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)
58 SIG_PRI_TONE_RINGTONE = 0,
60 SIG_PRI_TONE_CONGESTION,
61 SIG_PRI_TONE_DIALTONE,
62 SIG_PRI_TONE_DIALRECALL,
78 #if defined(HAVE_PRI_CALL_HOLD)
91 #if defined(HAVE_PRI_CALL_HOLD)
117 #if defined(HAVE_PRI_CALL_HOLD)
178 void (*
const unlock_private)(
void *pvt);
180 void (*
const lock_private)(
void *pvt);
182 void (*
const deadlock_avoidance_private)(
void *pvt);
189 int (*
const play_tone)(
void *pvt,
enum sig_pri_tone tone);
191 int (*
const set_echocanceller)(
void *pvt,
int enable);
192 int (*
const train_echocanceller)(
void *pvt);
193 int (*
const dsp_reset_and_flush_digits)(
void *pvt);
199 void (*
const fixup_chans)(
void *old_chan,
void *new_chan);
202 void (*
const handle_dchan_exception)(
struct sig_pri_span *
pri,
int index);
203 void (*
const set_alarm)(
void *pvt,
int in_alarm);
204 void (*
const set_dialing)(
void *pvt,
int is_dialing);
205 void (*
const set_digital)(
void *pvt,
int is_digital);
206 void (*
const set_outgoing)(
void *pvt,
int is_outgoing);
207 void (*
const set_callerid)(
void *pvt,
const struct ast_party_caller *caller);
208 void (*
const set_dnid)(
void *pvt,
const char *dnid);
209 void (*
const set_rdnis)(
void *pvt,
const char *rdnis);
210 void (*
const queue_control)(
void *pvt,
int subclass);
213 const char *(*
const get_orig_dialstring)(
void *pvt);
214 void (*
const make_cc_dialstring)(
void *pvt,
char *buf,
size_t buf_size);
216 void (*
const dial_digits)(
void *pvt,
const char *dial_string);
218 void (*
const open_media)(
void *pvt);
239 #define SIG_PRI_NUM_DCHANS 4
240 #define SIG_PRI_MAX_CHANNELS 672
242 #define SIG_PRI DAHDI_SIG_CLEAR
243 #define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR)
244 #define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR)
247 #define DAHDI_CHAN_MAPPING_PHYSICAL 0
248 #define DAHDI_CHAN_MAPPING_LOGICAL 1
251 #define DAHDI_OVERLAPDIAL_NONE 0
252 #define DAHDI_OVERLAPDIAL_OUTGOING 1
253 #define DAHDI_OVERLAPDIAL_INCOMING 2
254 #define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
256 #if defined(HAVE_PRI_SERVICE_MESSAGES)
258 #define SRVST_DBKEY "service-state"
260 #define SRVST_TYPE_OOS "O"
266 #define SRVST_INITIALIZED 0
268 #define SRVST_NEAREND (1 << 0)
270 #define SRVST_FAREND (1 << 1)
272 #define SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND)
280 unsigned int hidecallerid:1;
284 unsigned int priindication_oob:1;
307 #if defined(HAVE_PRI_SETUP_KEYPAD)
317 #if defined(HAVE_PRI_AOC_EVENTS)
318 struct pri_subcmd_aoc_e aoc_e;
324 unsigned int inalarm:1;
341 unsigned int digital:1;
344 #if defined(HAVE_PRI_CALL_WAITING)
348 #if defined(HAVE_PRI_SETUP_ACK_INBAND)
362 #if defined(HAVE_PRI_TRANSFER)
369 #if defined(HAVE_PRI_SERVICE_MESSAGES)
375 #if defined(HAVE_PRI_REVERSE_CHARGE)
387 #if defined(HAVE_PRI_MWI)
389 #define SIG_PRI_MAX_MWI_MAILBOXES 8
391 #define SIG_PRI_MAX_MWI_VM_NUMBER_LEN 10
393 #define SIG_PRI_MAX_MWI_MBOX_NUMBER_LEN 10
395 #define SIG_PRI_MAX_MWI_CONTEXT_LEN 10
402 #define SIG_PRI_MAX_MWI_VM_NUMBER_STR (SIG_PRI_MAX_MWI_MAILBOXES \
403 * (SIG_PRI_MAX_MWI_VM_NUMBER_LEN + 1))
409 #define SIG_PRI_MAX_MWI_VM_MAILBOX (SIG_PRI_MAX_MWI_MBOX_NUMBER_LEN \
410 + 1 + SIG_PRI_MAX_MWI_CONTEXT_LEN)
417 #define SIG_PRI_MAX_MWI_MAILBOX_STR (SIG_PRI_MAX_MWI_MAILBOXES \
418 * (SIG_PRI_MAX_MWI_VM_MAILBOX + 1))
447 int pritimers[PRI_MAX_TIMERS];
452 #if defined(HAVE_PRI_L2_PERSISTENCE)
459 #if defined(HAVE_PRI_AOC_EVENTS)
464 #if defined(HAVE_PRI_SERVICE_MESSAGES)
467 #ifdef HAVE_PRI_INBANDDISCONNECT
470 #if defined(HAVE_PRI_CALL_HOLD)
479 #if defined(HAVE_PRI_CALL_WAITING)
494 #if defined(HAVE_PRI_MCID)
500 #if defined(HAVE_PRI_DATETIME_SEND)
516 #if defined(HAVE_PRI_DISPLAY_TEXT)
520 #if defined(HAVE_PRI_MWI)
559 #if defined(HAVE_PRI_CCSS)
564 #if defined(HAVE_PRI_CALL_WAITING)
572 unsigned int hidecallerid:1;
576 unsigned int priindication_oob:1;
628 #if defined(THRESHOLD_DEVSTATE_PLACEHOLDER)
642 int threshold_devstate;
647 int user_busy_threshold;
656 int sig_pri_indicate(
struct sig_pri_chan *p,
struct ast_channel *chan,
int condition,
const void *data,
size_t datalen);
661 int sig_pri_available(
struct sig_pri_chan **pvt,
int is_specific_channel);
673 void sig_pri_set_alarm(
struct sig_pri_chan *p,
int in_alarm);
677 void pri_event_alarm(
struct sig_pri_span *pri,
int index,
int before_start_pri);
678 void pri_event_noalarm(
struct sig_pri_span *pri,
int index,
int before_start_pri);
692 void sig_pri_cli_show_channels_header(
int fd);
693 void sig_pri_cli_show_channels(
int fd,
struct sig_pri_span *pri);
694 void sig_pri_cli_show_spans(
int fd,
int span,
struct sig_pri_span *pri);
696 void sig_pri_cli_show_span(
int fd,
int *dchannels,
struct sig_pri_span *pri);
698 int pri_send_keypad_facility_exec(
struct sig_pri_chan *p,
const char *digits);
699 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);
701 #if defined(HAVE_PRI_SERVICE_MESSAGES)
702 int pri_maintenance_bservice(
struct pri *pri,
struct sig_pri_chan *p,
int changestatus);
706 #if defined(HAVE_PRI_DISPLAY_TEXT)
int aoc_s_request_invoke_id
int max_call_waiting_calls
Number of extra outgoing calls to allow on a span before considering that span congested.
void sig_pri_unload(void)
Unload the sig_pri submodule.
int sig_pri_cc_monitor_unsuspend(struct ast_cc_monitor *monitor)
Unsuspend monitoring.
void sig_pri_chan_alarm_notify(struct sig_pri_chan *p, int noalarm)
Notify new alarm status.
int dchan_logical_span[SIG_PRI_NUM_DCHANS]
char user_tag[AST_MAX_EXTENSION *2]
User tag for party id's sent from this device driver.
Main Channel structure associated with a channel.
unsigned long display_flags_send
int sig_pri_cc_agent_party_b_free(struct ast_cc_agent *agent)
Let the caller know that the callee has become free but that the caller cannot attempt to call back b...
ast_device_state
Device States.
unsigned int alreadyhungup
unsigned int priexclusive
void sig_pri_sendtext(struct sig_pri_chan *pchan, const char *text)
Send display text.
char keypad_digits[AST_MAX_EXTENSION]
Keypad digits that came in with the SETUP message.
int cc_qsig_signaling_link_req
int congestion_devstate
Congestion device state of the span.
int reverse_charging_indication
Reverse charging indication.
static const char dahdi_db[]
The AstDB family.
unsigned int use_callingpres
const char * vm_box
Mailbox number sent to span.
unsigned int use_callerid
char idleext[AST_MAX_EXTENSION]
unsigned int hold_disconnect_transfer
TRUE if held calls are transferred on disconnect.
int sig_pri_cc_agent_stop_offer_timer(struct ast_cc_agent *agent)
Stop the offer timer.
char mwi_vm_boxes[SIG_PRI_MAX_MWI_VM_NUMBER_STR]
Comma separated list of mailbox numbers sent over ISDN span for MWI.
unsigned int transfer
TRUE if call transfer is enabled for the span.
struct sig_pri_callback sig_pri_callbacks
unsigned int allow_call_waiting_calls
TRUE if we will allow incoming ISDN call waiting calls.
int sig_pri_cc_monitor_req_cc(struct ast_cc_monitor *monitor, int *available_timer_id)
Request CCSS.
int sig_pri_cc_monitor_suspend(struct ast_cc_monitor *monitor)
Suspend monitoring.
char idlecontext[AST_MAX_CONTEXT]
const char * vm_number
Voicemail access controlling number sent to span.
#define SIG_PRI_MAX_MWI_MAILBOXES
unsigned int mcid_send
TRUE if allow sending MCID request on this span.
struct ast_cc_config_params * cc_params
unsigned int aoc_s_request_invoke_id_valid
unsigned int hidecalleridname
Structure to pass both assignedid values to channel drivers.
unsigned int enable_service_message_support
unsigned int aoce_delayhangup
ast_channel_state
ast_channel states
enum sig_pri_reset_state resetting
Channel reset/restart state.
unsigned int no_b_channel
TRUE if this interface has no B channel. (call hold and call waiting)
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)
Output AMI show spans response events for the given PRI span.
unsigned short transfercapability
ast_cc_agent_response_reason
int dchanavail[SIG_PRI_NUM_DCHANS]
unsigned service_status
Active SRVST_DBKEY out-of-service status value.
char mwi_vm_numbers[SIG_PRI_MAX_MWI_VM_NUMBER_STR]
Comma separated list of voicemail access controlling numbers for MWI.
enum sig_pri_colp_signaling colp_send
unsigned int inband_on_setup_ack
void sig_pri_extract_called_num_subaddr(struct sig_pri_chan *p, const char *rdest, char *called, size_t called_buff_size)
Extract the called number and subaddress from the dial string.
unsigned int no_d_channels
void(* destroy_later)(struct sig_pri_span *pri)
int cc_qsig_signaling_link_rsp
#define SIG_PRI_MAX_MWI_MAILBOX_STR
Maximum mwi_mailboxs string length.
int sig_pri_cc_monitor_cancel_available_timer(struct ast_cc_monitor *monitor, int *sched_id)
Cancel the running available timer.
struct sig_pri_mbox mbox[SIG_PRI_MAX_MWI_MAILBOXES]
Active MWI mailboxes.
struct ast_mwi_subscriber * sub
MWI mailbox event subscription.
General Asterisk PBX channel definitions.
unsigned int inband_on_proceeding
int sig_pri_cc_agent_stop_ringing(struct ast_cc_agent *agent)
Request for an agent's phone to stop ringing.
enum sig_pri_call_level call_level
#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 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.
char internationalprefix[10]
The channel is being RESTARTed.
const char * uniqueid
Mailbox uniqueid.
void(*const ami_channel_event)(void *pvt, struct ast_channel *chan)
Post an AMI B channel association event.
unsigned int holding_aoce
#define SIG_PRI_MAX_MWI_VM_NUMBER_STR
Maximum mwi_vm_numbers and mwi_vm_boxes string length.
void sig_pri_chan_delete(struct sig_pri_chan *doomed)
Delete the sig_pri private channel structure.
unsigned int use_callingpres
struct xfer_rsp_data * xfer_data
char moh_suggested[MAX_MUSICCLASS]
int sig_pri_cc_agent_init(struct ast_cc_agent *agent, struct sig_pri_chan *pvt_chan)
PRI CC agent initialization.
int sig_pri_cc_monitor_status_rsp(struct ast_cc_monitor *monitor, enum ast_device_state devstate)
Status response to an ast_cc_monitor_status_request().
unsigned int force_restart_unavailable_chans
TRUE if forcing RESTART when receive cause 44 on this span.
unsigned int inbanddisconnect
#define SIG_PRI_NUM_DCHANS
struct sig_pri_chan * pvts[SIG_PRI_MAX_CHANNELS]
char idledial[AST_MAX_EXTENSION]
unsigned long display_flags_receive
unsigned int hidecalleridname
unsigned int append_msn_to_user_tag
char initial_user_tag[AST_MAX_EXTENSION]
Initial user tag for party id's sent from this device driver.
char mwi_mailboxes[SIG_PRI_MAX_MWI_MAILBOX_STR]
Comma separated list of mailboxes to indicate MWI.
Call Completion Supplementary Services API.
void sig_pri_cc_monitor_destructor(void *monitor_pvt)
Destroy PRI private data on the monitor.
char msn_list[AST_MAX_EXTENSION]
char deferred_digits[AST_MAX_EXTENSION]
int sig_pri_cc_agent_start_monitoring(struct ast_cc_agent *agent)
Begin monitoring a busy device.
int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, const char *rdest, int timeout, int layer1)
unsigned int is_call_waiting
TRUE if this is a call waiting call.
void sig_pri_stop_pri(struct sig_pri_span *pri)
Stop PRI span.
unsigned int priexclusive
#define SIG_PRI_MAX_CHANNELS
Peer may not be sending the expected RESTART ACKNOWLEDGE.
int num_call_waiting_calls
Number of outstanding call waiting calls.
void sig_pri_cc_agent_destructor(struct ast_cc_agent *agent)
Destroy private data on the agent.
int discardremoteholdretrieval
void sig_pri_dial_complete(struct sig_pri_chan *pvt, struct ast_channel *ast)
DTMF dial string complete.
unsigned int use_callerid
unsigned int layer1_ignored
int sig_pri_is_chan_available(struct sig_pri_chan *pvt)
Determine if a private channel structure is available.
int sig_pri_cc_agent_start_offer_timer(struct ast_cc_agent *agent)
Start the offer timer.
int sig_pri_load(const char *cc_type_name)
Load the sig_pri submodule.
unsigned int allocated
TRUE when this channel is allocated.
struct pri * dchans[SIG_PRI_NUM_DCHANS]
unsigned int no_dialed_digits
void(* module_unref)(void)
void sig_pri_cc_agent_req_rsp(struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)
Response to a CC request.
int datetime_send
Configured date/time ie send policy option.
unsigned int waiting_for_aoce
int sig_pri_is_alarm_ignored(struct sig_pri_span *pri)
Determine if layer 1 alarms are ignored.
int sig_pri_cc_agent_callee_available(struct ast_cc_agent *agent)
Alert the caller that it is time to try recalling.
char exten[AST_MAX_EXTENSION]
Structure for mutex and tracking information.
int fds[SIG_PRI_NUM_DCHANS]
int sig_pri_cc_agent_status_req(struct ast_cc_agent *agent)
Request the status of the agent's device.