32 #include <dahdi/user.h> 34 #if defined(HAVE_PRI_CCSS) 36 #define SIG_PRI_DEBUG_NORMAL \ 37 (PRI_DEBUG_APDU | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE | PRI_DEBUG_CC) 41 #define SIG_PRI_DEBUG_NORMAL \ 42 (PRI_DEBUG_APDU | PRI_DEBUG_Q931_STATE | PRI_DEBUG_Q921_STATE) 47 #define SIG_PRI_DEBUG_DEFAULT (SIG_PRI_DEBUG_NORMAL | PRI_DEBUG_Q931_DUMP) 50 #define SIG_PRI_DEBUG_DEFAULT 0 53 #define SIG_PRI_AOC_GRANT_S (1 << 0) 54 #define SIG_PRI_AOC_GRANT_D (1 << 1) 55 #define SIG_PRI_AOC_GRANT_E (1 << 2) 78 #if defined(HAVE_PRI_CALL_HOLD) 80 SIG_PRI_MOH_SIGNALING_HOLD,
91 #if defined(HAVE_PRI_CALL_HOLD) 93 SIG_PRI_MOH_STATE_HOLD_REQ,
95 SIG_PRI_MOH_STATE_PEND_UNHOLD,
97 SIG_PRI_MOH_STATE_HOLD,
99 SIG_PRI_MOH_STATE_RETRIEVE_REQ,
101 SIG_PRI_MOH_STATE_PEND_HOLD,
103 SIG_PRI_MOH_STATE_RETRIEVE_FAIL,
117 #if defined(HAVE_PRI_CALL_HOLD) 119 SIG_PRI_MOH_EVENT_HOLD_ACK,
121 SIG_PRI_MOH_EVENT_HOLD_REJ,
123 SIG_PRI_MOH_EVENT_RETRIEVE_ACK,
125 SIG_PRI_MOH_EVENT_RETRIEVE_REJ,
127 SIG_PRI_MOH_EVENT_REMOTE_RETRIEVE_ACK,
174 struct xfer_rsp_data;
208 void (*
const set_dnid)(
void *pvt,
const char *dnid);
241 #define SIG_PRI_NUM_DCHANS 4 242 #define SIG_PRI_MAX_CHANNELS 672 244 #define SIG_PRI DAHDI_SIG_CLEAR 245 #define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR) 246 #define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR) 249 #define DAHDI_CHAN_MAPPING_PHYSICAL 0 250 #define DAHDI_CHAN_MAPPING_LOGICAL 1 253 #define DAHDI_OVERLAPDIAL_NONE 0 254 #define DAHDI_OVERLAPDIAL_OUTGOING 1 255 #define DAHDI_OVERLAPDIAL_INCOMING 2 256 #define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING) 258 #if defined(HAVE_PRI_SERVICE_MESSAGES) 260 #define SRVST_DBKEY "service-state" 262 #define SRVST_TYPE_OOS "O" 268 #define SRVST_INITIALIZED 0 270 #define SRVST_NEAREND (1 << 0) 272 #define SRVST_FAREND (1 << 1) 274 #define SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND) 277 static const char dahdi_db[] =
"dahdi/registry";
309 #if defined(HAVE_PRI_SETUP_KEYPAD) 319 #if defined(HAVE_PRI_AOC_EVENTS) 320 struct pri_subcmd_aoc_e aoc_e;
321 int aoc_s_request_invoke_id;
322 unsigned int aoc_s_request_invoke_id_valid:1;
323 unsigned int waiting_for_aoce:1;
324 unsigned int holding_aoce:1;
346 #if defined(HAVE_PRI_CALL_WAITING) 348 unsigned int is_call_waiting:1;
350 #if defined(HAVE_PRI_SETUP_ACK_INBAND) 352 unsigned int no_dialed_digits:1;
364 #if defined(HAVE_PRI_TRANSFER) 366 struct xfer_rsp_data *xfer_data;
371 #if defined(HAVE_PRI_SERVICE_MESSAGES) 373 unsigned service_status;
377 #if defined(HAVE_PRI_REVERSE_CHARGE) 385 int reverse_charging_indication;
389 #if defined(HAVE_PRI_MWI) 391 #define SIG_PRI_MAX_MWI_MAILBOXES 8 393 #define SIG_PRI_MAX_MWI_VM_NUMBER_LEN 10 395 #define SIG_PRI_MAX_MWI_MBOX_NUMBER_LEN 10 397 #define SIG_PRI_MAX_MWI_CONTEXT_LEN 10 404 #define SIG_PRI_MAX_MWI_VM_NUMBER_STR (SIG_PRI_MAX_MWI_MAILBOXES \ 405 * (SIG_PRI_MAX_MWI_VM_NUMBER_LEN + 1)) 411 #define SIG_PRI_MAX_MWI_VM_MAILBOX (SIG_PRI_MAX_MWI_MBOX_NUMBER_LEN \ 412 + 1 + SIG_PRI_MAX_MWI_CONTEXT_LEN) 419 #define SIG_PRI_MAX_MWI_MAILBOX_STR (SIG_PRI_MAX_MWI_MAILBOXES \ 420 * (SIG_PRI_MAX_MWI_VM_MAILBOX + 1)) 422 struct sig_pri_mbox {
429 const char *uniqueid;
433 const char *vm_number;
449 int pritimers[PRI_MAX_TIMERS];
454 #if defined(HAVE_PRI_L2_PERSISTENCE) 461 #if defined(HAVE_PRI_AOC_EVENTS) 462 int aoc_passthrough_flag;
463 unsigned int aoce_delayhangup:1;
466 #if defined(HAVE_PRI_SERVICE_MESSAGES) 467 unsigned int enable_service_message_support:1;
469 #ifdef HAVE_PRI_INBANDDISCONNECT 470 unsigned int inbanddisconnect:1;
472 #if defined(HAVE_PRI_CALL_HOLD) 474 unsigned int hold_disconnect_transfer:1;
481 #if defined(HAVE_PRI_CALL_WAITING) 483 unsigned int allow_call_waiting_calls:1;
496 #if defined(HAVE_PRI_MCID) 498 unsigned int mcid_send:1;
502 #if defined(HAVE_PRI_DATETIME_SEND) 509 char internationalprefix[10];
510 char nationalprefix[10];
511 char localprefix[20];
512 char privateprefix[20];
513 char unknownprefix[20];
518 #if defined(HAVE_PRI_DISPLAY_TEXT) 519 unsigned long display_flags_send;
520 unsigned long display_flags_receive;
522 #if defined(HAVE_PRI_MWI) 524 struct sig_pri_mbox
mbox[SIG_PRI_MAX_MWI_MAILBOXES];
531 char mwi_mailboxes[SIG_PRI_MAX_MWI_MAILBOX_STR];
538 char mwi_vm_boxes[SIG_PRI_MAX_MWI_VM_NUMBER_STR];
544 char mwi_vm_numbers[SIG_PRI_MAX_MWI_VM_NUMBER_STR];
561 #if defined(HAVE_PRI_CCSS) 562 int cc_ptmp_recall_mode;
563 int cc_qsig_signaling_link_req;
564 int cc_qsig_signaling_link_rsp;
566 #if defined(HAVE_PRI_CALL_WAITING) 571 int max_call_waiting_calls;
574 unsigned int hidecallerid:1;
575 unsigned int hidecalleridname:1;
577 unsigned int priexclusive:1;
578 unsigned int priindication_oob:1;
579 unsigned int use_callerid:1;
580 unsigned int use_callingpres:1;
590 int num_call_waiting_calls;
630 #if defined(THRESHOLD_DEVSTATE_PLACEHOLDER) 644 int threshold_devstate;
649 int user_busy_threshold;
684 int transfercapability);
703 #if defined(HAVE_PRI_SERVICE_MESSAGES) 704 int pri_maintenance_bservice(
struct pri *pri,
struct sig_pri_chan *p,
int changestatus);
708 #if defined(HAVE_PRI_DISPLAY_TEXT) void(*const lock_private)(void *pvt)
void sig_pri_unload(void)
int sig_pri_cc_monitor_unsuspend(struct ast_cc_monitor *monitor)
void sig_pri_chan_alarm_notify(struct sig_pri_chan *p, int noalarm)
static char mohinterpret[MAX_MUSICCLASS]
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
int sig_pri_cc_agent_party_b_free(struct ast_cc_agent *agent)
ast_device_state
Device States.
unsigned int alreadyhungup
int sig_pri_available(struct sig_pri_chan **pvt, int is_specific_channel)
unsigned int priexclusive
int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condition, const void *data, size_t datalen)
int congestion_devstate
Congestion device state of the span.
unsigned int use_callingpres
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(*const init_config)(void *pvt, struct sig_pri_span *pri)
void sig_pri_cli_show_channels(int fd, struct sig_pri_span *pri)
void sig_pri_cli_show_channels_header(int fd)
unsigned int priindication_oob
unsigned int use_callerid
void pri_event_alarm(struct sig_pri_span *pri, int index, int before_start_pri)
int sig_pri_cc_agent_stop_offer_timer(struct ast_cc_agent *agent)
unsigned int transfer
TRUE if call transfer is enabled for the span.
struct sig_pri_callback sig_pri_callbacks
int sig_pri_cc_monitor_req_cc(struct ast_cc_monitor *monitor, int *available_timer_id)
int sig_pri_cc_monitor_suspend(struct ast_cc_monitor *monitor)
struct ast_channel * owner
void(*const set_rdnis)(void *pvt, const char *rdnis)
struct ast_cc_config_params * cc_params
Structure to pass both assignedid values to channel drivers.
void(*const deadlock_avoidance_private)(void *pvt)
void(*const set_dialing)(void *pvt, int is_dialing)
ast_channel_state
ast_channel states
int(*const train_echocanceller)(void *pvt)
unsigned int no_b_channel
TRUE if this interface has no B channel. (call hold and call waiting)
void(*const set_callerid)(void *pvt, const struct ast_party_caller *caller)
The channel is not being RESTARTed.
int sig_pri_ami_show_spans(struct mansession *s, const char *show_cmd, struct sig_pri_span *pri, const int *dchannels, const char *action_id)
void(*const fixup_chans)(void *old_chan, void *new_chan)
ast_cc_agent_response_reason
void(*const dial_digits)(void *pvt, const char *dial_string)
unsigned int inband_on_setup_ack
static char cid_num[AST_MAX_EXTENSION]
void sig_pri_extract_called_num_subaddr(struct sig_pri_chan *p, const char *rdest, char *called, size_t called_buff_size)
void(*const unlock_private)(void *pvt)
unsigned int no_d_channels
int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
static const char * mbox(struct ast_vm_user *vmu, int id)
int pri_send_keypad_facility_exec(struct sig_pri_chan *p, const char *digits)
void(* destroy_later)(struct sig_pri_span *pri)
void(*const open_media)(void *pvt)
void sig_pri_init_pri(struct sig_pri_span *pri)
int(*const play_tone)(void *pvt, enum sig_pri_tone tone)
int sig_pri_cc_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, int *sched_id)
General Asterisk PBX channel definitions.
unsigned int inband_on_proceeding
int sig_pri_cc_agent_stop_ringing(struct ast_cc_agent *agent)
void(*const handle_dchan_exception)(struct sig_pri_span *pri, int index)
#define AST_MAX_EXTENSION
Caller Party information.
Asterisk internal frame definitions.
In case you didn't read that giant block of text above the mansession_session struct, the struct mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data.
The channel is being RESTARTed.
static struct ao2_container * pvts
void(*const ami_channel_event)(void *pvt, struct ast_channel *chan)
Post an AMI B channel association event.
void sig_pri_chan_delete(struct sig_pri_chan *doomed)
int(*const set_echocanceller)(void *pvt, int enable)
int(*const dsp_reset_and_flush_digits)(void *pvt)
int sig_pri_cc_agent_init(struct ast_cc_agent *agent, struct sig_pri_chan *pvt_chan)
int(*const new_nobch_intf)(struct sig_pri_span *pri)
int sig_pri_cc_monitor_status_rsp(struct ast_cc_monitor *monitor, enum ast_device_state devstate)
unsigned int force_restart_unavailable_chans
TRUE if forcing RESTART when receive cause 44 on this span.
static unsigned int monitor
#define SIG_PRI_NUM_DCHANS
void(*const set_digital)(void *pvt, int is_digital)
void sig_pri_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan)
unsigned int hidecalleridname
struct ast_channel *(*const new_ast_channel)(void *pvt, int state, enum sig_pri_law law, char *exten, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
unsigned int append_msn_to_user_tag
void sig_pri_set_alarm(struct sig_pri_chan *p, int in_alarm)
Call Completion Supplementary Services API.
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)
void sig_pri_cc_monitor_destructor(void *monitor_pvt)
int sig_pri_start_pri(struct sig_pri_span *pri)
int sig_pri_cc_agent_start_monitoring(struct ast_cc_agent *agent)
void(*const set_alarm)(void *pvt, int in_alarm)
static char cid_name[AST_MAX_EXTENSION]
int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, const char *rdest, int timeout, int layer1)
void(*const set_dnid)(void *pvt, const char *dnid)
unsigned int hidecallerid
int sig_pri_answer(struct sig_pri_chan *p, struct ast_channel *ast)
struct ast_channel * sig_pri_request(struct sig_pri_chan *p, enum sig_pri_law law, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, int transfercapability)
void sig_pri_stop_pri(struct sig_pri_span *pri)
#define SIG_PRI_MAX_CHANNELS
Peer may not be sending the expected RESTART ACKNOWLEDGE.
void(*const update_span_devstate)(struct sig_pri_span *pri)
int sig_pri_digit_begin(struct sig_pri_chan *pvt, struct ast_channel *ast, char digit)
void sig_pri_cc_agent_destructor(struct ast_cc_agent *agent)
int discardremoteholdretrieval
void sig_pri_dial_complete(struct sig_pri_chan *pvt, struct ast_channel *ast)
struct stasis_forward * sub
void(*const make_cc_dialstring)(void *pvt, char *buf, size_t buf_size)
struct sig_pri_span * pri
unsigned int layer1_ignored
int sig_pri_is_chan_available(struct sig_pri_chan *pvt)
void(*const set_outgoing)(void *pvt, int is_outgoing)
static char context[AST_MAX_CONTEXT]
int sig_pri_cc_agent_start_offer_timer(struct ast_cc_agent *agent)
int sig_pri_load(const char *cc_type_name)
struct sig_pri_chan * sig_pri_chan_new(void *pvt_data, struct sig_pri_span *pri, int logicalspan, int channo, int trunkgroup)
const char *(*const get_orig_dialstring)(void *pvt)
unsigned int allocated
TRUE when this channel is allocated.
void(* module_unref)(void)
void sig_pri_cc_agent_req_rsp(struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)
int sig_pri_is_alarm_ignored(struct sig_pri_span *pri)
int sig_pri_cc_agent_callee_available(struct ast_cc_agent *agent)
int pri_is_up(struct sig_pri_span *pri)
void(*const queue_control)(void *pvt, int subclass)
Structure for mutex and tracking information.
void pri_event_noalarm(struct sig_pri_span *pri, int index, int before_start_pri)
int sig_pri_cc_agent_status_req(struct ast_cc_agent *agent)