From 4c50c16addfc846eefccf8d517e696a23e869bd1 Mon Sep 17 00:00:00 2001 From: russell Date: Mon, 3 Jul 2006 04:25:21 +0000 Subject: 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 --- channels/chan_h323.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'channels/chan_h323.c') 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); } -- cgit v1.2.3