[PATCH] Shortcode detection in smsc_smpp.c (1.4 .3 based)

Slavoj Hruška <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization XEN-Housing s.r.o.
Message-ID <830940fc3a6bef4116794447279460b0@localhost>
Hi,

at first sorry about my poor english ;) I hope that my patch will be better
;)

Description:

problematic setup:

source-addr-autodetect = yes
dest-addr-ton = 1
dest-addr-npi = 1
source-addr-ton = 1
source-addr-npi = 1

Testcase 1)

FROM = 421xxxYYYYYY (international formated)
  TO = 420xxxYYYYYY (international formated)

result = OK


Testcase 2)

FROM = SANTA        (Alphanumeric sender)
  TO = 420xxxYYYYYY (international formated)

result = OK



Testcase 3)

FROM = 12345        (shortcode)
  TO = 420xxxYYYYYY (international formated)

result = PROBLEM
MT show sender as +12345 and SMS can not be replyed.

After that patch everything is ok.

I hope that my "SHORTCODE ENGLISH" explanation was clear to clear purpose
of that patch ;)

PS: Stipe, thnx for "howto"

-- 

-- 
S pozdravom / Sincerely Yours

Slavoj Hruska
Director

SMS-Brana.SK
------------------------------------
Tel. (SK) : +421-47-2250119
Tel. (UK) : +44-203-1296148
Tel. (USA): +1-235-397-1823
Tel. (SK) : +421-650-822969 - HaVel VoIP
Fax. (SK) : +421-2-20252478

E-Mail    : [email protected]
WEB       : http://www.sms-brana.sk/
------------------------------------

XEN-Housing s.r.o.
Panenská 24
811 09 Bratislava

IČO: 44 010 567
DIČ: 2022556030
Registrácia: Okresný súd Bratislava I, odd.: Sro, vl.č.: 51050/B
smsc_smpp.patch (application/octet-stream, 1.1 KB)
--- smsc_smpp.c	2009-01-12 17:46:50.000000000 +0100
+++ smsc_smpp_new.c	2009-03-02 08:37:40.000000000 +0100
@@ -794,6 +794,19 @@
                 }
             }
         }
+        /* lets make it Santa's way */
+        if (octstr_check_range(pdu->u.submit_sm.source_addr, 1, 256, gw_isdigit)){
+            if (octstr_len(pdu->u.submit_sm.source_addr) <7){
+                warning(0, "SMPP[%s]: Santa's way shortcode detected %s.",
+                                   octstr_get_cstr(smpp->conn->id),octstr_get_cstr(pdu->u.submit_sm.source_addr));
+                pdu->u.submit_sm.source_addr_ton = GSM_ADDR_TON_NATIONAL;   /* national */
+                pdu->u.submit_sm.source_addr_npi = GSM_ADDR_NPI_UNKNOWN;    /* short code */
+            }else{
+                pdu->u.submit_sm.source_addr_ton = smpp->source_addr_ton;
+                pdu->u.submit_sm.source_addr_npi = smpp->source_addr_npi;
+            }
+       }
+                                                                                                                                    
     }
 
     /* Check for manual override of destination ton and npi values */
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.