Can't direct incoming calls to the right extension

will

Joined
Nov 6, 2010
Messages
1
Likes
0
Points
0
#1
Can anyone please give me some help. I'm trying to direct incoming calls from my sip trunk provider (Engin in Australia) to the correct corresponding extensions based on the number the external caller calls (as I have 100 in-dial numbers).

Eg if someone from outside calls our company on 0298765432, it should go to handset 1006.

I can receive all incoming calls to all 100 numbers altright. When I set up an Inbound Route with Any DID (Catch All), they all go to handset 1001 which is expected. But as soon as I change its DID to 0298765432, I get a service not available message.

The provider (Engin) gave me the below to extract the number that was called in the TO header

[custom-from-provider]
exten => s,1,NoOp(${SIP_HEADER(To)})
exten => s,n,Set(DID=${SIP_HEADER(To)})
exten => s,n,Set(DID=${CUT(DID,:,2)})
exten => s,n,Set(DID=${CUT(DID,@,1)})
exten => s,n,Goto(from-pstn,${DID},1)


The question is (1) is it the right way to do what I want to achieve and (2) if so, I don't know where to put this context and make it work.

In the debug, the incoming packet is:
Executing [0298765400@from-sip-external:1] NoOp("SIP/My_Trunk-00000000", "Received incoming SIP connection from unknown peer to 0298765400") in new stack.

Thanks guys.
*Phone numbers have been changed to protect privacy.
 

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#2
That makes me think taht you havent configured the context flag on your trunk settings for peer details, you will need to add:
context=from-pstn
Then create an ounbound route for DID 0298765400
If you have already donde that, and you still get the same error message, then you will need to paste the output of the CLI (asterisk -r) while you are receiving a call
 

astone

Joined
Dec 26, 2009
Messages
8
Likes
0
Points
0
#3
create new inbound route is ok,input correct called number which your ISP sent, and select the destination as your special extension;

please try it
 

astone

Joined
Dec 26, 2009
Messages
8
Likes
0
Points
0
#4
create new inbound route is ok,input correct called number which your ISP sent, and select the destination as your special extension;

please try it
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top