<div dir="ltr"><div><div>Hi guys, I have a simple call scenario:<br></div><i>Caller -> FS -> Callee</i><br></div><div>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.<br><br></div><div>I'm retrieving
that custom header by looking at ${sip_rh_X-MyVar} via <i>execute_on_answer</i> on B leg, and it's fine. But I'm unable to export it
to the A leg.<br></div><div>Here's my dialplan:<br><b><br><extension name="logvar"><br> <condition field="destination_number" expression="^logvar$"><br> <action application="export" data="myvar=${sip_rh_X-MyVar}"/><br> </condition><br></extension><br><br><action application="bridge" data="{execute_on_answer=execute_extension logvar XML external}sofia/external/${destination_number}"/></b><br></div><div><div><div><br></div><div>I don't want X-MyVar header to be passed to Caller, so I have to export the variable.<br></div><div>But
when CHANNEL_HANGUP_COMPLETE fires, the variable <i>variable_myvar</i> present only in the outbound B leg. Look like my export did not work.<br></div><div>Note that I have some upstream exports from A leg to B leg in normal XML dialplan and they're all fine.<br><br>Below is my fs_cli log: 192.168.1.100 is my FS.<br><b>Dialplan: sofia/external/<a href="http://400@192.168.1.100:5060" target="_blank">400@192.168.1.100:5060</a> Action export(myvar=${sip_rh_X-MyVar})<br>2017-08-10 17:27:29.958572 [NOTICE] switch_core_session.c:2913 Execute export(myvar=${sip_rh_X-MyVar})<br>EXECUTE sofia/external/<a href="http://400@192.168.1.100:5060" target="_blank">400@192.168.1.100:5060</a> export(myvar=598c35116ee949.25824485)<br>2017-08-10 17:27:29.958572 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [myvar]=[598c35116ee949.25824485]</b><br><br></div><div>Not sure what I'm missing in this case.<br></div><div>Any help would be appreciated.<br></div><div>rgds,<br></div><div>Loi Dang<br></div></div></div></div>