User features
Let's begin by looking at the XML file that defines a user. Locate the file conf/directory/default/1000.xml
and open it in an editor. You should see a file like the following:
<include> <user id="1000"> <params> <param name="password" value="$${default_password}"/> <param name="vm-password" value="1000"/> </params> <variables> <variable name="toll_allow" value="domestic,international,local"/> <variable name="accountcode" value="1000"/> <variable name="user_context" value="default"/> <variable name="effective_caller_id_name" value="Extension 1000"/> <variable name="effective_caller_id_number" value="1000"/> <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/> <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/> <variable name="callgroup" value="techsupport"/> </variables> </user> </include>
The XML structure of a user is simple. Within the <include>
tags the user has the following:
- The
user
element with theid
attribute - The
params
element, wherein parameters are specified - The
variables
element, wherein channel variables are defined
Even before we know what many of the specifics mean, we can glean from this file that the user ID is 1000 and that there is both a password and a vm-password
. In this case, the password
parameter refers to the SIP authorization password. (We discussed this in the Configuring a SIP phone to work with FreeSWITCH section in Chapter 3, Test Driving the Example Configuration.) The expression $${default_password}
refers to the value contained in the global variable default_password
, which is defined in the conf/vars.xml
file. If you surmised that vm-password
means voicemail password then you are correct. This value refers to the digits that the user needs to dial when logging in to check his or her voicemail messages. The value of id
is used both as the authorization username and the SIP username.
Additionally, there are a number of channel variables that are defined for this user. Most of these are directly related to the default Dialplan. The following table lists each variable and what it is used for:
In summary, a user in the default configuration has the following:
- A username for SIP and for authorization
- A voicemail password
- A means of allowing/restricting dialing
- A means of handling caller ID being sent out
- Several arbitrary variables that can be used or ignored as needed
Let's now add a new user to our directory.