[svn-commits] branch crichter/0.3.0 - r7981 in /team/crichter/0.3.0: ./ apps/ cdr/ channels...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Jan 11 06:13:44 CST 2006


Author: crichter
Date: Wed Jan 11 06:11:51 2006
New Revision: 7981

URL: http://svn.digium.com/view/asterisk?rev=7981&view=rev
Log:
merged -r 7670:7980 manually

Added:
    team/crichter/0.3.0/contrib/init.d/rc.suse.asterisk   (props changed)
      - copied unchanged from r7980, trunk/contrib/init.d/rc.suse.asterisk
    team/crichter/0.3.0/contrib/scripts/safe_asterisk_restart
      - copied unchanged from r7980, trunk/contrib/scripts/safe_asterisk_restart
    team/crichter/0.3.0/doc/README.app_sms   (props changed)
      - copied unchanged from r7980, trunk/doc/README.app_sms
    team/crichter/0.3.0/doc/README.channels   (props changed)
      - copied unchanged from r7980, trunk/doc/README.channels
    team/crichter/0.3.0/doc/README.linkedlists   (props changed)
      - copied unchanged from r7980, trunk/doc/README.linkedlists
    team/crichter/0.3.0/formats/format_h264.c
      - copied unchanged from r7980, trunk/formats/format_h264.c
    team/crichter/0.3.0/funcs/func_base64.c
      - copied unchanged from r7980, trunk/funcs/func_base64.c
    team/crichter/0.3.0/funcs/func_rand.c
      - copied unchanged from r7980, trunk/funcs/func_rand.c
    team/crichter/0.3.0/include/asterisk/stringfields.h
      - copied unchanged from r7980, trunk/include/asterisk/stringfields.h
Removed:
    team/crichter/0.3.0/ast_expr.y
    team/crichter/0.3.0/channels/chan_modem.c
    team/crichter/0.3.0/channels/chan_modem_aopen.c
    team/crichter/0.3.0/channels/chan_modem_bestdata.c
    team/crichter/0.3.0/channels/chan_modem_i4l.c
    team/crichter/0.3.0/doc/app_sms.html
    team/crichter/0.3.0/doc/channel.txt
    team/crichter/0.3.0/doc/linkedlists.README
Modified:
    team/crichter/0.3.0/   (props changed)
    team/crichter/0.3.0/UPGRADE.txt
    team/crichter/0.3.0/acl.c
    team/crichter/0.3.0/aescrypt.c
    team/crichter/0.3.0/aeskey.c
    team/crichter/0.3.0/alaw.c
    team/crichter/0.3.0/app.c
    team/crichter/0.3.0/apps/   (props changed)
    team/crichter/0.3.0/apps/app_adsiprog.c
    team/crichter/0.3.0/apps/app_authenticate.c
    team/crichter/0.3.0/apps/app_cdr.c
    team/crichter/0.3.0/apps/app_chanisavail.c
    team/crichter/0.3.0/apps/app_chanspy.c
    team/crichter/0.3.0/apps/app_controlplayback.c
    team/crichter/0.3.0/apps/app_curl.c
    team/crichter/0.3.0/apps/app_db.c
    team/crichter/0.3.0/apps/app_dial.c
    team/crichter/0.3.0/apps/app_dictate.c
    team/crichter/0.3.0/apps/app_directed_pickup.c
    team/crichter/0.3.0/apps/app_directory.c
    team/crichter/0.3.0/apps/app_disa.c
    team/crichter/0.3.0/apps/app_dumpchan.c
    team/crichter/0.3.0/apps/app_echo.c
    team/crichter/0.3.0/apps/app_externalivr.c
    team/crichter/0.3.0/apps/app_festival.c
    team/crichter/0.3.0/apps/app_flash.c
    team/crichter/0.3.0/apps/app_forkcdr.c
    team/crichter/0.3.0/apps/app_getcpeid.c
    team/crichter/0.3.0/apps/app_hasnewvoicemail.c
    team/crichter/0.3.0/apps/app_ices.c
    team/crichter/0.3.0/apps/app_image.c
    team/crichter/0.3.0/apps/app_intercom.c
    team/crichter/0.3.0/apps/app_ivrdemo.c
    team/crichter/0.3.0/apps/app_lookupblacklist.c
    team/crichter/0.3.0/apps/app_lookupcidname.c
    team/crichter/0.3.0/apps/app_macro.c
    team/crichter/0.3.0/apps/app_meetme.c
    team/crichter/0.3.0/apps/app_milliwatt.c
    team/crichter/0.3.0/apps/app_mixmonitor.c
    team/crichter/0.3.0/apps/app_mp3.c
    team/crichter/0.3.0/apps/app_nbscat.c
    team/crichter/0.3.0/apps/app_osplookup.c
    team/crichter/0.3.0/apps/app_page.c
    team/crichter/0.3.0/apps/app_parkandannounce.c
    team/crichter/0.3.0/apps/app_playback.c
    team/crichter/0.3.0/apps/app_privacy.c
    team/crichter/0.3.0/apps/app_queue.c
    team/crichter/0.3.0/apps/app_read.c
    team/crichter/0.3.0/apps/app_readfile.c
    team/crichter/0.3.0/apps/app_realtime.c
    team/crichter/0.3.0/apps/app_record.c
    team/crichter/0.3.0/apps/app_rpt.c
    team/crichter/0.3.0/apps/app_sayunixtime.c
    team/crichter/0.3.0/apps/app_senddtmf.c
    team/crichter/0.3.0/apps/app_sendtext.c
    team/crichter/0.3.0/apps/app_setcallerid.c
    team/crichter/0.3.0/apps/app_setcdruserfield.c
    team/crichter/0.3.0/apps/app_settransfercapability.c
    team/crichter/0.3.0/apps/app_skel.c
    team/crichter/0.3.0/apps/app_sms.c
    team/crichter/0.3.0/apps/app_softhangup.c
    team/crichter/0.3.0/apps/app_sql_postgres.c
    team/crichter/0.3.0/apps/app_stack.c
    team/crichter/0.3.0/apps/app_system.c
    team/crichter/0.3.0/apps/app_talkdetect.c
    team/crichter/0.3.0/apps/app_test.c
    team/crichter/0.3.0/apps/app_transfer.c
    team/crichter/0.3.0/apps/app_url.c
    team/crichter/0.3.0/apps/app_verbose.c
    team/crichter/0.3.0/apps/app_voicemail.c
    team/crichter/0.3.0/apps/app_waitforring.c
    team/crichter/0.3.0/apps/app_waitforsilence.c
    team/crichter/0.3.0/apps/app_while.c
    team/crichter/0.3.0/apps/app_zapateller.c
    team/crichter/0.3.0/apps/app_zapbarge.c
    team/crichter/0.3.0/apps/app_zapras.c
    team/crichter/0.3.0/apps/app_zapscan.c
    team/crichter/0.3.0/ast_expr2.fl
    team/crichter/0.3.0/ast_expr2f.c
    team/crichter/0.3.0/asterisk.c
    team/crichter/0.3.0/astmm.c
    team/crichter/0.3.0/autoservice.c
    team/crichter/0.3.0/buildinfo.c
    team/crichter/0.3.0/callerid.c
    team/crichter/0.3.0/cdr/   (props changed)
    team/crichter/0.3.0/cdr.c
    team/crichter/0.3.0/cdr/cdr_csv.c
    team/crichter/0.3.0/cdr/cdr_custom.c
    team/crichter/0.3.0/channel.c
    team/crichter/0.3.0/channels/   (props changed)
    team/crichter/0.3.0/channels/Makefile
    team/crichter/0.3.0/channels/chan_agent.c
    team/crichter/0.3.0/channels/chan_alsa.c
    team/crichter/0.3.0/channels/chan_features.c
    team/crichter/0.3.0/channels/chan_h323.c
    team/crichter/0.3.0/channels/chan_iax2.c
    team/crichter/0.3.0/channels/chan_local.c
    team/crichter/0.3.0/channels/chan_mgcp.c
    team/crichter/0.3.0/channels/chan_oss.c
    team/crichter/0.3.0/channels/chan_phone.c
    team/crichter/0.3.0/channels/chan_sip.c
    team/crichter/0.3.0/channels/chan_zap.c
    team/crichter/0.3.0/channels/iax2-parser.c
    team/crichter/0.3.0/channels/iax2-provision.c
    team/crichter/0.3.0/chanvars.c
    team/crichter/0.3.0/cli.c
    team/crichter/0.3.0/codecs/   (props changed)
    team/crichter/0.3.0/codecs/ilbc/   (props changed)
    team/crichter/0.3.0/codecs/lpc10/   (props changed)
    team/crichter/0.3.0/config.c
    team/crichter/0.3.0/configs/features.conf.sample
    team/crichter/0.3.0/configs/manager.conf.sample
    team/crichter/0.3.0/configs/sip.conf.sample
    team/crichter/0.3.0/configs/zapata.conf.sample
    team/crichter/0.3.0/contrib/scripts/managerproxy.pl
    team/crichter/0.3.0/cryptostub.c
    team/crichter/0.3.0/db.c
    team/crichter/0.3.0/db1-ast/   (props changed)
    team/crichter/0.3.0/devicestate.c
    team/crichter/0.3.0/dns.c
    team/crichter/0.3.0/dnsmgr.c
    team/crichter/0.3.0/doc/CODING-GUIDELINES
    team/crichter/0.3.0/doc/README.cdr
    team/crichter/0.3.0/doc/README.variables
    team/crichter/0.3.0/dsp.c
    team/crichter/0.3.0/editline/   (props changed)
    team/crichter/0.3.0/enum.c
    team/crichter/0.3.0/file.c
    team/crichter/0.3.0/formats/   (props changed)
    team/crichter/0.3.0/formats/Makefile
    team/crichter/0.3.0/formats/format_pcm.c
    team/crichter/0.3.0/formats/format_pcm_alaw.c
    team/crichter/0.3.0/frame.c
    team/crichter/0.3.0/fskmodem.c
    team/crichter/0.3.0/funcs/   (props changed)
    team/crichter/0.3.0/funcs/Makefile
    team/crichter/0.3.0/funcs/func_cdr.c
    team/crichter/0.3.0/funcs/func_cut.c
    team/crichter/0.3.0/funcs/func_db.c
    team/crichter/0.3.0/funcs/func_enum.c
    team/crichter/0.3.0/funcs/func_logic.c
    team/crichter/0.3.0/funcs/func_math.c
    team/crichter/0.3.0/funcs/func_md5.c
    team/crichter/0.3.0/funcs/func_moh.c
    team/crichter/0.3.0/funcs/func_odbc.c
    team/crichter/0.3.0/funcs/func_strings.c
    team/crichter/0.3.0/funcs/func_timeout.c
    team/crichter/0.3.0/funcs/func_uri.c
    team/crichter/0.3.0/funcs/pbx_functions.c
    team/crichter/0.3.0/image.c
    team/crichter/0.3.0/include/asterisk/app.h
    team/crichter/0.3.0/include/asterisk/astmm.h
    team/crichter/0.3.0/include/asterisk/astobj.h
    team/crichter/0.3.0/include/asterisk/callerid.h
    team/crichter/0.3.0/include/asterisk/channel.h
    team/crichter/0.3.0/include/asterisk/chanspy.h
    team/crichter/0.3.0/include/asterisk/dns.h
    team/crichter/0.3.0/include/asterisk/doxyref.h
    team/crichter/0.3.0/include/asterisk/frame.h
    team/crichter/0.3.0/include/asterisk/image.h
    team/crichter/0.3.0/include/asterisk/linkedlists.h
    team/crichter/0.3.0/include/asterisk/manager.h
    team/crichter/0.3.0/include/asterisk/options.h
    team/crichter/0.3.0/include/asterisk/pbx.h
    team/crichter/0.3.0/include/asterisk/rtp.h
    team/crichter/0.3.0/include/asterisk/strings.h
    team/crichter/0.3.0/include/asterisk/translate.h
    team/crichter/0.3.0/include/asterisk/utils.h
    team/crichter/0.3.0/io.c
    team/crichter/0.3.0/loader.c
    team/crichter/0.3.0/logger.c
    team/crichter/0.3.0/manager.c
    team/crichter/0.3.0/muted.c
    team/crichter/0.3.0/netsock.c
    team/crichter/0.3.0/pbx/   (props changed)
    team/crichter/0.3.0/pbx.c
    team/crichter/0.3.0/pbx/pbx_config.c
    team/crichter/0.3.0/pbx/pbx_spool.c
    team/crichter/0.3.0/plc.c
    team/crichter/0.3.0/privacy.c
    team/crichter/0.3.0/res/   (props changed)
    team/crichter/0.3.0/res/res_adsi.c
    team/crichter/0.3.0/res/res_agi.c
    team/crichter/0.3.0/res/res_config_odbc.c
    team/crichter/0.3.0/res/res_crypto.c
    team/crichter/0.3.0/res/res_features.c
    team/crichter/0.3.0/res/res_monitor.c
    team/crichter/0.3.0/res/res_musiconhold.c
    team/crichter/0.3.0/res/res_odbc.c
    team/crichter/0.3.0/res/res_osp.c
    team/crichter/0.3.0/rtp.c
    team/crichter/0.3.0/say.c
    team/crichter/0.3.0/sched.c
    team/crichter/0.3.0/slinfactory.c
    team/crichter/0.3.0/srv.c
    team/crichter/0.3.0/stdtime/   (props changed)
    team/crichter/0.3.0/tdd.c
    team/crichter/0.3.0/term.c
    team/crichter/0.3.0/translate.c
    team/crichter/0.3.0/ulaw.c
    team/crichter/0.3.0/utils.c

Propchange: team/crichter/0.3.0/
------------------------------------------------------------------------------
--- svnmerge-blocked (original)
+++ svnmerge-blocked Wed Jan 11 06:11:51 2006
@@ -1,1 +1,1 @@
-/branches/1.2:7497
+/branches/1.2:7497,7915,7960,7965,7970,7976

Propchange: team/crichter/0.3.0/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: team/crichter/0.3.0/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/UPGRADE.txt?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/UPGRADE.txt (original)
+++ team/crichter/0.3.0/UPGRADE.txt Wed Jan 11 06:11:51 2006
@@ -18,6 +18,9 @@
 * The application SetVar has been renamed to Set.  The syntax SetVar was marked
   deprecated in version 1.2 and is no longer recognized in this version.
 
+* app_read has been updated to use the newer options codes, using "skip" or
+  "noanswer" will not work.  Use s or n.  Also there is a new feature i, for
+  using indication tones, so typing in skip would give you unexpected results.
 Variables:
 
 * The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
@@ -26,3 +29,6 @@
   functions.  You are encouraged to move towards the associated dialplan
   function, as these variables will be removed in a future release.
 
+The SIP channel:
+
+* The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.

Modified: team/crichter/0.3.0/acl.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/acl.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/acl.c (original)
+++ team/crichter/0.3.0/acl.c Wed Jan 11 06:11:51 2006
@@ -19,7 +19,8 @@
 /*! \file
  *
  * \brief Various sorts of access control
- * 
+ *
+ * \author Mark Spencer <markster at digium.com> 
  */
 
 #include <stdio.h>

Modified: team/crichter/0.3.0/aescrypt.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/aescrypt.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/aescrypt.c (original)
+++ team/crichter/0.3.0/aescrypt.c Wed Jan 11 06:11:51 2006
@@ -31,12 +31,16 @@
  Issue Date: 26/08/2003
 
 */
+
 /*! \file
-\brief  This file contains the code for implementing encryption and decryption
- for AES (Rijndael) for block and key sizes of 16, 24 and 32 bytes. It
- can optionally be replaced by code written in assembler using NASM. For
- further details see the file aesopt.h
-*/
+ *
+ * \brief  This file contains the code for implementing encryption and decryption
+ * for AES (Rijndael) for block and key sizes of 16, 24 and 32 bytes. It
+ * can optionally be replaced by code written in assembler using NASM. For
+ * further details see the file aesopt.h
+ *
+ * \author Dr Brian Gladman <brg at gladman.me.uk>
+ */
 
 #include "aesopt.h"
 

Modified: team/crichter/0.3.0/aeskey.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/aeskey.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/aeskey.c (original)
+++ team/crichter/0.3.0/aeskey.c Wed Jan 11 06:11:51 2006
@@ -31,11 +31,15 @@
  Issue Date: 26/08/2003
 
 */
+
 /*! \file
-\brief  This file contains the code for implementing the key schedule for AES
- (Rijndael) for block and key sizes of 16, 24, and 32 bytes. See aesopt.h
- for further details including optimisation.
-*/
+ *
+ *  \brief  This file contains the code for implementing the key schedule for AES
+ *  (Rijndael) for block and key sizes of 16, 24, and 32 bytes. See aesopt.h
+ *  for further details including optimisation.
+ *
+ * \author Dr Brian Gladman <brg at gladman.me.uk>
+ */
 
 #include "aesopt.h"
 

Modified: team/crichter/0.3.0/alaw.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/alaw.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/alaw.c (original)
+++ team/crichter/0.3.0/alaw.c Wed Jan 11 06:11:51 2006
@@ -19,7 +19,8 @@
 /*! \file
  *
  * \brief u-Law to Signed linear conversion
- * 
+ *
+ * \author Mark Spencer <markster at digium.com> 
  */
 
 #include "asterisk.h"

Modified: team/crichter/0.3.0/app.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/app.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/app.c (original)
+++ team/crichter/0.3.0/app.c Wed Jan 11 06:11:51 2006
@@ -19,7 +19,8 @@
 /*! \file
  *
  * \brief Convenient Application Routines
- * 
+ *
+ * \author Mark Spencer <markster at digium.com> 
  */
 
 #include <stdio.h>
@@ -278,47 +279,57 @@
 	return 0;
 }
 
-int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between) 
-{
-	char *ptr;
+int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const char *digits, int between) 
+{
+	const char *ptr;
 	int res = 0;
-	struct ast_frame f;
+	struct ast_frame f = {
+		.frametype = AST_FRAME_DTMF,
+		.src = "ast_dtmf_stream"
+	};
+
 	if (!between)
 		between = 100;
 
 	if (peer)
 		res = ast_autoservice_start(peer);
 
-	if (!res) {
-		res = ast_waitfor(chan,100);
-		if (res > -1) {
-			for (ptr=digits; *ptr; ptr++) {
-				if (*ptr == 'w') {
-					res = ast_safe_sleep(chan, 500);
-					if (res) 
-						break;
-					continue;
-				}
-				memset(&f, 0, sizeof(f));
-				f.frametype = AST_FRAME_DTMF;
+	if (!res)
+		res = ast_waitfor(chan, 100);
+
+	/* ast_waitfor will return the number of remaining ms on success */
+	if (res < 0)
+		return res;
+
+	for (ptr = digits; *ptr; ptr++) {
+		if (*ptr == 'w') {
+			/* 'w' -- wait half a second */
+			if ((res = ast_safe_sleep(chan, 500)))
+				break;
+		} else if (strchr("0123456789*#abcdfABCDF", *ptr)) {
+			/* Character represents valid DTMF */
+			if (*ptr == 'f' || *ptr == 'F') {
+				/* ignore return values if not supported by channel */
+				ast_indicate(chan, AST_CONTROL_FLASH);
+			} else {
 				f.subclass = *ptr;
-				f.src = "ast_dtmf_stream";
-				if (strchr("0123456789*#abcdABCD",*ptr)==NULL) {
-					ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdD allowed)\n",*ptr);
-				} else {
-					res = ast_write(chan, &f);
-					if (res) 
-						break;
-					/* pause between digits */
-					res = ast_safe_sleep(chan,between);
-					if (res) 
-						break;
-				}
-			}
-		}
-		if (peer)
-			res = ast_autoservice_stop(peer);
-	}
+				if ((res = ast_write(chan, &f)))
+					break;
+			}
+			/* pause between digits */
+			if ((res = ast_safe_sleep(chan, between)))
+				break;
+		} else
+			ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdD allowed)\n",*ptr);
+	}
+
+	if (peer) {
+		/* Stop autoservice on the peer channel, but don't overwrite any error condition 
+		   that has occurred previously while acting on the primary channel */
+		if (ast_autoservice_stop(peer) && !res)
+			res = -1;
+	}
+
 	return res;
 }
 

Propchange: team/crichter/0.3.0/apps/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jan 11 06:11:51 2006
@@ -1,1 +1,3 @@
 .depend
+*.a
+*.so

Modified: team/crichter/0.3.0/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_adsiprog.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_adsiprog.c (original)
+++ team/crichter/0.3.0/apps/app_adsiprog.c Wed Jan 11 06:11:51 2006
@@ -17,7 +17,10 @@
  */
 
 /*! \file
+ *
  * \brief Program Asterisk ADSI Scripts into phone
+ *
+ * \author Mark Spencer <markster at digium.com>
  * 
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_authenticate.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_authenticate.c (original)
+++ team/crichter/0.3.0/apps/app_authenticate.c Wed Jan 11 06:11:51 2006
@@ -17,7 +17,10 @@
  */
 
 /*! \file
+ *
  * \brief Execute arbitrary authenticate commands
+ *
+ * \author Mark Spencer <markster at digium.com>
  * 
  * \ingroup applications
  */
@@ -41,6 +44,23 @@
 #include "asterisk/app.h"
 #include "asterisk/astdb.h"
 #include "asterisk/utils.h"
+#include "asterisk/options.h"
+
+enum {
+	OPT_ACCOUNT = (1 << 0),
+	OPT_DATABASE = (1 << 1),
+	OPT_JUMP = (1 << 2),
+	OPT_MULTIPLE = (1 << 3),
+	OPT_REMOVE = (1 << 4),
+} auth_option_flags;
+
+AST_APP_OPTIONS(auth_app_options, {
+	AST_APP_OPTION('a', OPT_ACCOUNT),
+	AST_APP_OPTION('d', OPT_DATABASE),
+	AST_APP_OPTION('j', OPT_JUMP),
+	AST_APP_OPTION('m', OPT_MULTIPLE),
+	AST_APP_OPTION('r', OPT_REMOVE),
+});
 
 static char *tdesc = "Authentication Application";
 
@@ -49,9 +69,9 @@
 static char *synopsis = "Authenticate a user";
 
 static char *descrip =
-"  Authenticate(password[|options]): This application asks the caller to enter a\n"
-"given password in order to continue dialplan execution. If the password begins\n"
-"with the '/' character, it is interpreted as a file which contains a list of\n"
+"  Authenticate(password[|options[|maxdigits]]): This application asks the caller\n"
+"to enter a given password in order to continue dialplan execution. If the password\n"
+"begins with the '/' character, it is interpreted as a file which contains a list of\n"
 "valid passwords, listed 1 password per line in the file.\n"
 "  When using a database key, the value associated with the key can be anything.\n"
 "Users have three attempts to authenticate before the channel is hung up. If the\n"
@@ -66,6 +86,10 @@
 "         the file. When one of the passwords is matched, the channel will have\n"
 "         its account code set to the corresponding account code in the file.\n"
 "     r - Remove the database key upon successful entry (valid with 'd' only)\n"
+"     maxdigits  - maximum acceptable number of digits. Stops reading after\n"
+"         maxdigits have been entered (without requiring the user to\n"
+"         press the '#' key).\n"
+"         Defaults to 0 - no limit - wait for the user press the '#' key.\n"
 ;
 
 STANDARD_LOCAL_USER;
@@ -75,13 +99,19 @@
 static int auth_exec(struct ast_channel *chan, void *data)
 {
 	int res=0;
-	int jump = 0;
 	int retries;
 	struct localuser *u;
-	char password[256]="";
 	char passwd[256];
-	char *opts;
 	char *prompt;
+	int maxdigits;
+	char *argcopy =NULL;
+	struct ast_flags flags = {0};
+
+	AST_DECLARE_APP_ARGS(arglist,
+		AST_APP_ARG(password);
+		AST_APP_ARG(options);
+		AST_APP_ARG(maxdigits);
+	);
 	
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Authenticate requires an argument(password)\n");
@@ -98,37 +128,49 @@
 		}
 	}
 	
-	strncpy(password, data, sizeof(password) - 1);
-	opts=strchr(password, '|');
-	if (opts) {
-		*opts = 0;
-		opts++;
-	} else
-		opts = "";
-	if (strchr(opts, 'j'))
-		jump = 1;
+	argcopy = ast_strdupa(data);
+	if (!argcopy) {
+		ast_log(LOG_ERROR, "Out of memory!\n");
+		LOCAL_USER_REMOVE(u);
+		return -1;
+	}
+
+	AST_STANDARD_APP_ARGS(arglist,argcopy);
+	
+	if (!ast_strlen_zero(arglist.options)) {
+		ast_app_parse_options(auth_app_options, &flags, NULL, arglist.options);
+	}
+
+	if (!ast_strlen_zero(arglist.maxdigits)) {
+		maxdigits = atoi(arglist.maxdigits);
+		if ((maxdigits<1) || (maxdigits>sizeof(passwd)-2))
+			maxdigits = sizeof(passwd) - 2;
+	} else {
+		maxdigits = sizeof(passwd) - 2;
+	}
+
 	/* Start asking for password */
 	prompt = "agent-pass";
 	for (retries = 0; retries < 3; retries++) {
-		res = ast_app_getdata(chan, prompt, passwd, sizeof(passwd) - 2, 0);
+		res = ast_app_getdata(chan, prompt, passwd, maxdigits, 0);
 		if (res < 0)
 			break;
 		res = 0;
-		if (password[0] == '/') {
-			if (strchr(opts, 'd')) {
+		if (arglist.password[0] == '/') {
+			if (ast_test_flag(&flags,OPT_DATABASE)) {
 				char tmp[256];
 				/* Compare against a database key */
-				if (!ast_db_get(password + 1, passwd, tmp, sizeof(tmp))) {
+				if (!ast_db_get(arglist.password + 1, passwd, tmp, sizeof(tmp))) {
 					/* It's a good password */
-					if (strchr(opts, 'r')) {
-						ast_db_del(password + 1, passwd);
+					if (ast_test_flag(&flags,OPT_REMOVE)) {
+						ast_db_del(arglist.password + 1, passwd);
 					}
 					break;
 				}
 			} else {
 				/* Compare against a file */
 				FILE *f;
-				f = fopen(password, "r");
+				f = fopen(arglist.password, "r");
 				if (f) {
 					char buf[256] = "";
 					char md5passwd[33] = "";
@@ -138,7 +180,7 @@
 						fgets(buf, sizeof(buf), f);
 						if (!feof(f) && !ast_strlen_zero(buf)) {
 							buf[strlen(buf) - 1] = '\0';
-							if (strchr(opts, 'm')) {
+							if (ast_test_flag(&flags,OPT_MULTIPLE)) {
 								md5secret = strchr(buf, ':');
 								if (md5secret == NULL)
 									continue;
@@ -146,13 +188,13 @@
 								md5secret++;
 								ast_md5_hash(md5passwd, passwd);
 								if (!strcmp(md5passwd, md5secret)) {
-									if (strchr(opts, 'a'))
+									if (ast_test_flag(&flags,OPT_ACCOUNT))
 										ast_cdr_setaccount(chan, buf);
 									break;
 								}
 							} else {
 								if (!strcmp(passwd, buf)) {
-									if (strchr(opts, 'a'))
+									if (ast_test_flag(&flags,OPT_ACCOUNT))
 										ast_cdr_setaccount(chan, buf);
 									break;
 								}
@@ -161,7 +203,7 @@
 					}
 					fclose(f);
 					if (!ast_strlen_zero(buf)) {
-						if (strchr(opts, 'm')) {
+						if (ast_test_flag(&flags,OPT_MULTIPLE)) {
 							if (md5secret && !strcmp(md5passwd, md5secret))
 								break;
 						} else {
@@ -170,23 +212,23 @@
 						}
 					}
 				} else 
-					ast_log(LOG_WARNING, "Unable to open file '%s' for authentication: %s\n", password, strerror(errno));
+					ast_log(LOG_WARNING, "Unable to open file '%s' for authentication: %s\n", arglist.password, strerror(errno));
 			}
 		} else {
 			/* Compare against a fixed password */
-			if (!strcmp(passwd, password)) 
+			if (!strcmp(passwd, arglist.password)) 
 				break;
 		}
 		prompt="auth-incorrect";
 	}
 	if ((retries < 3) && !res) {
-		if (strchr(opts, 'a') && !strchr(opts, 'm')) 
+		if (ast_test_flag(&flags,OPT_ACCOUNT) && !ast_test_flag(&flags,OPT_MULTIPLE)) 
 			ast_cdr_setaccount(chan, passwd);
 		res = ast_streamfile(chan, "auth-thankyou", chan->language);
 		if (!res)
 			res = ast_waitstream(chan, "");
 	} else {
-		if (jump && ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
+		if (ast_test_flag(&flags,OPT_JUMP) && ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
 			res = 0;
 		} else {
 			if (!ast_streamfile(chan, "vm-goodbye", chan->language))

Modified: team/crichter/0.3.0/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_cdr.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_cdr.c (original)
+++ team/crichter/0.3.0/apps/app_cdr.c Wed Jan 11 06:11:51 2006
@@ -17,7 +17,10 @@
  */
 
 /*! \file
+ * 
  * \brief Applications connected with CDR engine
+ *
+ * Martin Pycko <martinp at digium.com>
  *
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_chanisavail.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_chanisavail.c (original)
+++ team/crichter/0.3.0/apps/app_chanisavail.c Wed Jan 11 06:11:51 2006
@@ -18,8 +18,12 @@
 */
 
 /*! \file
-* \brief Check if Channel is Available
-* 
+ * 
+ * \brief Check if Channel is Available
+ * 
+ * \author Mark Spencer <markster at digium.com>
+ * \author James Golovich <james at gnuinter.net>
+
  * \ingroup applications
  */
 

Modified: team/crichter/0.3.0/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_chanspy.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_chanspy.c (original)
+++ team/crichter/0.3.0/apps/app_chanspy.c Wed Jan 11 06:11:51 2006
@@ -2,6 +2,7 @@
  * Asterisk -- An open source telephony toolkit.
  *
  * Copyright (C) 2005 Anthony Minessale II (anthmct at yahoo.com)
+ * Copyright (C) 2005 - 2006, Digium, Inc.
  *
  * Disclaimed to Digium
  *
@@ -17,8 +18,11 @@
  */
 
 /*! \file
+ *
  * \brief ChanSpy: Listen in on any channel.
- * 
+ *
+ * \author Anthony Minessale II <anthmct at yahoo.com>
+ *
  * \ingroup applications
  */
 
@@ -208,9 +212,9 @@
 
 static void stop_spying(struct ast_channel *chan, struct ast_channel_spy *spy) 
 {
-	/* If our status has changed, then the channel we're spying on is gone....
+	/* If our status has changed to DONE, then the channel we're spying on is gone....
 	   DON'T TOUCH IT!!!  RUN AWAY!!! */
-	if (spy->status != CHANSPY_RUNNING)
+	if (spy->status == CHANSPY_DONE)
 		return;
 
 	if (!chan)

Modified: team/crichter/0.3.0/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_controlplayback.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_controlplayback.c (original)
+++ team/crichter/0.3.0/apps/app_controlplayback.c Wed Jan 11 06:11:51 2006
@@ -17,7 +17,10 @@
  */
 
 /*! \file
+ * 
  * \brief Trivial application to control playback of a sound file
+ *
+ * \author Mark Spencer <markster at digium.com>
  * 
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_curl.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_curl.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_curl.c (original)
+++ team/crichter/0.3.0/apps/app_curl.c Wed Jan 11 06:11:51 2006
@@ -18,7 +18,12 @@
  */
 
 /*! \file
+ * 
  * \brief Curl - App to load a URL
+ *
+ * \author Tilghman Lesher <curl-20050919 at the-tilghman.com>
+ *
+ * \note Brian Wilkins <bwilkins at cfl.rr.com> (Added POST option) 
  * 
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_db.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_db.c (original)
+++ team/crichter/0.3.0/apps/app_db.c Wed Jan 11 06:11:51 2006
@@ -21,6 +21,9 @@
 /*! \file
  *
  * \brief Database access functions
+ *
+ * \author Mark Spencer <markster at digium.com>
+ * \author Jefferson Noxon <jeff at debian.org>
  *
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_dial.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_dial.c (original)
+++ team/crichter/0.3.0/apps/app_dial.c Wed Jan 11 06:11:51 2006
@@ -19,6 +19,8 @@
 /*! \file
  *
  * \brief dial() & retrydial() - Trivial application to dial a channel and send an URL on answer
+ *
+ * \author Mark Spencer <markster at digium.com>
  * 
  * \ingroup applications
  */
@@ -162,7 +164,7 @@
 "    S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
 "           answered the call.\n"  	
 "    t    - Allow the called party to transfer the calling party by sending the\n"
-"           DTMF sequence defiend in features.conf.\n"
+"           DTMF sequence defined in features.conf.\n"
 "    T    - Allow the calling party to transfer the called party by sending the\n"
 "           DTMF sequence defined in features.conf.\n"
 "    w    - Allow the called party to enable recording of the call by sending\n"

Modified: team/crichter/0.3.0/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_dictate.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_dictate.c (original)
+++ team/crichter/0.3.0/apps/app_dictate.c Wed Jan 11 06:11:51 2006
@@ -21,6 +21,8 @@
 /*! \file
  *
  * \brief Virtual Dictation Machine Application For Asterisk
+ *
+ * \author Anthony Minessale II <anthmct at yahoo.com>
  *
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_directed_pickup.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_directed_pickup.c (original)
+++ team/crichter/0.3.0/apps/app_directed_pickup.c Wed Jan 11 06:11:51 2006
@@ -19,6 +19,8 @@
 /*! \file
  *
  * \brief Directed Call Pickup Support
+ *
+ * \author Joshua Colp <jcolp at asterlink.com>
  *
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_directory.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_directory.c (original)
+++ team/crichter/0.3.0/apps/app_directory.c Wed Jan 11 06:11:51 2006
@@ -19,6 +19,8 @@
 /*! \file
  *
  * \brief Provide a directory of extensions
+ *
+ * \author Mark Spencer <markster at digium.com>
  * 
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_disa.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_disa.c (original)
+++ team/crichter/0.3.0/apps/app_disa.c Wed Jan 11 06:11:51 2006
@@ -146,12 +146,12 @@
 	}
 	
 	if (ast_set_write_format(chan,AST_FORMAT_ULAW)) {
-		ast_log(LOG_WARNING, "Unable to set write format to Mu-law on %s\n",chan->name);
+		ast_log(LOG_WARNING, "Unable to set write format to Mu-law on %s\n", chan->name);
 		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
 	if (ast_set_read_format(chan,AST_FORMAT_ULAW)) {
-		ast_log(LOG_WARNING, "Unable to set read format to Mu-law on %s\n",chan->name);
+		ast_log(LOG_WARNING, "Unable to set read format to Mu-law on %s\n", chan->name);
 		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
@@ -198,8 +198,7 @@
 	for (;;) {
 		  /* if outa time, give em reorder */
 		if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) > 
-		    ((k&2) ? digittimeout : firstdigittimeout))
-		{
+		    ((k&2) ? digittimeout : firstdigittimeout)) {
 			ast_log(LOG_DEBUG,"DISA %s entry timeout on chan %s\n",
 				((k&1) ? "extension" : "password"),chan->name);
 			break;
@@ -210,14 +209,12 @@
 		}
 			
 		f = ast_read(chan);
-		if (f == NULL) 
-		{
+		if (f == NULL) {
 			LOCAL_USER_REMOVE(u);
 			return -1;
 		}
 		if ((f->frametype == AST_FRAME_CONTROL) &&
-		    (f->subclass == AST_CONTROL_HANGUP))
-		{
+		    (f->subclass == AST_CONTROL_HANGUP)) {
 			ast_frfree(f);
 			LOCAL_USER_REMOVE(u);
 			return -1;
@@ -226,56 +223,54 @@
 			ast_frfree(f);
 			continue;
 		}
-		  /* if not DTMF, just do it again */
-		if (f->frametype != AST_FRAME_DTMF) 
-		{
+
+		/* if not DTMF, just do it again */
+		if (f->frametype != AST_FRAME_DTMF) {
 			ast_frfree(f);
 			continue;
 		}
 
 		j = f->subclass;  /* save digit */
 		ast_frfree(f);
-		if (i == 0) 
-		{
+		if (i == 0) {
 			k|=2; /* We have the first digit */ 
 			ast_playtones_stop(chan);
 		}
 		lastdigittime = ast_tvnow();
 		  /* got a DTMF tone */
-		if (i < AST_MAX_EXTENSION) /* if still valid number of digits */
-		{
-			if (!(k&1)) /* if in password state */
-			{
-				if (j == '#') /* end of password */
-				{
+		if (i < AST_MAX_EXTENSION) { /* if still valid number of digits */
+			if (!(k&1)) { /* if in password state */
+				if (j == '#') { /* end of password */
 					  /* see if this is an integer */
-					if (sscanf(args.passcode,"%d",&j) < 1)
-					   { /* nope, it must be a filename */
+					if (sscanf(args.passcode,"%d",&j) < 1) { /* nope, it must be a filename */
 						fp = fopen(args.passcode,"r");
-						if (!fp)
-						   {
+						if (!fp) {
 							ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name);
 							LOCAL_USER_REMOVE(u);
 							return -1;
-						   }
+						}
 						pwline[0] = 0;
-						while(fgets(pwline,sizeof(pwline) - 1,fp))
-						   {
-							if (!pwline[0]) continue;
+						while(fgets(pwline,sizeof(pwline) - 1,fp)) {
+							if (!pwline[0])
+								continue;
 							if (pwline[strlen(pwline) - 1] == '\n') 
 								pwline[strlen(pwline) - 1] = 0;
-							if (!pwline[0]) continue;
-							  /* skip comments */
-							if (pwline[0] == '#') continue;
-							if (pwline[0] == ';') continue;
+							if (!pwline[0])
+								continue;
+							 /* skip comments */
+							if (pwline[0] == '#')
+								continue;
+							if (pwline[0] == ';')
+								continue;
 
 							AST_STANDARD_APP_ARGS(args, pwline);
 			
 							ast_log(LOG_DEBUG, "Mailbox: %s\n",args.mailbox);
 
-							  /* password must be in valid format (numeric) */
-							if (sscanf(args.passcode,"%d",&j) < 1) continue;
-							  /* if we got it */
+							/* password must be in valid format (numeric) */
+							if (sscanf(args.passcode,"%d", &j) < 1)
+								continue;
+							 /* if we got it */
 							if (!strcmp(exten,args.passcode)) {
 								if (ast_strlen_zero(args.context))
 									args.context = "disa";
@@ -283,12 +278,11 @@
 									args.mailbox = "";
 								break;
 							}
-						   }
+						}
 						fclose(fp);
-					   }
-					  /* compare the two */
-					if (strcmp(exten,args.passcode))
-					{
+					}
+					/* compare the two */
+					if (strcmp(exten,args.passcode)) {
 						ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",chan->name,exten);
 						goto reorder;
 
@@ -302,15 +296,16 @@
 					exten[sizeof(acctcode)] = 0;
 					ast_copy_string(acctcode, exten, sizeof(acctcode));
 					exten[0] = 0;
-					ast_log(LOG_DEBUG,"Successful DISA log-in on chan %s\n",chan->name);
+					ast_log(LOG_DEBUG,"Successful DISA log-in on chan %s\n", chan->name);
 					continue;
 				}
 			}
 
 			exten[i++] = j;  /* save digit */
 			exten[i] = 0;
-			if (!(k&1)) continue; /* if getting password, continue doing it */
-			  /* if this exists */
+			if (!(k&1))
+				continue; /* if getting password, continue doing it */
+			/* if this exists */
 
 			if (ast_ignore_pattern(args.context, exten)) {
 				play_dialtone(chan, "");
@@ -321,7 +316,7 @@
 					did_ignore = 0;
 				}
 
-			  /* if can do some more, do it */
+			/* if can do some more, do it */
 			if (!ast_matchmore_extension(chan,args.context,exten,1, chan->cid.cid_num)) {
 				break;
 			}
@@ -341,8 +336,7 @@
 		if (!recheck || ast_exists_extension(chan, args.context, exten, 1, chan->cid.cid_num)) {
 			ast_playtones_stop(chan);
 			/* We're authenticated and have a target extension */
-			if (!ast_strlen_zero(args.cid))
-			{
+			if (!ast_strlen_zero(args.cid)) {
 				ast_callerid_split(args.cid, ourcidname, sizeof(ourcidname), ourcidnum, sizeof(ourcidnum));
 				ast_set_callerid(chan, ourcidnum, ourcidname, ourcidnum);
 			}
@@ -364,8 +358,7 @@
 	ast_indicate(chan,AST_CONTROL_CONGESTION);
 	/* something is invalid, give em reorder for several seconds */
 	time(&rstart);
-	while(time(NULL) < rstart + 10)
-	{
+	while(time(NULL) < rstart + 10) {
 		if (ast_waitfor(chan, -1) < 0)
 			break;
 		f = ast_read(chan);

Modified: team/crichter/0.3.0/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_dumpchan.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_dumpchan.c (original)
+++ team/crichter/0.3.0/apps/app_dumpchan.c Wed Jan 11 06:11:51 2006
@@ -21,7 +21,9 @@
 /*! \file
  *
  * \brief Application to dump channel variables
- * 
+ *
+ * \author Anthony Minessale <anthmct at yahoo.com>
+ *
  * \ingroup applications
  */
 

Modified: team/crichter/0.3.0/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_echo.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_echo.c (original)
+++ team/crichter/0.3.0/apps/app_echo.c Wed Jan 11 06:11:51 2006
@@ -19,6 +19,8 @@
 /*! \file
  *
  * \brief Echo application -- play back what you hear to evaluate latency
+ *
+ * \author Mark Spencer <markster at digium.com>
  * 
  * \ingroup applications
  */

Modified: team/crichter/0.3.0/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/apps/app_externalivr.c?rev=7981&r1=7980&r2=7981&view=diff
==============================================================================
--- team/crichter/0.3.0/apps/app_externalivr.c (original)
+++ team/crichter/0.3.0/apps/app_externalivr.c Wed Jan 11 06:11:51 2006
@@ -22,7 +22,12 @@
 /*! \file
  *
  * \brief External IVR application interface
- * 
+ *
+ * \author Kevin P. Fleming <kpfleming at digium.com>
+ *
+ * \note Portions taken from the file-based music-on-hold work
+ * created by Anthony Minessale II in res_musiconhold.c
+ *
  * \ingroup applications
  */
 

Modified: team/crichter/0.3.0/apps/app_festival.c

[... 12332 lines stripped ...]


More information about the svn-commits mailing list