75 char *dial_string =
ast_strdupa(parker_channel_name);
110 int preferred_space = -1;
112 const char *parkingexten;
115 ast_log(
LOG_NOTICE,
"Tried to park in a parking lot that is no longer able to be parked to.\n");
120 if (!new_parked_user) {
124 if (use_random_space) {
135 if (sscanf(parkingexten,
"%30d", &preferred_space) != 1 || preferred_space <= 0) {
136 ast_log(
LOG_WARNING,
"PARKINGEXTEN='%s' is not a valid parking space.\n", parkingexten);
159 new_parked_user->
lot =
lot;
185 return new_parked_user;
207 const char *blind_transfer;
209 const char *parker_channel_name =
NULL;
252 ast_log(
LOG_WARNING,
"Failed to apply holding bridge roles to %s while joining the parking lot.\n",
277 parker_channel_name = parker->
base->
name;
282 parker_channel_name = blind_transfer;
285 parker_channel_name = parker->
base->
name;
289 park_datastore->parker_dial_string, park_datastore->randomize, park_datastore->time_limit);
297 if (park_datastore->comeback_override) {
305 if (
ast_strlen_zero(blind_transfer) && !park_datastore->silence_announce) {
308 snprintf(saynum_buf,
sizeof(saynum_buf),
"%d %d", 0, pu->
parking_space);
367 switch (pu->resolution) {
445 self->
lot = bridge_lot;
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_link(container, obj)
Add an object to a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc(data_size, destructor_fn)
void(* ast_bridge_destructor_fn)(struct ast_bridge *self)
Destroy the bridge.
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.
void(* ast_bridge_dissolving_fn)(struct ast_bridge *self)
The bridge is being dissolved.
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.
@ AST_BRIDGE_CAPABILITY_HOLDING
void(* ast_bridge_pull_channel_fn)(struct ast_bridge *self, struct ast_bridge_channel *bridge_channel)
Pull this channel from the bridge.
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.
#define ast_bridge_channel_unlock(bridge_channel)
Unlock the bridge_channel.
#define ast_bridge_channel_lock(bridge_channel)
Lock the bridge_channel.
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.
@ AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM
@ AST_BRIDGE_FLAG_MERGE_INHIBIT_TO
@ AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM
struct ast_bridge * bridge_register(struct ast_bridge *bridge)
Register the new bridge with the system.
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.
struct ast_bridge * bridge_alloc(size_t size, const struct ast_bridge_methods *v_table)
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.
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.
const char * ast_channel_name(const struct ast_channel *chan)
#define ast_channel_lock(chan)
void ast_channel_name_to_dial_string(char *channel_name)
Removes the trailing identifiers from a channel name string.
int ast_answer(struct ast_channel *chan)
Answer a channel.
#define ast_channel_unlock(chan)
ast_channel_state
ast_channel states
Call Parking and Pickup API Includes code and algorithms from the Zapata library.
@ AST_FEATURE_FLAG_BYCALLEE
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,...
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_verb(level,...)
void park_common_datastore_free(struct park_common_datastore *datastore)
Free a park common datastore struct.
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.
struct ast_bridge * bridge_parking_new(struct parking_lot *bridge_lot)
Create a new parking bridge.
struct ast_bridge_methods ast_bridge_parking_v_table
static void bridge_parking_pull(struct ast_bridge_parking *self, struct ast_bridge_channel *bridge_channel)
static void bridge_parking_get_merge_priority(struct ast_bridge_parking *self)
static void bridge_parking_notify_masquerade(struct ast_bridge_parking *self, struct ast_bridge_channel *bridge_channel)
static int bridge_parking_push(struct ast_bridge_parking *self, struct ast_bridge_channel *bridge_channel, struct ast_bridge_channel *swap)
static void bridge_parking_dissolving(struct ast_bridge_parking *self)
static void destroy_parked_user(void *obj)
static void bridge_parking_destroy(struct ast_bridge_parking *self)
static struct ast_bridge * ast_bridge_parking_init(struct ast_bridge_parking *self, struct parking_lot *bridge_lot)
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)
static int parked_user_set_parker_dial_string(struct parked_user *pu, const char *parker_channel_name)
void parking_set_duration(struct ast_bridge_features *features, struct parked_user *user)
Setup timeout interval feature on an ast_bridge_features for parking.
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...
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.
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.
int parking_lot_get_space(struct parking_lot *lot, int target_override)
Get an available parking space within a parking lot.
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...
void parking_notify_metermaids(int exten, const char *context, enum ast_device_state state)
Notify metermaids that we've changed an extension.
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.
void publish_parked_call_failure(struct ast_channel *parkee)
Publish a stasis parked call message for the channel indicating failure to park.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
Call Parking Resource Internal API.
Say numbers and dates (maybe words one day too)
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Structure that contains information regarding a channel in a bridge.
void * bridge_pvt
Bridge class private channel data.
struct ast_bridge_features * features
struct ast_channel * chan
Bridge virtual methods table definition.
ast_bridge_dissolving_fn dissolving
ast_bridge_push_channel_fn push
ast_bridge_notify_masquerade_fn notify_masquerade
ast_bridge_destructor_fn destroy
ast_bridge_merge_priority_fn get_merge_priority
ast_bridge_pull_channel_fn pull
Structure that contains information about a bridge.
const ast_string_field name
Structure representing a snapshot of channel state.
struct ast_channel_snapshot_base * base
Main Channel structure associated with a channel.
char * parker_dial_string
struct ast_channel * chan
struct ast_channel_snapshot * retriever
char comeback[AST_MAX_CONTEXT]
const ast_string_field parking_con
enum parking_lot_modes mode
struct parking_lot_cfg * cfg
const ast_string_field name
struct ao2_container * parked_users
Handy terminal functions for vt* terms.
#define COLORIZE(fg, bg, str)
#define COLORIZE_FMT
Shortcut macros for coloring a set of text.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
long int ast_random(void)