李研, 2006-06-19
本WAP Push测试采用Kannel工具。
本测试采用Fedora Core。安装如下:
$ yum -y install kannel
Kannel的源码也要用到,下载源码并解压,执行:
$ ./configure && make
以下用$SRC表示源码所在目录。
使用配置文件wappushtest.conf。
将GSM Modem接到串口上。修改wappushtest.conf中的device语句,使用正确的串口文件名。
启动Kannel,以root身份在三个不同的shell中按顺序分别执行以下三条指令:
bearbox wappushtest.conf smsbox wappushtest.conf wapbox wappushtest.conf
使用HTTP请求发送短信,使用浏览器访问如下格式的超链接:
http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=PHONE_NO&text=test
其中PHONE_NO替换为收信人的手机号码。发送成功后进入下一步。
本段根据Kannel User's Guide中的Setting up a test environment for Push Proxy Gateway一节进行。下面记录我的测试过程。
测试WAP Push要用到test_ppg程序(在源码的test目录中,第一步中已编译)、push control document和content file。
编辑$SRC/test/smstestppg.txt,修改以下字段:
这是我用的smstestppg.txt。
这是我用的content file,其中indication的href属性是你希望用户访问的超链接,si-expires一定要写上未来的时间,否则手机收到此信息也不会有动作。indication元素的内容是对用户的提问(Want to test a fetch?)。
./test_ppg "http://localhost:8080/wappush" contentfile.txt smstestppg.txt测试完毕。