Well, as I promised here's an ultra mini PPG Howto :P
Actually the Kannel's doc is not that bad as I thought. What should be
maybe explained a bit more is the part of posting the data to the PPG
The configuration was done following tha Kannel's doc.
Having a running kannel box with smsbox, sms-services, etc, these are
the steps I followed:
First I added to my existing kannel.conf under core gorup:
wapbox-port = xxxx
where xxxx is the port obviously :)
Then I added wapbox group which I din't use:
group = wapbox
bearerbox-host = localhost
log-file = "/var/log/kannel/wapbox.log"
log-level = 1
syslog-level = none
After that I added ppg group:
group = ppg
ppg-url = /wappush
ppg-port = 8080
concurrent-pushes = 100
users = 1024
ppg-allow-ip = "xxx.xxx.xxx.xxx"
trusted-pi = true
service-name = ppg1
group = wap-push-user
wap-push-user = wappush
ppg-username = foo
ppg-password = bar
allow-ip = "xxx.xxx.xxx.xxx"
Restart kannel, and that's it :)
Actually as I put "trusted-pi = true" the PPG server won't check for the
username and password from wap-push-user group
It's maybe better first doing it this way, and if it works fine, then go
and use the user and password
For sending the Wap Push itself here I post some PHP code. It's just a
simple function for you to see how to send it,
as proof of concept, and you may adapt it to your needs, including the
XML's parameters used.
Since I'm not using right now the authentication part (trusted-pi =
true), I left the authentication part on
the code commented. I haven't tested it with wap-push-user yet, but
uncommenting the $ppg_user and $ppg_pass variables
plus uncommenting the "Authorization: Basic" line I guess it should work
fine, if you use "trusted-pi = false" plus wap-push-user
I'm making use of CURL for posting to the PPG server.
The only thing is that I'm succesfully sending Wap Push via PPG now, and
the phones receive them fine, but on the
wapbox logs I find this warning:
WARNING: Received other message than wdp/admin, ignoring!
I've seen a couple of mails on the list asking about this, but now
answer about it... and no idea of what it is about..
Anyone knows what's this warning about???
So here's the code!
$country_code = '12';
$phone = '1234567890';
$push_url = 'http://wap.google.com';
$text = 'This is a test';
$smsc_id = 'mySMSCid';
send_wap_push($smsc_id, $country_code, $phone, $url, $text);
function send_wap_push($smsc_id, $country_code, $phone, $push_url, $text)
$host = 'xxx.xxx.xxx.xxx';
$port = '8080';
$url = "<a href="http://$host:$port">http://$host:$port";
//$ppg_user = 'foo';
//$ppg_pass = 'bar';
$wap_push_id = function_that_generates_a_unique_id();
$body = "--multipart-boundary\r\n".
'<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN"'."\r\n".
'<quality-of-service delivery-method="unconfirmed" network="GSM"
'<!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN"'."\r\n".
'<indication action="signal-high" si-id="'.$wap_push_id.'"
$post = "POST /wappush HTTP/1.1\r\n".
//"Authorization: Basic ".base64_encode("$ppg_user:$ppg_pass")."\r\n";
'Content-Type: multipart/related; boundary=multipart-boundary;
$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);
if anyone finds something wrong on what I'm doing for PPG,
or wants to contribute on anything, feel free to post about it ;)
Great ! can I add it tp userguide ? People seems have similar
On 21 Jan 2006, at 00:20, Juan Nin wrote:
> if anyone finds something wrong on what I'm doing for PPG,
> or wants to contribute on anything, feel free to post about it ;)
Aarno Syvänen wrote:
> Great ! can I add it tp userguide ? People seems have similar problems ...
> On 21 Jan 2006, at 00:20, Juan Nin wrote:
>> if anyone finds something wrong on what I'm doing for PPG,
>> or wants to contribute on anything, feel free to post about it ;)
|Free forum by Nabble||Edit this page|