diff --git a/CHANGES b/CHANGES index 2cc6145ecb0889f4bd6b7b3b87d5745add377f79..ed397227087d2d0b45365c0805ba2458e17e0a49 100644 --- a/CHANGES +++ b/CHANGES @@ -61,6 +61,9 @@ Features * Add support for automixmonitor to the BRIDGE_FEATURES channel variable. + * PARKINGSLOT and PARKEDLOT channel variables will now be set for a parked + channel even when comebactoorigin=yes + Logging ------------------- * When performing queue pause/unpause on an interface without specifying an diff --git a/configs/features.conf.sample b/configs/features.conf.sample index 7f00fab94e1c57290d2fce6ed771d8c4035d3498..701ccdf37f6d26a1da5d9e345dd06d91d35938d8 100644 --- a/configs/features.conf.sample +++ b/configs/features.conf.sample @@ -27,7 +27,10 @@ context => parkedcalls ; Which context parked calls are in (default par ; an extension created based on the name of the channel that originally parked ; the call. This extension will be created automatically to do a Dial() to the ; device that originally parked the call for comebacktodialtime seconds. If the - ; call is not answered, the call will proceed to 'park-dial,t,1'. + ; call is not answered, the call will proceed to the next priority (usually none + ; unless you deliberately set up a catch-all second priority in the park-call + ; context) in the dialplan for extension matching the peer name (same as how + ; peer names are flattened into extensions when comebacktoorigin is 'no'). ; ; 'no' - This option is useful for performing custom dialplan functionality prior to ; sending the call back to the extension that initially parked the call, or to diff --git a/main/features.c b/main/features.c index 547863534f4279c096dccd5b97f3b68d07a55f3c..51b143be4170df3aa4c4c976ad6ca08e3b012938 100644 --- a/main/features.c +++ b/main/features.c @@ -5075,6 +5075,7 @@ static int manage_parked_call(struct parkeduser *pu, const struct pollfd *pfds, char *peername; char *dash; char *peername_flat; /* using something like DAHDI/52 for an extension name is NOT a good idea */ + char parkingslot[AST_MAX_EXTENSION]; /* buffer for parkinglot slot number */ int i; peername = ast_strdupa(pu->peername); @@ -5135,6 +5136,11 @@ static int manage_parked_call(struct parkeduser *pu, const struct pollfd *pfds, peername_flat, parking_con_dial); } } + + snprintf(parkingslot, sizeof(parkingslot), "%d", pu->parkingnum); + pbx_builtin_setvar_helper(chan, "PARKINGSLOT", parkingslot); + pbx_builtin_setvar_helper(chan, "PARKEDLOT", pu->parkinglot->name); + if (pu->options_specified) { /* * Park() was called with overriding return arguments, respect @@ -5144,12 +5150,6 @@ static int manage_parked_call(struct parkeduser *pu, const struct pollfd *pfds, } else if (pu->parkinglot->cfg.comebacktoorigin) { set_c_e_p(chan, parking_con_dial, peername_flat, 1); } else { - char parkingslot[AST_MAX_EXTENSION]; - - snprintf(parkingslot, sizeof(parkingslot), "%d", pu->parkingnum); - pbx_builtin_setvar_helper(chan, "PARKINGSLOT", parkingslot); - pbx_builtin_setvar_helper(chan, "PARKEDLOT", pu->parkinglot->name); - /* 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);