diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-05 12:07:00 +0000 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-08 07:23:22 +0800 |
commit | 6bb3065e6dc36d018aeab0deb2ee6ccb7fc28298 (patch) | |
tree | b4ffd9061cd5c8ecb24b0940a31b87a3ed883139 | |
parent | 3c30a4bb1f3d35bec6f2eb975084cba58dca4134 (diff) |
mgcp: Patch RTP packets again if that is allowed.
-rw-r--r-- | openbsc/include/openbsc/mgcp_internal.h | 3 | ||||
-rw-r--r-- | openbsc/src/mgcp/mgcp_network.c | 2 | ||||
-rw-r--r-- | openbsc/src/mgcp/mgcp_protocol.c | 1 | ||||
-rw-r--r-- | openbsc/src/mgcp/mgcp_vty.c | 1 |
4 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h index 92e5f9955..bdcd03030 100644 --- a/openbsc/include/openbsc/mgcp_internal.h +++ b/openbsc/include/openbsc/mgcp_internal.h @@ -86,6 +86,9 @@ struct mgcp_endpoint { /* sequence bits */ struct mgcp_rtp_state net_state; struct mgcp_rtp_state bts_state; + + /* SSRC/seq/ts patching for loop */ + int allow_patch; }; #define ENDPOINT_NUMBER(endp) abs(endp - endp->cfg->endpoints) diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c index 735defadd..39856de29 100644 --- a/openbsc/src/mgcp/mgcp_network.c +++ b/openbsc/src/mgcp/mgcp_network.c @@ -117,7 +117,7 @@ static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *s state->ssrc = rtp_hdr->ssrc; state->seq_offset = (state->seq_no + 1) - seq; state->timestamp_offset = state->last_timestamp - timestamp; - //state->patch = 1; + state->patch = endp->allow_patch; LOGP(DMGCP, LOGL_NOTICE, "The SSRC changed on 0x%x SSRC: %u offset: %d from %s:%d in %d\n", ENDPOINT_NUMBER(endp), state->ssrc, state->seq_offset, diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c index a9827cbf4..19dd05505 100644 --- a/openbsc/src/mgcp/mgcp_protocol.c +++ b/openbsc/src/mgcp/mgcp_protocol.c @@ -825,4 +825,5 @@ void mgcp_free_endp(struct mgcp_endpoint *endp) memset(&endp->bts_state, 0, sizeof(endp->bts_state)); endp->conn_mode = endp->orig_mode = MGCP_CONN_NONE; + endp->allow_patch = 0; } diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c index 0254dc36f..11ac07745 100644 --- a/openbsc/src/mgcp/mgcp_vty.c +++ b/openbsc/src/mgcp/mgcp_vty.c @@ -304,6 +304,7 @@ DEFUN(loop_endp, endp->conn_mode = MGCP_CONN_LOOPBACK; else endp->conn_mode = endp->orig_mode; + endp->allow_patch = 1; return CMD_SUCCESS; } |