[Freeswitch-users] Unable to get channel variables from directory to dialplan.

Artur Mega findmeinwland at gmail.com
Thu Aug 27 17:26:26 MSD 2015


​i was wrong)
with brackets ​<action application="log" data="ERR TestMessage
[${user_context}]"/> it works too in my computer

2015-08-27 18:22 GMT+05:00 Artur Mega <findmeinwland at gmail.com>:

> Hi Vlad,
> 1) try remove bakets from log, write it like <action application="log"
> data="ERR TestMessage ${user_context}"/>. I tested now, it works.
> 2) Examples of my directory:
> <user id="someid">
>                   <params>
>                     <param name="password" value="xxx"/>
>                   </params>
>                   <variables>
>                     <variable name="toll_allow"
> value="domestic,international,local" />
>                     <variable name="accountcode" value="xxx" />
>                     <variable name="user_context" value="ARTUR" />
>                     <variable name="effective_caller_id_name" value="xxx"
> />
>                     <variable name="effective_caller_id_number"
> value="xxx" />
>                     <variable name="outbound_caller_id_name"
> value="$${outbound_caller_name}" />
>                     <variable name="outbound_caller_id_number"
> value="$${outbound_caller_id}" />
>                     <variable name="sip-force-expires" value="180" />
>                   </variables>
>                 </user>
> then in dialplan
> <context name="ARTUR">
> ... extentions....
> </context>
>
> 2015-08-26 19:05 GMT+05:00 Vladislav Ivanov <deforceczt at gmail.com>:
>
>> Good Day,
>>
>> I have been trying to set up the sip phone at my home, and i'm having
>> some issues with channel variables.
>> From what I have read:
>> https://wiki.freeswitch.org/wiki/Routing_with_directory_parameters   I
>> should force per-call authentication in your sofia.xml.conf for
>> <variables> to be passed through to the dialplan. But I were unable to find
>> this option in sofia/sofia_default files.
>>
>> https://freeswitch.org/confluence/display/FREESWITCH/Channel+Variables -
>> Although here there is nothing about "per-call authentication". And I'm not
>> sure how to proceed.
>>
>> I have this directory xml:
>>
>> <include>
>>   <user id="123123">
>>     <params>
>>       <param name="password" value="123123"/>
>>     </params>
>>     <variables>
>>       <variable name="accountcode" value="123123"/>
>>       <variable name="user_context" value="test_context"/>
>>       <variable name="effective_caller_id_name" value="Test Phone"/>
>>       <variable name="effective_caller_id_number" value="123123"/>
>>       <variable name="outbound_caller_id_name"
>> value="$${outbound_caller_name}"/>
>>       <variable name="outbound_caller_id_number"
>> value="$${outbound_caller_id}"/>
>>     </variables>
>>   </user>
>> </include>
>>
>> Directory variables should be passed as ${variable} as they are channel
>> variables?
>> I have Dialplan as follows:
>>
>> <extension name="registrar_test">
>>         <condition field="destination_number" expression="^(.*)$">
>>                 <action application="log" data="ERR TestMessage
>> [${user_context}]"/>
>>                 <action application="respond" data="503 Route
>> Successfull"/>
>>         </condition>
>> </extension>
>>
>> <extension name="all_reject">
>>         <condition field="destination_number" expression="^(.*)$">
>>                 <action application="respond" data="503 No Route"/>
>>         </condition>
>> </extension>
>>
>> When I dial the call I get TestMessage [] instead of test_context.
>> Also, wrapping registrar_test extension with <context name="test_context"></context>
>> doesn't help, my call will go to "all_reject" extension.
>>
>> What do I miss?
>>
>> Best Regards,
>> Vlad
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.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
>>
>
>
>
> --
>
> Arthur
>



-- 

Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150827/7a0fd5c8/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list