O'Reilly logo

FreeSWITCH 1.6 Cookbook by Giovanni Maruzzelli, Michael S Collins, Anthony Minessale II

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time-of-day routing

It is common for routing of calls to be different, depending on the time of day or day of the week. The FreeSWITCH XML dialplan has a number of parameters to allow this functionality.

Getting ready

Determine the parameters for your routing. In this example, we will define business hours as Monday through Friday from 8:00 a.m. to 5:00 p.m. Additionally, we will include a day_part variable to reflect morning (midnight to noon), afternoon (noon to 6:00 p.m.), and evening (6:00 p.m. to midnight).

How to do it...

Start at the beginning of your dialplan by following these steps:

  1. Add this extension to the beginning of your context:
    <extension name="Time of day, day of week setup" continue="true"> <condition wday="2-6" hour="8-16" break="never"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required