Wed Jan 8 2020 09:50:12

Asterisk developer's documentation


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"

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)
 
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 = "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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, }
 
static 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

static void __reg_module ( void  )
static

Definition at line 131 of file func_callcompletion.c.

static void __unreg_module ( void  )
static

Definition at line 131 of file func_callcompletion.c.

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.

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

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))) {
84  ast_channel_unlock(chan);
85  return -1;
86  }
87 
88  res = ast_cc_get_param(cc_params, data, buf, buf_len);
89  ast_channel_unlock(chan);
90  return res;
91 }
#define ast_channel_lock(chan)
Definition: channel.h:2466
#define LOG_WARNING
Definition: logger.h:144
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:9754
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:645
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
Definition: logger.c:1207
#define ast_channel_unlock(chan)
Definition: channel.h:2467
static const char name[]
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.

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

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 }
#define ast_channel_lock(chan)
Definition: channel.h:2466
#define LOG_WARNING
Definition: logger.h:144
int value
Definition: syslog.c:39
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:9754
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:688
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
Definition: logger.c:1207
#define ast_channel_unlock(chan)
Definition: channel.h:2467
static int load_module ( void  )
static

Definition at line 126 of file func_callcompletion.c.

References ast_custom_function_register, AST_MODULE_LOAD_DECLINE, and AST_MODULE_LOAD_SUCCESS.

127 {
129 }
static struct ast_custom_function cc_function
#define ast_custom_function_register(acf)
Register a custom function.
Definition: pbx.h:1164
static int unload_module ( void  )
static

Definition at line 121 of file func_callcompletion.c.

References ast_custom_function_unregister().

122 {
124 }
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
Definition: pbx.c:3814
static struct ast_custom_function cc_function

Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, }
static

Definition at line 131 of file func_callcompletion.c.

Definition at line 131 of file func_callcompletion.c.

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