<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6947">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">features: Bridge application's BRIDGERESULT not appropriately set<br><br>The dialplan application "Bridge" was not setting the BRIDGERESULT to failure<br>when a failure did occur. Even worse if it did fail to join the bridge it would<br>still report success.<br><br>This patch now sets the BRIDGERESULT variable to an appropriate value for a<br>given condition state. Also, removed the value INCOMPATIBLE as a valid result<br>type since it is no longer used.<br><br>ASTERISK-27369 #close<br><br>Change-Id: I22588e7125a765edf35cff28c98ca143e9927554<br>---<br>M main/features.c<br>1 file changed, 10 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/47/6947/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/features.c b/main/features.c<br>index 61d9e51..516c64a 100644<br>--- a/main/features.c<br>+++ b/main/features.c<br>@@ -196,7 +196,6 @@<br> <value name="FAILURE" /><br> <value name="LOOP" /><br> <value name="NONEXISTENT" /><br>- <value name="INCOMPATIBLE" /><br> </variable><br> </variablelist><br> </description><br>@@ -1006,6 +1005,7 @@<br> const char *extension;<br> int priority;<br> int bridge_add_failed;<br>+ int res = -1;<br> struct ast_bridge_features chan_features;<br> struct ast_bridge_features *peer_features;<br> struct ast_bridge *bridge;<br>@@ -1032,6 +1032,7 @@<br> if (!current_dest_chan) {<br> ast_log(LOG_WARNING, "Bridge failed because channel %s does not exist\n",<br> args.dest_chan);<br>+ pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "NONEXISTENT");<br> return 0;<br> }<br> <br>@@ -1039,13 +1040,13 @@<br> if (chan == current_dest_chan) {<br> ast_channel_unref(current_dest_chan);<br> ast_log(LOG_WARNING, "Unable to bridge channel %s with itself\n", ast_channel_name(chan));<br>+ pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "LOOP");<br> return 0;<br> }<br> <br> if (ast_test_flag(&opts, OPT_DURATION_LIMIT)<br> && !ast_strlen_zero(opt_args[OPT_ARG_DURATION_LIMIT])<br> && ast_bridge_timelimit(chan, &bconfig, opt_args[OPT_ARG_DURATION_LIMIT], &calldurationlimit)) {<br>- pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "FAILURE");<br> goto done;<br> }<br> <br>@@ -1124,14 +1125,18 @@<br> /* Don't keep the channel ref in case it was not already in a bridge. */<br> current_dest_chan = ast_channel_unref(current_dest_chan);<br> <br>- ast_bridge_join(bridge, chan, NULL, &chan_features, NULL,<br>+ res = ast_bridge_join(bridge, chan, NULL, &chan_features, NULL,<br> AST_BRIDGE_JOIN_PASS_REFERENCE);<br> <br> ast_bridge_features_cleanup(&chan_features);<br> <br>- /* The bridge has ended, set BRIDGERESULT to SUCCESS. */<br>- pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "SUCCESS");<br> done:<br>+ if (res == -1) {<br>+ pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "FAILURE");<br>+ } else {<br>+ pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "SUCCESS");<br>+ }<br>+<br> ast_free((char *) bconfig.warning_sound);<br> ast_free((char *) bconfig.end_sound);<br> ast_free((char *) bconfig.start_sound);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6947">change 6947</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6947"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I22588e7125a765edf35cff28c98ca143e9927554 </div>
<div style="display:none"> Gerrit-Change-Number: 6947 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>