Ok, I set it up like this:
<extension name="CompanyIn">
   <condition field="destination_number" expression="^(8203)$" continue="true"/>
     <!-- man strftime - M-F, 9AM to 5PM -->
      <condition field="${strftime(%w)}" expression="^([1-2])$"/>
         <anti-action application="voicemail" data="default 10.11.12.25 10199"/>
      <condition field="${strftime(%H%M)}" expression="^((09|1[0-6])[0-5][0-9]|1700)$">
         <action application="set" data="call_timeout=45"/>
         <action application="set" data="domain_name=10.11.12.25"/>
         <action application="set" data="continue_on_fail=true"/>
         <action application="set" data="hangup_after_bridge=true"/>
         <action application="bridge" data="group/company@${domain_name}"/>
         <action application="answer" data=""/>
         <action application="sleep" data="1000"/>
         <action application="voicemail" data="default 10.11.12.25 10199"/>
         <anti-action application="voicemail" data="default 10.11.12.25 10199"/>
      </condition>
</extension>

But now it gives me:

2010-01-22 11:52:08.667564 [NOTICE] switch_channel.c:602 New Channel sofia/external/2680xxxx@87.54.25.116 [16baec2f-4407-df11-8fb3-000c29b7b4cb]
2010-01-22 11:52:08.800123 [INFO] mod_dialplan_xml.c:252 Processing 2680xxxx->4692xxxx in context public
2010-01-22 11:52:08.830071 [NOTICE] switch_ivr.c:1349 Transfer sofia/external/2680xxxx@87.54.25.116 to XML[8203@default]
2010-01-22 11:52:08.830071 [INFO] mod_dialplan_xml.c:252 Processing 2680xxxx->8203 in context default
2010-01-22 11:52:08.830071 [NOTICE] switch_ivr.c:1349 Transfer sofia/external/2680xxxx@87.54.25.116 to enum[8203@default]
2010-01-22 11:52:09.163439 [INFO] switch_core_state_machine.c:136 No Route, Aborting

huh


>>> Michael Collins 21-01-10 9:39 >>>


On Wed, Jan 20, 2010 at 2:45 AM, mailinglist <mailinglist@fribert.dk> wrote:
Hi Michael

It's running on pfsense, so it's kinda locked to the version it currently is.
Looks very nice though.
Looking beyond that, is the action / anti-action list corrent?

I would say that you need to add an anti-action under the day of week check and go to vm if it does not match. Right now if the DOW is 0 or 6 then the entire extension will "fail" and the dialplan will just move on. Remember that if any conditions fail then the entire thing extension "fails" unless you are doing interesting things with the break= parameter. See the dialplan page on the wiki for examples of how to use break in your conditions.
-MC


Best regards
Fribse


>>> Michael Collins 20-01-10 1:53 >>>


On Tue, Jan 19, 2010 at 9:02 AM, mailinglist <mailinglist@fribert.dk> wrote:
I have a very small one man constultancy company that has the occasional call, unfortunately we are getting more spam calls after hours than real calls during work hours, so I would like to set up a TOD system.
 
First step for me is just playing with the TOD example, I've gotten this far:
 
<extension name="CompanyTOD" continue="true">
   <condition field="destination_number" expression="^(8203)$"/>
      <!-- man strftime - M-F, 9AM to 5PM -->
      <condition field="${strftime(%w)}" expression="^([1-5])$"/>
      <condition field="${strftime(%H%M)}" expression="^((09|1[0-6])[0-5][0-9]|1700)$">
         <action application="set" data="call_timeout=45"/>
         <action application="set" data="domain_name=10.11.12.25"/>
         <action application="set" data="continue_on_fail=true"/>
         <action application="set" data="hangup_after_bridge=true"/>
         <action application="bridge" data="group/company@${domain_name}"/>
         <action application="answer" data=""/>
         <action application="sleep" data="1000"/>
         <action application="voicemail" data="default 10.11.12.25 10199"/>
         <anti-action application="voicemail" data="default 10.11.12.25 10199"/>
      </condition>
</extension>
My idea with this, was that in the time 9-17 mon-fri, it rings, the rest of the time it's sent directly to the voicemail.
I would of course like to have it not take messages outside work hours, but that's just refining :-)
 
But it picks up the call, and then nothing...
 
We have a much cleaner way of doing TOD and DOW handling. You'll need to get to the latest FreeSWITCH version. Look in conf/dialplan/default.xml for this example:

    <!-- Example of doing things based on time of day.

     year = 4 digit year. Example year="2009"
     yday = 1-365
     mon = 1-12
     mday = 1-31
     week = 1-52
     mweek= 1-6
     wday = 1-7
     hour = 0-23
     minute = 0-59
     minute-of-day = 1-1440
     
     Example:
     <condition minute-of-day="540-1080"> (9am to 6pm EVERY day)
     do something ...
     </condition>
    -->
    <extension name="tod_example" continue="true">
      <condition wday="2-6" hour="9-18">
        <action application="set" data="open=true"/>
      </condition>
    </extension>


Use that condition instead of the two conditions you're now using and see if you have better success.

-MC

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org