static char *tdesc = "Extension Directory";
static char *app = "Directory";
+static char *synopsis = "Provide directory of voicemail extensions";
+static char *descrip =
+" Directory(context): Presents the user with a directory of extensions from which\n"
+" they may select by name. The list of names and extensions is discovered from\n"
+" voicemail.conf. The context argument is required, and specifies the context\n"
+" in which to interpret the extensions\n. Returns 0 unless the user hangs up. It\n"
+" also sets up the channel on exit to enter the extension the user selected.\n";
+
/* For simplicity, I'm keeping the format compatible with the voicemail config,
but i'm open to suggestions for isolating it */
int load_module(void)
{
- return ast_register_application(app, directory_exec);
+ return ast_register_application(app, directory_exec, synopsis, descrip);
}
char *description(void)
static char *app = "Echo";
+static char *synopsis = "Echo audio read back to the user";
+
+static char *descrip =
+" Echo(): Echo audio read from channel back to the channel. Returns 0\n"
+" if the user exits with the '#' key, or -1 if the user hangs up.\n";
+
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
-static int skel_exec(struct ast_channel *chan, void *data)
+static int echo_exec(struct ast_channel *chan, void *data)
{
int res=-1;
struct localuser *u;
int load_module(void)
{
- return ast_register_application(app, skel_exec);
+ return ast_register_application(app, echo_exec, synopsis, descrip);
}
char *description(void)
static char *app = "Intercom";
+static char *synopsis = "(Obsolete) Send to Intercom";
+static char *descrip =
+" Intercom(): Sends the user to the intercom (i.e. /dev/dsp). This program\n"
+" is generally considered obselete by the chan_oss module. Returns 0 if the\n"
+" user exits with a DTMF tone, or -1 if they hangup.\n";
+
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
{
int res;
struct audio_buf_info info;
- pthread_mutex_lock(&sound_lock);
+ ast_pthread_mutex_lock(&sound_lock);
if (sound < 0) {
ast_log(LOG_WARNING, "Sound device closed?\n");
- pthread_mutex_unlock(&sound_lock);
+ ast_pthread_mutex_unlock(&sound_lock);
return -1;
}
if (ioctl(sound, SNDCTL_DSP_GETOSPACE, &info)) {
ast_log(LOG_WARNING, "Unable to read output space\n");
- pthread_mutex_unlock(&sound_lock);
+ ast_pthread_mutex_unlock(&sound_lock);
return -1;
}
res = write(sound, data, len);
- pthread_mutex_unlock(&sound_lock);
+ ast_pthread_mutex_unlock(&sound_lock);
return res;
}
struct localuser *u;
struct ast_frame *f;
int oreadformat;
- if (!data) {
- ast_log(LOG_WARNING, "Playback requires an argument (filename)\n");
- return -1;
- }
LOCAL_USER_ADD(u);
/* Remember original read format */
oreadformat = chan->readformat;
{
if (create_audio())
return -1;
- return ast_register_application(app, intercom_exec);
+ return ast_register_application(app, intercom_exec, synopsis, descrip);
}
char *description(void)
static char *app = "Playback";
+static char *synopsis = "Play a file";
+
+static char *descrip =
+ "Playback(filename): Plays back a given filename (do not put extension).\n"
+ "Returns -1 if the channel was hung up, or if the file does not exist.\n"
+ "Returns 0 otherwise.\n";
+
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
int load_module(void)
{
- return ast_register_application(app, playback_exec);
+ return ast_register_application(app, playback_exec, synopsis, descrip);
}
char *description(void)
static char *app = "System";
+static char *synopsis = "Execute a system command";
+
+static char *descrip =
+" System(command): Executes a command by using system(). Returns -1 on failure to execute\n"
+" the specified command. If the command itself executes but is in error, and if there exists\n"
+" a priority n + 101, where 'n' is the priority of the current instance, then the channel will\n"
+" will be setup to continue at that priority level. Otherwise, System returns 0.\n";
+
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
int load_module(void)
{
- return ast_register_application(app, skel_exec);
+ return ast_register_application(app, skel_exec, synopsis, descrip);
}
char *description(void)