Merged revisions 47850 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 20 Nov 2006 15:55:58 +0000 (15:55 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 20 Nov 2006 15:55:58 +0000 (15:55 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47850 | file | 2006-11-20 10:51:37 -0500 (Mon, 20 Nov 2006) | 2 lines

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: https://origsvn.digium.com/svn/asterisk/trunk@47851 65c4cc65-6c06-0410-ace0-fbb531ad65f3

.cleancount
apps/app_dial.c
apps/app_directed_pickup.c
include/asterisk/channel.h

index 7273c0f..6f4247a 100644 (file)
@@ -1 +1 @@
-25
+26
index 9053922..c3cc262 100644 (file)
@@ -590,7 +590,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                                       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
                                                       OPT_CALLEE_PARK | OPT_CALLER_PARK |
                                                       DIAL_NOFORWARDHTML);
                                                       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;
                                        ast_copy_string(c->exten, "", sizeof(c->exten));
                                }
                                continue;
@@ -625,7 +625,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                                               OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
                                                               OPT_CALLEE_PARK | OPT_CALLER_PARK |
                                                               DIAL_NOFORWARDHTML);
                                                               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 early bridge if appropriate */
                                                ast_channel_early_bridge(in, peer);
                                                ast_copy_string(c->exten, "", sizeof(c->exten));
                                                /* Setup early bridge if appropriate */
                                                ast_channel_early_bridge(in, peer);
@@ -1369,7 +1369,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_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 */
                ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten));
 
                /* Place the call, but don't wait on the answer */
index 78fa9fe..9aba195 100644 (file)
@@ -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) &&
 
        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);
                    can_pickup(target)) {
                        res = pickup_do(chan, target);
                        ast_channel_unlock(target);
index 83a4598..94b46a9 100644 (file)
@@ -385,6 +385,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 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 */
 
        struct ast_pbx *pbx;                            /*!< PBX private structure for this channel */
        int amaflags;                                   /*!< Set BEFORE PBX is started to determine AMA flags */