[asterisk-commits] jrose: branch 11 r380348 - /branches/11/main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 29 11:05:26 CST 2013


Author: jrose
Date: Tue Jan 29 11:05:23 2013
New Revision: 380348

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380348
Log:
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/

Modified:
    branches/11/main/features.c

Modified: branches/11/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/features.c?view=diff&rev=380348&r1=380347&r2=380348
==============================================================================
--- branches/11/main/features.c (original)
+++ branches/11/main/features.c Tue Jan 29 11:05:23 2013
@@ -5099,7 +5099,21 @@
 				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 at 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 {
 			/*




More information about the asterisk-commits mailing list