Hello Nikos,

I am searching where in the script is added this 2nd HTTP /1.1 but I really
don't see anything...strange.
Below the script:

About the destination address I had not added the domain after "@" and it
seems to be mandatory, it caused an error:
*<address address-value="WAPPUSH=+*********/type=p...@xxxxxx"/>*

I have added bearer and network parameter and wapbox.log does not complain
about this any more.

---------- script: where is hidden this @!=$£*§/.; HTTP/1.1 ? ------------
- Masquer le texte des messages précédents -
<?
$country_code = '***';
$phone = '******';
$push_url = "http://***.***.***.***/test/ecosse.jpg";;
$text = 'Test Google URL';
$smsc_id  = 'sagem_my300X';

$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 = '8080';
        $url  =  "http://$host:$port";;
        $domain = "elodine.nc";

        //$ppg_user = '1defcom';
        //$ppg_pass = '1mocdef';

    $wap_push_before_ts = '2010-12-22T12:00:00Z';
    $wap_push_after_ts = "2008-12-22T00:00:00Z";


        $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".
                "deliver-before-timestamp=\"".$wap_push_before_ts."\"\r\n".
                "deliver-after-timestamp=\"".$wap_push_after_ts."\"\r\n".
                "progress-notes-requested=\"false\">\r\n\t".
                "<address
address-value=\"WAPPUSH=+".$country_code.$phone."/TYPE=PLMN@
".$domain."\"/>\r\n\t".
                "<quality-of-service priority=\"low\"
delivery-method=\"unconfirmed\" network-required=\"true\"\r\n".
                "network=\"GSM\" bearer-required=\"true\" 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".
                "\r\n".
        "--multipart-boundary--\r\n".
                "\r\n".
                "\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);
// print_r($post.$body);
 echo $post."<br />";
        return $reply;
}

function assign_rand_value($num)
{
...
}

?>

Regards,

Emmanuel

Reply via email to