Can't dial out through trunk

I am having trouble with an IAX trunk I have set up between a new server(server a) I just built and and existing one (server b).

From what I can tell, everything is set up correctly so I’m probably overlooking something.

When trying to dial out from a phone connected to the new server I get this on the CLI for server a:

Executing [s@macro-dialout-trunk:17] Macro(“SIP/201-b7803308”, “dialout-trunk-predial-hook|”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/201-b7803308”, “0?bypass|1”) in new stack
– Executing [s@macro-dialout-trunk:19] GotoIf(“SIP/201-b7803308”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:20] Dial(“SIP/201-b7803308”, “IAX2/serverb/1112223333|300|T”) in new stack
– Called serverb/1112223333
– Hungup ‘IAX2/serverb-8’

On server b’s CLI when I try to dial i get this:

[Apr 14 08:18:17] NOTICE[3245]: chan_iax2.c:7344 socket_process: Rejected connect attempt from 192.168.10.127, who was trying to reach ‘1112223333@’

I see that “111222333@” is missing the context (it should be @internal) in which to dial out of but I am not sure where I need to enter that information. In the IAX.conf of both servers the context is set correctly in each registration. I just don’t see where it’s pulling the information and getting no context.

Any help would be greatly appreciated.

At the B end of the link, what context have you got the incoming call set to.

There are two main entry points:-

  1. from-trunk - in this case it will try and match with an entry in inbound routes

  2. from-internal - in this case, you should be able to dial any number in your dial plan - can be a bit insecure though, so be careful.

Joe

The context at the B end of the link is set for from-trunk. From what I can see it’s just not putting the context at the end of whatever number is dialed (ex: “111222333@” should be “111222333@internal”) I don’t see what else could be missing.

The answer is simple when you see it.

Add these lines to your IAX setup

context=from-internal
trunk=yes

thats the first thing i checked when I first started having this issue:

This is how the iax.conf on server B has been since install:

[servera]
type=friend
username=servera
secret=111111
host=dynamic
disallow=all
allow=ulaw
trunk=yes
context=from-internal

Making a new context specifically for outbound dialing through the trunk did not work either.

It should be noted that server B is straight asterisk, no FreePBX. Server A however does have FreePBX installed to the newest version.