summaryrefslogtreecommitdiff
path: root/res/parking
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-03-26 14:10:21 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-03-26 14:10:22 -0500
commit36347dbc3cc40f3dd5aa646e0f25ef4b92cd3ebc (patch)
tree4d912b8eb970271f8e81a1e14d1ea771590bfaa2 /res/parking
parente2853ae3375d8ce8d2f52be5d7d9e3e7761af152 (diff)
parent3cf714031c51af0f2c21166bb9d161b144f5723c (diff)
Merge "res_parking: Cleanup find_channel_parking_lot_name() usage."
Diffstat (limited to 'res/parking')
-rw-r--r--res/parking/parking_applications.c2
-rw-r--r--res/parking/parking_bridge_features.c11
-rw-r--r--res/parking/res_parking.h5
3 files changed, 6 insertions, 12 deletions
diff --git a/res/parking/parking_applications.c b/res/parking/parking_applications.c
index 3a9527c1f..616627a3b 100644
--- a/res/parking/parking_applications.c
+++ b/res/parking/parking_applications.c
@@ -608,7 +608,7 @@ static int parked_call_app_exec(struct ast_channel *chan, const char *data)
int target_space = -1;
struct ast_bridge_features chan_features;
char *parse;
- char *lot_name;
+ const char *lot_name;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(lot_name);
diff --git a/res/parking/parking_bridge_features.c b/res/parking/parking_bridge_features.c
index 4cb87c81a..4d1416eb8 100644
--- a/res/parking/parking_bridge_features.c
+++ b/res/parking/parking_bridge_features.c
@@ -474,19 +474,12 @@ static int parking_park_bridge_channel(struct ast_bridge_channel *bridge_channel
static int parking_park_call(struct ast_bridge_channel *parker, char *exten, size_t length)
{
RAII_VAR(struct parking_lot *, lot, NULL, ao2_cleanup);
- const char *lot_name = NULL;
+ const char *lot_name;
ast_channel_lock(parker->chan);
- lot_name = find_channel_parking_lot_name(parker->chan);
- if (!ast_strlen_zero(lot_name)) {
- lot_name = ast_strdupa(lot_name);
- }
+ lot_name = ast_strdupa(find_channel_parking_lot_name(parker->chan));
ast_channel_unlock(parker->chan);
- if (ast_strlen_zero(lot_name)) {
- return -1;
- }
-
lot = parking_lot_find_by_name(lot_name);
if (!lot) {
ast_log(AST_LOG_WARNING, "Cannot Park %s: lot %s unknown\n",
diff --git a/res/parking/res_parking.h b/res/parking/res_parking.h
index 2c4a18055..f4ef2ea09 100644
--- a/res/parking/res_parking.h
+++ b/res/parking/res_parking.h
@@ -308,8 +308,9 @@ struct parking_lot *parking_create_dynamic_lot_forced(const char *name, struct a
*
* \param chan The channel we want the parking lot name for
*
- * \retval name of the channel's assigned parking lot if it is defined by the channel in some way
- * \retval name of the default parking lot if it is not
+ * \return name of the parking lot to use for the channel.
+ *
+ * \note Always returns a parking lot name.
*
* \note Channel needs to be locked while the returned string is in use.
*/