Re: Internal rerouting issues

"Dziugas Baltrunas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

> > Moreover, I noticed one more minor issue with rerouting. One would
> > expect that both source and destination TON/NPI would remain the same
> > in submit_sm as they were in deliver_sm, however, they are not. What
> > is more, even if, say, destination address has TON = 1, Kannel will
> > not treat it as an international number since there are no "+" in the
> > beginning and as a result it will set TON to 2 (national number).
> > Again, having dest-addr-ton = 1 in the smsc group makes a "workaround"
> > for international numbers.
> >
>
> That could be caused by receiver SMSC module if sending SMSC doesn't set
> ton/npi values to international. It's not a kannel fault but sending SMSC.

No, this is not true. As I said, deliver_sm comes with TON set to
international but after Kannel unpacks it to internal structure and
then packs again, it gets lost since number does not have a '+'
prefix. This is clearly seen from gw/smsc/smsc_smpp.c, pdu_to_msg and
msg_to_pdu() functions. To be more precise, pdu_to_msg() does

msg->sms.sender = pdu->u.deliver_sm.source_addr;

and msg_to_pdu() does a check:

    /*
     * if its a international number starting with +, lets remove the
     * '+' and set number type to international instead
     */
    if (octstr_get_char(pdu->u.submit_sm.destination_addr,0) == '+') {
        octstr_delete(pdu->u.submit_sm.destination_addr, 0,1);
        pdu->u.submit_sm.dest_addr_ton = GSM_ADDR_TON_INTERNATIONAL;
    }

which will never be true since '+' is only for mnemonics and it will
rarely be put before the number. So the problem indeed is that msg
structure does not have such a marker to store the type of src/dst
number.

-- 
Dziugas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.