Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 2:02 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Comments CID Callback Test
PostPosted: Fri Mar 04, 2011 1:16 am 
Offline

Joined: Wed May 26, 2010 5:39 pm
Posts: 30
OK, I have set up a linksys for PSTN to VOIP gateway. When I call its PSTN number, call comes to FreePBX Inbound Route where DID=myCIDcallbacktriggerDIDnum, with any callerID.

From this inbound route, call is sent to custom destination "A2B - CID Callback", which in turn calls custom-a2billing-cid-callback in extensions_custom.conf, which is like:

[custom-a2billing-cid-callback]
exten => _X.,1,DeadAgi(a2billing.php|8|cid-callback|9)
exten => _X.,n,Hangup

Here I am using conf 8 for the cllback leg, and I am using country prefix 9, you will see soon why ...

NOW, I set up a user account in A2Billing and add my mobile number for CID (as 0533xxxxxxx because that's how it is seen from a fixed phone), and I test.

I call my Linksys, and from Putty, I see the call come to A2Billing. My mobile's CID is seen as 0533xxxxxxx, as it should be, which is authenticated because it exists just like that in my account). Rate is found in the rate table because I have that 9 for the country prefix in

exten => _X.,1,DeadAgi(a2billing.php|8|cid-callback|9)

Hence, it checks for 90533xxxxxxx in the rate table, finds the rate, and initiates the call to 0533xxxxxxx with Caller ID 0533xxxxxxx.

1) However, most carriers want to have caller ID in standard form, like 90533xxxxxxx. If not, they do further manipulation on the callerID (such as putting another - their own - country code to the beginning, etc). So, I'd rateher have the CID 90533xxxxxxx on the callback leg.

2) Furthermore, if you have in the callback group in A2Billing conf;

PD Caller ID callerid=902161111111 Set the callerID for the predictive dialer and call-back.

This works for the callback leg of WebCallbck, but not on CID Callback.

3) What if I were not calling from my mobile, but say, from another fixed phone, in the same area code, then the CID coming to A2Billing was going to be only 7 digits xxxxxxx. It was going to go be looked for as 9xxxxxxx in the rate table, and fail. So, there has to be a mechanism to sanitize the CallerID so that, if it comes as 0xxxxxxxxxx or just xxxxxxx, the number can be manipulated into a standard 90xxxxxxxxxx form, before checking the rate table, and then, preferably the sanitised number called back, so that you get a proper callerID on the A-Leg as well as B-Leg.

4) If set, why wouldn't CID Callback also use the callerid=902161111111 in the callback group in a2billing conf?

Especially (3) above seems to be a problem.

Please comment, anyone ....

Burak


Top
 Profile  
 
 Post subject: Re: Comments CID Callback Test
PostPosted: Fri Mar 04, 2011 10:37 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Using some asterisk dial plan, you could manipulate the caller ID before calling a2billing.php

Joe


Top
 Profile  
 
 Post subject: Re: Comments CID Callback Test
PostPosted: Sat Mar 05, 2011 1:50 pm 
Offline

Joined: Wed May 26, 2010 5:39 pm
Posts: 30
Thanks Joe, actually kinda thought about that.

After receiving the call from the gateway, in the inbound route, I should send it to a custom destination where I normalize all callerid's of the form

xxx xxxx
0 xxx xxxx

to

90 xxx xxx xxxx

and then call [custom-a2billing-cid-callback] (with a goto?)

n'est ce pas?

Can you point me to a such a dialplan example, that I can play around with to get the callerid manipulation done? I will check voip-info to see if I can find some examples.

:-)

Burak


Top
 Profile  
 
 Post subject: Re: Comments CID Callback Test
PostPosted: Sun Mar 20, 2011 2:33 pm 
Offline

Joined: Fri Dec 17, 2010 12:17 pm
Posts: 20
Here is a solution to modify the CID before you send it to a2billing:

Code:
; This one for example will remove the first 2 zeros in the case where we receive an international call  :
exten => 058xxx0001,n,Set(CALLERID(num)=${IF($[${CALLERID(num):0:2}=00]?${CALLERID(num):2}:${CALLERID(num)})})
; In case we receive a national call (starting with one zero), we add the country code "33" in this example :
exten => 058xxx0001,n,Set(CALLERID(num)=${IF($[${CALLERID(num):0:1}=0]?33${CALLERID(num):1}:${CALLERID(num)})})


In this case the cid is sent using country code+phone number (without international prefix)

Then in a2billing admin interface :
- in ratecards i use the international phone numbers format without any 00 just country code
- in trunks i add the international prefix (00 for my voip provider)

The client should add their CID without 00 or + or any other international prefix


Top
 Profile  
 
 Post subject: Re: Comments CID Callback Test
PostPosted: Sat Mar 26, 2011 12:38 pm 
Offline

Joined: Wed May 26, 2010 5:39 pm
Posts: 30
Thanks chab,

I have used your CID manipulation code and got everything nice and dandy. I appreciate it. For those who are interested, here is how it goes:

1) I am using coutry code + areacode in the rate table.
2) My outgoing calls satart with 0 for domestic and 00 for international calls
3) I have callerid's in A2Billing customers as country code + area code + phone number

I have studied the dialplan for callerd manipulation you have presented above (my asterisk dialplan capability is currently very limited, so after checking the if statement syntax, I was able to add one more line for what you suggested. My CID Callback context has become:

exten => _X.,1,Set(CALLERID(num)=${IF($[${CALLERID(num):0:2}=00]?${CALLERID(num):2}:${CALLERID(num)})})
exten => _X.,n,Set(CALLERID(num)=${IF($[${CALLERID(num):0:1}=0]?90${CALLERID(num):1}:${CALLERID(num)})})
exten => _X.,n,Set(CALLERID(num)=${IF($[${LEN(${CALLERIDNUM})}=7]?90216${CALLERID(num):1}:${CALLERID(num)})})
exten => _X.,n,DeadAgi(a2billing.php|8|cid-callback|) ;last parameter is the callback area code
exten => _X.,n,Hangup

Here,
if the callerid is of the form 00 + country code ... , 00 is stripped, CID number becomes country code + area code + number
if the callerid is of the form 0 + area code ... , 0 is stripped, 90 added (country code here), CID number becomes country code + area code + number
if the callerid is of the form xxx-xxxx (just the number, because the caller is in the same area, in this case 216, as the gateway), 90216 is added, CID number becomes country code + area code + number

So,
Any CID number is converted into standard form, befor passing to cid-callback.

Naturally, rate exists, and the caller is called back, beautifully, with a proper callerid, on the callback leg.

Thank you so much for your help.

Burak


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 
Voice Broadcast System


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