]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_followme: fix issue with enable_callee_prompt=no (#88)
authoralex2grad <alex2grad@users.noreply.github.com>
Mon, 5 Jun 2023 18:23:03 +0000 (14:23 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Mon, 10 Jul 2023 11:49:48 +0000 (11:49 +0000)
* app_followme: fix issue with enable_callee_prompt=no

If the FollowMe option 'enable_callee_prompt' is set to 'no' then Asterisk
incorrectly sets a winner channel to the channel from which any control frame was read.

This fix sets the winner channel only to the answered channel.

Resolves: #87

ASTERISK-30326

(cherry picked from commit a8ea16cdf8de454dc244154501a570da788fc605)

apps/app_followme.c

index bc60b3687187da7f2d75ad82fc11380f6d02bdbc..367452f3a7ee870ce8ca451442f1c26bfe58b5a7 100644 (file)
@@ -836,8 +836,9 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                                }
                                                        }
                                                } else {
-                                                       ast_verb(3, "Skip playback of caller name / norecording\n");
-                                                       tmpuser->state = 2;
+                                                       ast_debug(1, "Taking call with no prompt\n");
+                                                       ast_frfree(f);
+                                                       return tmpuser->ochan;
                                                }
                                                break;
                                        case AST_CONTROL_BUSY:
@@ -964,11 +965,6 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                break;
                                        }
                                }
-                               if (!tpargs->enable_callee_prompt && tmpuser) {
-                                       ast_debug(1, "Taking call with no prompt\n");
-                                       ast_frfree(f);
-                                       return tmpuser->ochan;
-                               }
                                if (tmpuser && tmpuser->state == 3 && f->frametype == AST_FRAME_DTMF) {
                                        int cmp_len;