Hello,

i know that this is an issue have been discussed many times in the past and thats why before posting i did my homework (reading the user guide and searching the email list) but with no succsess and i am still confused and desprade to find a solution in my problem.

So my configuration is a linux box (Centos 4.3), Kannel 1.4.1 and a Wavecom M1306 GSM modem connected to the ttyS0.
The init string i use for the Wavecom (besides the default one) is AT+CNMI=2,0,0,1,0. So after i run the bearerbox and smsbox using the proper conf file, i am able through a http client to send SMS and everything file up to here.

Since i want to have a delivery report back (such as delivered to the phone, sent, failed etc) i setup a MySQL database and i set the dlr-storage = mysql, also whenever i send a SMS besides all the usual setting i request ...&dlr-mask=31&dlr-url= "" href="http://localhost/cgi/dlr.php?type=%25d." target="_blank" >http://localhost/cgi/dlr.php?type=%d... like it is mentioned in the user guide but it is not working i don't have any status back and at the mysql table i can see all the time that the status is 0.
I also tried to change the dlr-url to point to a php script (that i borrowed from playsms and modified to fit mysql tables and configuration). This script is at the /var/www/html dir so when i send an SMS i use ...&dlr-mask=31&dlr-url= "" href="http://localhost/dlr.php?type=%25d" target="_blank" >http://localhost/dlr.php?type=%d ... but again its not working...

At the bearerbox debug messages i can see that i get back a +CDS message with the appropriate PDU information but i cannot see the status somewhere...

Also kannel, after i sent one message crashes with a "system error 12" message.

Please find bellow the dlr.php script and advice please if something is wrong and the debug messages from kannel.
2006-10-25 17:44:52 [8530] [0] INFO: Kannel bearerbox II version 1.4.1 starting
2006-10-25 17:44:52 [8530] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) maps to pid 8530.
2006-10-25 17:44:52 [8530] [6] DEBUG: Thread 6 (gw/smsc/smsc_at.c:at2_device
_thread) maps to pid 8530.
2006-10-25 17:44:52 [8530] [6] INFO: AT2[1]: trying to use speed <9600> from modem definition
2006-10-25 17:44:52 [8530] [6] INFO: AT2[1]: opening device
2006-10-25 17:44:52 [8530] [6] DEBUG: AT2[1]: device opened
2006-10-25 17:44:52 [8530] [6] DEBUG: AT2[1]: device opened
2006-10-25 17:44:52 [8530] [6] INFO: AT2[1]: speed set to 9600
2006-10-25 17:44:52 [8530] [6] DEBUG: AT2[1]: --> ^M
2006-10-25 17:44:52 [8530] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) maps to pid 8530.
2006-10-25 17:44:52 [8530] [7] DEBUG: sms_router: time to sleep 30.00 secs.
2006-10-25 17:44:52 [8530] [0] INFO: Loading store file `/var/log/kannel/kannel.store'
2006-10-25 17:44:52 [8530] [0] INFO: Store-file size 0, starting to unpack
2006-10-25 17:44:52 [8530] [0] INFO: Retrieved 0 messages, non-acknowledged messages: 0
2006-10-25 17:44:52 [8530] [0] DEBUG: Started thread 8 (gw/bb_store.c:store_dumper)
2006-10-25 17:44:52 [8530] [0] INFO: MAIN: Start-up done, entering mainloop
2006-10-25 17:44:52 [8530] [0] DEBUG: AT2[1]: start called
2006-10-25 17:44:52 [8530] [7] DEBUG: sms_router: gwlist_len = 0
2006-10-25 17:44:52 [8530] [8] DEBUG: Thread 8 (gw/bb_store.c:store_dumper) maps to pid 8530.
2006-10-25 17:44:52 [8530] [8] DEBUG: Dumping 0 messages to store
2006-10-25 17:44:53 [8530] [5] INFO: Client connected from < 127.0.0.1>
2006-10-25 17:44:53 [8530] [5] DEBUG: Started thread 9 (gw/bb_boxc.c:function)
2006-10-25 17:44:53 [8530] [9] DEBUG: Thread 9 (gw/bb_boxc.c:function) maps to pid 8530.
2006-10-25 17:44:53 [8530] [9] DEBUG: Started thread 10 (gw/bb_boxc.c:boxc_sender)
2006-10-25 17:44:53 [8530] [10] DEBUG: Thread 10 (gw/bb_boxc.c:boxc_sender) maps to pid 8530.
2006-10-25 17:44:53 [8530] [9] DEBUG: boxc_receiver: got boxc_id <1> from <127.0.0.1>
2006-10-25 17:44:54 [8530] [6] DEBUG: AT2[1]: --> AT^M
2006-10-25 17:44:56 [8530] [9] DEBUG: boxc_receiver: sms received
2006-10-25 17:44:56 [8530] [9] DEBUG: send_msg: sending msg to boxc: <1>
2006-10-25 17:44:56 [8530] [7] DEBUG: sms_router: handling message (0x835bbb0 vs 0x835bbb0)
2006-10-25 17:44:56 [8530] [7] DEBUG: sms_router: handling message (0x835bbb0 vs 0x835bbb0)
2006-10-25 17:44:56 [8530] [7] DEBUG: sms_router: time to sleep 30.00 secs.
2006-10-25 17:44:58 [8530] [6] DEBUG: AT2[1]: --> AT^M
2006-10-25 17:45:02 [8530] [6] DEBUG: AT2[1]: --> AT^M
2006-10-25 17:45:06 [8530] [6] INFO: AT2[1]: closing device
2006-10-25 17:45:06 [8530] [6] INFO: AT2[1]: speed in modem definition don't work, will autodetect
2006-10-25 17:45:06 [8530] [6] DEBUG: AT2[1]: detecting modem speed.
2006-10-25 17:45:06 [8530] [6] INFO: AT2[1]: opening device
2006-10-25 17:45:06 [8530] [6] DEBUG: AT2[1]: device opened
2006-10-25 17:45:06 [8530] [6] DEBUG: AT2[1]: device opened
2006-10-25 17:45:06 [8530] [6] INFO: AT2[1]: speed set to 115200
2006-10-25 17:45:06 [8530] [6] DEBUG: AT2[1]: --> ^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> AT^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:08 [8530] [6] INFO: AT2[1]: closing device
2006-10-25 17:45:08 [8530] [6] INFO: AT2[1]: detect speed is 115200
2006-10-25 17:45:08 [8530] [6] INFO: AT2[1]: opening device
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: device opened
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: device opened
2006-10-25 17:45:08 [8530] [6] INFO: AT2[1]: init device
2006-10-25 17:45:08 [8530] [6] INFO: AT2[1]: speed set to 115200
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> ATZ^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> AT^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- AT
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> AT&F^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- AT&F
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> ATE0^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- ATE0
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> AT+IFC=2,2^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: --> AT+CPIN?^M
2006-10-25 17:45:08 [8530] [6] DEBUG: AT2[1]: <-- +CPIN: READY
2006-10-25 17:45:12 [8530] [8] DEBUG: Dumping 1 messages to store
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: --> AT+CMGF=0^M
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: --> AT+CSMS=?^M
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: <-- +CSMS: (0,1)
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:19 [8530] [6] INFO: AT2[1]: Phase 2+ is supported
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: --> AT+CSMS=1^M
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: <-- +CSMS: 1,1,1
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: --> AT+CMGF=0;+CNMI=2,0,0,1,0^M
2006-10-25 17:45:19 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:19 [8530] [6] INFO: AT2[1]: AT SMSC successfully opened.
2006-10-25 17:45:19 [8530] [7] DEBUG: sms_router: gwlist_len = 1
2006-10-25 17:45:19 [8530] [7] DEBUG: sms_router: handling message (0x835bbb0 vs 0x835bbb0)
2006-10-25 17:45:21 [8530] [6] DEBUG: AT2[1]: TP-Validity-Period: 24.0 hours
2006-10-25 17:45:21 [8530] [6] DEBUG: AT2[1]: --> AT+CMGS=25^M
2006-10-25 17:45:21 [8530] [6] DEBUG: AT2[1]: <-- >
2006-10-25 17:45:21 [8530] [6] DEBUG: AT2[1]: send command status: 1
2006-10-25 17:45:21 [8530] [6] DEBUG: AT2[1]: --> 0031000C810396236313360000A70C31994C1693C564B170380C
2006-10-25 17:45:21 [8530] [6] DEBUG: AT2[1]: --> ^Z
2006-10-25 17:45:23 [8530] [6] DEBUG: AT2[1]: <-- >
2006-10-25 17:45:23 [8530] [6] DEBUG: AT2[1]: <-- +CMGS: 155
2006-10-25 17:45:23 [8530] [6] DEBUG: AT2[1]: <-- OK
2006-10-25 17:45:23 [8530] [6] DEBUG: AT2[1]: send command status: 0
2006-10-25 17:45:23 [8530] [6] DEBUG: DLR[mysql]: Adding DLR smsc=1, ts=155, src="" dst=306932363163, mask=31, boxc=1
2006-10-25 17:45:23 [8530] [6] DEBUG: sql: INSERT INTO dlr (smsc, ts, source, destination, service, url, mask, boxc, status) VALUES ('1', '155', '302111111111', '306932363163', 'tp', ' http://localhost/~playsms/plugin/gateway/kannel/dlr.php?type=', '31', '1', '0');
2006-10-25 17:45:23 [8530] [6] DEBUG: SMSC[1]: creating DLR message
2006-10-25 17:45:23 [8530] [6] DEBUG: SMSC[1]: DLR = http://localhost/~playsms/plugin/gateway/kannel/dlr.php?type=
2006-10-25 17:45:23 [8530] [10] DEBUG: send_msg: sending msg to boxc: <1>
2006-10-25 17:45:23 [8530] [10] DEBUG: boxc_sender: sent message to < 127.0.0.1>
2006-10-25 17:45:23 [8530] [9] DEBUG: boxc_receiver: got ack
2006-10-25 17:45:33 [8530] [6] DEBUG: AT2[1]: <-- +CDS: 25
2006-10-25 17:45:33 [8530] [6] DEBUG: AT2[1]: <-- 00069B0C81039623631336600152712412216001527124122100
2006-10-25 17:45:42 [8530] [8] DEBUG: Dumping 0 messages to store
2006-10-25 17:49:01 [8530] [6] PANIC: gwlib/octstr.c:2453: seems_valid_real: Assertion `ostr->size >= 0' failed. (Called from gwlib/octstr.c:1395:octstr_insert_data.)
2006-10-25 17:49:02 [8530] [6] PANIC: bearerbox(gw_panic+0xa3) [0x80b51df]
2006-10-25 17:49:02 [8530] [6] PANIC: bearerbox [0x80b62b4]
2006-10-25 17:49:02 [8530] [6] PANIC: bearerbox(octstr_append_char+0x2c) [0x80b8eec]
2006-10-25 17:49:02 [8530] [6] PANIC: bearerbox [0x8063eb4]
2006-10-25 17:49:02 [8530] [6] PANIC: bearerbox [0x8066e38]
2006-10-25 17:49:02 [8530] [6] PANIC: bearerbox [0x80ace37]
2006-10-25 17:49:02 [8530] [6] PANIC: /lib/tls/libpthread.so.0 [0x8f4371]
2006-10-25 17:49:02 [8530] [6] PANIC: /lib/tls/libc.so.6(__clone+0x5e) [0x84d9be]



dlr.php

<?

$type = $_GET['type'];
$slid = $_GET['slid'];
$uid = $_GET['uid'];

if ($type && $slid && $uid)
{
    $stat = 0;
    switch ($type)
    {
    case 1: $stat = 6; break;    // delivered to phone
    case 2: $stat = 5; break;    // non delivered to phone
    case 4: $stat = 3; break;    // queued on SMSC
    case 8: $stat = 4; break;    // delivered to SMSC
    case 16: $stat = 5; break;    // non delivered to SMSC
    case 9: $stat = 4; break;
    case 12: $stat = 4; break;
    case 18: $stat = 5; break;
    }
    $p_status = $stat;
    if ($stat)
    {
    $p_status = $stat - 3;
    }
    setsmsdeliverystatus($slid,$uid,$p_status);
    // log dlr
    $db_query = "SELECT kannel_dlr_id FROM kannel_kannel_dlrphp WHERE smslog_id='$slid'";
    $db_result = dba_num_rows($db_query);
    if ($db_result > 0)
    {
    $db_query = "UPDATE kannel_kannel_dlrphp SET kannel_dlr_type='$type' WHERE smslog_id='$slid'";
    $db_result = dba_query($db_query);
    }
    else
    {
    $db_query = "INSERT INTO kannel_kannel_dlrphp (smslog_id,kannel_dlr_type) VALUES ('$slid','$type')";
    $db_result = dba_query($db_query);
    }
}

?>


Thanks

Reply via email to