Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
res_format_attr_g729.c File Reference
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/format.h"
Include dependency graph for res_format_attr_g729.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int g729_clone (const struct ast_format *src, struct ast_format *dst)
 
static void g729_destroy (struct ast_format *format)
 
static void g729_generate_sdp_fmtp (const struct ast_format *format, unsigned int payload, struct ast_str **str)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "G.729 Format Attribute Module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct ast_format_interface g729_interface
 

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 74 of file res_format_attr_g729.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 74 of file res_format_attr_g729.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 74 of file res_format_attr_g729.c.

◆ g729_clone()

static int g729_clone ( const struct ast_format src,
struct ast_format dst 
)
static

Definition at line 34 of file res_format_attr_g729.c.

35 {
36  return 0;
37 }

◆ g729_destroy()

static void g729_destroy ( struct ast_format format)
static

Definition at line 29 of file res_format_attr_g729.c.

30 {
31 }

◆ g729_generate_sdp_fmtp()

static void g729_generate_sdp_fmtp ( const struct ast_format format,
unsigned int  payload,
struct ast_str **  str 
)
static

Definition at line 39 of file res_format_attr_g729.c.

References ast_str_append().

40 {
41  /*
42  * According to the rfc the joint annexb format parameter should be set to 'yes'
43  * or 'no' based on the answerer (rfc7261 - 3.3). However, Asterisk being a B2BUA
44  * makes things tricky. So for now Asterisk will set annexb=no.
45  */
46  ast_str_append(str, 0, "a=fmtp:%u annexb=no\r\n", payload);
47 }
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
Definition: strings.h:1091

◆ load_module()

static int load_module ( void  )
static

Definition at line 55 of file res_format_attr_g729.c.

References ast_format_interface_register, AST_MODULE_LOAD_DECLINE, and AST_MODULE_LOAD_SUCCESS.

Referenced by unload_module().

56 {
59  }
60 
62 }
#define ast_format_interface_register(codec, interface)
Register a format interface for use with the provided codec.
Definition: format.h:273
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
static struct ast_format_interface g729_interface

◆ unload_module()

static int unload_module ( void  )
static

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "G.729 Format Attribute Module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, }
static

Definition at line 74 of file res_format_attr_g729.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 74 of file res_format_attr_g729.c.

◆ g729_interface

struct ast_format_interface g729_interface
static
Initial value:
= {
.format_destroy = g729_destroy,
.format_clone = g729_clone,
.format_generate_sdp_fmtp = g729_generate_sdp_fmtp,
}
static void g729_generate_sdp_fmtp(const struct ast_format *format, unsigned int payload, struct ast_str **str)
static int g729_clone(const struct ast_format *src, struct ast_format *dst)
static void g729_destroy(struct ast_format *format)

Definition at line 49 of file res_format_attr_g729.c.