On Tue, Sep 27, 2005 at 05:28:30PM +0200, Stipe Tolj wrote:
> I'm -1 on commiting the patch in the form Enver send it in. We need to add
> a meta field layer in order to "pass" smsc specific values to the smsc
> module layer.
I had the same problem while still working for my previous employer
(i.e have to set esm_class suppose to be able to connect to one of CDMA
operators in Indonesia, Telkom/Flexi). At that time, I do make it
configurable through kannel config, i.e set 'submit_esm_class = 1" on
smsc group.
My current connection to the same operator doesn't need that setting
anymore.
Anyway, please take a alook at the attached patch.
Regards,
P.Y. Adi Prasaja
Index: gw/smsc/smsc_smpp.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v
retrieving revision 1.82
diff -a -u -r1.82 smsc_smpp.c
--- gw/smsc/smsc_smpp.c 12 Aug 2005 16:12:58 -0000 1.82
+++ gw/smsc/smsc_smpp.c 27 Sep 2005 17:07:32 -0000
@@ -161,6 +161,7 @@
long connection_timeout;
long wait_ack;
int wait_ack_action;
+ int submit_esm_class;
SMSCConn *conn;
} SMPP;
@@ -213,7 +214,7 @@
Octstr *my_number, int smpp_msg_id_type,
int autodetect_addr, Octstr *alt_charset,
Octstr *service_type, long connection_timeout,
- long wait_ack, int wait_ack_action)
+ long wait_ack, int wait_ack_action, int
submit_esm_class)
{
SMPP *smpp;
@@ -252,6 +253,7 @@
smpp->connection_timeout = connection_timeout;
smpp->wait_ack = wait_ack;
smpp->wait_ack_action = wait_ack_action;
+ smpp->submit_esm_class = submit_esm_class;
return smpp;
}
@@ -667,7 +669,7 @@
* set the esm_class field
* default is store and forward, plus udh and rpi if requested
*/
- pdu->u.submit_sm.esm_class = ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE;
+ pdu->u.submit_sm.esm_class = smpp->submit_esm_class;
if (octstr_len(msg->sms.udhdata))
pdu->u.submit_sm.esm_class = pdu->u.submit_sm.esm_class |
ESM_CLASS_SUBMIT_UDH_INDICATOR;
@@ -1758,6 +1760,7 @@
int autodetect_addr;
Octstr *alt_charset;
long connection_timeout, wait_ack, wait_ack_action;
+ int submit_esm_class;
my_number = alt_charset = NULL;
transceiver_mode = 0;
@@ -1883,13 +1886,18 @@
if (wait_ack_action > 0x03 || wait_ack_action < 0)
panic(0, "SMPP: Invalid wait-ack-expire directive in configuration.");
+ /* submit_esm_class */
+ if (cfg_get_integer((long *)&submit_esm_class, grp,
octstr_imm("submit-esm-class")) == -1)
+ submit_esm_class = ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE;
+
smpp = smpp_create(conn, host, port, receive_port, system_type,
username, password, address_range,
source_addr_ton, source_addr_npi, dest_addr_ton,
dest_addr_npi, enquire_link_interval,
max_pending_submits, version, priority, my_number,
smpp_msg_id_type, autodetect_addr, alt_charset,
- service_type, connection_timeout, wait_ack,
wait_ack_action);
+ service_type, connection_timeout, wait_ack,
wait_ack_action,
+ submit_esm_class);
conn->data = smpp;
conn->name = octstr_format("SMPP:%S:%d/%d:%S:%S",
Index: gwlib/cfg.def
===================================================================
RCS file: /home/cvs/gateway/gwlib/cfg.def,v
retrieving revision 1.112
diff -a -u -r1.112 cfg.def
--- gwlib/cfg.def 21 Sep 2005 02:01:22 -0000 1.112
+++ gwlib/cfg.def 27 Sep 2005 17:07:35 -0000
@@ -328,6 +328,7 @@
OCTSTR(flow-control)
OCTSTR(wait-ack)
OCTSTR(wait-ack-expire)
+ OCTSTR(submit-esm-class)
OCTSTR(no-sender)
OCTSTR(no-coding)
OCTSTR(window)