| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#include "asterisk.h" |
| 32 |
|
| 33 |
#include "asterisk/module.h" |
| 34 |
#include "asterisk/stasis_app_impl.h" |
| 35 |
|
| 36 |
static int app_control_answer(struct stasis_app_control *control, |
| 37 |
struct ast_channel *chan, void *data) |
| 38 |
{ |
| 39 |
ast_debug(3, "%s: Answering\n", |
| 40 |
stasis_app_control_get_channel_id(control)); |
| 41 |
return ast_raw_answer(chan); |
| 42 |
} |
| 43 |
|
| 44 |
int stasis_app_control_answer(struct stasis_app_control *control) |
| 45 |
{ |
| 46 |
int retval; |
| 47 |
|
| 48 |
ast_debug(3, "%s: Sending answer command\n", |
| 49 |
stasis_app_control_get_channel_id(control)); |
| 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", |
| 55 |
stasis_app_control_get_channel_id(control)); |
| 56 |
return -1; |
| 57 |
} |
| 58 |
|
| 59 |
return 0; |
| 60 |
} |
| 61 |
|
| 62 |
static int load_module(void) |
| 63 |
{ |
| 64 |
return AST_MODULE_LOAD_SUCCESS; |
| 65 |
} |
| 66 |
|
| 67 |
static int unload_module(void) |
| 68 |
{ |
| 69 |
return 0; |
| 70 |
} |
| 71 |
|
| 72 |
AST_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 |
); |