Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Parking Bridge DTMF and Interval features. More...
#include "asterisk.h"
#include "res_parking.h"
#include "asterisk/utils.h"
#include "asterisk/astobj2.h"
#include "asterisk/logger.h"
#include "asterisk/pbx.h"
#include "asterisk/app.h"
#include "asterisk/bridge.h"
#include "asterisk/bridge_internal.h"
#include "asterisk/bridge_channel.h"
#include "asterisk/bridge_features.h"
#include "asterisk/conversions.h"
#include "asterisk/features.h"
#include "asterisk/say.h"
#include "asterisk/datastore.h"
#include "asterisk/stasis.h"
#include "asterisk/module.h"
#include "asterisk/core_local.h"
#include "asterisk/causes.h"
Go to the source code of this file.
Data Structures | |
struct | parked_subscription_data |
struct | parked_subscription_datastore |
Functions | |
int | create_parked_subscription (struct ast_channel *chan, const char *parkee_uuid, int hangup_after) |
Create a parking announcement subscription. More... | |
static int | create_parked_subscription_full (struct ast_channel *chan, const char *parkee_uuid, int hangup_after, struct transfer_channel_data *parked_channel_data) |
static int | feature_park_call (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static int | func_get_parkingslot_channel (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
Dial plan function to get the parking lot channel of an occupied parking lot. More... | |
int | load_parking_bridge_features (void) |
Register bridge features for parking. More... | |
static struct ast_channel * | park_local_transfer (struct ast_channel *parker, const char *context, const char *exten, struct transfer_channel_data *parked_channel_data) |
static void | parked_subscription_datastore_destroy (void *data) |
static void | parker_parked_call_message_response (struct ast_parked_call_payload *message, struct parked_subscription_data *data, struct stasis_subscription *sub) |
static void | parker_update_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static int | parking_blind_transfer_park (struct ast_bridge_channel *bridge_channel, const char *context, const char *exten, transfer_channel_cb parked_channel_cb, struct transfer_channel_data *parked_channel_data) |
static int | parking_duration_callback (struct ast_bridge_channel *bridge_channel, void *hook_pvt) |
static int | parking_is_exten_park (const char *context, const char *exten) |
static int | parking_park_bridge_channel (struct ast_bridge_channel *bridge_channel, const char *uuid_parkee, const char *uuid_parker, const char *app_data) |
static int | parking_park_call (struct ast_bridge_channel *parker, char *exten, size_t length) |
void | parking_set_duration (struct ast_bridge_features *features, struct parked_user *user) |
Setup timeout interval feature on an ast_bridge_features for parking. More... | |
static void | parking_timeout_set_caller_features (struct ast_channel *chan, struct parking_lot_cfg *cfg) |
void | say_parking_space (struct ast_bridge_channel *bridge_channel, const char *payload) |
custom callback function for ast_bridge_channel_queue_playfile which plays a parking space and optionally hangs up the call afterwards based on the payload in playfile. More... | |
void | unload_parking_bridge_features (void) |
Unregister features registered by load_parking_bridge_features. More... | |
static void | wipe_subscription_datastore (struct ast_channel *chan) |
Variables | |
static struct ast_custom_function | getparkingslotchannel_function |
static const struct ast_datastore_info | parked_subscription_info |
struct ast_parking_bridge_feature_fn_table | parking_provider |
Parking Bridge DTMF and Interval features.
Definition in file parking_bridge_features.c.
int create_parked_subscription | ( | struct ast_channel * | chan, |
const char * | parkee_uuid, | ||
int | hangup_after | ||
) |
Create a parking announcement subscription.
chan | Channel that will receive the announcement |
parkee_uuid | Unique ID of the channel being parked |
hangup_after | if non-zero, have the channel hangup after hearing the announcement |
0 | on success |
-1 | on failure |
Definition at line 233 of file parking_bridge_features.c.
References create_parked_subscription_full(), parked_subscription_data::hangup_after, NULL, and parked_subscription_data::parkee_uuid.
Referenced by manager_park(), and manager_park_bridged().
|
static |
Definition at line 174 of file parking_bridge_features.c.
References ao2_ref, ast_calloc, ast_channel_datastore_add(), ast_channel_lock, ast_channel_uniqueid(), ast_channel_unlock, ast_copy_string(), ast_datastore_alloc, ast_datastore_free(), ast_free, ast_parked_call_type(), ast_parking_topic(), ast_strdupa, ast_datastore::data, parked_subscription_data::hangup_after, NULL, parked_subscription_datastore::parked_subscription, parked_subscription_info, parked_subscription_data::parkee_uuid, parker_update_cb(), parked_subscription_data::parker_uuid, stasis_subscribe_pool, stasis_subscription_accept_message_type(), stasis_subscription_change_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, stasis_subscription_set_filter(), parked_subscription_data::transfer_data, and wipe_subscription_datastore().
Referenced by create_parked_subscription(), park_local_transfer(), and parking_blind_transfer_park().
|
static |
Definition at line 524 of file parking_bridge_features.c.
References ast_channel::bridge_channel, NULL, parking_park_call(), and SCOPED_MODULE_USE.
Referenced by load_parking_bridge_features().
|
static |
Dial plan function to get the parking lot channel of an occupied parking lot.
Definition at line 731 of file parking_bridge_features.c.
References ao2_cleanup, args, AST_APP_ARG, ast_channel_name(), ast_copy_string(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_str_to_uint(), ast_strlen_zero(), buf, pbx_find_info::data, len(), LOG_ERROR, NULL, parking_lot_find_by_name(), parking_lot_inspect_parked_user(), and RAII_VAR.
int load_parking_bridge_features | ( | void | ) |
Register bridge features for parking.
0 | on success |
-1 | on failure |
Definition at line 800 of file parking_bridge_features.c.
References AST_BRIDGE_BUILTIN_PARKCALL, ast_bridge_features_register(), ast_custom_function_register, ast_parking_register_bridge_features(), feature_park_call(), getparkingslotchannel_function, ast_parking_bridge_feature_fn_table::module, NULL, and parking_provider.
Referenced by load_module().
|
static |
Definition at line 244 of file parking_bridge_features.c.
References ast_assert, ast_bridge_set_transfer_variables(), ast_call(), ast_channel_caller(), ast_channel_connected(), ast_channel_datastore_inherit(), ast_channel_inherit_variables(), ast_channel_lock_both, ast_channel_name(), ast_channel_nativeformats(), ast_channel_parkinglot(), ast_channel_req_accountcodes(), AST_CHANNEL_REQUESTOR_REPLACEMENT, ast_channel_uniqueid(), ast_channel_unlock, ast_channel_unref, ast_connected_line_copy_from_caller(), ast_hangup(), ast_local_get_peer(), AST_MAX_CONTEXT, AST_MAX_EXTENSION, ast_request(), voicemailpwcheck::context, create_parked_subscription_full(), ast_channel::exten, and NULL.
Referenced by parking_blind_transfer_park().
|
static |
Definition at line 76 of file parking_bridge_features.c.
References ast_free, NULL, parked_subscription_datastore::parked_subscription, and stasis_unsubscribe().
|
static |
Definition at line 105 of file parking_bridge_features.c.
References ao2_cleanup, ast_bridge_channel_queue_playfile(), ast_bridge_channel_queue_playfile_sync(), ast_channel_cleanup, ast_channel_get_bridge_channel(), ast_channel_get_by_name(), ast_channel_lock, ast_channel_unlock, ast_channel_snapshot::base, transfer_channel_data::completed, ast_datastore::data, parked_subscription_data::hangup_after, NULL, PARKED_CALL, PARKED_CALL_FAILED, parked_subscription_data::parker_uuid, RAII_VAR, say_parking_space(), parked_subscription_data::transfer_data, ast_channel_snapshot_base::uniqueid, and wipe_subscription_datastore().
Referenced by parker_update_cb().
|
static |
Definition at line 158 of file parking_bridge_features.c.
References ao2_cleanup, ast_free, ast_parked_call_type(), NULL, parker_parked_call_message_response(), stasis_message_data(), stasis_message_type(), stasis_subscription_final_message(), sub, and parked_subscription_data::transfer_data.
Referenced by create_parked_subscription_full().
|
static |
Definition at line 336 of file parking_bridge_features.c.
References ao2_cleanup, ao2_ref, ast_bridge_channel_lock_bridge(), ast_bridge_channel_peer(), ast_bridge_channel_write_park(), ast_bridge_impart(), AST_BRIDGE_IMPART_CHAN_INDEPENDENT, AST_BRIDGE_TRANSFER_MULTI_PARTY, AST_BRIDGE_TRANSFER_SINGLE_PARTY, ast_bridge_unlock, ast_channel_cleanup, ast_channel_ref, ast_channel_uniqueid(), ast_channel_unref, ast_get_extension_app_data(), ast_hangup(), ast_strlen_zero(), ast_bridge_channel::bridge, ast_channel::bridge_channel, ast_bridge_channel::chan, voicemailpwcheck::context, create_parked_subscription_full(), E_MATCH, ast_channel::exten, ast_bridge_channel::in_bridge, NULL, ast_bridge::num_channels, park_local_transfer(), parking_is_exten_park(), pbx_find_extension(), RAII_VAR, and pbx_find_info::stacklen.
Referenced by parking_park_call().
|
static |
Definition at line 573 of file parking_bridge_features.c.
References ao2_lock, ao2_unlock, ast_add_extension2_nolock(), ast_assert, ast_async_parseable_goto(), ast_bridge_channel_leave_bridge(), AST_CAUSE_NORMAL_CLEARING, ast_channel_lock, ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_unlock, ast_context_find_or_create(), ast_debug, ast_free_ptr(), ast_get_extension_registrar(), ast_log, AST_MAX_EXTENSION, ast_strdup, ast_strdupa, ast_strlen_zero(), ast_unlock_context(), ast_unlock_contexts(), ast_wrlock_context(), ast_wrlock_contexts(), BASE_REGISTRAR, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, comeback_goto(), E_MATCH, flatten_dial_string(), LOG_ERROR, NULL, PARK_DIAL_CONTEXT, PARK_TIMEOUT, PARK_UNSET, parking_timeout_set_caller_features(), pbx_builtin_setvar_helper(), pbx_find_extension(), and pbx_find_info::stacklen.
Referenced by parking_set_duration().
|
static |
Definition at line 297 of file parking_bridge_features.c.
References ast_debug, ast_get_extension_app(), voicemailpwcheck::context, E_MATCH, sip_to_pjsip::info(), NULL, PARK_APPLICATION, and pbx_find_extension().
Referenced by parking_blind_transfer_park().
|
static |
Definition at line 434 of file parking_bridge_features.c.
References ao2_cleanup, ao2_lock, ao2_ref, ao2_unlock, ast_bridge_move(), ast_bridge_set_transfer_variables(), ast_channel_get_by_name(), ast_channel_name(), ast_channel_uniqueid(), ast_log, ast_bridge_channel::bridge, ast_channel::bridge_channel, ast_bridge_channel::chan, LOG_ERROR, LOG_NOTICE, NULL, park_application_setup(), publish_parked_call_failure(), and RAII_VAR.
|
static |
Definition at line 499 of file parking_bridge_features.c.
References ao2_cleanup, ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_copy_string(), ast_log, AST_LOG_WARNING, ast_strdupa, ast_bridge_channel::chan, ast_channel::exten, find_channel_parking_lot_name(), NULL, parking_blind_transfer_park(), parking_create_dynamic_lot(), parking_lot_find_by_name(), and RAII_VAR.
Referenced by feature_park_call().
void parking_set_duration | ( | struct ast_bridge_features * | features, |
struct parked_user * | user | ||
) |
Setup timeout interval feature on an ast_bridge_features for parking.
features | The ast_bridge_features we are establishing the interval hook on |
user | The parked_user receiving the timeout duration limits |
Definition at line 703 of file parking_bridge_features.c.
References __ao2_cleanup(), ao2_ref, AST_BRIDGE_HOOK_REMOVE_ON_PULL, ast_bridge_interval_hook(), ast_log, ast_remaining_ms(), LOG_ERROR, and parking_duration_callback().
Referenced by bridge_parking_push().
|
static |
Definition at line 540 of file parking_bridge_features.c.
References AST_FEATURE_FLAG_BYCALLER, parking_lot_cfg::parkedcallhangup, parking_lot_cfg::parkedcallrecording, parking_lot_cfg::parkedcallreparking, parking_lot_cfg::parkedcalltransfers, and pbx_builtin_setvar_helper().
Referenced by parking_duration_callback().
void say_parking_space | ( | struct ast_bridge_channel * | bridge_channel, |
const char * | payload | ||
) |
custom callback function for ast_bridge_channel_queue_playfile which plays a parking space and optionally hangs up the call afterwards based on the payload in playfile.
Definition at line 681 of file parking_bridge_features.c.
References ast_assert, ast_bridge_channel_leave_bridge(), AST_CAUSE_NORMAL_CLEARING, ast_channel_language(), ast_say_digits(), BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, and ast_bridge_channel::chan.
Referenced by bridge_parking_push(), and parker_parked_call_message_response().
void unload_parking_bridge_features | ( | void | ) |
Unregister features registered by load_parking_bridge_features.
Definition at line 793 of file parking_bridge_features.c.
References AST_BRIDGE_BUILTIN_PARKCALL, ast_bridge_features_unregister(), ast_custom_function_unregister(), ast_parking_unregister_bridge_features(), getparkingslotchannel_function, ast_parking_bridge_feature_fn_table::module_name, and parking_provider.
Referenced by unload_module().
|
static |
Definition at line 91 of file parking_bridge_features.c.
References ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, ast_datastore_free(), NULL, and parked_subscription_info.
Referenced by create_parked_subscription_full(), and parker_parked_call_message_response().
|
static |
Definition at line 779 of file parking_bridge_features.c.
Referenced by load_parking_bridge_features(), and unload_parking_bridge_features().
|
static |
Definition at line 86 of file parking_bridge_features.c.
Referenced by create_parked_subscription_full(), and wipe_subscription_datastore().
struct ast_parking_bridge_feature_fn_table parking_provider |
Definition at line 784 of file parking_bridge_features.c.
Referenced by ast_parking_blind_transfer_park(), ast_parking_is_exten_park(), ast_parking_park_bridge_channel(), ast_parking_park_call(), ast_parking_provider_registered(), ast_parking_register_bridge_features(), ast_parking_unregister_bridge_features(), load_parking_bridge_features(), and unload_parking_bridge_features().