I am trying to get our Panasonic NCP1000 Phone system to work with a failover Internet connection.
After many hours a Telco company told me it won’t work because the SIP connection table needs to be flushed (clear out all connections) before the phonesystem will route all traffic over the second Internet connection.
I configured RB750 with Dual WAN ports (static IP) from Telus and Shaw IP providers and default all goes thru Shaw. When Shaw fails all traffic should go to Telus, but apparently the SIP connection table needs to be flushed first.
But how do I trigger this script to run when my Shaw connection fails and how do I add all existing connections in an “abuse” list or is this already taken care off by the script. I am a newby!
This is how we do failover on our Mikrotik routers… we had an in house person write it and it works well. (thanks Andrew!)
You will need to edit this to fit your upstream Gateway IP [replace xx.xx.xx.xx with your primary ISP gateway] and change the comment to whatever your label is on the default route. We used Google DNS as the secondary ping but you can use whatever external IP you see fit. (We need both IP’s to fail before it fails over.“else=”)
:if ([/ping xx.xx.xx.xx interval=.1 count=10]<5 && [/ping 8.8.4.4 interval=.1 count=10]<5 && [/ip route get [find comment="Primary"] disabled]=false) do={
:log info "Disabling Primary"; /ip route set [find comment="Primary"] disabled=yes
} else= {
:if ([/ip route get [find comment="Primary"] disabled]=true) do={
:log info "Enabling Primary"; /ip route set [find comment="Primary"] disabled=no
/delay 5
/system reboot
}
}
Then schedule this script to run and check how often you wish… we run ours every 2 minutes.
The reboot is put in there because we also run a PBX and NAT related services and this clears the tables.
That should be all… Just make sure the comments and upstream gateway match the script is all.
I tested this initially with Asterisks but should work just the same for any IP phone system.
There may also be a better way to flush the tables rather than a reboot, but the reboot is so fast and cleans it all out so its a sure thing.
I also use a more modified version that sends me notices on another router…
:global strDate [/system clock get date]
:global strTime [/system clock get time]
:global strSystemName [/system identity get name]
:if ([/ping xx.xx.xx.xx interval=.1 count=10]<5 && [/ping 8.8.4.4 interval=.1 count=10]<5 && [/ip route get [find comment="Default Route"] disabled]=false) do={
:log info "Disabling Primary"; /ip route set [find comment="Primary"] disabled=yes
/tool e-mail send from="noreply@routerdomain.com" to="alert@emaildomain.com" server="MAILSERVERIPHERE" subject="Route Failover - $strDate $strTime - $strSystemName" body="Failover to ISPNAME occurred at $strDate $strTime on $strSystemName"
} else= {
:if ([/ip route get [find comment="Primary"] disabled]=true) do={
:log info "Enabling Primary"; /ip route set [find comment="Primary"] disabled=no
/delay 5
/system reboot
}
}
This was was written also by the same guy… but he was also trying to add email notices to notify.
We have control of the mail server so we were able to add smtp bypass to the sending mail server. Auth will need to be added to the script if you want to add it.