Hello
For now International (addr = 0x1) numbers are validated with this code:
case GSM_ADDR_TON_INTERNATIONAL:
/*
* Checks to perform:
* 1) assume international number has at least 7 chars
* 2) the whole source addr consist of digits, exception '+' in
front
*/
if (octstr_len(addr) < 7) {
/* We consider this as a "non-hard" condition, since there "may"
* be international numbers routable that are < 7 digits. Think
* of 2 digit country code + 3 digit emergency code. */
warning(0, "SMPP[%s]: Mallformed addr `%s', generally expected
at least 7 digits. ",
octstr_get_cstr(id),
octstr_get_cstr(addr));
} else if (octstr_get_char(addr, 0) == '+' &&
!octstr_check_range(addr, 1, 256, gw_isdigit)) {
error(0, "SMPP[%s]: Mallformed addr `%s', expected all digits.
",
octstr_get_cstr(id),
octstr_get_cstr(addr));
reason = SMPP_ESME_RINVSRCADR;
goto error;
} else if (octstr_get_char(addr, 0) != '+' &&
!octstr_check_range(addr, 0, 256, gw_isdigit)) {
error(0, "SMPP[%s]: Mallformed addr `%s', expected all digits.
",
octstr_get_cstr(id),
octstr_get_cstr(addr));
reason = SMPP_ESME_RINVSRCADR;
goto error;
}
/* check if we received leading '00', then remove it*/
if (octstr_search(addr, octstr_imm("00"), 0) == 0)
octstr_delete(addr, 0, 2);
/* international, insert '+' if not already here */
if (octstr_get_char(addr, 0) != '+')
octstr_insert_char(addr, 0, '+');
break;
Could any one give a reference for the international format, which has been
used while this code was written. There is no any in SMPP 3.4 specs.
Thanks.
--
With best regards, Ivan Kurnosov