Re: Patch: wap_push_ppg.c

"Nikos Balkanas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <000901ca6519$9c734bf0$02b2a8c0@tardis>
Hi,

My intention was just to align PPG with SMS push, which sets them independently. SMS push will attempt to get null URL and print an error about it, so I have fixed that, too. 

Furthermore, with this patch, if you are just logging dlrs & not using dlr_url for ppg, not only you don't need a web server, but also you don't need smsbox (assuming you use wapbox for ppg).

BR,
Nikos
  ----- Original Message ----- 
  From: Alexander Malysh 
  To: Nikos Balkanas 
  Cc: [email protected] 
  Sent: Wednesday, November 11, 2009 6:58 PM
  Subject: Re: Patch: wap_push_ppg.c


  Hi Nikos, 


  what will happen when DLR without dlr-url arrive in smsbox? can smsbox handle this?


  IMO it's good idea to allow DLRs without dlr-url but then make it consistent and change not only
  wap-push part but sms part as well...


  -1 for non consistent patch, ++1 for consistent.


  Thanks,
  Alexander Malysh


  Am 02.11.2009 um 16:21 schrieb Nikos Balkanas:


    Hi,

    Another trivial patch for wap. The code disables dlrs, if no dlr_url is specified, despite if dlr_mask is set. These are 2 different variables, and I don't see why they should be linked like that. I just want the DLR in my access logs, don't need the URL. I shouldn't have to setup a web server just to get the DLR from the SMSc.

    BR,
    Nikos
    <wap_push_ppg.diff>
kannel.diff (application/octet-stream, 1.3 KB)
Index: gw/wap_push_ppg.c
===================================================================
RCS file: /home/cvs/gateway/gw/wap_push_ppg.c,v
retrieving revision 1.76
diff -a -u -r1.76 wap_push_ppg.c
--- gw/wap_push_ppg.c	12 Jan 2009 16:46:56 -0000	1.76
+++ gw/wap_push_ppg.c	13 Nov 2009 05:41:55 -0000
@@ -3319,10 +3319,6 @@
     long dlr_mask;
     long masklen;    
 
-    if (dlr_url == NULL) {
-        return 0; 
-    }
-
     dlrmaskos = http_header_value(headers, octstr_imm("X-Kannel-DLR-Mask"));
     if (dlrmaskos == NULL) { 
         return 0;
Index: gw/bb_smscconn.c
===================================================================
RCS file: /home/cvs/gateway/gw/bb_smscconn.c,v
retrieving revision 1.105
diff -a -u -r1.105 bb_smscconn.c
--- gw/bb_smscconn.c	31 Aug 2009 10:54:07 -0000	1.105
+++ gw/bb_smscconn.c	13 Nov 2009 05:41:55 -0000
@@ -471,7 +471,12 @@
          * the registered receiver numbers for specific smsbox'es.
          * Scope: external routing (to smsbox connections)
          */
-        rc = route_incoming_to_boxc(copy);
+        if (sms->sms.sms_type != report_mo || sms->sms.dlr_url)
+            rc = route_incoming_to_boxc(copy);
+        else {
+            msg_destroy(copy);
+            rc = 1;
+        }
     }
     
     if (rc == -1 || (rc != SMSCCONN_SUCCESS && rc != SMSCCONN_QUEUED)) {
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.