Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Dec 12, 2018 4:13 pm
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: SMS callback - Integrating Kannel and a2billing
PostPosted: Sun Aug 05, 2007 1:51 pm 
Offline

Joined: Sun Aug 05, 2007 1:43 pm
Posts: 9
Hi,

I have a kannel configured on one box and A2billing configured on another box. I want to implement sms callbacks. What this means is that a customer is able to SMS a phone number to a number on which kannel is configured and the system will then connect the two parties via VoIP.

I want to know how can i integrate kannel to a2billing. What i want is that when kannel recieve any sms it should do the same stuff as i do by using web callback. I have web callbacks already configured.

Kindly help me.. and let me know how this can be done!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 3:32 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
What version you using? 1.3 or 1.2.3 ? Cause with the 1.3 - the callback works a little differently, and there's the database for setting the triggers it seems. If so, then you could just write the record to trigger the callback. I haven't tried it yet, but it seems like that.

Please post any updates you got, I think there are several people interested in doing SMS triggered callback.


Top
 Profile  
 
 Post subject: Re: CallBack
PostPosted: Sun Aug 05, 2007 5:16 pm 
Offline

Joined: Sun Aug 05, 2007 1:43 pm
Posts: 9
I am using 1.3. Can you kindly guide me how can i do it. If possible please explain and point out to some links or kindly post some sample script...

Also how i tell kannel to make a callback as soon as it recieves an sms.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 6:32 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
Sorry man, don't know kennal or anything, was just pointing you in a direction.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 4:05 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Hello preeteesh

You can do this via SOAP. If you have Kannel configured properly, you can setup an SMS service that will be triggered based on your conditions and that service will call the A2Billing Callback through SOAP (the feature is already available).

If you can help me configure Kannel properly, I will make it work for both of us. We have successfully setup and executed A2Billing Callback by using a Windows system running Activexpert's (http://www.activexperts.com/) ActiveXperts SMS Messaging Server.

It was for testing purpose only since we do not want to use any Microsoft products for our solutions. It worked like a charm but we are no longer using it.

I am confident that I we can easy replicate the same solution with Kannel but the darn thing is not working for me. I am doing something wrong with Kannel. I am sure of it. But I have no clue.


Top
 Profile  
 
 Post subject: CallBack!
PostPosted: Mon Aug 06, 2007 4:26 pm 
Offline

Joined: Sun Aug 05, 2007 1:43 pm
Posts: 9
Hey,

Can we have chat please, i am online on gtalk [email protected] or yahoo preeteesh_kakkar. Please add me and lets have chat!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 7:59 pm 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Hello All,

Did you guys had any success with Kannel? I am interested in doing Callback SMS.

Cheers,
Neel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 6:04 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Hi

BTW, thanks preeteesh for the lift with Kannel. It's working like a charm.

I just wanted to let you guys know that in order to get the SOAP interface to work in A2Billing, you have to install PEAR::SOAP. For the moment, a2billing is using PEAR::SOAP. So install it however you can (go-pear, your linux distros, ...) and give it a try.

In my case, on Gentoo Linux, I have done "emerge PEAR-SOAP" which installed the SOAP Package with all the dependencies. But even then, even the simplest SOAP Server Application was throwing tons of errors.

So I have decided to use the SOAP extension that come with my PHP5 (http://www.php.net/soap). And then I have slightly rewritten the SOAP server application for callback, and it seams to work just fine. And best of all, it does not rely directly on PEAR. It's just plain old PHP code.

I will post the code and the procedure as soon as I am done with the preliminary tests.

Regards


Top
 Profile  
 
 Post subject: Callback Kannel+A2billing
PostPosted: Mon Oct 15, 2007 10:59 pm 
Offline

Joined: Mon Oct 15, 2007 10:57 pm
Posts: 8
asiby wrote:
Hi

BTW, thanks preeteesh for the lift with Kannel. It's working like a charm.

I just wanted to let you guys know that in order to get the SOAP interface to work in A2Billing, you have to install PEAR::SOAP. For the moment, a2billing is using PEAR::SOAP. So install it however you can (go-pear, your linux distros, ...) and give it a try.

In my case, on Gentoo Linux, I have done "emerge PEAR-SOAP" which installed the SOAP Package with all the dependencies. But even then, even the simplest SOAP Server Application was throwing tons of errors.

So I have decided to use the SOAP extension that come with my PHP5 (http://www.php.net/soap). And then I have slightly rewritten the SOAP server application for callback, and it seams to work just fine. And best of all, it does not rely directly on PEAR. It's just plain old PHP code.

I will post the code and the procedure as soon as I am done with the preliminary tests.

Regards



Any progress on this? Really interested in trying this out


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 7:39 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
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) :D

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 :lol: . 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 8). 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 8).

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.


Attachments:
File comment: SMS Callback Soap Client Application.

Rename it to sms-callback.php

sms-callback.php.txt [3.33 KiB]
Downloaded 1256 times
File comment: SMS Callback Soap Server Application.

Rename it to callback-server.php

callback-server.php.txt [12.28 KiB]
Downloaded 1045 times


Last edited by asiby on Sun Jun 15, 2008 12:38 am, edited 2 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 8:27 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Excellent write-up there Asiby. You've done the community proud sharing your (and neel's?) work in developing this into a working solution.
You rock! :punk: :mrgreen2: :punk:

PS Gentoo gets my vote as distribution of choice too. There's a lot more to learn than with your average point&dribble distro, but the rewards are numerous. I doubt I'll ever use another distro again.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 8:47 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Thank you Stavros. Let's hope that people will start using it and giving feedback.

I forgot to mention security issues. If people know about your url for the SMS callback, they can simply fire it up in a web browser. Of course, they will not have access to your A2B in order to create a fraudulent account. But they can initial continuous irritating callback without the consent of the clients. Because of that, it's a save precaution to only allow access to the Soap Client and Server from the intended sources (local machine -> kannel, or some specific domains, ...)

or simply chmod 700 sms-callback.php

this way, owner has full access. Group and others has now access. And make sure that kannel is the owner of that sms-callback.php file. I haven't tried this. If you do, please let us know. May be chmod 770 wont be bad also.

Regards


Top
 Profile  
 
 Post subject: Fantasic Asiby
PostPosted: Fri Nov 09, 2007 10:01 pm 
Offline

Joined: Mon Oct 15, 2007 10:57 pm
Posts: 8
asiby wrote:
Thank you Stavros. Let's hope that people will start using it and giving feedback.

I forgot to mention security issues. If people know about your url for the SMS callback, they can simply fire it up in a web browser. Of course, they will not have access to your A2B in order to create a fraudulent account. But they can initial continuous irritating callback without the consent of the clients. Because of that, it's a save precaution to only allow access to the Soap Client and Server from the intended sources (local machine -> kannel, or some specific domains, ...)

or simply chmod 700 sms-callback.php

this way, owner has full access. Group and others has now access. And make sure that kannel is the owner of that sms-callback.php file. I haven't tried this. If you do, please let us know. May be chmod 770 wont be bad also.

Regards


time and time again, i have noticed that asiby makes such valid and intelligent (and thoroughly explained) contributions on this forum on nearly all aspects of a2billing and not to mention anything else related to solving problems. From a user perspective, asiby is a real gold mine of information and the most helpful and patient person i have seen on any forum. Well done.

I will certainly try out your instructions and post.

Regards :P


Top
 Profile  
 
 Post subject: log files?
PostPosted: Tue Apr 07, 2009 11:54 am 
Offline

Joined: Tue Apr 07, 2009 11:39 am
Posts: 1
I am sucesfully install kanell, work with phone, receive message, activate sms-callback.php file and after that kannel raport

bearerbox:
2009-04-07 13:47:15 [11974] [6] DEBUG: AT2[samsung]: <-- +CMT: ,31
2009-04-07 13:47:15 [11974] [6] DEBUG: AT2[samsung]: <-- 07918362080009F0240B918362384074F00000904070203091800D339CCC869BC566B35ACD3603
2009-04-07 13:47:15 [11974] [6] DEBUG: AT2[samsung]: received message from SMSC: +(**removed**)
2009-04-07 13:47:15 [11974] [6] DEBUG: AT2[samsung]: Numeric sender (international) <+(**removed**)>
2009-04-07 13:47:15 [11974] [6] DEBUG: AT2[samsung]: User data length read as (13)
2009-04-07 13:47:15 [11974] [6] DEBUG: AT2[samsung]: Udh decoding done len=13 udhi=0 udhlen=0 udh=''
2009-04-07 13:47:15 [11974] [9] DEBUG: send_msg: sending msg to box: <127.0.0.1>
2009-04-07 13:47:15 [11974] [9] DEBUG: boxc_sender: sent message to <127.0.0.1>
2009-04-07 13:47:15 [11974] [8] DEBUG: boxc_receiver: sms received
2009-04-07 13:47:15 [11974] [8] DEBUG: send_msg: sending msg to box: <127.0.0.1>
2009-04-07 13:47:15 [11974] [8] DEBUG: boxc_receiver: got ack
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: TP-Validity-Period: 63 weeks
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: --> AT+CMGS=27^M
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: <-- >
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: send command status: 1
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: --> 0011000B918362384074F000F1FF0ED272BC5E9ED341C6709A5D2603
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: --> ^Z
2009-04-07 13:47:16 [11974] [6] DEBUG: AT2[samsung]: <-- >
2009-04-07 13:47:17 [11974] [6] DEBUG: AT2[samsung]: <-- +CMGS: 86
2009-04-07 13:47:17 [11974] [6] DEBUG: AT2[samsung]: <-- OK
2009-04-07 13:47:17 [11974] [6] DEBUG: AT2[samsung]: send command status: 0
2009-04-07 13:47:20 [11974] [8] DEBUG: boxc_receiver: heartbeat with load value 0 received


smsbox:
2009-04-07 13:47:15 [12008] [4] DEBUG: no match found: ^[ ]*(callback)[ ]*
2009-04-07 13:47:15 [12008] [4] WARNING: No translation found for <(**removed**)> from <+(**removed**)> to <+(**removed**)>
2009-04-07 13:47:15 [12008] [4] ERROR: request failed
2009-04-07 13:47:15 [12008] [4] DEBUG: message length 14, sending 1 messages
2009-04-07 13:47:15 [12008] [0] DEBUG: Got ACK (0) of 69ec826f-c416-44cc-8add-b070f8130ca0
2009-04-07 13:47:15 [12008] [0] DEBUG: No client - multi-send or ACK to pull-reply

Sent sms message is: callback (**removed number**)

On my phone receive message request failed and nothin is hapened with a2billing call back (in log of asterisk and a2billing I can not find registered any request).
Have any log so I can crack problem why sms-callback not activate call back service before try to ask you?
A2billing callback daemon work fine and web call back work too without problem.


Top
 Profile  
 
 Post subject: Re: SMS callback - Integrating Kannel and a2billing
PostPosted: Wed May 20, 2009 9:49 am 
Offline

Joined: Thu Feb 12, 2009 9:08 am
Posts: 7
Thank you Asiby.
I did it with a2b && kannel && siemens tc35i modem.
SMS Callback work fine


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group