156{
158 unsigned int bitrate;
164 };
165
166 switch(cmd) {
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";
175 }
176
179 }
180
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]);
187 }
188
190 if (!chan) {
191 ast_cli(
a->fd,
"%s is not a known channel\n",
a->argv[3]);
193 }
194
196
198 if (!remb_store) {
199 int framehook_id;
200
202 if (framehook_id < 0) {
203 ast_cli(
a->fd,
"Could not attach framehook for modifying REMB\n");
207 }
208
211 ast_cli(
a->fd,
"Could not create a place to store provided REMB value\n");
216 }
217
219 if (!remb_store) {
220 ast_cli(
a->fd,
"Could not create a place to store provided REMB value\n");
226 }
227
230 } else {
232 }
233
234 if (!strcasecmp(
a->argv[2],
"send")) {
236 }
else if (!strcasecmp(
a->argv[2],
"receive")) {
238 }
239
242
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]);
244
246}
#define ast_calloc(num, len)
A wrapper for calloc()
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.
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_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.
int ast_framehook_detach(struct ast_channel *chan, int framehook_id)
Detach an framehook from a channel.
#define AST_FRAMEHOOK_INTERFACE_VERSION
static const struct ast_datastore_info remb_info
static struct ast_frame * remb_hook_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_framehook_event event, void *data)
Main Channel structure associated with a channel.
Structure for a data store object.
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.