VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
alex.gusak at gmail.com Guest
|
Posted: Wed Apr 29, 2009 9:34 am Post subject: [Freeswitch-users] Condition and custom variables |
|
|
Hello.
Can I use custom variables in the condition field?
For example if i set my custom var ${forward_all} and continue search extensions
<condition field="${forward_all}" .../> not work even if the condition is met
and call does not go in the uplink.
Or, in the condition I can use only variables freeswitch like ${sip_from_user}?
Is it possible to use custom variables?
<extension name="set-vars" continue="true">
<condition>
<action application="set" data="forward_all=123456789"/>
</condition>
</extension>
<extension name="call">
<condition field="${forward_all}" expression="^(\d{8,9,10})$" break="on-true">
...
<action application="bridge" data="sofia/gateway/uplink/${forward_all}"/>
<action application="hangup"/>
</condition>
<condition field="destination_number" expression="^(.*)$">
...
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
<action application="hangup"/>
</condition>
</extension>
--
Alex Gusak
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Wed Apr 29, 2009 10:00 am Post subject: [Freeswitch-users] Condition and custom variables |
|
|
OK let me explain this for the 100th time.
The dialplan isn't executed line by line. The dialplan is just a compiled list of instructions to execute but its execution doesn't take place until the session enters the execute state. So your set forward_all=xxxx hasn't happened yet. BUT you can use execute_extension or transfer to send the session back into the dialplan to re-evaluate the the list of things to do based on certain conditions you previously set.
/b
On Apr 29, 2009, at 9:30 AM, Alex Gusak wrote:
Quote: | Hello.
Can I use custom variables in the condition field?
For example if i set my custom var ${forward_all} and continue search extensions
<condition field="${forward_all}" .../> not work even if the condition is met
and call does not go in the uplink.
Or, in the condition I can use only variables freeswitch like ${sip_from_user}?
Is it possible to use custom variables?
<extension name="set-vars" continue="true">
<condition>
<action application="set" data="forward_all=123456789"/>
</condition>
</extension>
<extension name="call">
<condition field="${forward_all}" expression="^(\d{8,9,10})$" break="on-true">
...
<action application="bridge" data="sofia/gateway/uplink/${forward_all}"/>
<action application="hangup"/>
</condition>
<condition field="destination_number" expression="^(.*)$">
...
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
<action application="hangup"/>
</condition>
</extension>
--
Alex Gusak |
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com |
|
Back to top |
|
|
mike at jerris.com Guest
|
Posted: Wed Apr 29, 2009 10:20 am Post subject: [Freeswitch-users] Condition and custom variables |
|
|
There should be several archive threads on this including:
http://n2.nabble.com/Using-Variables-in-Dialplans-tt2678222.html#a2678222
Mike
On Apr 29, 2009, at 10:30 AM, Alex Gusak wrote:
Quote: | Hello.
Can I use custom variables in the condition field?
For example if i set my custom var ${forward_all} and continue search extensions
<condition field="${forward_all}" .../> not work even if the condition is met
and call does not go in the uplink.
Or, in the condition I can use only variables freeswitch like ${sip_from_user}?
Is it possible to use custom variables?
<extension name="set-vars" continue="true">
<condition>
<action application="set" data="forward_all=123456789"/>
</condition>
</extension>
<extension name="call">
<condition field="${forward_all}" expression="^(\d{8,9,10})$" break="on-true">
...
<action application="bridge" data="sofia/gateway/uplink/${forward_all}"/>
<action application="hangup"/>
</condition>
<condition field="destination_number" expression="^(.*)$">
...
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
<action application="hangup"/>
</condition>
</extension>
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|