aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-29 20:56:26 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-29 20:56:26 +0000
commite3d556380a1423cbbab17a2f610d28441401eab7 (patch)
tree5ff4cd3a1ef718e6aa345bb3e89efd71e0ad7246 /main/channel.c
parent32c4a0bbf96e2c091add8e078339a5ac280c37ee (diff)
Allow a manager originate to succeed on forwarded devices.
The timeout to wait for an answer was being set to 0 when a device forwarded to another extension. We don't always need the timeout set like this, so make it an optional parameter, and don't use it in this case. ABE-2544 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289338 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index 5eeeeac54..65544af32 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3417,6 +3417,7 @@ struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_chan
struct ast_channel *new = NULL;
char *data, *type;
int cause = 0;
+ int res;
/* gather data and request the new forward channel */
ast_copy_string(tmpchan, orig->call_forward, sizeof(tmpchan));
@@ -3467,7 +3468,11 @@ struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_chan
ast_channel_unlock(orig);
/* call new channel */
- if ((*timeout = ast_call(new, data, 0))) {
+ res = ast_call(new, data, 0);
+ if (timeout) {
+ *timeout = res;
+ }
+ if (res) {
ast_log(LOG_NOTICE, "Unable to call forward to channel %s/%s\n", type, (char *)data);
ast_hangup(orig);
ast_hangup(new);
@@ -3528,7 +3533,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d
if (timeout > -1)
timeout = res;
if (!ast_strlen_zero(chan->call_forward)) {
- if (!(chan = ast_call_forward(NULL, chan, &timeout, format, oh, outstate))) {
+ if (!(chan = ast_call_forward(NULL, chan, NULL, format, oh, outstate))) {
return NULL;
}
continue;