Asterisk - The Open Source Telephony Project
18.5.0
|
Call Parking Manager Actions and Events. More...
#include "asterisk.h"
#include "res_parking.h"
#include "asterisk/config.h"
#include "asterisk/config_options.h"
#include "asterisk/utils.h"
#include "asterisk/module.h"
#include "asterisk/cli.h"
#include "asterisk/astobj2.h"
#include "asterisk/features.h"
#include "asterisk/manager.h"
#include "asterisk/bridge.h"
Go to the source code of this file.
Data Structures | |
struct | park_list_data |
Functions | |
int | load_parking_manager (void) |
Register manager actions and setup subscriptions for stasis events. More... | |
static int | manager_append_event_parking_lot_data_cb (void *obj, void *arg, void *data, int flags) |
static struct ast_str * | manager_build_parked_call_string (const struct ast_parked_call_payload *payload) |
Builds a manager string based on the contents of a parked call payload. More... | |
static int | manager_park (struct mansession *s, const struct message *m) |
static void | manager_park_bridged (struct mansession *s, const struct message *m, struct ast_channel *chan, struct ast_channel *parker_chan, const char *parkinglot, int timeout_override) |
static void | manager_park_unbridged (struct mansession *s, const struct message *m, struct ast_channel *chan, const char *parkinglot, int timeout_override) |
static int | manager_parking_lot_list (struct mansession *s, const struct message *m) |
static int | manager_parking_status (struct mansession *s, const struct message *m) |
static void | manager_parking_status_all_lots (struct mansession *s, const struct message *m, const char *id_text) |
static void | manager_parking_status_single_lot (struct mansession *s, const struct message *m, const char *id_text, const char *lot_name) |
static void | parked_call_message_response (struct ast_parked_call_payload *parked_call) |
static struct ast_parked_call_payload * | parked_call_payload_from_failure (struct ast_channel *chan) |
static struct ast_parked_call_payload * | parked_call_payload_from_parked_user (struct parked_user *pu, enum ast_parked_call_event_type event_type) |
static void | parking_event_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | parking_manager_disable_stasis (void) |
static void | parking_manager_enable_stasis (void) |
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. More... | |
void | publish_parked_call_failure (struct ast_channel *parkee) |
Publish a stasis parked call message for the channel indicating failure to park. More... | |
void | unload_parking_manager (void) |
Unregister manager actions and remove subscriptions for stasis events. More... | |
Variables | |
static struct stasis_subscription * | parking_sub |
subscription to the parking lot topic More... | |
Call Parking Manager Actions and Events.
Definition in file parking_manager.c.
int load_parking_manager | ( | void | ) |
Register manager actions and setup subscriptions for stasis events.
Definition at line 694 of file parking_manager.c.
References ast_manager_register_xml, EVENT_FLAG_CALL, manager_park(), manager_parking_lot_list(), manager_parking_status(), and parking_manager_enable_stasis().
Referenced by load_module().
|
static |
Definition at line 397 of file parking_manager.c.
References astman_append(), parking_lot::cfg, park_list_data::count, park_list_data::id_text, parking_lot::name, parking_lot_cfg::parking_start, parking_lot_cfg::parking_stop, and parking_lot_cfg::parkingtime.
Referenced by manager_parking_lot_list().
|
static |
Builds a manager string based on the contents of a parked call payload.
Definition at line 215 of file parking_manager.c.
References ast_free, ast_manager_build_channel_state_string_prefix(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_parked_call_payload::duration, NULL, out, ast_parked_call_payload::parkee, ast_parked_call_payload::parker_dial_string, ast_parked_call_payload::parkinglot, ast_parked_call_payload::parkingspace, RAII_VAR, ast_parked_call_payload::retriever, and ast_parked_call_payload::timeout.
Referenced by manager_parking_status_all_lots(), manager_parking_status_single_lot(), and parked_call_message_response().
|
static |
Definition at line 519 of file parking_manager.c.
References ao2_cleanup, ast_bridge_set_transfer_variables(), ast_channel_bridge_peer(), ast_channel_cleanup, ast_channel_get_by_name(), ast_channel_lock, ast_channel_name(), ast_channel_uniqueid(), ast_channel_unlock, ast_strlen_zero, astman_get_header(), astman_send_error(), buf, ast_bridge_channel::chan, create_parked_subscription(), manager_park_bridged(), manager_park_unbridged(), MAX, NULL, parkinglot, RAII_VAR, S_OR, and timeout.
Referenced by load_parking_manager().
|
static |
Definition at line 473 of file parking_manager.c.
References ao2_cleanup, ast_asprintf, ast_bridge_channel_write_park(), ast_channel_get_bridge_channel(), ast_channel_lock, ast_channel_uniqueid(), ast_channel_unlock, ast_free, astman_send_ack(), astman_send_error(), and create_parked_subscription().
Referenced by manager_park().
|
static |
Definition at line 452 of file parking_manager.c.
References ao2_cleanup, ast_bridge_add_channel(), astman_send_ack(), astman_send_error(), NULL, and park_common_setup().
Referenced by manager_park().
|
static |
Definition at line 420 of file parking_manager.c.
References ao2_callback_data, ast_log, ast_strlen_zero, astman_get_header(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), park_list_data::count, get_parking_lot_container(), park_list_data::id_text, LOG_ERROR, manager_append_event_parking_lot_data_cb(), OBJ_MULTIPLE, and OBJ_NODATA.
Referenced by load_parking_manager().
|
static |
Definition at line 372 of file parking_manager.c.
References ast_strlen_zero, astman_get_header(), manager_parking_status_all_lots(), and manager_parking_status_single_lot().
Referenced by load_parking_manager().
|
static |
Definition at line 309 of file parking_manager.c.
References ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_free, ast_log, ast_str_buffer(), astman_append(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), get_parking_lot_container(), LOG_ERROR, manager_build_parked_call_string(), NULL, PARKED_CALL, parked_call_payload_from_parked_user(), parking_lot::parked_users, RAII_VAR, and total.
Referenced by manager_parking_status().
|
static |
Definition at line 259 of file parking_manager.c.
References ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_free, ast_str_buffer(), astman_append(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), manager_build_parked_call_string(), NULL, PARKED_CALL, parked_call_payload_from_parked_user(), parking_lot_find_by_name(), RAII_VAR, and total.
Referenced by manager_parking_status().
|
static |
Definition at line 639 of file parking_manager.c.
References ast_free, ast_log, ast_str_buffer(), EVENT_FLAG_CALL, ast_parked_call_payload::event_type, LOG_ERROR, manager_build_parked_call_string(), manager_event, NULL, PARKED_CALL, PARKED_CALL_FAILED, PARKED_CALL_GIVEUP, PARKED_CALL_SWAP, PARKED_CALL_TIMEOUT, PARKED_CALL_UNPARKED, and RAII_VAR.
Referenced by parking_event_cb().
|
static |
Definition at line 178 of file parking_manager.c.
References ao2_cleanup, ast_channel_lock, ast_channel_snapshot_create(), ast_channel_unlock, ast_parked_call_payload_create(), NULL, PARKED_CALL_FAILED, and RAII_VAR.
Referenced by publish_parked_call_failure().
|
static |
Definition at line 192 of file parking_manager.c.
References ao2_cleanup, ast_channel_lock, ast_channel_snapshot_create(), ast_channel_unlock, ast_parked_call_payload_create(), ast_tvnow(), parked_user::chan, ast_parked_call_payload::duration, parked_user::lot, parking_lot::name, NULL, parked_user::parker_dial_string, parked_user::parking_space, RAII_VAR, parked_user::retriever, parked_user::start, parked_user::time_limit, and timeout.
Referenced by manager_parking_status_all_lots(), manager_parking_status_single_lot(), and publish_parked_call().
|
static |
Definition at line 677 of file parking_manager.c.
References ast_parked_call_type(), parked_call_message_response(), stasis_message_data(), and stasis_message_type().
Referenced by parking_manager_enable_stasis().
|
static |
Definition at line 705 of file parking_manager.c.
References stasis_unsubscribe_and_join().
Referenced by unload_parking_manager().
|
static |
Definition at line 685 of file parking_manager.c.
References ast_parked_call_type(), ast_parking_topic(), NULL, parking_event_cb(), stasis_subscribe, stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, and stasis_subscription_set_filter().
Referenced by load_parking_manager().
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.
pu | pointer to a parked_user that we are generating the message for |
event_type | What parked call event type is provoking this message |
Definition at line 617 of file parking_manager.c.
References ao2_cleanup, ast_parked_call_type(), ast_parking_topic(), NULL, parked_call_payload_from_parked_user(), RAII_VAR, stasis_message_create(), and stasis_publish().
Referenced by bridge_parking_pull(), and bridge_parking_push().
void publish_parked_call_failure | ( | struct ast_channel * | parkee | ) |
Publish a stasis parked call message for the channel indicating failure to park.
parkee | channel belonging to the failed parkee |
Definition at line 595 of file parking_manager.c.
References ao2_cleanup, ast_parked_call_type(), ast_parking_topic(), NULL, parked_call_payload_from_failure(), RAII_VAR, stasis_message_create(), and stasis_publish().
Referenced by bridge_parking_push(), park_app_exec(), and parking_park_bridge_channel().
void unload_parking_manager | ( | void | ) |
Unregister manager actions and remove subscriptions for stasis events.
Definition at line 710 of file parking_manager.c.
References ast_manager_unregister(), and parking_manager_disable_stasis().
Referenced by unload_module().
|
static |
subscription to the parking lot topic
Definition at line 176 of file parking_manager.c.