<div dir="ltr">Nah, it's executed after the bridge so that's fine Ken. The issue, as he found, is you can't use the hangup_cause within the A leg.. because it'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"><<a href="mailto:krice@freeswitch.org">krice@freeswitch.org</a>></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, "Bob McCarthy" <<a href="http://bob.mccarthy@experient.com" target="_blank">bob.mccarthy@experient.com</a>> 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>
<extension name="Outbound_SwitchVox"><br>
<condition regex="any"><br>
<regex field="destination_number" expression="^(\d{10})$"/><br>
<regex field="destination_number" expression="^2001$"/><br>
<br>
<action application="set" data="call_timeout=20"/><br>
<action application="set" data="hangup_after_bridge=false"/><br>
<action application="bridge" data="sofia/external/${destination_number}@$${Switchvox}"/><br>
<action application="set" data="<font color="#FF0000"><b>test=${hangup_cause}</b></font>"/><br>
<action application="log" data="1 A-leg hangup cause: ${hangup_cause}"/><br>
<action application="execute_extension" data="hangup_reason-${hangup_cause} XML features"/>"/> <br>
<br>
</condition><br>
</extension><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 -> 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 <CO999x1001.1>->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->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>