Workaround if Asterisk IP-PBX is offline

Hi everybody!
I need your help to understand in wich way I could solve this problem.
I’ve got a VoIP number and my Asterisk IP-PBX has a public IP and a dedicated DSL.
I’ve got also an analog number.
The problem is that my DSL sometimes go down for some hours so I can’t receive calls on my VoIP number (that’s the principal number, that everybody know).
I need a workaround to make a sort of backup. When my VoIP number is not reachable I need to transfer the call vs an analog number. What do you suggest to me (don’t say “change DSL operator” :smiley: … I know… :frowning: ) ?
Thank you very much!!

If you mean by incoming calls you can do nothing except your provider has this feature to route calls to a pstn number when your VOIP number is not accessible . ( of course you can implement this feature yourself by using a internet hosted asterisk server and do this fail over you yourself but I guess you dont want to do it for a small home asterisk box )

but if you want to have failover for you outgoing call from your asterisk box . you can do it by checking DIALSTATUS variable in dialplan and route it to your PSTN number when this variable returns Congestion or BUSY …

Hi! Thank you for your answer!!

Looking at your answer I understand that probably I missed to tell you the most important particular (sorry!)

To be clear, this is the scenario: VoIP provider <-> hosted Asterisk PBX <-> my Asterisk PBX

My Asterisk PBX is registered to the hosted Asterisk PBX by a VoIP trunk and the hosted Asterisk is registered to the VoIP provider with another VoIP trunk.
The problem is that my Asterisk PBX (that tipically is registered to the hosted Asterisk PBX) is not more reachable because my DSL fails. So all calls are terminated on the hosted Asterisk PBX.
I’m able to operate on my Asterisk PBX and also on the hosted one! So, what could I do to solve the problem? How could I configure the hosted Asterisk PBX to transfer all the calls that are arriving on the VoIP number to the analog number?
Could I use a particular Asterisk/A2B workaround on the hosted Asterisk PBX?

Thank you for your precious help that I really appreciate because you’re giving to me the possibility to understand (that’s the most important thing for me!) Thanks!

you can buy a trunk with access to your country PSTN . then whenever your IP trunk to your asterisk goes down you can dial your asterisk box PSTN number through that trunk .


Ok you just need to have your hosted system send the call to another number on channel unavailable. or use devstate to to check the link to your system, and route as appropriate.

Thank you for your answers!!

Ok! I like it! Suppose that I want to make this workaround! How do you suggest to proceed on the hosted machine?
If I understand, I need a sort of “listening process” that remains always activated for that VoIP number and that be able to catch the failure case…
Do I need a simple configuration in my asterisk conf files or I need a php-agi script for the hosted Asterisk PBX?
Consider also that the hosted machine is managed by A2B…
Can you help me being more specific (perhaps with some useful references that I can follow…)?
All single information is gold for me! Thanks a lot! :wink:

you can use following example . We have two trunk here . Trunk1 and Trunk2 …
If dialing 101 through trunk1 is failed because of Congestion or if channel is not available it will go thorugh trunk2

exten => 101,1,Dial(${TRUNK_1}/${EXTEN})
exten => 101,n,NoOp(E1 Trunk is not accessible because of ${DIALSTATUS} DialStatus)
exten => 101,n,GotoIf($[${DIALSTATUS}=CHANUNAVAIL|${DIALSTATUS}=CONGESTION]?continue:hangup)
exten => 101,n(continue),Dial(${TRUNK_2}/${EXTEN}))
exten => 101,n(hangup),NoOp(Dial failed due to ${DIALSTATUS})