[Freeswitch-users] Unable to access variables set in directory from the dialplan
Iskren Hadzhinedev
iskren.hadzhinedev at ikiji.com
Mon Mar 17 21:37:22 MSK 2014
"local" is a valid regex for "local,international" and it matches
correctly if I use user_data(${sip_from_uri} var toll_allow) instead of
${toll_allow}. The problem is that ${toll_allow} evaluates to an empty
string in the dialplan as opposed to ${user_data(${sip_from_uri} var
toll_allow)} which returns the correct result. I already have a
debugging extension that uses application "info" and there are no
variables from the directory at all.
Kind regards,
Iskren
On 17.3.2014 г. 20:16, mbo wrote:
> You set variable toll_allow to the string „local,international“ but you’re matching the condition only to the string „local“.
>
> you can put something like:
>
> <extension name="Debug">
> <condition>
> <action application="log" data="INFO toll_allow: ${toll_allow}" />
> </condition>
> </extension“>
>
> in your dial plan to see if the variable is set.
>
> Thanks
>
> Markus
>
>
>
>
>
> Am 17.03.2014 um 16:02 schrieb Iskren Hadzhinedev <iskren.hadzhinedev at ikiji.com>:
>
>> Greetings!
>> I'm unable to access user variables that are set in the directory from
>> the dialplan.
>> The setup is quite simple, the user is:
>> --
>> <user id="611">
>> <params>
>> <param name="a1-hash"
>> value="693c2978ddbe62f7129b7e551bcf7d49"/>
>> <param name="vm-enabled" value="true"/>
>> <param name="vm-a1-hash"
>> value="126003cf36e8e6a69ecdbfd1bba121c8"/>
>> </params>
>> <variables>
>> <variable name="toll_allow"
>> value="local,international"/>
>> <variable name="user_context"
>> value="sip.test.com"/>
>> <variable name="effective_caller_id_name"
>> value="Tester"/>
>> <variable name="effective_caller_id_number"
>> value="611"/>
>> </variables>
>> </user>
>> --
>> And the extension in the dialplan is:
>> --
>> <extension name="Outgoing Test">
>> <condition field="${toll_allow}" expression="local"/>
>> <condition field="destination_number" expression="^([0-9]{6})$">
>> <action application="bridge" data="sofia/gateway/testgw/$1"/>
>> </condition>
>> </extension>
>> --
>>
>> The toll_allow always gets evaluated to an empty string, and when I
>> actually run the info application I don't see any of the variables that
>> are set. If I replace the ${toll_allow} with ${user_data(${sip_from_uri}
>> var toll_allow}, everything is working, although the examples in the
>> wiki are showing that you can use those variables just fine without
>> invoking user_data.
>> What am I doing wrong?
>> Thanks!
>> ----
>> Kind regards,
>> Iskren
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>>
>>
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list