Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
[trunk-failover]
exten => _[+0-9]X.,1,Verbose(Failover group)
  same => n,Set(PREV_CHAN=${canale})

  same => n(__trunk_ffefd2c02f46993e),Verbose(Trying to dial using trunk "Trunk 10" __trunk_ffefd2c02f46993e)
  same => n,Set(NETWORKSTATUS=${SIPPEER(__trunk_ffefd2c02f46993e,status)})
  same => n,Gotoif($["${NETWORKSTATUS}"="UNREACHABLE"]?__trunk_616683993964bc16:)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=__trunk_ffefd2c02f46993e)
  same => n,Dial(SIP/__trunk_ffefd2c02f46993e/${EXTEN})
  same => n,Hangup()

  same => n(__trunk_616683993964bc16),Verbose(Trying to dial using trunk "Trunk 11" __trunk_616683993964bc16)
  same => n,Set(NETWORKSTATUS=${SIPPEER(__trunk_616683993964bc16,status)})
  same => n,Gotoif($["${NETWORKSTATUS}"="UNREACHABLE"]?__trunk_d346973491bc1df3:)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=__trunk_616683993964bc16)
  same => n,Dial(SIP/__trunk_616683993964bc16/${EXTEN})
  same => n,Hangup()

  same => n(last),Verbose(No trunk reachable)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=FAILOVER_FAILED)
  same => n,Hangup()
 
[trunk-failover-2]
exten => _[+0-9]X.,1,Verbose(Failover group)
  same => n,Set(PREV_CHAN=${canale})

  same => n(__trunk_d346973491bc1df3),Verbose(Trying to dial using trunk "Trunk 12" __trunk_d346973491bc1df3)
  same => n,Set(NETWORKSTATUS=${SIPPEER(__trunk_d346973491bc1df3,status)})
  same => n,Gotoif($["${NETWORKSTATUS}"="UNREACHABLE"]?__trunk_6fd24f043acea450:)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=__trunk_d346973491bc1df3)
  same => n,Dial(SIP/__trunk_d346973491bc1df3/${EXTEN})
  same => n,Hangup()

  same => n(__trunk_6fd24f043acea450),Verbose(Trying to dial using trunk "Trunk 13" __trunk_6fd24f043acea450)
  same => n,Set(NETWORKSTATUS=${SIPPEER(__trunk_6fd24f043acea450,status)})
  same => n,Gotoif($["${NETWORKSTATUS}"="UNREACHABLE"]?__trunk_27f415d6fb6346c0:)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=__trunk_6fd24f043acea450)
  same => n,Dial(SIP/__trunk_6fd24f043acea450/${EXTEN})
  same => n,Hangup()

  same => n(last),Verbose(No trunk reachable)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=FAILOVER_FAILED)
  same => n,Hangup()
 
[trunk-failover-2]
exten => _[+0-9]X.,1,Verbose(Failover group)
  same => n,Set(PREV_CHAN=${canale})

  same => n(last),Verbose(No trunk reachable)
  same => n,Set(SHARED(Sip_Trunk,${PREV_CHAN})=FAILOVER_FAILED)
  same => n,Hangup()

You can notice that we have one block two blocks of code for each configured Trunkfailover group. In this case we are using 4 Trunks named:

  • FAILOVER GROUP 1
    • Trunk 10
    • Trunk 11
  • FAILOVER GROUP 2
    • Trunk 12
    • Trunk 13

You have to copy page content and keep it somewhere handy.

...

Once you filled in the proper values, just press Create button to add your new Dialling Rule.

Info

Please be aware that if you need an exact match for a dialed number, then you have to write the number itself trailed by the ! character.

E.G: to match number 123456 and just it, you need to write it into "Prefix" textbox as follows: 123456!

Note

In case you need one rule as a subset of a more generic one, then you must write down the prefix of the more generic one trailed by an X .

E.G: we have one prefix 071 to route calls by one trunk trunk_1, but we need the prefix 0715 to be routed by another trunk named trunk_02 . Then we need to set one first dialing rule for trunk_1 using prefix 071X and a second one for trunk_2 using prefix 0715 .

 

 

Navbar