Re: sms MT charging advice

"Arne K. Haaje" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Eurobate ASA
Message-ID <[email protected]>
mandag 18. august 2003, 13:38, skrev DILWORTH MICHAEL:
> hi Arne
>
> thanks for the feedback.  it is interesting to see how others have tackled
> this issue. i am interested to know how you determined that the mesasge was
> binary and hence needed your price code fix.  did you look at the udh data?

No. I apply this for any message that is sent,  but the only messages that we 
need to split are binary.

>  also did you do this inside sms_split ?
Yes.

I have enclosed a diff for the patch. It is perhaps a bit ugly, but it appears 
to work fine. Feel free to use it.

-- 
Med vennlig hilsen,
Eurobate ASA

Arne K. Haaje
Senior Network Engineer
--------------------------------------------------------------------
    Eurobate ASA - Postboks 4589 Nydalen - 0404 Oslo - Norway
Phone: +47 23 22 73 73 - Fax: +47 23 22 73 74 - Mob: +47 92 88 44 66
                    http://www.eurobate.com/
netcom-tariff.diff (text/x-diff, 1.5 KB)
--- /home/kannel/kannel-snapshot/gw/shared.c	2003-07-20 02:57:50.000000000 +0200
+++ shared.c	2003-08-18 14:07:42.000000000 +0200
@@ -11,7 +11,6 @@
 #include "shared.h"
 #include "sms.h"
 #include "dlr.h"
-
 #if defined(HAVE_LIBSSL) || defined(HAVE_WTLS_OPENSSL) 
 #include <openssl/opensslv.h>
 #endif
@@ -19,7 +18,6 @@
 #include <mysql_version.h>
 #endif
 
-
 enum program_status program_status = starting_up;
 
 
@@ -332,6 +330,7 @@
     long last;
     List *list;
     Msg *part, *temp;
+    Octstr *zerocost = NULL;
 
     hf_len = octstr_len(header) + octstr_len(footer);
     nlsuf_len = octstr_len(nonlast_suffix);
@@ -359,6 +358,7 @@
 
     temp = msg_duplicate(orig);
     msgno = 0;
+    zerocost = octstr_imm("00");
     list = list_create();
 
     do {
@@ -370,10 +370,16 @@
          * only ask DLR for the first one 
          */
         if ((msgno > 1) && DLR_IS_ENABLED(part->sms.dlr_mask)) {
+        /* if ((msgno > 1) && (part->sms.dlr_mask)) { */
             octstr_destroy(part->sms.dlr_url);
             part->sms.dlr_url = NULL;
             part->sms.dlr_mask = 0;
         }
+    	/* Fiks for NetCom. Only the first message shall have a tariff
+        if (msgno > 1) {
+            octstr_destroy(part->sms.sender);
+            part->sms.sender = octstr_duplicate(zerocost);
+        }
         octstr_destroy(part->sms.msgdata);
         if (sms_msgdata_len(temp) <= max_part_len || msgno == max_messages) {
             part->sms.msgdata = temp->sms.msgdata ?
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.