]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Allow a manager originate to succeed on forwarded devices.
authorJason Parker <jparker@digium.com>
Wed, 29 Sep 2010 20:56:26 +0000 (20:56 +0000)
committerJason Parker <jparker@digium.com>
Wed, 29 Sep 2010 20:56:26 +0000 (20:56 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@289338 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c
res/res_features.c

index 5eeeeac548ad60b574a3f320d6177a0a3f73e35c..65544af3299728024b64432fcf33ef439ac14af6 100644 (file)
@@ -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;
index fcea7c566b8fd92015c67ae0262883ddbc882697..98760ccd2a50a6772a060e93a7253fbedb907cf2 100644 (file)
@@ -1505,7 +1505,7 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
 
                                if (chan && (chan == active_channel)) {
                                        if (!ast_strlen_zero(chan->call_forward)) {
-                                               if (!(chan = ast_call_forward(caller, chan, &to, format, NULL, outstate))) {
+                                               if (!(chan = ast_call_forward(caller, chan, NULL, format, NULL, outstate))) {
                                                        return NULL;
                                                }
                                                continue;