Dialing API. More...
Go to the source code of this file.
Typedefs | |
typedef void(* | ast_dial_state_callback )(struct ast_dial *) |
Enumerations | |
enum | ast_dial_option { AST_DIAL_OPTION_RINGING, AST_DIAL_OPTION_ANSWER_EXEC, AST_DIAL_OPTION_MUSIC, AST_DIAL_OPTION_DISABLE_CALL_FORWARDING, AST_DIAL_OPTION_MAX } |
List of options that are applicable either globally or per dialed channel. More... | |
enum | ast_dial_result { AST_DIAL_RESULT_INVALID, AST_DIAL_RESULT_FAILED, AST_DIAL_RESULT_TRYING, AST_DIAL_RESULT_RINGING, AST_DIAL_RESULT_PROGRESS, AST_DIAL_RESULT_PROCEEDING, AST_DIAL_RESULT_ANSWERED, AST_DIAL_RESULT_TIMEOUT, AST_DIAL_RESULT_HANGUP, AST_DIAL_RESULT_UNANSWERED } |
List of return codes for dial run API calls. More... | |
Functions | |
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) |
Append a channel. 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... | |
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... | |
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... | |
enum ast_dial_result | ast_dial_state (struct ast_dial *dial) |
Return state of dial. More... | |
Dialing API.
Definition in file dial.h.
enum ast_dial_option |
List of options that are applicable either globally or per dialed channel.
enum ast_dial_result |
List of return codes for dial run API calls.
struct ast_channel* ast_dial_answered | ( | struct ast_dial * | dial | ) |
Return channel that answered.
dial | Dialing structure |
Definition at line 754 of file dial.c.
References AST_DIAL_RESULT_ANSWERED, AST_LIST_FIRST, ast_dial::channels, and ast_dial::state.
Referenced by dial_trunk(), 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 766 of file dial.c.
References AST_DIAL_RESULT_ANSWERED, AST_LIST_FIRST, ast_dial::channels, and ast_dial::state.
Referenced by do_notify().
int ast_dial_append | ( | struct ast_dial * | dial, |
const char * | tech, | ||
const char * | device | ||
) |
Append a channel.
Definition at line 229 of file dial.c.
References ast_atomic_fetchadd_int(), ast_calloc, AST_LIST_INSERT_TAIL, ast_strdup, ast_dial::channels, ast_dial_channel::device, ast_dial_channel::list, ast_dial::num, ast_dial_channel::num, ast_dial_channel::tech, and ast_dial_channel::timeout.
Referenced by dial_trunk(), do_notify(), page_exec(), and sla_ring_station().
struct ast_dial* ast_dial_create | ( | void | ) |
New dialing structure.
Definition at line 201 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, ast_dial::thread, and ast_dial::timeout.
Referenced by dial_trunk(), do_notify(), page_exec(), and sla_ring_station().
int ast_dial_destroy | ( | struct ast_dial * | dial | ) |
Destroys a dialing structure.
dial | Dialing structure to free |
dial | Dialing structure to free |
Definition at line 866 of file dial.c.
References 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, ast_dial::options, ast_dial_channel::options, ast_dial_channel::owner, and ast_dial_channel::tech.
Referenced by dial_trunk(), do_notify(), page_exec(), run_station(), sla_handle_dial_state_event(), sla_hangup_stations(), sla_ring_station(), and sla_stop_ringing_station().
void ast_dial_hangup | ( | struct ast_dial * | dial | ) |
Hangup channels.
dial | Dialing structure |
Definition at line 842 of file dial.c.
References ast_hangup(), AST_LIST_LOCK, AST_LIST_TRAVERSE, AST_LIST_UNLOCK, ast_dial::channels, ast_dial_channel::list, 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 794 of file dial.c.
References ast_channel_lock, ast_channel_unlock, AST_DIAL_RESULT_FAILED, AST_LIST_FIRST, AST_LIST_LOCK, 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::lock, ast_dial::state, and ast_dial::thread.
Referenced by dial_trunk(), page_exec(), 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 |
Definition at line 1018 of file dial.c.
References AST_LIST_EMPTY, ast_dial::channels, ast_option_types::disable, find_dial_channel(), 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) |
Definition at line 966 of file dial.c.
References AST_LIST_EMPTY, ast_dial::channels, ast_option_types::enable, find_dial_channel(), 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 |
Definition at line 995 of file dial.c.
References ast_option_types::disable, 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) |
Definition at line 923 of file dial.c.
References ast_option_types::enable, and ast_dial::options.
Referenced by do_notify(), and page_exec().
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 714 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, async_dial(), begin_dial(), ast_dial::channels, monitor_dial(), ast_dial::state, and ast_dial::thread.
Referenced by dial_trunk(), do_notify(), page_exec(), 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 |
dial | The dial structure to apply the time limit to |
timeout | Maximum time allowed |
Definition at line 1053 of file dial.c.
References ast_dial::actual_timeout, and ast_dial::timeout.
Referenced by do_notify(), and page_exec().
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 1043 of file dial.c.
References ast_dial::state_callback.
Referenced by 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 |
dial | The dial structure the channel belongs to |
num | Channel number to set timeout on |
timeout | Maximum time allowed |
Definition at line 1069 of file dial.c.
References ast_dial::actual_timeout, find_dial_channel(), ast_dial::timeout, and ast_dial_channel::timeout.
enum ast_dial_result ast_dial_state | ( | struct ast_dial * | dial | ) |
Return state of dial.
dial | Dialing structure |
Definition at line 785 of file dial.c.
References ast_dial::state.
Referenced by dial_trunk(), and sla_handle_dial_state_event().