Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Call Pickup API. More...
Go to the source code of this file.
Functions | |
struct stasis_message_type * | ast_call_pickup_type (void) |
accessor for call pickup message type More... | |
int | ast_can_pickup (struct ast_channel *chan) |
Test if a channel can be picked up. More... | |
int | ast_do_pickup (struct ast_channel *chan, struct ast_channel *target) |
Pickup a call target. More... | |
int | ast_pickup_call (struct ast_channel *chan) |
Pickup a call. More... | |
struct ast_channel * | ast_pickup_find_by_group (struct ast_channel *chan) |
Find a pickup channel target by group. More... | |
int | ast_pickup_init (void) |
Initialize pickup. More... | |
struct stasis_message_type * ast_call_pickup_type | ( | void | ) |
accessor for call pickup message type
NULL | if not initialized |
Referenced by ast_pickup_init(), create_routes(), pickup_shutdown(), and send_call_pickup_stasis_message().
int ast_can_pickup | ( | struct ast_channel * | chan | ) |
Test if a channel can be picked up.
chan | Channel to test if can be picked up. |
TRUE | if channel can be picked up. |
Definition at line 77 of file pickup.c.
References ast_channel_datastore_find(), ast_channel_flags(), ast_channel_masq(), ast_channel_pbx(), AST_FLAG_ZOMBIE, AST_STATE_DOWN, AST_STATE_RING, AST_STATE_RINGING, ast_test_flag, NULL, and pickup_active.
Referenced by ast_pickup_find_by_group(), find_by_mark(), find_by_name(), find_by_uniqueid(), find_channel_by_group(), and pickup_by_exten().
int ast_do_pickup | ( | struct ast_channel * | chan, |
struct ast_channel * | target | ||
) |
Pickup a call target.
chan | channel that initiated pickup. |
target | channel to be picked up. |
0 | on success. |
-1 | on failure. |
< A masquerade changes channel names.
< A masquerade changes channel names.
Definition at line 301 of file pickup.c.
References ao2_cleanup, ast_answer(), AST_CAUSE_ANSWERED_ELSEWHERE, ast_channel_caller(), ast_channel_connected(), ast_channel_connected_line_sub(), ast_channel_datastore_add(), ast_channel_datastore_remove(), ast_channel_hangupcause_set(), ast_channel_lock, ast_channel_move(), ast_channel_name(), ast_channel_queue_connected_line_update(), ast_channel_snapshot_create(), ast_channel_snapshot_get_latest(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_update_connected_line(), ast_connected_line_copy_from_caller(), AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER, AST_CONTROL_ANSWER, ast_datastore_alloc, ast_datastore_free(), ast_debug, ast_log, ast_party_connected_line_copy(), ast_party_connected_line_free(), ast_party_connected_line_init(), ast_party_id_reset(), ast_queue_control(), ast_strdupa, LOG_WARNING, NULL, pickup_active, ast_party_connected_line::priv, RAII_VAR, send_call_pickup_stasis_message(), and ast_party_connected_line::source.
Referenced by ast_pickup_call(), AST_TEST_DEFINE(), pickup_by_channel(), pickup_by_exten(), pickup_by_group(), pickup_by_mark(), and pickup_by_part().
int ast_pickup_call | ( | struct ast_channel * | chan | ) |
Pickup a call.
chan | The channel that initiated the pickup |
0 | on success |
-1 | on failure |
Walk list of channels, checking it is not itself, channel is pbx one, check that the callgroup for both channels are the same and the channel is ringing. Answer calling channel, flag channel as answered on queue, masq channels together.
< Potential pickup target
Definition at line 199 of file pickup.c.
References ao2_cleanup, ast_answer(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_debug, ast_do_pickup(), ast_get_chan_features_pickup_config(), ast_log, ast_pickup_find_by_group(), ast_strdupa, ast_stream_and_wait(), ast_strlen_zero(), LOG_ERROR, LOG_NOTICE, LOG_WARNING, NULL, pbx_builtin_setvar_helper(), and RAII_VAR.
Referenced by __analog_ss_thread(), analog_ss_thread(), call_pickup_incoming_request(), and handle_call_outgoing().
struct ast_channel * ast_pickup_find_by_group | ( | struct ast_channel * | chan | ) |
Find a pickup channel target by group.
chan | channel that initiated pickup. |
NULL | on error. |
< Candidate channels found to pickup.
< Potential pickup target
< Potential new older target
Definition at line 133 of file pickup.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_list, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ao2_unlink, ast_can_pickup(), ast_channel_callback(), ast_channel_creationtime(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ast_tvcmp(), find_channel_by_group(), and NULL.
Referenced by ast_pickup_call(), and pickup_by_group().
int ast_pickup_init | ( | void | ) |
Initialize pickup.
0 | on success |
non-zero | on failure |
Definition at line 399 of file pickup.c.
References ast_call_pickup_type(), ast_register_cleanup(), pickup_shutdown(), and STASIS_MESSAGE_TYPE_INIT.
Referenced by asterisk_daemon().