Asterisk - The Open Source Telephony Project  21.4.1
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"

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

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 ast_debug, 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 
51  retval = stasis_app_send_command(control, app_control_answer, NULL, NULL);
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 }
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:920
#define ast_debug(level,...)
Log a DEBUG message.
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:1452