#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/channel.h"
#include "asterisk/indications.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | handle_playtones (struct ast_channel *chan, const char *data) |
static int | handle_stopplaytones (struct ast_channel *chan, const char *data) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Playtones Application" , .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 = "88eaa8f5c1bd988bedd71113385e0886" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
static struct ast_module_info * | ast_module_info = &__mod_info |
static const char | playtones_app [] = "PlayTones" |
static const char | stopplaytones_app [] = "StopPlayTones" |
Definition in file app_playtones.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 133 of file app_playtones.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 133 of file app_playtones.c.
static int handle_playtones | ( | struct ast_channel * | chan, | |
const char * | data | |||
) | [static] |
Definition at line 79 of file app_playtones.c.
References ast_get_indication_tone(), ast_log(), ast_playtones_start(), ast_strlen_zero(), ast_tone_zone_sound_unref(), ast_tone_zone_sound::data, LOG_NOTICE, str, and ast_channel::zone.
Referenced by load_module().
00080 { 00081 struct ast_tone_zone_sound *ts; 00082 int res; 00083 const char *str = data; 00084 00085 if (ast_strlen_zero(str)) { 00086 ast_log(LOG_NOTICE,"Nothing to play\n"); 00087 return -1; 00088 } 00089 00090 ts = ast_get_indication_tone(chan->zone, str); 00091 00092 if (ts) { 00093 res = ast_playtones_start(chan, 0, ts->data, 0); 00094 ts = ast_tone_zone_sound_unref(ts); 00095 } else { 00096 res = ast_playtones_start(chan, 0, str, 0); 00097 } 00098 00099 if (res) { 00100 ast_log(LOG_NOTICE, "Unable to start playtones\n"); 00101 } 00102 00103 return res; 00104 }
static int handle_stopplaytones | ( | struct ast_channel * | chan, | |
const char * | data | |||
) | [static] |
Definition at line 106 of file app_playtones.c.
References ast_playtones_stop().
Referenced by load_module().
00107 { 00108 ast_playtones_stop(chan); 00109 00110 return 0; 00111 }
static int load_module | ( | void | ) | [static] |
Definition at line 123 of file app_playtones.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, handle_playtones(), and handle_stopplaytones().
00124 { 00125 int res; 00126 00127 res = ast_register_application_xml(playtones_app, handle_playtones); 00128 res |= ast_register_application_xml(stopplaytones_app, handle_stopplaytones); 00129 00130 return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS; 00131 }
static int unload_module | ( | void | ) | [static] |
Definition at line 113 of file app_playtones.c.
References ast_unregister_application().
00114 { 00115 int res; 00116 00117 res = ast_unregister_application(playtones_app); 00118 res |= ast_unregister_application(stopplaytones_app); 00119 00120 return res; 00121 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Playtones Application" , .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 = "88eaa8f5c1bd988bedd71113385e0886" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } [static] |
Definition at line 133 of file app_playtones.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 133 of file app_playtones.c.
const char playtones_app[] = "PlayTones" [static] |
Definition at line 41 of file app_playtones.c.
const char stopplaytones_app[] = "StopPlayTones" [static] |
Definition at line 42 of file app_playtones.c.