Problem with two FreePBX trunks

I have two FreePBX in the same network, one of them have the connection with ITSP I will called Server1, but the other just have connection with LAN I will called Server2.

The Server1 have the Sip Trunk with the ITSP. I want that the server2 can make calls with that trunk through server1 but just the internal calls working.

10.78.9.78 (IP ITSP)
192.168.110.228 Server 2
192.168.110.4 Server 1

Server 2 IAX2 Trunk:

Outgoing Config

disallow=all
allow=alaw&ulaw
host=192.168.110.4
type=peer
nat=yes
qualify=yes
monitor=yes

Usercontext

auth=plaintext
context=from-trunk
disallow=all
allow=alaw&ulaw
host=dynamic
type=user

Server 1

Outgoing config

disallow=all
allow=alaw&ulaw
host=192.168.110.228
type=peer
nat=yes
qualify=yes
monitor=yes

Usercontext

auth=plaintext
context=from-trunk
disallow=all
allow=alaw&ulaw
host=dynamic
type=user

Additional i have in the server 1 an inbound route that DID Number with the patron _XXXXXXXX set destination to ITSP trunk

Asterisk CLI of server1 show this logs:

– SIP/ClaroSIP-00000035 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– Called SIP/ClaroSIP/23868686
> 0xf8f0a8 – Strict RTP learning after remote address set to: 10.78.9.78:39474
– SIP/ClaroSIP-00000035 is making progress passing it to IAX2/VIRTUAL_FREEPBX-1503
– SIP/ClaroSIP-00000035 is ringing
> 0xf8f0a8 – Strict RTP learning after remote address set to: 10.78.9.78:39474
– SIP/ClaroSIP-00000035 answered IAX2/VIRTUAL_FREEPBX-1503
– Channel SIP/ClaroSIP-00000035 joined ‘simple_bridge’ basic-bridge
– Channel IAX2/VIRTUAL_FREEPBX-1503 joined ‘simple_bridge’ basic-bridge
> 0xf8f0a8 – Strict RTP switching to RTP target address 10.78.9.78:39474 as source
> 0xf8f0a8 – Strict RTP learning complete - Locking on source address 10.78.9.78:39474
[2019-04-07 07:29:12] NOTICE[1184]: chan_sip.c:29607 check_rtp_timeout: Disconnecting call ‘SIP/ClaroSIP-00000035’ for lack of RTP activity in 31 seconds
– Channel SIP/ClaroSIP-00000035 left ‘simple_bridge’ basic-bridge
– Channel IAX2/VIRTUAL_FREEPBX-1503 left ‘simple_bridge’ basic-bridge
== Spawn extension (macro-dialout-trunk, s, 24) exited non-zero on ‘IAX2/VIRTUAL_FREEPBX-1503’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 23868686, 5) exited non-zero on ‘IAX2/VIRTUAL_FREEPBX-1503’
– Executing [h@from-internal:1] Macro(“IAX2/VIRTUAL_FREEPBX-1503”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“IAX2/VIRTUAL_FREEPBX-1503”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“IAX2/VIRTUAL_FREEPBX-1503”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] NoOp(“IAX2/VIRTUAL_FREEPBX-1503”, "SIP/ClaroSIP-00000035 monior file= ") in new stack
– Executing [s@macro-hangupcall:5] AGI(“IAX2/VIRTUAL_FREEPBX-1503”, “attendedtransfer-rec-restart.php,SIP/ClaroSIP-00000035,”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
– <IAX2/VIRTUAL_FREEPBX-1503>AGI Script attendedtransfer-rec-restart.php completed, returning 0
– Executing [s@macro-hangupcall:6] Hangup(“IAX2/VIRTUAL_FREEPBX-1503”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘IAX2/VIRTUAL_FREEPBX-1503’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘IAX2/VIRTUAL_FREEPBX-1503’
– Hungup ‘IAX2/VIRTUAL_FREEPBX-1503’

Can you help me with some tip?

Server 1 can’t allow the outbound call from the “from-trunk” context. Change your trunk connect from Server2 to Server1 to “from-internal” and try again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.