Hello.
I have finally manage to save a few minutes to write this post about A2B, Kannel and SMS Callback. The equation is pretty simple.
A2Billing + Kannel + GSM + SIM CARD = SMS Callback
The main steps are:
1 - Install A2Billing (Dah)
2 - Install and configure Kannel with at least the Bearerbox and the SMSBox and make sure that they talk to each other. You can verify that with Kannel's Web based admin interface. Also make sure that Kannel recognize your GSM Mobile Device properly (more on that farther in this post). We have work successfully with a Sony Ericsson w810i. Of course, other phone will probably work. But just like in our case, if your phone is not in the default available settings, you will have to write your own AT commands to initialize the phone and enter the SMS mode properly. Good Luck
. For more help on Kannel or to get Kannel, please visit
http://www.kannel.org and lookup the AT Commands reference specific to your phone.
3 - Install php_soap. PEAR::SOAP sucks. It's slow and it didn't work for us out of the box. A Google search has made us quickly realize that we weren't alone. We are using PHP5 and it is shipped with a soap module that came in very handy after all. On Gentoo, we have simply recompiled our PHP5 with the soap extension. Believe me, you need this. Check your Linux document for the steps to follow in order to install php_soap. I am not sure if PHP4 has such extension. If you are using PHP 4, than upgrade.
4 - Download our Soap Server Application for Callback. It is attached to this post
. Wherever applicable and in the following steps, do not forget to substitute "your.server.here" with your own IP or domain name.
5 - Download our Soap Client Application for SMS Callback. It is also attached to this post
.
6 - Insert our SMS service example for using the Soap SMS Callback in /etc/kannel/kannel.conf. The suggested path (Bill/api/SOAP/sms-callback.php) may be changed, but for now, avoid any fancy stuff and just follow the instructions please.
Code:
# SMS SERVICE for CallBack
group = sms-service
keyword = callback
get-url = "http://your.server.here/Bill/api/SOAP/sms-callback.php?n=%q"
concatenation = true
7 - Setup an account in A2Billing and make sure that it works with cid-callback (Caller DI Callback)
8 - Plug your phone in your Linux box. Again, no fancy stuff. If you are planning on using a Bluetooth or an infrared interface between your phone and the Linux box, than you are on your own. The phones we have tried had USB cable and our Linux Kernel was already configured to dectect USB devices like USB modem, USB Memory Key, ... It is also possible to plug a GSM Mobile in a serial port if that's your only option. If you are using a USB pluggable GSM Device, then you can install the USB Utilities available for your Linux. On Gentoo, it's usbutils and the command is (do this only if you don't have the lsusb command) :
Code:
# emerge usbutils
After a successful install, you will have access to the lsusb command. It will show any recognized USB device that is attached to the server. An example of output for the Sony Ericsson w810i plugged in the USB port #5 is:
Code:
Bus 002 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000 Sony Ericsson Mobile Communications AB
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Please, make sure that you do not continue until your phone is detected by the server.
Also, please note that some USB cables will not actually let the computer see your GSM Device as a USB device. For example, the data cable that shipped with my Nokia 3220 was a USB cable with an embedded serial port. As a result, the Nokia 3220 will show up a serial modem instead of a USB modem. The only difference will be in the device name (/dev/someUSBModem or /dev/someSerialModem, /dev/ttyACM0, /dev/ttyACM1 ...)
9 - For the moment, your will have to start kannel in testing mode (not as a service). For that, open 2 different consoles and open the bearerbox in on of them and the smsbox in the other.
Starting the bearerbox:
Code:
# cd /etc/kannel
# bearerbox -v 1 kannel.conf
Starting the smsbox:
Code:
# cd /etc/kannel
# smsbox -v 1 kannel.conf
10 - Send a test SMS to the number that you have configured in your smsbox settings. The content of the sms message MUST be callback. That will match the service keywork in kannel's configuration. You can change that later. Pay a very good attention to the log files if you have set them up cause they are the only way that we can fix problems if something goes wrong. You can also configure the Kannel Admin Interface and play with it in your favorite Web browser.
11 - Now, install the service on your server. For Gentoo we have a service called kannel in the folder /etc/init.d/
The original file was not working at all. Get the one that is attached, backup the original and use ours.
You also need to edit the file /etc/conf.d/kannel and make it look like this:
Code:
START_SMSBOX=yes
START_WAPBOX=no
#See the documentation for setting proper options
#Note: verbosity codes are strange!
# Default is 0, which means 'debug'. 1 is 'info, 2 'warning', 3 'error' and 4 'panic'
BEARERBOX_OPTS="--verbosity 1 --logfile /var/log/kannel/bearerbox.log"
SMSBOX_OPTS="--verbosity 1 --logfile /var/log/kannel/smsbox.log"
WAPBOX_OPTS="--verbosity 1 --logfile /var/log/kannel/wapbox.log"
12 - Have fun
Special note:
I haven't had the time to search for the equivalent steps on other Linux Distros. But I trust that many will appreciate the post anyway and find a way to port thoses steps on Centos, Ubuntu, Red Hat or any flavor that they might be using.
You might be asking your self why I prefer Gentoo. Well check this out:
- Emerge is a fantastic tool
- We can even emerge a package call rpm on Gentoo. Yep, the same rpm (RedHat Package Manager) available on Red Hat Linux
- We can also emerge the yum package on Gentoo and use it just like on Centos Linux
That gives us a great advantage. We are even using the rpm package to install server drivers and applications specifically (for HP Proliant and Dell PowerEdge) only available Read Hat and Suse Linux, ...
Thanks for reading.