77 char *dial_string =
ast_strdupa(parker_channel_name);
112 int preferred_space = -1;
114 const char *parkingexten;
117 ast_log(
LOG_NOTICE,
"Tried to park in a parking lot that is no longer able to be parked to.\n");
122 if (!new_parked_user) {
126 if (use_random_space) {
137 if (sscanf(parkingexten,
"%30d", &preferred_space) != 1 || preferred_space <= 0) {
138 ast_log(
LOG_WARNING,
"PARKINGEXTEN='%s' is not a valid parking space.\n", parkingexten);
149 if (parking_space == -1) {
157 new_parked_user->
chan = chan;
161 new_parked_user->
lot = lot;
167 if (parker_dial_string) {
187 return new_parked_user;
209 const char *blind_transfer;
211 const char *parker_channel_name =
NULL;
254 ast_log(
LOG_WARNING,
"Failed to apply holding bridge roles to %s while joining the parking lot.\n",
279 parker_channel_name = parker->
base->
name;
284 parker_channel_name = blind_transfer;
287 parker_channel_name = parker->
base->
name;
291 park_datastore->parker_dial_string, park_datastore->randomize, park_datastore->time_limit);
299 if (park_datastore->comeback_override) {
307 if (
ast_strlen_zero(blind_transfer) && !park_datastore->silence_announce) {
310 snprintf(saynum_buf,
sizeof(saynum_buf),
"%d %d", 0, pu->
parking_space);
371 switch (pu->resolution) {
451 self->lot = bridge_lot;
static int bridge_parking_push(struct ast_bridge_parking *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
int ast_bridge_channel_has_role(struct ast_bridge_channel *bridge_channel, const char *role_name)
Check to see if a bridge channel inherited a specific role from its channel.
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
struct ast_channel_snapshot_base * base
int unpark_parked_user(struct parked_user *pu)
Pull a parked user out of its parking lot. Use this when you don't want to use the parked user afterw...
Asterisk main include file. File version handling, generic pbx functions.
struct ast_bridge_features * features
void park_common_datastore_free(struct park_common_datastore *datastore)
Free a park common datastore struct.
struct ast_bridge * bridge_register(struct ast_bridge *bridge)
Register the new bridge with the system.
void parking_notify_metermaids(int exten, const char *context, enum ast_device_state state)
Notify metermaids that we've changed an extension.
int(* ast_bridge_push_channel_fn)(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
Push this channel into the bridge.
int parking_lot_get_space(struct parking_lot *lot, int target_override)
Get an available parking space within a parking lot.
void(* ast_bridge_dissolving_fn)(struct ast_bridge *self)
The bridge is being dissolved.
struct ao2_container * parked_users
Structure representing a snapshot of channel state.
void parked_call_retrieve_enable_features(struct ast_channel *chan, struct parking_lot *lot, int recipient_mode)
Apply features based on the parking lot feature options.
ast_channel_state
ast_channel states
ast_bridge_dissolving_fn dissolving
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
void parking_set_duration(struct ast_bridge_features *features, struct parked_user *user)
Setup timeout interval feature on an ast_bridge_features for parking.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_verb(level,...)
void publish_parked_call(struct parked_user *pu, enum ast_parked_call_event_type event_type)
Publish a stasis parked call message for a given parked user.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
#define COLORIZE(fg, bg, str)
#define ast_strlen_zero(foo)
void publish_parked_call_failure(struct ast_channel *parkee)
Publish a stasis parked call message for the channel indicating failure to park.
struct ast_bridge_methods ast_bridge_base_v_table
Bridge base class virtual method table.
int(* ast_bridge_merge_priority_fn)(struct ast_bridge *self)
Get the merge priority of this bridge.
int parking_channel_set_roles(struct ast_channel *chan, struct parking_lot *lot, int force_ringing)
Set necessary bridge roles on a channel that is about to enter a parking lot.
#define ast_bridge_channel_lock(bridge_channel)
Lock the bridge_channel.
static struct ast_bridge * ast_bridge_parking_init(struct ast_bridge_parking *self, struct parking_lot *bridge_lot)
ast_bridge_notify_masquerade_fn notify_masquerade
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
char * parker_dial_string
#define ao2_ref(o, delta)
#define COLORIZE_FMT
Shortcut macros for coloring a set of text.
long int ast_random(void)
#define ast_strdupa(s)
duplicate a string in memory from the stack
struct ast_bridge * bridge_alloc(size_t size, const struct ast_bridge_methods *v_table)
struct ast_bridge * bridge_base_init(struct ast_bridge *self, uint32_t capabilities, unsigned int flags, const char *creator, const char *name, const char *id)
Initialize the base class of the bridge.
void(* ast_bridge_pull_channel_fn)(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel)
Pull this channel from the bridge.
#define ast_bridge_channel_unlock(bridge_channel)
Unlock the bridge_channel.
Structure that contains information about a bridge.
static int parked_user_set_parker_dial_string(struct parked_user *pu, const char *parker_channel_name)
void ast_channel_name_to_dial_string(char *channel_name)
Removes the trailing identifiers from a channel name string.
#define ao2_alloc(data_size, destructor_fn)
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 option...
struct ast_bridge * bridge_parking_new(struct parking_lot *bridge_lot)
Create a new parking bridge.
static void bridge_parking_pull(struct ast_bridge_parking *self, struct ast_bridge_channel *bridge_channel)
Bridge virtual methods table definition.
#define ast_channel_unlock(chan)
ast_bridge_merge_priority_fn get_merge_priority
void(* ast_bridge_destructor_fn)(struct ast_bridge *self)
Destroy the bridge.
const ast_string_field name
Support for logging to various files, console and syslog Configuration in file logger.conf.
static void bridge_parking_get_merge_priority(struct ast_bridge_parking *self)
struct ast_channel * chan
Structure that contains information regarding a channel in a bridge.
void * bridge_pvt
Bridge class private channel data.
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.
enum parking_lot_modes mode
struct ast_channel_snapshot * ast_channel_snapshot_get_latest(const char *uniqueid)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object...
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
const char * ast_channel_name(const struct ast_channel *chan)
int ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_play_fn custom_play, const char *playfile, const char *moh_class)
Queue a bridge action play file frame onto the bridge channel.
int ast_answer(struct ast_channel *chan)
Answer a channel.
static void destroy_parked_user(void *obj)
static void bridge_parking_destroy(struct ast_bridge_parking *self)
Handy terminal functions for vt* terms.
ast_bridge_pull_channel_fn pull
ast_bridge_destructor_fn destroy
ast_bridge_push_channel_fn push
Call Parking Resource Internal API.
Call Parking and Pickup API Includes code and algorithms from the Zapata library. ...
static void bridge_parking_dissolving(struct ast_bridge_parking *self)
Say numbers and dates (maybe words one day too)
struct ast_channel_snapshot * retriever
const char * ast_bridge_channel_get_role_option(struct ast_bridge_channel *bridge_channel, const char *role_name, const char *option)
Retrieve the value of a requested role option from a bridge channel.
struct ast_channel * chan
static void bridge_parking_notify_masquerade(struct ast_bridge_parking *self, struct ast_bridge_channel *bridge_channel)
static struct parked_user * generate_parked_user(struct parking_lot *lot, struct ast_channel *chan, const char *parker_channel_name, const char *parker_dial_string, int use_random_space, int time_limit)
void(* ast_bridge_notify_masquerade_fn)(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel)
Notify the bridge that this channel was just masqueraded.
struct ast_bridge_methods ast_bridge_parking_v_table
const ast_string_field name
struct parking_lot_cfg * cfg
#define ao2_link(container, obj)