diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-11-19 20:29:30 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-11-20 17:35:47 +0100 |
commit | 7f71d99cc3f8bface8eda3004ae51c26ce9bb698 (patch) | |
tree | c5e969e657c4769c5b6cda1985caabe6decb20fd /openbsc | |
parent | b92167cf80a7d1d8b562c1cfac1b1fcd85abee97 (diff) |
[bsc] Add a rtp base port to the BSC config too
Stop having a global variable... keep it in the
gsm network or the mgcp
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 1 | ||||
-rw-r--r-- | openbsc/include/openbsc/mgcp.h | 2 | ||||
-rw-r--r-- | openbsc/src/bsc_mgcp.c | 1 | ||||
-rw-r--r-- | openbsc/src/bssap.c | 3 | ||||
-rw-r--r-- | openbsc/src/vty_interface.c | 16 |
5 files changed, 20 insertions, 3 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 32b05d4da..1e66fa482 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -465,6 +465,7 @@ struct gsm_network { struct gsm_audio_support **audio_support; int audio_length; int rtp_payload; + int rtp_base_port; /* layer 4 */ int (*mncc_recv) (struct gsm_network *net, int msg_type, void *arg); diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index fa6224c12..3cba203de 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -21,8 +21,6 @@ * */ -unsigned int rtp_base_port = 4000; - /** * Calculate the RTP audio port for the given multiplex * and the direction. This allows a semi static endpoint diff --git a/openbsc/src/bsc_mgcp.c b/openbsc/src/bsc_mgcp.c index 6d5e6b154..045dff29c 100644 --- a/openbsc/src/bsc_mgcp.c +++ b/openbsc/src/bsc_mgcp.c @@ -63,6 +63,7 @@ static const char *audio_name = "GSM-EFR/8000"; static int audio_payload = 97; static int audio_loop = 0; static int early_bind = 0; +static int rtp_base_port = 0; static char *config_file = "mgcp.cfg"; diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c index f97a17107..874400fd1 100644 --- a/openbsc/src/bssap.c +++ b/openbsc/src/bssap.c @@ -440,7 +440,8 @@ static int bssmap_handle_assignm_req(struct sccp_connection *conn, /* the mgcp call agent starts counting at one. a bit of a weird mapping */ if (multiplex == 0) multiplex = 1; - msc_data->rtp_port = rtp_calculate_port(multiplex, rtp_base_port); + msc_data->rtp_port = rtp_calculate_port(multiplex, + network->rtp_base_port); DEBUGP(DMSC, "Sending ChanModify for speech on: sccp: %p mode: 0x%x on 0x%x port: %u\n", conn, chan_mode, multiplex, msc_data->rtp_port); if (chan_mode == GSM48_CMODE_SPEECH_AMR) { diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c index 6f7714cd6..b6ca503ab 100644 --- a/openbsc/src/vty_interface.c +++ b/openbsc/src/vty_interface.c @@ -895,6 +895,21 @@ DEFUN(cfg_net_ipacc_rtp_payload, return CMD_SUCCESS; } +DEFUN(cfg_net_rtp_base_port, + cfg_net_rtp_base_port_cmd, + "rtp base <0-65534>", + "Base port to use for MGCP RTP") +{ + unsigned int port = atoi(argv[0]); + if (port > 65534) { + vty_out(vty, "%% wrong base port '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + gsmnet->rtp_base_port = port; + return CMD_SUCCESS; +} + /* per-BTS configuration */ DEFUN(cfg_bts, cfg_bts_cmd, @@ -1337,6 +1352,7 @@ int bsc_vty_init(struct gsm_network *net) install_element(GSMNET_NODE, &cfg_net_neci_cmd); install_element(GSMNET_NODE, &cfg_net_supported_codecs_cmd); install_element(GSMNET_NODE, &cfg_net_ipacc_rtp_payload_cmd); + install_element(GSMNET_NODE, &cfg_net_rtp_base_port_cmd); install_element(GSMNET_NODE, &cfg_bts_cmd); install_node(&bts_node, config_write_bts); |