How to sip trunk between 3 voice box (1 AVAYA anad 2 FreePBX base)

hello all ;

I have 3 voice center contain a AVAYA and 2 ELastix .
AVAYA is connected to Elastix by sip trunk , then this Elastix is
connect to another Elastix by another sip trunk .
I have the certain
dial pattern on each voice center , and I can call from AVAYA to first
Elastix and can call from each Elastix together . this is my Plan :
AVAYA --------------------sip trunk------------------ Elastix 1 --------------------sip trunk------------------ Elastix 2

AVAYA to Elastix 1 work fine and Conversely. :smile:
Elastix 1 to Elastix 2 work fine and Conversely. :smile:

but the problem is :
I can’t call from AVAYA to Elastix 2 . :frowning:

Best Regards.

Do you have to go through Elastix 1 to get to Elastix 2 or can the Avaya go directly to Elastix 2?

I have to call from AVAYA to elastix 2 through elastix 1 .
I need elastix be my core .
But I can use other thunk type (IAX, …)
have you any solution ?

I suspect the issue is in the call routing in E1, the inbound and outbound routes may need to be tweaked. The log files may help tracking down the failure.

I have the E1 line in avaya and used for call from elastix 1 to none-extensions .
elastix 1 can call both avaya and elastix 2 extensions and now I want extensions from avaya can call extensions in elastix 2.

I am not an Elastix expert but somehow the E1 system has to be able to analyze the incoming number and either drop it off at E1 (which appears to be happening) or to pass it along the E1 to E2 trunk for processing. Do watch the log files as they will provide clues to what is happening.

this log in elastix 1 when avaya extension (249) try to call extension (399) on elasticx 2.
“5” is prefix for call from avaya to elastix 1 and “8” is perfix that used for call from elastix 1 to elastix 2 .
so avaya and extension(249) should call 58(399) to call elastix 2 ,
the log is :
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] Macro(“SIP/FXO-0000011d”, “user-callerid,SKIPTTL,”) in new stack
– Executing [[email protected]:1] Set(“SIP/FXO-0000011d”, “AMPUSER=249”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/FXO-0000011d”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/FXO-0000011d”, “1?Set(REALCALLERIDNUM=249)”) in new stack
– Executing [[email protected]:4] Set(“SIP/FXO-0000011d”, “AMPUSER=”) in new stack
– Executing [[email protected]:5] Set(“SIP/FXO-0000011d”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/FXO-0000011d”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [[email protected]:10] GotoIf(“SIP/FXO-0000011d”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] Set(“SIP/FXO-0000011d”, “CALLERID(number)=249”) in new stack
– Executing [[email protected]:20] Set(“SIP/FXO-0000011d”, “CALLERID(name)=Bahari”) in new stack
– Executing [[email protected]:21] NoOp(“SIP/FXO-0000011d”, “Using CallerID “Bahari” <249>”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/FXO-0000011d”, “Calling Out Route: GSSTech_ext”) in new stack
– Executing [[email protected]:3] Set(“SIP/FXO-0000011d”, “MOHCLASS=default”) in new stack
– Executing [[email protected]:4] Set(“SIP/FXO-0000011d”, “_NODEST=”) in new stack
– Executing [[email protected]:5] Macro(“SIP/FXO-0000011d”, “record-enable,OUT,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/FXO-0000011d”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“SIP/FXO-0000011d”, “1?MacroExit()”) in new stack
– Executing [[email protected]:6] Macro(“SIP/FXO-0000011d”, “dialout-trunk,3,399,”) in new stack
– Executing [[email protected]:1] Set(“SIP/FXO-0000011d”, “DIAL_TRUNK=3”) in new stack
– Executing [[email protected]:2] GosubIf(“SIP/FXO-0000011d”, “0?sub-pincheck,s,1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/FXO-0000011d”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:4] Set(“SIP/FXO-0000011d”, “DIAL_NUMBER=399”) in new stack
– Executing [[email protected]:5] Set(“SIP/FXO-0000011d”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [[email protected]:6] Set(“SIP/FXO-0000011d”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/FXO-0000011d”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/FXO-0000011d”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“SIP/FXO-0000011d”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [[email protected]:11] Macro(“SIP/FXO-0000011d”, “outbound-callerid,3”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/FXO-0000011d”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/FXO-0000011d”, “0?Set(REALCALLERIDNUM=249)”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/FXO-0000011d”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [[email protected]:6] Set(“SIP/FXO-0000011d”, “USEROUTCID=”) in new stack
– Executing [[email protected]:7] Set(“SIP/FXO-0000011d”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:8] Set(“SIP/FXO-0000011d”, “TRUNKOUTCID=”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/FXO-0000011d”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] ExecIf(“SIP/FXO-0000011d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/FXO-0000011d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/FXO-0000011d”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/FXO-0000011d”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [[email protected]:12] GosubIf(“SIP/FXO-0000011d”, “0?sub-flp-3,s,1”) in new stack
– Executing [[email protected]:13] Set(“SIP/FXO-0000011d”, “OUTNUM=399”) in new stack
– Executing [[email protected]:14] Set(“SIP/FXO-0000011d”, “custom=SIP/GSSTech”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/FXO-0000011d”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
– Executing [[email protected]:16] Macro(“SIP/FXO-0000011d”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/FXO-0000011d”, “”) in new stack
– Executing [[email protected]:17] GotoIf(“SIP/FXO-0000011d”, “0?bypass,1”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/FXO-0000011d”, “0?customtrunk”) in new stack
– Executing [[email protected]:19] Dial(“SIP/FXO-0000011d”, “SIP/GSSTech/399,300,”) in new stack
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/GSSTech/399
– SIP/GSSTech-0000011e is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
– Executing [[email protected]:20] NoOp(“SIP/FXO-0000011d”, “Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 21”) in new stack
– Executing [[email protected]:21] Goto(“SIP/FXO-0000011d”, “s-CONGESTION,1”) in new stack
– Goto (macro-dialout-trunk,s-CONGESTION,1)
– Executing [[email protected]:1] Set(“SIP/FXO-0000011d”, “RC=21”) in new stack
– Executing [[email protected]:2] Goto(“SIP/FXO-0000011d”, “21,1”) in new stack
– Goto (macro-dialout-trunk,21,1)
– Executing [[email protected]:1] Goto(“SIP/FXO-0000011d”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] GotoIf(“SIP/FXO-0000011d”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,continue,3)
– Executing [[email protected]:3] NoOp(“SIP/FXO-0000011d”, “TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
– Executing [[email protected]:4] Set(“SIP/FXO-0000011d”, “CALLERID(number)=”) in new stack
– Executing [[email protected]:7] Macro(“SIP/FXO-0000011d”, “outisbusy,”) in new stack
– Executing [[email protected]:1] Progress(“SIP/FXO-0000011d”, “”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/FXO-0000011d”, “0?emergency,1”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/FXO-0000011d”, “0?intracompany,1”) in new stack
– Executing [[email protected]:4] Playback(“SIP/FXO-0000011d”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– <SIP/FXO-0000011d> Playing ‘all-circuits-busy-now.gsm’ (language ‘en’)
– <SIP/FXO-0000011d> Playing ‘pls-try-call-later.gsm’ (language ‘en’)
– Executing [[email protected]:5] Congestion(“SIP/FXO-0000011d”, “20”) in new stack
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/FXO-0000011d’ in macro ‘outisbusy’
== Spawn extension (from-internal, 8399, 7) exited non-zero on ‘SIP/FXO-0000011d’
– Executing [[email protected]:1] Macro(“SIP/FXO-0000011d”, “hangupcall”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/FXO-0000011d”, “1?endmixmoncheck”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] NoOp(“SIP/FXO-0000011d”, “End of MIXMON check”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/FXO-0000011d”, “1?nomeetmemon”) in new stack
– Goto (macro-hangupcall,s,28)
– Executing [[email protected]:28] NoOp(“SIP/FXO-0000011d”, “End of MEETME check”) in new stack
– Executing [[email protected]:29] GotoIf(“SIP/FXO-0000011d”, “1?noautomon”) in new stack
– Goto (macro-hangupcall,s,34)
– Executing [[email protected]:34] NoOp(“SIP/FXO-0000011d”, “TOUCH_MONITOR_OUTPUT=”) in new stack
– Executing [[email protected]:35] GotoIf(“SIP/FXO-0000011d”, “1?noautomon2”) in new stack
– Goto (macro-hangupcall,s,41)
– Executing [[email protected]:41] NoOp(“SIP/FXO-0000011d”, “MONITOR_FILENAME=”) in new stack
– Executing [[email protected]:42] GotoIf(“SIP/FXO-0000011d”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,45)
– Executing [[email protected]:45] GotoIf(“SIP/FXO-0000011d”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,48)
– Executing [[email protected]:48] GotoIf(“SIP/FXO-0000011d”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,50)
– Executing [[email protected]:50] AGI(“SIP/FXO-0000011d”, “hangup.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi
– <SIP/FXO-0000011d>AGI Script hangup.agi completed, returning 0
– Executing [[email protected]:51] Hangup(“SIP/FXO-0000011d”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 51) exited non-zero on ‘SIP/FXO-0000011d’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/FXO-0000011d’

I see where it fails. You should compare this log to another where you call from a station on E1 to E2 successfully and see what changes.

so How can I create a route by source and destination in elastix or Asterisk or FreePBX ???
becase I want to route call from avaya to elastix 2 , how can I write and create this route ?

It’s seems to be just a routing issue, whether you use a designated prefix or an extension range, the core system has to be able to sort out which is which and route appropriately. In FreePBX on calls going from Avaya to E2 (for example), the E1 systems needs to be able to pick those out and the incoming route send them directly through to the E1 to E2 trunk. Again, the FreePBX has the ability to pick a trunk as a destination for an inbound call; we did it for quite awhile on external calls being sent directly to a Lync system.

thank you , nut Elastix has a FreePBX Admin module , could you please explain the main work that you do for this perpose ???
I need a totorial even for FreePBX to do this topology , please explain it in detail and command or Web GUI help about this .
thank you very much

Best I can do is point you to the ‘core’ system; the routing should be able to be done with both the incoming and outbound routing modules. I am just not in a position to write up, test, and publish a full step-by-step tutorial.

could you give me a link to do this in correct way ?

I have almost the same setup (Avaya–freepbxA–freepbxB).
Sip trunk between Avaya and freepbxA , IAX trunk between freepbxA and freepbxB
On freepbx A and B I have marked outbound routes pointing to respective PBX as “Intra-Company” (there is a flag to check)
This was enough for my setup to work…
Hope that’s what you’re looking for. :telephone_receiver:

Hay digiteltlc
I want to setup SIP trunk b/w Avaya and Freepbx .I have tried a lot but unseccessful.log says destination unreachable.PLz helpme with ur configuration

The FreePBX sip trunk is configured this way:

host=avaya_ip_address
deny=all
allow=ulaw
type=friend
qualify=yes
context=from-internal
trunk=yes
transfer=no

I cannot reach Avaya configuration now (I’m on holyday… :smile:) to paste it here , however it’s a simple sip trunk with no registration and a feature code routes calls to FreePBX
A FreePBX outbound rule uses sip trunk to route call to Avaya

What’s the log you are collecting faulty infos from ??

Thanks Dear,
I have tried but failed.

Let me make clear
i dont have Session Manager or SES on Avaya
But once i created SIP trunk b/w Avaya and CUCM and it worked perfect

related to logs
Asterisk:log is saying destination unreacheable
and avaya trunk status shows FE-idle and signaling group status is far-end bypass