summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-01-29 17:06:17 +0000
committerJonathan Rose <jrose@digium.com>2013-01-29 17:06:17 +0000
commit80021f220c2d20f9c19a00ed751442669f0982c2 (patch)
treee860201d6d57e6abd7d88b98231d258e6df22ad1 /main
parent126060042ed39993576948e437ea82b8de183de7 (diff)
call_parking: Make sure fallbacks are used when lacking a flat channel exten
A regression was introduced which removed automatic fallback behavior from the PBX. This behavior was used by call parking (or at least documented as how the feature works) in order to select an extension when the flat channel extension wasn't available from the comebackcontext. Parking now handles the fallbacks internally in order to keep behavior matching with how it is documented. (closes issue ASTERISK-20716) Reported by: Chris Gentle Review: https://reviewboard.asterisk.org/r/2296/ ........ Merged revisions 380348 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/features.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/main/features.c b/main/features.c
index 2f2716eb7..547863534 100644
--- a/main/features.c
+++ b/main/features.c
@@ -5149,7 +5149,21 @@ static int manage_parked_call(struct parkeduser *pu, const struct pollfd *pfds,
snprintf(parkingslot, sizeof(parkingslot), "%d", pu->parkingnum);
pbx_builtin_setvar_helper(chan, "PARKINGSLOT", parkingslot);
pbx_builtin_setvar_helper(chan, "PARKEDLOT", pu->parkinglot->name);
- set_c_e_p(chan, pu->parkinglot->cfg.comebackcontext, peername_flat, 1);
+
+ /* Handle fallback when extensions don't exist here since that logic was removed from pbx */
+ if (ast_exists_extension(chan, pu->parkinglot->cfg.comebackcontext, peername_flat, 1, NULL)) {
+ set_c_e_p(chan, pu->parkinglot->cfg.comebackcontext, peername_flat, 1);
+ } else if (ast_exists_extension(chan, pu->parkinglot->cfg.comebackcontext, "s", 1, NULL)) {
+ ast_verb(2, "Can not start %s at %s,%s,1. Using 's@%s' instead.\n", ast_channel_name(chan),
+ pu->parkinglot->cfg.comebackcontext, peername_flat, pu->parkinglot->cfg.comebackcontext);
+ set_c_e_p(chan, pu->parkinglot->cfg.comebackcontext, "s", 1);
+ } else {
+ ast_verb(2, "Can not start %s at %s,%s,1 and exten 's@%s' does not exist. Using 's@default'\n",
+ ast_channel_name(chan),
+ pu->parkinglot->cfg.comebackcontext, peername_flat,
+ pu->parkinglot->cfg.comebackcontext);
+ set_c_e_p(chan, "default", "s", 1);
+ }
}
} else {
/*