aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 618fdd7ca..6d80d466f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -811,12 +811,11 @@ struct sip_auth {
#define SIP_PAGE2_UDPTL_DESTINATION (1 << 28) /*!< 28: Use source IP of RTP as destination if NAT is enabled */
#define SIP_PAGE2_DIALOG_ESTABLISHED (1 << 29) /*!< 29: Has a dialog been established? */
#define SIP_PAGE2_RPORT_PRESENT (1 << 30) /*!< 30: Was rport received in the Via header? */
-#define SIP_PAGE2_CONSTANT_SSRC (1 << 31) /*!< 31: Don't change SSRC on reinvite */
#define SIP_PAGE2_FLAGS_TO_COPY \
(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | \
SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | SIP_PAGE2_BUGGY_MWI | \
- SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_CONSTANT_SSRC)
+ SIP_PAGE2_UDPTL_DESTINATION)
/* SIP packet flags */
#define SIP_PKT_DEBUG (1 << 0) /*!< Debug this packet */
@@ -2952,9 +2951,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;
@@ -2965,9 +2961,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);
- }
}
ast_string_field_set(dialog, peername, peer->name);
@@ -3871,6 +3864,7 @@ static int sip_answer(struct ast_channel *ast)
if (option_debug)
ast_log(LOG_DEBUG, "SIP answering channel: %s\n", ast->name);
+ ast_rtp_update_source(p->rtp);
res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
}
@@ -3905,7 +3899,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, 1);
@@ -4153,11 +4147,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 */
@@ -4168,7 +4162,10 @@ static int sip_indicate(struct ast_channel *ast, int condition, const void *data
res = -1;
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;
@@ -15085,14 +15082,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;
if (option_debug > 1)
@@ -17574,9 +17563,6 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
} else if (!strcasecmp(v->name, "t38pt_usertpsource")) {
ast_set_flag(&mask[1], SIP_PAGE2_UDPTL_DESTINATION);
ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_UDPTL_DESTINATION);
- } 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
res = 0;
@@ -18650,8 +18636,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, "shrinkcallerid")) {
if (ast_true(v->value)) {
global_shrinkcallerid = 1;