]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_dial/queue/followme: 'I' options to block initial updates in both directions
authorAlexei Gradinari <alex2grad@gmail.com>
Wed, 26 Sep 2018 20:05:59 +0000 (16:05 -0400)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 19 Oct 2018 20:35:24 +0000 (15:35 -0500)
The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates
from the called parties to the caller.

This patch also blocks updates in the other direction before call is
answered.

ASTERISK-27980

Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01

apps/app_dial.c
apps/app_followme.c
apps/app_queue.c

index 855945b244fde4288fe7c483ed9612151be5b7d4..65c44c5b5a5a2fdf800baf87014e7a2a67473b10 100644 (file)
@@ -1754,12 +1754,20 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
                                                ast_indicate(o->chan, f->subclass.integer);
                                                break;
                                        case AST_CONTROL_CONNECTED_LINE:
+                                               if (ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
+                                                       ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(o->chan));
+                                                       break;
+                                               }
                                                if (ast_channel_connected_line_sub(in, o->chan, f, 1) &&
                                                        ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {
                                                        ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
                                                }
                                                break;
                                        case AST_CONTROL_REDIRECTING:
+                                               if (ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
+                                                       ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(o->chan));
+                                                       break;
+                                               }
                                                if (ast_channel_redirecting_sub(in, o->chan, f, 1) &&
                                                        ast_channel_redirecting_macro(in, o->chan, f, 0, 1)) {
                                                        ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
index 43b95e7430d0c1abf47937cf2dea03e69b819345..3e0c2c081928c109c301de6e56d08e84e1aaa882 100644 (file)
@@ -890,6 +890,11 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                /* Ignore going off hook and flash */
                                                break;
                                        case AST_CONTROL_CONNECTED_LINE:
+                                               if (ast_test_flag(&tpargs->followmeflags, FOLLOWMEFLAG_IGNORE_CONNECTEDLINE)) {
+                                                       ast_verb(3, "Connected line update from %s prevented.\n",
+                                                               ast_channel_name(winner));
+                                                       break;
+                                               }
                                                if (!tmpuser) {
                                                        /*
                                                         * Hold connected line update from caller until we have a
@@ -905,11 +910,6 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
                                                                tpargs->pending_in_connected_update = 1;
                                                        }
                                                        ast_party_connected_line_free(&connected);
-                                                       break;
-                                               }
-                                               if (ast_test_flag(&tpargs->followmeflags, FOLLOWMEFLAG_IGNORE_CONNECTEDLINE)) {
-                                                       ast_verb(3, "Connected line update from %s prevented.\n",
-                                                               ast_channel_name(winner));
                                                } else {
                                                        ast_verb(3,
                                                                "%s connected line has changed. Saving it until answer.\n",
index eb85c51b0e75b49a3108b09ac52a52011bb0ccd4..7f9261ad887b29fb6390c38186660c835519189c 100644 (file)
@@ -5232,12 +5232,20 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
                                case AST_FRAME_CONTROL:
                                        switch (f->subclass.integer) {
                                        case AST_CONTROL_CONNECTED_LINE:
+                                               if (o->block_connected_update) {
+                                                       ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(o->chan));
+                                                       break;
+                                               }
                                                if (ast_channel_connected_line_sub(in, o->chan, f, 1) &&
                                                        ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {
                                                        ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
                                                }
                                                break;
                                        case AST_CONTROL_REDIRECTING:
+                                               if (o->block_connected_update) {
+                                                       ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(o->chan));
+                                                       break;
+                                               }
                                                if (ast_channel_redirecting_sub(in, o->chan, f, 1) &&
                                                        ast_channel_redirecting_macro(in, o->chan, f, 0, 1)) {
                                                        ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);