Set Optional Destinations in Custom Context on Inbound Calls

Hallo everybody,

I have a question about the syntax to use in a Context in Extensions_custom.

Normally, for each Extensions, we can set the Optional Destinations in case of No Answer, Not Reachable, Busy.
For many of our customers, we have hundreds of Extensions XXX and just one incoming Number such as 00390612345XXX. In this cases, we create an Inbound Route that ends on a Custom Destination like


and we insert in Extension_custom a code like this:

exten = _X.,n,Goto(from-did-direct,${EXTEN},1)
exten = _X.,n(PO),Goto(ext-queues,200,1)
exten = _X.,n(fine),hangup

What we need to achieve is that the extension rings, but in case of No answer, Busy, Not Reachable the call reaches the receptionist.
The code above actually never reaches the second line, because in case of No Answer, Busy, Not Reachable, the context [from-did-direct] hangs up.
Anyway, replacing the first line with a simple Dial, will ignore all the configuration that a user could do
on his extension (Voicemail, Follow-me…).

Is there a way to set the Optional Destination directly in the code (hence not on each extension), but at the same time preserve all the features of the context [from-did-direct]?

Thank you
Kind regards

I presume there is more to the code than what you’re sharing, there is no priority 1.

You can’t use a Goto to from-did-direct as you’ve discovered. I think the only supportable way to do this is to examine how dialing is done in a ring group and copy those ideas for your custom destination. It will be quite a bit more complicated than a single Goto line.

Hallo Lorne,

yes right, i just wrote the useful lines :slight_smile:

Thanks for the answer, I will analyze the dialing of a ring group and try to find out a not-too-complicated way of achieve my goal :wink:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.