Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
Functions | Variables
func_callcompletion.c File Reference

Call Completion Supplementary Services implementation. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/ccss.h"
#include "asterisk/pbx.h"
Include dependency graph for func_callcompletion.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static int acf_cc_read (struct ast_channel *chan, const char *name, char *data, char *buf, size_t buf_len)
 
static int acf_cc_write (struct ast_channel *chan, const char *cmd, char *data, const char *value)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Call Control Configuration Function" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "ccss", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct ast_custom_function cc_function
 

Detailed Description

Call Completion Supplementary Services implementation.

Author
Mark Michelson mmich.nosp@m.elso.nosp@m.n@dig.nosp@m.ium..nosp@m.com

Definition in file func_callcompletion.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 136 of file func_callcompletion.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 136 of file func_callcompletion.c.

◆ acf_cc_read()

static int acf_cc_read ( struct ast_channel chan,
const char *  name,
char *  data,
char *  buf,
size_t  buf_len 
)
static

Definition at line 71 of file func_callcompletion.c.

73{
74 struct ast_cc_config_params *cc_params;
75 int res;
76
77 if (!chan) {
78 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", name);
79 return -1;
80 }
81
82 ast_channel_lock(chan);
83 if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
85 return -1;
86 }
87
88 res = ast_cc_get_param(cc_params, data, buf, buf_len);
90 return res;
91}
#define ast_log
Definition astobj2.c:42
int ast_cc_get_param(struct ast_cc_config_params *params, const char *const name, char *buf, size_t buf_len)
get a CCSS configuration parameter, given its name
Definition ccss.c:764
#define ast_channel_lock(chan)
Definition channel.h:2982
struct ast_cc_config_params * ast_channel_get_cc_config_params(struct ast_channel *chan)
Get the CCSS parameters from a channel.
Definition channel.c:10518
#define ast_channel_unlock(chan)
Definition channel.h:2983
char buf[BUFSIZE]
Definition eagi_proxy.c:66
static const char name[]
Definition format_mp3.c:68
#define LOG_WARNING

References ast_cc_get_param(), ast_channel_get_cc_config_params(), ast_channel_lock, ast_channel_unlock, ast_log, buf, LOG_WARNING, and name.

◆ acf_cc_write()

static int acf_cc_write ( struct ast_channel chan,
const char *  cmd,
char *  data,
const char *  value 
)
static

Definition at line 93 of file func_callcompletion.c.

95{
96 struct ast_cc_config_params *cc_params;
97 int res;
98
99 if (!chan) {
100 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
101 return -1;
102 }
103
104 ast_channel_lock(chan);
105 if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
106 ast_channel_unlock(chan);
107 return -1;
108 }
109
110 res = ast_cc_set_param(cc_params, data, value);
111 ast_channel_unlock(chan);
112 return res;
113}
int ast_cc_set_param(struct ast_cc_config_params *params, const char *const name, const char *value)
set a CCSS configuration parameter, given its name
Definition ccss.c:807
int value
Definition syslog.c:37

References ast_cc_set_param(), ast_channel_get_cc_config_params(), ast_channel_lock, ast_channel_unlock, ast_log, LOG_WARNING, and value.

◆ AST_MODULE_SELF_SYM()

struct ast_module * AST_MODULE_SELF_SYM ( void  )

Definition at line 136 of file func_callcompletion.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 126 of file func_callcompletion.c.

127{
129}
static struct ast_custom_function cc_function
@ AST_MODULE_LOAD_SUCCESS
Definition module.h:70
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Definition module.h:78
#define ast_custom_function_register(acf)
Register a custom function.
Definition pbx.h:1562

References ast_custom_function_register, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and cc_function.

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 121 of file func_callcompletion.c.

122{
124}
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.

References ast_custom_function_unregister(), and cc_function.

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Call Control Configuration Function" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "ccss", }
static

Definition at line 136 of file func_callcompletion.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 136 of file func_callcompletion.c.

◆ cc_function

struct ast_custom_function cc_function
static
Initial value:
= {
.name = "CALLCOMPLETION",
.read = acf_cc_read,
.write = acf_cc_write,
}
static int acf_cc_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static int acf_cc_read(struct ast_channel *chan, const char *name, char *data, char *buf, size_t buf_len)

Definition at line 115 of file func_callcompletion.c.

115 {
116 .name = "CALLCOMPLETION",
117 .read = acf_cc_read,
118 .write = acf_cc_write,
119};

Referenced by load_module(), and unload_module().