[Freeswitch-users] Home setup with home company
Michael Collins
msc at freeswitch.org
Tue Jan 19 16:41:40 PST 2010
On Tue, Jan 19, 2010 at 9:02 AM, mailinglist <mailinglist at 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}"/<group/company@$%7Bdomain_name%7D%22/>
> >
> <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100119/3a9e3b22/attachment-0001.html
More information about the FreeSWITCH-users
mailing list