From: Richard Mudgett Date: Tue, 20 Dec 2011 23:09:53 +0000 (+0000) Subject: Fix chan_iax2 to not report an RDNIS number if it is blank. X-Git-Tag: 10.1.0-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bfbc7febf197ca1f5de61a16e9f5ac6a7102cc1;p=thirdparty%2Fasterisk.git Fix chan_iax2 to not report an RDNIS number if it is blank. Some ISDN switches complain or block the call if the RDNIS number is empty. * Made chan_iax2 not save a RDNIS number into the ast_channel if the string is blank. This is what other channel drivers do. (closes issue ASTERISK-17152) Reported by: rmudgett ........ Merged revisions 348735 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@348736 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index a34bb98f4c..79e9aefe61 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -5839,8 +5839,10 @@ static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capab tmp->caller.ani.number.str = ast_strdup(i->cid_num); } tmp->dialed.number.str = ast_strdup(i->dnid); - tmp->redirecting.from.number.valid = 1; - tmp->redirecting.from.number.str = ast_strdup(i->rdnis); + if (!ast_strlen_zero(i->rdnis)) { + tmp->redirecting.from.number.valid = 1; + tmp->redirecting.from.number.str = ast_strdup(i->rdnis); + } tmp->caller.id.name.presentation = i->calling_pres; tmp->caller.id.number.presentation = i->calling_pres; tmp->caller.id.number.plan = i->calling_ton;