Asterisk - The Open Source Telephony Project
21.4.1
|
Call Parking Applications. More...
#include "asterisk.h"
#include "res_parking.h"
#include "asterisk/config.h"
#include "asterisk/config_options.h"
#include "asterisk/utils.h"
#include "asterisk/astobj2.h"
#include "asterisk/features.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
#include "asterisk/say.h"
#include "asterisk/bridge_basic.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | park_announce_subscription_data |
Macros | |
#define | PARK_AND_ANNOUNCE_APPLICATION "ParkAndAnnounce" |
Functions | |
static void | announce_to_dial (char *dial_string, char *announce_string, int parkingspace, struct ast_channel_snapshot *parkee_snapshot) |
static int | apply_option_timeout (int *var, char *timeout_arg) |
struct park_common_datastore * | get_park_common_datastore_copy (struct ast_channel *parkee) |
Get a copy of the park_common_datastore from a channel that is being parked. More... | |
static void | inherit_channel_vars_from_id (struct outgoing_helper *oh, const char *channel_id) |
int | load_parking_applications (void) |
Register parking applications. More... | |
static int | park_and_announce_app_exec (struct ast_channel *chan, const char *data) |
static struct park_announce_subscription_data * | park_announce_subscription_data_create (const char *parkee_uuid, const char *dial_string, const char *announce_string) |
static void | park_announce_subscription_data_destroy (void *data) |
static void | park_announce_update_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static int | park_app_exec (struct ast_channel *chan, const char *data) |
static int | park_app_parse_data (const char *data, int *disable_announce, int *use_ringing, int *randomize, int *time_limit, char **comeback_override, char **lot_name, char **musicclass) |
struct ast_bridge * | park_application_setup (struct ast_channel *parkee, struct ast_channel *parker, const char *app_data, int *silence_announcements) |
Function to prepare a channel for parking by determining which parking bridge should be used, setting up a park common datastore so that the parking bridge will have access to necessary parking information when joining, and applying various bridge roles to the channel. More... | |
static void | park_common_datastore_destroy (void *data) |
void | park_common_datastore_free (struct park_common_datastore *datastore) |
Free a park common datastore struct. More... | |
struct ast_bridge * | park_common_setup (struct ast_channel *parkee, struct ast_channel *parker, const char *lot_name, const char *comeback_override, int use_ringing, int randomize, int time_limit, int silence_announcements) |
Setup a parked call on a parking bridge without needing to parse appdata. More... | |
static struct ast_bridge * | park_common_setup2 (struct ast_channel *parkee, struct ast_channel *parker, const char *lot_name, const char *comeback_override, const char *musicclass, int use_ringing, int randomize, int time_limit, int silence_announcements) |
static int | parked_call_app_exec (struct ast_channel *chan, const char *data) |
static int | setup_park_common_datastore (struct ast_channel *parkee, const char *parker_uuid, const char *comeback_override, int randomize, int time_limit, int silence_announce) |
void | unload_parking_applications (void) |
Unregister parking applications. More... | |
static void | wipe_park_common_datastore (struct ast_channel *chan) |
Variables | |
static const struct ast_datastore_info | park_common_info |
static const struct ast_app_option | park_opts [128] = { [ 'r' ] = { .flag = MUXFLAG_RINGING }, [ 'R' ] = { .flag = MUXFLAG_RANDOMIZE }, [ 's' ] = { .flag = MUXFLAG_NOANNOUNCE }, [ 'c' ] = { .flag = MUXFLAG_COMEBACK_OVERRIDE , .arg_index = OPT_ARG_COMEBACK + 1 }, [ 't' ] = { .flag = MUXFLAG_TIMEOUT_OVERRIDE , .arg_index = OPT_ARG_TIMEOUT + 1 }, [ 'm' ] = { .flag = MUXFLAG_MUSICONHOLD , .arg_index = OPT_ARG_MUSICONHOLD + 1 }, } |
Call Parking Applications.
Definition in file parking_applications.c.
struct park_common_datastore* get_park_common_datastore_copy | ( | struct ast_channel * | parkee | ) |
Get a copy of the park_common_datastore from a channel that is being parked.
parkee | The channel entering parking with the datastore we are checking |
NULL | if the park_common_datastore could not be copied off of the channel. |
Definition at line 441 of file parking_applications.c.
References ast_calloc, ast_channel_datastore_find(), ast_strdup, park_common_datastore::comeback_override, ast_datastore::data, lock, park_common_datastore_free(), park_common_datastore::parker_dial_string, park_common_datastore::parker_uuid, park_common_datastore::randomize, SCOPED_CHANNELLOCK, park_common_datastore::silence_announce, and park_common_datastore::time_limit.
int load_parking_applications | ( | void | ) |
Register parking applications.
0 | if successful |
-1 | on failure |
Definition at line 1008 of file parking_applications.c.
References ast_register_application_xml, and PARK_APPLICATION.
struct ast_bridge* park_application_setup | ( | struct ast_channel * | parkee, |
struct ast_channel * | parker, | ||
const char * | app_data, | ||
int * | silence_announcements | ||
) |
Function to prepare a channel for parking by determining which parking bridge should be used, setting up a park common datastore so that the parking bridge will have access to necessary parking information when joining, and applying various bridge roles to the channel.
parkee | The channel being prepared for parking |
parker | The channel initiating the park; may be the parkee as well. May be NULL. |
app_data | arguments supplied to the Park application. May be NULL. |
silence_announcements | optional pointer to an integer where we want to store the silence option flag this value should be initialized to 0 prior to calling park_common_setup. |
NULL | on failure |
Definition at line 545 of file parking_applications.c.
References RAII_VAR.
void park_common_datastore_free | ( | struct park_common_datastore * | datastore | ) |
Free a park common datastore struct.
datastore | The park_common_datastore being free'd. (NULL tolerant) |
Definition at line 335 of file parking_applications.c.
References park_common_datastore::comeback_override, park_common_datastore::parker_dial_string, and park_common_datastore::parker_uuid.
Referenced by get_park_common_datastore_copy().
struct ast_bridge* park_common_setup | ( | struct ast_channel * | parkee, |
struct ast_channel * | parker, | ||
const char * | lot_name, | ||
const char * | comeback_override, | ||
int | use_ringing, | ||
int | randomize, | ||
int | time_limit, | ||
int | silence_announcements | ||
) |
Setup a parked call on a parking bridge without needing to parse appdata.
Definition at line 538 of file parking_applications.c.
void unload_parking_applications | ( | void | ) |
Unregister parking applications.
Definition at line 1025 of file parking_applications.c.
References ast_unregister_application(), and PARK_APPLICATION.
|
static |
Definition at line 353 of file parking_applications.c.