[asterisk-commits] app dial.c: Make 'A' option pass COLP updates. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 29 07:27:02 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: app_dial.c: Make 'A' option pass COLP updates.
......................................................................


app_dial.c: Make 'A' option pass COLP updates.

While the 'A' option is playing the announcement file allow the caller and
peer to exchange COLP update frames.

ASTERISK-25423
Reported by: John Hardin

Change-Id: Iac6cf89b56d26452c6bb88e9363622bbf23895f9
---
M apps/app_dial.c
1 file changed, 33 insertions(+), 17 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/apps/app_dial.c b/apps/app_dial.c
index 6461c40..945e01e 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -2748,34 +2748,50 @@
 
 				active_chan = ast_waitfor_n(chans, 2, &ms);
 				if (active_chan) {
+					struct ast_channel *other_chan;
 					struct ast_frame *fr = ast_read(active_chan);
+
 					if (!fr) {
 						ast_autoservice_chan_hangup_peer(chan, peer);
 						res = -1;
 						goto done;
 					}
-					switch(fr->frametype) {
-						case AST_FRAME_DTMF_END:
-							digit = fr->subclass.integer;
-							if (active_chan == peer && strchr(AST_DIGIT_ANY, res)) {
-								ast_stopstream(peer);
-								res = ast_senddigit(chan, digit, 0);
+					switch (fr->frametype) {
+					case AST_FRAME_DTMF_END:
+						digit = fr->subclass.integer;
+						if (active_chan == peer && strchr(AST_DIGIT_ANY, res)) {
+							ast_stopstream(peer);
+							res = ast_senddigit(chan, digit, 0);
+						}
+						break;
+					case AST_FRAME_CONTROL:
+						switch (fr->subclass.integer) {
+						case AST_CONTROL_HANGUP:
+							ast_frfree(fr);
+							ast_autoservice_chan_hangup_peer(chan, peer);
+							res = -1;
+							goto done;
+						case AST_CONTROL_CONNECTED_LINE:
+							/* Pass COLP update to the other channel. */
+							if (active_chan == chan) {
+								other_chan = peer;
+							} else {
+								other_chan = chan;
 							}
-							break;
-						case AST_FRAME_CONTROL:
-							switch (fr->subclass.integer) {
-								case AST_CONTROL_HANGUP:
-									ast_frfree(fr);
-									ast_autoservice_chan_hangup_peer(chan, peer);
-									res = -1;
-									goto done;
-								default:
-									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)) {
+								ast_indicate_data(other_chan, fr->subclass.integer,
+									fr->data.ptr, fr->datalen);
 							}
 							break;
 						default:
-							/* Ignore all others */
 							break;
+						}
+						break;
+					default:
+						/* Ignore all others */
+						break;
 					}
 					ast_frfree(fr);
 				}

-- 
To view, visit https://gerrit.asterisk.org/1322
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac6cf89b56d26452c6bb88e9363622bbf23895f9
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list