[asterisk-commits] branch russell/autoconf_and_menuselect - r8035 in
/team/russell/autoconf_and_...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jan 12 14:20:33 CST 2006
Author: russell
Date: Thu Jan 12 14:20:05 2006
New Revision: 8035
URL: http://svn.digium.com/view/asterisk?rev=8035&view=rev
Log:
Merged revisions 7929,7936,7940,7945-7948,7952-7954,7956,7958,7961-7962,7964,7966-7969,7971,7973-7975,7977-7978,7985,7987-7989,7991,7995-7996,7998,8000-8001,8007-8017 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r7929 | tilghman | 2006-01-09 22:23:38 -0500 (Mon, 09 Jan 2006) | 2 lines
Fix indentation
................
r7936 | oej | 2006-01-10 03:33:52 -0500 (Tue, 10 Jan 2006) | 2 lines
Declare missing randomlock
................
r7940 | oej | 2006-01-10 03:52:55 -0500 (Tue, 10 Jan 2006) | 4 lines
Importing rev 7939 from 1.2
- Add reference to README.tds
- Reformat table
................
r7945 | mogorman | 2006-01-10 11:08:28 -0500 (Tue, 10 Jan 2006) | 3 lines
6186 amd 6187 with minor revisions. added arg
parsing from macro.
................
r7946 | mattf | 2006-01-10 16:13:18 -0500 (Tue, 10 Jan 2006) | 2 lines
Make sure to update the config file for chan_zap to include japanese caller id
................
r7947 | mattf | 2006-01-10 16:34:04 -0500 (Tue, 10 Jan 2006) | 2 lines
Update chan_phone to indicate FLASH properley (#4935)
................
r7948 | mattf | 2006-01-10 16:35:45 -0500 (Tue, 10 Jan 2006) | 2 lines
Allow a digitstream to contain a flash character ('f' or 'F') when sending dtmf string to a channel. (#4935)
................
r7952 | russell | 2006-01-10 18:51:42 -0500 (Tue, 10 Jan 2006) | 8 lines
Add wrappers for commonly used memory allocation functions. These wrappers
add an automatically generated Asterisk log message if the allocation fails
for some reason. Otherwise, they are functionally the same, with the
exception of ast_strdup and ast_strndup. These functions have the added
ability to accept a NULL argument without error, which will just be ignored
without generating an error. The coding guidelines have also been updated to
reflect all of this information. (issue #4996)
................
r7953 | russell | 2006-01-10 19:06:15 -0500 (Tue, 10 Jan 2006) | 2 lines
fix typo, thanks Qwell!
................
r7954 | russell | 2006-01-10 20:20:29 -0500 (Tue, 10 Jan 2006) | 3 lines
convert some channels to use the memory allocation wrappers.
(This is being added to the janitor projects list.)
................
r7956 | tilghman | 2006-01-10 20:31:28 -0500 (Tue, 10 Jan 2006) | 3 lines
Merged revisions 7955 via svnmerge from
/branches/1.2
................
r7958 | russell | 2006-01-10 22:13:45 -0500 (Tue, 10 Jan 2006) | 10 lines
Merged revisions 7957 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r7957 | russell | 2006-01-10 22:12:44 -0500 (Tue, 10 Jan 2006) | 2 lines
fix a little typo
........
................
r7961 | russell | 2006-01-10 23:19:48 -0500 (Tue, 10 Jan 2006) | 2 lines
block 7960
................
r7962 | russell | 2006-01-10 23:31:59 -0500 (Tue, 10 Jan 2006) | 3 lines
fix locking bug - lock instead of unlock (see commit to r7960 to branches/1.2)
store hint list using linked list macros
................
r7964 | russell | 2006-01-10 23:39:53 -0500 (Tue, 10 Jan 2006) | 2 lines
remove stray header
................
r7966 | russell | 2006-01-10 23:54:13 -0500 (Tue, 10 Jan 2006) | 2 lines
block 7965
................
r7967 | russell | 2006-01-11 00:00:45 -0500 (Wed, 11 Jan 2006) | 3 lines
lock list of translators *before* recalculating translation matrix.
Also, store translators using linked list macros.
................
r7968 | russell | 2006-01-11 00:05:13 -0500 (Wed, 11 Jan 2006) | 3 lines
- add AST_LIST_HEAD_NOLOCK_STATIC, similar to AST_LIST_HEAD_STATIC, but without the lock!
- store registered channel backends using linked list macros
................
r7969 | russell | 2006-01-11 00:23:19 -0500 (Wed, 11 Jan 2006) | 3 lines
add doxygen documentation and fix various issues with ast_dtmf_stream
(discussed in issue #6087)
................
r7971 | russell | 2006-01-11 00:26:51 -0500 (Wed, 11 Jan 2006) | 2 lines
block 7970
................
r7973 | russell | 2006-01-11 00:47:21 -0500 (Wed, 11 Jan 2006) | 10 lines
Merged revisions 7972 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r7972 | russell | 2006-01-11 00:46:39 -0500 (Wed, 11 Jan 2006) | 2 lines
fix mem leak on module unload (issue #6190)
........
................
r7974 | russell | 2006-01-11 01:35:34 -0500 (Wed, 11 Jan 2006) | 2 lines
oops. :)
................
r7975 | mogorman | 2006-01-11 01:56:28 -0500 (Wed, 11 Jan 2006) | 5 lines
added feature from 5750 with whitespace fixing.
allows for meetme show list to tell how long user
has been in confrence and reports it to manager
when user leaves confrence.
................
r7977 | russell | 2006-01-11 02:19:52 -0500 (Wed, 11 Jan 2006) | 2 lines
block 7976
................
r7978 | russell | 2006-01-11 02:21:16 -0500 (Wed, 11 Jan 2006) | 2 lines
fix temp greetings with odbc storage (issue #6078)
................
r7985 | russell | 2006-01-11 13:40:42 -0500 (Wed, 11 Jan 2006) | 3 lines
replace malloc+memset with a call to ast_calloc, also removing the error
message that is no longer necessary (issue #6205)
................
r7987 | russell | 2006-01-11 14:13:33 -0500 (Wed, 11 Jan 2006) | 10 lines
Merged revisions 7986 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r7986 | russell | 2006-01-11 14:08:53 -0500 (Wed, 11 Jan 2006) | 2 lines
move variable to correct scope (issue #6197)
........
................
r7988 | russell | 2006-01-11 14:23:16 -0500 (Wed, 11 Jan 2006) | 2 lines
fix incorrect return value (issue #6202)
................
r7989 | mogorman | 2006-01-11 14:52:29 -0500 (Wed, 11 Jan 2006) | 3 lines
Added macros from 6198 and 6203. also added better
error reporting in func_cut
................
r7991 | russell | 2006-01-11 17:41:34 -0500 (Wed, 11 Jan 2006) | 2 lines
conversions to memory allocation wrappers (issue #6210)
................
r7995 | mogorman | 2006-01-11 21:20:19 -0500 (Wed, 11 Jan 2006) | 3 lines
Added automatic folder feature described in 6090
with bounds checking.
................
r7996 | russell | 2006-01-11 21:35:45 -0500 (Wed, 11 Jan 2006) | 2 lines
typo
................
r7998 | tilghman | 2006-01-12 00:47:30 -0500 (Thu, 12 Jan 2006) | 2 lines
Bug 6213 - Morse code app
................
r8000 | tilghman | 2006-01-12 01:15:56 -0500 (Thu, 12 Jan 2006) | 3 lines
Merged revisions 7999 via svnmerge from
/branches/1.2
................
r8001 | mogorman | 2006-01-12 01:43:24 -0500 (Thu, 12 Jan 2006) | 3 lines
added page macro examples from 6077 with minor typo
fixes.
................
r8007 | bweschke | 2006-01-12 10:11:49 -0500 (Thu, 12 Jan 2006) | 3 lines
Use argument macro in app_dictate #6222
................
r8008 | bweschke | 2006-01-12 10:28:01 -0500 (Thu, 12 Jan 2006) | 3 lines
Use argument macro in app_voicemail #6221
................
r8009 | bweschke | 2006-01-12 10:51:13 -0500 (Thu, 12 Jan 2006) | 3 lines
New memory wrapper changes.
................
r8010 | mogorman | 2006-01-12 11:00:04 -0500 (Thu, 12 Jan 2006) | 3 lines
removed unused variable and config parsing for it
as to bug 6219
................
r8011 | bweschke | 2006-01-12 11:00:13 -0500 (Thu, 12 Jan 2006) | 3 lines
More new memory wrapper work and initializing some memory allocations to zero where they weren't before.
................
r8012 | bweschke | 2006-01-12 11:08:06 -0500 (Thu, 12 Jan 2006) | 3 lines
More new memory wrapper work.
................
r8013 | mogorman | 2006-01-12 11:15:01 -0500 (Thu, 12 Jan 2006) | 3 lines
As we no longer have chan_modem this file is not used
either thanks rizzo in refrence to 6217
................
r8014 | mattf | 2006-01-12 12:12:12 -0500 (Thu, 12 Jan 2006) | 2 lines
Changes to add udptl to asterisk (preliminary merging of the t.38 patch)
................
r8015 | mattf | 2006-01-12 12:14:58 -0500 (Thu, 12 Jan 2006) | 2 lines
More changes to make t.38 support work
................
r8016 | markster | 2006-01-12 12:27:38 -0500 (Thu, 12 Jan 2006) | 2 lines
Merge rizzo's range optimizations (bug #6101)
................
r8017 | markster | 2006-01-12 12:34:10 -0500 (Thu, 12 Jan 2006) | 2 lines
Remove unnecessary (but unexecutable) unlocks, cleanup code (bug #6220)
................
Added:
team/russell/autoconf_and_menuselect/apps/app_morsecode.c
- copied unchanged from r8017, trunk/apps/app_morsecode.c
team/russell/autoconf_and_menuselect/formats/format_h264.c
team/russell/autoconf_and_menuselect/include/asterisk/udptl.h
- copied unchanged from r8017, trunk/include/asterisk/udptl.h
team/russell/autoconf_and_menuselect/udptl.c
- copied unchanged from r8017, trunk/udptl.c
Removed:
team/russell/autoconf_and_menuselect/include/asterisk/vmodem.h
Modified:
team/russell/autoconf_and_menuselect/ (props changed)
team/russell/autoconf_and_menuselect/Makefile
team/russell/autoconf_and_menuselect/app.c
team/russell/autoconf_and_menuselect/apps/Makefile
team/russell/autoconf_and_menuselect/apps/app_adsiprog.c
team/russell/autoconf_and_menuselect/apps/app_alarmreceiver.c
team/russell/autoconf_and_menuselect/apps/app_curl.c
team/russell/autoconf_and_menuselect/apps/app_dial.c
team/russell/autoconf_and_menuselect/apps/app_dictate.c
team/russell/autoconf_and_menuselect/apps/app_directory.c
team/russell/autoconf_and_menuselect/apps/app_externalivr.c
team/russell/autoconf_and_menuselect/apps/app_meetme.c
team/russell/autoconf_and_menuselect/apps/app_milliwatt.c
team/russell/autoconf_and_menuselect/apps/app_page.c
team/russell/autoconf_and_menuselect/apps/app_queue.c
team/russell/autoconf_and_menuselect/apps/app_rpt.c
team/russell/autoconf_and_menuselect/apps/app_voicemail.c
team/russell/autoconf_and_menuselect/asterisk.c
team/russell/autoconf_and_menuselect/channel.c
team/russell/autoconf_and_menuselect/channels/chan_agent.c
team/russell/autoconf_and_menuselect/channels/chan_alsa.c
team/russell/autoconf_and_menuselect/channels/chan_iax2.c
team/russell/autoconf_and_menuselect/channels/chan_local.c
team/russell/autoconf_and_menuselect/channels/chan_oss.c
team/russell/autoconf_and_menuselect/channels/chan_phone.c
team/russell/autoconf_and_menuselect/channels/chan_sip.c
team/russell/autoconf_and_menuselect/channels/chan_zap.c
team/russell/autoconf_and_menuselect/configs/extensions.conf.sample
team/russell/autoconf_and_menuselect/configs/voicemail.conf.sample
team/russell/autoconf_and_menuselect/configs/zapata.conf.sample
team/russell/autoconf_and_menuselect/doc/CODING-GUIDELINES
team/russell/autoconf_and_menuselect/doc/README.cdr
team/russell/autoconf_and_menuselect/funcs/Makefile
team/russell/autoconf_and_menuselect/funcs/func_cdr.c
team/russell/autoconf_and_menuselect/funcs/func_cut.c
team/russell/autoconf_and_menuselect/funcs/func_math.c
team/russell/autoconf_and_menuselect/funcs/func_md5.c
team/russell/autoconf_and_menuselect/include/asterisk/app.h
team/russell/autoconf_and_menuselect/include/asterisk/channel.h
team/russell/autoconf_and_menuselect/include/asterisk/frame.h
team/russell/autoconf_and_menuselect/include/asterisk/linkedlists.h
team/russell/autoconf_and_menuselect/include/asterisk/translate.h
team/russell/autoconf_and_menuselect/include/asterisk/utils.h
team/russell/autoconf_and_menuselect/pbx.c
team/russell/autoconf_and_menuselect/translate.c
team/russell/autoconf_and_menuselect/utils.c
Propchange: team/russell/autoconf_and_menuselect/
------------------------------------------------------------------------------
--- svnmerge-blocked (original)
+++ svnmerge-blocked Thu Jan 12 14:20:05 2006
@@ -1,1 +1,1 @@
-/branches/1.2:7497,7915
+/branches/1.2:7497,7915,7960,7965,7970,7976
Propchange: team/russell/autoconf_and_menuselect/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 12 14:20:05 2006
@@ -1,1 +1,1 @@
-/trunk:1-7921
+/trunk:1-8018
Modified: team/russell/autoconf_and_menuselect/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/Makefile?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/Makefile (original)
+++ team/russell/autoconf_and_menuselect/Makefile Thu Jan 12 14:20:05 2006
@@ -358,7 +358,7 @@
OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
translate.o file.o say.o pbx.o cli.o md5.o term.o \
ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
- cdr.o tdd.o acl.o rtp.o manager.o asterisk.o \
+ cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
@@ -428,6 +428,8 @@
LIBS+=-lssl
INSTALL=install
+
+CFLAGS+=-DT38_SUPPORT
_all: all
@echo " +--------- Asterisk Build Complete ---------+"
Modified: team/russell/autoconf_and_menuselect/app.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/app.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/app.c (original)
+++ team/russell/autoconf_and_menuselect/app.c Thu Jan 12 14:20:05 2006
@@ -279,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;
}
Modified: team/russell/autoconf_and_menuselect/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/Makefile?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/Makefile (original)
+++ team/russell/autoconf_and_menuselect/apps/Makefile Thu Jan 12 14:20:05 2006
@@ -29,7 +29,8 @@
app_setcdruserfield.so app_settransfercapability.so app_softhangup.so \
app_stack.so app_system.so app_talkdetect.so app_test.so app_transfer.so \
app_userevent.so app_url.so app_verbose.so app_voicemail.so \
- app_waitforring.so app_waitforsilence.so app_while.so app_zapateller.so
+ app_waitforring.so app_waitforsilence.so app_while.so app_zapateller.so \
+ app_morsecode.so
#
# Obsolete things...
Modified: team/russell/autoconf_and_menuselect/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_adsiprog.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_adsiprog.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_adsiprog.c Thu Jan 12 14:20:05 2006
@@ -1359,13 +1359,10 @@
ast_log(LOG_WARNING, "Can't open file '%s'\n", fn);
return NULL;
}
- scr = malloc(sizeof(struct adsi_script));
- if (!scr) {
+ if (!(scr = ast_calloc(1, sizeof(*scr)))) {
fclose(f);
- ast_log(LOG_WARNING, "Out of memory loading script '%s'\n", fn);
return NULL;
}
- memset(scr, 0, sizeof(struct adsi_script));
/* Create "main" as first subroutine */
getsubbyname(scr, "main", NULL, 0);
while(!feof(f)) {
Modified: team/russell/autoconf_and_menuselect/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_alarmreceiver.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_alarmreceiver.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_alarmreceiver.c Thu Jan 12 14:20:05 2006
@@ -56,6 +56,7 @@
#include "asterisk/localtime.h"
#include "asterisk/callerid.h"
#include "asterisk/astdb.h"
+#include "asterisk/utils.h"
#define ALMRCV_CONFIG "alarmreceiver.conf"
#define ADEMCO_CONTACT_ID "ADEMCO_CONTACT_ID"
@@ -579,17 +580,11 @@
events_received++;
- /* Queue the Event */
-
- if((enew = malloc(sizeof(event_node_t))) == NULL){
- if(option_verbose >= 1)
- ast_verbose(VERBOSE_PREFIX_1 "AlarmReceiver: Failed to allocate memory\n");
- ast_log(LOG_WARNING, "AlarmReceiver Failed to allocate memory\n");
+ /* Queue the Event */
+ if (!(enew = ast_calloc(1, sizeof(*enew)))) {
res = -1;
- break;
- }
-
- memset(enew, 0, sizeof(event_node_t));
+ break;
+ }
enew->next = NULL;
ast_copy_string(enew->data, event, sizeof(enew->data));
Modified: team/russell/autoconf_and_menuselect/apps/app_curl.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_curl.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_curl.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_curl.c Thu Jan 12 14:20:05 2006
@@ -46,6 +46,7 @@
#include "asterisk/options.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
+#include "asterisk/utils.h"
static char *tdesc = "Load external URL";
@@ -63,9 +64,9 @@
/* There might be a realloc() out there that doesn't like reallocing
NULL pointers, so we take care of it here */
if (ptr)
- return realloc(ptr, size);
+ return ast_realloc(ptr, size);
else
- return malloc(size);
+ return ast_malloc(size);
}
static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
Modified: team/russell/autoconf_and_menuselect/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_dial.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_dial.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_dial.c Thu Jan 12 14:20:05 2006
@@ -164,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"
@@ -984,13 +984,10 @@
goto out;
}
*number = '\0';
- number++;
- tmp = malloc(sizeof(struct localuser));
- if (!tmp) {
- ast_log(LOG_WARNING, "Out of memory\n");
+ number++;
+ if (!(tmp = ast_calloc(1, sizeof(*tmp)))) {
goto out;
}
- memset(tmp, 0, sizeof(struct localuser));
if (opts.flags) {
ast_copy_flags(tmp, &opts,
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
Modified: team/russell/autoconf_and_menuselect/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_dictate.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_dictate.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_dictate.c Thu Jan 12 14:20:05 2006
@@ -82,7 +82,12 @@
static int dictate_exec(struct ast_channel *chan, void *data)
{
- char *mydata, *argv[3], *path = NULL, filein[256], *filename = "";
+ char *path = NULL, filein[256], *filename = "";
+ char *parse;
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(base);
+ AST_APP_ARG(filename);
+ );
char dftbase[256];
char *base;
struct ast_flags flags = {0};
@@ -91,7 +96,6 @@
struct localuser *u;
int ffactor = 320 * 80,
res = 0,
- argc = 0,
done = 0,
oldr = 0,
lastop = 0,
@@ -105,17 +109,23 @@
LOCAL_USER_ADD(u);
snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
- if (!ast_strlen_zero(data) && (mydata = ast_strdupa(data))) {
- argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]));
- }
+ if (!ast_strlen_zero(data)) {
+ parse = ast_strdupa(data);
+ if (!parse) {
+ ast_log(LOG_ERROR, "Out of memory!\n");
+ return -1;
+ }
+ AST_STANDARD_APP_ARGS(args, parse);
+ } else
+ args.argc = 0;
- if (argc) {
- base = argv[0];
+ if (args.argc && !ast_strlen_zero(args.base)) {
+ base = args.base;
} else {
base = dftbase;
}
- if (argc && argv[1]) {
- filename = argv[1];
+ if (args.argc > 1 && args.filename) {
+ filename = args.filename;
}
oldr = chan->readformat;
if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) {
Modified: team/russell/autoconf_and_menuselect/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_directory.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_directory.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_directory.c Thu Jan 12 14:20:05 2006
@@ -84,7 +84,7 @@
{
char *tmp;
int lcount = 0;
- tmp = malloc(NUMDIGITS + 1);
+ tmp = ast_malloc(NUMDIGITS + 1);
if (tmp) {
while((*lastname > 32) && lcount < NUMDIGITS) {
switch(toupper(*lastname)) {
Modified: team/russell/autoconf_and_menuselect/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_externalivr.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_externalivr.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_externalivr.c Thu Jan 12 14:20:05 2006
@@ -49,6 +49,7 @@
#include "asterisk/module.h"
#include "asterisk/linkedlists.h"
#include "asterisk/app.h"
+#include "asterisk/utils.h"
static const char *tdesc = "External IVR Interface Application";
@@ -112,10 +113,8 @@
{
struct localuser *u = params;
struct gen_state *state;
-
- state = calloc(1, sizeof(*state));
-
- if (!state)
+
+ if (!(state = ast_calloc(1, sizeof(*state))))
return NULL;
state->u = u;
@@ -234,10 +233,8 @@
static struct playlist_entry *make_entry(const char *filename)
{
struct playlist_entry *entry;
-
- entry = calloc(1, sizeof(*entry) + strlen(filename) + 10);
-
- if (!entry)
+
+ if (!(entry = ast_calloc(1, sizeof(*entry) + strlen(filename) + 10)))
return NULL;
strcpy(entry->filename, filename);
Modified: team/russell/autoconf_and_menuselect/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_meetme.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_meetme.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_meetme.c Thu Jan 12 14:20:05 2006
@@ -662,8 +662,14 @@
}
}
/* Show all the users */
- for (user = cnf->firstuser; user; user = user->nextuser)
- ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s\n",
+ for (user = cnf->firstuser; user; user = user->nextuser){
+ now = time(NULL);
+ hr = (now - user->jointime) / 3600;
+ min = ((now - user->jointime) % 3600) / 60;
+ sec = (now - user->jointime) % 60;
+
+
+ ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %02d:%02d:%02d\n",
user->user_no,
user->chan->cid.cid_num ? user->chan->cid.cid_num : "<unknown>",
user->chan->cid.cid_name ? user->chan->cid.cid_name : "<no name>",
@@ -671,7 +677,8 @@
user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
user->adminflags & ADMINFLAG_MUTED ? "(Admn Muted)" : "",
- istalking(user->talking));
+ istalking(user->talking), hr, min, sec);
+ }
ast_cli(fd,"%d users in that conference.\n",cnf->users);
return RESULT_SUCCESS;
@@ -867,6 +874,8 @@
int menu_active = 0;
int using_pseudo = 0;
int duration=20;
+ int hr, min, sec;
+ time_t now;
struct ast_dsp *dsp=NULL;
struct ast_app *app;
const char *agifile;
@@ -1661,12 +1670,26 @@
ast_dsp_free(dsp);
if (user->user_no) { /* Only cleanup users who really joined! */
- manager_event(EVENT_FLAG_CALL, "MeetmeLeave",
- "Channel: %s\r\n"
- "Uniqueid: %s\r\n"
- "Meetme: %s\r\n"
- "Usernum: %d\r\n",
- chan->name, chan->uniqueid, conf->confno, user->user_no);
+ now = time(NULL);
+ hr = (now - user->jointime) / 3600;
+ min = ((now - user->jointime) % 3600) / 60;
+ sec = (now - user->jointime) % 60;
+
+ manager_event(EVENT_FLAG_CALL, "MeetmeLeave",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %d\r\n"
+ "CIDnum: %s\r\n"
+ "CIDname: %s\r\n"
+ "Duration: %02d:%02d:%02d\r\n",
+ chan->name, chan->uniqueid, conf->confno,
+ user->user_no,
+ user->chan->cid.cid_num ? user->chan->cid.cid_num :
+ "<unknown>",
+ user->chan->cid.cid_name ? user->chan->cid.cid_name :
+ "<no name>", hr, min, sec);
+
conf->users--;
if (confflags & CONFFLAG_MARKEDUSER)
conf->markedusers--;
Modified: team/russell/autoconf_and_menuselect/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_milliwatt.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_milliwatt.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_milliwatt.c Thu Jan 12 14:20:05 2006
@@ -60,7 +60,7 @@
static void *milliwatt_alloc(struct ast_channel *chan, void *params)
{
int *indexp;
- indexp = malloc(sizeof(int));
+ indexp = ast_malloc(sizeof(*indexp));
if (indexp == NULL) return(NULL);
*indexp = 0;
return(indexp);
Modified: team/russell/autoconf_and_menuselect/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_page.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_page.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_page.c Thu Jan 12 14:20:05 2006
@@ -100,9 +100,8 @@
struct ast_var_t *varptr;
pthread_t t;
pthread_attr_t attr;
- cd = malloc(sizeof(struct calloutdata));
+ cd = ast_calloc(1, sizeof(*cd));
if (cd) {
- memset(cd, 0, sizeof(struct calloutdata));
ast_copy_string(cd->cidnum, chan->cid.cid_num ? chan->cid.cid_num : "", sizeof(cd->cidnum));
ast_copy_string(cd->cidname, chan->cid.cid_name ? chan->cid.cid_name : "", sizeof(cd->cidname));
ast_copy_string(cd->tech, tech, sizeof(cd->tech));
Modified: team/russell/autoconf_and_menuselect/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_queue.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_queue.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_queue.c Thu Jan 12 14:20:05 2006
@@ -515,7 +515,7 @@
pthread_t t;
pthread_attr_t attr;
- sc = malloc(sizeof(struct statechange) + strlen(dev) + 1);
+ sc = ast_calloc(1, sizeof(*sc) + strlen(dev) + 1);
if (sc) {
sc->state = state;
strcpy(sc->dev, dev);
@@ -535,10 +535,9 @@
/* Add a new member */
- cur = malloc(sizeof(struct member));
+ cur = ast_calloc(1, sizeof(*cur));
if (cur) {
- memset(cur, 0, sizeof(struct member));
cur->penalty = penalty;
cur->paused = paused;
ast_copy_string(cur->interface, interface, sizeof(cur->interface));
@@ -554,9 +553,8 @@
{
struct ast_call_queue *q;
- q = malloc(sizeof(*q));
+ q = ast_calloc(1, sizeof(*q));
if (q) {
- memset(q, 0, sizeof(*q));
ast_mutex_init(&q->lock);
ast_copy_string(q->name, queuename, sizeof(q->name));
}
@@ -1707,7 +1705,7 @@
if (in->cid.cid_ani) {
if (o->chan->cid.cid_ani)
free(o->chan->cid.cid_ani);
- o->chan->cid.cid_ani = malloc(strlen(in->cid.cid_ani) + 1);
+ o->chan->cid.cid_ani = ast_calloc(1, strlen(in->cid.cid_ani) + 1);
if (o->chan->cid.cid_ani)
strncpy(o->chan->cid.cid_ani, in->cid.cid_ani, strlen(in->cid.cid_ani) + 1);
else
@@ -2063,7 +2061,7 @@
announce = announceoverride;
while(cur) {
- tmp = malloc(sizeof(*tmp));
+ tmp = ast_calloc(1, sizeof(*tmp));
if (!tmp) {
ast_mutex_unlock(&qe->parent->lock);
if (use_weight)
@@ -2071,7 +2069,6 @@
ast_log(LOG_WARNING, "Out of memory\n");
goto out;
}
- memset(tmp, 0, sizeof(*tmp));
tmp->stillgoing = -1;
if (option_debug) {
if (url)
@@ -3685,7 +3682,7 @@
}
case 7:
if (state < 100) { /* 0-99 */
- char *num = malloc(3);
+ char *num = ast_malloc(3);
if (num) {
sprintf(num, "%d", state);
}
Modified: team/russell/autoconf_and_menuselect/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_rpt.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_rpt.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_rpt.c Thu Jan 12 14:20:05 2006
@@ -1313,7 +1313,7 @@
l = l->next;
continue;
}
- m = malloc(sizeof(struct rpt_link));
+ m = ast_malloc(sizeof(*m));
if (!m)
{
ast_log(LOG_WARNING, "Cannot alloc memory on %s\n", mychannel->name);
@@ -1564,7 +1564,7 @@
struct rpt_link *mylink = (struct rpt_link *) data;
pthread_attr_t attr;
- tele = malloc(sizeof(struct rpt_tele));
+ tele = ast_malloc(sizeof(*tele));
if (!tele)
{
ast_log(LOG_WARNING, "Unable to allocate memory\n");
@@ -1952,13 +1952,12 @@
ast_mutex_unlock(&myrpt->lock);
strncpy(myrpt->lastlinknode,digitbuf,MAXNODESTR - 1);
/* establish call in monitor mode */
- l = malloc(sizeof(struct rpt_link));
+ l = ast_calloc(1, sizeof(*l));
if (!l){
ast_log(LOG_WARNING, "Unable to malloc\n");
return DC_ERROR;
}
/* zero the silly thing */
- memset((char *)l,0,sizeof(struct rpt_link));
snprintf(deststr, sizeof(deststr), "IAX2/%s", s1);
tele = strchr(deststr,'/');
if (!tele){
@@ -2066,13 +2065,11 @@
ast_mutex_unlock(&myrpt->lock);
strncpy(myrpt->lastlinknode,digitbuf,MAXNODESTR - 1);
/* establish call in tranceive mode */
- l = malloc(sizeof(struct rpt_link));
+ l = ast_calloc(1, sizeof(*l));
if (!l){
ast_log(LOG_WARNING, "Unable to malloc\n");
return(DC_ERROR);
}
- /* zero the silly thing */
- memset((char *)l,0,sizeof(struct rpt_link));
l->mode = 1;
l->outbound = 1;
strncpy(l->name, digitbuf, MAXNODESTR - 1);
@@ -6017,7 +6014,7 @@
}
l=strlen(options)+2;
- orig_s=malloc(l);
+ orig_s=ast_malloc(l);
if(!orig_s) {
ast_log(LOG_WARNING, "Out of memory\n");
return -1;
@@ -6229,14 +6226,12 @@
} else
ast_mutex_unlock(&myrpt->lock);
/* establish call in tranceive mode */
- l = malloc(sizeof(struct rpt_link));
+ l = ast_calloc(1, sizeof(*l));
if (!l)
{
ast_log(LOG_WARNING, "Unable to malloc\n");
pthread_exit(NULL);
}
- /* zero the silly thing */
- memset((char *)l,0,sizeof(struct rpt_link));
l->mode = 1;
strncpy(l->name,b1,MAXNODESTR - 1);
l->isremote = 0;
Modified: team/russell/autoconf_and_menuselect/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/autoconf_and_menuselect/apps/app_voicemail.c?rev=8035&r1=8034&r2=8035&view=diff
==============================================================================
--- team/russell/autoconf_and_menuselect/apps/app_voicemail.c (original)
+++ team/russell/autoconf_and_menuselect/apps/app_voicemail.c Thu Jan 12 14:20:05 2006
@@ -123,11 +123,13 @@
OPT_RECORDGAIN = (1 << 3),
OPT_PREPEND_MAILBOX = (1 << 4),
OPT_PRIORITY_JUMP = (1 << 5),
+ OPT_AUTOPLAY = (1 << 6),
} vm_option_flags;
enum {
OPT_ARG_RECORDGAIN = 0,
OPT_ARG_ARRAY_SIZE = 1,
+ OPT_ARG_PLAYFOLDER = 2,
} vm_option_args;
AST_APP_OPTIONS(vm_app_options, {
@@ -137,6 +139,7 @@
AST_APP_OPTION_ARG('g', OPT_RECORDGAIN, OPT_ARG_RECORDGAIN),
AST_APP_OPTION('p', OPT_PREPEND_MAILBOX),
AST_APP_OPTION('j', OPT_PRIORITY_JUMP),
+ AST_APP_OPTION_ARG('a', OPT_AUTOPLAY, OPT_ARG_PLAYFOLDER),
});
static int load_config(void);
@@ -335,7 +338,8 @@
" is entered by the caller.\n"
" g(#) - Use the specified amount of gain when recording a voicemail\n"
" message. The units are whole-number decibels (dB).\n"
-" s - Skip checking the passcode for the mailbox.\n";
+" s - Skip checking the passcode for the mailbox.\n"
+" a(#) - Skip folder prompt and go directly to folder specified, default 1\n";
static char *synopsis_vm_box_exists =
"Check to see if Voicemail mailbox exists";
@@ -447,7 +451,7 @@
ast_copy_string(vmu->language, value, sizeof(vmu->language));
} else if (!strcasecmp(var, "tz")) {
ast_copy_string(vmu->zonetag, value, sizeof(vmu->zonetag));
- } else if (!strcasecmp(var, "delete")) {
+ } else if (!strcasecmp(var, "delete") || !strcasecmp(var, "deletevoicemail")) {
ast_set2_flag(vmu, ast_true(value), VM_DELETE);
} else if (!strcasecmp(var, "saycid")){
ast_set2_flag(vmu, ast_true(value), VM_SAYCID);
@@ -529,12 +533,13 @@
if (ivm)
retval=ivm;
else
- retval=malloc(sizeof(struct ast_vm_user));
+ retval=ast_calloc(1, sizeof(*retval));
if (retval) {
- memset(retval, 0, sizeof(struct ast_vm_user));
if (!ivm)
ast_set_flag(retval, VM_ALLOCED);
+ else
+ memset(retval, 0, sizeof(*retval));
if (mailbox)
ast_copy_string(retval->mailbox, mailbox, sizeof(retval->mailbox));
populate_defaults(retval);
@@ -593,9 +598,9 @@
vmu = ivm;
else
/* Make a copy, so that on a reload, we have no race */
- vmu = malloc(sizeof(struct ast_vm_user));
+ vmu = ast_malloc(sizeof(*vmu));
if (vmu) {
- memcpy(vmu, cur, sizeof(struct ast_vm_user));
+ memcpy(vmu, cur, sizeof(*vmu));
ast_set2_flag(vmu, !ivm, VM_ALLOCED);
vmu->next = NULL;
}
@@ -2589,8 +2594,8 @@
}
}
if (ast_fileexists(fn, NULL, NULL)) {
+ STORE(dir, vmu->mailbox, vmu->context, msgnum);
notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
- STORE(dir, vmu->mailbox, vmu->context, msgnum);
DISPOSE(dir, msgnum);
}
pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
@@ -3414,7 +3419,7 @@
/* start optimistic */
valid_extensions = 1;
while (s) {
- /* find_user is going to malloc since we have a NULL as first argument */
+ /* find_user is going to ast_malloc since we have a NULL as first argument */
if ((receiver = find_user(NULL, context, s))) {
if (!extensions)
vmtmp = extensions = receiver;
@@ -4742,6 +4747,7 @@
while (cmd >= 0 && cmd != 't') {
if (cmd)
retries = 0;
+ RETRIEVE(prefile, -1);
if (ast_fileexists(prefile, NULL, NULL) <= 0) {
play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
cmd = 't';
@@ -4751,7 +4757,7 @@
cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain);
break;
case '2':
- ast_filedelete(prefile, NULL);
+ DELETE(prefile, -1, prefile);
ast_play_and_wait(chan, "vm-tempremoved");
cmd = 't';
break;
@@ -4770,6 +4776,7 @@
cmd = 't';
}
}
+ DISPOSE(prefile, -1);
}
if (cmd == 't')
cmd = 0;
@@ -5019,6 +5026,8 @@
int silentexit = 0;
struct ast_flags flags = { 0 };
signed char record_gain = 0;
+ int play_auto = 0;
+ int play_folder = 0;
LOCAL_USER_ADD(u);
@@ -5031,15 +5040,24 @@
ast_answer(chan);
if (!ast_strlen_zero(data)) {
- char *tmp;
- int argc;
- char *argv[2];
char *opts[OPT_ARG_ARRAY_SIZE];
-
- tmp = ast_strdupa(data);
- argc = ast_app_separate_args(tmp, '|', argv, sizeof(argv) / sizeof(argv[0]));
- if (argc == 2) {
- if (ast_app_parse_options(vm_app_options, &flags, opts, argv[1])) {
+ char *parse;
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(argv0);
+ AST_APP_ARG(argv1);
+ );
+
+ parse = ast_strdupa(data);
+ if (!parse) {
+ ast_log(LOG_ERROR, "Out of memory!\n");
+ LOCAL_USER_REMOVE(u);
+ return -1;
+ }
+
+ AST_STANDARD_APP_ARGS(args, parse);
+
+ if (args.argc == 2) {
+ if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) {
LOCAL_USER_REMOVE(u);
return -1;
}
@@ -5054,30 +5072,42 @@
record_gain = (signed char) gain;
}
}
+ if (ast_test_flag(&flags, OPT_AUTOPLAY) ) {
+ play_auto = 1;
+ if (sscanf(opts[OPT_ARG_PLAYFOLDER], "%d", &play_folder) != 1) {
+ ast_log(LOG_WARNING, "Invalid value '%s' provided for folder autoplay option\n", opts[OPT_ARG_PLAYFOLDER]);
+ LOCAL_USER_REMOVE(u);
+ return -1;
+ }
+ else if ( play_folder > 9 || play_folder < 1) {
+ ast_log(LOG_WARNING, "Invalid value '%d' provided for folder autoplay option\n", play_folder);
+ LOCAL_USER_REMOVE(u);
+ return -1;
+ }
+ }
} else {
/* old style options parsing */
- while (*argv[0]) {
- if (*argv[0] == 's') {
+ while (*(args.argv0)) {
+ if (*(args.argv0) == 's')
ast_set_flag(&flags, OPT_SILENT);
- argv[0]++;
[... 3645 lines stripped ...]
More information about the asterisk-commits
mailing list