Change in osmo-mgw[master]: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jul 31 17:18:14 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10171 )

Change subject: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well
......................................................................

mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well

The regular version of the mgcp_client supports the configuration of of
custom payload types. In case some corner cases require a specific
dynamic paylod type number that is not according to 3GPP standards has
to be used the user can override the standard settings. However the fsm
based variant of the mgcp_client does not have that feature but it
should have it as well.

- add struct members for ptmap config.
- pass configuration values down to the underlying magcp client.

Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2
Related: OS#2728
Related: OS#3384
---
M include/osmocom/mgcp_client/mgcp_client_fsm.h
M src/libosmo-mgcp-client/mgcp_client_fsm.c
2 files changed, 17 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h
index 353baff..81d3dea 100644
--- a/include/osmocom/mgcp_client/mgcp_client_fsm.h
+++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h
@@ -34,6 +34,14 @@
 
 	/*! Number of codecs in RTP codec list (optional) */
 	unsigned int codecs_len;
+
+	/*! RTP payload type map (optional, only needed when payload types are
+	 * used that differ from what IANA/3GPP defines) */
+	struct ptmap ptmap[MGCP_MAX_CODECS];
+
+	/*! RTP payload type map length (optional, only needed when payload
+	 * types are used that differ from what IANA/3GPP defines) */
+	unsigned int ptmap_len;
 };
 
 struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt,
diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c
index fe1590f..a0dc0fb 100644
--- a/src/libosmo-mgcp-client/mgcp_client_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c
@@ -114,10 +114,12 @@
 		.call_id = mgcp_ctx->conn_peer_local.call_id,
 		.conn_mode = MGCP_CONN_RECV_ONLY,
 		.ptime = mgcp_ctx->conn_peer_local.ptime,
-		.codecs_len = mgcp_ctx->conn_peer_local.codecs_len
+		.codecs_len = mgcp_ctx->conn_peer_local.codecs_len,
+		.ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len
 	};
 	osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_local.endpoint, MGCP_ENDPOINT_MAXLEN);
 	memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs));
+	memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap));
 
 	return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg);
 }
@@ -136,10 +138,12 @@
 		.audio_ip = mgcp_ctx->conn_peer_local.addr,
 		.audio_port = mgcp_ctx->conn_peer_local.port,
 		.ptime = mgcp_ctx->conn_peer_local.ptime,
-		.codecs_len = mgcp_ctx->conn_peer_local.codecs_len
+		.codecs_len = mgcp_ctx->conn_peer_local.codecs_len,
+		.ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len
 	};
 	osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_local.endpoint, MGCP_ENDPOINT_MAXLEN);
 	memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs));
+	memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap));
 
 	return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg);
 }
@@ -158,10 +162,12 @@
 		.audio_ip = mgcp_ctx->conn_peer_local.addr,
 		.audio_port = mgcp_ctx->conn_peer_local.port,
 		.ptime = mgcp_ctx->conn_peer_local.ptime,
-		.codecs_len = mgcp_ctx->conn_peer_local.codecs_len
+		.codecs_len = mgcp_ctx->conn_peer_local.codecs_len,
+		.ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len
 	};
 	osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_remote.endpoint, MGCP_ENDPOINT_MAXLEN);
 	memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs));
+	memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap));
 
 	/* Note: We take the endpoint and the call_id from the remote
 	 * connection info, because we can be confident that the

-- 
To view, visit https://gerrit.osmocom.org/10171
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2
Gerrit-Change-Number: 10171
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180731/a2622edb/attachment.htm>


More information about the gerrit-log mailing list