Asterisk - The Open Source Telephony Project GIT-master-d5a0626
|
Dialing API. More...
#include "asterisk.h"
#include <sys/time.h>
#include <signal.h>
#include "asterisk/channel.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/linkedlists.h"
#include "asterisk/dial.h"
#include "asterisk/pbx.h"
#include "asterisk/musiconhold.h"
#include "asterisk/app.h"
#include "asterisk/causes.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/max_forwards.h"
Go to the source code of this file.
Data Structures | |
struct | answer_exec_struct |
Structure for 'ANSWER_EXEC' option. More... | |
struct | ast_dial |
Main dialing structure. Contains global options, channels being dialed, and more! More... | |
struct | ast_dial_channel |
Dialing channel structure. Contains per-channel dialing options, asterisk channel, and more! More... | |
struct | ast_option_types |
Macros | |
#define | AST_MAX_WATCHERS 256 |
Maximum number of channels we can watch at a time. More... | |
#define | FIND_RELATIVE_OPTION(dial, dial_channel, ast_dial_option) (dial_channel->options[ast_dial_option] ? dial_channel->options[ast_dial_option] : dial->options[ast_dial_option]) |
Macro for finding the option structure to use on a dialed channel. More... | |
#define | IS_CALLER(chan, owner) (chan == owner ? 1 : 0) |
Macro that determines whether a channel is the caller or not. More... | |
Typedefs | |
typedef int(* | ast_dial_option_cb_disable) (void *data) |
Typedef for dial option disable. More... | |
typedef void *(* | ast_dial_option_cb_enable) (void *data) |
Typedef for dial option enable. More... | |
Functions | |
static int | answer_exec_disable (void *data) |
Disable function for 'ANSWER_EXEC' option. More... | |
static void * | answer_exec_enable (void *data) |
Enable function for 'ANSWER_EXEC' option. More... | |
static void | answer_exec_run (struct ast_dial *dial, struct ast_dial_channel *dial_channel, char *app, char *args) |
Application execution function for 'ANSWER_EXEC' option. More... | |
struct ast_channel * | ast_dial_answered (struct ast_dial *dial) |
Return channel that answered. More... | |
struct ast_channel * | ast_dial_answered_steal (struct ast_dial *dial) |
Steal the channel that answered. More... | |
int | ast_dial_append (struct ast_dial *dial, const char *tech, const char *device, const struct ast_assigned_ids *assignedids) |
Append a channel. More... | |
int | ast_dial_append_channel (struct ast_dial *dial, struct ast_channel *chan) |
Append a channel using an actual channel object. More... | |
struct ast_dial * | ast_dial_create (void) |
New dialing structure. More... | |
int | ast_dial_destroy (struct ast_dial *dial) |
Destroys a dialing structure. More... | |
struct ast_channel * | ast_dial_get_channel (struct ast_dial *dial, int num) |
Get the dialing channel, if prerun has been executed. More... | |
void * | ast_dial_get_user_data (struct ast_dial *dial) |
Return the user data on a dial structure. More... | |
void | ast_dial_hangup (struct ast_dial *dial) |
Hangup channels. More... | |
enum ast_dial_result | ast_dial_join (struct ast_dial *dial) |
Cancel async thread. More... | |
int | ast_dial_option_disable (struct ast_dial *dial, int num, enum ast_dial_option option) |
Disables an option per channel. More... | |
int | ast_dial_option_enable (struct ast_dial *dial, int num, enum ast_dial_option option, void *data) |
Enables an option per channel. More... | |
int | ast_dial_option_global_disable (struct ast_dial *dial, enum ast_dial_option option) |
Disables an option globally. More... | |
int | ast_dial_option_global_enable (struct ast_dial *dial, enum ast_dial_option option, void *data) |
Enables an option globally. More... | |
int | ast_dial_prerun (struct ast_dial *dial, struct ast_channel *chan, struct ast_format_cap *cap) |
Request all appended channels, but do not dial. More... | |
int | ast_dial_reason (struct ast_dial *dial, int num) |
Get the reason an outgoing channel has failed. More... | |
enum ast_dial_result | ast_dial_run (struct ast_dial *dial, struct ast_channel *chan, int async) |
Execute dialing synchronously or asynchronously. More... | |
void | ast_dial_set_global_timeout (struct ast_dial *dial, int timeout) |
Set the maximum time (globally) allowed for trying to ring phones. More... | |
void | ast_dial_set_state_callback (struct ast_dial *dial, ast_dial_state_callback callback) |
Set a callback for state changes. More... | |
void | ast_dial_set_timeout (struct ast_dial *dial, int num, int timeout) |
Set the maximum time (per channel) allowed for trying to ring the phone. More... | |
void | ast_dial_set_user_data (struct ast_dial *dial, void *user_data) |
Set user data on a dial structure. More... | |
enum ast_dial_result | ast_dial_state (struct ast_dial *dial) |
Return state of dial. More... | |
const char * | ast_hangup_cause_to_dial_status (int hangup_cause) |
Convert a hangup cause to a publishable dial status. More... | |
static void * | async_dial (void *data) |
Dial async thread function. More... | |
static int | begin_dial (struct ast_dial *dial, struct ast_channel *chan, int async) |
Helper function that does the beginning dialing per dial structure. More... | |
static int | begin_dial_channel (struct ast_dial_channel *channel, struct ast_channel *chan, int async, const char *predial_string, struct ast_channel *forwarder_chan) |
Helper function that does the beginning dialing per-appended channel. More... | |
static int | begin_dial_prerun (struct ast_dial_channel *channel, struct ast_channel *chan, struct ast_format_cap *cap, const char *predial_string) |
Helper function that requests all channels. More... | |
static int | dial_append_common (struct ast_dial *dial, struct ast_dial_channel *channel, const char *tech, const char *device, const struct ast_assigned_ids *assignedids) |
static struct ast_dial_channel * | find_dial_channel (struct ast_dial *dial, int num) |
Helper function for finding a channel in a dial structure based on number. More... | |
static struct ast_dial_channel * | find_relative_dial_channel (struct ast_dial *dial, struct ast_channel *owner) |
Helper function that finds the dialed channel based on owner. More... | |
static int | handle_call_forward (struct ast_dial *dial, struct ast_dial_channel *channel, struct ast_channel *chan) |
Helper function to handle channels that have been call forwarded. More... | |
static void | handle_frame (struct ast_dial *dial, struct ast_dial_channel *channel, struct ast_frame *fr, struct ast_channel *chan) |
Helper function that handles frames. More... | |
static int | handle_timeout_trip (struct ast_dial *dial, struct timeval start) |
Helper function to handle when a timeout occurs on dialing attempt. More... | |
static enum ast_dial_result | monitor_dial (struct ast_dial *dial, struct ast_channel *chan) |
Helper function that basically keeps tabs on dialing attempts. More... | |
static int | music_disable (void *data) |
static void * | music_enable (void *data) |
static int | predial_disable (void *data) |
static void * | predial_enable (void *data) |
static void | set_state (struct ast_dial *dial, enum ast_dial_result state) |
Variables | |
static const struct ast_option_types | option_types [] |
Map options to respective handlers (enable/disable). More... | |
Dialing API.
Definition in file dial.c.
#define AST_MAX_WATCHERS 256 |
#define FIND_RELATIVE_OPTION | ( | dial, | |
dial_channel, | |||
ast_dial_option | |||
) | (dial_channel->options[ast_dial_option] ? dial_channel->options[ast_dial_option] : dial->options[ast_dial_option]) |
#define IS_CALLER | ( | chan, | |
owner | |||
) | (chan == owner ? 1 : 0) |
typedef int(* ast_dial_option_cb_disable) (void *data) |
typedef void *(* ast_dial_option_cb_enable) (void *data) |
|
static |
Disable function for 'ANSWER_EXEC' option.
Definition at line 116 of file dial.c.
References answer_exec_struct::args, and ast_free.
|
static |
Enable function for 'ANSWER_EXEC' option.
Definition at line 90 of file dial.c.
References app, answer_exec_struct::app, answer_exec_struct::args, args, ast_calloc, ast_copy_string(), ast_strdup, ast_strdupa, ast_strlen_zero(), and NULL.
|
static |
Application execution function for 'ANSWER_EXEC' option.
Definition at line 166 of file dial.c.
References app, args, ast_hangup(), ast_mutex_lock, ast_mutex_unlock, ast_pbx_exec_application(), AST_PTHREADT_STOP, ast_dial::lock, NULL, ast_dial_channel::owner, and ast_dial::thread.
Referenced by monitor_dial().
struct ast_channel * ast_dial_answered | ( | struct ast_dial * | dial | ) |
Return channel that answered.
dial | Dialing structure |
Definition at line 977 of file dial.c.
References AST_DIAL_RESULT_ANSWERED, AST_LIST_FIRST, ast_dial::channels, NULL, and ast_dial::state.
Referenced by ari_originate_dial(), dial_trunk(), page_state_callback(), and sla_handle_dial_state_event().
struct ast_channel * ast_dial_answered_steal | ( | struct ast_dial * | dial | ) |
Steal the channel that answered.
dial | Dialing structure |
Definition at line 989 of file dial.c.
References AST_DIAL_RESULT_ANSWERED, AST_LIST_FIRST, ast_dial::channels, NULL, and ast_dial::state.
Referenced by ari_originate_dial(), do_notify(), pbx_outgoing_exec(), and recall_callback().
int ast_dial_append | ( | struct ast_dial * | dial, |
const char * | tech, | ||
const char * | device, | ||
const struct ast_assigned_ids * | assignedids | ||
) |
Append a channel.
Definition at line 280 of file dial.c.
References ast_calloc, ast_dial_channel::device, dial_append_common(), NULL, and ast_dial_channel::tech.
Referenced by ari_channels_handle_originate_with_id(), dial_trunk(), do_notify(), page_exec(), pbx_outgoing_attempt(), recalling_enter(), and sla_ring_station().
int ast_dial_append_channel | ( | struct ast_dial * | dial, |
struct ast_channel * | chan | ||
) |
Append a channel using an actual channel object.
dial | The ast_dial to add the channel to |
chan | The channel to add to the dial |
-1 | Failure |
non-zero | The position of the channel in the list of dialed channels |
Definition at line 295 of file dial.c.
References ast_calloc, ast_channel_name(), ast_free, ast_strdupa, ast_dial_channel::device, dial_append_common(), NULL, ast_dial_channel::owner, and ast_dial_channel::tech.
struct ast_dial * ast_dial_create | ( | void | ) |
New dialing structure.
Definition at line 223 of file dial.c.
References ast_dial::actual_timeout, ast_calloc, AST_LIST_HEAD_INIT, ast_mutex_init, AST_PTHREADT_NULL, ast_dial::channels, ast_dial::lock, NULL, ast_dial::thread, and ast_dial::timeout.
Referenced by ari_channels_handle_originate_with_id(), dial_trunk(), do_notify(), page_exec(), pbx_outgoing_attempt(), recalling_enter(), and sla_ring_station().
int ast_dial_destroy | ( | struct ast_dial * | dial | ) |
Destroys a dialing structure.
dial | Dialing structure to free |
0 | on success |
-1 | on failure |
Definition at line 1091 of file dial.c.
References ast_dial_channel::assignedid1, ast_dial_channel::assignedid2, AST_DIAL_OPTION_MAX, ast_free, ast_hangup(), AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_mutex_destroy, ast_dial::channels, ast_dial_channel::device, ast_option_types::disable, ast_dial_channel::list, ast_dial::lock, NULL, option_types, ast_dial::options, ast_dial_channel::options, ast_dial_channel::owner, and ast_dial_channel::tech.
Referenced by ari_channels_handle_originate_with_id(), ari_originate_dial(), dial_trunk(), do_notify(), monitor_dial(), page_exec(), pbx_outgoing_destroy(), recalling_exit(), run_station(), sla_handle_dial_state_event(), sla_hangup_stations(), sla_ring_station(), and sla_stop_ringing_station().
struct ast_channel * ast_dial_get_channel | ( | struct ast_dial * | dial, |
int | num | ||
) |
Get the dialing channel, if prerun has been executed.
dial | Dial structure |
num | Channel number to get channel of |
Definition at line 1258 of file dial.c.
References AST_LIST_EMPTY, ast_dial::channels, find_dial_channel(), NULL, ast_dial_channel::num, and ast_dial_channel::owner.
Referenced by ari_channels_handle_originate_with_id(), pbx_outgoing_attempt(), pbx_outgoing_state_callback(), and recalling_enter().
void * ast_dial_get_user_data | ( | struct ast_dial * | dial | ) |
Return the user data on a dial structure.
dial | The dial structure |
Definition at line 1279 of file dial.c.
References ast_dial::user_data.
Referenced by ari_originate_dial(), page_state_callback(), and recall_callback().
void ast_dial_hangup | ( | struct ast_dial * | dial | ) |
Hangup channels.
dial | Dialing structure |
Definition at line 1074 of file dial.c.
References ast_hangup(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_dial::channels, ast_dial_channel::list, NULL, and ast_dial_channel::owner.
Referenced by ast_dial_run(), and page_exec().
enum ast_dial_result ast_dial_join | ( | struct ast_dial * | dial | ) |
Cancel async thread.
dial | Dialing structure |
Definition at line 1017 of file dial.c.
References ast_channel_lock, ast_channel_unlock, AST_DIAL_RESULT_FAILED, AST_LIST_FIRST, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_mutex_lock, ast_mutex_unlock, AST_PTHREADT_NULL, AST_PTHREADT_STOP, ast_softhangup(), AST_SOFTHANGUP_EXPLICIT, ast_dial::channels, ast_dial_channel::list, ast_dial::lock, NULL, ast_dial_channel::owner, ast_dial::state, thread, and ast_dial::thread.
Referenced by dial_trunk(), page_exec(), recalling_exit(), run_station(), sla_handle_dial_state_event(), sla_hangup_stations(), sla_ring_station(), and sla_stop_ringing_station().
int ast_dial_option_disable | ( | struct ast_dial * | dial, |
int | num, | ||
enum ast_dial_option | option | ||
) |
Disables an option per channel.
dial | Dial structure |
num | Channel number to disable option on |
option | Option to disable |
0 | on success |
-1 | on failure |
Definition at line 1222 of file dial.c.
References AST_LIST_EMPTY, ast_dial::channels, ast_option_types::disable, find_dial_channel(), NULL, ast_dial_channel::num, option_types, and ast_dial_channel::options.
int ast_dial_option_enable | ( | struct ast_dial * | dial, |
int | num, | ||
enum ast_dial_option | option, | ||
void * | data | ||
) |
Enables an option per channel.
dial | Dial structure |
num | Channel number to enable option on |
option | Option to enable |
data | Data to pass to this option (not always needed) |
0 | on success |
-1 | on failure |
Definition at line 1181 of file dial.c.
References AST_LIST_EMPTY, ast_dial::channels, ast_option_types::enable, find_dial_channel(), NULL, ast_dial_channel::num, option_types, and ast_dial_channel::options.
int ast_dial_option_global_disable | ( | struct ast_dial * | dial, |
enum ast_dial_option | option | ||
) |
Disables an option globally.
dial | Dial structure to disable option on |
option | Option to disable |
0 | on success |
-1 | on failure |
Definition at line 1205 of file dial.c.
References ast_option_types::disable, NULL, option_types, and ast_dial::options.
int ast_dial_option_global_enable | ( | struct ast_dial * | dial, |
enum ast_dial_option | option, | ||
void * | data | ||
) |
Enables an option globally.
dial | Dial structure to enable option on |
option | Option to enable |
data | Data to pass to this option (not always needed) |
0 | on success |
-1 | on failure |
Definition at line 1145 of file dial.c.
References ast_option_types::enable, option_types, and ast_dial::options.
Referenced by do_notify(), page_exec(), and pbx_outgoing_attempt().
int ast_dial_prerun | ( | struct ast_dial * | dial, |
struct ast_channel * | chan, | ||
struct ast_format_cap * | cap | ||
) |
Request all appended channels, but do not dial.
dial | Dialing structure |
chan | Optional dialing channel |
cap | Optional requested capabilities |
-1 | failure |
0 | success |
Definition at line 431 of file dial.c.
References AST_DIAL_OPTION_PREDIAL, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, begin_dial_prerun(), ast_dial::channels, ast_dial_channel::list, and ast_dial::options.
Referenced by ari_channels_handle_originate_with_id(), pbx_outgoing_attempt(), and recalling_enter().
int ast_dial_reason | ( | struct ast_dial * | dial, |
int | num | ||
) |
Get the reason an outgoing channel has failed.
dial | Dial structure |
num | Channel number to get the reason from |
Definition at line 1247 of file dial.c.
References AST_LIST_EMPTY, ast_dial_channel::cause, ast_dial::channels, find_dial_channel(), and ast_dial_channel::num.
Referenced by pbx_outgoing_attempt().
enum ast_dial_result ast_dial_run | ( | struct ast_dial * | dial, |
struct ast_channel * | chan, | ||
int | async | ||
) |
Execute dialing synchronously or asynchronously.
Definition at line 935 of file dial.c.
References ast_debug, ast_dial_hangup(), AST_DIAL_RESULT_FAILED, AST_DIAL_RESULT_INVALID, AST_DIAL_RESULT_TRYING, AST_LIST_EMPTY, ast_pthread_create, ast_read_threadstorage_callid(), async_dial(), begin_dial(), ast_dial::callid, ast_dial::channels, monitor_dial(), NULL, ast_dial::state, and ast_dial::thread.
Referenced by ari_originate_dial(), dial_trunk(), do_notify(), page_exec(), pbx_outgoing_exec(), recalling_enter(), and sla_ring_station().
void ast_dial_set_global_timeout | ( | struct ast_dial * | dial, |
int | timeout | ||
) |
Set the maximum time (globally) allowed for trying to ring phones.
dial | The dial structure to apply the time limit to |
timeout | Maximum time allowed in milliseconds |
Definition at line 1284 of file dial.c.
References ast_dial::actual_timeout, ast_dial::timeout, and ast_dial_channel::timeout.
Referenced by ari_channels_handle_originate_with_id(), do_notify(), page_exec(), and pbx_outgoing_attempt().
void ast_dial_set_state_callback | ( | struct ast_dial * | dial, |
ast_dial_state_callback | callback | ||
) |
Set a callback for state changes.
dial | The dial structure to watch for state changes |
callback | the callback |
Definition at line 1269 of file dial.c.
References ast_dial::state_callback.
Referenced by page_exec(), pbx_outgoing_attempt(), recalling_enter(), and sla_ring_station().
void ast_dial_set_timeout | ( | struct ast_dial * | dial, |
int | num, | ||
int | timeout | ||
) |
Set the maximum time (per channel) allowed for trying to ring the phone.
dial | The dial structure the channel belongs to |
num | Channel number to set timeout on |
timeout | Maximum time allowed in milliseconds |
Definition at line 1294 of file dial.c.
References ast_dial::actual_timeout, find_dial_channel(), NULL, ast_dial_channel::num, and ast_dial_channel::timeout.
void ast_dial_set_user_data | ( | struct ast_dial * | dial, |
void * | user_data | ||
) |
Set user data on a dial structure.
dial | The dial structure to set a user data pointer on |
user_data | The user data pointer |
Definition at line 1274 of file dial.c.
References ast_dial::user_data.
Referenced by ari_channels_handle_originate_with_id(), page_exec(), and recalling_enter().
enum ast_dial_result ast_dial_state | ( | struct ast_dial * | dial | ) |
Return state of dial.
dial | Dialing structure |
Definition at line 1008 of file dial.c.
References ast_dial::state.
Referenced by dial_trunk(), page_state_callback(), pbx_outgoing_state_callback(), recall_callback(), and sla_handle_dial_state_event().
const char * ast_hangup_cause_to_dial_status | ( | int | hangup_cause | ) |
Convert a hangup cause to a publishable dial status.
Definition at line 749 of file dial.c.
References AST_CAUSE_BUSY, AST_CAUSE_CONGESTION, AST_CAUSE_NO_ANSWER, AST_CAUSE_NO_ROUTE_DESTINATION, and AST_CAUSE_UNREGISTERED.
Referenced by monitor_dial(), try_calling(), and wait_for_answer().
|
static |
Dial async thread function.
Definition at line 918 of file dial.c.
References ast_callid_threadassoc_add(), ast_dial::callid, monitor_dial(), and NULL.
Referenced by ast_dial_run().
|
static |
Helper function that does the beginning dialing per dial structure.
Definition at line 481 of file dial.c.
References AST_DIAL_OPTION_PREDIAL, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, begin_dial_channel(), ast_dial::channels, ast_dial_channel::list, NULL, and ast_dial::options.
Referenced by ast_dial_run().
|
static |
Helper function that does the beginning dialing per-appended channel.
Definition at line 449 of file dial.c.
References ast_call(), ast_channel_lock, AST_CHANNEL_NAME, ast_channel_name(), ast_channel_publish_dial(), ast_channel_unlock, ast_copy_string(), ast_hangup(), ast_verb, begin_dial_prerun(), ast_dial_channel::device, NULL, ast_dial_channel::owner, and pbx_builtin_setvar_helper().
Referenced by begin_dial(), and handle_call_forward().
|
static |
Helper function that requests all channels.
Definition at line 330 of file dial.c.
References ao2_bump, ao2_cleanup, ast_dial_channel::assignedid1, ast_dial_channel::assignedid2, ast_autoservice_start(), ast_autoservice_stop(), ast_channel_adsicpe_set(), ast_channel_appl_set(), ast_channel_caller(), ast_channel_connected(), ast_channel_data_set(), ast_channel_datastore_inherit(), ast_channel_dialed(), ast_channel_inherit_variables(), ast_channel_language(), ast_channel_lock, ast_channel_lock_both, ast_channel_musicclass(), ast_channel_name(), ast_channel_nativeformats(), ast_channel_redirecting(), ast_channel_req_accountcodes(), AST_CHANNEL_REQUESTOR_BRIDGE_PEER, AST_CHANNEL_REQUESTOR_REPLACEMENT, ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_transfercapability(), ast_channel_transfercapability_set(), ast_channel_unlock, ast_channel_whentohangup(), ast_connected_line_copy_from_caller(), AST_DIAL_OPTION_DIAL_REPLACES_SELF, ast_format_cap_alloc, ast_format_cap_append_by_type(), ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, ast_max_forwards_decrement(), ast_max_forwards_get(), AST_MEDIA_TYPE_AUDIO, ast_party_redirecting_copy(), ast_pre_call(), ast_request(), ast_strlen_zero(), ast_dial_channel::cause, ast_dial_channel::device, LOG_WARNING, NULL, ast_dial_channel::options, ast_dial_channel::owner, ast_dial_channel::tech, ast_party_dialed::transit_network_select, and ast_assigned_ids::uniqueid.
Referenced by ast_dial_prerun(), and begin_dial_channel().
|
static |
Definition at line 247 of file dial.c.
References ast_dial_channel::assignedid1, ast_dial_channel::assignedid2, ast_atomic_fetchadd_int(), AST_LIST_INSERT_TAIL, ast_strdup, ast_strlen_zero(), ast_dial::channels, ast_dial_channel::device, ast_dial::num, ast_dial_channel::num, ast_dial_channel::tech, ast_dial_channel::timeout, ast_assigned_ids::uniqueid, and ast_assigned_ids::uniqueid2.
Referenced by ast_dial_append(), and ast_dial_append_channel().
|
static |
Helper function for finding a channel in a dial structure based on number.
Definition at line 1162 of file dial.c.
References AST_LIST_LAST, AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_dial::channels, ast_dial_channel::list, and ast_dial_channel::num.
Referenced by ast_dial_get_channel(), ast_dial_option_disable(), ast_dial_option_enable(), ast_dial_reason(), and ast_dial_set_timeout().
|
static |
Helper function that finds the dialed channel based on owner.
Definition at line 557 of file dial.c.
References AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_dial::channels, ast_dial_channel::list, NULL, and ast_dial_channel::owner.
Referenced by monitor_dial().
|
static |
Helper function to handle channels that have been call forwarded.
Definition at line 499 of file dial.c.
References ast_dial_channel::assignedid1, ast_dial_channel::assignedid2, ast_channel_call_forward(), ast_channel_context(), ast_channel_lock, ast_channel_publish_dial_forward(), ast_channel_unlock, AST_DIAL_OPTION_DISABLE_CALL_FORWARDING, AST_DIAL_OPTION_PREDIAL, ast_free, ast_hangup(), AST_LIST_UNLOCK, AST_MAX_CONTEXT, AST_MAX_EXTENSION, ast_strdup, ast_strdupa, begin_dial_channel(), ast_dial::channels, ast_dial_channel::device, FIND_RELATIVE_OPTION, NULL, ast_dial::options, ast_dial_channel::owner, pbx_builtin_getvar_helper(), S_OR, ast_channel::tech, ast_dial_channel::tech, and tmp().
Referenced by monitor_dial().
|
static |
Helper function that handles frames.
Definition at line 580 of file dial.c.
References AST_CAUSE_NORMAL_CIRCUIT_CONGESTION, AST_CAUSE_UNALLOCATED, AST_CAUSE_USER_BUSY, ast_channel_connected_line_sub(), ast_channel_exten(), ast_channel_name(), ast_channel_publish_dial(), ast_channel_redirecting_sub(), AST_CONTROL_ANSWER, AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_CONNECTED_LINE, AST_CONTROL_FLASH, AST_CONTROL_HOLD, AST_CONTROL_INCOMPLETE, AST_CONTROL_OFFHOOK, AST_CONTROL_PROCEEDING, AST_CONTROL_PROGRESS, AST_CONTROL_PVT_CAUSE_CODE, AST_CONTROL_REDIRECTING, AST_CONTROL_RINGING, AST_CONTROL_SRCUPDATE, AST_CONTROL_UNHOLD, AST_CONTROL_VIDUPDATE, AST_DIAL_OPTION_MUSIC, AST_DIAL_RESULT_ANSWERED, AST_DIAL_RESULT_PROCEEDING, AST_DIAL_RESULT_PROGRESS, AST_DIAL_RESULT_RINGING, AST_FRAME_CONTROL, ast_hangup(), ast_indicate(), ast_indicate_data(), AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_REMOVE, AST_LIST_UNLOCK, ast_verb, ast_dial_channel::cause, ast_dial::channels, ast_frame::data, ast_frame::datalen, ast_dial_channel::device, ast_frame::frametype, ast_frame_subclass::integer, ast_dial_channel::list, NULL, ast_dial::options, ast_dial_channel::owner, ast_frame::ptr, set_state(), and ast_frame::subclass.
Referenced by monitor_dial().
|
static |
Helper function to handle when a timeout occurs on dialing attempt.
Definition at line 715 of file dial.c.
References AST_CAUSE_NO_ANSWER, AST_DIAL_RESULT_TIMEOUT, ast_hangup(), AST_LIST_TRAVERSE, ast_tvdiff_ms(), ast_tvnow(), ast_dial_channel::cause, ast_dial::channels, ast_dial_channel::list, NULL, ast_dial_channel::owner, set_state(), ast_dial::state, ast_dial::timeout, and ast_dial_channel::timeout.
Referenced by monitor_dial().
|
static |
Helper function that basically keeps tabs on dialing attempts.
Definition at line 766 of file dial.c.
References ast_dial::actual_timeout, answer_exec_run(), answer_exec_struct::app, answer_exec_struct::args, AST_CAUSE_ANSWERED_ELSEWHERE, AST_CAUSE_NORMAL_CLEARING, ast_channel_call_forward(), ast_channel_hangupcause(), ast_channel_musicclass(), ast_channel_publish_dial(), AST_CONTROL_RINGING, ast_dial_destroy(), AST_DIAL_OPTION_ANSWER_EXEC, AST_DIAL_OPTION_MUSIC, AST_DIAL_OPTION_RINGING, AST_DIAL_OPTION_SELF_DESTROY, AST_DIAL_RESULT_ANSWERED, AST_DIAL_RESULT_HANGUP, AST_DIAL_RESULT_RINGING, AST_DIAL_RESULT_TIMEOUT, AST_DIAL_RESULT_TRYING, AST_DIAL_RESULT_UNANSWERED, ast_frfree, ast_hangup(), ast_hangup_cause_to_dial_status(), ast_indicate(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, AST_MAX_WATCHERS, ast_moh_start(), ast_moh_stop(), AST_PTHREADT_STOP, ast_read(), ast_strdupa, ast_strlen_zero(), ast_tvnow(), ast_waitfor_n(), ast_dial_channel::cause, ast_dial::channels, ast_dial_channel::device, find_relative_dial_channel(), FIND_RELATIVE_OPTION, handle_call_forward(), handle_frame(), handle_timeout_trip(), IS_CALLER, ast_dial_channel::is_running_app, NULL, ast_dial::options, ast_dial_channel::owner, set_state(), state, ast_dial::state, ast_dial::thread, and ast_dial_channel::timeout.
Referenced by ast_dial_run(), and async_dial().
|
static |
|
static |
Definition at line 134 of file dial.c.
References ast_strdup.
|
static |
|
static |
Definition at line 149 of file dial.c.
References ast_strdup.
|
static |
Definition at line 571 of file dial.c.
References state, ast_dial::state, and ast_dial::state_callback.
Referenced by handle_frame(), handle_timeout_trip(), and monitor_dial().
|
static |
Map options to respective handlers (enable/disable).
Definition at line 199 of file dial.c.
Referenced by ast_dial_destroy(), ast_dial_option_disable(), ast_dial_option_enable(), ast_dial_option_global_disable(), and ast_dial_option_global_enable().