<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7449">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_basic.c: Update transfer diagnostic messages.<br><br>* Add the channel name to diagnostic messages so you will know which<br>channel failed to transfer.<br><br>* Promoted some debug messages to verbose 4 messages.<br><br>ASTERISK-27449 #close<br><br>Change-Id: Idac66b7628c99379cc9269158377fd87dc97a880<br>---<br>M main/bridge_basic.c<br>1 file changed, 38 insertions(+), 17 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/49/7449/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/bridge_basic.c b/main/bridge_basic.c<br>index fd6bac0..6b393f4 100644<br>--- a/main/bridge_basic.c<br>+++ b/main/bridge_basic.c<br>@@ -3170,7 +3170,8 @@<br> ast_channel_lock(chan);<br> xfer_cfg = ast_get_chan_features_xfer_config(chan);<br> if (!xfer_cfg) {<br>- ast_log(LOG_ERROR, "Unable to get transfer configuration\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to get transfer configuration\n",<br>+ ast_channel_name(chan));<br> ast_channel_unlock(chan);<br> return -1;<br> }<br>@@ -3214,9 +3215,9 @@<br> } else if (!res) {<br> /* 0 for invalid extension dialed. */<br> if (ast_strlen_zero(exten)) {<br>- ast_debug(1, "%s dialed no digits.\n", ast_channel_name(chan));<br>+ ast_verb(4, "%s dialed no digits.\n", ast_channel_name(chan));<br> } else {<br>- ast_debug(1, "%s dialed '%s@%s' does not exist.\n",<br>+ ast_verb(4, "%s dialed '%s@%s' does not exist.\n",<br> ast_channel_name(chan), exten, context);<br> }<br> if (attempts < max_attempts) {<br>@@ -3304,8 +3305,8 @@<br> bridge = ast_bridge_channel_merge_inhibit(bridge_channel, +1);<br> <br> if (strcmp(bridge->v_table->name, "basic")) {<br>- ast_log(LOG_ERROR, "Attended transfer attempted on unsupported bridge type '%s'.\n",<br>- bridge->v_table->name);<br>+ ast_log(LOG_ERROR, "Channel %s: Attended transfer attempted on unsupported bridge type '%s'.\n",<br>+ ast_channel_name(bridge_channel->chan), bridge->v_table->name);<br> ast_bridge_merge_inhibit(bridge, -1);<br> ao2_ref(bridge, -1);<br> return 0;<br>@@ -3327,7 +3328,8 @@<br> props = attended_transfer_properties_alloc(bridge_channel->chan,<br> attended_transfer ? attended_transfer->context : NULL);<br> if (!props) {<br>- ast_log(LOG_ERROR, "Unable to allocate control structure for performing attended transfer.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to allocate control structure for performing attended transfer.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> ast_bridge_merge_inhibit(bridge, -1);<br> ao2_ref(bridge, -1);<br> return 0;<br>@@ -3336,7 +3338,8 @@<br> props->transferee_bridge = bridge;<br> <br> if (add_transferer_role(props->transferer, attended_transfer)) {<br>- ast_log(LOG_ERROR, "Unable to set transferrer bridge role.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to set transferrer bridge role.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> attended_transfer_properties_shutdown(props);<br> return 0;<br> }<br>@@ -3345,7 +3348,15 @@<br> <br> /* Grab the extension to transfer to */<br> if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), props->context)) {<br>- ast_log(LOG_WARNING, "Unable to acquire target extension for attended transfer.\n");<br>+ /*<br>+ * XXX The warning here really should be removed. While the<br>+ * message is accurate, this is a normal exit for when the user<br>+ * fails to specify a valid transfer target. e.g., The user<br>+ * hungup, didn't dial any digits, or dialed an invalid<br>+ * extension.<br>+ */<br>+ ast_log(LOG_WARNING, "Channel %s: Unable to acquire target extension for attended transfer.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> ast_bridge_channel_write_unhold(bridge_channel);<br> attended_transfer_properties_shutdown(props);<br> return 0;<br>@@ -3356,12 +3367,14 @@<br> /* Fill the variable with the extension and context we want to call */<br> snprintf(destination, sizeof(destination), "%s@%s", props->exten, props->context);<br> <br>- ast_debug(1, "Attended transfer to '%s'\n", destination);<br>+ ast_debug(1, "Channel %s: Attended transfer target '%s'\n",<br>+ ast_channel_name(bridge_channel->chan), destination);<br> <br> /* Get a channel that is the destination we wish to call */<br> props->transfer_target = dial_transfer(bridge_channel->chan, destination);<br> if (!props->transfer_target) {<br>- ast_log(LOG_ERROR, "Unable to request outbound channel for attended transfer target.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to request outbound channel for attended transfer target.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> stream_failsound(props->transferer);<br> ast_bridge_channel_write_unhold(bridge_channel);<br> attended_transfer_properties_shutdown(props);<br>@@ -3372,7 +3385,8 @@<br> /* Create a bridge to use to talk to the person we are calling */<br> props->target_bridge = ast_bridge_basic_new();<br> if (!props->target_bridge) {<br>- ast_log(LOG_ERROR, "Unable to create bridge for attended transfer target.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to create bridge for attended transfer target.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> stream_failsound(props->transferer);<br> ast_bridge_channel_write_unhold(bridge_channel);<br> ast_hangup(props->transfer_target);<br>@@ -3383,7 +3397,8 @@<br> ast_bridge_merge_inhibit(props->target_bridge, +1);<br> <br> if (attach_framehook(props, props->transfer_target)) {<br>- ast_log(LOG_ERROR, "Unable to attach framehook to transfer target.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to attach framehook to transfer target.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> stream_failsound(props->transferer);<br> ast_bridge_channel_write_unhold(bridge_channel);<br> ast_hangup(props->transfer_target);<br>@@ -3398,7 +3413,8 @@<br> BRIDGE_BASIC_PERSONALITY_ATXFER, props);<br> <br> if (ast_call(props->transfer_target, destination, 0)) {<br>- ast_log(LOG_ERROR, "Unable to place outbound call to transfer target.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to place outbound call to transfer target.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> stream_failsound(props->transferer);<br> ast_bridge_channel_write_unhold(bridge_channel);<br> ast_hangup(props->transfer_target);<br>@@ -3414,7 +3430,8 @@<br> ast_channel_ref(props->transfer_target);<br> if (ast_bridge_impart(props->target_bridge, props->transfer_target, NULL, NULL,<br> AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {<br>- ast_log(LOG_ERROR, "Unable to place transfer target into bridge.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to place transfer target into bridge.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> stream_failsound(props->transferer);<br> ast_bridge_channel_write_unhold(bridge_channel);<br> ast_hangup(props->transfer_target);<br>@@ -3424,7 +3441,8 @@<br> }<br> <br> if (ast_pthread_create_detached(&thread, NULL, attended_transfer_monitor_thread, props)) {<br>- ast_log(LOG_ERROR, "Unable to create monitoring thread for attended transfer.\n");<br>+ ast_log(LOG_ERROR, "Channel %s: Unable to create monitoring thread for attended transfer.\n",<br>+ ast_channel_name(bridge_channel->chan));<br> stream_failsound(props->transferer);<br> ast_bridge_channel_write_unhold(bridge_channel);<br> attended_transfer_properties_shutdown(props);<br>@@ -3470,13 +3488,16 @@<br> return 0;<br> }<br> <br>+ ast_debug(1, "Channel %s: Blind transfer target '%s@%s'\n",<br>+ ast_channel_name(bridge_channel->chan), xfer_exten, xfer_context);<br>+<br> if (!ast_strlen_zero(goto_on_blindxfr)) {<br> const char *chan_context;<br> const char *chan_exten;<br> int chan_priority;<br> <br>- ast_debug(1, "After transfer, transferer %s goes to %s\n",<br>- ast_channel_name(bridge_channel->chan), goto_on_blindxfr);<br>+ ast_debug(1, "After transfer, transferrer %s goes to %s\n",<br>+ ast_channel_name(bridge_channel->chan), goto_on_blindxfr);<br> <br> ast_channel_lock(bridge_channel->chan);<br> chan_context = ast_strdupa(ast_channel_context(bridge_channel->chan));<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7449">change 7449</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/7449"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Idac66b7628c99379cc9269158377fd87dc97a880 </div>
<div style="display:none"> Gerrit-Change-Number: 7449 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Niklas Larsson <niklas@tese.se> </div>