From: Tilghman Lesher Date: Wed, 18 Aug 2010 07:43:14 +0000 (+0000) Subject: Don't warn on callerid when completely text, instead of numeric with localdialplan... X-Git-Tag: 1.6.2.12-rc1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=943034663acc3fe0cc64cb6f147db94f734f0a75;p=thirdparty%2Fasterisk.git Don't warn on callerid when completely text, instead of numeric with localdialplan prefixes. (closes issue #16770) Reported by: jamicque Patches: 20100413__issue16770.diff.txt uploaded by tilghman (license 14) 20100811__issue16770.diff.txt uploaded by tilghman (license 14) Tested by: jamicque git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@282607 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index fb45564e3d..820a1c8c3a 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -3601,7 +3601,16 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout) l = NULL; n = NULL; if (!p->hidecallerid) { - l = ast->cid.cid_num; + /* If we get to the end of this loop without breaking, there's no + * numeric calleridnum. This is done instead of testing for + * "unknown" or the thousands of other ways that the calleridnum + * could be invalid. */ + for (l = ast->cid.cid_num; l && *l; l++) { + if (strchr("0123456789", *l)) { + l = ast->cid.cid_num; + break; + } + } if (!p->hidecalleridname) { n = ast->cid.cid_name; }