Route incoming calls to sip trunk


I would like to know if it’s possible to route incoming calls to trunk,
I had asterisk server running with 23 extension (100 TO 122) and tow trunks (TRUNK A and Trunk B)communication is ok between extension to trunks and from trunks to extension.

My need is to route incoming calls from Trunk A to Trunk B.

Any help and guidance is much appreciated


Yes it is very possible.

Since you did not tell us what version of FreePBX you are running I can’t be of any more help.

Sorry i forget, am running the latest version freepbx-2.9.0

With FreePBX 2.9 a trunk can be the destination of an inbound route. You have to do any digit modification in the trunk.

SkykingOH - can you expand on this a bit? I have 2 FreePBX 2.9.x systems setup.

I have setup an AIX2 connection ( there is too much NAT involved for SIP… I tried that and gave up… the AIX2 connection over a tunnel seems to work fine… )

I can call extension 600 from SystemA and have it route to SystemB over the AIX2 / tunnel. I setup an Inbound Route on SystemB for DID number _6XX and that calls my 600 ring group… that part seems to work fine.

SystemB has a TRUNK setup for my outgoing calls to real phones.
On SystemB, I can dial 1800-555-1212 and make a call. ( 18005551212 is just an example… I can do a real, working 1800 number )

I want to be able to call 1800-555-1212 from SystemA and have it
go to SystemB and go out my outbound trunk.

On my Outbound route from SystemA to SystemB I have 1800 and 600 and they go to my SystemB system over the AIX2 trunk. I can
see in the asterisk log that 18005551212 goes to SystemB.

The issue I have is I’m not sure what to setup on SystemB to
take the 18005551212 call and route it to you outgoing trunk.

I setup an Inbound Route on SystemB for no-did set and that doesn’t seem to take the 1800 number call. The log says:

– Executing [[email protected]:1] NoOp(“IAX2/HomeUser-164”, “Catch-All DID Match - Found 18885551212 - You probably want a DID for this.”) in new stack
I think that:
– Executing [[email protected]:2] Set(“IAX2/HomeUser-164”, “CALLED_BLACKLIST=1”) in new stack
is the message that triggers the ‘all circuits are busy’ message
that I get on my SystemA phone.

so… what do I need to setup on SystemB to have the calls from
SystemA get routed over my SystemB / Outgoing trunk?

Thanks - jack

The trunk on system B needs to be in the from-internal context to allow access to the internal dial plan (and outbound routes)

I set inbound route to trunk B, i can hear trunk B phone ring but no audio.

Trunk A receive sip calls from [email protected] nat=yes, communication from Trunk A and internal extension is ok.

Trunk B to Patton FXO Gateway did not use NAT and communication from internal extension to Trunk B is ok.

I think its NAT problem since Trunk A use nat and trunk B not.

Any idea where the problem is?

Yes it is a NAT problem. How is your NAT configured?

Don’t set anonymous, build a trunk on both sides.

no way to disable anonymous because communication server (Motorola) connected to Trunk A always send from anonymous.

sip_general_additional.conf show nat=yes externip=


is there any way to make it work even trunk A get anonymous ID.


Yes, you can disable anonymous. Setup a trunk that matches the IP of the sender, you don’t have to match on SIP username.

Have you looked at the Asterisk SIP peer documentation?

I’m trying to find my question’s answer about incoming calls, but I couldn’t as this page is related to it, I hope one of you guys can give me a help!
I have a DID numbers provider that they ask me for a SIP URI to map the number.
I just want to make sure if this scenario is correct? :
I’m going to create an extension and and forward it to IVR, then by enabling incoming SIP calls, receive the calls.
I don’t know if this is the right way or not. I’m confused in Trunks, If I underestand right, we need a Trunk to be able to receive incoming calls, but it’s a bit confusing, why we need to use a provider to receive our calls while we have our own pbx!!
My provider asks me to create a Voxalot account, then I create a trunk , they map my number to Voxalot, so I can receive calls!!
But shouldn’t be right way thing like this, I mean I want to know the best way to receive incoming calls directly without using other provider and subsequently preventing causing delay and other problems and limits.
I would really appreciate it if someone can answer me as this is the first step of using my pbx and I need to wait, as I cant reconfig everything again later.

Thanks a lot and sorry for long story