aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2001-04-10 17:18:04 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2001-04-10 17:18:04 +0000
commit1ab2e9f4be0b381e9c28b476204c0e5b1429c57f (patch)
tree7f208ce1324151706ea9ca01ce9193a92e080c69
parent6612ac7b39c7551a720bf6bce88585626cf7b806 (diff)
Version 0.1.8 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@269 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_directory.c10
-rwxr-xr-xapps/app_echo.c10
-rwxr-xr-xapps/app_intercom.c20
-rwxr-xr-xapps/app_playback.c9
-rwxr-xr-xapps/app_system.c10
5 files changed, 45 insertions, 14 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index e22a2ccb4..551f61fae 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -28,6 +28,14 @@
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 */
@@ -248,7 +256,7 @@ int unload_module(void)
int load_module(void)
{
- return ast_register_application(app, directory_exec);
+ return ast_register_application(app, directory_exec, synopsis, descrip);
}
char *description(void)
diff --git a/apps/app_echo.c b/apps/app_echo.c
index 7d0647d04..db1eb9e9a 100755
--- a/apps/app_echo.c
+++ b/apps/app_echo.c
@@ -28,11 +28,17 @@ static char *tdesc = "Simple Echo Application";
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;
@@ -64,7 +70,7 @@ int unload_module(void)
int load_module(void)
{
- return ast_register_application(app, skel_exec);
+ return ast_register_application(app, echo_exec, synopsis, descrip);
}
char *description(void)
diff --git a/apps/app_intercom.c b/apps/app_intercom.c
index a50b533a2..e12f0973b 100755
--- a/apps/app_intercom.c
+++ b/apps/app_intercom.c
@@ -37,6 +37,12 @@ static char *tdesc = "Intercom using /dev/dsp for output";
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;
@@ -48,19 +54,19 @@ static int write_audio(short *data, int len)
{
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;
}
@@ -117,10 +123,6 @@ static int intercom_exec(struct ast_channel *chan, void *data)
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;
@@ -173,7 +175,7 @@ int load_module(void)
{
if (create_audio())
return -1;
- return ast_register_application(app, intercom_exec);
+ return ast_register_application(app, intercom_exec, synopsis, descrip);
}
char *description(void)
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 945686b2c..47e096bb9 100755
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -25,6 +25,13 @@ static char *tdesc = "Trivial Playback Application";
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;
@@ -61,7 +68,7 @@ int unload_module(void)
int load_module(void)
{
- return ast_register_application(app, playback_exec);
+ return ast_register_application(app, playback_exec, synopsis, descrip);
}
char *description(void)
diff --git a/apps/app_system.c b/apps/app_system.c
index 9915cbd96..bb10543e2 100755
--- a/apps/app_system.c
+++ b/apps/app_system.c
@@ -28,6 +28,14 @@ static char *tdesc = "Generic System() application";
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;
@@ -66,7 +74,7 @@ int unload_module(void)
int load_module(void)
{
- return ast_register_application(app, skel_exec);
+ return ast_register_application(app, skel_exec, synopsis, descrip);
}
char *description(void)