user dial-string getting variables
Hi, Is it possible to access a variable that is passed per channel, in some script called in the directory.xml, parameter dial-string? I need to be able to set the var1 dynamically from the dialplan, so i can parse it from my lua script. Using the set command directly it will set the variables for both channels. For example, I dialed two users: <extension name="test" continue="false"> <condition field="destination_number" expression=".*"> <action application="bridge" data="[leg_timeout=60,var1=555]user/100@default.com|[leg_timeout=60,var1=777]user/101@default.com"/> </condition> </extension> then in my directory.xml, i have: <param name="dial-string" value="${lua(dial.lua ${dialed_user} ${dialed_domain} ${var1})}"/> So when the return dial-string for the user 100 has it's own var1, and when dial the user 102 has another value. I already try to uuid_dump in dial.lua, but i can't see the variable var1... Using this method, [var1=value], it will set the variable var1 for the B channel, but can i access it from the A channel? Or is there another way to set this variables before processing the dial-string... Thanks, António -- Un cordial saludo / Best regards, _________________________ António Silva E-mail:asilva@wirelessmundi.com
Sorry for the late reply... Did you figure this one out yet? I think you can set the uuid of the b-leg to a known value and then do a uuid_dump (or whatever) to check stuff on that uuid: <action application="set" data="new_uuid=${create_uuid}" inline="true"/> <action application="bridge" data="{origination_uuid=${new_uuid}[leg_timeout=60,var1= 555]user/100@default.com <100@commsmundi.com>|[leg_timeout=60,var1=777]user/ 101@default.com"/> You will have ${new_uuid} on the A leg which contains the B leg uuid. I suppose you could also skip the create_uuid/origination_uuid thing and just use the value in ${signal_bond}. However, personally, I like creating the uuid beforehand and knowing what the B leg's uuid will be. In any case, you can do a uuid_dump XXXX where XXXX is whatever is in ${new_uuid} (or in ${signal_bond}) Let us know what happens. -MC On Tue, Mar 6, 2012 at 11:21 AM, Antonio <asilva@wirelessmundi.com> wrote:
** Hi,
Is it possible to access a variable that is passed per channel, in some script called in the directory.xml, parameter dial-string?
I need to be able to set the var1 dynamically from the dialplan, so i can parse it from my lua script.
Using the set command directly it will set the variables for both channels.
For example, I dialed two users:
<extension name="test" continue="false"> <condition field="destination_number" expression=".*"> <action application="bridge" data="[leg_timeout=60,var1=555]user/ 100@default.com <100@commsmundi.com>|[leg_timeout=60,var1=777]user/ 101@default.com"/> </condition> </extension>
then in my directory.xml, i have:
<param name="dial-string" value="${lua(dial.lua ${dialed_user} ${dialed_domain} ${var1})}"/>
So when the return dial-string for the user 100 has it's own var1, and when dial the user 102 has another value.
I already try to uuid_dump in dial.lua, but i can't see the variable var1...
Using this method, [var1=value], it will set the variable var1 for the B channel, but can i access it from the A channel? Or is there another way to set this variables before processing the dial-string...
Thanks, António
--
Un cordial saludo / Best regards,
_________________________
António Silva
E-mail:asilva@wirelessmundi.com
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
participants (2)
-
Antonio
-
Michael Collins