mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
Modifying the behaviour of the dialplan engine
the 'data' field in action tags may now refer to variables and api functions
to be expanded at runtime.
Syntax:
$varname
${varname}
&func_name(func args)
Exception:
variables that are numeric are still expanded at dialplan compile time based on the regex eg $1 $2 etc
Example:
<extension name="1000">
<condition field="destination_number" expression="^(1000)$">
<action appplication="my_route_app" data="$1"/>
<action appplication="bridge" data="$destination"/>
</condition>
</extension>
Here the $1 is ecaluated before the call begins setting it to 1000 based on the regex ^(1000)$
$destination is evaluated on the fly in execution once the my_route_app has run and has had a
chance to set the variable 'destination' to the correct value.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2994 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -400,6 +400,14 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(char *name);
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event);
|
||||
|
||||
/*!
|
||||
\brief Expand varaibles in a string based on the variables in a paticular channel
|
||||
\param channel channel to expand the variables from
|
||||
\param in the original string
|
||||
\return the original string if no expansion takes place otherwise a new string that must be freed
|
||||
\note it's necessary to test if the return val is the same as the input and free the string if it is not.
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel, char *in);
|
||||
|
||||
// These may go away
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_raw_mode (switch_channel_t *channel, int freq, int bits, int channels, int ms, int kbps);
|
||||
|
||||
Reference in New Issue
Block a user