Asterisk - The Open Source Telephony Project  18.5.0
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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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 134 of file func_callcompletion.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

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

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

71 {
72  struct ast_cc_config_params *cc_params;
73  int res;
74 
75  if (!chan) {
76  ast_log(LOG_WARNING, "No channel was provided to %s function.\n", name);
77  return -1;
78  }
79 
80  ast_channel_lock(chan);
81  if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
82  ast_channel_unlock(chan);
83  return -1;
84  }
85 
86  res = ast_cc_get_param(cc_params, data, buf, buf_len);
87  ast_channel_unlock(chan);
88  return res;
89 }
#define ast_channel_lock(chan)
Definition: channel.h:2945
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define LOG_WARNING
Definition: logger.h:274
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:10675
#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:759
#define ast_channel_unlock(chan)
Definition: channel.h:2946
static const char name[]
Definition: cdr_mysql.c:74

◆ acf_cc_write()

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

Definition at line 91 of file func_callcompletion.c.

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

93 {
94  struct ast_cc_config_params *cc_params;
95  int res;
96 
97  if (!chan) {
98  ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
99  return -1;
100  }
101 
102  ast_channel_lock(chan);
103  if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
104  ast_channel_unlock(chan);
105  return -1;
106  }
107 
108  res = ast_cc_set_param(cc_params, data, value);
109  ast_channel_unlock(chan);
110  return res;
111 }
#define ast_channel_lock(chan)
Definition: channel.h:2945
#define LOG_WARNING
Definition: logger.h:274
int value
Definition: syslog.c:37
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:10675
#define ast_log
Definition: astobj2.c:42
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:804
#define ast_channel_unlock(chan)
Definition: channel.h:2946

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 134 of file func_callcompletion.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 124 of file func_callcompletion.c.

References ast_custom_function_register, AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, and unload_module().

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

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 119 of file func_callcompletion.c.

References ast_custom_function_unregister().

Referenced by load_module().

120 {
122 }
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
static struct ast_custom_function 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "ccss", }
static

Definition at line 134 of file func_callcompletion.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 134 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_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)

Definition at line 113 of file func_callcompletion.c.