here is the modification of esm_class using meta-data approach. I have
not tested yet, but I think this will work.
Stipe, if you think this approach is OK, I will test it.
Having done this, I believe that this parameter should be configurable
from the configuration file, not from an url request because defines
an important behavior, like the 'host'.
just my thoughts. ;)
BEGIN DIFF
******************************************************************************************
--- kannel-snapshot-original/gw/smsc/smsc_smpp.c 2009-01-29
08:38:28.000000000 -0300
+++ kannel-snapshot/gw/smsc/smsc_smpp.c 2009-03-24 09:42:13.000000000
-0400
@@ -743,6 +743,7 @@
{
SMPP_PDU *pdu;
int validity;
+ Octstr *esm_class_default;
pdu = smpp_pdu_create(submit_sm,
counter_increase(smpp->message_id_counter));
@@ -854,10 +855,20 @@
pdu->u.submit_sm.protocol_id = msg->sms.pid;
/*
- * set the esm_class field
- * default is store and forward, plus udh and rpi if requested
+ * set the esm_class field from meta-data, if not set, the
default value is asummed
+ * (Original: pdu->u.submit_sm.esm_class =
ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE;)
+ * Alvaro Talavera (alvarot...@gmail.com) - www.puntopy.com
*/
- pdu->u.submit_sm.esm_class =
ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE;
+
+ if (msg->sms.meta_data != NULL &&
+ (esm_class_default = meta_data_get_value(msg->sms.meta_data,
"smpp", octstr_imm("esm_class"))) != NULL) {
+ degug("bb.sms.smpp",0,"esm_class meta_data received, set in %s",
octstr_get_cstr(esm_class_default));
+ pdu->u.submit_sm.esm_class = octstr_get_cstr(esm_class_default);
+ }else{
+ degug("bb.sms.smpp",0,"esm_class meta_data empty, set
default.");
+ pdu->u.submit_sm.esm_class = ESM_CLASS_SUBMIT_DEFAULT_SMSC_MODE;
+ }
+
if (octstr_len(msg->sms.udhdata))
pdu->u.submit_sm.esm_class = pdu->u.submit_sm.esm_class |
ESM_CLASS_SUBMIT_UDH_INDICATOR;
******************************************************************************************
END DIFF
Stipe:
> you're welcome. :) ... well we all know the need of "quick-and-
dirty". But
> that's what we need to beware of to commit to CVS.
>
> I urge the group to pick up Alvaro's patch and modify for the meta-
data
> approach. There should be some more people out there who can do this?