Hi every one.
I am using asterisk v1.4.18.
I use softphone Eyebeam to call.
Here is my dialplan :
exten => 123,1,Goto(123,s,1)
[123]
exten => s,1,GotoIfTime(10:00-10:45|*|*|*?s|2)
exten => s,2,Monitor(wav,test,m)
exten => s,3,Background(custom/mix/aoluahadong)
exten => s,4,StopMonitor()
exten => 1,1,StopMonitor()
Now is 11.40. And here is output :
Verbosity is at least 3
-- Executing [123@from-sip:1] Goto("SIP/101-085ba4c0", "123|s|1") in new stack
-- Goto (123,s,1)
-- Executing [s@123:1] GotoIfTime("SIP/101-085ba4c0", "10:00-10:45|*|*|*?s|2") in new stack
-- Executing [s@123:2] Monitor("SIP/101-085ba4c0", "wav|test|m") in new stack
-- Executing [s@123:3] BackGround("SIP/101-085ba4c0", "custom/mix/aoluahadong") in new stack
-- <SIP/101-085ba4c0> Playing 'custom/mix/aoluahadong' (language 'en')
== CDR updated on SIP/101-085ba4c0
-- Executing [1@123:1] StopMonitor("SIP/101-085ba4c0", "") in new stack
== Auto fallthrough, channel 'SIP/101-085ba4c0' status is 'UNKNOWN'
localhost*CLI>
So, the GotoIfTime doesn’t work. Do i miss something to make it works.
You didn’t specify an action for false condition, therefore default behavior is goto the next priority.
Still not work :
exten => s,1,GotoIfTime(10:00-10:45|*|*|*?2:5)
exten => s,2,Monitor(wav,test,m)
exten => s,3,Background(custom/mix/aoluahadong)
exten => s,4,StopMonitor()
exten => s,5,SayDigits(123456)
exten => 1,1,StopMonitor()
Check your actual system time.
voip-info.org/wiki/view/Aste … GotoIfTime
exten => s,1,GotoIfTime(9:00-17:00|mon-fri||?2:5)
Try that. I just copy and paste it from the link above and changed it a little. Maybe you have a syntax error that’s not obvious by looking at it. So just copy and paste what I wrote and try it.
[quote=“supertle”]Check your actual system time.
voip-info.org/wiki/view/Aste … GotoIfTime
exten => s,1,GotoIfTime(9:00-17:00|mon-fri||?2:5)
Try that. I just copy and paste it from the link above and changed it a little. Maybe you have a syntax error that’s not obvious by looking at it. So just copy and paste what I wrote and try it.[/quote]
I copied anh try but It didn’t go to 5. I don’t think that i have wrong syntax, hu hu . Maybe because of the RealTime, i don’t know ???
Hi all, I’ve fixed my problem.
The http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime say that the ‘|’ character will be changed to ‘,’ in Asterisk version 1.6. But, my Asterisk is v1.4.18. And when I change it like this :
exten => s,1,GotoIfTime(9:00-16:00,mon-fri,*,*?5)
exten => s,2,Monitor(wav,test,m)
exten => s,3,Background(custom/mix/aoluahadong)
exten => s,4,StopMonitor()
exten => s,5,SayDigits(123456)
exten => 1,1,StopMonitor()
exten => 2,1,AGI(cmptime.agi)
and it works fines.
Thank you for help. :mrgreen: