<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>&nbsp;</o:p></p><p class=MsoNormal>I&#8217;m first doing a originate which hits the below dialplan when answered. When it&#8217;s answered I&#8217;m setting a variable named &#8220;bridged&#8221; to 0.<o:p></o:p></p><p class=MsoNormal>When the user presses the &#8220;critical_option_digit&#8221; the call is bridged to another destination. <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</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>&nbsp;</o:p></p><p class=MsoNormal>I tried different ways of execute_on_answer but that didn&#8217;t work:<o:p></o:p></p><p class=MsoNormal>&lt;action application=&quot;set&quot; data=&quot;execute_on_answer=set bridged=1&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&lt;action application=&quot;set&quot; data=&quot;nolocal:execute_on_answer=set bridged=1&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&lt;action application=&quot;export&quot; data=&quot;execute_on_answer=set bridged=1&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&lt;action application=&quot;export&quot; data=&quot;nolocal:execute_on_answer=set bridged=1&quot;/&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</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>&nbsp;</o:p></p><p class=MsoNormal>Any ideas how to fix this?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<o:p></o:p></p><p class=MsoNormal>&lt;include&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp; &lt;context name=&quot;outbound_cc&quot;&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;extension name=&quot;start&quot;&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;destination_number&quot; expression=&quot;^(start)$&quot; require-nested=&quot;false&quot;&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;answer&quot; /&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;bridge_early_media=true&quot; /&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=false&quot; /&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action application=&quot;set&quot; data=&quot;critical_option_digit=1&quot; /&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;transfer_destination=0031123456789&quot; /&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;bridged=0&quot; /&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--Ask And Collect Message--&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;play_and_get_digits&quot; data=&quot;1 1 2 5000 # welcome.wav invalid.wav dtmfInput \d 2500&quot;/&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;transfer&quot; data=&quot;act_on_input XML outbound_cc&quot; /&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;/extension&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;extension name=&quot;act_on_input&quot;&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition field=&quot;${dtmfInput}&quot; expression=&quot;${critical_option_digit}&quot; break=&quot;never&quot;&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--Bridge--&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;set&quot; data=&quot;execute_on_answer=set bridged=1&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;bridge&quot; data=&quot;{sip_copy_custom_headers=false}sofia/outbound/${transfer_destination}@$${outbound_load_balancer_sip_ip}:$${outbound_load_balancer_sip_port}&quot; /&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application=&quot;export&quot; data=&quot;sip_bye_h_X-CollectedData=&amp;lt;CollectedData&amp;gt;&amp;lt;DTMFInput&amp;gt;${dtmfInput}&amp;lt;/DTMFInput&amp;gt;&amp;lt;BridgeSucceeded&amp;gt;${bridged}&amp;lt;/BridgeSucceeded&amp;gt;&amp;lt;/CollectedData&amp;gt;&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;action application=&quot;export&quot; data=&quot;sip_rh_X-CollectedData=&amp;lt;CollectedData&amp;gt;&amp;lt;DTMFInput&amp;gt;${dtmfInput}&amp;lt;/DTMFInput&amp;gt;&amp;lt;BridgeSucceeded&amp;gt;${bridged}&amp;lt;/BridgeSucceeded&amp;gt;&amp;lt;/CollectedData&amp;gt;&quot;/&gt;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--Hangup the channel--&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anit-action application=&quot;export&quot; data=&quot;sip_bye_h_X-CollectedData=&amp;lt;CollectedData&amp;gt;&amp;lt;DTMFInput&amp;gt;${dtmfInput}&amp;lt;/DTMFInput&amp;gt;&amp;lt;BridgeSucceeded&amp;gt;${bridged}&amp;lt;/BridgeSucceeded&amp;gt;&amp;lt;/CollectedData&amp;gt;&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anit-action application=&quot;export&quot; data=&quot;sip_rh_X-CollectedData=&amp;lt;CollectedData&amp;gt;&amp;lt;DTMFInput&amp;gt;${dtmfInput}&amp;lt;/DTMFInput&amp;gt;&amp;lt;BridgeSucceeded&amp;gt;${bridged}&amp;lt;/BridgeSucceeded&amp;gt;&amp;lt;/CollectedData&amp;gt;&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anti-action application=&quot;hangup&quot;/&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;/extension&gt;<o:p></o:p></p><p class=MsoNormal>&nbsp; &lt;/context&gt;<o:p></o:p></p><p class=MsoNormal>&lt;/include&gt;<o:p></o:p></p></div></body></html>