From 4ec389e58f139fda2a540789f54ac38185dd1584 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 20 Nov 2009 11:10:31 +0100 Subject: [mgcp] Make the number of endpoints configurable... Allow to configure the number of endpoints at start. Currently this will not be changed at runtime but one needs to save the config and restart the system. --- openbsc/src/bsc_mgcp.c | 14 +++++++++++++- openbsc/src/mgcp.cfg | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/openbsc/src/bsc_mgcp.c b/openbsc/src/bsc_mgcp.c index d4007a0ec..6d5e6b154 100644 --- a/openbsc/src/bsc_mgcp.c +++ b/openbsc/src/bsc_mgcp.c @@ -55,7 +55,7 @@ static int source_port = 2427; static const char *local_ip = NULL; static const char *source_addr = "0.0.0.0"; static struct bsc_fd bfd; -static const unsigned int number_endpoints = 32 + 1; +static unsigned int number_endpoints = 0; static const char *bts_ip = NULL; static struct in_addr bts_in; static int first_request = 1; @@ -908,6 +908,7 @@ static int config_write_mgcp(struct vty *vty) vty_out(vty, " sdp audio payload number %u%s", audio_payload, VTY_NEWLINE); vty_out(vty, " sdp audio payload name %s%s", audio_name, VTY_NEWLINE); vty_out(vty, " loop %u%s", !!audio_loop, VTY_NEWLINE); + vty_out(vty, " endpoints %u%s", number_endpoints, VTY_NEWLINE); return CMD_SUCCESS; } @@ -1044,6 +1045,16 @@ DEFUN(cfg_mgcp_loop, return CMD_SUCCESS; } +DEFUN(cfg_mgcp_number_endp, + cfg_mgcp_number_endp_cmd, + "number endpoints <0-65534>", + "The number of endpoints to allocate. This is not dynamic.") +{ + /* + 1 as we start counting at one */ + number_endpoints = atoi(argv[0]) + 1; + return CMD_SUCCESS; +} + int bsc_vty_init(struct gsm_network *dummy) { cmd_init(1); @@ -1064,6 +1075,7 @@ int bsc_vty_init(struct gsm_network *dummy) install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_number_cmd); install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_name_cmd); install_element(MGCP_NODE, &cfg_mgcp_loop_cmd); + install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd); return 0; } diff --git a/openbsc/src/mgcp.cfg b/openbsc/src/mgcp.cfg index d9950ab95..678f54637 100644 --- a/openbsc/src/mgcp.cfg +++ b/openbsc/src/mgcp.cfg @@ -15,4 +15,5 @@ mgcp rtp base 4000 sdp audio payload number 98 sdp audio payload name AMR/8000 + number endpoints 31 loop 1 -- cgit v1.2.3