Versions Compared

Key

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

Click on the "Outbound" link in menu on the left side so you get to the "Dialing Rule List" page. Here you can choose the default outbound trunk or set up the dialing rule to route the calls on a specific one.

4.

...

5.1 Set the default Outbound Trunk

Subtitle
Prefixfigure
SubtitleTextDefault Outbound view
AnchorNamebasic outbound view

...

Subtitle
Prefixfigure
SubtitleTextchoose the default outbound trunk
AnchorNamechoose default outbound

Single default Trunk

To choose the default Trunk you just need to click on the "BLOCKED" tag and then you can use the drop down menu as in 

Xref
AnchorNamechoose default outbound

...

Once you're done you can press the "Update" button to confirm your choice. You return to the "Dialing Rule List" page and this time the "Default Outbound" option is set to the trunk you choose.

Trunk Failover

In case of multiple Trunk that have to work in failover style, you need some more advanced setup. 

Brand
brandserver
 can manage two separate failover groups (eg: production infrastructure with 3 SIP trunks and QA infrastructure with 2 SIP trunks).

...

As shown in 

Xref
AnchorNameps_trunk_failover_menu
 there's one option called "FAILOVER GROUP" just between "BLOCKED" and your first SIP Trunk name. First part of this configuration is to choose this option as default outbound Trunk.

Once you're done you need to change content of one file in your 

Brand
brandserver
. Retrieve new file content by visiting url:

Code Block
https://<host>/dialingRule/failoverDialplan

Eg: if your 

Brand
brandserver
 hostname is "pippo.madama.at", then you should write in your browser's address field the following address: 

Code Block
https://pippo.madama.at/dialingRule/failoverDialplan

The resulting page is pure text configuration lines as in example below:

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()

You can notice that we have two blocks of code for each failover 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.

Now you need to access via SSH to your 

Brand
brandserver
 and become root. Then edit file /etc/asterisk/trunk-failover.conf :

Code Block
[root@xxx ~]# vim /etc/asterisk/trunk-failover.conf
Note

On

Brand
brandserver
is also available "nano" editor, if you feel uncomfortable with "vim" one.

Standard file's content is like this:

Code Block
[trunk-failover]
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_NOT_CONFIGURED)
  same => n,Hangup()

You need to remove all lines and change the content with the ones you copied from web console at the beginning of the operation.

Once you're done just save the file. When you're back in console, as root you can reload dialplan by issuing the following command:

Code Block
[root@xxx ~]# rasterisk -x "dialplan reload"
Setting max files open to 65536
Privilege escalation protection disabled!
See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.
Dialplan reloaded.
[root@xxx ~]#

Now your Trunk failover configuration is completed. Any time one Trunk of yours resulted Unreachable,

Brand
brandserver
 would try to use the next one configured. If all your trunks failed, then the call would be rejected (as you can expect, by the way). 

Info

It's possible to choose the exact priority by correctly naming your Trunks. Order followed is alphabetical.

4.

...

5.2 "Re-route temporary unavailable users" option

This option adds a new flexibility to the renewed Sip Trunk management introduced in the present version. When you check the option all the calls for temporary unavailable users will bounce into the specified SIP Trunk. 

...

An example scenario for this option would be an enterprise integration where the mobile phone numbers are handled by

Brand
brandserver
in secure mode and by the company's PBX in clear (not-secure) mode. If the Service administrator need that the users have to be reachable no matter whether secure or not, then he can enable this option and let each PBX manage the users in its way.

 

4.5.3 Re-route prefix (optional)

This option is to replace prefix to create conditional routing rules for outbound calls.

  • When the field is empty the dialed number is the one used when the sip account is created.
  • When a prefix is filled with a valid number, then the + prefix is replaced with the number filled. 

4.5.

...

4 Create Outbound routing by dialing rules

The Outbound Trunks can also be selected by dialing a prefix. If you need to create conditional routing rules for Outbound calls, then you need to use the lower section of the "Dialing Rule List" page (cfr. 

Xref
AnchorNamebasic outbound view
). 

...