UCP/EMI to support E50_HPLMN and E50_AC

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

Hi, 

I'm using the meta-data to get the E50_HPLMN and set the E50_AC. 

here's the patch to support that for the EMI protocol. If you guys have
a better way of doing so please feel free to give me a hint. 

I'd like to apply the patch in the main repo asap. 

thanks
emi.patch (text/x-diff, 1.2 KB)
--- /home/mgatien/smsc_emi.c	2014-07-10 16:09:52.811210564 +0000
+++ gw/smsc/smsc_emi.c	2014-07-10 13:28:44.815970958 +0000
@@ -88,6 +88,7 @@
 #include "sms.h"
 #include "emimsg.h"
 #include "dlr.h"
+#include "meta_data.h"
 #include "alt_charsets.h"
 
 #define EMI2_MAX_TRN 100
@@ -459,6 +460,11 @@
     else if (msg->sms.rpi > 0)
         emimsg->fields[E50_RPI] = octstr_create("1");
 
+    /* Use meta-data to set the E50_AC */
+    if (msg->sms.meta_data != NULL) {
+        emimsg->fields[E50_AC] =  meta_data_get_value(msg->sms.meta_data, "smpp", octstr_imm("E50_AC"));
+    }
+
     str = octstr_duplicate(msg->sms.receiver);
     if(octstr_get_char(str,0) == '+') {
     	 /* international number format */
@@ -777,6 +783,12 @@
 		  octstr_get_cstr(emimsg->fields[E50_MT]));
 	    msg->sms.msgdata = octstr_create("");
 	}
+	
+        //Insert the E50_HPLMN into meta_data
+        msg->sms.meta_data = octstr_duplicate(emimsg->fields[E50_HPLMN]);
+	if (msg->sms.meta_data != NULL) {
+            meta_data_set_value(msg->sms.meta_data, "smpp" , octstr_imm("E50_HPLMN"), octstr_duplicate(emimsg->fields[E50_HPLMN]),1);
+	}
 
 	msg->sms.sender = octstr_duplicate(emimsg->fields[E50_OADC]);
 	if (msg->sms.sender == NULL) {
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.