Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
res_stasis_answer.c File Reference

Stasis application control support. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/stasis_app_impl.h"
Include dependency graph for res_stasis_answer.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static int app_control_answer (struct stasis_app_control *control, struct ast_channel *chan, void *data)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int load_module (void)
 
int stasis_app_control_answer (struct stasis_app_control *control)
 Answer the channel associated with this control. More...
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS , .description = "Stasis application answer support" , .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 = "res_stasis", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 

Detailed Description

Stasis application control support.

Author
David M. Lee, II dlee@.nosp@m.digi.nosp@m.um.co.nosp@m.m

Definition in file res_stasis_answer.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 77 of file res_stasis_answer.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 77 of file res_stasis_answer.c.

◆ app_control_answer()

static int app_control_answer ( struct stasis_app_control control,
struct ast_channel chan,
void *  data 
)
static

Definition at line 36 of file res_stasis_answer.c.

References ast_debug, ast_raw_answer(), and stasis_app_control_get_channel_id().

Referenced by stasis_app_control_answer().

38 {
39  ast_debug(3, "%s: Answering\n",
41  return ast_raw_answer(chan);
42 }
int ast_raw_answer(struct ast_channel *chan)
Answer a channel.
Definition: channel.c:2699
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:452
const char * stasis_app_control_get_channel_id(const struct stasis_app_control *control)
Returns the uniqueid of the channel associated with this control.
Definition: control.c:1430

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 77 of file res_stasis_answer.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 62 of file res_stasis_answer.c.

References AST_MODULE_LOAD_SUCCESS.

Referenced by unload_module().

63 {
65 }

◆ stasis_app_control_answer()

int stasis_app_control_answer ( struct stasis_app_control control)

Answer the channel associated with this control.

Parameters
controlControl for res_stasis.
Returns
0 for success.
Non-zero for error.

Definition at line 44 of file res_stasis_answer.c.

References app_control_answer(), ast_debug, ast_log, LOG_WARNING, NULL, retval, stasis_app_control_get_channel_id(), and stasis_app_send_command().

Referenced by ast_ari_channels_answer().

45 {
46  int retval;
47 
48  ast_debug(3, "%s: Sending answer command\n",
50 
52 
53  if (retval != 0) {
54  ast_log(LOG_WARNING, "%s: Failed to answer channel\n",
56  return -1;
57  }
58 
59  return 0;
60 }
#define LOG_WARNING
Definition: logger.h:274
int stasis_app_send_command(struct stasis_app_control *control, stasis_app_command_cb command, void *data, command_data_destructor_fn data_destructor)
Invokes a command on a control's channel.
Definition: control.c:898
static int app_control_answer(struct stasis_app_control *control, struct ast_channel *chan, void *data)
#define NULL
Definition: resample.c:96
#define ast_debug(level,...)
Log a DEBUG message.
Definition: logger.h:452
#define ast_log
Definition: astobj2.c:42
const char * stasis_app_control_get_channel_id(const struct stasis_app_control *control)
Returns the uniqueid of the channel associated with this control.
Definition: control.c:1430
static ENTRY retval
Definition: hsearch.c:50

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 67 of file res_stasis_answer.c.

References AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, and load_module().

68 {
69  return 0;
70 }

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS , .description = "Stasis application answer support" , .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 = "res_stasis", }
static

Definition at line 77 of file res_stasis_answer.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 77 of file res_stasis_answer.c.