Make Asterisk jump to the next context if connection fails

Status
Not open for further replies.

jazziao

Joined
May 6, 2013
Messages
35
Reaction score
0
Hello community.

I will try to explain this as smooth as possible so bear with me :)

I have two PBX, let's call them A and B. I am located in B and I'm trying to do the following from A:

I have two NIC's on PBX B with two different Internet connections (2 ISP), it doesn't matter which is the active default gateway, calls will go in and out from/to B. The issue resides that I have all my trunks and routes, etc in PBX A (inbound/outbound connections are made using A even though I'm located in B).

I have the [ivr-3] context in extensions_custom.conf in PBX A in order to make a direct connection to extensions in PBX B when a call is in the IVR in PBX A (all routes and queues are properly set up), I have the following [ivr-3] context in PBX A, changed the names of the Trunks so it will not show the real trunk names for this purpose:

[ivr-3]
exten => _2XX,1,dial(IAX2/Backup-Trunk/${EXTEN})
exten => _1XX,n,dial(IAX2/Backup-Trunk/${EXTEN})
exten => _2XX,1,dial(IAX2/Primary-Trunk/${EXTEN})
exten => _1XX,n,dial(IAX2/Primary-Trunk/${EXTEN})

When I'm using one of the default gateways I have to manually change the order of the trunks in the route and also have to change the trunk order in the context, so finally the question is:

Is there a way to make it jump to the next instruction or a next context if a connection is not made to the extension? As of right now, the call will not go through as it will give me a busy tone when trying the first lines (if default gateway is the opposite), is there a way to tell Asterisk that I'm using another Default gateway so it must use the following lines or a different context?

Hope this explanation is clear to you, if not, let me know if anything. I will really appreciate your words of wisdom on this one since I have to be making manual changes whenever one ISP fails.

Thanks in advance.
 
Re: Make Asterisk jump to the next context if connection fai

Your setup is hard to wrap my head around without looking at a diagram...but it's Friday and the 'ol CPU is tired.

I'm wondering if the problem you are facing could actually be solved through a custom routing table and not even touch the Asterisk dialplan? Something like some custom routing rules to let Linux know that for example, in order to reach trunk-primary try gateway address xx.xx.xx.xx.xx with a priority metric of 10 and if that route is down try gateway address nn.nn.nn.nn with a priority metric of 20.

Does that make perfect senselessness?
 
Re: Make Asterisk jump to the next context if connection fai

Thanks for your kind responses.

I will definitely give this a try next Monday, I'm leaving for the day already. Will post back with the results after tests.

Thanks.
 
Re: Make Asterisk jump to the next context if connection fai

Thank you so much for your help, just wanted to let you know that I followed the Macro instructions on the Dialplan on the link that was provided on this post and it worked like a charm. Tested this all the way and it works so well. Thank you guys for all your help, hope this information help others.
 
Status
Not open for further replies.

Latest Posts

Members Online Now

Forum statistics

Threads
111,861
Messages
589,439
Members
164,701
Latest member
yarusemiKK