mgcp/rtp: Only patch SSRC once after MDCX if enabled

Currently the output SSRC is always forced to be the same if SSRC
patching is enabled.

This patch modifies this to optionally restrict the number of SSRC
changes that will be corrected.

Note that the configuration only allows for the 'once' mode and 'off'.

Sponsored-by: On-Waves ehf
This commit is contained in:
Jacob Erlbeck 2013-12-03 15:13:12 +01:00
parent 3da9e4e441
commit e2292f3aa1
3 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@ struct mgcp_rtp_end {
char *fmtp_extra;
/* RTP patching */
int force_constant_ssrc;
int force_constant_ssrc; /* -1: always, 0: don't, 1: once */
int force_constant_timing;
/*

View File

@ -280,6 +280,8 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
timestamp;
state->patch = 1;
ssrc = state->orig_ssrc;
if (rtp_end->force_constant_ssrc != -1)
rtp_end->force_constant_ssrc -= 1;
LOGP(DMGCP, LOGL_NOTICE,
"SSRC patching enabled on 0x%x SSRC: %u "

View File

@ -619,8 +619,10 @@ void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
{
struct mgcp_trunk_config *tcfg = endp->tcfg;
int patch_ssrc = expect_ssrc_change && tcfg->force_constant_ssrc;
rtp->force_constant_timing = tcfg->force_constant_timing;
rtp->force_constant_ssrc = tcfg->force_constant_ssrc;
rtp->force_constant_ssrc = patch_ssrc ? 1 : 0;
LOGP(DMGCP, LOGL_DEBUG,
"Configuring RTP endpoint: local port %d%s%s\n",