<div dir="ltr">Nah, it&#39;s executed after the bridge so that&#39;s fine Ken. The issue, as he found, is you can&#39;t use the hangup_cause within the A leg.. because it&#39;s not hung up yet. He found other variable that ARE set in the A leg, though.<div>

<br clear="all"><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small">-Avi</span></span></div>
<br><br><div class="gmail_quote">On Fri, Mar 2, 2012 at 4:40 PM, Ken Rice <span dir="ltr">&lt;<a href="mailto:krice@freeswitch.org">krice@freeswitch.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div>
<font face="Monaco, Courier New"><span style="font-size:11pt">Variables are not expanded during the actual execution phase of dialplan processing ... <br>
<br>
What you are trying to do here will most likely require a transfer... You should read up on the wiki how the dialplan is processed and how variables are expanded...<br>
<br>
<br>
K<br>
<br>
<br>
On 3/2/12 5:50 AM, &quot;Bob McCarthy&quot; &lt;<a href="http://bob.mccarthy@experient.com" target="_blank">bob.mccarthy@experient.com</a>&gt; wrote:<br>
<br>
</span></font><blockquote><font face="Monaco, Courier New"><span style="font-size:11pt">I am trying to play messages for failures on outbound Calls.  When I try to use ${hangup_cause} after the failed bridge command it comes back as blank.<br>


<br>
what am I doing wrong ???<br>
<br>
 &lt;extension name=&quot;Outbound_SwitchVox&quot;&gt;<br>
      &lt;condition regex=&quot;any&quot;&gt;<br>
      &lt;regex field=&quot;destination_number&quot; expression=&quot;^(\d{10})$&quot;/&gt;<br>
      &lt;regex field=&quot;destination_number&quot; expression=&quot;^2001$&quot;/&gt;<br>
<br>
&lt;action application=&quot;set&quot; data=&quot;call_timeout=20&quot;/&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=false&quot;/&gt;<br>
    &lt;action application=&quot;bridge&quot; data=&quot;sofia/external/${destination_number}@$${Switchvox}&quot;/&gt;<br>
 &lt;action application=&quot;set&quot; data=&quot;<font color="#FF0000"><b>test=${hangup_cause}</b></font>&quot;/&gt;<br>
 &lt;action application=&quot;log&quot; data=&quot;1 A-leg hangup cause: ${hangup_cause}&quot;/&gt;<br>
        &lt;action application=&quot;execute_extension&quot; data=&quot;hangup_reason-${hangup_cause} XML features&quot;/&gt;&quot;/&gt;    <br>
<br>
      &lt;/condition&gt;<br>
  &lt;/extension&gt;<br>
<br>
<br>
2012-03-02 06:42:38.005915 [DEBUG] switch_channel.c:2850 (<a href="http://sofia/external/2001@192.168.1.195" target="_blank">sofia/external/2001@192.168.1.195</a>) Callstate Change RINGING -&gt; HANGUP<br>
2012-03-02 06:42:38.005915 [NOTICE] switch_ivr_originate.c:3183 Hangup <a href="http://sofia/external/2001@192.168.1.195" target="_blank">sofia/external/2001@192.168.1.195</a> [CS_CONSUME_MEDIA] [NO_ANSWER]<br>
2012-03-02 06:42:38.005915 [DEBUG] switch_channel.c:2873 Send signal <a href="http://sofia/external/2001@192.168.1.195" target="_blank">sofia/external/2001@192.168.1.195</a> [KILL]<br>
2012-03-02 06:42:38.005915 [DEBUG] switch_core_session.c:1180 Send signal <a href="http://sofia/external/2001@192.168.1.195" target="_blank">sofia/external/2001@192.168.1.195</a> [BREAK]<br>
2012-03-02 06:42:38.005915 [INFO] mod_dptools.c:2922 <font color="#FF0000"><b>Originate Failed.  Cause: NO_ANSWER<br>
</b></font>EXECUTE <a href="http://sofia/internal/CO999x1001.1@192.168.57.211" target="_blank">sofia/internal/CO999x1001.1@192.168.57.211</a> <font color="#FF0000"><b>set(test=)<br>
</b></font>2012-03-02 06:42:38.005915 [DEBUG] mod_dptools.c:1281 <a href="http://sofia/internal/CO999x1001.1@192.168.57.211" target="_blank">sofia/internal/CO999x1001.1@192.168.57.211</a> <font color="#FF0000"><b>SET [test]=[UNDEF]<br>


</b></font>EXECUTE <a href="http://sofia/internal/CO999x1001.1@192.168.57.211" target="_blank">sofia/internal/CO999x1001.1@192.168.57.211</a> log(1 A-leg hangup cause: )<br>
2012-03-02 06:42:38.005915 [ALERT] mod_dptools.c:1420 A-leg hangup cause: <br>
EXECUTE <a href="http://sofia/internal/CO999x1001.1@192.168.57.211" target="_blank">sofia/internal/CO999x1001.1@192.168.57.211</a> execute_extension(hangup_reason- XML features)<br>
2012-03-02 06:42:38.005915 [INFO] mod_dialplan_xml.c:485 Processing Dispatch 2 &lt;CO999x1001.1&gt;-&gt;hangup_reason- in context features<br>
Dialplan: <a href="http://sofia/internal/CO999x1001.1@192.168.57.211" target="_blank">sofia/internal/CO999x1001.1@192.168.57.211</a> parsing [features-&gt;dx] continue=false<br>
<br>
<br>
<hr align="CENTER" size="3" width="95%"></span></font><font><font face="Consolas, Courier New, Courier"><span style="font-size:10pt">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="http://consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="http://FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</span></font></font></blockquote>
</div>


<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>