<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 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;}
h1
        {mso-style-priority:9;
        mso-style-link:"Heading 1 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:24.0pt;
        font-family:"Calibri",sans-serif;}
h2
        {mso-style-priority:9;
        mso-style-link:"Heading 2 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:18.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.Heading1Char
        {mso-style-name:"Heading 1 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 1";
        font-family:"Calibri",sans-serif;
        font-weight:bold;}
span.Heading2Char
        {mso-style-name:"Heading 2 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 2";
        font-family:"Calibri",sans-serif;
        font-weight:bold;}
span.author
        {mso-style-name:author;}
span.aui-lozenge
        {mso-style-name:aui-lozenge;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1599634382;
        mso-list-template-ids:-560150752;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I find below documentation for hangup after bridge<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<h2 style="margin:0in;margin-bottom:.0001pt"><span style="font-size:15.0pt;font-family:"Arial",sans-serif;color:#333333;font-weight:normal">hangup_after_bridge<o:p></o:p></span></h2>
<p class="MsoNormal"><span class="aui-lozenge"><b><span style="font-size:8.5pt;font-family:"Arial",sans-serif;color:#4A6785;text-transform:uppercase;border:solid #E4E8ED 1.0pt;padding:2.0pt;background:white">BOOLEAN</span></b></span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333"> Controls
 what happens to a calling (A) party when in a bridge state and the called (B) party hangs up. If </span><code><span style="font-size:10.0pt;color:#333333">true</span></code><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333"> the dialplan
 will stop processing and the A leg will be terminated when the B leg terminates. If </span><code><span style="font-size:10.0pt;color:#333333">false</span></code><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333"> (default) the dialplan
 continues to be processed after the B leg terminates. This is checked after <a href="https://freeswitch.org/confluence/display/FREESWITCH/Variables+Master+List#VariablesMasterList-park_after_bridge"><span style="color:#3572B0">park_after_bridge</span></a> and <a href="https://freeswitch.org/confluence/display/FREESWITCH/Variables+Master+List#VariablesMasterList-transfer_after_bridge"><span style="color:#3572B0">transfer_after_bridge</span></a>.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In the below code within switch_ivr_bridge.c we are checking park_after_bridge transfer after bridge (highlighted). However we are not checking for hangup_after_bridge setting and hanging up the channel. Is there any reason for missing
 the check of hangup_after_bridge flag before hanging up the channel?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">static</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> switch_status_t
<b>audio_bridge_on_exchange_media</b>(</span><span style="font-size:10.0pt;font-family:Consolas;color:#005032">switch_core_session_t</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> *session)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">{</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><span style="font-size:10.0pt;font-family:Consolas;color:#005032">switch_channel_t</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> *channel = switch_core_session_get_channel(session);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><span style="font-size:10.0pt;font-family:Consolas;color:#005032">switch_ivr_bridge_data_t</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> *bd = switch_channel_get_private(channel,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"_bridge_"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><span style="font-size:10.0pt;font-family:Consolas;color:#005032">switch_channel_state_t</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> state;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">const</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">char</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> *var;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (bd) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              switch_channel_set_private(channel,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"_bridge_"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">, NULL);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">             
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (bd-></span><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">session</span><span style="font-size:10.0pt;font-family:Consolas;color:black">
 == session && *bd-></span><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">b_uuid</span><span style="font-size:10.0pt;font-family:Consolas;color:black">) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     audio_bridge_thread(NULL, (</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">void</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">
 *) bd);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     switch_core_session_reset(session,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_TRUE</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_TRUE</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              }
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     switch_channel_hangup(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">       }
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              switch_channel_hangup(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">       }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">       switch_channel_clear_state_handler(channel, &audio_bridge_peer_state_handlers);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">       state = switch_channel_get_state(channel);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (!switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_TRANSFER</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">) && !switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_REDIRECT</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">) &&</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              !switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_XFER_ZOMBIE</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">) && bd && !bd-></span><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">clean_exit</span><span style="font-size:10.0pt;font-family:Consolas;color:black">
 && state != </span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CS_PARK</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black"> && state !=
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CS_ROUTING</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black"> &&</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              state ==
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CS_EXCHANGE_MEDIA</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black"> && !switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_INNER_BRIDGE</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">)) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">             
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055;background:yellow;mso-highlight:yellow">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow"> (state <
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0;background:yellow;mso-highlight:yellow">CS_HANGUP</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow"> && switch_true(switch_channel_get_variable(channel,
 SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {</span><span style="font-size:10.0pt;font-family:Consolas;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">                     switch_ivr_park_session(session);</span><span style="font-size:10.0pt;font-family:Consolas;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">                    
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055;background:yellow;mso-highlight:yellow">return</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow"> SWITCH_STATUS_FALSE;</span><span style="font-size:10.0pt;font-family:Consolas;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">              }
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055;background:yellow;mso-highlight:yellow">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055;background:yellow;mso-highlight:yellow">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow"> (state <
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0;background:yellow;mso-highlight:yellow">CS_HANGUP</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow"> && (var = switch_channel_get_variable(channel,
 SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {</span><span style="font-size:10.0pt;font-family:Consolas;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">                     transfer_after_bridge(session, var);</span><span style="font-size:10.0pt;font-family:Consolas;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">                    
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055;background:yellow;mso-highlight:yellow">return</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow"> SWITCH_STATUS_FALSE;</span><span style="font-size:10.0pt;font-family:Consolas;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">              }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">             
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_INTERCEPTED</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">)) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     switch_channel_clear_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_INTERCEPT</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     switch_channel_clear_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_INTERCEPTED</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                    
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">return</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> SWITCH_STATUS_FALSE;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              }
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                    
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_INTERCEPT</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">)) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                           switch_channel_hangup(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_CAUSE_PICKED_OFF</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     }
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                          
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (!switch_channel_test_flag(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CF_ANSWERED</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">)) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">int</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> x = 0;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (switch_channel_execute_on(channel,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"execute_on_orphaned_bleg"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">) == SWITCH_STATUS_SUCCESS) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                         x++;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                  }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (switch_channel_api_on(channel,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"api_on_orphaned_bleg"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">) == SWITCH_STATUS_SUCCESS) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                         x++;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                  }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (!x) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                         switch_channel_hangup(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_CAUSE_ORIGINATOR_CANCEL</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                  }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                           }
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                  switch_channel_hangup(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">SWITCH_CAUSE_NORMAL_CLEARING</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                           }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">       }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (switch_channel_get_state(channel) ==
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CS_EXCHANGE_MEDIA</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">) {</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              switch_channel_set_variable(channel,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"park_timeout"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"3"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              switch_channel_set_state(channel,
</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">CS_PARK</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">       }</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">      
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">return</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> SWITCH_STATUS_FALSE;</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Darshan<o:p></o:p></p>
</div>
</body>
</html>