osmux: add 'osmux batch-size NUM' option to mgcp vty
This allows you to specify the osmux batch frame size. If zero, the library uses the default value.
This commit is contained in:
parent
308d5f8912
commit
03ab79abac
|
@ -217,6 +217,8 @@ struct mgcp_config {
|
||||||
int osmux_init;
|
int osmux_init;
|
||||||
/* osmux batch factor: from 1 to 4 maximum */
|
/* osmux batch factor: from 1 to 4 maximum */
|
||||||
int osmux_batch;
|
int osmux_batch;
|
||||||
|
/* osmux batch size (in bytes) */
|
||||||
|
int osmux_batch_size;
|
||||||
/* osmux port */
|
/* osmux port */
|
||||||
uint16_t osmux_port;
|
uint16_t osmux_port;
|
||||||
};
|
};
|
||||||
|
|
|
@ -121,6 +121,8 @@ osmux_handle_alloc(struct mgcp_config *cfg, struct in_addr *addr, int rem_port)
|
||||||
|
|
||||||
h->in->osmux_seq = 0; /* sequence number to start OSmux message from */
|
h->in->osmux_seq = 0; /* sequence number to start OSmux message from */
|
||||||
h->in->batch_factor = cfg->osmux_batch;
|
h->in->batch_factor = cfg->osmux_batch;
|
||||||
|
/* If batch size is zero, the library defaults to 1470 bytes. */
|
||||||
|
h->in->batch_size = cfg->osmux_batch_size;
|
||||||
h->in->deliver = osmux_deliver;
|
h->in->deliver = osmux_deliver;
|
||||||
osmux_xfrm_input_init(h->in);
|
osmux_xfrm_input_init(h->in);
|
||||||
h->in->data = h;
|
h->in->data = h;
|
||||||
|
|
|
@ -135,6 +135,8 @@ static int config_write_mgcp(struct vty *vty)
|
||||||
g_cfg->osmux == 1 ? "on" : "off", VTY_NEWLINE);
|
g_cfg->osmux == 1 ? "on" : "off", VTY_NEWLINE);
|
||||||
vty_out(vty, " osmux batch-factor %d%s",
|
vty_out(vty, " osmux batch-factor %d%s",
|
||||||
g_cfg->osmux_batch, VTY_NEWLINE);
|
g_cfg->osmux_batch, VTY_NEWLINE);
|
||||||
|
vty_out(vty, " osmux batch-size %u%s",
|
||||||
|
g_cfg->osmux_batch_size, VTY_NEWLINE);
|
||||||
vty_out(vty, " osmux port %u%s",
|
vty_out(vty, " osmux port %u%s",
|
||||||
g_cfg->osmux_port, VTY_NEWLINE);
|
g_cfg->osmux_port, VTY_NEWLINE);
|
||||||
|
|
||||||
|
@ -1134,6 +1136,15 @@ DEFUN(cfg_mgcp_osmux_batch_factor,
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUN(cfg_mgcp_osmux_batch_size,
|
||||||
|
cfg_mgcp_osmux_batch_size_cmd,
|
||||||
|
"osmux batch-size <1-65535>",
|
||||||
|
OSMUX_STR "batch size\n" "Batch size in bytes\n")
|
||||||
|
{
|
||||||
|
g_cfg->osmux_batch_size = atoi(argv[0]);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFUN(cfg_mgcp_osmux_port,
|
DEFUN(cfg_mgcp_osmux_port,
|
||||||
cfg_mgcp_osmux_port_cmd,
|
cfg_mgcp_osmux_port_cmd,
|
||||||
"osmux port <1-65535>",
|
"osmux port <1-65535>",
|
||||||
|
@ -1198,6 +1209,7 @@ int mgcp_vty_init(void)
|
||||||
install_element(MGCP_NODE, &cfg_mgcp_no_sdp_payload_send_ptime_cmd);
|
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_cmd);
|
||||||
install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_factor_cmd);
|
install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_factor_cmd);
|
||||||
|
install_element(MGCP_NODE, &cfg_mgcp_osmux_batch_size_cmd);
|
||||||
install_element(MGCP_NODE, &cfg_mgcp_osmux_port_cmd);
|
install_element(MGCP_NODE, &cfg_mgcp_osmux_port_cmd);
|
||||||
|
|
||||||
install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd);
|
install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd);
|
||||||
|
|
Loading…
Reference in New Issue