Wed Aug 7 17:16:13 2019

Asterisk developer's documentation


sig_pri.h File Reference

Interface header for PRI signaling module. More...

#include "asterisk/channel.h"
#include "asterisk/frame.h"
#include "asterisk/event.h"
#include "asterisk/ccss.h"
#include <libpri.h>
#include <dahdi/user.h>

Go to the source code of this file.

Data Structures

struct  sig_pri_callback
struct  sig_pri_chan
struct  sig_pri_span

Defines

#define DAHDI_CHAN_MAPPING_LOGICAL   1
#define DAHDI_CHAN_MAPPING_PHYSICAL   0
#define DAHDI_OVERLAPDIAL_BOTH   (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
#define DAHDI_OVERLAPDIAL_INCOMING   2
#define DAHDI_OVERLAPDIAL_NONE   0
#define DAHDI_OVERLAPDIAL_OUTGOING   1
#define SIG_BRI   (0x2000000 | DAHDI_SIG_CLEAR)
#define SIG_BRI_PTMP   (0X4000000 | DAHDI_SIG_CLEAR)
#define SIG_PRI   DAHDI_SIG_CLEAR
#define SIG_PRI_AOC_GRANT_D   (1 << 1)
#define SIG_PRI_AOC_GRANT_E   (1 << 2)
#define SIG_PRI_AOC_GRANT_S   (1 << 0)
#define SIG_PRI_DEBUG_DEFAULT   0
#define SIG_PRI_DEBUG_INTENSE
#define SIG_PRI_DEBUG_NORMAL   (PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE)
#define SIG_PRI_MAX_CHANNELS   672
#define SIG_PRI_NUM_DCHANS   4

Enumerations

enum  sig_pri_call_level {
  SIG_PRI_CALL_LEVEL_IDLE, SIG_PRI_CALL_LEVEL_SETUP, SIG_PRI_CALL_LEVEL_OVERLAP, SIG_PRI_CALL_LEVEL_PROCEEDING,
  SIG_PRI_CALL_LEVEL_ALERTING, SIG_PRI_CALL_LEVEL_DEFER_DIAL, SIG_PRI_CALL_LEVEL_CONNECT
}
enum  sig_pri_law { SIG_PRI_DEFLAW = 0, SIG_PRI_ULAW, SIG_PRI_ALAW }
enum  sig_pri_reset_state { SIG_PRI_RESET_IDLE, SIG_PRI_RESET_ACTIVE, SIG_PRI_RESET_NO_ACK }
enum  sig_pri_tone {
  SIG_PRI_TONE_RINGTONE = 0, SIG_PRI_TONE_STUTTER, SIG_PRI_TONE_CONGESTION, SIG_PRI_TONE_DIALTONE,
  SIG_PRI_TONE_DIALRECALL, SIG_PRI_TONE_INFO, SIG_PRI_TONE_BUSY
}

Functions

void pri_event_alarm (struct sig_pri_span *pri, int index, int before_start_pri)
void pri_event_noalarm (struct sig_pri_span *pri, int index, int before_start_pri)
int pri_is_up (struct sig_pri_span *pri)
int pri_send_callrerouting_facility_exec (struct sig_pri_chan *p, enum ast_channel_state chanstate, const char *destination, const char *original, const char *reason)
int pri_send_keypad_facility_exec (struct sig_pri_chan *p, const char *digits)
int sig_pri_answer (struct sig_pri_chan *p, struct ast_channel *ast)
int sig_pri_available (struct sig_pri_chan **pvt, int is_specific_channel)
int sig_pri_call (struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, int timeout, int layer1)
int sig_pri_cc_agent_callee_available (struct ast_cc_agent *agent)
void sig_pri_cc_agent_destructor (struct ast_cc_agent *agent)
int sig_pri_cc_agent_init (struct ast_cc_agent *agent, struct sig_pri_chan *pvt_chan)
int sig_pri_cc_agent_party_b_free (struct ast_cc_agent *agent)
void sig_pri_cc_agent_req_rsp (struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)
int sig_pri_cc_agent_start_monitoring (struct ast_cc_agent *agent)
int sig_pri_cc_agent_start_offer_timer (struct ast_cc_agent *agent)
int sig_pri_cc_agent_status_req (struct ast_cc_agent *agent)
int sig_pri_cc_agent_stop_offer_timer (struct ast_cc_agent *agent)
int sig_pri_cc_agent_stop_ringing (struct ast_cc_agent *agent)
int sig_pri_cc_monitor_cancel_available_timer (struct ast_cc_monitor *monitor, int *sched_id)
void sig_pri_cc_monitor_destructor (void *monitor_pvt)
int sig_pri_cc_monitor_req_cc (struct ast_cc_monitor *monitor, int *available_timer_id)
int sig_pri_cc_monitor_status_rsp (struct ast_cc_monitor *monitor, enum ast_device_state devstate)
int sig_pri_cc_monitor_suspend (struct ast_cc_monitor *monitor)
int sig_pri_cc_monitor_unsuspend (struct ast_cc_monitor *monitor)
void sig_pri_chan_alarm_notify (struct sig_pri_chan *p, int noalarm)
void sig_pri_chan_delete (struct sig_pri_chan *doomed)
struct sig_pri_chansig_pri_chan_new (void *pvt_data, struct sig_pri_callback *callback, struct sig_pri_span *pri, int logicalspan, int channo, int trunkgroup)
void sig_pri_cli_show_channels (int fd, struct sig_pri_span *pri)
void sig_pri_cli_show_channels_header (int fd)
void sig_pri_cli_show_span (int fd, int *dchannels, struct sig_pri_span *pri)
void sig_pri_cli_show_spans (int fd, int span, struct sig_pri_span *pri)
void sig_pri_dial_complete (struct sig_pri_chan *pvt, struct ast_channel *ast)
int sig_pri_digit_begin (struct sig_pri_chan *pvt, struct ast_channel *ast, char digit)
void sig_pri_extract_called_num_subaddr (struct sig_pri_chan *p, const char *rdest, char *called, size_t called_buff_size)
void sig_pri_fixup (struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan)
int sig_pri_hangup (struct sig_pri_chan *p, struct ast_channel *ast)
int sig_pri_indicate (struct sig_pri_chan *p, struct ast_channel *chan, int condition, const void *data, size_t datalen)
void sig_pri_init_pri (struct sig_pri_span *pri)
int sig_pri_is_alarm_ignored (struct sig_pri_span *pri)
int sig_pri_is_chan_available (struct sig_pri_chan *pvt)
int sig_pri_load (const char *cc_type_name)
struct ast_channelsig_pri_request (struct sig_pri_chan *p, enum sig_pri_law law, const struct ast_channel *requestor, int transfercapability)
void sig_pri_set_alarm (struct sig_pri_chan *p, int in_alarm)
int sig_pri_start_pri (struct sig_pri_span *pri)
void sig_pri_stop_pri (struct sig_pri_span *pri)
void sig_pri_unload (void)

Detailed Description

Interface header for PRI signaling module.

Author:
Matthew Fredrickson <creslin@digium.com>

Definition in file sig_pri.h.


Define Documentation

#define DAHDI_CHAN_MAPPING_LOGICAL   1

Definition at line 192 of file sig_pri.h.

Referenced by process_dahdi().

#define DAHDI_CHAN_MAPPING_PHYSICAL   0

Definition at line 191 of file sig_pri.h.

Referenced by dahdi_chan_conf_default(), and process_dahdi().

#define DAHDI_OVERLAPDIAL_BOTH   (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)

Definition at line 198 of file sig_pri.h.

Referenced by process_dahdi().

#define DAHDI_OVERLAPDIAL_INCOMING   2

Definition at line 197 of file sig_pri.h.

Referenced by dahdi_handle_event(), dahdi_read(), and process_dahdi().

#define DAHDI_OVERLAPDIAL_NONE   0

Definition at line 195 of file sig_pri.h.

Referenced by process_dahdi().

#define DAHDI_OVERLAPDIAL_OUTGOING   1

Definition at line 196 of file sig_pri.h.

Referenced by dahdi_read(), and process_dahdi().

#define SIG_BRI   (0x2000000 | DAHDI_SIG_CLEAR)

Definition at line 187 of file sig_pri.h.

#define SIG_BRI_PTMP   (0X4000000 | DAHDI_SIG_CLEAR)

Definition at line 188 of file sig_pri.h.

#define SIG_PRI   DAHDI_SIG_CLEAR

Definition at line 186 of file sig_pri.h.

#define SIG_PRI_AOC_GRANT_D   (1 << 1)

Definition at line 67 of file sig_pri.h.

Referenced by process_dahdi().

#define SIG_PRI_AOC_GRANT_E   (1 << 2)

Definition at line 68 of file sig_pri.h.

Referenced by process_dahdi().

#define SIG_PRI_AOC_GRANT_S   (1 << 0)

Definition at line 66 of file sig_pri.h.

Referenced by process_dahdi().

#define SIG_PRI_DEBUG_DEFAULT   0

PRI debug message flags set on initial startup.

Definition at line 63 of file sig_pri.h.

#define SIG_PRI_DEBUG_INTENSE
Value:
(PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE \
   | PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP)

PRI debug message flags when intense PRI debugging is turned on at the command line.

Definition at line 53 of file sig_pri.h.

#define SIG_PRI_DEBUG_NORMAL   (PRI_DEBUG_APDU | PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE)

PRI debug message flags when normal PRI debugging is turned on at the command line.

Definition at line 49 of file sig_pri.h.

#define SIG_PRI_MAX_CHANNELS   672

No more than a DS3 per trunk group

Definition at line 184 of file sig_pri.h.

#define SIG_PRI_NUM_DCHANS   4

No more than 4 d-channels

Definition at line 183 of file sig_pri.h.


Enumeration Type Documentation

Call establishment life cycle level for simple comparisons.

Enumerator:
SIG_PRI_CALL_LEVEL_IDLE 

Call does not exist.

SIG_PRI_CALL_LEVEL_SETUP 

Call is present but has no response yet. (SETUP)

SIG_PRI_CALL_LEVEL_OVERLAP 

Call is collecting digits for overlap dialing. (SETUP ACKNOWLEDGE)

SIG_PRI_CALL_LEVEL_PROCEEDING 

Call routing is happening. (PROCEEDING)

SIG_PRI_CALL_LEVEL_ALERTING 

Called party is being alerted of the call. (ALERTING)

SIG_PRI_CALL_LEVEL_DEFER_DIAL 

Call is dialing 'w' deferred digits. (CONNECT)

SIG_PRI_CALL_LEVEL_CONNECT 

Call is connected/answered. (CONNECT)

Definition at line 87 of file sig_pri.h.

00087                         {
00088    /*! Call does not exist. */
00089    SIG_PRI_CALL_LEVEL_IDLE,
00090    /*! Call is present but has no response yet. (SETUP) */
00091    SIG_PRI_CALL_LEVEL_SETUP,
00092    /*! Call is collecting digits for overlap dialing. (SETUP ACKNOWLEDGE) */
00093    SIG_PRI_CALL_LEVEL_OVERLAP,
00094    /*! Call routing is happening. (PROCEEDING) */
00095    SIG_PRI_CALL_LEVEL_PROCEEDING,
00096    /*! Called party is being alerted of the call. (ALERTING) */
00097    SIG_PRI_CALL_LEVEL_ALERTING,
00098    /*! Call is dialing 'w' deferred digits. (CONNECT) */
00099    SIG_PRI_CALL_LEVEL_DEFER_DIAL,
00100    /*! Call is connected/answered. (CONNECT) */
00101    SIG_PRI_CALL_LEVEL_CONNECT,
00102 };

Enumerator:
SIG_PRI_DEFLAW 
SIG_PRI_ULAW 
SIG_PRI_ALAW 

Definition at line 80 of file sig_pri.h.

00080                  {
00081    SIG_PRI_DEFLAW = 0,
00082    SIG_PRI_ULAW,
00083    SIG_PRI_ALAW
00084 };

Enumerator:
SIG_PRI_RESET_IDLE 

The channel is not being RESTARTed.

SIG_PRI_RESET_ACTIVE 

The channel is being RESTARTed.

Note:
Waiting for a RESTART ACKNOWLEDGE from the peer.
SIG_PRI_RESET_NO_ACK 

Peer may not be sending the expected RESTART ACKNOWLEDGE.

We have already received a SETUP on this channel. If another SETUP comes in on this channel then the peer considers this channel useable. Assume that the peer is never going to give us a RESTART ACKNOWLEDGE and assume that we have received one. This is not according to Q.931, but some peers occasionally fail to send a RESTART ACKNOWLEDGE.

Definition at line 104 of file sig_pri.h.

00104                          {
00105    /*! \brief The channel is not being RESTARTed. */
00106    SIG_PRI_RESET_IDLE,
00107    /*!
00108     * \brief The channel is being RESTARTed.
00109     * \note Waiting for a RESTART ACKNOWLEDGE from the peer.
00110     */
00111    SIG_PRI_RESET_ACTIVE,
00112    /*!
00113     * \brief Peer may not be sending the expected RESTART ACKNOWLEDGE.
00114     *
00115     * \details We have already received a SETUP on this channel.
00116     * If another SETUP comes in on this channel then the peer
00117     * considers this channel useable.  Assume that the peer is
00118     * never going to give us a RESTART ACKNOWLEDGE and assume that
00119     * we have received one.  This is not according to Q.931, but
00120     * some peers occasionally fail to send a RESTART ACKNOWLEDGE.
00121     */
00122    SIG_PRI_RESET_NO_ACK,
00123 };

Enumerator:
SIG_PRI_TONE_RINGTONE 
SIG_PRI_TONE_STUTTER 
SIG_PRI_TONE_CONGESTION 
SIG_PRI_TONE_DIALTONE 
SIG_PRI_TONE_DIALRECALL 
SIG_PRI_TONE_INFO 
SIG_PRI_TONE_BUSY 

Definition at line 70 of file sig_pri.h.


Function Documentation

void pri_event_alarm ( struct sig_pri_span pri,
int  index,
int  before_start_pri 
)
void pri_event_noalarm ( struct sig_pri_span pri,
int  index,
int  before_start_pri 
)
int pri_is_up ( struct sig_pri_span pri  ) 
int pri_send_callrerouting_facility_exec ( struct sig_pri_chan p,
enum ast_channel_state  chanstate,
const char *  destination,
const char *  original,
const char *  reason 
)
int pri_send_keypad_facility_exec ( struct sig_pri_chan p,
const char *  digits 
)
int sig_pri_answer ( struct sig_pri_chan p,
struct ast_channel ast 
)

Referenced by dahdi_answer().

int sig_pri_available ( struct sig_pri_chan **  pvt,
int  is_specific_channel 
)

Referenced by available().

int sig_pri_call ( struct sig_pri_chan p,
struct ast_channel ast,
char *  rdest,
int  timeout,
int  layer1 
)

Referenced by dahdi_call().

int sig_pri_cc_agent_callee_available ( struct ast_cc_agent agent  ) 
void sig_pri_cc_agent_destructor ( struct ast_cc_agent agent  ) 
int sig_pri_cc_agent_init ( struct ast_cc_agent agent,
struct sig_pri_chan pvt_chan 
)
int sig_pri_cc_agent_party_b_free ( struct ast_cc_agent agent  ) 
void sig_pri_cc_agent_req_rsp ( struct ast_cc_agent agent,
enum ast_cc_agent_response_reason  reason 
)
int sig_pri_cc_agent_start_monitoring ( struct ast_cc_agent agent  ) 
int sig_pri_cc_agent_start_offer_timer ( struct ast_cc_agent agent  ) 
int sig_pri_cc_agent_status_req ( struct ast_cc_agent agent  ) 
int sig_pri_cc_agent_stop_offer_timer ( struct ast_cc_agent agent  ) 
int sig_pri_cc_agent_stop_ringing ( struct ast_cc_agent agent  ) 
int sig_pri_cc_monitor_cancel_available_timer ( struct ast_cc_monitor monitor,
int *  sched_id 
)
void sig_pri_cc_monitor_destructor ( void *  monitor_pvt  ) 
int sig_pri_cc_monitor_req_cc ( struct ast_cc_monitor monitor,
int *  available_timer_id 
)
int sig_pri_cc_monitor_status_rsp ( struct ast_cc_monitor monitor,
enum ast_device_state  devstate 
)
int sig_pri_cc_monitor_suspend ( struct ast_cc_monitor monitor  ) 
int sig_pri_cc_monitor_unsuspend ( struct ast_cc_monitor monitor  ) 
void sig_pri_chan_alarm_notify ( struct sig_pri_chan p,
int  noalarm 
)
void sig_pri_chan_delete ( struct sig_pri_chan doomed  ) 

Referenced by destroy_dahdi_pvt().

struct sig_pri_chan* sig_pri_chan_new ( void *  pvt_data,
struct sig_pri_callback callback,
struct sig_pri_span pri,
int  logicalspan,
int  channo,
int  trunkgroup 
) [read]

Referenced by mkintf().

void sig_pri_cli_show_channels ( int  fd,
struct sig_pri_span pri 
)
void sig_pri_cli_show_channels_header ( int  fd  ) 
void sig_pri_cli_show_span ( int  fd,
int *  dchannels,
struct sig_pri_span pri 
)
void sig_pri_cli_show_spans ( int  fd,
int  span,
struct sig_pri_span pri 
)
void sig_pri_dial_complete ( struct sig_pri_chan pvt,
struct ast_channel ast 
)

Referenced by dahdi_handle_event().

int sig_pri_digit_begin ( struct sig_pri_chan pvt,
struct ast_channel ast,
char  digit 
)

Referenced by dahdi_digit_begin().

void sig_pri_extract_called_num_subaddr ( struct sig_pri_chan p,
const char *  rdest,
char *  called,
size_t  called_buff_size 
)

Referenced by dahdi_request().

void sig_pri_fixup ( struct ast_channel oldchan,
struct ast_channel newchan,
struct sig_pri_chan pchan 
)

Referenced by dahdi_fixup().

int sig_pri_hangup ( struct sig_pri_chan p,
struct ast_channel ast 
)

Referenced by dahdi_hangup().

int sig_pri_indicate ( struct sig_pri_chan p,
struct ast_channel chan,
int  condition,
const void *  data,
size_t  datalen 
)

Referenced by dahdi_indicate().

void sig_pri_init_pri ( struct sig_pri_span pri  ) 

Referenced by dahdi_restart(), and load_module().

int sig_pri_is_alarm_ignored ( struct sig_pri_span pri  ) 
int sig_pri_is_chan_available ( struct sig_pri_chan pvt  ) 
int sig_pri_load ( const char *  cc_type_name  ) 

Referenced by load_module().

struct ast_channel* sig_pri_request ( struct sig_pri_chan p,
enum sig_pri_law  law,
const struct ast_channel requestor,
int  transfercapability 
) [read]

Referenced by dahdi_request().

void sig_pri_set_alarm ( struct sig_pri_chan p,
int  in_alarm 
)

Referenced by mkintf().

int sig_pri_start_pri ( struct sig_pri_span pri  ) 

Referenced by setup_dahdi_int().

void sig_pri_stop_pri ( struct sig_pri_span pri  ) 

Referenced by __unload_module().

void sig_pri_unload ( void   ) 

Referenced by __unload_module().


Generated on 7 Aug 2019 for Asterisk - The Open Source Telephony Project by  doxygen 1.6.1