summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2008-03-05 22:43:22 +0000
committerJoshua Colp <jcolp@digium.com>2008-03-05 22:43:22 +0000
commit496adc6fc08da92e9c151829ed1db9e9fc480ce4 (patch)
treea996e649bf519c5eb10d31e1e353e551a9fca363 /main/channel.c
parent82b3a87fd7fd93f1c62b512d1c03cd8d5e33de07 (diff)
Merged revisions 106235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106235 | file | 2008-03-05 18:32:10 -0400 (Wed, 05 Mar 2008) | 4 lines Add a control frame to indicate the source of media has changed. Depending on the underlying technology it may need to change some things. (closes issue #12148) Reported by: jcomellas ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index ecb12ac57..3c68a71b7 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2745,6 +2745,8 @@ int ast_indicate_data(struct ast_channel *chan, int condition, const void *data,
/* Do nothing.... */
} else if (condition == AST_CONTROL_VIDUPDATE) {
/* Do nothing.... */
+ } else if (condition == AST_CONTROL_SRCUPDATE) {
+ /* Do nothing... */
} else {
/* not handled */
ast_log(LOG_WARNING, "Unable to handle indication %d for '%s'\n", condition, chan->name);
@@ -3272,6 +3274,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d
case AST_CONTROL_HOLD:
case AST_CONTROL_UNHOLD:
case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
case -1: /* Ignore -- just stopping indications */
break;
@@ -4156,6 +4159,7 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
case AST_CONTROL_HOLD:
case AST_CONTROL_UNHOLD:
case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
ast_indicate_data(other, f->subclass, f->data, f->datalen);
break;
default:
@@ -4318,6 +4322,10 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
ast_set_flag(c0, AST_FLAG_END_DTMF_ONLY);
manager_bridge_event(1, 1, c0, c1);
+ /* Before we enter in and bridge these two together tell them both the source of audio has changed */
+ ast_indicate(c0, AST_CONTROL_SRCUPDATE);
+ ast_indicate(c1, AST_CONTROL_SRCUPDATE);
+
for (/* ever */;;) {
struct timeval now = { 0, };
int to;
@@ -4470,6 +4478,10 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
ast_clear_flag(c0, AST_FLAG_END_DTMF_ONLY);
ast_clear_flag(c1, AST_FLAG_END_DTMF_ONLY);
+ /* Now that we have broken the bridge the source will change yet again */
+ ast_indicate(c0, AST_CONTROL_SRCUPDATE);
+ ast_indicate(c1, AST_CONTROL_SRCUPDATE);
+
c0->_bridge = NULL;
c1->_bridge = NULL;