]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
give outbound channels callerid of their extension after calling (bug #2489)
authorRussell Bryant <russell@russellbryant.com>
Mon, 17 Jan 2005 22:52:49 +0000 (22:52 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 17 Jan 2005 22:52:49 +0000 (22:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4826 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index cc2b4b62f82dd48ac21edd1d16336d87c400142f..ce50a10da90dd650ac73e0e70eb49c54fab7d12f 100755 (executable)
@@ -281,6 +281,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
                                                        ast_hangup(o->chan);
                                                        o->chan = NULL;
                                                        numnochan++;
+                                               } else {
+                                                       /* After calling, set callerid to extension */
+                                                       ast_set_callerid(o->chan, ast_strlen_zero(in->macroexten) ? in->exten : in->macroexten, 0);
                                                }
                                        }
                                        /* Hangup the original channel now, in case we needed it */
@@ -845,9 +848,11 @@ static int dial_exec(struct ast_channel *chan, void *data)
                        free(tmp);
                        cur = rest;
                        continue;
-               } else
+               } else {
                        if (option_verbose > 2)
                                ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
+                       ast_set_callerid(tmp->chan, ast_strlen_zero(chan->macroexten) ? chan->exten : chan->macroexten, 0);
+               }
                /* Put them in the list of outgoing thingies...  We're ready now. 
                   XXX If we're forcibly removed, these outgoing calls won't get
                   hung up XXX */