After reading the article
“How did we meet the apocalypse, or how were 3,500 companies left without calls?” There was a sense of bewilderment, and then there was a desire to share experience.
So, if you have, like
yagodkinvs had :
Redundancy was the server for the web-muzzle, but with telephony is not so simple ...
That welcome under kat.

Participating in one project, he was responsible for the initial setup and further support of telephony. The project grew over time, requirements changed, one of which was uninterrupted work of the call center, with the exception of cases of loss of electricity and / or trunk accidents with providers (Internet and / or telephony).
')
How was this solved?
I would like to note that it is impossible to reserve a phone number for 100% if you have it ONE. In case of an accident with a telecom operator, you cannot do anything.
Therefore, we acted as follows. The main telephony server was moved roughly from office to cloud. For its reservation, the second one was raised in a cheap hosting.
Settings on the backup - a copy of the main, with the exception of small nuances.
The project manager was offered the following options for automatically switching telephony between servers:
- Use DNS, in particular - from Amazon. There you can configure a very fast name switching, for example, voip.company.pro between the IP addresses of our two servers, by fail-over and other parameters.
- Use balancer. Options settings Kamailio and Asterisk, and not only it is in the vast network.
It should be noted that in the first embodiment, the switching of SIP-clients to the new server will be after the registration timeout works.
In the second case, the authorization is moved outside of Asterisk to the balancer itself.
But, the customer, having beaten the option with DNS, refused it. Proving that the update of information in the DNS servers at the end devices can be very long.
The second option was postponed, in view of the fact that so far there are not so many operators, and the customer did not want to complicate this scheme yet. Well, the weak point in the second version would be the balancer, and it would be necessary to reserve it.
The customer offered to think about another option - he sets up two accounts for operators in SIP clients. They are essentially identical, the differences are only in the connection server. And for my part, it is necessary to work out telephony switching between servers.
That is, part of the scheme on the part of subscribers took the following form:

Not perfect, but the customer insisted on such a decision, and all the labor costs for setting up SIP clients were taken by him. Entrusted to the existing sysadmin :)
Further. In order for calls to come in any case, an additional city number was rented, but from another service provider.
Number posted on the site, along with the main.
Both servers were connected in personal accounts at both telephone service providers, as sip-clients.
Were configured scripts for processing incoming calls, according to the following scheme:
- When an incoming call arrived, it was sent to the main server, the dialing time was 20 seconds.
- When the primary server was unavailable, the call was sent to the backup, the dialing time was 20 seconds.
- With unavailability and backup server, the call was sent to voicemail.
Almost all VOIP providers allow you to configure this scheme either in your personal account or on request to support service. At least from those chosen by us, we set it up in a personal account.
It turned out the following scheme:

Since the servers regarding external SIP clients are external, the customer has the opportunity to reserve Internet access channels for the call center without any problems. Although, I must say, he went even further and reserved the call center, opening its part in another city.
findings
The implemented scheme allowed to avoid idle call center in such cases:
- Failure, for any reason, of one of the telephony servers.
- The loss of electricity and / or all communication channels on the Internet at one of the call centers
- Accident at one of the service providers
Of course, in any of these cases, the current calls were broken, and the subsequent ones were already received on a backup scheme.
I remember that feeling of satisfaction, when in the evening in monitoring I saw a case of switching to a backup scheme.
And while no one called me with screams of panic, since this was hardly noticed.
Thank you for your attention! I hope that someone, this material will be useful.