From: Mark Spencer Date: Sun, 16 Jan 2005 07:58:51 +0000 (+0000) Subject: Give outbound channels callerid of their extension *after* calling (bug #2489) X-Git-Tag: 1.2.0-beta1~1379 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6b393c1b923546ec00c96ce5dbc5397cebc6eb8;p=thirdparty%2Fasterisk.git Give outbound channels callerid of their extension *after* calling (bug #2489) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4810 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_dial.c b/apps/app_dial.c index 0cbc302b68..2828262b7e 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -336,6 +336,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, NULL, NULL); } } /* Hangup the original channel now, in case we needed it */ @@ -912,9 +915,11 @@ static int dial_exec(struct ast_channel *chan, void *data) tmp->chan = NULL; 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, NULL, NULL); + } /* 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 */