From: Anthony Minessale Date: Fri, 19 Mar 2010 23:23:04 +0000 (+0000) Subject: qualify the whole string is digits in test X-Git-Tag: v1.0.6~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4006ffa33271e678b729fda660ba4b98685e6579;p=thirdparty%2Ffreeswitch.git qualify the whole string is digits in test git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17053 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index 3fd06d96a5..700446f03e 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -691,11 +691,12 @@ static switch_status_t is_intrastatelata(callback_t *cb_struct) e164 format without the + NANP only (so 11 digits starting with 1) */ - if (!cb_struct->lookup_number || (strlen(cb_struct->lookup_number) != 11 && *cb_struct->lookup_number != '1')) { + if (!cb_struct->lookup_number || (strlen(cb_struct->lookup_number) != 11 && *cb_struct->lookup_number != '1') || + !switch_is_number(cb_struct->lookup_number)) { /* dest doesn't appear to be NANP number */ return SWITCH_STATUS_GENERR; } - if (!cb_struct->cid || (strlen(cb_struct->cid) != 11 && *cb_struct->cid != '1')) { + if (!cb_struct->cid || (strlen(cb_struct->cid) != 11 && *cb_struct->cid != '1') || !switch_is_number(cb_struct->cid)) { /* cid not NANP */ return SWITCH_STATUS_GENERR; }