aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-13 00:00:16 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-03-13 00:00:16 +0000
commit1d3c85d7d27ccdc82968519bdf33825efbd32c9c (patch)
tree5c8668fbd75d2b72f3c9bd6ff4ea76f7ccb6b519 /channels
parent1e0e6b20839192d12981acc0afe22be62147e872 (diff)
Merged revisions 252089 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r252089 | twilson | 2010-03-12 16:04:51 -0600 (Fri, 12 Mar 2010) | 20 lines Only change the RTP ssrc when we see that it has changed This change basically reverts the change reviewed in https://reviewboard.asterisk.org/r/374/ and instead limits the updating of the RTP synchronization source to only those times when we detect that the other side of the conversation has changed the ssrc. The problem is that SRCUPDATE control frames are sent many times where we don't want a new ssrc, including whenever Asterisk has to send DTMF in a normal bridge. This is also not the first time that this mistake has been made. The initial implementation of the ast_rtp_new_source function also changed the ssrc--and then it was removed because of this same issue. Then, we put it back in again to fix a different issue. This patch attempts to only change the ssrc when we see that the other side of the conversation has changed the ssrc. It also renames some functions to make their purpose more clear. Review: https://reviewboard.asterisk.org/r/540/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@252135 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_h323.c6
-rw-r--r--channels/chan_mgcp.c5
-rw-r--r--channels/chan_sip.c35
-rw-r--r--channels/chan_skinny.c5
4 files changed, 22 insertions, 29 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 68b64d979..32ba5060e 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -914,7 +914,11 @@ static int oh323_indicate(struct ast_channel *c, int condition, const void *data
res = 0;
break;
case AST_CONTROL_SRCUPDATE:
- ast_rtp_new_source(pvt->rtp);
+ ast_rtp_update_source(pvt->rtp);
+ res = 0;
+ break;
+ case AST_CONTROL_SRCCHANGE:
+ ast_rtp_change_source(pvt->rtp);
res = 0;
break;
case AST_CONTROL_PROCEEDING:
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 7536ea0e0..f30ddd15c 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -1480,7 +1480,10 @@ static int mgcp_indicate(struct ast_channel *ast, int ind, const void *data, siz
ast_moh_stop(ast);
break;
case AST_CONTROL_SRCUPDATE:
- ast_rtp_new_source(sub->rtp);
+ ast_rtp_update_source(sub->rtp);
+ break;
+ case AST_CONTROL_SRCCHANGE:
+ ast_rtp_change_source(sub->rtp);
break;
case -1:
transmit_notify_request(sub, "");
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 0d24aa8c2..7bd17a3ad 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1064,7 +1064,6 @@ struct sip_auth {
#define SIP_PAGE2_RTCACHEFRIENDS (1 << 0) /*!< GP: Should we keep RT objects in memory for extended time? */
#define SIP_PAGE2_RTAUTOCLEAR (1 << 2) /*!< GP: Should we clean memory from peers after expiry? */
/* Space for addition of other realtime flags in the future */
-#define SIP_PAGE2_CONSTANT_SSRC (1 << 8) /*!< GDP: Don't change SSRC on reinvite */
#define SIP_PAGE2_STATECHANGEQUEUE (1 << 9) /*!< D: Unsent state pending change exists */
#define SIP_PAGE2_RPORT_PRESENT (1 << 10) /*!< Was rport received in the Via header? */
@@ -1097,7 +1096,7 @@ struct sip_auth {
(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_IGNORESDPVERSION | \
SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | \
SIP_PAGE2_BUGGY_MWI | SIP_PAGE2_TEXTSUPPORT | \
- SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_CONSTANT_SSRC | SIP_PAGE2_FAX_DETECT)
+ SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_FAX_DETECT)
/*@}*/
@@ -4773,9 +4772,6 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
ast_rtp_set_rtptimeout(dialog->rtp, peer->rtptimeout);
ast_rtp_set_rtpholdtimeout(dialog->rtp, peer->rtpholdtimeout);
ast_rtp_set_rtpkeepalive(dialog->rtp, peer->rtpkeepalive);
- if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_CONSTANT_SSRC)) {
- ast_rtp_set_constantssrc(dialog->rtp);
- }
/* Set Frame packetization */
ast_rtp_codec_setpref(dialog->rtp, &dialog->prefs);
dialog->autoframing = peer->autoframing;
@@ -4786,9 +4782,6 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
ast_rtp_set_rtptimeout(dialog->vrtp, peer->rtptimeout);
ast_rtp_set_rtpholdtimeout(dialog->vrtp, peer->rtpholdtimeout);
ast_rtp_set_rtpkeepalive(dialog->vrtp, peer->rtpkeepalive);
- if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_CONSTANT_SSRC)) {
- ast_rtp_set_constantssrc(dialog->vrtp);
- }
}
if (dialog->trtp) { /* Realtime text */
ast_rtp_setdtmf(dialog->trtp, 0);
@@ -5792,7 +5785,7 @@ static int sip_answer(struct ast_channel *ast)
ast_setstate(ast, AST_STATE_UP);
ast_debug(1, "SIP answering channel: %s\n", ast->name);
- ast_rtp_new_source(p->rtp);
+ ast_rtp_update_source(p->rtp);
res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, FALSE);
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
}
@@ -5827,7 +5820,7 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
if ((ast->_state != AST_STATE_UP) &&
!ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
!ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
- ast_rtp_new_source(p->rtp);
+ ast_rtp_update_source(p->rtp);
if (!global_prematuremediafilter) {
p->invitestate = INV_EARLY_MEDIA;
transmit_provisional_response(p, "183 Session Progress", &p->initreq, TRUE);
@@ -6150,11 +6143,11 @@ static int sip_indicate(struct ast_channel *ast, int condition, const void *data
res = -1;
break;
case AST_CONTROL_HOLD:
- ast_rtp_new_source(p->rtp);
+ ast_rtp_update_source(p->rtp);
ast_moh_start(ast, data, p->mohinterpret);
break;
case AST_CONTROL_UNHOLD:
- ast_rtp_new_source(p->rtp);
+ ast_rtp_update_source(p->rtp);
ast_moh_stop(ast);
break;
case AST_CONTROL_VIDUPDATE: /* Request a video frame update */
@@ -6173,7 +6166,10 @@ static int sip_indicate(struct ast_channel *ast, int condition, const void *data
}
break;
case AST_CONTROL_SRCUPDATE:
- ast_rtp_new_source(p->rtp);
+ ast_rtp_update_source(p->rtp);
+ break;
+ case AST_CONTROL_SRCCHANGE:
+ ast_rtp_change_source(p->rtp);
break;
case -1:
res = -1;
@@ -19092,14 +19088,6 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
res = -1;
goto request_invite_cleanup;
}
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_CONSTANT_SSRC)) {
- if (p->rtp) {
- ast_rtp_set_constantssrc(p->rtp);
- }
- if (p->vrtp) {
- ast_rtp_set_constantssrc(p->vrtp);
- }
- }
} else { /* No SDP in invite, call control session */
p->jointcapability = p->capability;
ast_debug(2, "No SDP in Invite, third party call control\n");
@@ -22458,9 +22446,6 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
} else if (!strcasecmp(v->name, "buggymwi")) {
ast_set_flag(&mask[1], SIP_PAGE2_BUGGY_MWI);
ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_BUGGY_MWI);
- } else if (!strcasecmp(v->name, "constantssrc")) {
- ast_set_flag(&mask[1], SIP_PAGE2_CONSTANT_SSRC);
- ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_CONSTANT_SSRC);
} else if (!strcasecmp(v->name, "faxdetect")) {
ast_set_flag(&mask[1], SIP_PAGE2_FAX_DETECT);
ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_FAX_DETECT);
@@ -23860,8 +23845,6 @@ static int reload_config(enum channelreloadreason reason)
default_maxcallbitrate = DEFAULT_MAX_CALL_BITRATE;
} else if (!strcasecmp(v->name, "matchexterniplocally")) {
global_matchexterniplocally = ast_true(v->value);
- } else if (!strcasecmp(v->name, "constantssrc")) {
- ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_CONSTANT_SSRC);
} else if (!strcasecmp(v->name, "session-timers")) {
int i = (int) str2stmode(v->value);
if (i < 0) {
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index b9fe51548..9839ee2eb 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -3918,7 +3918,10 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
case AST_CONTROL_PROCEEDING:
break;
case AST_CONTROL_SRCUPDATE:
- ast_rtp_new_source(sub->rtp);
+ ast_rtp_update_source(sub->rtp);
+ break;
+ case AST_CONTROL_SRCCHANGE:
+ ast_rtp_change_source(sub->rtp);
break;
default:
ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);