From 188a804f6df55a66185054e664d6b3a998e7a371 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 8 Jun 2017 12:19:30 +0200 Subject: 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. --- openbsc/include/openbsc/mgcpgw_client.h | 4 ++++ openbsc/src/libmgcp/mgcpgw_client.c | 10 ++++++++++ 2 files changed, 14 insertions(+) (limited to 'openbsc') diff --git a/openbsc/include/openbsc/mgcpgw_client.h b/openbsc/include/openbsc/mgcpgw_client.h index b353db0a4..8220cfa51 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 5a850ea0a..0c2106704 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); +} -- cgit v1.2.3