Asterisk Getting called DID

Hello Everyone,

I’m new to this forum and also to asterisk. I’m trying to create a project in which two or more DID numbers will be used to receive calls. Each number is used for different users.

Is it possible to find from which number Asterisk is getting that call?

Eg:

xxx-xxx-xxx7
xxx-xxx-xxx8
xxx-xxx-xxx9 all these numbers route to user 1000

Is it possible for the user 1000 to see through which number he is getting the call?

I’m sorry if I posted this in the wrong section or my question is stupid.

Please respond

If you have a valid DID configuration, ${EXTEN} will contain the information.

Note that DID is often misused as a marketing term for situations where only the ITSP has this information.

better check with log file

You haven’t explained the scenario enough to know. So here are several ways to handle this…

  1. Hijack Caller ID - most IP phones have a LCD display on them. If you don’t mind losing the name of the original caller set the caller id to the number dialed. In this example the operator will not be able to see the original name of who is calling but will know what line the call came in on with the original caller number. In other words you are changing “John Doe <2813925678>” in to “SALES <2813925678>”

[extension]
exten => 3036740007,1,Set(CALLERID(name)=“SALES”)
exten => 3036740007,n,Answer()
exten => 3036740007,n,Dial(SIP/1000)

exten => 3036740008,1,Set(CALLERID(name)=“SUPPORT”)
exten => 3036740008,n,Answer()
exten => 3036740008,n,Dial(SIP/1000)

exten => 3036740009,1,Set(CALLERID(name)=“INVESTORS”)
exten => 3036740009,n,Answer()
exten => 3036740009,n,Dial(SIP/1000)

  1. Multiple Lines - most IP phones have multiple line appearence, up to 4 or 6 is typical even on a low end model. As long as the count of DID numbers does not exceed the number of lines allowed on the phone use that. You can even set a different ring tone for each line so the operator can hear the difference as to what line it is coming in on.

; line 1 on the ops phone
exten => 3036740007,1,Answer()
exten => 3036740007,n,Dial(SIP/1000)

; line 2 on the ops phone
exten => 3036740008,1,Answer()
exten => 3036740008,n,Dial(SIP/1001)

; line 3 on the ops phone
exten => 3036740009,1,Answer()
exten => 3036740009,n,Dial(SIP/1002)

  1. Queues - you can setup queues and use the announce feature which will announce what line it is to the agent before the caller is connected. Put user 1000 in the queues as a permanent member and just forget they are using queues. Ring… Ring… Ring… picks up hears “SUPPORT” then can answer “Hello, you have reach Acme Support how can I help?”

; make three short recordings
say-sales.wav
say-support.wav
say-investors.wav

; create three queues with a permanent member in queues.conf
[sales]
announce=say-sales
member => SIP/1000

[support]
announce=say-support
member => SIP/1000

[investors]
announce=say-investors
member => SIP/1000

; route the calls in to queue instead of direct to user SIP/1000 in extension.conf
[default]
exten => 3036740007,1,Answer()
exten => 3036740007,n,Queue(sales)

exten => 3036740008,1,Answer()
exten => 3036740008,n,Queue(support)

exten => 3036740009,1,Answer()
exten => 3036740009,n,Queue(investors)