mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
osmux: allow to specify the Osmux port
via mgcp section from the configuration file.
This commit is contained in:
@@ -217,6 +217,8 @@ struct mgcp_config {
|
||||
int osmux_init;
|
||||
/* osmux batch factor: from 1 to 4 maximum */
|
||||
int osmux_batch;
|
||||
/* osmux port */
|
||||
uint16_t osmux_port;
|
||||
};
|
||||
|
||||
/* config management */
|
||||
|
@@ -1132,6 +1132,15 @@ DEFUN(cfg_mgcp_osmux_batch_factor,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN(cfg_mgcp_osmux_port,
|
||||
cfg_mgcp_osmux_port_cmd,
|
||||
"osmux port <1-65535>",
|
||||
OSMUX_STR "port\n" "UDP port\n")
|
||||
{
|
||||
g_cfg->osmux_port = atoi(argv[0]);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
int mgcp_vty_init(void)
|
||||
{
|
||||
install_element_ve(&show_mgcp_cmd);
|
||||
@@ -1187,6 +1196,7 @@ int mgcp_vty_init(void)
|
||||
install_element(MGCP_NODE, &cfg_mgcp_no_sdp_payload_send_ptime_cmd);
|
||||
install_element(MGCP_NODE, &cfg_mgcp_osmux_cmd);
|
||||
install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_factor_cmd);
|
||||
install_element(MGCP_NODE, &cfg_mgcp_osmux_port_cmd);
|
||||
|
||||
install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd);
|
||||
install_node(&trunk_node, config_write_trunk);
|
||||
|
@@ -416,7 +416,10 @@ int osmux_init(int role, struct mgcp_config *cfg)
|
||||
}
|
||||
osmux_fd.data = cfg;
|
||||
|
||||
ret = mgcp_create_bind("0.0.0.0", &osmux_fd, OSMUX_PORT);
|
||||
if (!cfg->osmux_port)
|
||||
cfg->osmux_port = OSMUX_PORT;
|
||||
|
||||
ret = mgcp_create_bind("0.0.0.0", &osmux_fd, cfg->osmux_port);
|
||||
if (ret < 0) {
|
||||
LOGP(DMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n");
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user