Setting Wap Push on Kannel
Transcription
Setting Wap Push on Kannel
Setting Wap Push on Kannel After building kannel based on the last documentation on how to configure Kannel on Ubuntu, we need to do following steps to let Wap Push work: 1. We need another configuration file to configure bearbox, smsbox and wapbox, and put this configuration file under /gw directory with the file name wappush.conf. # # # # # # # # # CONFIGURATION FOR WAP PUSH OVER SMS It is run like this: 1% gw/bearerbox gw/wappush.conf 2% gw/wapbox gw/wappush.conf # BEARERBOX SETUP, for Kannel core operations group = core admin-port = 13000 smsbox-port = 13001 wapbox-port = 13002 admin-password = bar #status-password = foo #admin-deny-ip = "" #admin-allow-ip = "" wdp-interface-name = "*" #log-file = "/tmp/bearerbox.log" #log-level = 0 box-deny-ip = "*.*.*.*" box-allow-ip = "127.0.0.1" #unified-prefix = "+358,00358,0;+,00" #access-log = "/tmp/access.log" #store-file = "/tmp/kannel.store" #ssl-server-cert-file = "cert.pem" #ssl-server-key-file = "key.pem" #ssl-certkey-file = "mycertandprivkeyfile.pem" # WAPBOX SETUP, for pushing and for pulling (fetching) the wap data group = wapbox bearerbox-host = 127.0.0.1 #log-file = "/tmp/wapbox.log" #log-level = 0 syslog-level = none # PPG CORE SETUP, for defining the push request interface group = ppg ppg-url = /cgi-bin/wap-push.cgi ppg-port = 8080 #ppg-ssl-port = 8081 concurrent-pushes = 100 trusted-pi = false users = 1024 #ppg-deny-ip = "*.*.*.*" ppg-allow-ip = "*.*.*.*" #ssl-server-cert-file = "cert.pem" #ssl-server-key-file = "key.pem" # PPG USER SETUP, for authorizing a specific push user group = wap-push-user wap-push-user = foo ppg-username = foo ppg-password = bar #country-prefix = +358 #allowed-prefix = "40;60;70" #denied-prefix = 50 #white-list = http://localhost:8082/whitelist #black-list = http://localhost:8082/blacklist #deny-ip = "*.*.*.*" #allow-ip = "127.0.0.1" # SMSC CONNECTIONS, for pushing SI, SL, MMS notifications or whatever over SMS group = smsc smsc = at modemtype = 0x2303 device = /dev/ttyUSB0 my-number = 97508682 #smsc-id = FAKE #port = 10000 connect-allow-ip = 127.0.0.1 log-level = 0 # SMSBOX SETUP (a kludge!) group = smsbox bearerbox-host = 127.0.0.1 sendsms-port = 13013 global-sender = 97508682 #sendsms-chars = "0123456789 +-" #log-file = "/tmp/smsbox.log" log-level = 0 #access-log = "/tmp/access.log" group = modems id = 0x2303 speed = 115200 need-sleep = false # SEND-SMS USERS group = sendsms-user username = tester password = foobar concatenation = true #user-deny-ip = "" #user-allow-ip = "" 2. Under /gw directory, execute the following commands in different shells: 1% bearerbox wappush.conf 2% wapbox wappush.conf 3. Put compiled file xml2wbxml into /gw directory 4. Creating push content and control document for testing Here is an example of a push control document (smscontrol.txt), which gives push gateway instructions how to do the pushing. <?xml version="1.0"?> <!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP//EN" "http://www.wapforum.org/DTD/pap_1.0.dtd"> <pap> <push-message push-id="[email protected]" deliver-after-timestamp="2008-03-25T06:45:00Z" progress-notes-requested="false"> <address address-value="WAPPUSH=+6591206853/[email protected]"> </address> <quality-of-service priority="low" delivery-method="unconfirmed" network-required="true" network="gsm" bearer-required="true" bearer="sms"> </quality-of-service> </push-message> </pap> Because the push content is send to the phone over SMS, right value for network-required and bearer-required is true, for network GSM and for bearer SMS. However, you can omit these values altogether, if you use a phone number as an address. Address value is international phone number and it must start with plus. It is used here as an unique identifier, SMSC, or sendsms script must transform it to an usable phone number. Here is an Service Indication, a type of push content. ( contentfile.txt ) Essentially, the phone displays, when it receives this SI, the text "New version of Mandiri Mobile Banking has been released!--Neil" and if the user wants, fetches the content located by URL http://www.gadogadomail.com. <?xml version="1.0"?> <!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN" "http://www.wapforum.org/DTD/si.dtd"> <si> <indication href="http://www.gadogadomail.com" si-id="[email protected]" action="signal-high" created="2008-03-26T00:07:15Z" si-expires="2008-03-29T00:00:00Z"> New version of Mandiri Mobile Banking has been released!--Neil </indication> </si> Put these two files into /gw directory too. 5. Under /gw directory, execute the following command, ./xml2wbxml "http://localhost:8080/cgi-bin/wap-push.cgi?username=foo&password=bar" contentfile.txt smscontrol.txt in the shell which runs bearerbox wappush.conf, you could see that the message has been pushed correctly.