aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-04 22:55:56 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-04 22:55:56 +0000
commit64c13aeb0d4d07c2b3d77c26bc2155473c49bfee (patch)
treeb5b09ef0c9ad482db0cbd4f0413eadcb94f9c169 /res
parentac0ee9984f5d6f40f2edefadde22d4860ae908ac (diff)
Properly continue in the dialplan if using PARKINGEXTEN and the slot is full.
Issue 11237, patch by me. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@96573 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_features.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/res/res_features.c b/res/res_features.c
index 1915eae37..2a65b90a2 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -325,7 +325,7 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in
ast_mutex_unlock(&parking_lock);
free(pu);
ast_log(LOG_WARNING, "Requested parking extension already exists: %s@%s\n", parkingexten, parking_con);
- return 0; /* Continue execution if possible */
+ return 1; /* Continue execution if possible */
}
ast_copy_string(pu->parkingexten, parkingexten, sizeof(pu->parkingexten));
x = atoi(parkingexten);
@@ -1811,6 +1811,9 @@ static int park_call_exec(struct ast_channel *chan, void *data)
* of a park--it is still theoretically possible for a transfer to happen before
* we get here, but it is _really_ unlikely */
char *orig_chan_name = ast_strdupa(chan->name);
+ char orig_exten[AST_MAX_EXTENSION];
+ int orig_priority = chan->priority;
+
/* Data is unused at the moment but could contain a parking
lot context eventually */
int res = 0;
@@ -1818,6 +1821,8 @@ static int park_call_exec(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
+ ast_copy_string(orig_exten, chan->exten, sizeof(orig_exten));
+
/* Setup the exten/priority to be s/1 since we don't know
where this call should return */
strcpy(chan->exten, "s");
@@ -1829,12 +1834,20 @@ static int park_call_exec(struct ast_channel *chan, void *data)
if (!res)
res = ast_safe_sleep(chan, 1000);
/* Park the call */
- if (!res)
+ if (!res) {
res = park_call_full(chan, NULL, 0, NULL, orig_chan_name);
+ /* Continue on in the dialplan */
+ if (res == 1) {
+ ast_copy_string(chan->exten, orig_exten, sizeof(chan->exten));
+ chan->priority = orig_priority;
+ res = 0;
+ } else if (!res)
+ res = AST_PBX_KEEPALIVE;
+ }
ast_module_user_remove(u);
- return !res ? AST_PBX_KEEPALIVE : res;
+ return res;
}
/*! \brief Pickup parked call */