Real-time sip users scenario: Dial plan not not executing as per requirement

Dear asterisk users, i am trying to dial an extension 03111308308 and want a time check to be perfomed. if the time is between 09 to 5 (regular office hours) then it should go to open context and then an IVR should be played but my configuration is not working properly.

following is my extenisons.conf file.

exten =>03111308308,1,MixMonitor(callrecording.wav,b)
same => n,GotoIfTime(9:00-17:00,mon-fri,,?open)

same =>2,1,Queue(support,120)

asterisk cli

0x7f9b8c016bf0 – Strict RTP learning after remote address set to:
– Executing [03111308308@my-sip:1] MixMonitor(“SIP/3000-00000006”, “callrecording.wav,b”) in new stack
– Executing [03111308308@my-sip:2] GotoIfTime(“SIP/3000-00000006”, “9:00-17:00,mon-fri,,?open”) in new stack
– Auto fallthrough, channel ‘SIP/3000-00000006’ status is ‘UNKNOWN’
== Begin MixMonitor Recording SIP/3000-00000006
== MixMonitor close filestream (mixed)
== End MixMonitor Recording SIP/3000-00000006

@jcolp my dial-plan in not executing in the open context as i have defined the context in the sip.conf as my-sip. How to change it to execute dial-plans from all contexts? I need your help please.

This is my sip.conf file.


You can specify what context to go to in your GotoIfTime.

Below I changed your code so it goes to the ‘open’ context ‘s’ extension priority ‘1’

I also re-wrote your open context so it was valid, Please note the changes from ‘same’ to ‘exten’

exten => 03111308308,1,MixMonitor(callrecording.wav,b)
 same => n,GotoIfTime(9:00-17:00,mon-fri,,?open,s,1)
exten => s,1,Background(2)
 same => n,WaitExten(10)
exten => 1,1,Dial(SIP/03111308309,20)
exten => 2,1,Queue(support,120)
1 Like

Thank you. My problem got resolved. Actually my system was not running a 24 hour clock that was creating a problem.