diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-03 04:25:21 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-03 04:25:21 +0000 |
commit | 4c50c16addfc846eefccf8d517e696a23e869bd1 (patch) | |
tree | 9e29310d1f0916eaa0b2301492a9ed5f1c5e093a /channels/chan_h323.c | |
parent | 9f9c7882f4f3b0b592576b1f9a44a44b77c4d472 (diff) |
Blocked revisions 36725 via svnmerge
........
r36725 | russell | 2006-07-03 00:19:09 -0400 (Mon, 03 Jul 2006) | 4 lines
use ast_set_callerid to be more consistent and to make sure that the
"callerid" option in the conf files is always handled the same way and sets ANI
(issue #7285, gkloepfer)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@36726 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r-- | channels/chan_h323.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 36c0582b8..a638b19a7 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -786,16 +786,15 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c if (pvt->amaflags) { ch->amaflags = pvt->amaflags; } - if (!ast_strlen_zero(pvt->cid_num)) { - ch->cid.cid_num = strdup(pvt->cid_num); - } else if (!ast_strlen_zero(pvt->cd.call_source_e164)) { - ch->cid.cid_num = strdup(pvt->cd.call_source_e164); - } - if (!ast_strlen_zero(pvt->cid_name)) { - ch->cid.cid_name = strdup(pvt->cid_name); - } else if (!ast_strlen_zero(pvt->cd.call_source_name)) { - ch->cid.cid_name = strdup(pvt->cd.call_source_name); - } + /* + * If cid_num and cd.call_source_e164 are both null, then + * ast_set_callerid will do the right thing and leave the + * cid_num and cid_ani for the channel alone. + */ + ast_set_callerid(ch, + !ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164, + !ast_strlen_zero(pvt->cid_name) ? pvt->cid_name : pvt->cd.call_source_name, + !ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164); if (!ast_strlen_zero(pvt->rdnis)) { ch->cid.cid_rdnis = strdup(pvt->rdnis); } |