client: add features to generate and parse codec information

The current implementation does not support any way to influence the
codec that is negotiated via SDP or LCO. The client statically
negotitates AMR on an invalid payload type number. Also we ignore
any codec information in the responses.

- Add struct members to allow setting of user defined codec information.
- Add struct members to retrieve parsed codec info from responses.
- Add code to generate codec information in SDP
- Add code to parse SDP codec info in MGCP responses

Change-Id: I78e72d41b73acfcb40599a0ff4823f17c3642059
Related: OS#2728
Related: OS#3334
diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c
index 25543ae..fe1590f 100644
--- a/src/libosmo-mgcp-client/mgcp_client_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c
@@ -113,8 +113,11 @@
 		.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE),
 		.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
 	};
 	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));
 
 	return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg);
 }
@@ -124,15 +127,19 @@
 	struct mgcp_msg mgcp_msg;
 
 	mgcp_msg = (struct mgcp_msg) {
-		.verb = MGCP_VERB_CRCX,.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID |
-						    MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP |
-						    MGCP_MSG_PRESENCE_AUDIO_PORT),
+		.verb = MGCP_VERB_CRCX,
+		.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID |
+			     MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP |
+			     MGCP_MSG_PRESENCE_AUDIO_PORT),
 		.call_id = mgcp_ctx->conn_peer_local.call_id,
 		.conn_mode = MGCP_CONN_RECV_SEND,
 		.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
 	};
 	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));
 
 	return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg);
 }
@@ -150,8 +157,11 @@
 		.conn_mode = MGCP_CONN_RECV_SEND,
 		.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
 	};
 	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));
 
 	/* Note: We take the endpoint and the call_id from the remote
 	 * connection info, because we can be confident that the
@@ -573,7 +583,7 @@
 	OSMO_ASSERT(mgcp);
 	OSMO_ASSERT(conn_peer);
 
-	/* Check if IP/Port informstaion in conn info makes sense */
+	/* Check if IP/Port information in conn info makes sense */
 	if (conn_peer->port && inet_aton(conn_peer->addr, &ip_test) == 0)
 		return NULL;