Asterisk - The Open Source Telephony Project GIT-master-f36a736
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 = "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 = 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 133 of file func_callcompletion.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 133 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 68 of file func_callcompletion.c.

70{
71 struct ast_cc_config_params *cc_params;
72 int res;
73
74 if (!chan) {
75 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", name);
76 return -1;
77 }
78
79 ast_channel_lock(chan);
80 if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
82 return -1;
83 }
84
85 res = ast_cc_get_param(cc_params, data, buf, buf_len);
87 return res;
88}
#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:758
#define ast_channel_lock(chan)
Definition: channel.h:2968
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:10496
#define ast_channel_unlock(chan)
Definition: channel.h:2969
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 90 of file func_callcompletion.c.

92{
93 struct ast_cc_config_params *cc_params;
94 int res;
95
96 if (!chan) {
97 ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
98 return -1;
99 }
100
101 ast_channel_lock(chan);
102 if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
103 ast_channel_unlock(chan);
104 return -1;
105 }
106
107 res = ast_cc_set_param(cc_params, data, value);
108 ast_channel_unlock(chan);
109 return res;
110}
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:801
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 133 of file func_callcompletion.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 123 of file func_callcompletion.c.

124{
126}
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:1558

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 118 of file func_callcompletion.c.

119{
121}
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 = "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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "ccss", }
static

Definition at line 133 of file func_callcompletion.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 133 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 112 of file func_callcompletion.c.

Referenced by load_module(), and unload_module().