diff options
-rw-r--r-- | apps/app_dial.c | 11 | ||||
-rw-r--r-- | main/channel.c | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index a6e0f3d79..a3a32999a 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -436,7 +436,16 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l /* Turn off hold music, etc */ ast_deactivate_generator(in); /* If we are calling a single channel, make them compatible for in-band tone purpose */ - ast_channel_make_compatible(outgoing->chan, in); + if (ast_channel_make_compatible(outgoing->chan, in) < 0) { + /* If these channels can not be made compatible, + * there is no point in continuing. The bridge + * will just fail if it gets that far. + */ + *to = -1; + strcpy(status, "CONGESTION"); + ast_cdr_failed(in->cdr); + return NULL; + } } diff --git a/main/channel.c b/main/channel.c index 43443287a..8630ded01 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2827,8 +2827,7 @@ int ast_indicate_data(struct ast_channel *chan, int _condition, if (option_debug) { ast_log(LOG_DEBUG, "Driver for channel '%s' does not support indication %d, emulating it\n", chan->name, condition); } - ast_playtones_start(chan, 0, ts->data, 1); - res = 0; + res = ast_playtones_start(chan, 0, ts->data, 1); chan->visible_indication = condition; } @@ -3410,11 +3409,12 @@ static int set_format(struct ast_channel *chan, int fmt, int *rawformat, int *fo else /* writing */ *trans = ast_translator_build_path(*rawformat, *format); + res = *trans ? 0 : -1; ast_channel_unlock(chan); if (option_debug) ast_log(LOG_DEBUG, "Set channel %s to %s format %s\n", chan->name, direction ? "write" : "read", ast_getformatname(fmt)); - return 0; + return res; } int ast_set_read_format(struct ast_channel *chan, int fmt) |