From 5b168ee34babe562be856ec8f1dd14c0abd7c1a5 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sat, 1 Nov 2008 21:10:07 +0000 Subject: Merge changes from team/group/appdocsxml This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_chanspy.c | 352 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 231 insertions(+), 121 deletions(-) (limited to 'apps/app_chanspy.c') diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index dea2017ea..92a430546 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -52,128 +52,238 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define AST_NAME_STRLEN 256 #define NUM_SPYGROUPS 128 -static const char *tdesc = "Listen to a channel, and optionally whisper into it"; +/*** DOCUMENTATION + + + Listen to a channel, and optionally whisper into it. + + + + + + + + + + + + + + + + + + + + + + + + This application is used to listen to the audio from an Asterisk channel. This includes the audio + coming in and "out of the channel being spied on. If the chanprefix parameter is specified, + only channels beginning with this string will be spied upon. + While spying, the following actions may be performed: + - Dialing # cycles the volume level. + - Dialing * will stop spying and look for another channel to spy on. + - Dialing a series of digits followed by # builds a channel name to append + to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing the digits '1234#' + while spying will begin spying on the channel 'Agent/1234'. Note that this feature will be overriden if the 'd' option + is used + The X option supersedes the three features above in that if a valid + single digit extension exists in the correct context ChanSpy will exit to it. + This also disables choosing a channel based on chanprefix and a digit sequence. + + + + + Listen to a channel, and optionally whisper into it. + + + + + Specify extension. + + + Optionally specify a context, defaults to default. + + + + + + + + + + + + + + + + + + + + + + + This application is used to listen to the audio from an Asterisk channel. This includes + the audio coming in and out of the channel being spied on. Only channels created by outgoing calls for the + specified extension will be selected for spying. If the optional context is not supplied, + the current channel's context will be used. + While spying, the following actions may be performed: + - Dialing # cycles the volume level. + - Dialing * will stop spying and look for another channel to spy on. + The X option supersedes the three features above in that if a valid + single digit extension exists in the correct context ChanSpy will exit to it. + This also disables choosing a channel based on chanprefix and a digit sequence. + + + + ***/ static const char *app_chan = "ChanSpy"; -static const char *desc_chan = -" ChanSpy([chanprefix][,options]): This application is used to listen to the\n" -"audio from an Asterisk channel. This includes the audio coming in and\n" -"out of the channel being spied on. If the 'chanprefix' parameter is specified,\n" -"only channels beginning with this string will be spied upon.\n" -" While spying, the following actions may be performed:\n" -" - Dialing # cycles the volume level.\n" -" - Dialing * will stop spying and look for another channel to spy on.\n" -" - Dialing a series of digits followed by # builds a channel name to append\n" -" to 'chanprefix'. For example, executing ChanSpy(Agent) and then dialing\n" -" the digits '1234#' while spying will begin spying on the channel\n" -" 'Agent/1234'. Note that this feature will be overriden if the 'd' option\n" -" is used\n" -" Note: The X option supersedes the three features above in that if a valid\n" -" single digit extension exists in the correct context ChanSpy will\n" -" exit to it. This also disables choosing a channel based on 'chanprefix'\n" -" and a digit sequence.\n" -" Options:\n" -" b - Only spy on channels involved in a bridged call.\n" -" B - Instead of whispering on a single channel barge in on both\n" -" channels involved in the call.\n" -" d - Override the typical numeric DTMF functionality and instead\n" -" use DTMF to switch between spy modes.\n" -" 4 = spy mode\n" -" 5 = whisper mode\n" -" 6 = barge mode\n" -" g(grp) - Only spy on channels in which one or more of the groups \n" -" listed in 'grp' matches one or more groups from the\n" -" SPYGROUP variable set on the channel to be spied upon.\n" -" Note that both 'grp' and SPYGROUP can contain either a\n" -" single group or a colon-delimited list of groups, such\n" -" as 'sales:support:accounting'.\n" -" n([mailbox][@context]) - Say the name of the person being spied on if that person has recorded\n" -" his/her name. If a context is specified, then that voicemail context will\n" -" be searched when retrieving the name, otherwise the \"default\" context\n" -" will be searched. If no mailbox is specified, then the channel name will\n" -" be used when searching for the name (i.e. if SIP/1000 is the channel being\n" -" spied on and no mailbox is specified, then \"1000\" will be used when searching\n" -" for the name).\n" -" q - Don't play a beep when beginning to spy on a channel, or speak the\n" -" selected channel name.\n" -" r[(basename)] - Record the session to the monitor spool directory. An\n" -" optional base for the filename may be specified. The\n" -" default is 'chanspy'.\n" -" s - Skip the playback of the channel type (i.e. SIP, IAX, etc) when\n" -" speaking the selected channel name.\n" -" v([value]) - Adjust the initial volume in the range from -4 to 4. A\n" -" negative value refers to a quieter setting.\n" -" w - Enable 'whisper' mode, so the spying channel can talk to\n" -" the spied-on channel.\n" -" W - Enable 'private whisper' mode, so the spying channel can\n" -" talk to the spied-on channel but cannot listen to that\n" -" channel.\n" -" o - Only listen to audio coming from this channel.\n" -" X - Allow the user to exit ChanSpy to a valid single digit\n" -" numeric extension in the current context or the context\n" -" specified by the SPY_EXIT_CONTEXT channel variable. The\n" -" name of the last channel that was spied on will be stored\n" -" in the SPY_CHANNEL variable.\n" -" e(ext) - Enable 'enforced' mode, so the spying channel can\n" -" only monitor extensions whose name is in the 'ext' : \n" -" delimited list.\n" -; static const char *app_ext = "ExtenSpy"; -static const char *desc_ext = -" ExtenSpy(exten[@context][,options]): This application is used to listen to the\n" -"audio from an Asterisk channel. This includes the audio coming in and\n" -"out of the channel being spied on. Only channels created by outgoing calls for the\n" -"specified extension will be selected for spying. If the optional context is not\n" -"supplied, the current channel's context will be used.\n" -" While spying, the following actions may be performed:\n" -" - Dialing # cycles the volume level.\n" -" - Dialing * will stop spying and look for another channel to spy on.\n" -" Note: The X option superseeds the two features above in that if a valid\n" -" single digit extension exists in the correct context it ChanSpy will\n" -" exit to it.\n" -" Options:\n" -" b - Only spy on channels involved in a bridged call.\n" -" B - Instead of whispering on a single channel barge in on both\n" -" channels involved in the call.\n" -" d - Override the typical numeric DTMF functionality and instead\n" -" use DTMF to switch between spy modes.\n" -" 4 = spy mode\n" -" 5 = whisper mode\n" -" 6 = barge mode\n" -" g(grp) - Only spy on channels in which one or more of the groups \n" -" listed in 'grp' matches one or more groups from the\n" -" SPYGROUP variable set on the channel to be spied upon.\n" -" Note that both 'grp' and SPYGROUP can contain either a\n" -" single group or a colon-delimited list of groups, such\n" -" as 'sales:support:accounting'.\n" -" n([mailbox][@context]) - Say the name of the person being spied on if that person has recorded\n" -" his/her name. If a context is specified, then that voicemail context will\n" -" be searched when retrieving the name, otherwise the \"default\" context\n" -" will be searched. If no mailbox is specified, then the channel name will\n" -" be used when searching for the name (i.e. if SIP/1000 is the channel being\n" -" spied on and no mailbox is specified, then \"1000\" will be used when searching\n" -" for the name).\n" -" q - Don't play a beep when beginning to spy on a channel, or speak the\n" -" selected channel name.\n" -" r[(basename)] - Record the session to the monitor spool directory. An\n" -" optional base for the filename may be specified. The\n" -" default is 'chanspy'.\n" -" s - Skip the playback of the channel type (i.e. SIP, IAX, etc) when\n" -" speaking the selected channel name.\n" -" v([value]) - Adjust the initial volume in the range from -4 to 4. A\n" -" negative value refers to a quieter setting.\n" -" w - Enable 'whisper' mode, so the spying channel can talk to\n" -" the spied-on channel.\n" -" W - Enable 'private whisper' mode, so the spying channel can\n" -" talk to the spied-on channel but cannot listen to that\n" -" channel.\n" -" o - Only listen to audio coming from this channel.\n" -" X - Allow the user to exit ChanSpy to a valid single digit\n" -" numeric extension in the current context or the context\n" -" specified by the SPY_EXIT_CONTEXT channel variable. The\n" -" name of the last channel that was spied on will be stored\n" -" in the SPY_CHANNEL variable.\n" -; enum { OPTION_QUIET = (1 << 0), /* Quiet, no announcement */ @@ -1103,8 +1213,8 @@ static int load_module(void) { int res = 0; - res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan); - res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext); + res |= ast_register_application_xml(app_chan, chanspy_exec); + res |= ast_register_application_xml(app_ext, extenspy_exec); return res; } -- cgit v1.2.3