Re: [FYI] billing identifier/information proxying

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

I think it's nice if we could specify billing info using
X-Kannel-BInfo header from sms-service.

I'm not sure about smsc_http.c ... is that correct?

Diff output from latest cvs attached.

Regards,

P.Y. Adi Prasaja
binfo.diffs (text/plain, 2.5 KB)
Index: gw/smsbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsbox.c,v
retrieving revision 1.236
diff -a -u -r1.236 smsbox.c
--- gw/smsbox.c	17 Oct 2003 14:18:41 -0000	1.236
+++ gw/smsbox.c	19 Oct 2003 01:59:15 -0000
@@ -424,6 +424,10 @@
 	    *account = octstr_duplicate(val);
 	    octstr_strip_blanks(*account);
 	}
+	else if (octstr_case_compare(name, octstr_imm("X-Kannel-BInfo")) == 0) {
+            *binfo = octstr_duplicate(val);
+            octstr_strip_blanks(*binfo);
+	}
 	else if (octstr_case_compare(name, octstr_imm("X-Kannel-Coding")) == 0) {
     	    sscanf(octstr_get_cstr(val),"%d", coding);
 	}
Index: gw/smsc/smsc_http.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_http.c,v
retrieving revision 1.28
diff -a -u -r1.28 smsc_http.c
--- gw/smsc/smsc_http.c	16 Oct 2003 16:00:44 -0000	1.28
+++ gw/smsc/smsc_http.c	19 Oct 2003 01:59:17 -0000
@@ -299,6 +299,8 @@
 	octstr_format_append(url, "&mwi=%d", sms->sms.mwi);
     if (sms->sms.account) /* prepend account with local username */
 	octstr_format_append(url, "&account=%E:%E", sms->sms.service, sms->sms.account);
+    if (sms->sms.binfo) /* prepend billing info */
+	octstr_format_append(url, "&binfo=%S", sms->sms.binfo);
     if (sms->sms.smsc_id) /* proxy the smsc-id to the next instance */
 	octstr_format_append(url, "&smsc=%S", sms->sms.smsc_id);
     if (sms->sms.dlr_url) {
@@ -341,7 +343,7 @@
 			       List *headers, Octstr *body, List *cgivars)
 {
     ConnData *conndata = conn->data;
-    Octstr *user, *pass, *from, *to, *text, *udh, *account, *tmp_string;
+    Octstr *user, *pass, *from, *to, *text, *udh, *account, *binfo, *tmp_string;
     Octstr *retmsg;
     int	mclass, mwi, coding, validity, deferred;
     List *reply_headers;
@@ -356,7 +358,7 @@
     text = http_cgi_variable(cgivars, "text");
     udh = http_cgi_variable(cgivars, "udh");
     account = http_cgi_variable(cgivars, "account");
-
+    binfo = http_cgi_variable(cgivars, "binfo");
     tmp_string = http_cgi_variable(cgivars, "flash");
     if(tmp_string) {
 	sscanf(octstr_get_cstr(tmp_string),"%d", &mclass);
@@ -417,7 +419,8 @@
 	msg->sms.coding = coding;
 	msg->sms.validity = validity;
 	msg->sms.deferred = deferred;
-    msg->sms.account = octstr_duplicate(account);
+	msg->sms.account = octstr_duplicate(account);
+	msg->sms.binfo = octstr_duplicate(binfo);
 	ret = bb_smscconn_receive(conn, msg);
 	if (ret == -1)
 	    retmsg = octstr_create("Not accepted");
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.