Asterisk - The Open Source Telephony Project GIT-master-abe0018
res_stasis_answer.c
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2013, Digium, Inc.
5 *
6 * David M. Lee, II <dlee@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19/*! \file
20 *
21 * \brief Stasis application control support.
22 *
23 * \author David M. Lee, II <dlee@digium.com>
24 */
25
26/*** MODULEINFO
27 <depend type="module">res_stasis</depend>
28 <support_level>core</support_level>
29 ***/
30
31#include "asterisk.h"
32
33#include "asterisk/module.h"
35
36static int app_control_answer(struct stasis_app_control *control,
37 struct ast_channel *chan, void *data)
38{
39 ast_debug(3, "%s: Answering\n",
41 return ast_raw_answer(chan);
42}
43
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}
61
62static int load_module(void)
63{
65}
66
67static int unload_module(void)
68{
69 return 0;
70}
71
72AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Stasis application answer support",
73 .support_level = AST_MODULE_SUPPORT_CORE,
74 .load = load_module,
75 .unload = unload_module,
76 .requires = "res_stasis",
77);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_log
Definition: astobj2.c:42
int ast_raw_answer(struct ast_channel *chan)
Answer a channel.
Definition: channel.c:2690
static ENTRY retval
Definition: hsearch.c:50
#define ast_debug(level,...)
Log a DEBUG message.
#define LOG_WARNING
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
Definition: module.h:330
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Definition: module.h:557
@ AST_MODULE_SUPPORT_CORE
Definition: module.h:121
#define ASTERISK_GPL_KEY
The text the key() function should return.
Definition: module.h:46
@ AST_MODULE_LOAD_SUCCESS
Definition: module.h:70
static int app_control_answer(struct stasis_app_control *control, struct ast_channel *chan, void *data)
static int load_module(void)
static int unload_module(void)
int stasis_app_control_answer(struct stasis_app_control *control)
Answer the channel associated with this control.
#define NULL
Definition: resample.c:96
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
Backend API for implementing components of res_stasis.
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
Main Channel structure associated with a channel.