]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix callerid of Originated calls.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 27 Feb 2012 23:34:03 +0000 (23:34 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 27 Feb 2012 23:34:03 +0000 (23:34 +0000)
Thanks to Matt Riddell for tracking this down.

(closes issue ASTERISK-19385)
Reported by: ornix

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@357093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 83ff60c6b53700ecffb93ed23c075ef707ae04ac..273f2c9b347ad4ef9e793f41602361d3e42bfaf3 100644 (file)
@@ -5354,6 +5354,16 @@ struct ast_channel *__ast_request_and_dial(const char *type, format_t format, co
                }
        }
 
+       /*
+        * I seems strange to set the CallerID on an outgoing call leg
+        * to whom we are calling, but this function's callers are doing
+        * various Originate methods.  This call leg goes to the local
+        * user.  Once the local user answers, the dialplan needs to be
+        * able to access the CallerID from the CALLERID function as if
+        * the local user had placed this call.
+        */
+       ast_set_callerid(chan, cid_num, cid_name, cid_num);
+
        ast_set_flag(chan->cdr, AST_CDR_FLAG_ORIGINATED);
        ast_party_connected_line_set_init(&connected, &chan->connected);
        if (cid_num) {