summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorAlexei Gradinari <alex2grad@gmail.com>2016-05-25 11:34:42 -0400
committerAlexei Gradinari <alex2grad@gmail.com>2016-06-04 11:07:22 -0500
commit3e8d523d889351c69b21fdc563cb98d18a7bdb66 (patch)
tree88b04ab5d38f7e4c152163ea94702def95497a60 /apps/app_dial.c
parentf7ce0f1832e9c7f13d1c66289a3d5659b664caaf (diff)
core/dial: New channel variable FORWARDERNAME
Added a new channel variable FORWARDERNAME which indicates which channel was responsible for a forwarding requests received on dial attempt. Fixed a bug in the app_queue: FORWARD_CONTEXT is not used. ASTERISK-26059 #close Change-Id: I34e93e8c1b5e17776a77b319703c48c8ca48e7b2
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 5e034d3eb..1f019d6c8 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -834,6 +834,7 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
struct ast_party_id *forced_clid, struct ast_party_id *stored_clid)
{
char tmpchan[256];
+ char forwarder[AST_CHANNEL_NAME];
struct ast_channel *original = o->chan;
struct ast_channel *c = o->chan; /* the winner */
struct ast_channel *in = num->chan; /* the input channel */
@@ -842,6 +843,7 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
int cause;
struct ast_party_caller caller;
+ ast_copy_string(forwarder, ast_channel_name(c), sizeof(forwarder));
ast_copy_string(tmpchan, ast_channel_call_forward(c), sizeof(tmpchan));
if ((stuff = strchr(tmpchan, '/'))) {
*stuff++ = '\0';
@@ -895,6 +897,7 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
ast_channel_lock_both(in, o->chan);
ast_channel_inherit_variables(in, o->chan);
ast_channel_datastore_inherit(in, o->chan);
+ pbx_builtin_setvar_helper(o->chan, "FORWARDERNAME", forwarder);
ast_max_forwards_decrement(o->chan);
ast_channel_unlock(in);
ast_channel_unlock(o->chan);