Suppose you have a traditional Boss/Secretary arrangement where you want most calls to the boss to be intercepted by a secretary/admin assistant. The secretary acts as gatekeeper and has the ability to call the boss or transfer callers to the boss. And also suppose we have a select group of executives that can call the boss directly and bypass the secretary. If the accountcode is not already in use for accounting or pinsets, then one way we might do this is as follows:
Have a MIsc Application or virtual extension configured that everyone uses to call the boss.
Have the bossā true extension be a secret. The bossā CID Num Alias is set to the MIsc. Application.
For each extension that has the ability to call the boss directly, edit their extension, advanced tab and set the accountcode to ābossā or whatever string you prefer. (A clever idea by @billsimonsource.)
The Misc Application or virt extension goes to a Dynamic Route, and the dynroute is configured with Asterisk Variable, has substitutions disabled and this expression:
The above expression will return a 0 if there is no match, or a 1 if there is a match. You can then create dynroute destinations of 0 and 1 with the appropriate destination for each, one to the secretary and one to the bossā true extension.
This is clever. I love these Dynamic Route posts, I feel like Iām just scratching the surface and every time you post about it it gives me about a dozen different ideas about usable applications. Thanks
This exact scenario came up in support this morning. I feel like the price checker at the dollar store. Every time someone asks me 'How do I ā¦" I just automatically answer dynroutes before they finish.
As one who has a long extensions_custom.conf file full of hackery, I appreciate that some of these things can now be done in the GUI instead. Thanks @lgaetz !
Going thru this recently with @slobera and we discovered that itās not so simple to obscure a local extension number for a boss extension as is required for this work correctly. You can set the āCID Num Aliasā for the extension on the advanced tab, and outgoing calls from the Boss extension will carry the obscured CID Number, but for calls that are indirectly connected to the Boss, ConnectedLine will show the actual secret CID number.
This dialplan hook will correct for this:
[macro-dialout-one-predial-hook]
exten => s,1,Noop(Entering User defined context macro-dialout-one-predial-hook in extensions_custom.conf)
;exten => s,n,DumpChan ; uncomment for debug
exten => s,n,Set(CONNECTEDLINE(num)=${DB(AMPUSER/${EXTTOCALL}/cidnum)})
exten => s,n,MacroExit