...
Eg: if your
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 |
and you get remaining configuration in pure text. Content of the page has to be copied.
Keeping at handy one copy of the text mentioned above, you need to access via SSH to your
and become root. Note |
---|
To accomplish above tasks please sdlgkndasglndsglnsdglnsdglkndsglknsdglk |
Code Block |
---|
[root@xxx ~]# vim /etc/asterisk/trunk-failover.conf |
Note |
---|
On is also available "nano" editor, if you feel uncomfortable with "vim" one. |
Code Block |
---|
[trunk-failover]
exten => _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.The resulting page is pure text configuration lines as in example below:
Code Block |
---|
[trunk-failover]
exten => _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(__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 one block of code for each configured Trunk. In this case we are using 4 Trunks named:
- Trunk 10
- Trunk 11
- Trunk 12
- Trunk 13
You have to copy page content and keep it somewhere handy.
Now you need to access via SSH to your
and become root. Then edit file /etc/asterisk/trunk-failover.conf : Code Block |
---|
[root@xxx ~]# vim /etc/asterisk/trunk-failover.conf |
Note |
---|
On is also available "nano" editor, if you feel uncomfortable with "vim" one. |
Standard file's content is like this:
Code Block |
---|
[trunk-failover]
exten => _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:
...