Re: Source address auto detect for short code

Andreas Fink <[email protected]> Wed, 14 Oct 2015 17:13:57 +0200
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
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]> 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 (application/pgp-signature, 872 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.29
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCgAGBQJWHnE1AAoJEOtfx+3l1p1nmCMP/1OuCxBravSAyyOvhchndKU9
xgLrUeE8ho2XgdjQOhoF18inundcBwIUTbYslmZLrG0FCZZsNYnJmHntPEYP1Y/W
DosXeE2ZUswgT3v0dL85qjF89ErnPpAI1wCPPmegIna8jIGvSlJ836FmvWCemyQ0
Ua6F/UpJEJ5NU3GH0NGDZQOXo45AUpYvwCHvZRxrl/pZ565gy2jfJSSrvgpBC5iA
P4bqhzuBuNYmfGWViZFFA7aYRL0hp7SX43oNi/lRY9+1x/XG7JWOFsacb9GroT5X
6OeH20x0dhv7EMlzgJjIWqlt6GOHIZ7mL27VbrMF5/aFC/aESLLHI+crynH2RDIe
ivHtViRbWW6RdtFgH7fK6ZDElEKQVbLuio6mCxFJVwxuniqBYfk3C62gXpJcMJ7v
DDA8ZH/BUjRjRMqFQ3NIu4CL67Q35saKL1F9QXVpo+uory6pzCNgJ42L3PQPEZ+S
sT3AFTIhSvBQYNHAT8VF7pymd5ZrS/oTLQGuF0YO8BcNhQUqrHaVnPclC1hr1yag
lX5qFNMTLsrrUhIAoav2GmSTHCBypnww7gDfPB6FF16GVphmWHBJiRvOcorTKd4Y
qdaRF24ZCUZZfisIxTn03/ivvckVJhB1/vte5gwoUSMegZkzFvodRKQ/4UlhmymA
CsDL03PzXDZLWMA1+BUQ
=8KMT
-----END PGP SIGNATURE-----