Re: [RFC] variable sms_split() length per SMSCConn

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

I believe we should get user possibility to send longer messages if he
wants. Attached simple patch allows it.

Anybody write userguide for it?

Stipe Tolj wrote:

> Andreas Fink schrieb:
>> The known GSM SMSC's dont accept longer SMS because the GSM
>> infrastructure does not allow longer SMS than the 140 octets.
>> some CDMA SMSC's might accept longer SMS and some GSM SMSc's might split
>> it on their side but so far I have not seen any really supporting it or
>> at least not with asking a fortune to the operator for a useless feature.
>> 
>> I don't see a real need for this.
> 
> I do. From an achitecure point of view we (kannel) is beyond the signaling
> layer. So taking it strictly, we COULD use protocols towards SMSC that
> allow long messages to be passed in one PDU, as SMPP per spec does. Or
> consider HTTP as a simple example.
> 
> I understand that most vendors leaverage the underlying signaling limits
> (140 octets per GSM SMS message) to the SMSC clients, but this is actually
> not conceptualls correct.
> 
> What I want is to give the user an "option" to define the max octets we
> are allowed to pass to the SMSC. Which SHOULD BE allowed, hence we're
> still above the signaling layer.
> 
> Think of Kannel instance concatenation as another example:
> 
> client <-> smsbox(2) <-> bearerbox(2)[smsc_http] <-> smsbox(1) <->
> bearerbox(1)[smsc_smpp] <-> SMSC
> 
> so if a client injects a large msg at the left hand side, this would
> result in a sms_split() segmentation within bearerbox(2), even while we
> know that smsbox(1) could handle the "whole message".
> 
> Stipe
> 
> -------------------------------------------------------------------
> Kölner Landstrasse 419
> 40589 DÃŒsseldorf, NRW, Germany
> 
> tolj.org system architecture      Kannel Software Foundation (KSF)
> http://www.tolj.org/              http://www.kannel.org/
> 
> mailto:st_{at}_tolj.org           mailto:stolj_{at}_kannel.org
> -------------------------------------------------------------------

-- 
Thanks,
Alex
max-sms-octets.diff (text/x-diff, 1.8 KB)
diff --git a/gw/smscconn.c b/gw/smscconn.c
index 21e824d..6654665 100644
--- a/gw/smscconn.c
+++ b/gw/smscconn.c
@@ -229,6 +229,9 @@ SMSCConn *smscconn_create(CfgGroup *grp, int start_as_stopped)
     if (cfg_get_integer(&conn->log_level, grp, octstr_imm("log-level")) == -1)
         conn->log_level = 0;
 
+    if (cfg_get_integer(&conn->max_sms_octets, grp, octstr_imm("max-sms-octets")) == -1)
+        conn->max_sms_octets = MAX_SMS_OCTETS;
+
     /* open a smsc-id specific log-file in exlusive mode */
     if (conn->log_file)
         conn->log_idx = log_open(octstr_get_cstr(conn->log_file), 
@@ -512,7 +515,7 @@ int smscconn_send(SMSCConn *conn, Msg *msg)
 
         /* split msg */
         parts = sms_split(msg, NULL, NULL, NULL, NULL, 1, 
-            counter_increase(split_msg_counter) & 0xff, 0xff, MAX_SMS_OCTETS);
+            counter_increase(split_msg_counter) & 0xff, 0xff, conn->max_sms_octets);
         if (gwlist_len(parts) == 1) {
             /* don't create split_parts of sms fit into one */
             gwlist_destroy(parts, msg_destroy_item);
diff --git a/gw/smscconn_p.h b/gw/smscconn_p.h
index 866f2f7..89bdcf1 100644
--- a/gw/smscconn_p.h
+++ b/gw/smscconn_p.h
@@ -202,6 +202,7 @@ struct smscconn {
     Octstr *reroute_to_smsc;    /* define a smsc-id to reroute to */
     int reroute_dlr;            /* should DLR's are rereouted too? */
 
+    long max_sms_octets; /* max allowed octets for this SMSC */
 
     /* XXX: move rest global data from Smsc here
      */
diff --git a/gwlib/cfg.def b/gwlib/cfg.def
index 5a29f61..b0dcd9f 100644
--- a/gwlib/cfg.def
+++ b/gwlib/cfg.def
@@ -381,6 +381,7 @@ MULTI_GROUP(smsc,
     OCTSTR(status-success-regex)
     OCTSTR(status-permfail-regex)
     OCTSTR(status-tempfail-regex)
+    OCTSTR(max-sms-octets)
 )
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.