Outbound dialing via another asterisk box

Hello everyone!

I’m desperate in hoping someone can help me!

I’ve got 2 Asterisk servers:

Server 1 = VicidialNow
Server 2 = Trixbox (This has the SIP Trunk to my provider)

I’m trying to get server 1 to be able to dial out through server 2.

I’ve got it currently setup where I have a SIP extension 5000 setup on server 2. I have then setup server 1’s SIP trunk as the following:


This is my dial plan on Server 1:

exten => _9X,1,AGI(agi://
exten => _9X,2,Dial(${SIPtrunk}/${EXTEN:1},To)
exten => _9X,3,Hangup

Now this is the thing. I can dial extension on SERVER 2 from SERVER 1 by dialing and outside line 9 then the extension number 302 for example:


That connects fine to an extension on SERVER 2

When i try dialing an outside line though for example:


It comes up with “extension cannot be found” recording and the following log in my asterisk -r:

Connected to Asterisk 1.4.22-3 RPM by vc-r currently running on ibtpbx001 (pid = 2500)
Verbosity is at least 3
– Executing [01423564556@from-sip-external:1] NoOp(“SIP/”, “Received incoming SIP connection from unknown peer to 01423564556”) in new stack
– Executing [01423564556@from-sip-external:2] Set(“SIP/”, “DID=01423564556”) in new stack
– Executing [01423564556@from-sip-external:3] Goto(“SIP/”, “s|1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/”, “1?from-trunk|01423564556|1”) in new stack
– Goto (from-trunk,01423564556,1)
– Executing [01423564556@from-trunk:1] Set(“SIP/”, “__FROM_DID=01423564556”) in new stack
– Executing [01423564556@from-trunk:2] NoOp(“SIP/”, “Received an unknown call with DID set to 01423564556”) in new stack
– Executing [01423564556@from-trunk:3] Goto(“SIP/”, “s|a2”) in new stack
– Goto (from-trunk,s,2)
– Executing [s@from-trunk:2] Answer(“SIP/”, “”) in new stack
– Executing [s@from-trunk:3] Wait(“SIP/”, “2”) in new stack
– Executing [s@from-trunk:4] Playback(“SIP/”, “ss-noservice”) in new stack
– <SIP/> Playing ‘ss-noservice’ (language ‘en’)
== Spawn extension (from-trunk, s, 4) exited non-zero on ‘SIP/’
– Executing [h@from-trunk:1] Hangup(“SIP/”, “”) in new stack
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/’

Can anyone help? I’m willing to pay for support as I need this up and running by the weekend :frowning:

Kind regards


Trixbox is abandonware, but I think it used FreePBX, so you need to take this up with the FreePBX people, as you are quoting bits of their dialplan.

As general guidance though, a tie trunk should be done as type=peer with static hosts on both ends. (friend should rarely be used with any SIP configuration).

You are specifying insecure=port, and I can see no reason for that. In any case, static addresses, and no passwords, even insecure=invite can go.