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 192.168.16.151
Server 2 = Trixbox 192.168.16.150 (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:

[SIP01]
disallow=all
allow=gsm
allow=ulaw
type=friend
username=5000
secret=5000
dtmfmode=rfc2833
context=trunkinbound
qualify=yes
insecure=very
nat=no
host=192.168.16.150
context=from-trunk

This is my dial plan on Server 1:

exten => _9X,1,AGI(agi://127.0.0.1:4577/call_log)
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:

9302

That connects fine to an extension on SERVER 2

When i try dialing an outside line though for example:

901423545342

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)
pms@voipconsulting.nl
Verbosity is at least 3
– Executing [01423564556@from-sip-external:1] NoOp(“SIP/192.168.16.151-08d40430”, “Received incoming SIP connection from unknown peer to 01423564556”) in new stack
– Executing [01423564556@from-sip-external:2] Set(“SIP/192.168.16.151-08d40430”, “DID=01423564556”) in new stack
– Executing [01423564556@from-sip-external:3] Goto(“SIP/192.168.16.151-08d40430”, “s|1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/192.168.16.151-08d40430”, “1?from-trunk|01423564556|1”) in new stack
– Goto (from-trunk,01423564556,1)
– Executing [01423564556@from-trunk:1] Set(“SIP/192.168.16.151-08d40430”, “__FROM_DID=01423564556”) in new stack
– Executing [01423564556@from-trunk:2] NoOp(“SIP/192.168.16.151-08d40430”, “Received an unknown call with DID set to 01423564556”) in new stack
– Executing [01423564556@from-trunk:3] Goto(“SIP/192.168.16.151-08d40430”, “s|a2”) in new stack
– Goto (from-trunk,s,2)
– Executing [s@from-trunk:2] Answer(“SIP/192.168.16.151-08d40430”, “”) in new stack
– Executing [s@from-trunk:3] Wait(“SIP/192.168.16.151-08d40430”, “2”) in new stack
– Executing [s@from-trunk:4] Playback(“SIP/192.168.16.151-08d40430”, “ss-noservice”) in new stack
– <SIP/192.168.16.151-08d40430> Playing ‘ss-noservice’ (language ‘en’)
== Spawn extension (from-trunk, s, 4) exited non-zero on ‘SIP/192.168.16.151-08d40430’
– Executing [h@from-trunk:1] Hangup(“SIP/192.168.16.151-08d40430”, “”) in new stack
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/192.168.16.151-08d40430’

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

Kind regards

Andy

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.