"Preprocessor" Variables

Those are the variables indicated by the syntax $${varname}. In a way, those are not actual variables, but they act as read-only ones. You assign them in one of the FreeSWITCH configuration files (/usr/local/freeswitch/conf/vars.xml), and then they are literally substituted at startup when encountered. This is exactly the same as the #define construct in C preprocessor, or a "Find and Replace" command in a text editor.

<X-PRE-PROCESS cmd="set" data="hold_music=local_stream://moh"/>

In this example, by editing the vars.xml configuration file you alter the value that will be substituted in all configuration files (dialplan included) when "$${hold_music} " is encountered. If you then write in dialplan:

<action application="set" data="mystring=$${hold_music}"/>

it would be exactly the same as if you wrote:

<action application="set" data="mystring=local_stream://moh"/>

Because this is actually a text search and replace procedure that is done once at FreeSWITCH startup, if you change a preprocessor variable in vars.xml you MUST restart FreeSWITCH in order to activate the changes (in this case reloading the configuration without restarting FreeSWITCH is not enough).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset