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]);
202 if (framehook_id < 0) {
203 ast_cli(a->
fd,
"Could not attach framehook for modifying REMB\n");
209 remb_values =
ast_calloc(1,
sizeof(*remb_values));
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");
228 remb_store->
data = remb_values;
231 remb_values = remb_store->
data;
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]);
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
float send_bitrate
The amount of bitrate to use for REMB sent to the channel.
#define ast_channel_unref(c)
Decrease channel reference count.
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
Structure for a data store object.
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.
void ast_cli(int fd, const char *fmt,...)
float receive_bitrate
The amount of bitrate to use for REMB received from the channel.
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i)
Attach an framehook onto a channel for frame interception.
#define AST_FRAMEHOOK_INTERFACE_VERSION
#define ast_channel_unlock(chan)
#define ast_calloc(num, len)
A wrapper for calloc()
static const struct ast_datastore_info remb_info
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_datastore_alloc(info, uid)
struct ast_channel * ast_channel_get_by_name(const char *name)
Find a channel by name.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
static struct ast_frame * remb_hook_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data)