41 #include "asterisk/ilbc.h"
43 static struct ilbc_attr default_ilbc_attr = {
47 static void ilbc_destroy(
struct ast_format *format)
66 *attr = default_ilbc_attr;
74 static struct ast_format *ilbc_parse_sdp_fmtp(
const struct ast_format *format,
const char *attributes)
89 for (attrib = attribs; *attrib; ++attrib) {
90 *attrib = tolower(*attrib);
93 if ((kvp = strstr(attribs,
"mode")) && sscanf(kvp,
"mode=%30u", &val) == 1) {
102 static void ilbc_generate_sdp_fmtp(
const struct ast_format *format,
unsigned int payload,
struct ast_str **str)
107 attr = &default_ilbc_attr;
118 ast_str_append(str, 0,
"a=fmtp:%u mode=%u\r\n", payload, attr->mode);
130 attr1 = &default_ilbc_attr;
134 attr2 = &default_ilbc_attr;
143 if (attr1->mode != attr2->mode) {
152 .format_clone = ilbc_clone,
154 .format_get_joint = ilbc_getjoint,
155 .format_attribute_set = NULL,
156 .format_parse_sdp_fmtp = ilbc_parse_sdp_fmtp,
157 .format_generate_sdp_fmtp = ilbc_generate_sdp_fmtp,
160 static int load_module(
void)
169 static int unload_module(
void)
174 AST_MODULE_INFO(
ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER,
"iLBC Format Attribute Module",
175 .support_level = AST_MODULE_SUPPORT_CORE,
177 .unload = unload_module,
Asterisk main include file. File version handling, generic pbx functions.
String manipulation functions.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_malloc(len)
A wrapper for malloc()
Support for dynamic strings.
Module has failed to load, may be in an inconsistent state.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.