[svn-commits] file: trunk r106239 - in /trunk: ./ apps/ channels/ include/asterisk/ main/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Mar 5 16:43:22 CST 2008
Author: file
Date: Wed Mar 5 16:43:22 2008
New Revision: 106239
URL: http://svn.digium.com/view/asterisk?view=rev&rev=106239
Log:
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
........
Modified:
trunk/ (props changed)
trunk/apps/app_dial.c
trunk/apps/app_followme.c
trunk/channels/chan_alsa.c
trunk/channels/chan_console.c
trunk/channels/chan_h323.c
trunk/channels/chan_mgcp.c
trunk/channels/chan_oss.c
trunk/channels/chan_phone.c
trunk/channels/chan_sip.c
trunk/channels/chan_skinny.c
trunk/channels/chan_unistim.c
trunk/channels/chan_zap.c
trunk/include/asterisk/frame.h
trunk/main/channel.c
trunk/main/dial.c
trunk/main/file.c
trunk/main/rtp.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Wed Mar 5 16:43:22 2008
@@ -717,6 +717,10 @@
ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name);
ast_indicate(in, AST_CONTROL_VIDUPDATE);
break;
+ case AST_CONTROL_SRCUPDATE:
+ ast_verb(3, "%s requested a source update, passing it to %s\n", c->name, in->name);
+ ast_indicate(in, AST_CONTROL_SRCUPDATE);
+ break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
if (single && CAN_EARLY_BRIDGE(peerflags))
@@ -820,7 +824,8 @@
if (single && (f->frametype == AST_FRAME_CONTROL) &&
((f->subclass == AST_CONTROL_HOLD) ||
(f->subclass == AST_CONTROL_UNHOLD) ||
- (f->subclass == AST_CONTROL_VIDUPDATE))) {
+ (f->subclass == AST_CONTROL_VIDUPDATE) ||
+ (f->subclass == AST_CONTROL_SRCUPDATE))) {
ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
}
Modified: trunk/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_followme.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/apps/app_followme.c (original)
+++ trunk/apps/app_followme.c Wed Mar 5 16:43:22 2008
@@ -656,6 +656,9 @@
case AST_CONTROL_VIDUPDATE:
ast_verb(3, "%s requested a video update, passing it to %s\n", winner->name, caller->name);
break;
+ case AST_CONTROL_SRCUPDATE:
+ ast_verb(3, "%s requested a source update, passing it to %s\n", winner->name, caller->name);
+ break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding passing it to %s\n", winner->name,caller->name);
break;
Modified: trunk/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_alsa.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_alsa.c (original)
+++ trunk/channels/chan_alsa.c Wed Mar 5 16:43:22 2008
@@ -510,6 +510,7 @@
case AST_CONTROL_PROGRESS:
case AST_CONTROL_PROCEEDING:
case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
break;
case AST_CONTROL_HOLD:
ast_verbose(" << Console Has Been Placed on Hold >> \n");
Modified: trunk/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_console.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Wed Mar 5 16:43:22 2008
@@ -610,6 +610,7 @@
case AST_CONTROL_PROGRESS:
case AST_CONTROL_PROCEEDING:
case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
break;
case AST_CONTROL_HOLD:
ast_verb(1, V_BEGIN "Console Has Been Placed on Hold" V_END);
Modified: trunk/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_h323.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Wed Mar 5 16:43:22 2008
@@ -914,6 +914,10 @@
ast_moh_stop(c);
res = 0;
break;
+ case AST_CONTROL_SRCUPDATE:
+ ast_rtp_new_source(pvt->rtp);
+ res = 0;
+ break;
case AST_CONTROL_PROCEEDING:
case -1:
break;
Modified: trunk/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Wed Mar 5 16:43:22 2008
@@ -1478,6 +1478,9 @@
break;
case AST_CONTROL_UNHOLD:
ast_moh_stop(ast);
+ break;
+ case AST_CONTROL_SRCUPDATE:
+ ast_rtp_new_source(sub->rtp);
break;
case -1:
transmit_notify_request(sub, "");
Modified: trunk/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_oss.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_oss.c (original)
+++ trunk/channels/chan_oss.c Wed Mar 5 16:43:22 2008
@@ -764,6 +764,7 @@
case AST_CONTROL_PROGRESS:
case AST_CONTROL_PROCEEDING:
case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
break;
case AST_CONTROL_HOLD:
ast_verbose(" << Console Has Been Placed on Hold >> \n");
Modified: trunk/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_phone.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_phone.c (original)
+++ trunk/channels/chan_phone.c Wed Mar 5 16:43:22 2008
@@ -206,21 +206,24 @@
int res=-1;
ast_debug(1, "Requested indication %d on channel %s\n", condition, chan->name);
switch(condition) {
- case AST_CONTROL_FLASH:
- ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_ON_HOOK);
- usleep(320000);
- ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_OFF_HOOK);
+ case AST_CONTROL_FLASH:
+ ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_ON_HOOK);
+ usleep(320000);
+ ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_OFF_HOOK);
p->lastformat = -1;
res = 0;
break;
- case AST_CONTROL_HOLD:
- ast_moh_start(chan, data, NULL);
- break;
- case AST_CONTROL_UNHOLD:
- ast_moh_stop(chan);
- break;
- default:
- ast_log(LOG_WARNING, "Condition %d is not supported on channel %s\n", condition, chan->name);
+ case AST_CONTROL_HOLD:
+ ast_moh_start(chan, data, NULL);
+ break;
+ case AST_CONTROL_UNHOLD:
+ ast_moh_stop(chan);
+ break;
+ case AST_CONTROL_SRCUPDATE:
+ res = 0;
+ break;
+ default:
+ ast_log(LOG_WARNING, "Condition %d is not supported on channel %s\n", condition, chan->name);
}
return res;
}
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Mar 5 16:43:22 2008
@@ -5139,6 +5139,9 @@
break;
}
}
+ break;
+ case AST_CONTROL_SRCUPDATE:
+ ast_rtp_new_source(p->rtp);
break;
case -1:
res = -1;
Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Wed Mar 5 16:43:22 2008
@@ -3650,6 +3650,9 @@
break;
case AST_CONTROL_PROCEEDING:
break;
+ case AST_CONTROL_SRCUPDATE:
+ ast_rtp_new_source(sub->rtp);
+ break;
default:
ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
return -1;
Modified: trunk/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Wed Mar 5 16:43:22 2008
@@ -4117,6 +4117,7 @@
ast_moh_stop(ast);
break;
case AST_CONTROL_PROGRESS:
+ case AST_CONTROL_SRCUPDATE:
break;
case -1:
ast_playtones_stop(ast);
Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Wed Mar 5 16:43:22 2008
@@ -5812,6 +5812,9 @@
res = 0;
} else
res = 0;
+ break;
+ case AST_CONTROL_SRCUPDATE:
+ res = 0;
break;
case -1:
res = tone_zone_play_tone(p->subs[index].zfd, -1);
Modified: trunk/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/frame.h?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/include/asterisk/frame.h (original)
+++ trunk/include/asterisk/frame.h Wed Mar 5 16:43:22 2008
@@ -83,6 +83,7 @@
\arg \b HOLD Call is placed on hold
\arg \b UNHOLD Call is back from hold
\arg \b VIDUPDATE Video update requested
+ \arg \b SRCUPDATE The source of media has changed
*/
@@ -292,7 +293,8 @@
AST_CONTROL_HOLD = 16, /*!< Indicate call is placed on hold */
AST_CONTROL_UNHOLD = 17, /*!< Indicate call is left from hold */
AST_CONTROL_VIDUPDATE = 18, /*!< Indicate video frame update */
- AST_CONTROL_T38 = 19 /*!< T38 state change request/notification */
+ AST_CONTROL_T38 = 19, /*!< T38 state change request/notification */
+ AST_CONTROL_SRCUPDATE = 20, /*!< Indicate source of media has changed */
};
enum ast_control_t38 {
Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Wed Mar 5 16:43:22 2008
@@ -2745,6 +2745,8 @@
/* 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 @@
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 @@
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:
@@ -4317,6 +4321,10 @@
if (!c1->tech->send_digit_begin)
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, };
@@ -4470,6 +4478,10 @@
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;
Modified: trunk/main/dial.c
URL: http://svn.digium.com/view/asterisk/trunk/main/dial.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/main/dial.c (original)
+++ trunk/main/dial.c Wed Mar 5 16:43:22 2008
@@ -422,6 +422,10 @@
ast_verb(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:
ast_verb(3, "%s is proceeding, passing it to %s\n", channel->owner->name, chan->name);
ast_indicate(chan, AST_CONTROL_PROCEEDING);
Modified: trunk/main/file.c
URL: http://svn.digium.com/view/asterisk/trunk/main/file.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/main/file.c (original)
+++ trunk/main/file.c Wed Mar 5 16:43:22 2008
@@ -1136,6 +1136,7 @@
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 */
Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?view=diff&rev=106239&r1=106238&r2=106239
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Wed Mar 5 16:43:22 2008
@@ -3376,7 +3376,8 @@
if ((fr->subclass == AST_CONTROL_HOLD) ||
(fr->subclass == AST_CONTROL_UNHOLD) ||
(fr->subclass == AST_CONTROL_VIDUPDATE) ||
- (fr->subclass == AST_CONTROL_T38)) {
+ (fr->subclass == AST_CONTROL_T38) ||
+ (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)
@@ -3615,7 +3616,8 @@
if ((fr->subclass == AST_CONTROL_HOLD) ||
(fr->subclass == AST_CONTROL_UNHOLD) ||
(fr->subclass == AST_CONTROL_VIDUPDATE) ||
- (fr->subclass == AST_CONTROL_T38)) {
+ (fr->subclass == AST_CONTROL_T38) ||
+ (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)
More information about the svn-commits
mailing list