<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18521">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_dial: Fix dial status regression.<br><br>ASTERISK_28638 caused a regression by incorrectly aborting<br>early and overwriting the status on certain calls.<br>This was exhibited by certain technologies such as DAHDI,<br>where DAHDI returns NULL for the request if a line is busy.<br>This caused the BUSY condition to be incorrectly treated<br>as CHANUNAVAIL because the DIALSTATUS was getting incorrectly<br>overwritten and call handling was aborted early.<br><br>This is fixed by instead checking if any valid peers have been<br>specified, as opposed to checking the list size of successful<br>requests. This is because the latter could be empty but this<br>does not indicate any kind of problem. This restores the<br>previous working behavior.<br><br>ASTERISK-29989 #close<br><br>Change-Id: I4d4b209b967816b1bc791534593ababa2b99bb88<br>---<br>M apps/app_dial.c<br>1 file changed, 10 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/18521/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_dial.c b/apps/app_dial.c</span><br><span>index 7ea23f3..500816e 100644</span><br><span>--- a/apps/app_dial.c</span><br><span>+++ b/apps/app_dial.c</span><br><span>@@ -1644,8 +1644,8 @@</span><br><span>                                                                 "Sending SF '%s' to %s as result of "</span><br><span>                                                              "receiving a WINK message.\n",</span><br><span>                                                             sf_wink, (hearpulsing ? "parties" : "called party"));</span><br><span style="color: hsl(0, 100%, 40%);">-                                                       ast_sf_stream(c, (hearpulsing ? NULL : in),</span><br><span style="color: hsl(0, 100%, 40%);">-                                                     (hearpulsing ? in : NULL), sf_wink, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+                                                    //ast_sf_stream(c, (hearpulsing ? NULL : in),</span><br><span style="color: hsl(120, 100%, 40%);">+                                                 //(hearpulsing ? in : NULL), sf_wink, 0, 0);</span><br><span>                                                 }</span><br><span>                                    }</span><br><span>                                    ast_indicate(in, AST_CONTROL_WINK);</span><br><span>@@ -2319,6 +2319,7 @@</span><br><span>  int to; /* timeout */</span><br><span>        struct cause_args num = { chan, 0, 0, 0 };</span><br><span>   int cause, hanguptreecause = -1;</span><br><span style="color: hsl(120, 100%, 40%);">+      int valid_peers = 0;</span><br><span> </span><br><span>     struct ast_bridge_config config = { { 0, } };</span><br><span>        struct timeval calldurationlimit = { 0, };</span><br><span>@@ -2636,6 +2637,8 @@</span><br><span>                   goto out;</span><br><span>            }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+         valid_peers++; /* Might not work out, but the format of this peer seems okay. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>           /* Save tech, number, and interface. */</span><br><span>              cur = tmp->stuff;</span><br><span>                 strcpy(cur, tech);</span><br><span>@@ -2698,7 +2701,8 @@</span><br><span> </span><br><span>               if (!tc) {</span><br><span>                   /* If we can't, just go on to the next call */</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                     /* Failure doesn't necessarily mean user error. DAHDI channels could be busy. */</span><br><span style="color: hsl(120, 100%, 40%);">+                  ast_log(LOG_NOTICE, "Unable to create channel of type '%s' (cause %d - %s)\n",</span><br><span>                             tmp->tech, cause, ast_cause2str(cause));</span><br><span>                  handle_cause(cause, &num);</span><br><span>                       if (!rest) {</span><br><span>@@ -2836,7 +2840,9 @@</span><br><span>                 AST_LIST_INSERT_TAIL(&out_chans, tmp, node);</span><br><span>     }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (AST_LIST_EMPTY(&out_chans)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* As long as we attempted to dial valid peers, don't throw a warning. */</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If a DAHDI peer is busy, out_chans will be empty so checking list size is misleading. */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!valid_peers) {</span><br><span>          ast_verb(3, "No devices or endpoints to dial (technology/resource)\n");</span><br><span>            if (continue_exec) {</span><br><span>                         /* There is no point in having RetryDial try again */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18521">change 18521</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/18521"/><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-Change-Id: I4d4b209b967816b1bc791534593ababa2b99bb88 </div>
<div style="display:none"> Gerrit-Change-Number: 18521 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>