RE: PPG - CIMD2 - DLR

"Andrikopoulos Dimitrios" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Dear Stipe,

  Please find attached the "bearerbox.log" file containing two WAP Push messages, which I received
successfully on my handset.

  As you can notice from the log, after sending the 1st CIMD2 message of the 1st WAP Push message,
Kannel inserted a record in the database, used for storing DLRs. Soon after, it made the appropriate HTTP
request to the DLR-URL (status=8). Finally, the two final CIMD2 messages of the 1st WAP Push message
follow.

  Please note that the second WAP Push message starts from the line 87:

		2006-12-07 15:50:08 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox

  After my Push Initiator sent the 2nd WAP Push message, Kannel followed the very same procedure as
above (until line 108). At line 109 it seemed that SMS-C sent something (probably its DLR) to Kannel which
didn't before, and as result, Kannel queried the database for the newly inserted DLR record, made an HTTP
request to the DLR-URL (status=1) and finally removed the associated database entry.

  The above procedure is repeated for PAP-message by PAP-message! What I cannot understand, in the
first place, is:

	1. I've set the header X-Kannel-DLR-Mask=31, so the INSERT SQL statement set mask=31.
 	    However, the tag "056" in each 1st CIMD2 message is set to 14. Note that according to
	    the CIMD2 specification, the tag "056" means "Status report request".

	2. I expected to have everything about DLR directly stored in the database. However, it seemed
	    that I have to use the DLR-URL to update the database.

	3. Why did Kannel remove database entries, but for not successive WAP Push messages?

BR,
Dimitris



-----Original Message-----
From: Stipe Tolj [mailto:[email protected]] 
Sent: Wednesday, December 06, 2006 7:35 PM
To: Andrikopoulos Dimitrios
Subject: Re: PPG - CIMD2 - DLR


Andrikopoulos Dimitrios wrote:

> Hello Stipe,
>  
>   I eventually managed to configure Kannel as a Push Proxy Gateway 
> (PPG), interconnect it with a NOKIA SMS-C (which understands CIMD2), 
> and a MySQL database for storing the SMS
> level delivery reports (DLR). Please find   attached the configuration
> file and a PAP/HTTP request.
>  
>   Note that if you define the "default-dlr-url" attribute of the group 
> "ppg" in the Kannel's configuration file, there is no need to define 
> the "X-Kannel-DLR-Url" header in the PAP/HTTP
> request. However, if you neither define a "X-Kannel-DLR-Url" header, nor
> the "default-dlr-url"
> attribute, Kannel will not request a DLR from SMS-C. You should also
> note the value of the header
> "X-Kannel-DLR-Mask": I've only got DLR for specific values of that
> header. However, I didn't deal
> with what the reason was: either Kannel didn't request DLR, or the SMS-C
> didn't send DLR.

definetly a) Kannel didn't request DLR. Since Kannel will *ONLY* request DLR if 
both values dlr-url and dlr-mask are given. That has semantical reasons. A mask 
only would imply Kannel to receive the DLR, but there would be no "way" to pass 
that DLR information (since missing DLR-URL), so Kannel treats this condition 
like unwanted in other worst "without value" and therefore does not request DLR 
from SMSC.

>   Finally, I have two issues:
>  
>     1. I send Unicode messages, so Kannel sends 3 CIMD2 messages to 
> SMS-C for each PAP
>         message. When I send a PAP message to Kannel, Kannel inserts a 
> record in database,
>         as soon as it sends the first CIMD2 message. On the other 
> hand, I receive at the DLR-URL
>         (defined with either "X-Kannel-DLR-Url", or "default-dlr-url") 
> a HTTP request with
>         status=8.
>  
>         When I send another PAP message, Kannel does the same, but now 
> I receive an additional
>         HTTP request at the DLR-URL with status=1, and the 
> corresponding record in the database
>         is removed. This procedure is repeated for PAP message by PAP 
> message.

ok, the status 8 means semantically: SMSC accepted the message for processing. 
The status 1 is a final state meaning: termianted on target device.

But the issue here seems to be with the concatenation of the MT chunks and the 
DLR signaling, right?

Can you forward me a dump of bearerbox.log in debug log-level where I can trace 
that sending of MT chunks towards SMSC and the receive of the DLRs?!

I need to see that happening in the logs to see actually the logic taking place.

But(!) you need to take care that you make the DLR signaling to your application 
that receives the DLR-URL HTTP GET call is unique.

Aaaaaa, ok, I see. PPG does the chunk splitting, so you can unique the chunks on 
your own via putting some dedicated DLR-URL parameters inside.

Please forward the bearerbox.log. In addition it would be good if you file a bug 
report to http://bugs.kannel.org/ describing the issue as detailed as possible, 
so we keep track of the issue.

>     2. Does anyone know what is the maximum number of recipients that 
> Kannel supports in case
>         of a PAP message destined to multiple recipients?

good question. We'd need to clarify this from the code itself. Please post this 
question to the devel@ mailing list, so others can pick it up also.

Stipe

-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany

tolj.org system architecture      Kannel Software Foundation (KSF)
http://www.tolj.org/              http://www.kannel.org/

mailto:st_{at}_tolj.org           mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------
bearerbox.log (application/octet-stream, 12.6 KB)
2006-12-07 15:48:54 [4852] [0] INFO: Added logfile `/tmp/bearerbox.log' with level `0'.
2006-12-07 15:48:54 [4852] [0] INFO: HTTP: Opening server at port 13000.
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 3 (gw/bb_http.c:httpadmin_run)
2006-12-07 15:48:54 [4852] [0] DEBUG: starting smsbox connection module
2006-12-07 15:48:54 [4852] [0] INFO: BOXC: 'smsbox-max-pending' not set, using default (100).
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 4 (gw/bb_boxc.c:sms_to_smsboxes)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 5 (gw/bb_boxc.c:smsboxc_run)
2006-12-07 15:48:54 [4852] [0] INFO: Set SMS resend frequency to 60 seconds.
2006-12-07 15:48:54 [4852] [0] INFO: SMS resend retry set to unlimited.
2006-12-07 15:48:54 [4852] [0] INFO: Set throughput to 10.000 for smsc id <test>
2006-12-07 15:48:54 [4852] [0] INFO: DLR rerouting for smsc id <test> disabled.
2006-12-07 15:48:54 [4852] [0] DEBUG: CIMD2[test]: Keepalive set to 60 seconds
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 6 (gw/smsc/smsc_cimd2.c:io_thread)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 7 (gw/bb_smscconn.c:sms_router)
2006-12-07 15:48:54 [4852] [0] DEBUG: starting UDP sender/receiver module
2006-12-07 15:48:54 [4852] [0] INFO: Adding interface *
2006-12-07 15:48:54 [4852] [0] DEBUG: udpc_create: Bound to UDP <0.0.0.0:9200>
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 8 (gw/bb_udp.c:udp_receiver)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 9 (gw/bb_udp.c:udp_sender)
2006-12-07 15:48:54 [4852] [0] DEBUG: udpc_create: Bound to UDP <0.0.0.0:9201>
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 10 (gw/bb_udp.c:udp_receiver)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 11 (gw/bb_udp.c:udp_sender)
2006-12-07 15:48:54 [4852] [0] DEBUG: starting wapbox connection module
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 12 (gw/bb_boxc.c:wdp_to_wapboxes)
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 13 (gw/bb_boxc.c:wapboxc_run)
2006-12-07 15:48:54 [4852] [0] DEBUG: starting WDP router
2006-12-07 15:48:54 [4852] [0] DEBUG: Started thread 14 (gw/bearerbox.c:wdp_router)
2006-12-07 15:48:54 [4852] [0] INFO: ----------------------------------------
2006-12-07 15:48:54 [4852] [0] INFO: Kannel bearerbox II version 1.4.1 starting
2006-12-07 15:48:54 [4852] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 4852.
2006-12-07 15:48:54 [4852] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 4852.
2006-12-07 15:48:54 [4852] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) maps to pid 4852.
2006-12-07 15:48:54 [4852] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) maps to pid 4852.
2006-12-07 15:48:54 [4852] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) maps to pid 4852.
2006-12-07 15:48:54 [4852] [0] INFO: MAIN: Start-up done, entering mainloop
2006-12-07 15:48:54 [4852] [6] DEBUG: Thread 6 (gw/smsc/smsc_cimd2.c:io_thread) maps to pid 4852.
2006-12-07 15:48:54 [4852] [0] DEBUG: SMSCConn CIMD2 test, start called
2006-12-07 15:48:54 [4852] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) maps to pid 4852.
2006-12-07 15:48:54 [4852] [7] DEBUG: sms_router: time to sleep 30.00 secs.
2006-12-07 15:48:54 [4852] [7] DEBUG: sms_router: gwlist_len = 0
2006-12-07 15:48:54 [4852] [8] DEBUG: Thread 8 (gw/bb_udp.c:udp_receiver) maps to pid 4852.
2006-12-07 15:48:54 [4852] [9] DEBUG: Thread 9 (gw/bb_udp.c:udp_sender) maps to pid 4852.
2006-12-07 15:48:54 [4852] [10] DEBUG: Thread 10 (gw/bb_udp.c:udp_receiver) maps to pid 4852.
2006-12-07 15:48:54 [4852] [11] DEBUG: Thread 11 (gw/bb_udp.c:udp_sender) maps to pid 4852.
2006-12-07 15:48:54 [4852] [12] DEBUG: Thread 12 (gw/bb_boxc.c:wdp_to_wapboxes) maps to pid 4852.
2006-12-07 15:48:54 [4852] [13] DEBUG: Thread 13 (gw/bb_boxc.c:wapboxc_run) maps to pid 4852.
2006-12-07 15:48:54 [4852] [14] DEBUG: Thread 14 (gw/bearerbox.c:wdp_router) maps to pid 4852.
2006-12-07 15:48:54 [4852] [6] DEBUG: CIMD2[test]: sending <01:001	010:wap	011:wap1	A1>
2006-12-07 15:48:54 [4852] [6] DEBUG: CIMD2[test]: received: <51:001	3C>
2006-12-07 15:48:54 [4852] [6] INFO: CIMD2[test] logged in.
2006-12-07 15:49:30 [4852] [5] INFO: Client connected from <172.16.15.30> 
2006-12-07 15:49:30 [4852] [5] DEBUG: Started thread 15 (gw/bb_boxc.c:function)
2006-12-07 15:49:30 [4852] [15] DEBUG: Thread 15 (gw/bb_boxc.c:function) maps to pid 4852.
2006-12-07 15:49:30 [4852] [15] DEBUG: Started thread 16 (gw/bb_boxc.c:boxc_sender)
2006-12-07 15:49:30 [4852] [15] DEBUG: boxc_receiver: got boxc_id <dlrbox> from <172.16.15.30>
2006-12-07 15:49:30 [4852] [16] DEBUG: Thread 16 (gw/bb_boxc.c:boxc_sender) maps to pid 4852.
2006-12-07 15:49:36 [4852] [13] INFO: Client connected from <172.16.15.30> 
2006-12-07 15:49:36 [4852] [13] DEBUG: Started thread 17 (gw/bb_boxc.c:function)
2006-12-07 15:49:36 [4852] [17] DEBUG: Thread 17 (gw/bb_boxc.c:function) maps to pid 4852.
2006-12-07 15:49:36 [4852] [17] DEBUG: setting up systems for new wapbox
2006-12-07 15:49:36 [4852] [17] DEBUG: Started thread 18 (gw/bb_boxc.c:boxc_sender)
2006-12-07 15:49:36 [4852] [18] DEBUG: Thread 18 (gw/bb_boxc.c:boxc_sender) maps to pid 4852.
2006-12-07 15:49:39 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox
2006-12-07 15:49:39 [4852] [17] DEBUG: send_msg: sending msg to box: <172.16.15.30>
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: sending message
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: sending <03:003	021:+306973983868	023:1234	050:167	056:14	055:0	044:1	032:0B05040B8423F00003000301	034:000614AEA97761705F707573682F312E30008D01FDC39302056A0045C60C037761702E6D79636F736D6F732E67722F436173696E6F526F79616C652E6173700011035065726C5363726970745F53492F3836346665376461613039646364306230616566323431316363303336646137000AC3072006120715494410C3072006	030:4	A5>
2006-12-07 15:49:39 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox
2006-12-07 15:49:39 [4852] [17] DEBUG: send_msg: sending msg to box: <172.16.15.30>
2006-12-07 15:49:39 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox
2006-12-07 15:49:39 [4852] [17] DEBUG: send_msg: sending msg to box: <172.16.15.30>
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: received: <53:003	021:+306973983868	060:061207154944	0B>
2006-12-07 15:49:39 [4852] [6] DEBUG: DLR[mysql]: Adding DLR smsc=CIMD2:172.25.38.20:9971:wap, ts=061207154944, src=1234, dst=+306973983868, mask=31, boxc=dlrbox
2006-12-07 15:49:39 [4852] [6] DEBUG: sql: INSERT INTO dlr (smsc, ts, source, destination, service, url, mask, boxc, status) VALUES ('CIMD2:172.25.38.20:9971:wap', '061207154944', '1234', '+306973983868', 'ppg', 'http://172.16.15.30/dls_notifications/notify1.php?smsc-id=%i&status=%d&answer=%A&to=%P&from=%p&ts=%t', '31', 'dlrbox', '0');
2006-12-07 15:49:39 [4852] [6] DEBUG: SMSC[test]: creating DLR message
2006-12-07 15:49:39 [4852] [6] DEBUG: SMSC[test]: DLR = http://172.16.15.30/dls_notifications/notify1.php?smsc-id=%i&status=%d&answer=%A&to=%P&from=%p&ts=%t
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: sending message
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: sending <03:005	021:+306973983868	023:1234	050:167	056:0	055:0	044:1	032:0B05040B8423F00003000302	034:1210154944080103363A20CEA9504120CE934941204D4F59CEA3494B4821203135204E4541205245414C544F4E45532041CEA04F20544F204E454F20414C42554D205448CEA320CEA045CE934B59205A484E4120CEA34520CEA04550494D454E4F594E2041CEA04F4BCE9B4549CEA354494B4120CEA3544F204D55534943205A	030:4	16>
2006-12-07 15:49:39 [4852] [16] DEBUG: send_msg: sending msg to boxc: <dlrbox>
2006-12-07 15:49:39 [4852] [16] DEBUG: boxc_sender: sent message to <172.16.15.30>
2006-12-07 15:49:39 [4852] [15] DEBUG: boxc_receiver: got ack
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: received: <53:005	021:+306973983868	060:061207154945	0E>
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: sending message
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: sending <03:007	021:+306973983868	023:1234	050:167	056:0	055:0	044:0	032:0B05040B8423F00003000303	034:4F4E45205448CEA320434F534D4F544521000101	030:4	20>
2006-12-07 15:49:39 [4852] [6] DEBUG: CIMD2[test]: received: <53:007	021:+306973983868	060:061207154946	11>
2006-12-07 15:50:08 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox
2006-12-07 15:50:08 [4852] [17] DEBUG: send_msg: sending msg to box: <172.16.15.30>
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: sending message
2006-12-07 15:50:08 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: sending <03:009	021:+306973983868	023:1234	050:167	056:14	055:0	044:1	032:0B05040B8423F00003010301	034:010614AEA97761705F707573682F312E30008D01FDC39302056A0045C60C037761702E6D79636F736D6F732E67722F436173696E6F526F79616C652E6173700011035065726C5363726970745F53492F3236636332646636333738653364373161343538396639613330393336643064000AC3072006120715501310C3072006	030:4	B1>
2006-12-07 15:50:08 [4852] [17] DEBUG: send_msg: sending msg to box: <172.16.15.30>
2006-12-07 15:50:08 [4852] [17] DEBUG: boxc_receiver: got sms from wapbox
2006-12-07 15:50:08 [4852] [17] DEBUG: send_msg: sending msg to box: <172.16.15.30>
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: received: <53:009	021:+306973983868	060:061207155013	05>
2006-12-07 15:50:08 [4852] [6] DEBUG: DLR[mysql]: Adding DLR smsc=CIMD2:172.25.38.20:9971:wap, ts=061207155013, src=1234, dst=+306973983868, mask=31, boxc=dlrbox
2006-12-07 15:50:08 [4852] [6] DEBUG: sql: INSERT INTO dlr (smsc, ts, source, destination, service, url, mask, boxc, status) VALUES ('CIMD2:172.25.38.20:9971:wap', '061207155013', '1234', '+306973983868', 'ppg', 'http://172.16.15.30/dls_notifications/notify1.php?smsc-id=%i&status=%d&answer=%A&to=%P&from=%p&ts=%t', '31', 'dlrbox', '0');
2006-12-07 15:50:08 [4852] [6] DEBUG: SMSC[test]: creating DLR message
2006-12-07 15:50:08 [4852] [6] DEBUG: SMSC[test]: DLR = http://172.16.15.30/dls_notifications/notify1.php?smsc-id=%i&status=%d&answer=%A&to=%P&from=%p&ts=%t
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: sending message
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: sending <03:011	021:+306973983868	023:1234	050:167	056:0	055:0	044:1	032:0B05040B8423F00003010302	034:1210155013080103363A20CEA9504120CE934941204D4F59CEA3494B4821203135204E4541205245414C544F4E45532041CEA04F20544F204E454F20414C42554D205448CEA320CEA045CE934B59205A484E4120CEA34520CEA04550494D454E4F594E2041CEA04F4BCE9B4549CEA354494B4120CEA3544F204D55534943205A	030:4	08>
2006-12-07 15:50:08 [4852] [16] DEBUG: send_msg: sending msg to boxc: <dlrbox>
2006-12-07 15:50:08 [4852] [16] DEBUG: boxc_sender: sent message to <172.16.15.30>
2006-12-07 15:50:08 [4852] [15] DEBUG: boxc_receiver: got ack
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: received: <53:011	021:+306973983868	060:061207155014	FF>
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: sending message
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: sending <03:013	021:+306973983868	023:1234	050:167	056:0	055:0	044:0	032:0B05040B8423F00003010303	034:4F4E45205448CEA320434F534D4F544521000101	030:4	1E>
2006-12-07 15:50:08 [4852] [6] DEBUG: CIMD2[test]: received: <53:013	021:+306973983868	060:061207155015	02>
2006-12-07 15:50:13 [4852] [6] DEBUG: CIMD2[test]: received: <23:000	021:306973983868	060:061207155013	061:4	063:061207155017	062:0	26>
2006-12-07 15:50:13 [4852] [6] DEBUG: DLR[mysql]: Looking for DLR smsc=CIMD2:172.25.38.20:9971:wap, ts=061207155013, dst=306973983868, type=1
2006-12-07 15:50:13 [4852] [6] DEBUG: sql: SELECT mask, service, url, source, destination, boxc FROM dlr WHERE smsc='CIMD2:172.25.38.20:9971:wap' AND ts='061207155013';
2006-12-07 15:50:13 [4852] [6] DEBUG: Found entry, row[0]=31, row[1]=ppg, row[2]=http://172.16.15.30/dls_notifications/notify1.php?smsc-id=%i&status=%d&answer=%A&to=%P&from=%p&ts=%t, row[3]=1234, row[4]=+306973983868 row[5]=dlrbox
2006-12-07 15:50:13 [4852] [6] DEBUG: DLR[mysql]: created DLR message for URL <http://172.16.15.30/dls_notifications/notify1.php?smsc-id=%i&status=%d&answer=%A&to=%P&from=%p&ts=%t>
2006-12-07 15:50:13 [4852] [6] DEBUG: removing DLR from database
2006-12-07 15:50:13 [4852] [6] DEBUG: sql: DELETE FROM dlr WHERE smsc='CIMD2:172.25.38.20:9971:wap' AND ts='061207155013' LIMIT 1;
2006-12-07 15:50:13 [4852] [6] DEBUG: CIMD2[test]: sending <73:000	3F>
2006-12-07 15:50:13 [4852] [6] DEBUG: CIMD2[test]: new message received
2006-12-07 15:50:13 [4852] [16] DEBUG: send_msg: sending msg to boxc: <dlrbox>
2006-12-07 15:50:13 [4852] [16] DEBUG: boxc_sender: sent message to <172.16.15.30>
2006-12-07 15:50:13 [4852] [15] DEBUG: boxc_receiver: got ack
2006-12-07 15:51:09 [4852] [6] DEBUG: CIMD2[test]: sending <40:015	3F>
2006-12-07 15:51:09 [4852] [6] DEBUG: CIMD2[test]: received: <90:015	44>
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.