<HTML>
<HEAD>
<TITLE>Re: [Freeswitch-users] Hang Up Cause is Blank in Dial Plan</TITLE>
</HEAD>
<BODY>
<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="bob.mccarthy@experient.com">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="sofia/external/2001@192.168.1.195">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="sofia/external/2001@192.168.1.195">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="sofia/external/2001@192.168.1.195">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="sofia/external/2001@192.168.1.195">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="sofia/internal/CO999x1001.1@192.168.57.211">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="sofia/internal/CO999x1001.1@192.168.57.211">sofia/internal/CO999x1001.1@192.168.57.211</a> <FONT COLOR="#FF0000"><B>SET [test]=[UNDEF]<BR>
</B></FONT>EXECUTE <a href="sofia/internal/CO999x1001.1@192.168.57.211">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="sofia/internal/CO999x1001.1@192.168.57.211">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="sofia/internal/CO999x1001.1@192.168.57.211">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 SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_________________________________________________________________________<BR>
Professional FreeSWITCH Consulting Services:<BR>
<a href="consulting@freeswitch.org">consulting@freeswitch.org</a><BR>
<a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><BR>
<BR>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
<a href="http://www.cudatel.com">http://www.cudatel.com</a><BR>
<BR>
Official FreeSWITCH Sites<BR>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><BR>
<a href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a><BR>
<a href="http://www.cluecon.com">http://www.cluecon.com</a><BR>
<BR>
FreeSWITCH-users mailing list<BR>
<a href="FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><BR>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><BR>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><BR>
<a href="http://www.freeswitch.org">http://www.freeswitch.org</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>