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 )
 
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%26dlr%3D%25d%26answer%3D%25A%26to%3D%25p%26from%3D%25P%26ts%3D%25T%26smsID%3D120343994592%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

  ----- Original Message ----- 
  From: Pavan Ramdhani 
  To: Tharanga 
  Sent: Friday, June 13, 2008 3:11 PM
  Subject: Re: Re[3]: smsc message ID


  Hi Tharanga,

  Please could u send your delivery report script!

  Thank you so much, Pavan.


  On Fri, Jun 13, 2008 at 11:37 AM, Tharanga <[EMAIL PROTECTED]> wrote:

    Hey guys,

    Finally  i have successfully completed the "mission" of dilervery report
    nottifications using the unique dlr-url for each sms. if any one need it i
    can send my script.

    special thank goes to the seik and the mailing list members . thanks guys

    --Tharanga-


    ----- Original Message -----
    From: "seik" <[EMAIL PROTECTED]>
    To: <[email protected]>
    Sent: Tuesday, June 10, 2008 2:33 PM
    Subject: Re[3]: smsc message ID


    > each request, either to the send-sms interface, either the sql injection
    in the sqlbox send_sms table
    > should be with its unique dlr-url value
    >
    > you may achieve that with adding some extra parameters in the dlr-url ..
    >
    > as i am repeating myself , read the post bellow...
    > / track the value of smsID, you will see its identical in all the dlr-url
    values .. /
    >
    >
    >
    > -----Original Message-----
    > From: [email protected] [EMAIL PROTECTED]
    > Sent: 10 Юни 2008 г.
    > To: seik
    > Subject:smsc message ID
    >
    > > M. Seik,
    > > How to set an unique drl-url per MT message ????
    >
    >
    >
    >
    > > De : [EMAIL PROTECTED]
    > > Date : 09/06/08 22:43:46
    > > A : [email protected]
    >
    > > Sujet : Re: smsc message ID
    > > you do not need the smsc id
    >
    > > all you need is to set YOUR unique dlr-url per MT message
    >
    > > to achieve that, add in the dlr-url something like
    >
    > > MysmsID=6be1268d3d7d99e6ec99e9138e77d6ea
    > > make sure the value of the MysmsID sould is unique
    > > and use it to trace the status of the MT message.
    >
    > > the db based dlr queue has nothing to do with the delivery reports per
    message ...
    > > it just saves the queue in a db, to avoid loss of data in case of OS
    crash ...
    >
    > > example of dlr-url:
    > >
    "http://localhost/dlr.pgsql.php?smscID=%i&dlr=%d&answer=%A&to=%p&from=%P&ts=
    %T&smsID=07fceb25372fcc4cb847c7099008500e&charset=%C&kannel_id=%I"
    >
    > > resulting dlr-url:
    >
    > > 127.0.0.1 - - [09/Jun/2008:22:45:37 +0300] "GET
    > >
    /dlr.pgsql.php?smscID=mtel&dlr=8&answer=ACK%2F&to=%2B359111111111&from=1916&
    ts=1213040737&smsID=nonfd9c1ff6b66bc510c785ffac6fb0b754&charset=ISO-8859-1&k
    annel_id=a890dfe9-72a9-48db-b98d-cd7c533c5958 HTTP/1.1" 200 1 "-"
    "Kannel/cvs-20070627"
    > > 127.0.0.1 - - [09/Jun/2008:22:45:45 +0300] "GET
    > >
    /dlr.pgsql.php?smscID=mtel&dlr=1&answer=id%3A0302419579+sub%3A001+dlvrd%3A00
    1+submit+date%3A0806092245+done+date%3A0806092245+stat%3ADELIVRD+err%3A000+t
    ext%3ABlagodarim+Vi+za+Vas&to=%2B359111111111&from=1916&ts=1213040745&smsID=
    nonfd9c1ff6b66bc510c785ffac6fb0b754&charset=ISO-8859-1&kannel_id=41e9cd46-90
    ad-4014-b08f-91d152fd0388 HTTP/1.1" 200 1 "-" "Kannel/cvs-20070627"
    >
    > > i think you will deal from here
    >
    >
    >
    >
    > > -----Original Message-----
    > > From: [email protected] [EMAIL PROTECTED]
    > > Sent: 09 ??? 2008 ?.
    > > To: seik
    > > Subject:smsc message ID
    >
    > >> Hello everybody,
    >
    >
    > >> I am currently working on getting delivery receipts on my dlr-url.
    >
    > >> When I query the sendsms cgi-bin interface :
    > >>
    http://localhost/cgi-bin/sendsms?user=username&pass=password&from=xxxxxxx&to
    =xxxxxxxxxxx&smsc=mysmsc&text=some+text&mclass=1&dlr-mask=31&dlr-url=http%3A
    %2F%2Flocalhost%2Fdlr.php%3Fid%3DArdn6lE4%26state%3D%25d%26smsid%3D%25I
    >
    > >> dlr-url looking like that:
    >
    > >> http://localhost/dlr.php?id=Ardn6l&state=%d&smsid=%I
    >
    > >> The %I only gives me the "internal" message ID kannel generated.
    >
    > >> I would like the actual (aggregator) smsc message ID
    >
    > >> On a side not, I am using a pgsql dlr queue, and I can see my message
    ID
    > >> being stored into the ts (timestamp) field.
    >
    > >> Thank you for your help,
    >
    > >> Eric
    >
    >
    >
    >
    >
    >
    >
    >
    > > My...o? ? You...quoi ? Face...qui ?... Vous ne savez plus comment ?tre
    vous-m?me ?
    > > Pour Cr?er, Partager et enfin Gagner ... D?couvrez iDOO en vid?o
    >
    >
    >
    >







  -- 
  Kind Regards,

  Pavan. 

Reply via email to