pespin has uploaded this change for review.

View Change

TODO: move mgcp_rtp_end_config

Change-Id: I7f2209f50424903cfefad53b4278b712fda51ce5
---
M include/osmocom/mgcp/mgcp_rtp_end.h
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_rtp_end.c
3 files changed, 26 insertions(+), 18 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/39218/1
diff --git a/include/osmocom/mgcp/mgcp_rtp_end.h b/include/osmocom/mgcp/mgcp_rtp_end.h
index 02554cb..5d644b1 100644
--- a/include/osmocom/mgcp/mgcp_rtp_end.h
+++ b/include/osmocom/mgcp/mgcp_rtp_end.h
@@ -51,3 +51,10 @@
void mgcp_rtp_end_set_packet_duration_ms(struct mgcp_rtp_end *end, uint32_t packet_duration_ms);
bool mgcp_rtp_end_remote_addr_available(const struct mgcp_rtp_end *rtp_end);
void mgcp_rtp_end_free_port(struct mgcp_rtp_end *end);
+
+void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
+ struct mgcp_rtp_end *rtp);
+
+uint32_t mgcp_rtp_packet_duration(const struct mgcp_endpoint *endp,
+ const struct mgcp_rtp_end *rtp);
+
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 48bb28b..33b48e1 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -722,24 +722,6 @@
return 0;
}

-void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
- struct mgcp_rtp_end *rtp)
-{
- struct mgcp_trunk *trunk = endp->trunk;
-
- bool patch_ssrc = expect_ssrc_change && trunk->force_constant_ssrc;
-
- rtp->force_aligned_timing = trunk->force_aligned_timing;
- rtp->force_constant_ssrc = patch_ssrc ? 1 : 0;
- rtp->rfc5993_hr_convert = trunk->rfc5993_hr_convert;
-
- LOGPENDP(endp, DLMGCP, LOGL_DEBUG,
- "Configuring RTP endpoint: local port %d%s%s\n",
- osmo_sockaddr_port(&rtp->addr.u.sa),
- rtp->force_aligned_timing ? ", force constant timing" : "",
- rtp->force_constant_ssrc ? ", force constant ssrc" : "");
-}
-
uint32_t mgcp_rtp_packet_duration(const struct mgcp_endpoint *endp,
const struct mgcp_rtp_end *rtp)
{
diff --git a/src/libosmo-mgcp/mgcp_rtp_end.c b/src/libosmo-mgcp/mgcp_rtp_end.c
index c9dbc54..85794f6 100644
--- a/src/libosmo-mgcp/mgcp_rtp_end.c
+++ b/src/libosmo-mgcp/mgcp_rtp_end.c
@@ -98,3 +98,22 @@
end->rtcp = NULL;
}
}
+
+/* TODO: move this here, maybe split this actually into 2 funcs due to a VTY command setting a loopback using it: */
+void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change,
+ struct mgcp_rtp_end *rtp)
+{
+ struct mgcp_trunk *trunk = endp->trunk;
+
+ bool patch_ssrc = expect_ssrc_change && trunk->force_constant_ssrc;
+
+ rtp->force_aligned_timing = trunk->force_aligned_timing;
+ rtp->force_constant_ssrc = patch_ssrc ? 1 : 0;
+ rtp->rfc5993_hr_convert = trunk->rfc5993_hr_convert;
+
+ LOGPENDP(endp, DLMGCP, LOGL_DEBUG,
+ "Configuring RTP endpoint: local port %d%s%s\n",
+ osmo_sockaddr_port(&rtp->addr.u.sa),
+ rtp->force_aligned_timing ? ", force constant timing" : "",
+ rtp->force_constant_ssrc ? ", force constant ssrc" : "");
+}

To view, visit change 39218. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I7f2209f50424903cfefad53b4278b712fda51ce5
Gerrit-Change-Number: 39218
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>