you can set ton/npi in the config file. its not a good idea to hardcode this into the binary as it would dissalow you to send international originating SMS for non shortcode.
> On 14 Oct 2015, at 14:20, Ahmed Shabana <a.shab...@cequens.com> wrote: > > Dears at kannel devel mailing list , > > Have a nice day , > > Some of our SMPP SMSC provider ( specially Orange ) , claim that submitting > short code sender for MT SMSs must be follow below npi & ton value > > I add below patch , and it working well . feel free to commit it to the trunk > if you need , or keep it in the mail list as a reference for others . > > > Index: gw/smsc/smsc_smpp.c > =================================================================== > --- gw/smsc/smsc_smpp.c (revision 5110) > +++ gw/smsc/smsc_smpp.c (working copy) > @@ -82,6 +82,8 @@ > #include "load.h" > > #define SMPP_DEFAULT_CHARSET "UTF-8" > +#define SHORT_CODE_MAX_LEN 0x06 > +#define SHORT_CODE_MIN_LEN 0x04 > > /* > * Select these based on whether you want to dump SMPP PDUs as they are > @@ -892,8 +894,11 @@ > } else if > (charset_convert(pdu->u.submit_sm.source_addr, SMPP_DEFAULT_CHARSET, > octstr_get_cstr(smpp->alt_addr_charset)) != 0) > error(0, "Failed to convert source_addr from > charset <%s> to <%s>, will send as is.", > SMPP_DEFAULT_CHARSET, > octstr_get_cstr(smpp->alt_addr_charset)); > - } > - } > + } > + }else if(octstr_len(pdu->u.submit_sm.source_addr) < > SHORT_CODE_MAX_LEN && octstr_len(pdu->u.submit_sm.source_addr) > > SHORT_CODE_MIN_LEN){ > + pdu->u.submit_sm.source_addr_ton = > GSM_ADDR_TON_ABBREVIATED ; > + pdu->u.submit_sm.source_addr_npi = > GSM_ADDR_NPI_UNKNOWN ; > + } > } > }
signature.asc
Description: Message signed with OpenPGP using GPGMail