Skip to content

Commit 626fefd

Browse files
InterLinked1kharwell
authored andcommitted
app_dial: Fix dial status regression.
ASTERISK_28638 caused a regression by incorrectly aborting early and overwriting the status on certain calls. This was exhibited by certain technologies such as DAHDI, where DAHDI returns NULL for the request if a line is busy. This caused the BUSY condition to be incorrectly treated as CHANUNAVAIL because the DIALSTATUS was getting incorrectly overwritten and call handling was aborted early. This is fixed by instead checking if any valid peers have been specified, as opposed to checking the list size of successful requests. This is because the latter could be empty but this does not indicate any kind of problem. This restores the previous working behavior. ASTERISK-29989 #close Change-Id: I4d4b209b967816b1bc791534593ababa2b99bb88
1 parent 350ffcb commit 626fefd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/app_dial.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,8 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
27032703

27042704
if (!tc) {
27052705
/* If we can't, just go on to the next call */
2706-
ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n",
2706+
/* Failure doesn't necessarily mean user error. DAHDI channels could be busy. */
2707+
ast_log(LOG_NOTICE, "Unable to create channel of type '%s' (cause %d - %s)\n",
27072708
tmp->tech, cause, ast_cause2str(cause));
27082709
handle_cause(cause, &num);
27092710
if (!rest) {
@@ -2841,7 +2842,9 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
28412842
AST_LIST_INSERT_TAIL(&out_chans, tmp, node);
28422843
}
28432844

2844-
if (AST_LIST_EMPTY(&out_chans)) {
2845+
/* As long as we attempted to dial valid peers, don't throw a warning. */
2846+
/* If a DAHDI peer is busy, out_chans will be empty so checking list size is misleading. */
2847+
if (!num_dialed) {
28452848
ast_verb(3, "No devices or endpoints to dial (technology/resource)\n");
28462849
if (continue_exec) {
28472850
/* There is no point in having RetryDial try again */

0 commit comments

Comments
 (0)