diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-11-20 11:10:31 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-11-20 14:05:17 +0100 |
commit | 4ec389e58f139fda2a540789f54ac38185dd1584 (patch) | |
tree | 92250f8233b02b80a1181d43b564c46ae6e33e1e | |
parent | 8ea4b5688a65e2e3cd8cd2529e40721f435dd18a (diff) |
[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.
-rw-r--r-- | openbsc/src/bsc_mgcp.c | 14 | ||||
-rw-r--r-- | openbsc/src/mgcp.cfg | 1 |
2 files changed, 14 insertions, 1 deletions
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 |