<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m first doing a originate which hits the below dialplan when answered. When it’s answered I’m setting a variable named “bridged” to 0.<o:p></o:p></p><p class=MsoNormal>When the user presses the “critical_option_digit” the call is bridged to another destination. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I need to know if this bridge was answered or not. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I tried different ways of execute_on_answer but that didn’t work:<o:p></o:p></p><p class=MsoNormal><action application="set" data="execute_on_answer=set bridged=1"/><o:p></o:p></p><p class=MsoNormal><action application="set" data="nolocal:execute_on_answer=set bridged=1"/><o:p></o:p></p><p class=MsoNormal><action application="export" data="execute_on_answer=set bridged=1"/><o:p></o:p></p><p class=MsoNormal><action application="export" data="nolocal:execute_on_answer=set bridged=1"/><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It is important the bridged variable is set to 1 on the first leg and a header is appended to the BYE/200 OK(BYE) of the first leg containing this new value.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any ideas how to fix this?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><?xml version="1.0" encoding="utf-8"?><o:p></o:p></p><p class=MsoNormal><include><o:p></o:p></p><p class=MsoNormal> <context name="outbound_cc"><o:p></o:p></p><p class=MsoNormal> <extension name="start"><o:p></o:p></p><p class=MsoNormal> <condition field="destination_number" expression="^(start)$" require-nested="false"><o:p></o:p></p><p class=MsoNormal> <action application="answer" /><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <action application="set" data="bridge_early_media=true" /><o:p></o:p></p><p class=MsoNormal> <action application="set" data="hangup_after_bridge=false" /><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <action application="set" data="critical_option_digit=1" /><o:p></o:p></p><p class=MsoNormal> <action application="set" data="transfer_destination=0031123456789" /><o:p></o:p></p><p class=MsoNormal> <action application="set" data="bridged=0" /><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <!--Ask And Collect Message--><o:p></o:p></p><p class=MsoNormal> <action application="play_and_get_digits" data="1 1 2 5000 # welcome.wav invalid.wav dtmfInput \d 2500"/><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <action application="transfer" data="act_on_input XML outbound_cc" /><o:p></o:p></p><p class=MsoNormal> </condition><o:p></o:p></p><p class=MsoNormal> </extension><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <extension name="act_on_input"><o:p></o:p></p><p class=MsoNormal> <condition field="${dtmfInput}" expression="${critical_option_digit}" break="never"><o:p></o:p></p><p class=MsoNormal> <!--Bridge--><o:p></o:p></p><p class=MsoNormal> <action application="set" data="execute_on_answer=set bridged=1"/><o:p></o:p></p><p class=MsoNormal> <action application="bridge" data="{sip_copy_custom_headers=false}sofia/outbound/${transfer_destination}@$${outbound_load_balancer_sip_ip}:$${outbound_load_balancer_sip_port}" /><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <action application="export" data="sip_bye_h_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><o:p></o:p></p><p class=MsoNormal> <action application="export" data="sip_rh_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <!--Hangup the channel--><o:p></o:p></p><p class=MsoNormal> <anit-action application="export" data="sip_bye_h_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><o:p></o:p></p><p class=MsoNormal> <anit-action application="export" data="sip_rh_X-CollectedData=&lt;CollectedData&gt;&lt;DTMFInput&gt;${dtmfInput}&lt;/DTMFInput&gt;&lt;BridgeSucceeded&gt;${bridged}&lt;/BridgeSucceeded&gt;&lt;/CollectedData&gt;"/><o:p></o:p></p><p class=MsoNormal> <anti-action application="hangup"/><o:p></o:p></p><p class=MsoNormal> </condition><o:p></o:p></p><p class=MsoNormal> </extension><o:p></o:p></p><p class=MsoNormal> </context><o:p></o:p></p><p class=MsoNormal></include><o:p></o:p></p></div></body></html>