Dynamic Routes Question

I have three Inbound Routes:


These routes go to the same time check before heading to three different queues (if the time matches)


This works fine, no problem. What I was hoping to do was as efficiently as possible, in the GUI, have a single call flow control to override the time check and force calls to queue no matter what. I have a call flow control:

if the value is night. I want to ignore the time check and go straight to queue. I think this could work in Dynamic Routes, but my question is how to make it as efficient as possible (fewest Dyn routes).

I can use:
${DB(DAYNIGHT/C5)}) to see the day/night value

I need to write something to the effect of:

  • If ${DB(DAYNIGHT/C5)}) = Day
    RETURN 0
    else RETURN ${CALLERID(dnid)6:4}

I could make an entry for each queue based on the returned result, 0 would go to the time condition like normal.

Question: How would I write that into a Dyn Route?

Thanks for any help or insights you can provide here.

Based on what you’ve told us so far, the desired functionality is built into Time Conditions and you have no need for a dynamic route. In your Time Conditions, see the tool tip for Call Flow Toggle Associate with. .

1 Like

If I understand the ask, you want all calls from all DIDs to go to a single Call Flow Control. After the call flow control, you need to branch the call by DID to go to separate queues, so a single dynroute will do that if you use the Asterisk variable ${FROM_DID}.

1 Like

@Stewart1 I never noticed this function, but it looks like it might work. I looked at the wiki but I am still lacking understanding.
I made:
Time Condition: test1 (*271)
Time Condition: test2 (*272)
Time Condition: test3 (*273)

When I dial the feature codes they toggles between temporally unmatched and no override
Is that because I am currently in the matched hours? If I tried this outside of the matched hours, would it move to temporally matched since the time conditions current state would be unmatched?


  • How can I make it toggle between temporally matched and no override?
  • How can I toggle all three with one feature code?

You will first be adding a Call Flow Control (default feature code starts with *280). Then, you would reference this single Control in each of your three Time Conditiions.

I am not understanding how to tie the single call flow control to the three time conditions, I am not seeing it in the GUI (FreePBX 16), but I could be completely missing it.

After setting up the CFC, you visit each Time Condition and set Call Flow Toggle Associate with.

I still don’t see how, sorry for being dense.

Sorry, I don’t know why the option is missing.

Possibly, it doesn’t display until you have created at least one Call Flow Control.
Or, maybe your system is older than when this was implemented.
Or, maybe it’s somehow broken.

Edit: Sorry, this post is all wrong; see @lgaetz next post.

It needs to be enabled in Advanced Settings

1 Like

Just came in to say, holy shit I wish I had known about this functionality earlier but I sure am glad I learned about it now.


Ditto, I’ve done a fair amount and read a lot, but I still have a lot to learn. I’ve been trying to stay out of custom destinations, because I miss things like this. Thanks @david55 & @lgaetz

Why is the option off for this by default @lgaetz?

I suspect because it only has a couple of rare(?) use cases but oh boy does it scratch an itch when there is need for it.

This feature predates me and I can’t find any discussion around it. If I had to guess, it was probably added mid life cycle and there was some concern that it might break or affect exiting setups, so they chose to leave it disabled by default.

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