Asterisk - The Open Source Telephony Project
21.4.1
|
PRI signaling module. More...
#include "asterisk.h"
#include <errno.h>
#include <ctype.h>
#include <signal.h>
#include "asterisk/utils.h"
#include "asterisk/options.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/mwi.h"
#include "asterisk/file.h"
#include "asterisk/callerid.h"
#include "asterisk/say.h"
#include "asterisk/manager.h"
#include "asterisk/astdb.h"
#include "asterisk/causes.h"
#include "asterisk/musiconhold.h"
#include "asterisk/cli.h"
#include "asterisk/transcap.h"
#include "asterisk/features.h"
#include "asterisk/aoc.h"
#include "asterisk/bridge.h"
#include "asterisk/stasis_channels.h"
#include "sig_pri.h"
Go to the source code of this file.
Data Structures | |
struct | sig_pri_cc_agent_prv |
struct | sig_pri_cc_monitor_instance |
struct | xfer_rsp_data |
Typedefs | |
typedef enum sig_pri_moh_state(* | sig_pri_moh_fsm_state) (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
Functions | |
static void | apply_plan_to_existing_number (char *buf, size_t size, const struct sig_pri_span *pri, const char *number, int plan) |
static void | apply_plan_to_number (char *buf, size_t size, const struct sig_pri_span *pri, const char *number, int plan) |
static unsigned char | ast_pri_pack_hex_char (char c) |
static int | ast_pri_pack_hex_string (unsigned char *dst, char *src, int maxlen) |
static int | ast_to_pri_char_set (enum AST_PARTY_CHAR_SET ast_char_set) |
static int | ast_to_pri_presentation (int ast_presentation) |
static int | ast_to_pri_reason (enum AST_REDIRECTING_REASON ast_reason) |
static void | build_status (char *s, size_t len, int status, int active) |
static char * | dialplan2str (int dialplan) |
static void * | do_idle_thread (void *v_pvt) |
static ast_callid | func_pri_dchannel_chanpos_callid (struct sig_pri_span *pri, int chanpos) |
static ast_callid | func_pri_dchannel_new_callid (void) |
static struct ast_manager_event_blob * | mcid_to_ami (struct stasis_message *msg) |
static void | party_json_to_ami (struct ast_str **msg, const char *prefix, struct ast_json *party) |
static void | party_name_json_to_ami (struct ast_str **msg, const char *prefix, struct ast_json *name) |
static void | party_number_json_to_ami (struct ast_str **msg, const char *prefix, struct ast_json *number) |
static void | party_subaddress_json_to_ami (struct ast_str **msg, const char *prefix, struct ast_json *subaddress) |
static int | pri_active_dchan_index (struct sig_pri_span *pri) |
static void | pri_check_restart (struct sig_pri_span *pri) |
static void * | pri_dchannel (void *vpri) |
static void | pri_destroy_later (struct sig_pri_span *pri) |
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) |
static void | pri_find_dchan (struct sig_pri_span *pri) |
static int | pri_find_empty_chan (struct sig_pri_span *pri, int backwards) |
static int | pri_find_empty_nobch (struct sig_pri_span *pri) |
static int | pri_find_fixup_principle (struct sig_pri_span *pri, int channel, q931_call *call) |
static int | pri_find_principle (struct sig_pri_span *pri, int channel, q931_call *call) |
static int | pri_find_principle_by_call (struct sig_pri_span *pri, q931_call *call) |
static int | pri_fixup_principle (struct sig_pri_span *pri, int principle, q931_call *call) |
static void | pri_grab (struct sig_pri_chan *p, struct sig_pri_span *pri) |
int | pri_is_up (struct sig_pri_span *pri) |
int | pri_maintenance_bservice (struct pri *pri, struct sig_pri_chan *p, int changestatus) |
static const char * | pri_order (int level) |
static void | pri_queue_control (struct sig_pri_span *pri, int chanpos, int subclass) |
static void | pri_queue_frame (struct sig_pri_span *pri, int chanpos, struct ast_frame *frame) |
static void | pri_queue_pvt_cause_data (struct sig_pri_span *pri, int chanpos, const char *cause, int ast_cause) |
static void | pri_rel (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) |
static void * | pri_ss_thread (void *data) |
static enum AST_PARTY_CHAR_SET | pri_to_ast_char_set (int pri_char_set) |
static int | pri_to_ast_presentation (int pri_presentation) |
static enum AST_REDIRECTING_REASON | pri_to_ast_reason (int pri_reason) |
static unsigned int | PVT_TO_CHANNEL (struct sig_pri_chan *p) |
static char * | redirectingreason2str (int redirectingreason) |
static void | send_mcid (struct ast_channel *chan, struct ast_party_id *caller, struct ast_party_id *connected) |
static void | setup_incoming_channel (struct sig_pri_span *pri, int chanpos, pri_event *ev) |
static void | sig_pri_ami_channel_event (struct sig_pri_chan *p) |
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. More... | |
int | sig_pri_answer (struct sig_pri_chan *p, struct ast_channel *ast) |
static enum ast_aoc_s_charged_item | sig_pri_aoc_charged_item_to_ast (enum PRI_AOC_CHARGED_ITEM value) |
static enum PRI_AOC_CHARGED_ITEM | sig_pri_aoc_charged_item_to_pri (enum PRI_AOC_CHARGED_ITEM value) |
static void | sig_pri_aoc_d_from_ast (struct sig_pri_chan *pvt, struct ast_aoc_decoded *decoded) |
static void | sig_pri_aoc_d_from_pri (const struct pri_subcmd_aoc_d *aoc_d, struct ast_channel *owner, int passthrough) |
static void | sig_pri_aoc_e_from_ast (struct sig_pri_chan *pvt, struct ast_aoc_decoded *decoded) |
static void | sig_pri_aoc_e_from_pri (const struct pri_subcmd_aoc_e *aoc_e, struct ast_channel *owner, int passthrough) |
static int | sig_pri_aoc_multiplier_from_ast (enum ast_aoc_currency_multiplier mult) |
static int | sig_pri_aoc_multiplier_from_pri (const int mult) |
static void | sig_pri_aoc_request_from_pri (const struct pri_subcmd_aoc_request *aoc_request, struct sig_pri_chan *pvt, q931_call *call) |
static void | sig_pri_aoc_s_from_ast (struct sig_pri_chan *pvt, struct ast_aoc_decoded *decoded) |
static void | sig_pri_aoc_s_from_pri (const struct pri_subcmd_aoc_s *aoc_s, struct ast_channel *owner, int passthrough) |
static enum ast_aoc_time_scale | sig_pri_aoc_scale_to_ast (enum PRI_AOC_TIME_SCALE value) |
static enum PRI_AOC_TIME_SCALE | sig_pri_aoc_scale_to_pri (enum ast_aoc_time_scale value) |
static int | sig_pri_attempt_transfer (struct sig_pri_span *pri, q931_call *call_1_pri, int call_1_held, q931_call *call_2_pri, int call_2_held, struct xfer_rsp_data *xfer_data) |
int | sig_pri_available (struct sig_pri_chan **pvt, int is_specific_channel) |
static int | sig_pri_available_check (struct sig_pri_chan *pvt) |
int | sig_pri_call (struct sig_pri_chan *p, struct ast_channel *ast, const char *rdest, int timeout, int layer1) |
static const char * | sig_pri_call_level2str (enum sig_pri_call_level level) |
int | sig_pri_cc_agent_callee_available (struct ast_cc_agent *agent) |
Alert the caller that it is time to try recalling. More... | |
static int | sig_pri_cc_agent_cmp_cc_id (void *obj, void *arg, int flags) |
void | sig_pri_cc_agent_destructor (struct ast_cc_agent *agent) |
Destroy private data on the agent. More... | |
int | sig_pri_cc_agent_init (struct ast_cc_agent *agent, struct sig_pri_chan *pvt_chan) |
PRI CC agent initialization. More... | |
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 because he is either busy or there is congestion on his line. More... | |
void | sig_pri_cc_agent_req_rsp (struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason) |
Response to a CC request. More... | |
int | sig_pri_cc_agent_start_monitoring (struct ast_cc_agent *agent) |
Begin monitoring a busy device. More... | |
int | sig_pri_cc_agent_start_offer_timer (struct ast_cc_agent *agent) |
Start the offer timer. More... | |
int | sig_pri_cc_agent_status_req (struct ast_cc_agent *agent) |
Request the status of the agent's device. More... | |
int | sig_pri_cc_agent_stop_offer_timer (struct ast_cc_agent *agent) |
Stop the offer timer. More... | |
int | sig_pri_cc_agent_stop_ringing (struct ast_cc_agent *agent) |
Request for an agent's phone to stop ringing. More... | |
static int | sig_pri_cc_available (struct sig_pri_span *pri, int chanpos, long cc_id, enum ast_cc_service_type service) |
static void | sig_pri_cc_generic_check (struct sig_pri_span *pri, int chanpos, enum ast_cc_service_type service) |
static void | sig_pri_cc_link_canceled (struct sig_pri_span *pri, long cc_id, int is_agent) |
int | sig_pri_cc_monitor_cancel_available_timer (struct ast_cc_monitor *monitor, int *sched_id) |
Cancel the running available timer. More... | |
static int | sig_pri_cc_monitor_cmp_cc_id (void *obj, void *arg, int flags) |
void | sig_pri_cc_monitor_destructor (void *monitor_pvt) |
Destroy PRI private data on the monitor. More... | |
static int | sig_pri_cc_monitor_instance_cmp_fn (void *obj, void *arg, int flags) |
static void | sig_pri_cc_monitor_instance_destroy (void *data) |
static int | sig_pri_cc_monitor_instance_hash_fn (const void *obj, const int flags) |
static struct sig_pri_cc_monitor_instance * | sig_pri_cc_monitor_instance_init (int core_id, struct sig_pri_span *pri, long cc_id, const char *device_name) |
int | sig_pri_cc_monitor_req_cc (struct ast_cc_monitor *monitor, int *available_timer_id) |
Request CCSS. More... | |
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(). More... | |
int | sig_pri_cc_monitor_suspend (struct ast_cc_monitor *monitor) |
Suspend monitoring. More... | |
int | sig_pri_cc_monitor_unsuspend (struct ast_cc_monitor *monitor) |
Unsuspend monitoring. More... | |
void | sig_pri_chan_alarm_notify (struct sig_pri_chan *p, int noalarm) |
Notify new alarm status. More... | |
void | sig_pri_chan_delete (struct sig_pri_chan *doomed) |
Delete the sig_pri private channel structure. More... | |
struct sig_pri_chan * | sig_pri_chan_new (void *pvt_data, 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) |
static int | sig_pri_cmp_pri_chans (const void *left, const void *right) |
static struct sig_pri_chan * | sig_pri_cw_available (struct sig_pri_span *pri) |
static void | sig_pri_deadlock_avoidance_private (struct sig_pri_chan *p) |
void | sig_pri_dial_complete (struct sig_pri_chan *pvt, struct ast_channel *ast) |
DTMF dial string complete. More... | |
static void | sig_pri_dial_digits (struct sig_pri_chan *p, const char *dial_string) |
int | sig_pri_digit_begin (struct sig_pri_chan *pvt, struct ast_channel *ast, char digit) |
static void | sig_pri_dsp_reset_and_flush_digits (struct sig_pri_chan *p) |
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. More... | |
static struct ast_cc_agent * | sig_pri_find_cc_agent_by_cc_id (struct sig_pri_span *pri, long cc_id) |
static struct sig_pri_cc_monitor_instance * | sig_pri_find_cc_monitor_by_cc_id (struct sig_pri_span *pri, long cc_id) |
void | sig_pri_fixup (struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan) |
static void | sig_pri_fixup_chans (struct sig_pri_chan *old_chan, struct sig_pri_chan *new_chan) |
static const char * | sig_pri_get_orig_dialstring (struct sig_pri_chan *p) |
static void | sig_pri_handle_cis_subcmds (struct sig_pri_span *pri, int event_id, const struct pri_subcommands *subcmds, q931_call *call_rsp) |
static void | sig_pri_handle_dchan_exception (struct sig_pri_span *pri, int index) |
static int | sig_pri_handle_hold (struct sig_pri_span *pri, pri_event *ev) |
static void | sig_pri_handle_hold_ack (struct sig_pri_span *pri, pri_event *ev) |
static void | sig_pri_handle_hold_rej (struct sig_pri_span *pri, pri_event *ev) |
static void | sig_pri_handle_retrieve (struct sig_pri_span *pri, pri_event *ev) |
static void | sig_pri_handle_retrieve_ack (struct sig_pri_span *pri, pri_event *ev) |
static void | sig_pri_handle_retrieve_rej (struct sig_pri_span *pri, pri_event *ev) |
static void | sig_pri_handle_setup (struct sig_pri_span *pri, pri_event *e) |
static void | sig_pri_handle_subcmds (struct sig_pri_span *pri, int chanpos, int event_id, const struct pri_subcommands *subcmds, q931_call *call_rsp) |
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) |
static void | sig_pri_init_config (struct sig_pri_chan *pvt, struct sig_pri_span *pri) |
void | sig_pri_init_pri (struct sig_pri_span *pri) |
int | sig_pri_is_alarm_ignored (struct sig_pri_span *pri) |
Determine if layer 1 alarms are ignored. More... | |
int | sig_pri_is_chan_available (struct sig_pri_chan *pvt) |
Determine if a private channel structure is available. More... | |
static int | sig_pri_is_chan_in_use (struct sig_pri_chan *pvt) |
static int | sig_pri_is_cis_call (int channel) |
static void | sig_pri_kill_call (struct sig_pri_span *pri, q931_call *call, int cause) |
int | sig_pri_load (const char *cc_type_name) |
Load the sig_pri submodule. More... | |
static void | sig_pri_lock_owner (struct sig_pri_span *pri, int chanpos) |
static void | sig_pri_lock_private (struct sig_pri_chan *p) |
static void | sig_pri_make_cc_dialstring (struct sig_pri_chan *p, char *buf, size_t buf_size) |
static void | sig_pri_mcid_event (struct sig_pri_span *pri, const struct pri_subcmd_mcid_req *mcid, struct ast_channel *owner) |
static const char * | sig_pri_moh_event_str (enum sig_pri_moh_event event) |
static void | sig_pri_moh_fsm_event (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_hold (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_hold_req (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_idle (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_moh (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_notify (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_pend_hold (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_pend_unhold (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_retrieve_fail (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_fsm_retrieve_req (struct ast_channel *chan, struct sig_pri_chan *pvt, enum sig_pri_moh_event event) |
static enum sig_pri_moh_state | sig_pri_moh_retrieve_call (struct sig_pri_chan *pvt) |
static const char * | sig_pri_moh_state_str (enum sig_pri_moh_state state) |
static int | sig_pri_msn_match (const char *msn_patterns, const char *exten) |
static void | sig_pri_mwi_cache_update (struct sig_pri_span *pri) |
static void | sig_pri_mwi_event_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static struct ast_channel * | sig_pri_new_ast_channel (struct sig_pri_chan *p, int state, enum sig_pri_law law, int transfercapability, char *exten, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor) |
static void | sig_pri_open_media (struct sig_pri_chan *p) |
static void | sig_pri_party_id_convert (struct ast_party_id *ast_id, const struct pri_party_id *pri_id, struct sig_pri_span *pri) |
static void | sig_pri_party_id_from_ast (struct pri_party_id *pri_id, const struct ast_party_id *ast_id) |
static void | sig_pri_party_name_convert (struct ast_party_name *ast_name, const struct pri_party_name *pri_name) |
static void | sig_pri_party_name_from_ast (struct pri_party_name *pri_name, const struct ast_party_name *ast_name) |
static void | sig_pri_party_number_convert (struct ast_party_number *ast_number, const struct pri_party_number *pri_number, struct sig_pri_span *pri) |
static void | sig_pri_party_number_from_ast (struct pri_party_number *pri_number, const struct ast_party_number *ast_number) |
static void | sig_pri_party_subaddress_from_ast (struct pri_party_subaddress *pri_subaddress, const struct ast_party_subaddress *ast_subaddress) |
static int | sig_pri_play_tone (struct sig_pri_chan *p, enum sig_pri_tone tone) |
static void | sig_pri_queue_hangup (struct sig_pri_span *pri, int chanpos) |
static void | sig_pri_queue_hold (struct sig_pri_span *pri, int chanpos) |
static void | sig_pri_queue_unhold (struct sig_pri_span *pri, int chanpos) |
static void | sig_pri_redirecting_convert (struct ast_party_redirecting *ast_redirecting, const struct pri_party_redirecting *pri_redirecting, const struct ast_party_redirecting *ast_guide, struct sig_pri_span *pri) |
static void | sig_pri_redirecting_update (struct sig_pri_chan *pvt, 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) |
static void | sig_pri_send_aoce_termination_request (struct sig_pri_span *pri, int chanpos, unsigned int ms) |
static void | sig_pri_send_mwi_indication (struct sig_pri_span *pri, const char *vm_number, const char *vm_box, const char *mbox_id, int num_messages) |
void | sig_pri_sendtext (struct sig_pri_chan *p, const char *text) |
Send display text. More... | |
void | sig_pri_set_alarm (struct sig_pri_chan *p, int in_alarm) |
static void | sig_pri_set_caller_id (struct sig_pri_chan *p) |
static void | sig_pri_set_dialing (struct sig_pri_chan *p, int is_dialing) |
static void | sig_pri_set_digital (struct sig_pri_chan *p, int is_digital) |
static void | sig_pri_set_dnid (struct sig_pri_chan *p, const char *dnid) |
static int | sig_pri_set_echocanceller (struct sig_pri_chan *p, int enable) |
static void | sig_pri_set_outgoing (struct sig_pri_chan *p, int is_outgoing) |
static void | sig_pri_set_rdnis (struct sig_pri_chan *p, const char *rdnis) |
static void | sig_pri_set_subaddress (struct ast_party_subaddress *ast_subaddress, const struct pri_party_subaddress *pri_subaddress) |
static void | sig_pri_sort_pri_chans (struct sig_pri_span *pri) |
static void | sig_pri_span_devstate_changed (struct sig_pri_span *pri) |
int | sig_pri_start_pri (struct sig_pri_span *pri) |
void | sig_pri_stop_pri (struct sig_pri_span *pri) |
Stop PRI span. More... | |
static void | sig_pri_transfer_rsp (struct xfer_rsp_data *rsp, int is_successful) |
void | sig_pri_unload (void) |
Unload the sig_pri submodule. More... | |
static void | sig_pri_unlock_private (struct sig_pri_chan *p) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (mcid_type,.to_ami=mcid_to_ami,) | |
Variables | |
static int | pri_gendigittimeout = 8000 |
static int | pri_matchdigittimeout = 3000 |
static const struct ast_app_option | sig_pri_call_opts [128] = { [ 'K' ] = { .flag = OPT_KEYPAD , .arg_index = OPT_ARG_KEYPAD + 1 }, [ 'R' ] = { .flag = OPT_REVERSE_CHARGE }, [ 'A' ] = { .flag = OPT_AOC_REQUEST , .arg_index = OPT_ARG_AOC_REQUEST + 1 }, } |
static struct ao2_container * | sig_pri_cc_monitors |
static const char * | sig_pri_cc_type_name |
static const sig_pri_moh_fsm_state | sig_pri_moh_fsm [SIG_PRI_MOH_STATE_NUM] |
PRI signaling module.
Definition in file sig_pri.c.
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.
show_cmd | AMI command name |
s | AMI session to output span information. |
pri | PRI span control structure. |
dchannels | Array of D channel channel numbers. |
action_id | Action ID line to use. |
Definition at line 7540 of file sig_pri.c.
References astman_append(), sig_pri_span::dchanavail, sig_pri_span::dchans, sig_pri_span::pri, and sig_pri_span::span.
int sig_pri_call | ( | struct sig_pri_chan * | p, |
struct ast_channel * | ast, | ||
const char * | rdest, | ||
int | timeout, | ||
int | layer1 | ||
) |
Definition at line 7780 of file sig_pri.c.
References ao2_ref, sig_pri_span::append_msn_to_user_tag, AST_APP_ARG, ast_app_parse_options(), ast_cc_get_monitor_by_recall_core_id(), ast_cc_is_recall(), ast_channel_get_device_name(), AST_CHANNEL_NAME, ast_copy_string(), ast_debug, AST_DECLARE_APP_ARGS, AST_NONSTANDARD_APP_ARGS, ast_party_subaddress_init(), ast_setstate(), AST_STATE_DIALING, AST_STATE_DOWN, AST_STATE_RESERVED, ast_strdup, ast_transfercapability2str(), sig_pri_chan::call, sig_pri_chan::call_level, sig_pri_cc_monitor_instance::cc_id, sig_pri_chan::channel, sig_pri_chan::deferred_digits, sig_pri_span::dialplan, sig_pri_span::facilityenable, sig_pri_chan::hidecalleridname, ast_party_caller::id, sig_pri_span::initial_user_tag, sig_pri_span::internationalprefix, sig_pri_chan::is_call_waiting, sig_pri_span::localdialplan, ast_party_id::name, sig_pri_span::nationalprefix, sig_pri_chan::no_dialed_digits, sig_pri_span::nodetype, ast_party_id::number, pbx_builtin_getvar_helper(), ast_party_number::plan, ast_party_number::presentation, sig_pri_cc_monitor_instance::pri, sig_pri_span::pri, sig_pri_chan::priexclusive, ast_cc_monitor::private_data, S_COR, SIG_PRI_CALL_LEVEL_SETUP, sig_pri_cc_type_name, ast_party_name::str, ast_party_number::str, ast_party_subaddress::str, ast_party_id::subaddress, ast_party_id::tag, ast_party_subaddress::type, sig_pri_chan::use_callingpres, sig_pri_chan::user_tag, ast_party_name::valid, ast_party_number::valid, and ast_party_subaddress::valid.
int sig_pri_cc_agent_callee_available | ( | struct ast_cc_agent * | agent | ) |
Alert the caller that it is time to try recalling.
agent | CC core agent control. |
The core will call this function when it receives notice that a monitored party has become available.
The agent's job is to send a message to the caller to notify it of such a change. If the agent is able to discern that the caller is currently unavailable, then the agent should react by calling the ast_cc_caller_unavailable function.
0 | on success. |
-1 | on error. |
Definition at line 9709 of file sig_pri.c.
References sig_pri_cc_agent_prv::cc_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
void sig_pri_cc_agent_destructor | ( | struct ast_cc_agent * | agent | ) |
Destroy private data on the agent.
agent | CC core agent control. |
The core will call this function upon completion or failure of CC.
Definition at line 9736 of file sig_pri.c.
References sig_pri_cc_agent_prv::cc_id, sig_pri_cc_agent_prv::cc_request_response_pending, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
int sig_pri_cc_agent_init | ( | struct ast_cc_agent * | agent, |
struct sig_pri_chan * | pvt_chan | ||
) |
PRI CC agent initialization.
agent | CC core agent control. |
pvt_chan | Original channel the agent will attempt to recall. |
This callback is called when the CC core is initialized. Agents should allocate any private data necessary for the call and assign it to the private_data on the agent. Additionally, if any ast_cc_agent_flags are pertinent to the specific agent type, they should be set in this function as well.
0 | on success. |
-1 | on error. |
Definition at line 9423 of file sig_pri.c.
References ast_calloc, sig_pri_chan::call, sig_pri_cc_agent_prv::cc_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
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 because he is either busy or there is congestion on his line.
agent | CC core agent control. |
This is something that really only affects a scenario where a phone places a call over ISDN PTMP to Asterisk, who then connects over PTMP again to the ISDN network. For most agent types, there is no need to implement this callback at all because they don't really need to actually do anything in this situation. If you're having trouble understanding what the purpose of this callback is, then you can be safe simply not implementing it.
0 | on success. |
-1 | on error. |
Definition at line 9653 of file sig_pri.c.
References sig_pri_cc_agent_prv::cc_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
void sig_pri_cc_agent_req_rsp | ( | struct ast_cc_agent * | agent, |
enum ast_cc_agent_response_reason | reason | ||
) |
Response to a CC request.
agent | CC core agent control. |
reason | CC request response status. |
When the core receives knowledge that a called party has accepted a CC request, it will call this callback. The core may also call this if there is some error when attempting to process the incoming CC request.
The duty of this is to issue a propper response to a CC request from the caller by acknowledging receipt of that request or rejecting it.
Definition at line 9514 of file sig_pri.c.
References AST_CC_AGENT_RESPONSE_FAILURE_INVALID, AST_CC_AGENT_RESPONSE_FAILURE_TOO_MANY, AST_CC_AGENT_RESPONSE_SUCCESS, ast_cc_failed(), sig_pri_cc_agent_prv::cc_id, sig_pri_cc_agent_prv::cc_request_response_pending, ast_cc_agent::core_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, ast_cc_agent::private_data, and sig_pri_cc_type_name.
int sig_pri_cc_agent_start_monitoring | ( | struct ast_cc_agent * | agent | ) |
Begin monitoring a busy device.
agent | CC core agent control. |
The core will call this callback if the callee becomes available but the caller has reported that he is busy. The agent should begin monitoring the caller's device. When the caller becomes available again, the agent should call ast_cc_agent_caller_available.
0 | on success. |
-1 | on error. |
int sig_pri_cc_agent_start_offer_timer | ( | struct ast_cc_agent * | agent | ) |
Start the offer timer.
agent | CC core agent control. |
This is called by the core when the caller hangs up after a call for which CC may be requested. The agent should begin the timer as configured.
The primary reason why this functionality is left to the specific agent implementations is due to the differing use of schedulers throughout the code. Some channel drivers may already have a scheduler context they wish to use, and amongst those, some may use the ast_sched API while others may use the ast_sched_thread API, which are incompatible.
0 | on success. |
-1 | on error. |
int sig_pri_cc_agent_status_req | ( | struct ast_cc_agent * | agent | ) |
Request the status of the agent's device.
agent | CC core agent control. |
Asynchronous request for the status of any caller which may be a valid caller for the CC transaction. Status responses should be made using the ast_cc_status_response function.
0 | on success. |
-1 | on error. |
Definition at line 9584 of file sig_pri.c.
References sig_pri_cc_agent_prv::cc_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
int sig_pri_cc_agent_stop_offer_timer | ( | struct ast_cc_agent * | agent | ) |
Stop the offer timer.
agent | CC core agent control. |
This callback is called by the CC core when the caller has requested CC.
0 | on success. |
-1 | on error. |
int sig_pri_cc_agent_stop_ringing | ( | struct ast_cc_agent * | agent | ) |
Request for an agent's phone to stop ringing.
agent | CC core agent control. |
The usefulness of this is quite limited. The only specific known case for this is if Asterisk requests CC over an ISDN PTMP link as the TE side. If other phones are in the same recall group as the Asterisk server, and one of those phones picks up the recall notice, then Asterisk will receive a "stop ringing" notification from the NT side of the PTMP link. This indication needs to be passed to the phone on the other side of the Asterisk server which originally placed the call so that it will stop ringing. Since the phone may be of any type, it is necessary to have a callback that the core can know about.
0 | on success. |
-1 | on error. |
Definition at line 9619 of file sig_pri.c.
References sig_pri_cc_agent_prv::cc_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
int sig_pri_cc_monitor_cancel_available_timer | ( | struct ast_cc_monitor * | monitor, |
int * | sched_id | ||
) |
Cancel the running available timer.
monitor | CC core monitor control. |
sched_id | Available timer scheduler id to cancel. Will never be NULL for a device monitor. |
In most cases, this function will likely consist of just a call to AST_SCHED_DEL. It might have been possible to do this within the core, but unfortunately the mixture of sched_thread and sched usage in Asterisk prevents such usage.
0 | on success |
-1 | on failure. |
void sig_pri_cc_monitor_destructor | ( | void * | monitor_pvt | ) |
Destroy PRI private data on the monitor.
monitor_pvt | CC device monitor private data pointer. |
Implementers of this callback are responsible for destroying all heap-allocated data in the monitor's private_data pointer, including the private_data itself.
Definition at line 9985 of file sig_pri.c.
References ao2_ref, and ao2_unlink.
int sig_pri_cc_monitor_req_cc | ( | struct ast_cc_monitor * | monitor, |
int * | available_timer_id | ||
) |
Request CCSS.
monitor | CC core monitor control. |
available_timer_id | Where to put the available timer scheduler id. Will never be NULL for a device monitor. |
Perform whatever steps are necessary in order to request CC. In addition, the monitor implementation is responsible for starting the available timer in this callback. The scheduler ID for the callback must be stored in the parent_link's child_avail_id field.
0 | on success |
-1 | on failure. |
Definition at line 9818 of file sig_pri.c.
References sig_pri_cc_monitor_instance::cc_id, sig_pri_span::lock, sig_pri_cc_monitor_instance::pri, sig_pri_span::pri, ast_cc_monitor::private_data, and ast_cc_monitor::service_offered.
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().
monitor | CC core monitor control. |
devstate | Current status of a Party A device. |
Alert a monitor as to the status of the agent for which the monitor had previously requested a status request.
0 | on success |
-1 | on failure. |
Definition at line 9917 of file sig_pri.c.
References AST_DEVICE_BUSY, AST_DEVICE_INUSE, AST_DEVICE_NOT_INUSE, AST_DEVICE_UNKNOWN, sig_pri_cc_monitor_instance::cc_id, sig_pri_span::lock, sig_pri_cc_monitor_instance::pri, sig_pri_span::pri, and ast_cc_monitor::private_data.
int sig_pri_cc_monitor_suspend | ( | struct ast_cc_monitor * | monitor | ) |
Suspend monitoring.
monitor | CC core monitor control. |
Implementers must perform the necessary steps to suspend monitoring.
0 | on success |
-1 | on failure. |
Definition at line 9861 of file sig_pri.c.
References sig_pri_cc_monitor_instance::cc_id, sig_pri_span::lock, sig_pri_cc_monitor_instance::pri, sig_pri_span::pri, and ast_cc_monitor::private_data.
int sig_pri_cc_monitor_unsuspend | ( | struct ast_cc_monitor * | monitor | ) |
Unsuspend monitoring.
monitor | CC core monitor control. |
Perform the necessary steps to unsuspend monitoring.
0 | on success |
-1 | on failure. |
Definition at line 9887 of file sig_pri.c.
References sig_pri_cc_monitor_instance::cc_id, sig_pri_span::lock, sig_pri_cc_monitor_instance::pri, sig_pri_span::pri, and ast_cc_monitor::private_data.
void sig_pri_chan_alarm_notify | ( | struct sig_pri_chan * | p, |
int | noalarm | ||
) |
Notify new alarm status.
p | Channel private pointer. |
noalarm | Non-zero if not in alarm mode. |
Definition at line 9163 of file sig_pri.c.
References AST_SOFTHANGUP_DEV, sig_pri_chan::call, and sig_pri_span::pri.
void sig_pri_chan_delete | ( | struct sig_pri_chan * | doomed | ) |
void sig_pri_dial_complete | ( | struct sig_pri_chan * | pvt, |
struct ast_channel * | ast | ||
) |
DTMF dial string complete.
pvt | sig_pri private channel structure. |
ast | Asterisk channel |
Definition at line 8726 of file sig_pri.c.
References AST_CONTROL_ANSWER, AST_FRAME_CONTROL, ast_queue_frame(), sig_pri_chan::call_level, sig_pri_chan::chan_pvt, ast_frame_subclass::integer, SIG_PRI_CALL_LEVEL_CONNECT, SIG_PRI_CALL_LEVEL_DEFER_DIAL, sig_pri_callbacks, and ast_frame::subclass.
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.
p | sig_pri channel structure. |
rdest | Dial string buffer to extract called number and subaddress. |
called | Buffer to fill with extracted <number>[:<subaddress>] |
called_buff_size | Size of buffer to fill. |
Definition at line 7694 of file sig_pri.c.
References AST_APP_ARG, AST_DECLARE_APP_ARGS, AST_NONSTANDARD_APP_ARGS, and ast_strdupa.
int sig_pri_is_alarm_ignored | ( | struct sig_pri_span * | pri | ) |
Determine if layer 1 alarms are ignored.
pri | Channel private pointer. |
Definition at line 9189 of file sig_pri.c.
References sig_pri_span::layer1_ignored.
int sig_pri_is_chan_available | ( | struct sig_pri_chan * | pvt | ) |
Determine if a private channel structure is available.
pvt | Channel to determine if available. |
Definition at line 1218 of file sig_pri.c.
References sig_pri_chan::service_status.
int sig_pri_load | ( | const char * | cc_type_name | ) |
Load the sig_pri submodule.
cc_type_name | CC type name to use when looking up agent/monitor. |
0 | on success. |
-1 | on error. |
Definition at line 10007 of file sig_pri.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, sig_pri_cc_type_name, and STASIS_MESSAGE_TYPE_INIT.
Referenced by load_module().
void sig_pri_sendtext | ( | struct sig_pri_chan * | p, |
const char * | text | ||
) |
Send display text.
p | Channel to send text over |
text | Text to send. |
Definition at line 9391 of file sig_pri.c.
References ast_copy_string(), sig_pri_chan::call, and sig_pri_span::pri.
void sig_pri_stop_pri | ( | struct sig_pri_span * | pri | ) |
Stop PRI span.
pri | PRI span control structure. |
Definition at line 8872 of file sig_pri.c.
References ast_mwi_unsubscribe_and_join(), sig_pri_span::mbox, and sig_pri_mbox::sub.
void sig_pri_unload | ( | void | ) |
Unload the sig_pri submodule.
Definition at line 10030 of file sig_pri.c.
References ao2_ref, and STASIS_MESSAGE_TYPE_CLEANUP.
|
static |
|
static |
Upper level agent/monitor type name.
Definition at line 159 of file sig_pri.c.
Referenced by sig_pri_call(), sig_pri_cc_agent_req_rsp(), and sig_pri_load().
|
static |