|
Asterisk - The Open Source Telephony Project GIT-master-27fb039
|
Parking Entry, Exit, and other assorted controls. More...
#include "asterisk.h"#include "asterisk/logger.h"#include "res_parking.h"#include "asterisk/astobj2.h"#include "asterisk/utils.h"#include "asterisk/manager.h"#include "asterisk/test.h"#include "asterisk/features.h"#include "asterisk/bridge_basic.h"
Go to the source code of this file.
Data Structures | |
| struct | parking_limits_pvt |
Functions | |
| int | comeback_goto (struct parked_user *pu, struct parking_lot *lot) |
| Set a channel's position in the PBX after timeout using the parking lot settings. | |
| void | flatten_dial_string (char *dialstring) |
| Flattens a dial string so that it can be written to/found from PBX extensions. | |
| 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. | |
| struct ast_bridge * | parking_lot_get_bridge (struct parking_lot *lot) |
| Get a reference to a parking lot's bridge. If it doesn't exist, create it and get a reference. | |
| int | parking_lot_get_space (struct parking_lot *lot, int target_override) |
| Get an available parking space within a parking lot. | |
| struct parked_user * | parking_lot_inspect_parked_user (struct parking_lot *lot, int target) |
| Determine if there is a parked user in a parking space and return it if there is. | |
| struct parked_user * | parking_lot_retrieve_parked_user (struct parking_lot *lot, int target) |
| Determine if there is a parked user in a parking space and pull it from the parking lot if there is. | |
| static int | retrieve_parked_user_targeted (void *obj, void *arg, int flags) |
| 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 afterwards. | |
Parking Entry, Exit, and other assorted controls.
Definition in file parking_controller.c.
| int comeback_goto | ( | struct parked_user * | pu, |
| struct parking_lot * | lot | ||
| ) |
Set a channel's position in the PBX after timeout using the parking lot settings.
| pu | Parked user who is entering/reentering the PBX |
| lot | Parking lot the user was removed from. |
| 0 | Position set successfully |
| -1 | Failed to set the position |
Definition at line 263 of file parking_controller.c.
References ast_async_goto(), ast_channel_name(), ast_exists_extension(), ast_log, ast_strdupa, ast_verb, parking_lot::cfg, parked_user::chan, parking_lot_cfg::comebackcontext, parking_lot_cfg::comebacktoorigin, flatten_dial_string(), LOG_ERROR, NULL, PARK_DIAL_CONTEXT, and parked_user::parker_dial_string.
Referenced by parking_duration_callback().
| void flatten_dial_string | ( | char * | dialstring | ) |
Flattens a dial string so that it can be written to/found from PBX extensions.
| dialstring | unflattened dial string. This will be flattened in place. |
Definition at line 251 of file parking_controller.c.
Referenced by comeback_goto(), and parking_duration_callback().
| 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.
| chan | Which channel's feature set is being modified |
| lot | parking lot which establishes the features used |
| recipient_mode | AST_FEATURE_FLAG_BYCALLER if the user is the retriever AST_FEATURE_FLAG_BYCALLEE if the user is the parkee |
Definition at line 217 of file parking_controller.c.
References ast_bridge_features_ds_get(), ast_bridge_features_ds_set(), ast_channel_lock, ast_channel_unlock, AST_FEATURE_AUTOMIXMON, AST_FEATURE_DISCONNECT, AST_FEATURE_PARKCALL, AST_FEATURE_REDIRECT, ast_set_flag, parking_lot::cfg, parking_lot_cfg::parkedcallhangup, parking_lot_cfg::parkedcallrecording, parking_lot_cfg::parkedcallreparking, and parking_lot_cfg::parkedcalltransfers.
Referenced by bridge_parking_pull(), and parked_call_app_exec().
| 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.
| chan | Entering channel |
| lot | The parking lot the channel will be entering |
| force_ringing | Use ringing instead of music on hold |
| 0 | on success |
| non-zero | on failure |
Definition at line 57 of file parking_controller.c.
References ast_channel_add_bridge_role(), ast_channel_set_bridge_role_option(), ast_strlen_zero(), parking_lot::cfg, and parking_lot_cfg::mohclass.
Referenced by bridge_parking_push(), and park_common_setup2().
| struct ast_bridge * parking_lot_get_bridge | ( | struct parking_lot * | lot | ) |
Get a reference to a parking lot's bridge. If it doesn't exist, create it and get a reference.
| lot | Which parking lot we need the bridge from. This parking lot must be locked before calling this function. |
| NULL | if it didn't already have a bridge and one couldn't be created |
Definition at line 36 of file parking_controller.c.
References ao2_ref, bridge_parking_new(), NULL, and parking_lot::parking_bridge.
Referenced by park_common_setup2().
| int parking_lot_get_space | ( | struct parking_lot * | lot, |
| int | target_override | ||
| ) |
Get an available parking space within a parking lot.
| lot | Which parking lot we are getting a space from |
| target_override | If there is a specific slot we want, provide it here and we'll start from that position |
| -1 | if No slot can be found |
Definition at line 96 of file parking_controller.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_log, parking_lot::cfg, LOG_WARNING, parked_user::lot, parking_lot::next_space, parking_lot::parked_users, parking_lot_cfg::parkfindnext, parking_lot_cfg::parking_start, parking_lot_cfg::parking_stop, and parked_user::start.
Referenced by generate_parked_user().
| struct parked_user * parking_lot_inspect_parked_user | ( | struct parking_lot * | lot, |
| int | target | ||
| ) |
Determine if there is a parked user in a parking space and return it if there is.
| lot | Parking lot being pulled from |
| target | If < 0 search for the first occupied space in the parking lot If >= 0 Only pull from the indicated target |
| NULL | if no parked user could be pulled from the requested parking lot at the requested parking space |
Definition at line 168 of file parking_controller.c.
References ao2_callback, parked_user::lot, NULL, parking_lot::parked_users, and retrieve_parked_user_targeted().
Referenced by func_get_parkingslot_channel().
| struct parked_user * parking_lot_retrieve_parked_user | ( | struct parking_lot * | lot, |
| int | target | ||
| ) |
Determine if there is a parked user in a parking space and pull it from the parking lot if there is.
| lot | Parking lot being pulled from |
| target | If < 0 search for the first occupied space in the parking lot If >= 0 Only pull from the indicated target |
| NULL | if no parked user could be pulled from the requested parking lot at the requested parking space |
Definition at line 185 of file parking_controller.c.
References ao2_callback, ao2_cleanup, ao2_lock, ao2_ref, ao2_unlink, ao2_unlock, parked_user::lot, NULL, PARK_ANSWERED, PARK_UNSET, parking_lot::parked_users, parking_lot_remove_if_unused(), RAII_VAR, and retrieve_parked_user_targeted().
Referenced by parked_call_app_exec().
|
static |
Definition at line 157 of file parking_controller.c.
References CMP_MATCH.
Referenced by parking_lot_inspect_parked_user(), and parking_lot_retrieve_parked_user().
| int unpark_parked_user | ( | struct parked_user * | user | ) |
Pull a parked user out of its parking lot. Use this when you don't want to use the parked user afterwards.
| user | The parked user being pulled. |
| 0 | on success |
| -1 | if the user didn't have its parking lot set |
Definition at line 85 of file parking_controller.c.
References ao2_unlink, parking_lot_remove_if_unused(), and parked_user::start.
Referenced by bridge_parking_pull().