diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-20 15:51:37 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-20 15:51:37 +0000 |
commit | 33061c4842f1f5beaa5ef9da703db6530f44e633 (patch) | |
tree | 3ab467d8a5c6bd16aaf9ade4f6069d3ea3631774 | |
parent | 363b421075e8bd3758372cf02a0756bd5f36c9ae (diff) |
Use a separate variable in the channel structure to store the context that the channel was dialed from. (issue #8382 reported by jiddings)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47850 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | .cleancount | 2 | ||||
-rw-r--r-- | apps/app_dial.c | 6 | ||||
-rw-r--r-- | apps/app_directed_pickup.c | 2 | ||||
-rw-r--r-- | include/asterisk/channel.h | 1 |
4 files changed, 6 insertions, 5 deletions
diff --git a/.cleancount b/.cleancount index 7273c0fa8..6f4247a62 100644 --- a/.cleancount +++ b/.cleancount @@ -1 +1 @@ -25 +26 diff --git a/apps/app_dial.c b/apps/app_dial.c index cdfa73bc3..b5c58385f 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -456,7 +456,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK | OPT_CALLER_PARK | DIAL_NOFORWARDHTML); - ast_copy_string(c->context, "", sizeof(c->context)); + ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext)); ast_copy_string(c->exten, "", sizeof(c->exten)); } continue; @@ -577,7 +577,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK | OPT_CALLER_PARK | DIAL_NOFORWARDHTML); - ast_copy_string(c->context, "", sizeof(c->context)); + ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext)); ast_copy_string(c->exten, "", sizeof(c->exten)); /* Setup RTP early bridge if appropriate */ ast_rtp_early_bridge(in, peer); @@ -1175,7 +1175,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ast_app_group_set_channel(tmp->chan, outbound_group); /* Inherit context and extension */ - ast_copy_string(tmp->chan->context, chan->context, sizeof(tmp->chan->context)); + ast_copy_string(tmp->chan->dialcontext, chan->context, sizeof(tmp->chan->dialcontext)); ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten)); /* Place the call, but don't wait on the answer */ diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c index 78fa9feaf..9aba195ec 100644 --- a/apps/app_directed_pickup.c +++ b/apps/app_directed_pickup.c @@ -97,7 +97,7 @@ static int pickup_by_exten(struct ast_channel *chan, char *exten, char *context) while ((target = ast_channel_walk_locked(target))) { if (!strcasecmp(target->exten, exten) && - !strcasecmp(target->context, context) && + !strcasecmp(target->dialcontext, context) && can_pickup(target)) { res = pickup_do(chan, target); ast_channel_unlock(target); diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 3c335837b..488b64c3c 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -382,6 +382,7 @@ struct ast_channel { char macrocontext[AST_MAX_CONTEXT]; /*!< Macro: Current non-macro context. See app_macro.c */ char macroexten[AST_MAX_EXTENSION]; /*!< Macro: Current non-macro extension. See app_macro.c */ int macropriority; /*!< Macro: Current non-macro priority. See app_macro.c */ + char dialcontext[AST_MAX_CONTEXT]; /*!< Dial: Extension context that we were called from */ struct ast_pbx *pbx; /*!< PBX private structure for this channel */ int amaflags; /*!< Set BEFORE PBX is started to determine AMA flags */ |