Hi, Sorry, I don't have the time to debug php scripts. Can you please post a tcpdump of the xml POST request you are sending to wapbox?
BR, Nikos ----- Original Message ----- From: Emmanuel CHANSON To: users Sent: Friday, December 18, 2009 1:05 PM Subject: Re: HTTP connection URL through Binary SMS or PPG ? I have used the following PHP script provided by someone in an old post. file attached ------------------------------------- $country_code = '234'; $phone = '8023256437'; $push_url = "http://wap.google.com"; $text = 'Test Google url'; $smsc_id = 'sms_4'; $out = send_wap_push($smsc_id, $country_code, $phone, $push_url, $text); echo $out; function send_wap_push($smsc_id, $country_code, $phone, $push_url, $text) {        $host = 'localhost';        $port = '8082';        $url = "http://$host:$port";              $ppg_user = '1defcom';        $ppg_pass = '1mocdef';              $wap_push_id = get_rand_numbers(5);        $body = "--multipart-boundary\r\n".                        "Content-type: application/xml\r\n\r\n".                        '<?xml version="1.0"?>'."\r\n".                        '<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN"'."\r\n".                        '"http://www.wapforum.org/DTD/pap_1.0.dtd" >'."\r\n".                        '<pap>'."\r\n".                        '<push-message push-id="'.$wap_push_id.'">'."\r\n\t".                        '<address address-value="WAPPUSH=+'.$country_code.$phone.'/type=p...@..."/>'."\r\n\t".                        '<quality-of-service delivery-method="unconfirmed" network="GSM" bearer="SMS"/>'.                        "\r\n</push-message>\r\n".                        "</pap>\r\n\r\n".                        "--multipart-boundary\r\n".                        "Content-type: text/vnd.wap.si\r\n\r\n".                        '<?xml version="1.0"?>'."\r\n".                        '<!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN"'."\r\n".                        '"http://www.wapforum.org/DTD/si.dtd">'."\r\n".                        "<si>\r\n".                        '<indication action="signal-high" si-id="'.$wap_push_id.'" href="'. $push_url .'">'.$text.'</indication>'."\r\n".                        "</si>\r\n"."--multipart-boundary--\r\n";        $post = "POST /wappush HTTP/1.1\r\n"."Host: $host:$port\r\n".                "Authorization: Basic ".base64_encode("$ppg_user:$ppg_pass")."\r\n".                "X-Kannel-SMSC: $smsc_id\r\n".'Content-Type: multipart/related; boundary=multipart-boundary; type="application/xml"'."\r\n".                "Content-Length: ".strlen($body)."\r\n"."\r\n".$body;        $ch = curl_init();        curl_setopt ($ch, CURLOPT_URL, $url);        curl_setopt($ch, CURLOPT_HEADER, 1);        curl_setopt($ch, CURLOPT_TIMEOUT, 15);        curl_setopt ($ch,CURLOPT_CUSTOMREQUEST , $post);        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);        $reply = curl_exec($ch);        curl_close ($ch);        return $reply; // print_r($post.$body); } BR, ManuC 2009/12/18 Nikos Balkanas <[email protected]> Hi,  You need to make sure that your mobile is configured to accept pushes. By default, some do not. You seem to have a problem in your pap.xml. Please post along with your si.xml.  BR, Nikos ----- Original Message ----- From: Emmanuel CHANSON To: users Sent: Friday, December 18, 2009 5:56 AM Subject: Re: HTTP connection URL through Binary SMS or PPG ? Thanks for trying to help me... but no need to fight xD I tried first to send a SMS with UDH and on my mobile I get a SMS with an URL inside but no automatic launch of my web browser. Is it normal ? I tried then to setup PPG on Kannel (wapbox & ppg config seems Ok, wapbox start) I send my document to HTTP interface of PPG port 8080 using a Β¨PHP script I found on inet. I am getting the following errors: # lynx -dump "http://localhost/test/sms-wap-push-2.php" Β Β HTTP/1.1 202 Accepted Server: Kannel/cvs-20091124 Date: Fri, 18 Dec Β Β 2009 03:26:50 GMT Content-Length: 705 Content-Type: application/xml ==> /var/log/kannel/wapbox.log <== 2009-12-18 14:26:50 [20985] [11] DEBUG: HTTP: Creating HTTPClient for `127.0.0.1'. 2009-12-18 14:26:50 [20985] [11] DEBUG: HTTP: Created HTTPClient area 0x954abf0. 2009-12-18 14:26:50 [20985] [14] INFO: PPG: Accept request </wappush> from <127.0.0.1> 2009-12-18 14:26:50 [20985] [14] DEBUG: PPG: http_read_thread: pap multipart accepted 2009-12-18 14:26:50 [20985] [14] DEBUG: PPG: send_bad_message_response: telling pi 2009-12-18 14:26:50 [20985] [14] DEBUG: HTTP: Resetting HTTPClient for `127.0.0.1'. 2009-12-18 14:26:50 [20985] [14] WARNING: PPG: pap control entity erroneous, the request unacceptable 2009-12-18 14:26:50 [20985] [10] DEBUG: HTTP: Destroying HTTPClient area 0x954abf0. 2009-12-18 14:26:50 [20985] [10] DEBUG: HTTP: Destroying HTTPClient for `127.0.0.1'. 2009/12/17 Nikos Balkanas <[email protected]> Actually, HenriΒ was just teaching meΒ how to program. He has already a php solution in place, I suspect yours. Poor Emmanuel was looking for a solution, and I hope he found what he was looking for, amidst all the flame :-) Β BR, Nikos ----- Original Message ----- From: Alejandro Guerrieri To: Nikos Balkanas Cc: Henri Hovi ; users Sent: Thursday, December 17, 2009 2:33 PM Subject: Re: HTTP connection URL through Binary SMS or PPG ? Did I get it all wrong, or Henri's only trying to send a WAP push to a phone? If that's the case, I've made time ago a simple php function you could use: http://www.blogalex.com/archives/12 There's no need to implement the whole protocol just to send a simple URL. However if you need more flexibility you'll probably need to use the PPG instead. Regards, Alex 2009/12/17 Nikos Balkanas <[email protected]> It's OK,Β don't tell me. IΒ have been usingΒ KISS probably before you were born. If you want to do a proper job, you have to implement the whole spec. In other words it seems you can send only *certain* GET URLs to mobiles. Can you handle POST requests & variables?Β It soundsΒ you don't use any stringtables or wap compression. How many SMS parts are you generating for a single push? PAP & SI variables determine delivery network, priority, validity period, etc.Β and it seems to me you are out of spec and abusing mobile phones (some of them may not even display it!). Β That's fine if it works for you. Just make sure you mention all your constraints before suggesting the same approach to others. Β Nikos ----- Original Message ----- From: Henri Hovi To: Nikos Balkanas Cc: Emmanuel CHANSON ; users Sent: Thursday, December 17, 2009 11:49 AM Subject: Re: HTTP connection URL through Binary SMS or PPG ? Target is to get phone opening a connection web-server to download something, You can use any compliers to compile the message or just simply construct the message by Yourself. With any link You like. I guarantee that just putting those couple of lines to Your code to build the message manually is more efficient than push XML to parser, compile it to WBXML and send it to the device. But of course, my script doesn't parse PAP messages, no need since why would I care about it since my aim is just to get the link to the device... Ever heard about term KISS ;) -- H 2009/12/17 Nikos Balkanas <[email protected]> My God! Why did all these stupid kannel developers wrote 1000's of lines for a descent wbxml compiler? Tokens alone from the spec are ~200, patterns > 500Β and many rules to consider. I have rewrittenΒ kannel's wbxmlΒ compiler in flex and yacc for efficiency and you preach me about efficiency? Β I was not aware of any php wbxml library, but unless you just encode the same message over and over or use a library, there is no other way for you to do it. Good for you, bad for efficiency. Β BR, Nikos ----- Original Message ----- From: Henri Hovi To: Nikos Balkanas Cc: Emmanuel CHANSON ; users Sent: Thursday, December 17, 2009 11:00 AM Subject: Re: HTTP connection URL through Binary SMS or PPG ? Well, I have aprx. ten lines and it works just fine ;) But for sure, sky is the limit in coding, so if I like, I think I can use several thousands lines as well to do the same, I just don't know if it's efficient or not ;) -- Henri 2009/12/17 Nikos Balkanas <[email protected]> Just to clarify. There are php examples to do your own wbxml encoding through the sendsms interface, but the encoding is several hundred lines of code, not 10! �’Β BR, Nikos ----- Original Message ----- From: Henri Hovi To: Emmanuel CHANSON Cc: users Sent: Thursday, December 17, 2009 9:26 AM Subject: Re: HTTP connection URL through Binary SMS or PPG ? The flow You explain is correct, but after You have sent it to PPG, it will take care of sending the SMS.. . So You just push the PAP message to the PPG url configured to Kannel. if You use PHP, You can use cUrl to do the communication between Your application and Kannel. Alternative solution is to build the message in Your application, it takes aprx. 10 lines of PHP code and then use the sendsms interface directly. Anyhow, I use the Kannel PPG. -- Henri On Wed, Dec 16, 2009 at 11:08 PM, Emmanuel CHANSON <[email protected]> wrote: Thanks Henri, So if I understand well Wapbox is mandatory in this situation. At least to compile the PAP xml ? then send a SMS ? PPG can not be used alone for this task? I mean what are the necessary steps to perform: HTTP Interface ? -> PPG -> Wapbox -> SMS -> Mobile Station I have to check how to use PPG for this purpose. I will check the Kannel User Guide for this but basically: Is it possible through a PHP script (or whatever) to call an HTTP interface in order to make the PPG do this job? Regards, Emmanuel 2009/12/16 Henri Hovi <[email protected]> You need to use PPG. The wapbox is just used to compile the PAP XML to "correct format", it's then forwarded as SMS to the device. When the phone retrieves the URL, it does it based on it's own configuration, so it can use HTTP directly or WAP Gateway as proxy. In later case the wapbox can be used, but requires that the user has the Kannel configured as proxy. But normally operators has those already configured, so You don't need to worry about them. -- Henri On Wed, Dec 16, 2009 at 6:59 AM, Emmanuel CHANSON <[email protected]> wrote: Hello guys, I'm wondering how can I make a mobile openning an HTTP URL ? - by sending a SMS push with UDH parameter through sendsms interface ? which value to add in this case? - by using PPG from kannel ? which config in this case for PPG group? - others solution ? I saw many times WAP PUSH tutorials that show how to send a WAP PUSH SMS using PPG but do I have to do the same if I want to make a mobile openning an HTTP URL ? Whatever its properties because some mobile (old one) have to use WAP and wapbox, the recent ones use HTTP and doesn't need wapbox in this case. -- Emmanuel CHANSON Emmanuel Mobile Nouvelle-Cal� �‰donie: +687.77.35.02 Mobile France: +33 (0) 6.68.03.89.56 @email : [email protected] -- Henri Hovi http://www.patidure.com http://patidure.blogspot.com -- Emmanuel CHANSON Emmanuel Mobile Nouvelle-Cal� �‰donie: +687.77.35.02 Mobile France: +33 (0) 6.68.03.89.56 @email : [email protected] -- Henri Hovi http://www.patidure.com http://patidure.blogspot.com -- Henri Hovi http://www.patidure.com http://patidure.blogspot.com -- Henri Hovi http://www.patidure.com http://patidure.blogspot.com -- Emmanuel CHANSON Emmanuel Mobile Nouvelle-CalΓ©donie: +687.77.35.02 Mobile France: +33 (0) 6.68.03.89.56 @email : [email protected] -- Emmanuel CHANSON Emmanuel Mobile Nouvelle-Calédonie: +687.77.35.02 Mobile France: +33 (0) 6.68.03.89.56 @email : [email protected]
