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_mbox |
struct | sig_pri_span |
Macros | |
#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 |
#define | SIG_PRI_MAX_CHANNELS 672 |
#define | SIG_PRI_MAX_MWI_CONTEXT_LEN 10 |
#define | SIG_PRI_MAX_MWI_MAILBOX_STR |
Maximum mwi_mailbox string length. More... | |
#define | SIG_PRI_MAX_MWI_MAILBOXES 8 |
#define | SIG_PRI_MAX_MWI_MBOX_NUMBER_LEN 10 /* digits in number */ |
#define | SIG_PRI_NUM_DCHANS 4 |
#define | SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND) |
SRVST_BOTH is used to indicate that both sides of the channel are out-of-service. More... | |
#define | SRVST_DBKEY "service-state" |
Persistent Service State. More... | |
#define | SRVST_FAREND (1 << 1) |
SRVST_FAREND is used to indicate that the far end was taken out-of-service. More... | |
#define | SRVST_INITIALIZED 0 |
SRVST_INITIALIZED is used to indicate a channel being out-of-service The SRVST_INITIALIZED is mostly used maintain backwards compatibility but also may mean that the channel has not yet received a RESTART message. If a channel is out-of-service with this reason a RESTART message will result in the channel being put into service. More... | |
#define | SRVST_NEAREND (1 << 0) |
SRVST_NEAREND is used to indicate that the near end was put out-of-service. More... | |
#define | SRVST_TYPE_OOS "O" |
The out-of-service SERVICE state. More... | |
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_maintenance_bservice (struct pri *pri, struct sig_pri_chan *p, int changestatus) |
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) |
Alert the caller that it is time to try recalling. More... | |
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... | |
int | sig_pri_cc_monitor_cancel_available_timer (struct ast_cc_monitor *monitor, int *sched_id) |
Cancel the running available timer. More... | |
void | sig_pri_cc_monitor_destructor (void *monitor_pvt) |
Destroy PRI private data on the monitor. More... | |
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_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) |
DTMF dial string complete. More... | |
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) |
Extract the called number and subaddress from the dial string. More... | |
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) |
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... | |
int | sig_pri_load (const char *cc_type_name) |
Load the sig_pri submodule. More... | |
struct ast_channel * | sig_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) |
Stop PRI span. More... | |
void | sig_pri_unload (void) |
Unload the sig_pri submodule. More... | |
Variables | |
static const char | dahdi_db [] = "dahdi/registry" |
The AstDB family. More... | |
Interface header for PRI signaling module.
Definition in file sig_pri.h.
#define DAHDI_CHAN_MAPPING_LOGICAL 1 |
Definition at line 192 of file sig_pri.h.
Referenced by process_dahdi(), and sig_pri_start_pri().
#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(), pri_dchannel(), pri_ss_thread(), process_dahdi(), sig_pri_cli_show_span(), and sig_pri_indicate().
#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(), pri_dchannel(), process_dahdi(), and sig_pri_start_pri().
#define SIG_PRI_AOC_GRANT_D (1 << 1) |
Definition at line 67 of file sig_pri.h.
Referenced by process_dahdi(), sig_pri_aoc_request_from_pri(), sig_pri_handle_subcmds(), and sig_pri_indicate().
#define SIG_PRI_AOC_GRANT_E (1 << 2) |
Definition at line 68 of file sig_pri.h.
Referenced by process_dahdi(), sig_pri_aoc_request_from_pri(), sig_pri_handle_subcmds(), and sig_pri_indicate().
#define SIG_PRI_AOC_GRANT_S (1 << 0) |
Definition at line 66 of file sig_pri.h.
Referenced by process_dahdi(), sig_pri_aoc_request_from_pri(), sig_pri_handle_subcmds(), and sig_pri_indicate().
#define SIG_PRI_DEBUG_DEFAULT 0 |
PRI debug message flags set on initial startup.
Definition at line 63 of file sig_pri.h.
Referenced by sig_pri_start_pri().
#define SIG_PRI_DEBUG_INTENSE |
PRI debug message flags when intense PRI debugging is turned on at the command line.
Definition at line 42 of file sig_pri.h.
Referenced by handle_pri_debug().
#define SIG_PRI_DEBUG_NORMAL |
PRI debug message flags when normal PRI debugging is turned on at the command line.
Definition at line 37 of file sig_pri.h.
Referenced by handle_pri_debug().
#define SIG_PRI_MAX_CHANNELS 672 |
#define SIG_PRI_MAX_MWI_CONTEXT_LEN 10 |
#define SIG_PRI_MAX_MWI_MAILBOX_STR |
Maximum mwi_mailbox string length.
max_length = #mailboxes * (mbox_number + '@' + context + ',') The last ',' is a null terminator instead.
#define SIG_PRI_MAX_MWI_MAILBOXES 8 |
#define SIG_PRI_MAX_MWI_MBOX_NUMBER_LEN 10 /* digits in number */ |
#define SIG_PRI_NUM_DCHANS 4 |
No more than 4 d-channels
Definition at line 183 of file sig_pri.h.
Referenced by __unload_module(), dahdi_pri_error(), dahdi_pri_message(), dahdi_restart(), handle_pri_debug(), handle_pri_service_generic(), handle_pri_show_debug(), mkintf(), prepare_pri(), pri_active_dchan_index(), pri_create_trunkgroup(), pri_dchannel(), pri_destroy_dchan(), pri_find_dchan(), pri_is_up(), setup_dahdi_int(), sig_pri_cli_show_span(), sig_pri_cli_show_spans(), sig_pri_init_pri(), and sig_pri_start_pri().
#define SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND) |
#define SRVST_DBKEY "service-state" |
Persistent Service State.
Definition at line 202 of file sig_pri.h.
Referenced by destroy_all_channels(), handle_pri_service_generic(), mkintf(), and pri_dchannel().
#define SRVST_FAREND (1 << 1) |
SRVST_FAREND is used to indicate that the far end was taken out-of-service.
Definition at line 214 of file sig_pri.h.
Referenced by mkintf(), pri_check_restart(), and pri_dchannel().
#define SRVST_INITIALIZED 0 |
SRVST_INITIALIZED is used to indicate a channel being out-of-service The SRVST_INITIALIZED is mostly used maintain backwards compatibility but also may mean that the channel has not yet received a RESTART message. If a channel is out-of-service with this reason a RESTART message will result in the channel being put into service.
#define SRVST_NEAREND (1 << 0) |
SRVST_NEAREND is used to indicate that the near end was put out-of-service.
Definition at line 212 of file sig_pri.h.
Referenced by handle_pri_service_generic(), mkintf(), pri_check_restart(), and pri_dchannel().
#define SRVST_TYPE_OOS "O" |
The out-of-service SERVICE state.
Definition at line 204 of file sig_pri.h.
Referenced by handle_pri_service_generic(), and pri_dchannel().
enum sig_pri_call_level |
Call establishment life cycle level for simple comparisons.
Definition at line 87 of file sig_pri.h.
enum sig_pri_law |
Enumerator | |
---|---|
SIG_PRI_DEFLAW | |
SIG_PRI_ULAW | |
SIG_PRI_ALAW |
enum sig_pri_reset_state |
Definition at line 104 of file sig_pri.h.
enum sig_pri_tone |
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.
void pri_event_alarm | ( | struct sig_pri_span * | pri, |
int | index, | ||
int | before_start_pri | ||
) |
Definition at line 2014 of file sig_pri.c.
References DCHAN_NOTINALARM, DCHAN_UP, sig_pri_span::dchanavail, and pri_find_dchan().
Referenced by my_handle_dchan_exception(), and prepare_pri().
void pri_event_noalarm | ( | struct sig_pri_span * | pri, |
int | index, | ||
int | before_start_pri | ||
) |
Definition at line 2022 of file sig_pri.c.
References DCHAN_NOTINALARM, sig_pri_span::dchanavail, and sig_pri_span::dchans.
Referenced by my_handle_dchan_exception(), and prepare_pri().
int pri_is_up | ( | struct sig_pri_span * | pri | ) |
Definition at line 1027 of file sig_pri.c.
References DCHAN_AVAILABLE, sig_pri_span::dchanavail, and SIG_PRI_NUM_DCHANS.
Referenced by pri_dchannel().
int pri_maintenance_bservice | ( | struct pri * | pri, |
struct sig_pri_chan * | p, | ||
int | changestatus | ||
) |
Definition at line 8109 of file sig_pri.c.
References sig_pri_chan::channel, PRI_SPAN, and PVT_TO_CHANNEL().
Referenced by handle_pri_service_generic().
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 | ||
) |
Definition at line 8087 of file sig_pri.c.
References ast_log(), sig_pri_chan::call, LOG_DEBUG, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), sig_pri_lock_private(), and sig_pri_unlock_private().
Referenced by dahdi_send_callrerouting_facility_exec().
int pri_send_keypad_facility_exec | ( | struct sig_pri_chan * | p, |
const char * | digits | ||
) |
Definition at line 8068 of file sig_pri.c.
References ast_debug, sig_pri_chan::call, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), sig_pri_lock_private(), and sig_pri_unlock_private().
Referenced by dahdi_send_keypad_facility_exec().
int sig_pri_answer | ( | struct sig_pri_chan * | p, |
struct ast_channel * | ast | ||
) |
Definition at line 7317 of file sig_pri.c.
References sig_pri_chan::aoc_s_request_invoke_id, sig_pri_chan::aoc_s_request_invoke_id_valid, ast_setstate(), AST_STATE_UP, sig_pri_chan::call, sig_pri_chan::call_level, sig_pri_chan::digital, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), SIG_PRI_CALL_LEVEL_CONNECT, sig_pri_open_media(), and sig_pri_set_dialing().
Referenced by dahdi_answer().
int sig_pri_available | ( | struct sig_pri_chan ** | pvt, |
int | is_specific_channel | ||
) |
Definition at line 7412 of file sig_pri.c.
References sig_pri_chan::allocated, ast_mutex_lock, ast_mutex_unlock, HAVE_PRI_CALL_WAITING, sig_pri_span::lock, sig_pri_span::num_call_waiting_calls, sig_pri_chan::pri, sig_pri_span::pri, sig_pri_available_check(), and sig_pri_cw_available().
Referenced by available().
int sig_pri_call | ( | struct sig_pri_chan * | p, |
struct ast_channel * | ast, | ||
char * | rdest, | ||
int | timeout, | ||
int | layer1 | ||
) |
Definition at line 6641 of file sig_pri.c.
References ast_channel::_state, ao2_ref, sig_pri_span::append_msn_to_user_tag, args, AST_APP_ARG, ast_app_parse_options(), ast_assert, ast_cc_get_monitor_by_recall_core_id(), ast_cc_is_recall(), ast_channel_get_device_name(), AST_CHANNEL_NAME, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_free, ast_log(), AST_NONSTANDARD_APP_ARGS, ast_party_subaddress_init(), ast_setstate(), AST_STATE_DIALING, AST_STATE_DOWN, AST_STATE_RESERVED, ast_strdup, ast_strlen_zero(), ast_test_flag, ast_transfercapability2str(), ast_verb, sig_pri_chan::call, sig_pri_chan::call_level, ast_channel::caller, sig_pri_cc_monitor_instance::cc_id, sig_pri_chan::channel, ast_channel::connected, sig_pri_chan::deferred_digits, sig_pri_chan::dialdest, sig_pri_span::dialplan, dialplan2str(), sig_pri_chan::digital, ext, sig_pri_span::facilityenable, sig_pri_chan::hidecallerid, sig_pri_chan::hidecalleridname, ast_party_caller::id, ast_party_connected_line::id, sig_pri_span::initial_user_tag, sig_pri_span::internationalprefix, sig_pri_chan::is_call_waiting, IS_DIGITAL, sig_pri_span::localdialplan, LOG_DEBUG, LOG_ERROR, LOG_WARNING, monitor, ast_party_id::name, ast_channel::name, sig_pri_span::nationalprefix, sig_pri_chan::no_dialed_digits, sig_pri_span::nodetype, ast_party_id::number, OPT_AOC_REQUEST, OPT_ARG_AOC_REQUEST, OPT_ARG_ARRAY_SIZE, OPT_ARG_KEYPAD, OPT_KEYPAD, OPT_REVERSE_CHARGE, sig_pri_chan::owner, pbx_builtin_getvar_helper(), ast_party_number::presentation, sig_pri_cc_monitor_instance::pri, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), PRI_TRANS_CAP_DIGITAL, sig_pri_chan::priexclusive, ast_cc_monitor::private_data, PVT_TO_CHANNEL(), S_COR, SIG_PRI_CALL_LEVEL_SETUP, sig_pri_call_opts, sig_pri_cc_type_name, sig_pri_party_subaddress_from_ast(), sig_pri_redirecting_update(), sig_pri_set_dialing(), sig_pri_set_digital(), sig_pri_set_outgoing(), ast_party_name::str, ast_party_number::str, ast_party_subaddress::str, sig_pri_chan::stripmsd, ast_party_id::subaddress, ast_party_id::tag, ast_channel::transfercapability, 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.
Referenced by dahdi_call().
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 8430 of file sig_pri.c.
References ast_mutex_lock, ast_mutex_unlock, 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 8459 of file sig_pri.c.
References ast_free, ast_mutex_lock, ast_mutex_unlock, 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.
Referenced by dahdi_pri_cc_agent_destructor().
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 8142 of file sig_pri.c.
References ast_calloc, ast_free, ast_mutex_lock, ast_mutex_unlock, sig_pri_chan::call, sig_pri_cc_agent_prv::cc_id, sig_pri_span::lock, sig_pri_cc_agent_prv::pri, sig_pri_chan::pri, sig_pri_span::pri, and ast_cc_agent::private_data.
Referenced by dahdi_pri_cc_agent_init().
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 8374 of file sig_pri.c.
References ast_mutex_lock, ast_mutex_unlock, 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 8235 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(), ast_mutex_lock, ast_mutex_unlock, 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, sig_pri_cc_type_name, and status.
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 8305 of file sig_pri.c.
References ast_mutex_lock, ast_mutex_unlock, 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 8340 of file sig_pri.c.
References ast_mutex_lock, ast_mutex_unlock, 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 8708 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 8541 of file sig_pri.c.
References AST_CC_CCBS, AST_CC_CCNR, ast_mutex_lock, ast_mutex_unlock, 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 8640 of file sig_pri.c.
References AST_DEVICE_BUSY, AST_DEVICE_INUSE, AST_DEVICE_NOT_INUSE, AST_DEVICE_UNKNOWN, ast_mutex_lock, ast_mutex_unlock, 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 8584 of file sig_pri.c.
References ast_mutex_lock, ast_mutex_unlock, 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 8610 of file sig_pri.c.
References ast_mutex_lock, ast_mutex_unlock, 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 7894 of file sig_pri.c.
References ast_channel::_softhangup, AST_SOFTHANGUP_DEV, sig_pri_chan::call, sig_pri_chan::owner, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), sig_pri_set_alarm(), and sig_pri_span_devstate_changed().
Referenced by dahdi_handle_event(), and handle_init_event().
void sig_pri_chan_delete | ( | struct sig_pri_chan * | doomed | ) |
Delete the sig_pri private channel structure.
doomed | sig_pri private channel structure to delete. |
Definition at line 7953 of file sig_pri.c.
References ast_free.
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 | ||
) |
Definition at line 7925 of file sig_pri.c.
References ast_calloc, sig_pri_chan::calls, sig_pri_chan::chan_pvt, sig_pri_chan::logicalspan, sig_pri_chan::mastertrunkgroup, sig_pri_chan::pri, and sig_pri_chan::prioffset.
Referenced by dahdi_new_pri_nobch_channel(), and mkintf().
void sig_pri_cli_show_channels | ( | int | fd, |
struct sig_pri_span * | pri | ||
) |
Definition at line 7966 of file sig_pri.c.
References ast_channel_unlock, ast_cli(), ast_mutex_lock, ast_mutex_unlock, sig_pri_chan::call, sig_pri_chan::call_level, sig_pri_chan::channel, sig_pri_span::lock, ast_channel::name, sig_pri_chan::no_b_channel, sig_pri_span::numchans, sig_pri_chan::owner, sig_pri_span::pvts, sig_pri_call_level2str(), sig_pri_is_chan_available(), sig_pri_lock_owner(), sig_pri_lock_private(), SIG_PRI_SC_LINE, sig_pri_unlock_private(), and sig_pri_span::span.
Referenced by handle_pri_show_channels().
void sig_pri_cli_show_channels_header | ( | int | fd | ) |
Definition at line 7960 of file sig_pri.c.
References ast_cli(), and SIG_PRI_SC_HEADER.
Referenced by handle_pri_show_channels().
void sig_pri_cli_show_span | ( | int | fd, |
int * | dchannels, | ||
struct sig_pri_span * | pri | ||
) |
Definition at line 8038 of file sig_pri.c.
References ast_cli(), ast_mutex_lock, ast_mutex_unlock, ast_std_free(), build_status(), DAHDI_OVERLAPDIAL_INCOMING, sig_pri_span::dchanavail, sig_pri_span::dchans, sig_pri_span::lock, sig_pri_span::overlapdial, sig_pri_span::pri, pri_order(), SIG_PRI_NUM_DCHANS, and status.
Referenced by handle_pri_show_span().
void sig_pri_cli_show_spans | ( | int | fd, |
int | span, | ||
struct sig_pri_span * | pri | ||
) |
Definition at line 8026 of file sig_pri.c.
References ast_cli(), build_status(), sig_pri_span::dchanavail, sig_pri_span::dchans, sig_pri_span::pri, SIG_PRI_NUM_DCHANS, and status.
Referenced by handle_pri_show_spans().
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 7506 of file sig_pri.c.
References AST_CONTROL_ANSWER, AST_FRAME_CONTROL, ast_queue_frame(), sig_pri_chan::call_level, sig_pri_chan::calls, sig_pri_chan::chan_pvt, ast_frame_subclass::integer, sig_pri_callback::queue_control, SIG_PRI_CALL_LEVEL_CONNECT, SIG_PRI_CALL_LEVEL_DEFER_DIAL, sig_pri_open_media(), sig_pri_set_dialing(), sig_pri_set_echocanceller(), and ast_frame::subclass.
Referenced by dahdi_handle_event().
int sig_pri_digit_begin | ( | struct sig_pri_chan * | pvt, |
struct ast_channel * | ast, | ||
char | digit | ||
) |
Definition at line 7460 of file sig_pri.c.
References ast_channel::_state, ast_debug, ast_log(), AST_STATE_DIALING, sig_pri_chan::call, sig_pri_chan::call_level, sig_pri_chan::dialdest, len(), LOG_WARNING, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), sig_pri_call_level2str(), SIG_PRI_CALL_LEVEL_CONNECT, SIG_PRI_CALL_LEVEL_OVERLAP, SIG_PRI_CALL_LEVEL_PROCEEDING, and sig_pri_span::span.
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 | ||
) |
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 6555 of file sig_pri.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, AST_NONSTANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ext, and sig_pri_chan::stripmsd.
Referenced by dahdi_request().
void sig_pri_fixup | ( | struct ast_channel * | oldchan, |
struct ast_channel * | newchan, | ||
struct sig_pri_chan * | pchan | ||
) |
Definition at line 8118 of file sig_pri.c.
References sig_pri_chan::owner.
Referenced by dahdi_fixup().
int sig_pri_hangup | ( | struct sig_pri_chan * | p, |
struct ast_channel * | ast | ||
) |
Definition at line 6464 of file sig_pri.c.
References sig_pri_chan::allocated, sig_pri_chan::alreadyhungup, sig_pri_chan::aoc_e, sig_pri_chan::aoc_s_request_invoke_id_valid, ast_atomic_fetchadd_int(), ast_debug, ast_log(), ast_strlen_zero(), sig_pri_chan::call, sig_pri_chan::call_level, sig_pri_chan::channel, sig_pri_chan::cid_name, sig_pri_chan::cid_num, sig_pri_chan::cid_subaddr, sig_pri_chan::exten, ast_channel::hangupcause, sig_pri_chan::holding_aoce, sig_pri_chan::is_call_waiting, LOG_WARNING, sig_pri_span::num_call_waiting_calls, sig_pri_chan::owner, pbx_builtin_getvar_helper(), sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), sig_pri_chan::progress, SIG_PRI_CALL_LEVEL_IDLE, sig_pri_set_dialing(), sig_pri_set_digital(), sig_pri_set_outgoing(), sig_pri_span_devstate_changed(), ast_channel::tech_pvt, sig_pri_chan::user_tag, and sig_pri_chan::waiting_for_aoce.
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 | ||
) |
Definition at line 7092 of file sig_pri.c.
References ast_channel::_softhangup, ast_channel::_state, sig_pri_span::aoc_passthrough_flag, AST_AOC_D, ast_aoc_decode(), ast_aoc_destroy_decoded(), AST_AOC_E, ast_aoc_get_msg_type(), ast_aoc_get_termination_request(), AST_AOC_REQUEST, AST_AOC_S, AST_CAUSE_INVALID_NUMBER_FORMAT, AST_CAUSE_NORMAL_CLEARING, AST_CAUSE_SWITCH_CONGESTION, AST_CAUSE_USER_BUSY, AST_CONTROL_AOC, AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_CONNECTED_LINE, AST_CONTROL_HOLD, AST_CONTROL_INCOMPLETE, AST_CONTROL_PROCEEDING, AST_CONTROL_PROGRESS, AST_CONTROL_REDIRECTING, AST_CONTROL_RINGING, AST_CONTROL_SRCUPDATE, AST_CONTROL_UNHOLD, ast_debug, ast_log(), ast_moh_start(), ast_moh_stop(), ast_setstate(), AST_SOFTHANGUP_DEV, ast_softhangup_nolock(), AST_STATE_RING, AST_STATE_RINGING, AST_STATE_UP, sig_pri_chan::call, sig_pri_chan::call_level, ast_channel::connected, DAHDI_OVERLAPDIAL_INCOMING, sig_pri_chan::digital, ast_channel::hangupcause, ast_party_connected_line::id, LOG_DEBUG, sig_pri_chan::mohinterpret, ast_channel::name, sig_pri_chan::no_b_channel, sig_pri_chan::outgoing, sig_pri_span::overlapdial, sig_pri_chan::pri, sig_pri_span::pri, pri_grab(), pri_rel(), sig_pri_chan::priindication_oob, sig_pri_chan::prioffset, sig_pri_chan::progress, PVT_TO_CHANNEL(), sig_pri_aoc_d_from_ast(), sig_pri_aoc_e_from_ast(), SIG_PRI_AOC_GRANT_D, SIG_PRI_AOC_GRANT_E, SIG_PRI_AOC_GRANT_S, sig_pri_aoc_s_from_ast(), SIG_PRI_CALL_LEVEL_ALERTING, SIG_PRI_CALL_LEVEL_CONNECT, SIG_PRI_CALL_LEVEL_PROCEEDING, sig_pri_party_id_from_ast(), sig_pri_play_tone(), sig_pri_redirecting_update(), sig_pri_set_digital(), SIG_PRI_TONE_BUSY, SIG_PRI_TONE_CONGESTION, SIG_PRI_TONE_RINGTONE, and sig_pri_chan::waiting_for_aoce.
Referenced by dahdi_indicate().
void sig_pri_init_pri | ( | struct sig_pri_span * | pri | ) |
Definition at line 6451 of file sig_pri.c.
References ast_mutex_init, AST_PTHREADT_NULL, sig_pri_span::fds, sig_pri_span::lock, sig_pri_span::master, and SIG_PRI_NUM_DCHANS.
Referenced by dahdi_restart(), and load_module().
int sig_pri_is_alarm_ignored | ( | struct sig_pri_span * | pri | ) |
Determine if layer 1 alarms are ignored.
p | Channel private pointer. |
Definition at line 7920 of file sig_pri.c.
References sig_pri_span::layer1_ignored.
Referenced by handle_alarms(), handle_clear_alarms(), my_handle_dchan_exception(), and sig_pri_set_alarm().
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 1160 of file sig_pri.c.
References sig_pri_chan::service_status, and sig_pri_is_chan_in_use().
Referenced by dahdi_pri_update_span_devstate(), pri_dchannel(), pri_find_empty_chan(), pri_find_empty_nobch(), pri_fixup_principle(), sig_pri_available_check(), sig_pri_cli_show_channels(), and sig_pri_handle_retrieve().
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 8730 of file sig_pri.c.
References ao2_container_alloc, sig_pri_cc_monitor_instance_cmp_fn(), sig_pri_cc_monitor_instance_hash_fn(), and sig_pri_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 | ||
) |
Definition at line 1013 of file sig_pri.c.
References ast_log(), AST_STATE_RESERVED, sig_pri_chan::channel, sig_pri_chan::exten, LOG_DEBUG, sig_pri_new_ast_channel(), and sig_pri_set_outgoing().
Referenced by dahdi_request(), and pri_dchannel().
void sig_pri_set_alarm | ( | struct sig_pri_chan * | p, |
int | in_alarm | ||
) |
Definition at line 187 of file sig_pri.c.
References sig_pri_chan::calls, sig_pri_chan::chan_pvt, sig_pri_chan::inalarm, sig_pri_chan::pri, sig_pri_chan::resetting, sig_pri_callback::set_alarm, sig_pri_is_alarm_ignored(), and SIG_PRI_RESET_IDLE.
Referenced by mkintf(), pri_dchannel(), and sig_pri_chan_alarm_notify().
int sig_pri_start_pri | ( | struct sig_pri_span * | pri | ) |
Definition at line 7703 of file sig_pri.c.
References ARRAY_LEN, AST_EVENT_IE_CONTEXT, AST_EVENT_IE_END, AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, AST_EVENT_MWI, ast_event_subscribe(), ast_event_unsubscribe(), ast_log(), ast_mutex_init, ast_pthread_create_background, ast_str_alloca, ast_str_buffer(), ast_str_set(), ast_strip(), ast_strlen_zero(), sig_pri_span::cc_ptmp_recall_mode, sig_pri_span::cc_qsig_signaling_link_req, sig_pri_span::cc_qsig_signaling_link_rsp, sig_pri_mbox::context, DAHDI_CHAN_MAPPING_LOGICAL, DAHDI_OVERLAPDIAL_OUTGOING, sig_pri_span::dchans, sig_pri_span::enable_service_message_support, errno, sig_pri_span::fds, sig_pri_span::inbanddisconnect, sig_pri_span::l2_persistence, sig_pri_span::lock, LOG_ERROR, sig_pri_span::master, sig_pri_span::mbox, sig_pri_span::mwi_mailboxes, sig_pri_span::nodetype, sig_pri_span::nsf, sig_pri_mbox::number, sig_pri_span::overlapdial, sig_pri_span::pri, pri_dchannel(), sig_pri_span::pritimers, sig_pri_span::qsigchannelmapping, sig_pri_span::resetpos, sig_pri_span::sig, SIG_BRI, SIG_BRI_PTMP, sig_pri_cc_type_name, SIG_PRI_DEBUG_DEFAULT, sig_pri_mwi_cache_update(), sig_pri_mwi_event_cb(), SIG_PRI_NUM_DCHANS, sig_pri_sort_pri_chans(), sig_pri_span::span, strsep(), sig_pri_mbox::sub, and sig_pri_span::switchtype.
Referenced by setup_dahdi_int().
void sig_pri_stop_pri | ( | struct sig_pri_span * | pri | ) |
Stop PRI span.
pri | PRI span control structure. |
Definition at line 7638 of file sig_pri.c.
References ARRAY_LEN, ast_event_unsubscribe(), sig_pri_span::mbox, and sig_pri_mbox::sub.
Referenced by __unload_module().
void sig_pri_unload | ( | void | ) |
Unload the sig_pri submodule.
Definition at line 8749 of file sig_pri.c.
References ao2_ref.
Referenced by __unload_module().
|
static |
The AstDB family.
Definition at line 219 of file sig_pri.h.
Referenced by destroy_all_channels(), handle_pri_service_generic(), mkintf(), and pri_dchannel().