aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-05 22:32:10 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-05 22:32:10 +0000
commit277beb94a0f5aa85eeb0603f6d11319cce02c3cd (patch)
tree32a4e75de52a4d00eb32bb5917c271f775d0743e /main
parent1de0d5b8308435068cf5a04314bfd98cc712c8ee (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@106235 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c12
-rw-r--r--main/dial.c4
-rw-r--r--main/file.c1
-rw-r--r--main/rtp.c6
4 files changed, 21 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index 16881a3d5..73c7db603 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2372,6 +2372,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);
@@ -2890,6 +2892,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;
@@ -3774,6 +3777,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:
@@ -3907,6 +3911,10 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
if (!c1->tech->send_digit_begin)
ast_set_flag(c0, AST_FLAG_END_DTMF_ONLY);
+ /* 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;
@@ -4070,6 +4078,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;
diff --git a/main/dial.c b/main/dial.c
index 807ba12c3..e96e776de 100644
--- a/main/dial.c
+++ b/main/dial.c
@@ -358,6 +358,10 @@ static void handle_frame(struct ast_dial *dial, struct ast_dial_channel *channel
ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_VIDUPDATE);
break;
+ case AST_CONTROL_SRCUPDATE:
+ if (option_verbose > 2)
+ ast_verbose (VERBOSE_PREFIX_3 "%s requested a source update, passing it to %s\n", channel->owner->name, chan->name);
+ ast_indicate(chan, AST_CONTROL_SRCUPDATE);
case AST_CONTROL_PROCEEDING:
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
diff --git a/main/file.c b/main/file.c
index c1ff4c39a..809eb43c0 100644
--- a/main/file.c
+++ b/main/file.c
@@ -1159,6 +1159,7 @@ static int waitstream_core(struct ast_channel *c, const char *breakon,
case AST_CONTROL_RINGING:
case AST_CONTROL_ANSWER:
case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
case AST_CONTROL_HOLD:
case AST_CONTROL_UNHOLD:
/* Unimportant */
diff --git a/main/rtp.c b/main/rtp.c
index 6578c400e..b5864f916 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -2968,7 +2968,8 @@ static enum ast_bridge_result bridge_native_loop(struct ast_channel *c0, struct
} else if ((fr->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS)) {
if ((fr->subclass == AST_CONTROL_HOLD) ||
(fr->subclass == AST_CONTROL_UNHOLD) ||
- (fr->subclass == AST_CONTROL_VIDUPDATE)) {
+ (fr->subclass == AST_CONTROL_VIDUPDATE) ||
+ (fr->subclass == AST_CONTROL_SRCUPDATE)) {
if (fr->subclass == AST_CONTROL_HOLD) {
/* If we someone went on hold we want the other side to reinvite back to us */
if (who == c0)
@@ -3199,7 +3200,8 @@ static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast
} else if ((fr->frametype == AST_FRAME_CONTROL) && !(flags & AST_BRIDGE_IGNORE_SIGS)) {
if ((fr->subclass == AST_CONTROL_HOLD) ||
(fr->subclass == AST_CONTROL_UNHOLD) ||
- (fr->subclass == AST_CONTROL_VIDUPDATE)) {
+ (fr->subclass == AST_CONTROL_VIDUPDATE) ||
+ (fr->subclass == AST_CONTROL_SRCUPDATE)) {
/* If we are going on hold, then break callback mode and P2P bridging */
if (fr->subclass == AST_CONTROL_HOLD) {
if (p0_callback)