Hi, First I like to thank all Active subscribers, for their great support and knowledge sharing
first u need to create a unique smsID for the message. this is a sample URL (u need to generate this URL, i have used Java ) dlr-url=http://localhost/dlr.php?smscID=%i&dlr=%d&answer=%A&to=%p&from=%P&ts =%T&smsID=07fceb25372fcc4cb847c7099008500e&charset=%C&kannel_id=%I (above url after the = should be encoded) resulting URL is as follows. http://147.120.203.99:17018/cgi-bin/sendsms?username=tester&password=tha&to= 94xxxxxx&from=44xxxxx&text=test msg&dlr-mask=31&dlr-url=http%3A%2F%2Flocalhost%2Fdlr.php%3FsmscID%3D%25i%26d lr%3D%25d%26answer%3D%25A%26to%3D%25p%26from%3D%25P%26ts%3D%25T%26smsID%3D12 0343994592%26charset%3D%25C%26kannel_id%3D%25I (some parameters are not needed. above is my parameter list.) u need to encode (this is a must ) the url after the dlr-url= parameter. ( u can use php urlencode function or java urlencode method for that). for the smsID i have used a timestamp. (unique one) kannel.conf looks like this (otherpart of the kannel config is ignored) # SEND-SMS USERS dlr-url = "http://147.120.203.99/sms/dlr.php?dlr=%d&dest=%p&report=%A" group = sendsms-user username = xxxxx password = yyyyyy this script will update my database. (Mysql database) database fields (db name sms) destination varchar(40) status int(10) status2 varchar(400) server_date varchar(20) delilver_date varchar(20) sms_id varchar(200) db.inc contains the logic to connect to mysql database. dlr.php script include('db.inc'); $val=$_GET['dlr']; $dst=$_GET['to']; echo $sms_id=$_GET['smsID']; //$ts=$_GET['ts']; //$report=$_GET['report']; //$regex= preg_match("/\stat%3ADELIVRD\b/i",$report); if($val==8) { $report='Pending'; $dt = date("Y-m-d"); $ti = date("H:i:s"); $timewsha1=$dt." ".$ti; $query = "insert into sms values('$dst','$val','$report','$timewsha1','Pending','$smsID')"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); } if ($val==1) { $dt = date("Y-m-d"); $ti = date("H:i:s"); $timewsha1=$dt." ".$ti; $query_update="update sms set status=$val , status2='Delivered' , delilver_date='$timewsha1' where sms_id=$sms_id and destination=$dst"; $result_update = mysql_query($query_update) or die("Query failed : " . mysql_error()); } Regards, Tharanga Abeyseela
