[Asterisk-code-review] app dial/queue/followme: 'I' options to block initial update... (asterisk[13])

Joshua Colp asteriskteam at digium.com
Thu Oct 25 07:46:01 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/10286 )

Change subject: app_dial/queue/followme: 'I' options to block initial updates in both directions
......................................................................

app_dial/queue/followme: 'I' options to block initial updates in both directions

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
---
M apps/app_dial.c
M apps/app_followme.c
M apps/app_queue.c
3 files changed, 21 insertions(+), 5 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/apps/app_dial.c b/apps/app_dial.c
index 855945b..65c44c5 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1754,12 +1754,20 @@
 						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);
diff --git a/apps/app_followme.c b/apps/app_followme.c
index 43b95e7..3e0c2c0 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -890,6 +890,11 @@
 						/* 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 @@
 								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",
diff --git a/apps/app_queue.c b/apps/app_queue.c
index eb85c51..7f9261a 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5232,12 +5232,20 @@
 				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);

-- 
To view, visit https://gerrit.asterisk.org/10286
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
Gerrit-Change-Number: 10286
Gerrit-PatchSet: 5
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181025/bcaff740/attachment.html>


More information about the asterisk-code-review mailing list