diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2000-12-28 19:15:51 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2000-12-28 19:15:51 +0000 |
commit | f1f8d090c614d75a02e41932d2003375a0712c07 (patch) | |
tree | c3117c891950cb12bc885cebf26c88513b8b7aee /apps | |
parent | a2a71416b0102cf6045d58bab51ca9fc86f0b722 (diff) |
Version 0.1.6 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/app_dial.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 6eef79497..722b0795e 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -514,6 +514,11 @@ static int park_exec(struct ast_channel *chan, void *data) nchan = chan; else nchan = ast_translator_create(chan, peer->format, AST_DIRECTION_BOTH); + if (!nchan) { + ast_log(LOG_WARNING, "Had to drop call because there was no translator for %s to %s.\n", chan->name, peer->name); + ast_hangup(peer); + return -1; + } /* This runs sorta backwards, since we give the incoming channel control, as if it were the person called. */ if (option_verbose > 2) @@ -649,10 +654,16 @@ static int dial_exec(struct ast_channel *chan, void *data) npeer = peer; else npeer = ast_translator_create(peer, chan->format, AST_DIRECTION_BOTH); - res = bridge_call(chan, npeer, allowredir); - if (npeer != peer) - ast_translator_destroy(npeer); - ast_hangup(peer); + if (!npeer) { + ast_log(LOG_WARNING, "Had to drop call because there was no translator for %s to %s.\n", chan->name, peer->name); + ast_hangup(peer); + res = -1; + } else { + res = bridge_call(chan, npeer, allowredir); + if (npeer != peer) + ast_translator_destroy(npeer); + ast_hangup(peer); + } } out: hanguptree(outgoing, NULL); |