fix check for NANPA

This commit is contained in:
Rupa Schomaker 2010-03-31 15:39:16 -05:00
parent dac1243900
commit f6eda2c23b
1 changed files with 2 additions and 2 deletions

View File

@ -700,12 +700,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') || !switch_is_number(cb_struct->cid)) {
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;
}