FreePBX | Register | Issues | Wiki | Portal | Support

Combining multiple similar flows


#1

I am setting a system for a medical office. The office have 5 doctors, and the flows are very similar. Each has his own DID, and the announcements are somewhat different - but the rest is the same. Also, they share a single receptionist.

I set up the first two (Routes, Announcement, Call Flow, etc.) - and there is a lot of duplication there. If it were not for different recordings and different ring groups - it would be one.

So, I am wondering are there any tips / best practices of somehow parametrize the flows? Since all is tied to DID number in the incoming route (say, I have 213-555-1111 and 213-555-2222), if I could set it as a variable $DID, and had two announcements (Welcome-2135551111 and Welcome-2135552222) and could reference announcement Welcome-$DID - I would cut the number of objects five-fold.

Am I dreaming? What if I drop into asterisk config files?


#2

Apparently, there is a bigger user inconvenience. Given that I have multiple call flows, the receptionist will have to toggle each one separately (two now; five eventually). She would much prefer to have one code to have one call flow that controls all branches.


#3

I’ve ran into the same limitation. We use Aastra 675x phones and specifically their xml feature to “flip” the call flow toggles and light associated keys on the phones as a reminder that night service is on. I’m also looking for a way to engage several call flow toggles from a single command.


#4

I found a way to “flip” multiple toggles through some dialplan code in /etc/extensions_custom.conf I add two custom contexts as in:
.
.
.
[set-call-flow-on]
exten => *285,1,Answer
exten => *285,2,Set(DB(DAYNIGHT/C0)=NIGHT)
exten => *285,3,Set(DB(DAYNIGHT/C1)=NIGHT)
exten => *285,4,Set(DB(DAYNIGHT/C2)=NIGHT)
exten => *285,5,Hangup

[set-call-flow-off]
exten => *286,1,Answer
exten => *286,2,Set(DB(DAYNIGHT/C0)=DAY)
exten => *286,3,Set(DB(DAYNIGHT/C1)=DAY)
exten => *286,4,Set(DB(DAYNIGHT/C2)=DAY)
exten => *286,5,Hangup

(remember to “include” these custom contexts!)

So, when I dial *285 it sets three Call Flows to “Night” (mine are numbered 280, 281 and 282 by default, but only the 0,1,2 matter) and when I dial *286 they go back to “Day”. I think with a little more work; using DBget and GotoIF these could probably be turned into a single toggle, but it is simpler than setting three Call Flows individually and of course by adding more “Set(DB(DAYNIGHT/Cn)=” you can increase the number of Call Flows toggled.


#5

As I said, “a little more work” and voila;
.
.
.
.
[set-call-flow-toggle]
exten => *287,1,Answer
exten => *287,2,Set(togglestate=${DB(DAYNIGHT/C0)})
exten => *287,3,GotoIf($[${togglestate} = NIGHT]]?9:4)
exten => *287,4,Set(DB(DAYNIGHT/C0)=NIGHT)
exten => *287,5,Set(DB(DAYNIGHT/C1)=NIGHT)
exten => *287,6,Set(DB(DAYNIGHT/C2)=NIGHT)
exten => *287,7,Set(DB(DAYNIGHT/C3)=NIGHT)
exten => *287,8,Hangup
exten => *287,9,Set(DB(DAYNIGHT/C0)=DAY)
exten => *287,10,Set(DB(DAYNIGHT/C1)=DAY)
exten => *287,11,Set(DB(DAYNIGHT/C2)=DAY)
exten => *287,12,Set(DB(DAYNIGHT/C3)=DAY)
exten => *287,13,Hangup

This sets four Call Flow toggles with one dialed code (*287) back and forth from day to night to day again. Add as many “Set(DB(DAYNIGHT/Cn)” as you have toggles to flip and modify the label numbering and the label digits in “GotoIf($[${togglestate} = NIGHT]]?9:4)” to land on the right lines.

EasyPeezyAsteriskIsEasy!


Single Call control toggle for multiple Time Conditions
(system) closed #6