[asterisk-users] billing based on local access number

C. Chad Wallace cwallace at lodgingcompany.com
Wed Feb 10 13:44:15 CST 2010


At 4:02 AM on 10 Feb 2010, umesh maharjan wrote:

> 
> Hi all,
> 
> I am configuring asterisk as a prepaid calling card. I am getting
> different local rate from my ISDN provider e.g  0.002 for landline
> and 0.13 for mobile etc. In this case I thing I have to say my
> asterisk/a2billing to bill based on local access number. so How can I
> retrieve  called number (eg. 03-6832-1040 and 0120-272-060 is our
> ISDN PRI access number) to my asterisk server so i can trigger
> different rates. 

The number the caller called to get to you should be passed to Asterisk
as the inbound extension.  So, in your incoming context, you can
provide different extensions for the different incoming numbers.  Or
you can catch everything with the "_X." pattern and use the ${EXTEN}
variable to check the number in your dialplan.

One thing to note is that it doesn't always pass the whole number.  I
have two PRIs from different providers; one of them passes all 10
digits, but the other one only passes the last 4, and for some reason
with one of our numbers that ends in "9977" the PRI passes "2977".  You
can either ask your provider what they pass, or you can just make test
calls and log the value of the ${EXTEN} variable with Verbose() calls,
something like this:

[incoming]
exten => _X.,1,Verbose(Incoming call to ${EXTEN});
exten => _X.,n,Playback(welcome);



-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20100210/3e0997e5/attachment.pgp 


More information about the asterisk-users mailing list