Dialplan Basics

From FreeSWITCH Wiki
Jump to: navigation, search



FreeSWITCH has a very flexible way of making your dialplan including XML, scripting in Lua, JavaScript, and from a DB, using mod_xml_curl and Asterisk compatibility using mod_dialplan_asterisk.

Getting Started

FreeSWITCH dialplan is divided in 4 things:

  • context
    • extension
      • condition
        • application


dialplan context is a way to group your extensions in one place and restrict users from dialing it, or give users only a very specific numbers to dial like in a large company, not just any user can dial international or even long distance call, only internal or local calls.


context can be assigned to a user in a directory, to a Sofia profile, a Sofia gateway or to any FreeSWITCH supported endpoint.

See also: modules

Context Example

 <!-- include this file into the dialplan -->
 <!-- declaring our context -->
   <context name="public">



dialplan extension is a group of instructions to route a call to a specific application or destination like international call, local call, Voice Mail or IVR.


conditions are used to determine what destination is dialed.

FreeSWITCH use regular expression aka regex for determining the dialed extension.


conditions are not used only for destinations, but for any Channel Variables including caller id name, caller id number, Sofia profile and any other variables.

Regular Expression Examples

^1234$ == destination 1234


dialplan actions is wrapped into conditions to run the needed applications including bridging calls, running IVRs, transferring to other extensions, playing music or anything.

See Also