A better way to do my call flow?

Hello everyone, if anyone has suggestions I would greatly appreciate it.

Here is my scenario, I have 5 DID’s, 4 DID’s go through the PBX to their respective Ring Groups. The Main Line DID(#5) I have a Call Flow Toggle set up. For Green it goes to the Main Line IVR. When red it goes to a announcement for when the business is closed, then on to the Main Line IVR

What I am wanting is to turn all the DID’s to this announcement when the Call Flow Toggle is Red. But when it is Green I do not want the other 4 DID’s going to the Main Line IVR. When Green the 4 DID’s still need to go to their Ring Group. I can not achieve this from the Call Flow Toggle Menu

Anyone have any suggestions to add/include that could make this work

@CCSNetTech Please do the following:

Edit /etc/asterisk/extensions_custom.conf. Ensure the following exists:

[from-internal-custom]
include => call-flow

[call-flow]
exten => cfc,1,GoSub(ext-group,${MATH(${CALLERID(dnid):-4}-1000,i)},1)

This does the following:

  1. Includes the ‘call-flow’ context
  2. Sends calls into the call-flow context to a ring group defined by the last FOUR digits of the dialed DID, MINUS 1000.

For instance, if your DID was 612 555 4862, this would assume your ring group’s extension was 3862. You can modify this to whatever you please.

Now, from FreePBX GUI, complete the following:

Admin > Custom Destinations > Add.

Copy and paste the following values directly into the appropriate fields:

  • Target: call-flow,cfc,1
  • Description: CallFlow
  • Notes: Send call to ring group defined by ${CALLERID(dnid)}-1000

Then:
Connectivity > Inbound Routes

Change each of your four DIDs to point to the call flow control you’ve already defined.

Then:
Applications > Call Flow Control

Modify your existing control to have Normal Flow point to the Custom Destination you just made.

Then
Applications > Ring Groups
Rebuild ring groups to suit your dialing method, or use what I provided. Or some other math. Whatever.

Save/apply/test. If you have trouble, please do the following from linux shell:

asterisk -rvvvvvvvvv
< reproduce issue >
exit

Copy resulting scrollback to pastebin.com. Copy the pastebin link here.

@cullenl

Thank you very much for pointing me in a direction. I will configure this and test.

No problem, let me know if you have any trouble.