summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-08 12:19:30 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-18 17:50:08 +0200
commit188a804f6df55a66185054e664d6b3a998e7a371 (patch)
treef6157671c1945e024d166df7bc79d980faf6f8e2
parent1728a6eb188a887a636f3eb8a01a6b09ad2515f5 (diff)
mgcp: add DLCX command to mgcpgw client
The mgcpgw client currently lacks support for DLCX. This patch adds a generator function to generate a DLCX command as well.
-rw-r--r--openbsc/include/openbsc/mgcpgw_client.h4
-rw-r--r--openbsc/src/libmgcp/mgcpgw_client.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcpgw_client.h b/openbsc/include/openbsc/mgcpgw_client.h
index b353db0..8220cfa 100644
--- a/openbsc/include/openbsc/mgcpgw_client.h
+++ b/openbsc/include/openbsc/mgcpgw_client.h
@@ -24,6 +24,8 @@ struct mgcpgw_client_conf {
int local_port;
const char *remote_addr;
int remote_port;
+ unsigned int first_endpoint;
+ unsigned int last_endpoint;
};
struct mgcp_response_head {
@@ -76,6 +78,8 @@ struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp,
uint16_t rtp_endpoint, const char *rtp_conn_addr,
uint16_t rtp_port, enum mgcp_connection_mode mode);
+struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint);
+
void mgcpgw_client_vty_init(int node, struct mgcpgw_client_conf *conf);
int mgcpgw_client_config_write(struct vty *vty, const char *indent);
diff --git a/openbsc/src/libmgcp/mgcpgw_client.c b/openbsc/src/libmgcp/mgcpgw_client.c
index 5a850ea..0c21067 100644
--- a/openbsc/src/libmgcp/mgcpgw_client.c
+++ b/openbsc/src/libmgcp/mgcpgw_client.c
@@ -548,3 +548,13 @@ struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp,
rtp_conn_addr,
rtp_port);
}
+
+struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint)
+{
+ mgcp_trans_id_t trans_id = mgcpgw_client_next_trans_id(mgcp);
+ return mgcp_msg_from_str(trans_id,
+ "DLCX %u %x@mgw MGCP 1.0\r\n"
+ ,
+ trans_id,
+ rtp_endpoint);
+}