122 static int saycountednoun_exec(
struct ast_channel *chan,
const char *data)
131 if (ast_strlen_zero(data)) {
132 ast_log(LOG_WARNING,
"SayCountedNoun requires two arguments (<number>,<noun>)\n");
139 if (args.argc != 2) {
140 ast_log(LOG_WARNING,
"SayCountedNoun requires two arguments\n");
144 if (sscanf(args.number,
"%d", &number) != 1) {
145 ast_log(LOG_WARNING,
"First argument must be a number between 0 and 2,147,483,647.\n");
149 return ast_say_counted_noun(chan, number, args.noun);
152 static int saycountedadj_exec(
struct ast_channel *chan,
const char *data)
162 if (ast_strlen_zero(data)) {
163 ast_log(LOG_WARNING,
"SayCountedAdj requires two or three arguments (<number>,<adjective>[,<gender>])\n");
171 ast_log(LOG_WARNING,
"SayCountedAdj requires at least two arguments\n");
175 if (sscanf(args.number,
"%d", &number) != 1) {
176 ast_log(LOG_WARNING,
"First argument must be a number between 0 and 2,147,483,647.\n");
180 if (!ast_strlen_zero(args.gender)) {
181 if (strchr(
"cCfFmMnN", args.gender[0])) {
182 ast_log(LOG_WARNING,
"SayCountedAdj gender option must be one of 'f', 'm', 'c', or 'n'.\n");
187 return ast_say_counted_adjective(chan, number, args.adjective, args.gender);
190 static int load_module(
void)
198 static int unload_module(
void)
206 AST_MODULE_INFO_STANDARD_EXTENDED(
ASTERISK_GPL_KEY,
"Decline words according to channel language");
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Support for logging to various files, console and syslog Configuration in file logger.conf.
Say numbers and dates (maybe words one day too)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.