Set dialed peer number properly when ringing multiple channels (bug #3437)
authorMark Spencer <markster@digium.com>
Thu, 27 Jan 2005 16:33:12 +0000 (16:33 +0000)
committerMark Spencer <markster@digium.com>
Thu, 27 Jan 2005 16:33:12 +0000 (16:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4898 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c
manager.c

index e62b0bb..1e5d95f 100755 (executable)
@@ -886,6 +886,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        cur = rest;
                        continue;
                }
+               pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
                if (!ast_strlen_zero(tmp->chan->call_forward)) {
                        char tmpchan[256]="";
                        char *stuff;
@@ -1059,8 +1060,11 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        ast_cdr_setdestchan(chan->cdr, peer->name);
                if (peer->name)
                        pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", peer->name);
-               if (numsubst)
-                       pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", numsubst);
+
+               number = pbx_builtin_getvar_helper(peer, "DIALEDPEERNUMBER");
+               if (!number)
+                       number = numsubst;
+               pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number);
                /* JDG: sendurl */
                if ( url && !ast_strlen_zero(url) && ast_channel_supports_html(peer) ) {
                        ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", url);
index 2f93090..a8eba25 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -840,16 +840,18 @@ static void *fast_originate(void *data)
                        "%s"
                        "Channel: %s/%s\r\n"
                        "Context: %s\r\n"
-                       "Exten: %s\r\n",
-                       in->idtext, in->tech, in->data, in->context, in->exten);
+                       "Exten: %s\r\n"
+                       "Reason: %i\r\n",
+                       in->idtext, in->tech, in->data, in->context, in->exten, reason);
        else
                manager_event(EVENT_FLAG_CALL,
                        "OriginateFailure",
                        "%s"
                        "Channel: %s/%s\r\n"
                        "Context: %s\r\n"
-                       "Exten: %s\r\n",
-                       in->idtext, in->tech, in->data, in->context, in->exten);
+                       "Exten: %s\r\n"
+                       "Reason: %i\r\n",
+                       in->idtext, in->tech, in->data, in->context, in->exten, reason);
 
        free(in);
        return NULL;
@@ -879,8 +881,8 @@ static int action_originate(struct mansession *s, struct message *m)
        char *priority = astman_get_header(m, "Priority");
        char *timeout = astman_get_header(m, "Timeout");
        char *callerid = astman_get_header(m, "CallerID");
-    char *variable = astman_get_header(m, "Variable");
-    char *account = astman_get_header(m, "Account");
+       char *variable = astman_get_header(m, "Variable");
+       char *account = astman_get_header(m, "Account");
        char *app = astman_get_header(m, "Application");
        char *appdata = astman_get_header(m, "Data");
        char *async = astman_get_header(m, "Async");