Enable ALL day/night instances at the same time

I have a system where I want to enable afterhours to go to different outside cellphones. There is no pattern for who is going to be on call.
I’ve been thinking about having a Day/Night instance for each on call person and hit that *28X at the end of the day and then have a feature code resetting all Day/night instances in the morning to “day”. So far I setup instances *282, *283, *284 and *285 and I added the following into extensions_custom.conf with no luck… when I dial *987 to reset everything, it doesn’t reset them:

[app-daynight-toggle-custom]
exten => *987,1,Answer
exten => *987,n,Wait(1)
exten => *987,n,Set(DB(DAYNIGHT/C2})=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT2)=NOT_INUSE)
exten => *987,n,Set(DB(DAYNIGHT/C3})=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT3)=NOT_INUSE)
exten => *987,n,Set(DB(DAYNIGHT/C4})=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT4)=NOT_INUSE)
exten => *987,n,Set(DB(DAYNIGHT/C5})=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT5)=NOT_INUSE)
exten => *987,n,Playback(beep&silence/1&day&reception&digits/7&enabled)
exten => *987,n,Hangup

NOTE: I just set the digit to say “7” (&digits/7) to identify the recording…

The idea is to keep it simple to the responsable at the end of the day and a the begining of the day.

Any out of the box ideas?

Thanks

Ok, it works great when look at it twice and I find out that there is an extra “}” that i don’t need.

Sorry guys, thanks, and here is the correct app:

[app-daynight-toggle-custom]
exten => *987,1,Answer
exten => *987,n,Wait(1)
exten => *987,n,Set(DB(DAYNIGHT/C2)=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT2)=NOT_INUSE)
exten => *987,n,Set(DB(DAYNIGHT/C3)=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT3)=NOT_INUSE)
exten => *987,n,Set(DB(DAYNIGHT/C4)=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT4)=NOT_INUSE)
exten => *987,n,Set(DB(DAYNIGHT/C5)=DAY)
exten => *987,n,Set(DEVSTATE(Custom:DAYNIGHT5)=NOT_INUSE)
exten => *987,n,Playback(beep&silence/1&day&reception&enabled)
exten => *987,n,Hangup

you include this at the end of your extensions_custom.conf using whatever "*987 that you know it’s not being used by another application and that will set day mode for all the listed day/night instances.

My scenario:

I am creating 4 different day night instances and I will have my incoming DID to redirect to the first while chaining them like conditions:

1- (*282)
Day goes to 2 (*283)
Night goes to External phone on call 1

2- (*283)
Day goes to 3 (*234)
Night goes to External phone on call 2

3- (*234)
Day goes to 4 (*285)
Night goes to External phone on call 3

4- (*285)
Day goes to Main Day IVR or queue or whatever the main incoming route is
Night goes to External phone on call 4

The main receptionist is trained to select between *282, *283, *284, *285 depending on “who is on call”. And during the morning they dial *987 to enable Day mode on eveything redardless of who was on call last night.

Comments?