[Freeswitch-users] Business/holiday hours routing

Seven Du dujinfang at gmail.com
Mon Nov 23 17:43:13 PST 2009


XML has basic conditioning, but lua rocks.

-- Time condition for sales 1

--session:setAutoHangup(false)

function do_transfer(extn)

        --print(extn)
        session:transfer(extn, "XML", "sales")
end


now = os.date("%H:%M")
w = tonumber(os.date("%w"))

if w >= 1 and w <=5 then

    if ( now >= "09:00" and now < "20:30" ) then
                do_transfer("sales_fifo_1")
        elseif ( now >= "20:30" and now < "22:30" ) then
                do_transfer("sales_fifo_2")
        else
                do_transfer("sales_fifo_cellphone")
        end

else

        if ( now >= "10:00" and now < "19:00" ) then
                do_transfer("sales_fifo_1")
        elseif (now >= "20:00" and now < "22:30" ) then
                do_transfer("sales_fifo_2")
        else
                do_transfer("sales_fifo_cellphone")
        end
end


2009/11/24 Adam Ford <lists at redbonez.net>

>  Is there a standard module for FreeSWITCH out there that people use for
> routing calls based on business hours and a holiday schedule? Or is everyone
> just creating their own in the XML dialplan?(which seems pretty simple)
>
>
>
> I can’t seem to find anything on the wiki, but might just be searching for
> the wrong thing.  I am relatively new at FreeSWITCH and would rather follow
> what the community has decided is the best practice, instead of trying to
> reinvent the wheel myself.
>
>
>
> Thanks for any input,
>
> -Adam
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20091124/98e25335/attachment-0002.html 


More information about the FreeSWITCH-users mailing list