mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Call Parking: Set PARKINGLOT and PARKINGSLOT variables on all parked calls
These two variables were previously not being set when comebacktoorigin=yes and the example configs seemed to imply that they should be. Since there is no harm in this and since calls that are sent back to origin are capable of continuing in the dialplan, this seemed like a no-brainer. Also it supports some bridging tests I've been working on. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user