5

I have an Asterisk open source phone system. My business will have many toll free 800 phone numbers, they all go to the phone system. When a client calls us, is it possible to know which 800 phone number they used? Maybe somewhere in the call logs? I already searched the call logs and I could not see this data.

Thank you

davidjhp
  • 700
  • 3
  • 7
  • 14

5 Answers5

1

On our system when we recieve a call I see

VERBOSE[21579] logger.c: -- Executing Set("IAX2/abcdef", "FROM_DID=1234567890") in new stack

in /var/log/asterisk/full, and possibly on the asterisk console too - I forget. Here abcdef is the name of the inbound route you've configured and FROM_DID is our line number. Even if you don't get the FROM_DID, are all you numbers set up for the same incoming IAX2 route - can you distinguish by route?

Rup
  • 255
  • 5
  • 15
0

It depends on how the lines are configured upstream.

If toll-free numbers are mapped to a single incoming number then you're going to have to rely on whether the provider passes the dialled number using CLID - not all of them do. You're paying them for the service - why not ask them?

symcbean
  • 21,009
  • 1
  • 31
  • 52
0
;Send calls from this DID to IVR 
exten => 18005555555,1,Answer 
exten => 18005555555,2,NoOp(Inbound Call on ${EXTEN} from ${CALLERID(num)}) 
exten => 18005555555,3,Goto(s,1)

I primarily use SIP no IAX. If you add this second line to your inbound dialplan you will be able to see what number it arrived on and where it orginated in the asterisk console.

If you want to log this information you may want to check out the log command rather than noop

http://www.voip-info.org/wiki/view/Asterisk+cmd+Log

If you want something custom you should read up on writing AGI. I've always written my AGI scripts using perl. Here is a link to the cpan module for Asterisk::AGI

I was going to link you to it but I don't have enough rep to post more than one link just google, "perl cpan asterisk agi"

Hope this helps

PCSJJ
  • 1
  • 1
0

Are you using FreePBX? Are the 800 numbers coming from SIP/IAX trunks, or are they dahdi? T1? Do you want to route calls based on the DID, or just get stats around what numbers are being dialed? (If you use FreePBX and want to be able to route calls, read on...)

For my setup using FreePBX, I have dahdi and SIP trunks. I used the "Zap Channel DIDs" section in FreePBX to associate each channel with it's DID. For my SIP trunks, my provider had an option I needed to enable called DNIS (Dialed Number Information Service). Without that option, I had no way of seeing what DID an incoming call was using. With my settings as described, I can use FreePBXs Inbound Routes section to route calls based on DID.

jcardinal
  • 85
  • 1
  • 7
0

The correct answer will depend on how your calls are delivered. You're looking for a service called DNIS or DNID in Asterisk. If your calls are coming in via SIP turn on SIP debug to see if it's getting set.

dkwiebe
  • 651
  • 3
  • 8