FreeSWITCH 1.8
上QQ阅读APP看书,第一时间看更新

Adding a new user to the directory

The demo example configuration file layout is organized to make it easy to add and remove users. We saw that in the /usr/local/freeswitch/conf/directory/default.xml file, inside the predefined default domain, in group "default", there is an instruction to the FreeSWITCH configuration pre-processor to read in all of the XML files contained in the /usr/local/freeswitch/conf/directory/default/ directory. Those files contain the users' definitions.

We found the files 1000.xml ... 1019.xml, the 20 demo predefined users with "id" 1000 to 1019. There you can find also some other XML files, very well commented, that can be source of inspiration.

In our demo configuration case, adding a user is done simply by copying 1000.xml to, let's say, 1020.xml, and then editing the newly created XML file.

In your text editor, search and replace all string occurrences of "1000" to be "1020":

That's it. We just created, by adding this file in that directory, a new user with all the same attributes of the user with "id" 1000. That is, same "callgroup", same "toll_allow", and so on. We only changed its "id", its voice mail password, its "accountcode" and "effective_caller_id_name" all of them to be the "1020" string. From FreeSWITCH command line (fs_cli), we need to reload configuration for the new user to become known to FreeSWITCH:

    reloadxml