[Freeswitch-users] How to export variable downstream on execute_on_answer?

Jurijs Ivolga jurijs.ivolga at gmail.com
Fri Aug 11 06:24:32 UTC 2017


Hi Loi,

You can try to use uuid_setvar and set a variable for specific call.

https://freeswitch.org/confluence/display/FREESWITCH/Channel+Variables#ChannelVariables-AccessingChannelVariablesinOtherEnvironments

I hope this will help.

With kind regards,

Jurijs

On Thu, Aug 10, 2017 at 3:40 PM, Lợi Đặng <loi.dangthanh at gmail.com> wrote:

> Hi Vladyslav,
> many thanks for your reply, but I don't want the Caller receive my custom
> header(s), so I intend to disable the copying.
>
> I just want to export a flag variable to the channel so that I could
> retrieve it later.
>
> rgds,
> Loi Dang
>
> Loi Dang Thanh
> Phone : +84. 1224.735.448
> Email : loi.dangthanh at gmail.com
>
> On Thu, Aug 10, 2017 at 6:32 PM, Vladyslav Zakhozhai <
> v.zakhozhai at gmail.com> wrote:
>
>> Hello,
>>
>> https://wiki.freeswitch.org/wiki/Variable_sip_copy_custom_headers
>>
>> I'm not sure but this link may help you.
>>
>> On Thu, Aug 10, 2017 at 2:24 PM, Lợi Đặng <loi.dangthanh at gmail.com>
>> wrote:
>>
>>> Hi guys, I have a simple call scenario:
>>> *Caller -> FS -> Callee*
>>> Callee answer the call with an additional header called X-MyVar in 200
>>> OK. I'm trying to store that value only for reporting via
>>> CHANNEL_HANGUP_COMPLETE - event socket.
>>>
>>> I'm retrieving that custom header by looking at ${sip_rh_X-MyVar} via
>>> *execute_on_answer* on B leg, and it's fine. But I'm unable to export
>>> it to the A leg.
>>> Here's my dialplan:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *<extension name="logvar">    <condition field="destination_number"
>>> expression="^logvar$">        <action application="export"
>>> data="myvar=${sip_rh_X-MyVar}"/>    </condition></extension><action
>>> application="bridge" data="{execute_on_answer=execute_extension logvar XML
>>> external}sofia/external/${destination_number}"/>*
>>>
>>> I don't want X-MyVar header to be passed to Caller, so I have to export
>>> the variable.
>>> But when CHANNEL_HANGUP_COMPLETE fires, the variable *variable_myvar*
>>> present only in the outbound B leg. Look like my export did not work.
>>> Note that I have some upstream exports from A leg to B leg in normal XML
>>> dialplan and they're all fine.
>>>
>>> Below is my fs_cli log: 192.168.1.100 is my FS.
>>>
>>>
>>>
>>> *Dialplan: sofia/external/400 at 192.168.1.100:5060
>>> <http://400@192.168.1.100:5060> Action
>>> export(myvar=${sip_rh_X-MyVar})2017-08-10 17:27:29.958572 [NOTICE]
>>> switch_core_session.c:2913 Execute export(myvar=${sip_rh_X-MyVar})EXECUTE
>>> sofia/external/400 at 192.168.1.100:5060 <http://400@192.168.1.100:5060>
>>> export(myvar=598c35116ee949.25824485)2017-08-10 17:27:29.958572 [DEBUG]
>>> switch_channel.c:1296 EXPORT (export_vars)
>>> [myvar]=[598c35116ee949.25824485]*
>>>
>>> Not sure what I'm missing in this case.
>>> Any help would be appreciated.
>>> rgds,
>>> Loi Dang
>>>
>>> ____________________________________________________________
>>> _____________
>>> 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
>>>
>>
>>
>>
>> --
>> С уважением,
>> Владислав Захожай
>>
>>
>> _________________________________________________________________________
>> 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
>>
>
>
> _________________________________________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170811/849f753f/attachment.html>


More information about the FreeSWITCH-users mailing list