bsc: Add the rtp-base command to osmo-bsc

This commit is contained in:
Holger Hans Peter Freyther 2010-11-03 13:32:48 +01:00
parent 45f9e69ac5
commit fe16622bf5
3 changed files with 20 additions and 1 deletions

View File

@ -43,6 +43,7 @@ struct osmo_msc_data {
struct bsc_msc_connection *msc_con;
int core_ncc;
int rtp_payload;
int rtp_base;
/* mgcp agent */
struct write_queue mgcp_agent;

View File

@ -25,6 +25,9 @@
#include <osmocore/talloc.h>
#define IPA_STR "IP.ACCESS specific\n"
extern struct gsm_network *bsc_gsmnet;
static struct osmo_msc_data *osmo_msc_data(struct vty *vty)
@ -59,6 +62,7 @@ static int config_write_msc(struct vty *vty)
data->core_ncc, VTY_NEWLINE);
vty_out(vty, " ip.access rtp-payload %d%s",
data->rtp_payload, VTY_NEWLINE);
vty_out(vty, " ip.access rtp-base %d%s", data->rtp_base, VTY_NEWLINE);
vty_out(vty, " ip %s%s", data->msc_ip, VTY_NEWLINE);
vty_out(vty, " port %d%s", data->msc_port, VTY_NEWLINE);
vty_out(vty, " ip-dscp %d%s", data->msc_ip_dscp, VTY_NEWLINE);
@ -94,7 +98,7 @@ DEFUN(cfg_net_bsc_ncc,
DEFUN(cfg_net_bsc_rtp_payload,
cfg_net_bsc_rtp_payload_cmd,
"ip.access rtp-payload <0-255>",
"IP.ACCESS specific\n"
IPA_STR
"Set the rtp-payload for the RTP stream\n"
"RTP payload number\n")
{
@ -103,6 +107,18 @@ DEFUN(cfg_net_bsc_rtp_payload,
return CMD_SUCCESS;
}
DEFUN(cfg_net_bsc_rtp_base,
cfg_net_bsc_rtp_base_cmd,
"ip.access rtp-base <1-65000>",
IPA_STR
"Set the rtp-base port for the RTP stream\n"
"Port number\n")
{
struct osmo_msc_data *data = osmo_msc_data(vty);
data->rtp_base = atoi(argv[0]);
return CMD_SUCCESS;
}
DEFUN(cfg_net_msc_ip,
cfg_net_msc_ip_cmd,
"ip A.B.C.D", "Set the MSC/MUX IP address.")
@ -177,6 +193,7 @@ int bsc_vty_init_extra(void)
install_element(MSC_NODE, &cfg_net_bsc_token_cmd);
install_element(MSC_NODE, &cfg_net_bsc_ncc_cmd);
install_element(MSC_NODE, &cfg_net_bsc_rtp_payload_cmd);
install_element(MSC_NODE, &cfg_net_bsc_rtp_base_cmd);
install_element(MSC_NODE, &cfg_net_msc_ip_cmd);
install_element(MSC_NODE, &cfg_net_msc_port_cmd);
install_element(MSC_NODE, &cfg_net_msc_prio_cmd);

View File

@ -319,6 +319,7 @@ struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_c
net->msc_data->pong_timeout = 5;
net->msc_data->core_ncc = -1;
net->msc_data->rtp_payload = 126;
net->msc_data->rtp_base = 4000;
gsm_net_update_ctype(net);