diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-06-08 12:19:30 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2017-06-08 14:24:08 +0200 |
commit | f8f4254ba35432b6a342b471b9be496419cd9dd2 (patch) | |
tree | 7dc0d9b6bea4e63c4ea3d9093d2d379081d86348 | |
parent | a6a4057451a9935de016a6d8deac90ad228d0965 (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.h | 4 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcpgw_client.c | 10 |
2 files changed, 14 insertions, 0 deletions
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 9f0c84de2..cf74aa0a0 100644 --- a/openbsc/src/libmgcp/mgcpgw_client.c +++ b/openbsc/src/libmgcp/mgcpgw_client.c @@ -547,3 +547,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); +} |