Re: Source address auto detect for short code
Ahmed Shabana <[email protected]> Thu, 15 Oct 2015 19:11:52 +0000
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <HE1PR07MB1180F514340B3948F22D878EF63E0@HE1PR07MB1180.eurprd07.prod.outlook.com> |
This act only in case of source-addr-autodetecy to able to use one session for various source address types ________________________________ From: Andreas Fink <[email protected]> Sent: Wednesday, October 14, 2015 3:13:57 PM To: Ahmed Shabana Cc: devel Devel Subject: Re: Source address auto detect for short code 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 <[email protected]<mailto:[email protected]>> 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 ; + } } }