[Asterisk-code-review] app dial: 'I' option to block all connected line updates in ... (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Wed Sep 26 15:24:07 CDT 2018


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/10286


Change subject: app_dial: 'I' option to block all connected line updates in both directions
......................................................................

app_dial: 'I' option to block all connected line updates in both directions

The 'I' option currently blocks CONNECTEDLINE or REDIRECTING updates
from the called parties to the caller and only before a call is answered.

This patch also blocks updates in the other direction before call is
answered and blocks CONNECTEDLINE updates in both directions after
the call is answered.

Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
---
M apps/app_dial.c
1 file changed, 13 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/86/10286/1

diff --git a/apps/app_dial.c b/apps/app_dial.c
index 855945b..72cf8ec 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1329,7 +1329,7 @@
 					ast_frfree(f);
 				}
 
-				if (o->pending_connected_update) {
+				if (o->pending_connected_update && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
 					/*
 					 * Re-seed the chanlist's connected line information with
 					 * previously acquired connected line info from the incoming
@@ -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);
@@ -2917,6 +2925,10 @@
 							} else {
 								other_chan = chan;
 							}
+							if (ast_test_flag64(&opts, OPT_IGNORE_CONNECTEDLINE)) {
+								ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(other_chan));
+								break;
+							}
 							if (ast_channel_connected_line_sub(active_chan, other_chan, fr, 1)
 								&& ast_channel_connected_line_macro(active_chan,
 									other_chan, fr, other_chan == chan, 1)) {

-- 
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: newchange
Gerrit-Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
Gerrit-Change-Number: 10286
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180926/f414010d/attachment-0001.html>


More information about the asterisk-code-review mailing list