Dear developers 


We are working on implementing Kannel into Zimbra collaboration suite by adding 
a Zimlet allowing users to send sms' from their mail inbox. So far we have 
completed the entire send process of the project, the only thing remaining is 
setting up the DLR logging into a mySQL database. 


I have read through the user guide numerous times, and have read blog and 
forums to figure out how to do this. I have come to the following stepped 
conclusion. 




    1. Append the dlr-url and dlr-mask to your sendsms-url. This is the method 
we use, it gets the information from a .pl script and this calls the sendsms 
script. 






    • URL EXAMPLE: 
http://sms-gw/dlr.php?sender=$from&subject=$subject&time=$theTime 
    • This URL is however URL encoded. 



my $dlr-url = 
http%3A%2F%2Fsms-gw%2Fdlr.php%3Fsender%3D%24from%26subject%3D%24subject%26time%3D%24theTime
 


my $url = ' 
http://sms-gw:13013/cgi-bin/sendsms?username=tester&password=654321&to= ' . 
$numbz . '&text='. $text . ' &dlr-mask=31 ' . ' &dlr-url=$dlr-url '; 
$html = getprint ($url); # ok shoot to kannel to send sms. 


OR 


Append add a field to the sendsms-user group in your smskannel.conf file. (Note 
inserted but not used) 





group = sendsms-user 
username=XXX 
password=XXX 
concatenation=true 
name=XXX 
footer=" XXXX" 
header= 
faked-sender=XXX 
default-sender= 
default-smsc=smsc 
max-messages=10 
#dlr-url = 
"http%3A%2F%2Fsms-gw%2Fdlr.php%3Fsender%3D%24from%26subject%3D%24subject%26time%3D%24theTime"
 
#dlr-mask = 31 
#user-deny-ip = "" 
#user-allow-ip = "" 


2. Create a php script in localhost/ called dlr.php. I put the script into 
/var/WWW/ though, although I have no idea which directory localhost/script 
would call for scripts. Now the script does create logs if you would call it 
through your browser and pass it the parameters. But the sendsms url does not 
seem to call it. I have heard that DLR url uses mostly predefined parameters, 
what are these, and would this affect the data being passed in any way? 




dlr.php 



<?PHP 
$val=$_GET['sender']; 
$dst=$_GET['subject']; 
$mask = "31"; <--- Static. doesn't really matter tomuch at the moment, we just 
want to log all DLR's. 
$ts=$_GET['time']; 




mysql_connect("localhost", "XXX", "XXX") or die("Cannot connect"); 
mysql_select_db("mysql") or die("cannot connect to database"); 






$dt = date("Y-m-d"); 
$ti = date("H:i:s"); 
$timewsha1=$dt." ".$ti; 
#echo $val; 
#echo $ts; 
#echo $dst; 
$query = "insert into dlr 
values('$val' ,'$ts' ,'$dst','XXX', 'XXX','URL', '$mask','21','XXX','', 
'$timewshal')"; 


$result = mysql_query($query) or die("Queryfailed : " . mysql_error()); 


?> 




3. Create a MySQL database following this format in some manor. 



id=mydlr 
table=dlr 
field-smsc=smsc 
field-timestamp=ts 
field-destination=destination 
field-source=source 
field-service=service 
field-url=url 
field-mask=mask 
field-status=status 
field-boxc-id=boxc 










Problem: 


Now the table's in the MySQL database do get filled when the script is called, 
therefore I do not believe the real problem to be located there. 
The real problem it seems is that the script is never called, that I do not 
understand. 

    • Is there something important missing? 

    • Does using predefined variables in the DLR-URL affect anything? 
    • What are these? 
    • Do you require an unique ID for each DLR? 
    • Which method is recomended for adding the DLR-URL or DLR-mask to the 
sendsms url? 
    • Can there be something missing in the configuration that causes this? 


If you require the configuration file, please just ask. If there is anything 
missing. Please do tell. 


PS: Excuse my bad terminology, I have never done anything like this before. 


Best Regards 


Aubrey 







Reply via email to