I’m trying to setup Asterisk to only allow outbound calling during certain hours. After hours works as it should, but normal hours it fails. It looks like it’s not passing the dialed number to the outbound context.
-- Executing [469xxxxxxx@internal-kids:1] GotoIfTime("SIP/301-00000002", "08:00-21:59,sun-thu,*,*?internal-kids-out,s,1") in new stack
-- Goto (internal-kids-out,s,1)
-- Executing [s@internal-kids-out:1] Set("SIP/301-00000002", "CALLERID(all)="My Name" <469xxxxxx>") in new stack
-- Executing [s@internal-kids-out:2] Dial("SIP/301-00000002", "SIP/1s@VoIPms") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/1s@VoIPms
== Everyone is busy/congested at this time (1:0/0/1)
Here is the extensions.conf
[internal-kids-out]
exten => _1NXXNXXXXXX,1,Set(CALLERID(all)="My Name" <469xxxxxxx>)
exten => _1NXXNXXXXXX,2,Dial(SIP/${EXTEN}@VoIPms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Set(CALLERID(all)="My Name" <469xxxxxxx>)
exten => _NXXNXXXXXX,2,Dial(SIP/1${EXTEN}@VoIPms)
exten => _NXXNXXXXXX,n,Hangup()
[internal-kids]
exten => _214xxxxxxx,1,Set(CALLERID(all)="My Name" <469xxxxxxx>)
exten => _214xxxxxxx,2,Dial(SIP/1${EXTEN}@VoIPms)
exten => _1214xxxxxxx,1,Set(CALLERID(all)="My Name" <469xxxxxxx>)
exten => _1214xxxxxxx,2,Dial(SIP/1${EXTEN}@VoIPms)
exten => _3XX,1,Dial(SIP/${EXTEN})
exten => _3XX,2,Hangup()
exten => _1NXXNXXXXXX,1,GotoIfTime(08:00-21:59,sun-thu,*,*?internal-kids-out,s,1)
exten => _1NXXNXXXXXX,2,GotoIfTime(09:00-23:59,fri&sat,*,*?internal-kids-out,s,1)
exten => _1NXXNXXXXXX,3,Goto(bedtime,s,1)
exten => _NXXNXXXXXX,1,GotoIfTime(08:00-21:59,sun-thu,*,*?internal-kids-out,s,1)
exten => _NXXNXXXXXX,2,GotoIfTime(09:00-23:59,fri&sat,*,*?internal-kids-out,s,1)
exten => _NXXNXXXXXX,3,Goto(bedtime,s,1)
include => parked-calls
[bedtime]
exten => s,1,Answer()
exten => s,2,Playback(what-time-it-is2)
exten => s,3,Playback(goodbye)
exten => s,4,Hangup()