IVR Demo application. More...
#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/app.h"
Go to the source code of this file.
Functions | |
AST_IVR_DECLARE_MENU (ivr_demo,"IVR Demo Main Menu", 0,{{"s", AST_ACTION_BACKGROUND,"demo-congrats"},{"g", AST_ACTION_BACKGROUND,"demo-instruct"},{"g", AST_ACTION_WAITOPTION},{"1", AST_ACTION_PLAYBACK,"digits/1"},{"1", AST_ACTION_RESTART},{"2", AST_ACTION_MENU,&ivr_submenu},{"2", AST_ACTION_RESTART},{"i", AST_ACTION_PLAYBACK,"invalid"},{"i", AST_ACTION_REPEAT,(void *)(unsigned long) 2},{"#", AST_ACTION_EXIT},{NULL},}) | |
AST_IVR_DECLARE_MENU (ivr_submenu,"IVR Demo Sub Menu", 0,{{"s", AST_ACTION_BACKGROUND,"demo-abouttotry"},{"s", AST_ACTION_WAITOPTION},{"1", AST_ACTION_PLAYBACK,"digits/1"},{"1", AST_ACTION_PLAYBACK,"digits/1"},{"1", AST_ACTION_RESTART},{"2", AST_ACTION_PLAYLIST,"digits/2;digits/3"},{"3", AST_ACTION_CALLBACK, ivr_demo_func},{"4", AST_ACTION_TRANSFER,"demo|s|1"},{"*", AST_ACTION_REPEAT},{"#", AST_ACTION_UPONE},{NULL}}) | |
AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"IVR Demo Application") | |
static int | ivr_demo_func (struct ast_channel *chan, void *data) |
static int | load_module (void) |
static int | skel_exec (struct ast_channel *chan, const char *data) |
static int | unload_module (void) |
Variables | |
static char * | app = "IVRDemo" |
IVR Demo application.
Definition in file app_ivrdemo.c.
AST_IVR_DECLARE_MENU | ( | ivr_demo | , | |
"IVR Demo Main Menu" | , | |||
0 | ||||
) |
AST_IVR_DECLARE_MENU | ( | ivr_submenu | , | |
"IVR Demo Sub Menu" | , | |||
0 | ||||
) |
AST_MODULE_INFO_STANDARD | ( | ASTERISK_GPL_KEY | , | |
"IVR Demo Application" | ||||
) |
static int ivr_demo_func | ( | struct ast_channel * | chan, | |
void * | data | |||
) | [static] |
Definition at line 61 of file app_ivrdemo.c.
References ast_verbose.
00062 { 00063 ast_verbose("IVR Demo, data is %s!\n", (char *) data); 00064 return 0; 00065 }
static int load_module | ( | void | ) | [static] |
Definition at line 124 of file app_ivrdemo.c.
References ast_register_application_xml, and skel_exec().
00125 { 00126 return ast_register_application_xml(app, skel_exec); 00127 }
static int skel_exec | ( | struct ast_channel * | chan, | |
const char * | data | |||
) | [static] |
Definition at line 97 of file app_ivrdemo.c.
References ast_channel::_state, ast_answer(), ast_ivr_menu_run(), ast_log(), AST_STATE_UP, ast_strdupa, ast_strlen_zero(), and LOG_WARNING.
Referenced by load_module().
00098 { 00099 int res=0; 00100 char *tmp; 00101 00102 if (ast_strlen_zero(data)) { 00103 ast_log(LOG_WARNING, "skel requires an argument (filename)\n"); 00104 return -1; 00105 } 00106 00107 tmp = ast_strdupa(data); 00108 00109 /* Do our thing here */ 00110 00111 if (chan->_state != AST_STATE_UP) 00112 res = ast_answer(chan); 00113 if (!res) 00114 res = ast_ivr_menu_run(chan, &ivr_demo, tmp); 00115 00116 return res; 00117 }
static int unload_module | ( | void | ) | [static] |
Definition at line 119 of file app_ivrdemo.c.
References ast_unregister_application().
00120 { 00121 return ast_unregister_application(app); 00122 }
char* app = "IVRDemo" [static] |
Definition at line 59 of file app_ivrdemo.c.