Configuration Recipes
About
The intention of this page is to come up with a series of 'recipes' which describe how to do various 'standard' tasks in FreeSWITCH. The hope is that enough of a functional description of the process is given, perhaps with examples, so that a new user can setup FreeSWITCH using these recipes as a basis much faster than trying to read all the documentation. FreeSWITCH is complex so there may be many ways to solve these problems, but these descriptions and examples should hopefully provide a good starting point or reference different techniques.
Click here to expand Table of Contents
- 1 Start with an empty configuration
- 2 Configure the sofia user agents (where freeswitch will listen for calls)
- 3 Configure extensions
- 4 Configure gateways for making outgoing calls
- 5 Configure call groups
- 6 Configure incoming calls from gateways
- 7 Configure voicemail
Start with an empty configuration
Right now there is no empty configuration. The the best way to create an empty configuration is to clean out the default configuration. Many entries in the default configuration are good so follow the next steps to clean out what is not needed.
Note: an empty configuration may not necessarily be an empty conf/ directory but simply a configuration where there are no user agents active, where no extensions are configured, and no gateways are active. This configuration would of course not be useful for anything except applying further recipes to provide more functionality.
Note: as will be apparent this page is work in progress and needs to be completed.
Configure the sofia user agents (where freeswitch will listen for calls)
Configure extensions
The extensions in the default configuration are configured by adding entries in directory/default/<extension_number>.xml.
The format of these files can be seen by the example configurations in directory/default/1000.xml to directory/default/1019.xml.
Limiting extensions to register call from local networks
If you want to limit registration and usage of these extensions to your local network you can add the option:
<include>
<user id="xxx">
<params>
...
<param name="auth-acl" value="localnet.auto"/>
</params>
...
</include>
This requires the following entry in sip_profiles/internal.xml:
<param name="auth-calls" value="true"/>
Configure gateways for making outgoing calls
Configure call groups
Call groups are a way in which you can treat a group of extensions together, and then via that name call them all together. This recipe tries to explain how you can add a new call group using the default configuration. This assumes you have several extensions configured and want to create a new call group number through which these extensions can be called.
First add the call group name into the directory/default/<extension_number>.xml:
<include>
<user id="xxxx">
<params>
...
</params>
<variables>
...
<variable name="callgroup" value="<call_group_name>"/>
</variables>
</user>
</include>
In directory/default.xml:
<groups>
<group name="<call_group_name>">
<users>
<user id="user_id1" type="pointer"/>
<user id="user_id2" type="pointer"/>
...
<user id="user_idn" type="pointer"/>
</users>
</group>
</groups>
Finally to use the call group you need something like:
In dialplan/default.xml:
<extension name="group_extension_name">
<condition field="destination_number" expression="^12345$">
<action application="bridge" data="group/<call_group_name>@${domain_name}"/>
</condition>
</extension>
Dialing the numbers in the call group can be done in many ways. See ... for more details.
Configure incoming calls from gateways
Configure voicemail
Configure voicemail so it doesn't ask you for your extension
If you call the voicemail extension then it asks you to provide your extension number and password. However, in most cases, and this is especially true of mobile phone networks, if the PBX is able to recognize an authenticated caller this should not be necessary and it would be convenient if you directly bypass the authentication phase and get a list of messages in your voicemail box.