aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-04 22:20:34 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-04 22:20:34 +0800
commitc02f11a04f59595853fff6571b3ac607a847724a (patch)
treeb44c98268dc65d8207ef4af4ae5c2ab64e10b370
parentf1f6bba16d96660226561c49833241bdff1f4a6b (diff)
mgcp: Pass the whole endpoint to the patch method.
-rw-r--r--openbsc/src/mgcp/mgcp_network.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index f90a623c..43de91b0 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -94,8 +94,8 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp)
endp->net_rtp, buf, 1);
}
-static void patch_and_count(struct mgcp_rtp_state *state, int payload, int conn_mode,
- struct sockaddr_in *addr, int endp_no, char *data, int len)
+static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *state,
+ int payload, struct sockaddr_in *addr, char *data, int len)
{
uint16_t seq;
uint32_t timestamp;
@@ -120,8 +120,8 @@ static void patch_and_count(struct mgcp_rtp_state *state, int payload, int conn_
//state->patch = 1;
LOGP(DMGCP, LOGL_NOTICE,
"The SSRC changed on 0x%x SSRC: %u offset: %d from %s:%d in %d\n",
- endp_no, state->ssrc, state->seq_offset,
- inet_ntoa(addr->sin_addr), ntohs(addr->sin_port), conn_mode);
+ ENDPOINT_NUMBER(endp), state->ssrc, state->seq_offset,
+ inet_ntoa(addr->sin_addr), ntohs(addr->sin_port), endp->conn_mode);
}
/* apply the offset and store it back to the packet */
@@ -237,19 +237,17 @@ static int rtp_data_cb(struct bsc_fd *fd, unsigned int what)
if (dest == DEST_NETWORK) {
if (proto == PROTO_RTP)
- patch_and_count(&endp->bts_state,
- endp->net_payload_type, endp->conn_mode,
- &addr,
- ENDPOINT_NUMBER(endp), buf, rc);
+ patch_and_count(endp, &endp->bts_state,
+ endp->net_payload_type,
+ &addr, buf, rc);
return udp_send(fd->fd, &endp->remote,
proto == PROTO_RTP ? endp->net_rtp : endp->net_rtcp,
buf, rc);
} else {
if (proto == PROTO_RTP)
- patch_and_count(&endp->net_state,
- endp->bts_payload_type, endp->conn_mode,
- &addr,
- ENDPOINT_NUMBER(endp), buf, rc);
+ patch_and_count(endp, &endp->net_state,
+ endp->bts_payload_type,
+ &addr, buf, rc);
return udp_send(fd->fd, &endp->bts,
proto == PROTO_RTP ? endp->bts_rtp : endp->bts_rtcp,
buf, rc);