Version 0.1.8 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@269 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
6612ac7b39
commit
1ab2e9f4be
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Reference in New Issue