55 .
type =
"REMB Values",
146 frexp(bitrate, &exp);
147 exp = exp > 18 ? exp - 18 : 0;
158 unsigned int bitrate;
168 e->
command =
"remb set {send|receive}";
170 "Usage: remb set {send|receive} <channel> <bitrate in bits>\n"
171 " Set the REMB value which overwrites what we send or receive\n";
181 if (sscanf(
a->argv[4],
"%30d", &bitrate) != 1) {
182 ast_cli(
a->fd,
"%s is not a valid bitrate in bits\n",
a->argv[4]);
184 }
else if (strcasecmp(
a->argv[2],
"send") && strcasecmp(
a->argv[2],
"receive")) {
185 ast_cli(
a->fd,
"%s is not a valid direction for REMB\n",
a->argv[2]);
191 ast_cli(
a->fd,
"%s is not a known channel\n",
a->argv[3]);
202 if (framehook_id < 0) {
203 ast_cli(
a->fd,
"Could not attach framehook for modifying REMB\n");
211 ast_cli(
a->fd,
"Could not create a place to store provided REMB value\n");
220 ast_cli(
a->fd,
"Could not create a place to store provided REMB value\n");
234 if (!strcasecmp(
a->argv[2],
"send")) {
236 }
else if (!strcasecmp(
a->argv[2],
"receive")) {
243 ast_cli(
a->fd,
"Set REMB %s override to a bitrate of %s on %s\n",
a->argv[2],
a->argv[3],
a->argv[4]);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_calloc(num, len)
A wrapper for calloc()
General Asterisk PBX channel definitions.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define ast_channel_lock(chan)
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
#define ast_channel_unlock(chan)
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Standard Command Line Interface.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
#define AST_CLI_DEFINE(fn, txt,...)
void ast_cli(int fd, const char *fmt,...)
char * ast_complete_channels(const char *line, const char *word, int pos, int state, int rpos)
Command completion for the list of active channels.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
#define ast_datastore_alloc(info, uid)
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
ast_framehook_event
These are the types of events that the framehook's event callback can receive.
@ AST_FRAMEHOOK_EVENT_ATTACHED
@ AST_FRAMEHOOK_EVENT_DETACHED
@ AST_FRAMEHOOK_EVENT_WRITE
@ AST_FRAMEHOOK_EVENT_READ
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
#define AST_FRAMEHOOK_INTERFACE_VERSION
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
static void remb_values_free(void *data)
static struct ast_cli_entry remb_cli[]
static const struct ast_datastore_info remb_info
static char * handle_remb_set(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static struct ast_frame * remb_hook_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data)
static int load_module(void)
static int unload_module(void)
Pluggable RTP Architecture.
#define AST_RTP_RTCP_PSFB
#define AST_RTP_RTCP_FMT_REMB
Main Channel structure associated with a channel.
descriptor for a cli entry.
Structure for a data store type.
Structure for a data store object.
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
An object that represents data received in a feedback report.
struct ast_rtp_rtcp_feedback_remb remb
float receive_bitrate
The amount of bitrate to use for REMB received from the channel.
float send_bitrate
The amount of bitrate to use for REMB sent to the channel.