[asterisk-users] Simple Time of Day Branching problem

Don Kelly dk at donkelly.biz
Tue Sep 15 12:39:45 CDT 2009


I haven't used GotoIfTime with a list of days, but a couple things come to
mind.

The list syntax wasn't in earlier versions (earlier than what, I'm not
sure). The error would suggest that the version you're using doesn't
recognize lists at all.

Then I'm wondering about a logic issue.

Your hours are the same for Tuesday, Thursday and Saturday, so you've
included "tue&thu&sat." However, if the ampersand ("&") in this case is an
"and" operator, it would mean that it currently must be Tuesday and Thursday
and Saturday--an impossibility. You would want to say "tue|thu|sat" so this
branch will be taken if it's Tuesday, or it's Thursday, or it's Saturday. 

So, either the book is wrong or Asterisk has been coded to use something
that looks like "and" to mean "or."

--Don

Don Kelly

PCF Corp
People Come First
651 842-1000
888 Don Kell(y)
651 842-1001 fax

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jim Hankins
Sent: Tuesday, September 15, 2009 6:28 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Cc: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Simple Time of Day Branching problem

Yes but I also have different hours for tue,thu and wed,fri. In the  
o'reilly book
I have, it shows examples of using & to group them, but I am getting  
the error.
Sent from my iPhone

On Sep 14, 2009, at 11:25 PM, Paul Hales <pdhales at optusnet.com.au>  
wrote:

>
> It's easier to work with the closed hours then - use a goto just for
> Sunday/Monday
>
> PaulH
>
>
> James Hankins wrote:
>> Greetings folks,  new to this, trying to get the syntax correct for a
>> day of week routing.
>>
>>
>> exten => 345,1,Answer()
>> exten => 345,n,GotoIfTime(10:00-17:00|tue&thu&sat|*|*?open,345,1)
>> exten => 345,n,GotoIfTime(10:00-19:00|wed&fri|*|*?open,345,1)
>> exten => 345,n,Playback(afterhours)
>> exten => 345,n,Hangup()
>>
>> I'll get an error stating incorrect day of week "tue&thur&sat",
>> assuming none
>>
>> What is the correct syntax for this?  We have longer hours on
>> Wednesday and Fridays and we're closed Sunday/Monday
>>
>> Just trying to automate the time of day greeting etc.
>>
>> Thanks
>>
>>
>> _______________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
>> Register Now: http://www.astricon.net
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list