TUTORIAL Single call flow control toggle to alter multiple inbound routes

GerryGerry

Member
Joined
Dec 26, 2015
Messages
38
Reaction score
5
I'm sure this must have been asked several times before, but I can't seem to find it.

I have several DID's configured via inbound routes as well as a single catch all inbound route.

I've successfully setup call flow control on the catch all route and assigned it to a BLF a one phone. This works very well as a day/night switch.

I'd like to use that same BLF to also control all the other inbound routes but cannot figure out how.

(I'm using Incredible PBX 12.0.70 with asterisk 13.6)
 
Last edited by a moderator:

islandtech

Wassamassaw
Joined
Jan 11, 2009
Messages
501
Reaction score
73
If you want all inbound routes to use the same cfc destination as the catchall route, the point each inbound route to that same cfc
 

GerryGerry

Member
Joined
Dec 26, 2015
Messages
38
Reaction score
5
If you want all inbound routes to use the same cfc destination as the catchall route, the point each inbound route to that same cfc
I want them all to point to the same 'out of hours' destination when in night mode, but different destinations when in day mode. (Otherwise I'd just delete those inbound routes ant they'd follow the catchall route anyway)
 

islandtech

Wassamassaw
Joined
Jan 11, 2009
Messages
501
Reaction score
73
Inbound route (catch all)
Destination -> CFC (out of hours)
Normal (green) destination (example) ring group A
Overide (red) destination (example) night IVR, announcement, vm etc


Inbound route (DID A)
Destination -> CFC (out of hours)
Normal (green) destination (example) ring group B
Overide (red) destination (example) night IVR, announcement, vm etc



Inbound route (DID B)
Destination -> CFC (out of hours)
Normal (green) destination (example) ext, vm, ivd, rg, etc
Overide (red) destination (example) night IVR, announcement, vm etc


If the same CFC is used for all inbound routes then it would switch all to the night mode
 

GerryGerry

Member
Joined
Dec 26, 2015
Messages
38
Reaction score
5
Inbound route (catch all)
Destination -> CFC (out of hours)
Normal (green) destination (example) ring group A
Overide (red) destination (example) night IVR, announcement, vm etc

Inbound route (DID A)
Destination -> CFC (out of hours)
Normal (green) destination (example) ring group B
Overide (red) destination (example) night IVR, announcement, vm etc

Inbound route (DID B)
Destination -> CFC (out of hours)
Normal (green) destination (example) ext, vm, ivd, rg, etc
Overide (red) destination (example) night IVR, announcement, vm etc

If the same CFC is used for all inbound routes then it would switch all to the night mode
That is exactly what I want BUT the destinations are part of the CFC so I am unabe to select different detinations for different inbound routes.
 

islandtech

Wassamassaw
Joined
Jan 11, 2009
Messages
501
Reaction score
73
You want 1 button to send inbound routes to the same night destination but different day destinations.
One BLF on your phone to control The following three separate call flow controls (which can be expanded)

1. Build all needed Call Flow Controls
2. Open the web GUI -> Other Tab -> open Config Edit
3. Select extensions_custom.conf under /etc/asterisk
4. add the following near the top of the file after include => custom-recordme

Code:
include => set-call-flow-toggle
include => ext-local-custom
5. Go to the bottom of the file and add the following

Code:
[set-call-flow-toggle]
exten => 6483,1,Answer
exten => 6483,2,Set(togglestate=${DB(DAYNIGHT/C0)})
exten => 6483,3,GotoIf($[${togglestate} = NIGHT]]?9:4)
exten => 6483,4,Set(DB(DAYNIGHT/C0)=NIGHT)
exten => 6483,5,Set(DB(DAYNIGHT/C1)=NIGHT)
exten => 6483,6,Set(DB(DAYNIGHT/C2)=NIGHT)
exten => _X.,7,Set(DEVICE_STATE(Custom:OnLeave)=InUse)
exten => 6483,8,Hangup
exten => 6483,9,Set(DB(DAYNIGHT/C0)=DAY)
exten => 6483,10,Set(DB(DAYNIGHT/C1)=DAY)
exten => 6483,11,Set(DB(DAYNIGHT/C2)=DAY)
exten => _X.,12,Set(DEVICE_STATE(Custom:OnLeave)=Not_InUse)
exten => 6483,13,Hangup



[ext-local-custom]
; Add hint to link to the Custom Device State
exten => 6483,hint,Custom:OnLeave
6. click update then click Re-Read Configs
7. add a blf to your phone using 6483 (nite) as the extension
green = day
red = night

The above can be expanded by adding another line
exten => 6483,x,Set(DB(DAYNIGHT/Cy)=NIGHT)
exten => 6483,x,Set(DB(DAYNIGHT/Cy)=DAY)
where x = the next priority and y = the next call flow control
Make sure the priority are in order
Go to the line exten => 6483,3,GotoIf($[${togglestate} = NIGHT]]?9:4)and change the 9 to
the next priority after the first Hangup
The above was adapted from various web postings
tested on asterisk 11.10.0 freepbx 2.11.0.43 yealink T-28P
 

GerryGerry

Member
Joined
Dec 26, 2015
Messages
38
Reaction score
5
You want 1 button to send inbound routes to the same night destination but different day destinations.
One BLF on your phone to control The following three separate call flow controls (which can be expanded)

1. Build all needed Call Flow Controls
2. Open the web GUI -> Other Tab -> open Config Edit
3. Select extensions_custom.conf under /etc/asterisk
4. add the following near the top of the file after include => custom-recordme

Code:
include => set-call-flow-toggle
include => ext-local-custom
5. Go to the bottom of the file and add the following

Code:
[set-call-flow-toggle]
exten => 6483,1,Answer
exten => 6483,2,Set(togglestate=${DB(DAYNIGHT/C0)})
exten => 6483,3,GotoIf($[${togglestate} = NIGHT]]?9:4)
exten => 6483,4,Set(DB(DAYNIGHT/C0)=NIGHT)
exten => 6483,5,Set(DB(DAYNIGHT/C1)=NIGHT)
exten => 6483,6,Set(DB(DAYNIGHT/C2)=NIGHT)
exten => _X.,7,Set(DEVICE_STATE(Custom:OnLeave)=InUse)
exten => 6483,8,Hangup
exten => 6483,9,Set(DB(DAYNIGHT/C0)=DAY)
exten => 6483,10,Set(DB(DAYNIGHT/C1)=DAY)
exten => 6483,11,Set(DB(DAYNIGHT/C2)=DAY)
exten => _X.,12,Set(DEVICE_STATE(Custom:OnLeave)=Not_InUse)
exten => 6483,13,Hangup



[ext-local-custom]
; Add hint to link to the Custom Device State
exten => 6483,hint,Custom:OnLeave
6. click update then click Re-Read Configs
7. add a blf to your phone using 6483 (nite) as the extension
green = day
red = night

The above can be expanded by adding another line
exten => 6483,x,Set(DB(DAYNIGHT/Cy)=NIGHT)
exten => 6483,x,Set(DB(DAYNIGHT/Cy)=DAY)
where x = the next priority and y = the next call flow control
Make sure the priority are in order
Go to the line exten => 6483,3,GotoIf($[${togglestate} = NIGHT]]?9:4)and change the 9 to
the next priority after the first Hangup
The above was adapted from various web postings
tested on asterisk 11.10.0 freepbx 2.11.0.43 yealink T-28P
Perfect, thank you so much it's just what I was after
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,571
Messages
138,926
Members
14,674
Latest member
gnordli