You were right both... I have modified the dlr variable to reach the dlr script in localhost and now the status is updated correctly !!! All seems to work now in this release 0.9.4....
until next issue.. Many thanks for those who help me on this as this issue was link mostly to PlaySMS and not Kannel. But PlaySMS seems died although it seems to be a great portal. Regards, Emmanuel 2009/10/22 Emmanuel CHANSON <[email protected]> > I succeed to progress in this issue: > > First I cancel to use file_get_contains) function and I try to use > fsockopen instead, unfortunately that lead to 404 error, unknonw request, so > I compare several things between the basic sendsms.php script and PlaySMS > one and I found out that my $URL variable was incorrect: > > *$URL = "http://localhost:13013/var/www/kannel/sendsms?username= > ".urlencode($kannel_param['username'])."&password=".urlencode($kannel_param['password']); > > instead of: > > **$URL = > "/var/www/kannel/sendsms?username=<http://localhost:13013/var/www/kannel/sendsms?username=> > ".urlencode($kannel_param['username'])."&password=".urlencode($kannel_param['password']); > * > > Because the host and port are already defined here in fsockopen before > using fputs($URL). > > Then I was able to see this after a test: > Your SMS for `+687783548` has been delivered to queue > > And the status in Outgoing message is "Pending" but stay in this status and > this is here that DLR option must play their role.. > > So to resume I have made the following changes on PlaySMS v0.9.4 to > integrate with Kannel: > - comment the line *$dlr_url = str_replace('//', '/', $dlr_url); > *- comment the file_get_contains() part and uncomment the fsockopen() part > in: ~/playsms/plugin/gateway/kannel/fn.php > > Now I have to focus to update the DLR status... > I tried to access it but nothing returned: what should I expect ? > > *[r...@elodine playsms]# lynx -dump " > http://localhost/playsms/plugin/gateway/kannel/dlr.php?type=8&slid=126&uid=1&mclass=1 > " > > > [r...@elodine playsms]#* > * > *Emmanuel > > 2009/10/22 Engel L <[email protected]> > > Hi Emmanuel, >> I am not sure what PlaySMS version you are using but I played with it a >> while back (I think mine is/was 0.9.3) and I still have the code lying >> around somewhere. >> >> The code snippet you quoted is different from mine in a number of ways. >> >> $URL = >> "/cgi-bin/sendsms?username=".urlencode($kannel_param['username'])."&password=".urlencode($kannel_param['password']); >> >> $URL .= >> "&from=".urlencode($sms_from)."&to=".urlencode($sms_to)."&text=".urlencode($sms_msg); >> >> $URL .= >> "&dlr-mask=31&dlr-url=".urlencode($kannel_param['playsms_web']."/plugin/gateway/kannel/dlr.php?type=%d&slid=$smslog_id&uid=$uid"); >> >> $URL .= "&mclass=".$msg_type; >> >> $connection = >> fsockopen($kannel_param['bearerbox_host'],$kannel_param['sendsms_port'],&$error_number,&$error_description,60); >> >> Note that mine uses fsockopen instead of file_get_contents. But I do not >> think this is the problem. My bet is that your dlr_url is incorrect ( >> dlr-url=".urlencode($dlr_url)). Where do you set your $dlr_url variable? >> From your logs it appears to be http://65.5.221.52/playsms/......... >> >> It appears strange to me that you are making sendsms requests on localhost >> and are accepting dlr data on another host. Try and access this url via a >> browser, and see if its accessible. >> >> Hope that helps >> >> On Wed, Oct 21, 2009 at 3:49 AM, Emmanuel CHANSON < >> [email protected]> wrote: >> >>> Hello again (still bugs with PlaySMS and Kannel) >>> >>> In PlaySMS version 0.9.4 when I try to send a SMS using "Send text SMS" I >>> am getting this error displayed in red on the php page: >>> >>> Failed to send SMS to `+XXXXXXX` >>> >>> But the SMS is successfully sent to Kannel and fakesmsc receive it: >>> *2009-10-21 11:29:19 [9778] [0] DEBUG: Got message 7: <+XXXXXX +XXXXXX >>> text test - playSMS>* >>> >>> So after checking the code of PlaySMS in fn.php around line 30 below the >>> code that should process the return status of the delivery: >>> >>> * $URL = "http://localhost:13013/var/www/kannel/sendsms?username= >>> ".urlencode($kannel_param['username'])."&password=".urlencode($kannel_param['password']); >>> $URL .= >>> "&from=".urlencode($sms_from)."&to=".urlencode($sms_to)."&text=".urlencode($sms_msg); >>> $URL .= "&dlr-mask=31&dlr-url=".urlencode($dlr_url); >>> $URL .= "&mclass=".$msg_type; >>> >>> if ($rv = **trim(file_get_contents("$URL"))**) { >>> // old kannel responsed with Sent. >>> // new kannel with the other 2 >>> if (($rv == "Sent.") || ($rv == "0: Accepted for delivery") || >>> ($rv == "3: Queued for later delivery")) { >>> $ok = true; >>> // set pending >>> $p_status = 0; >>> setsmsdeliverystatus($smslog_id, $uid, $p_status); >>> } >>> }* >>> >>> >>> I find that it is this function that is nok: >>> $rv = trim(file_get_contents("$URL")); >>> $rv does not contain anything >>> but the file_get_contents is executed since the SMS is sent >>> $URL I catched contains: >>> >>> >>> http://localhost:13013/var/www/kannel/sendsms?username=playsms&password=playsms&from=%2B687850850&to=%2B687783548&text=smstest+-+playSMS&dlr-mask=31&dlr-url=http%3A%2F%2F61.5.221.52%2Fplaysms%2Fplugin%2Fgateway%2Fkannel%2Fdlr.php%3Ftype%3D%25d%26slid%3D126%26uid%3D1&mclass=1 >>> >>> but the return value of file_get_contains is 0 equal to false right? >>> >>> I have also errors in apache: >>> >>> [Wed Oct 21 10:11:03 2009] [error] [client 114.69.193.66] PHP Warning: >>> file_get_contents( >>> http://localhost:13013/var/www/kannel/sendsms?username=playsms&password=playsms&from=%2B687850850&to=%2B687783548&text=smstest+-+playSMS&dlr-mask=31&dlr-url=http%3A%2F%2F61.5.221.52%2Fplaysms%2Fplugin%2Fgateway%2Fkannel%2Fdlr.php%3Ftype%3D%25d%26slid%3D132%26uid%3D1&mclass=1<http://localhost:13013/var/www/kannel/sendsms?username=playsms&password=playsms&from=%2B687850850&to=%2B687783548&text=smstest+-+playSMS&dlr-mask=31&dlr-url=http%3A%2F%2F61.5.221.52%2Fplaysms%2Fplugin%2Fgateway%2Fkannel%2Fdlr.php%3Ftype%3D%25d%26slid%3D132%26uid%3D1&mclass=1>) >>> [<a href='function.file-get-contents'>function.file-get-contents</a>]: >>> failed to open stream: HTTP request failed! HTTP/1.0 202 Accepted\r\n in >>> /var/www/playsms/plugin/gateway/kannel/fn.php on line 45, referer: >>> http://61.5.221.52/playsms/menu.php?inc=send_sms&op=sendsmstopv&message=smstest&err=Failed+to+send+SMS+to+%60%2B687783548%60%3Cbr%3E >>> >>> Something is wrong with file_get_contains... >>> >>> Although this work using the same URL: >>> # lynx -dump " >>> http://localhost:13013/var/www/kannel/sendsms?username=playsms&password=playsms&from=%2B687850850&to=%2B687783548&text=smstest+-+playSMS&dlr-mask=31&dlr-url=http%3A%2F%2F61.5.221.52%2Fplaysms%2Fplugin%2Fgateway%2Fkannel%2Fdlr.php%3Ftype%3D%25d%26slid%3D141%26uid%3D1&mclass=1 >>> " >>> 0: Accepted for delivery >>> >>> Also what do you think of this in the error log? >>> failed to open stream: *HTTP request failed*! *HTTP/1.0 202 Accepte*d\r\n >>> i >>> >>> Strange ? >>> >>> If this is solved then PlaySMS version 0.9.4 will allow to display the >>> right status of the SMS delivered or queued or not... >>> >>> Regards, >>> >>> -- >>> Emmanuel >>> >>> CHANSON Emmanuel >>> Mobile Nouvelle-Calédonie: +687 850.850 >>> Mobile France: +33 (0) 6.68.03.89.56 >>> @email : [email protected] >>> >> >> > > > -- > Emmanuel > > CHANSON Emmanuel > Mobile Nouvelle-Calédonie: +687 850.850 > Mobile France: +33 (0) 6.68.03.89.56 > @email : [email protected] > -- Emmanuel CHANSON Emmanuel Mobile Nouvelle-Calédonie: +687 850.850 Mobile France: +33 (0) 6.68.03.89.56 @email : [email protected]
