[svn-commits] branch oej/astum r27185 - in /team/oej/astum: ./
apps/ build_tools/ channels/...
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Mon May 15 09:32:23 MST 2006
Author: oej
Date: Mon May 15 03:07:14 2006
New Revision: 27185
URL: http://svn.digium.com/view/asterisk?rev=27185&view=rev
Log:
Reset automerge
Modified:
team/oej/astum/ (props changed)
team/oej/astum/Makefile
team/oej/astum/apps/Makefile
team/oej/astum/apps/app_externalivr.c
team/oej/astum/apps/app_meetme.c
team/oej/astum/apps/app_voicemail.c
team/oej/astum/asterisk.c
team/oej/astum/build_tools/cflags.xml
team/oej/astum/build_tools/make_buildopts_h
team/oej/astum/channels/Makefile
team/oej/astum/channels/chan_agent.c
team/oej/astum/channels/chan_sip.c
team/oej/astum/configs/manager.conf.sample
team/oej/astum/configs/sip.conf.sample
team/oej/astum/dnsmgr.c
team/oej/astum/doc/cliprompt.txt
team/oej/astum/funcs/func_logic.c
team/oej/astum/include/asterisk/ (props changed)
team/oej/astum/include/asterisk/linkedlists.h
team/oej/astum/include/asterisk/lock.h
team/oej/astum/include/asterisk/rtp.h
team/oej/astum/loader.c
team/oej/astum/manager.c
team/oej/astum/pbx.c
team/oej/astum/res/res_features.c
team/oej/astum/rtp.c
Propchange: team/oej/astum/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/astum/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/astum/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 15 03:07:14 2006
@@ -1,1 +1,1 @@
-/trunk:1-26859
+/trunk:1-27184
Modified: team/oej/astum/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/astum/Makefile?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/Makefile (original)
+++ team/oej/astum/Makefile Mon May 15 03:07:14 2006
@@ -24,18 +24,6 @@
#CROSS_PROC=arm
#SUB_PROC=xscale # or maverick
-# Pentium Pro Optimize
-#PROC=i686
-
-# Pentium & VIA processors optimize
-#PROC=i586
-
-#PROC=k6
-#PROC=ppc
-
-CC=$(CROSS_COMPILE)gcc
-HOST_CC=gcc
-
ifeq ($(CROSS_COMPILE),)
OSARCH=$(shell uname -s)
PROC?=$(shell uname -m)
@@ -69,37 +57,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3 #-pg
-
-# Set NOCRYPTO to yes if you do not want to have crypto support or dependencies
-#NOCRYPTO=yes
-
-# If you are running a radio application, define RADIO_RELAX so that the DTMF
-# will be received more reliably
-#OPTIONS += -DRADIO_RELAX
-
-# If you don't have a lot of memory (e.g. embedded Asterisk), define LOW_MEMORY
-# to reduce the size of certain static buffers
-#ifneq ($(CROSS_COMPILE),)
-#OPTIONS += -DLOW_MEMORY
-#endif
-
-# Asterisk SMDI integration
-WITH_SMDI = 1
-
-# Optional debugging parameters
-DEBUG_THREADS = #-DDUMP_SCHEDULER #-DDEBUG_SCHEDULER #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
-
-# If you want to debug channel locking, try this (depends on code using
-# ast_channel_lock and companions to work)
-DEBUG_THREADS += #-DDEBUG_CHANNEL_LOCKS
-
-# Uncomment next one to enable ast_frame tracing (for debugging)
-TRACE_FRAMES = #-DTRACE_FRAMES
-
-# Where to install asterisk after compiling
-# Default -> leave empty
-INSTALL_PREFIX?=
+DEBUG=-g3
# Staging directory
# Files are copied here temporarily during the install process
@@ -110,16 +68,16 @@
#DESTDIR?=/tmp/asterisk
# Original busydetect routine
-BUSYDETECT = #-DBUSYDETECT
+#BUSYDETECT = -DBUSYDETECT
# Improved busydetect routine, comment the previous one if you use this one
-BUSYDETECT+= #-DBUSYDETECT_MARTIN
+#BUSYDETECT+= -DBUSYDETECT_MARTIN
# Detect the busy signal looking only at tone lengths
# For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
-BUSYDETECT+= #-DBUSYDETECT_TONEONLY
+#BUSYDETECT+= -DBUSYDETECT_TONEONLY
# Enforce the detection of busy signal (get rid of false hangups)
# Don't use together with -DBUSYDETECT_TONEONLY
-BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
+#BUSYDETECT+= -DBUSYDETECT_COMPARE_TONE_AND_SILENCE
# Define standard directories for various platforms
# These apply if they are not redefined in asterisk.conf
@@ -201,7 +159,7 @@
# *CLI> show memory allocations [filename]
# *CLI> show memory summary [filename]
-ifneq ($(findstring -DMALLOC_DEBUG,$(ASTCFLAGS)),)
+ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
TOPDIR_CFLAGS+=-include include/asterisk/astmm.h
MOD_SUBDIR_CFLAGS+=-include ../include/asterisk/astmm.h
endif
@@ -251,7 +209,7 @@
ID=/usr/xpg4/bin/id
endif
-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) #-DMAKE_VALGRIND_HAPPY
+ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
ASTCFLAGS+=$(OPTIMIZE)
ifeq ($(AST_DEVMODE),yes)
@@ -259,7 +217,7 @@
endif
ifeq ($(shell gcc -v 2>&1 | grep 'gcc version' | cut -f3 -d' ' | cut -f1 -d.),4)
-ASTCFLAGS+= -Wno-pointer-sign
+ASTCFLAGS+=-Wno-pointer-sign
endif
ASTOBJ=-o asterisk
@@ -286,8 +244,7 @@
endif # FreeBSD
ifeq ($(OSARCH),NetBSD)
- ASTCFLAGS+=-pthread
- INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/pkg/include
+ AST_CFLAGS+=-pthread -I$(CROSS_COMPILE_TARGET)/usr/pkg/include
MPG123TARG=netbsd
endif
@@ -296,8 +253,7 @@
endif
ifeq ($(OSARCH),SunOS)
- ASTCFLAGS+=-Wcast-align -DSOLARIS
- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
+ ASTCFLAGS+=-Wcast-align -DSOLARIS -Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
endif
LIBEDIT=editline/libedit.a
@@ -322,13 +278,9 @@
endif
endif
-ASTCFLAGS+= $(DEBUG_THREADS)
-ASTCFLAGS+= $(TRACE_FRAMES)
-ASTCFLAGS+= $(MALLOC_DEBUG)
-ASTCFLAGS+= $(BUSYDETECT)
-ASTCFLAGS+= $(OPTIONS)
+ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
ifeq ($(findstring dont-optimize,$(MAKECMDGOALS)),)
-ASTCFLAGS+= -fomit-frame-pointer
+ASTCFLAGS+=-fomit-frame-pointer
endif
MOD_SUBDIRS=res channels pbx apps codecs formats cdr funcs
@@ -347,11 +299,11 @@
# we need to link in the objects statically, not as a library, because
# otherwise modules will not have them available if none of the static
# objects use it.
-OBJS+= stdtime/localtime.o
+OBJS+=stdtime/localtime.o
# At the moment say.o is an optional component which can be overridden
# by a module.
-OBJS+= say.o
+OBJS+=say.o
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
OBJS+= poll.o
@@ -410,7 +362,7 @@
endif
ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
- CFLAGS+=$(TOPDIR_CFLAGS) $(ASTCFLAGS)
+ CFLAGS+=$(TOPDIR_CFLAGS)$(ASTCFLAGS)
endif
# This is used when generating the doxygen documentation
@@ -532,7 +484,7 @@
@rm -f $@.tmp
stdtime/libtime.a:
- CFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a
+ CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a
asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
build_tools/make_build_h > include/asterisk/build.h.tmp
@@ -547,9 +499,9 @@
$(CC) $(AUDIO_LIBS) -o muted muted.o
subdirs:
- @for x in $(MOD_SUBDIRS); do CFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C $$x || exit 1 ; done
- @CFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C utils
- @CFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C agi
+ @for x in $(MOD_SUBDIRS); do CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $$x || exit 1 ; done
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C utils
+ @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C agi
clean-depend:
@for x in $(SUBDIRS); do $(MAKE) -C $$x clean-depend || exit 1 ; done
@@ -1004,7 +956,7 @@
menuselect: build_tools/menuselect makeopts.xml
- at build_tools/menuselect ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
-build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h include/autoconfig.h mxml/libmxml.a $(MENUSELECT_OBJS)
+build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h config.status mxml/libmxml.a $(MENUSELECT_OBJS)
$(MAKE) -C build_tools menuselect
mxml/libmxml.a:
Modified: team/oej/astum/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/Makefile?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/apps/Makefile (original)
+++ team/oej/astum/apps/Makefile Mon May 15 03:07:14 2006
@@ -12,10 +12,6 @@
#
MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%.so,$(wildcard app_*.c)))
-
-ifneq ($(WITH_SMDI),)
- CFLAGS+=-DWITH_SMDI
-endif
# If you have UnixODBC you can use ODBC voicemail
# storage
Modified: team/oej/astum/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_externalivr.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/apps/app_externalivr.c (original)
+++ team/oej/astum/apps/app_externalivr.c Mon May 15 03:07:14 2006
@@ -258,14 +258,14 @@
FILE *child_commands = NULL;
FILE *child_errors = NULL;
FILE *child_events = NULL;
- struct ivr_localuser foo, *u = &foo;
-
- bzero(u, sizeof(*u));
+ struct ivr_localuser foo = {
+ .playlist = AST_LIST_HEAD_INIT_VALUE,
+ .finishlist = AST_LIST_HEAD_INIT_VALUE,
+ };
+ struct ivr_localuser *u = &foo;
LOCAL_USER_ADD(lu);
- AST_LIST_HEAD_INIT(&u->playlist);
- AST_LIST_HEAD_INIT(&u->finishlist);
u->abort_current_sound = 0;
u->chan = chan;
Modified: team/oej/astum/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_meetme.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/apps/app_meetme.c (original)
+++ team/oej/astum/apps/app_meetme.c Mon May 15 03:07:14 2006
@@ -152,8 +152,6 @@
int zapconf; /* Zaptel Conf # */
int users; /* Number of active users */
int markedusers; /* Number of marked users */
- struct ast_conf_user *firstuser; /* Pointer to the first user struct */
- struct ast_conf_user *lastuser; /* Pointer to the last user struct */
time_t start; /* Start time (s) */
int refcount; /* reference count of usage */
unsigned int recording:2; /* recording status */
@@ -168,6 +166,7 @@
struct ast_frame *transframe[32];
struct ast_frame *origframe;
struct ast_trans_pvt *transpath[32];
+ AST_LIST_HEAD_NOLOCK(, ast_conf_user) userlist;
AST_LIST_ENTRY(ast_conference) list;
};
@@ -180,8 +179,6 @@
struct ast_conf_user {
int user_no; /* User Number */
- struct ast_conf_user *prevuser; /* Pointer to the previous user */
- struct ast_conf_user *nextuser; /* Pointer to the next user */
int userflags; /* Flags as set in the conference */
int adminflags; /* Flags set by the Admin */
struct ast_channel *chan; /* Connected channel */
@@ -192,6 +189,7 @@
time_t jointime; /* Time the user joined the conference */
struct volume talk;
struct volume listen;
+ AST_LIST_ENTRY(ast_conf_user) list;
};
static int audio_buffers; /* The number of audio buffers to be allocated on pseudo channels
@@ -532,9 +530,6 @@
cnf->start = time(NULL);
cnf->zapconf = ztc.confno;
cnf->isdynamic = dynamic ? 1 : 0;
- cnf->firstuser = NULL;
- cnf->lastuser = NULL;
- cnf->locked = 0;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
AST_LIST_INSERT_HEAD(&confs, cnf, list);
@@ -665,7 +660,7 @@
return RESULT_SUCCESS;
}
/* Show all the users */
- for (user = cnf->firstuser; user; user = user->nextuser){
+ AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
now = time(NULL);
hr = (now - user->jointime) / 3600;
min = ((now - user->jointime) % 3600) / 60;
@@ -751,7 +746,7 @@
if (cnf) {
/* Search for the user */
- for (usr = cnf->firstuser; usr; usr = usr->nextuser) {
+ AST_LIST_TRAVERSE(&cnf->userlist, usr, list) {
snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
if (!strncasecmp(word, usrno, len) && ++which > state)
break;
@@ -928,24 +923,13 @@
conf->markedusers++;
ast_mutex_lock(&conf->playlock);
- if (!conf->firstuser) {
- /* Fill the first new User struct */
+
+ if (AST_LIST_EMPTY(&conf->userlist))
user->user_no = 1;
- conf->firstuser = user;
- conf->lastuser = user;
- } else {
- /* Fill the new user struct */
- user->user_no = conf->lastuser->user_no + 1;
- user->prevuser = conf->lastuser;
- if (conf->lastuser->nextuser) {
- ast_log(LOG_WARNING, "Error in User Management!\n");
- ast_mutex_unlock(&conf->playlock);
- goto outrun;
- } else {
- conf->lastuser->nextuser = user;
- conf->lastuser = user;
- }
- }
+ else
+ user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;
+
+ AST_LIST_INSERT_TAIL(&conf->userlist, user, list);
user->chan = chan;
user->userflags = confflags;
@@ -1480,7 +1464,7 @@
break;
case '3': /* Eject last user */
menu_active = 0;
- usr = conf->lastuser;
+ usr = AST_LIST_LAST(&conf->userlist);
if ((usr->chan->name == chan->name)||(usr->userflags & CONFFLAG_ADMIN)) {
if(!ast_streamfile(chan, "conf-errormenu", chan->language))
ast_waitstream(chan, "");
@@ -1711,39 +1695,12 @@
ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
if (confflags & CONFFLAG_MARKEDUSER)
conf->markedusers--;
- if (!conf->users) {
+ if (AST_LIST_EMPTY(&conf->userlist)) {
/* close this one when no more users and no references*/
- if (!conf->refcount){
+ if (!conf->refcount)
conf_free(conf);
- }
} else {
- /* Remove the user struct */
- if (user == conf->firstuser) {
- if (user->nextuser) {
- /* There is another entry */
- user->nextuser->prevuser = NULL;
- } else {
- /* We are the only entry */
- conf->lastuser = NULL;
- }
- /* In either case */
- conf->firstuser = user->nextuser;
- } else if (user == conf->lastuser){
- if (user->prevuser)
- user->prevuser->nextuser = NULL;
- else
- ast_log(LOG_ERROR, "Bad bad bad! We're the last, not the first, but nobody before us??\n");
- conf->lastuser = user->prevuser;
- } else {
- if (user->nextuser)
- user->nextuser->prevuser = user->prevuser;
- else
- ast_log(LOG_ERROR, "Bad! Bad! Bad! user->nextuser is NULL but we're not the end!\n");
- if (user->prevuser)
- user->prevuser->nextuser = user->nextuser;
- else
- ast_log(LOG_ERROR, "Bad! Bad! Bad! user->prevuser is NULL but we're not the beginning!\n");
- }
+ AST_LIST_REMOVE(&conf->userlist, user, list);
}
/* Return the number of seconds the user was in the conf */
snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
@@ -2221,18 +2178,16 @@
return res;
}
-static struct ast_conf_user* find_user(struct ast_conference *conf, char *callerident)
+static struct ast_conf_user *find_user(struct ast_conference *conf, char *callerident)
{
struct ast_conf_user *user = NULL;
int cid;
sscanf(callerident, "%i", &cid);
if (conf && callerident) {
- user = conf->firstuser;
- while (user) {
+ AST_LIST_TRAVERSE(&conf->userlist, user, list) {
if (cid == user->user_no)
return user;
- user = user->nextuser;
}
}
return NULL;
@@ -2282,23 +2237,15 @@
case 108: /* l: Unlock */
cnf->locked = 0;
break;
- case 75: /* K: kick all users*/
- user = cnf->firstuser;
- while(user) {
+ case 75: /* K: kick all users */
+ AST_LIST_TRAVERSE(&cnf->userlist, user, list)
user->adminflags |= ADMINFLAG_KICKME;
- if (user->nextuser) {
- user = user->nextuser;
- } else {
- break;
- }
- }
break;
case 101: /* e: Eject last user*/
- user = cnf->lastuser;
- if (!(user->userflags & CONFFLAG_ADMIN)) {
+ user = AST_LIST_LAST(&cnf->userlist);
+ if (!(user->userflags & CONFFLAG_ADMIN))
user->adminflags |= ADMINFLAG_KICKME;
- break;
- } else
+ else
ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
break;
case 77: /* M: Mute */
@@ -2314,15 +2261,9 @@
}
break;
case 78: /* N: Mute all users */
- user = cnf->firstuser;
- while(user) {
- if (user && !(user->userflags & CONFFLAG_ADMIN))
+ AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
+ if (!(user->userflags & CONFFLAG_ADMIN))
user->adminflags |= ADMINFLAG_MUTED;
- if (user->nextuser) {
- user = user->nextuser;
- } else {
- break;
- }
}
break;
case 109: /* m: Unmute */
@@ -2337,25 +2278,15 @@
ast_log(LOG_NOTICE, "Specified User not found or he muted himself!\n");
}
break;
- case 110: /* n: Unmute all users */
- user = cnf->firstuser;
- while(user) {
- if (user && (user-> adminflags & ADMINFLAG_MUTED)) {
- user->adminflags ^= ADMINFLAG_MUTED;
- }
- if (user->nextuser) {
- user = user->nextuser;
- } else {
- break;
- }
- }
+ case 110: /* n: Unmute all users */
+ AST_LIST_TRAVERSE(&cnf->userlist, user, list)
+ user->adminflags &= ~ADMINFLAG_MUTED;
break;
case 107: /* k: Kick user */
- if (user) {
+ if (user)
user->adminflags |= ADMINFLAG_KICKME;
- } else {
+ else
ast_log(LOG_NOTICE, "Specified User not found!");
- }
break;
}
} else {
Modified: team/oej/astum/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/apps/app_voicemail.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/apps/app_voicemail.c (original)
+++ team/oej/astum/apps/app_voicemail.c Mon May 15 03:07:14 2006
@@ -919,7 +919,7 @@
odbc_release_obj(obj);
goto yuck;
}
- fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC);
+ fd = open(full_fn, O_RDWR | O_CREAT | O_TRUNC, 0770);
if (fd < 0) {
ast_log(LOG_WARNING, "Failed to write '%s': %s\n", full_fn, strerror(errno));
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
@@ -949,13 +949,13 @@
if (!strcasecmp(coltitle, "recording")) {
res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
fdlen = colsize;
- fd = open(full_fn, O_RDWR | O_TRUNC | O_CREAT, 0770);
if (fd > -1) {
char tmp[1]="";
lseek(fd, fdlen - 1, SEEK_SET);
if (write(fd, tmp, 1) != 1) {
close(fd);
fd = -1;
+ continue;
}
if (fd > -1)
fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
Modified: team/oej/astum/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/asterisk.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/asterisk.c (original)
+++ team/oej/astum/asterisk.c Mon May 15 03:07:14 2006
@@ -1644,26 +1644,29 @@
}
break;
#endif
- case 't': /* time */
- memset(&tm, 0, sizeof(tm));
- time(&ts);
- if (localtime_r(&ts, &tm)) {
- strftime(p, sizeof(prompt) - strlen(prompt), "%H:%M:%S", &tm);
- }
- break;
- case '#': /* process console or remote? */
- if (!ast_opt_remote) {
- strncat(p, "#", sizeof(prompt) - strlen(prompt) - 1);
- } else {
- strncat(p, ">", sizeof(prompt) - strlen(prompt) - 1);
- }
- break;
- case '%': /* literal % */
- strncat(p, "%", sizeof(prompt) - strlen(prompt) - 1);
- break;
- case '\0': /* % is last character - prevent bug */
- t--;
- break;
+ case 's': /* Asterisk system name (from asterisk.conf) */
+ strncat(p, ast_config_AST_SYSTEM_NAME, sizeof(prompt) - strlen(prompt) - 1);
+ break;
+ case 't': /* time */
+ memset(&tm, 0, sizeof(tm));
+ time(&ts);
+ if (localtime_r(&ts, &tm)) {
+ strftime(p, sizeof(prompt) - strlen(prompt), "%H:%M:%S", &tm);
+ }
+ break;
+ case '#': /* process console or remote? */
+ if (!ast_opt_remote) {
+ strncat(p, "#", sizeof(prompt) - strlen(prompt) - 1);
+ } else {
+ strncat(p, ">", sizeof(prompt) - strlen(prompt) - 1);
+ }
+ break;
+ case '%': /* literal % */
+ strncat(p, "%", sizeof(prompt) - strlen(prompt) - 1);
+ break;
+ case '\0': /* % is last character - prevent bug */
+ t--;
+ break;
}
while (*p != '\0') {
p++;
Modified: team/oej/astum/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/oej/astum/build_tools/cflags.xml?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/build_tools/cflags.xml (original)
+++ team/oej/astum/build_tools/cflags.xml Mon May 15 03:07:14 2006
@@ -11,10 +11,13 @@
</member>
<member name="MALLOC_DEBUG" displayname="Keep Track of Memory Allocations">
</member>
+ <member name="MTX_PROFILE" displayname="Enable Code Profiling Using TSC Counters">
+ </member>
<member name="RADIO_RELAX" displayname="Relax DTMF for Radio Applications">
</member>
<member name="TRACE_FRAMES" displayname="Trace Frame Allocations">
</member>
- <member name="MTX_PROFILE" displayname="Enable Code Profiling Using TSC Counters">
+ <member name="WITH_SMDI" displayname="Include SMDI Support">
+ <defaultenabled>yes</defaultenabled>
</member>
</category>
Modified: team/oej/astum/build_tools/make_buildopts_h
URL: http://svn.digium.com/view/asterisk/team/oej/astum/build_tools/make_buildopts_h?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/build_tools/make_buildopts_h (original)
+++ team/oej/astum/build_tools/make_buildopts_h Mon May 15 03:07:14 2006
@@ -9,5 +9,5 @@
END
TMP=`grep MENUSELECT_CFLAGS menuselect.makeopts | sed s/MENUSELECT_CFLAGS\=//g | sed s/-D//g`
for x in ${TMP}; do
- echo "#define ${x}"
+ echo "#define ${x} 1"
done
Modified: team/oej/astum/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/Makefile?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/channels/Makefile (original)
+++ team/oej/astum/channels/Makefile Mon May 15 03:07:14 2006
@@ -42,10 +42,6 @@
ifeq ($(OSARCH),SunOS)
SOLINK+=-lrt
-endif
-
-ifeq ($(WITH_SMDI),1)
- CFLAGS+=-DWITH_SMDI
endif
ifeq ($(wildcard h323/libchanh323.a),)
Modified: team/oej/astum/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/chan_agent.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/channels/chan_agent.c (original)
+++ team/oej/astum/channels/chan_agent.c Mon May 15 03:07:14 2006
@@ -2597,19 +2597,16 @@
ast_manager_unregister("AgentLogoff");
ast_manager_unregister("AgentCallbackLogin");
/* Unregister channel */
- ast_channel_unregister(&agent_tech);
- if (!AST_LIST_LOCK(&agents)) {
- /* Hangup all interfaces if they have an owner */
- AST_LIST_TRAVERSE(&agents, p, list) {
- if (p->owner)
- ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
- }
- AST_LIST_UNLOCK(&agents);
- AST_LIST_HEAD_INIT(&agents);
- } else {
- ast_log(LOG_WARNING, "Unable to lock the monitor\n");
- return -1;
- }
+ AST_LIST_LOCK(&agents);
+ /* Hangup all interfaces if they have an owner */
+ while ((p = AST_LIST_REMOVE_HEAD(&agents, list))) {
+ if (p->owner)
+ ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
+ free(p);
+ }
+ AST_LIST_UNLOCK(&agents);
+ AST_LIST_HEAD_DESTROY(&agents);
+
return 0;
}
Modified: team/oej/astum/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/channels/chan_sip.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/channels/chan_sip.c (original)
+++ team/oej/astum/channels/chan_sip.c Mon May 15 03:07:14 2006
@@ -1199,7 +1199,6 @@
static void make_our_tag(char *tagbuf, size_t len);
static int add_header(struct sip_request *req, const char *var, const char *value);
static int add_header_contentLength(struct sip_request *req, int len);
-static int add_blank_header(struct sip_request *req);
static int add_line(struct sip_request *req, const char *line);
static int add_text(struct sip_request *req, const char *text);
static int add_digit(struct sip_request *req, char digit);
@@ -1796,11 +1795,22 @@
parse_request(dst);
}
+/* add a blank line if no body */
+static void add_blank(struct sip_request *req)
+{
+ if (!req->lines) {
+ /* Add extra empty return. add_header() reserves 4 bytes so cannot be truncated */
+ snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
+ req->len += strlen(req->data + req->len);
+ }
+}
+
/*! \brief Transmit response on SIP request*/
static int send_response(struct sip_pvt *p, struct sip_request *req, enum xmittype reliable, int seqno)
{
int res;
+ add_blank(req);
if (sip_debug_test_pvt(p)) {
char iabuf[INET_ADDRSTRLEN];
if (ast_test_flag(&p->flags[0], SIP_NAT_ROUTE))
@@ -1827,6 +1837,7 @@
{
int res;
+ add_blank(req);
if (sip_debug_test_pvt(p)) {
char iabuf[INET_ADDRSTRLEN];
if (ast_test_flag(&p->flags[0], SIP_NAT_ROUTE))
@@ -4148,28 +4159,6 @@
return add_header(req, "Content-Length", clen);
}
-/*! \brief Add blank header to SIP message */
-static int add_blank_header(struct sip_request *req)
-{
- if (req->headers == SIP_MAX_HEADERS) {
- ast_log(LOG_WARNING, "Out of SIP header space\n");
- return -1;
- }
- if (req->lines) {
- ast_log(LOG_WARNING, "Can't add more headers when lines have been added\n");
- return -1;
- }
- if (req->len >= sizeof(req->data) - 4) {
- ast_log(LOG_WARNING, "Out of space, can't add anymore\n");
- return -1;
- }
- req->header[req->headers] = req->data + req->len;
- snprintf(req->header[req->headers], sizeof(req->data) - req->len, "\r\n");
- req->len += strlen(req->header[req->headers]);
- req->headers++;
- return 0;
-}
-
/*! \brief Add content (not header) to SIP message */
static int add_line(struct sip_request *req, const char *line)
{
@@ -4578,7 +4567,6 @@
snprintf(buf, sizeof(buf), "%d", p->owner->hangupcause);
add_header(&resp, "X-Asterisk-HangupCauseCode", buf);
}
- add_blank_header(&resp);
return send_response(p, &resp, reliable, seqno);
}
@@ -4625,7 +4613,6 @@
respprep(&resp, p, msg, req);
append_date(&resp);
add_header_contentLength(&resp, 0);
- add_blank_header(&resp);
return send_response(p, &resp, XMIT_UNRELIABLE, 0);
}
@@ -4636,7 +4623,6 @@
respprep(&resp, p, msg, req);
add_header(&resp, "Accept", "application/sdp");
add_header_contentLength(&resp, 0);
- add_blank_header(&resp);
return send_response(p, &resp, reliable, 0);
}
@@ -4657,7 +4643,6 @@
respprep(&resp, p, msg, req);
add_header(&resp, header, tmp);
add_header_contentLength(&resp, 0);
- add_blank_header(&resp);
return send_response(p, &resp, reliable, seqno);
}
@@ -4985,50 +4970,41 @@
}
/*! \brief Parse first line of incoming SIP request */
-static int determine_firstline_parts( struct sip_request *req )
-{
- char *e, *cmd;
- int len;
-
- cmd = ast_skip_blanks(req->header[0]);
- if (!*cmd)
+static int determine_firstline_parts(struct sip_request *req)
+{
+ char *e = ast_skip_blanks(req->header[0]); /* there shouldn't be any */
+
+ if (!*e)
return -1;
- req->rlPart1 = cmd;
- e = ast_skip_nonblanks(cmd);
- /* Get the command */
+ req->rlPart1 = e; /* method or protocol */
+ e = ast_skip_nonblanks(e);
if (*e)
*e++ = '\0';
+ /* Get URI or status code */
e = ast_skip_blanks(e);
if ( !*e )
return -1;
-
- if ( !strcasecmp(cmd, "SIP/2.0") ) {
- /* We have a response */
+ ast_trim_blanks(e);
+
+ if (!strcasecmp(req->rlPart1, "SIP/2.0") ) { /* We have a response */
+ if (strlen(e) < 3) /* status code is 3 digits */
+ return -1;
req->rlPart2 = e;
- len = strlen( req->rlPart2 );
- if ( len < 2 ) {
+ } else { /* We have a request */
+ if ( *e == '<' ) { /* XXX the spec says it must not be in <> ! */
+ ast_log(LOG_WARNING, "bogus uri in <> %s\n", e);
+ e++;
+ if (!*e)
+ return -1;
+ }
+ req->rlPart2 = e; /* URI */
+ e = ast_skip_nonblanks(e);
+ if (*e)
+ *e++ = '\0';
+ e = ast_skip_blanks(e);
+ if (strcasecmp(e, "SIP/2.0") ) {
+ ast_log(LOG_WARNING, "Bad request protocol %s\n", e);
return -1;
- }
- ast_trim_blanks(e);
- } else {
- /* We have a request */
- if ( *e == '<' ) {
- e++;
- if ( !*e ) {
- return -1;
- }
- }
- req->rlPart2 = e; /* URI */
- if ( ( e= strrchr( req->rlPart2, 'S' ) ) == NULL ) {
- return -1;
- }
- /* XXX maybe trim_blanks() ? */
- while( isspace( *(--e) ) )
- ;
- if ( *e == '>' ) {
- *e = '\0';
- } else {
- *(++e)= '\0';
}
}
return 1;
@@ -5395,7 +5371,6 @@
add_sdp(&req, p);
} else {
add_header_contentLength(&req, 0);
- add_blank_header(&req);
}
if (!p->initreq.headers)
@@ -5915,7 +5890,6 @@
add_header(&req, "Contact", p->our_contact);
add_header(&req, "Event", "registration");
add_header_contentLength(&req, 0);
- add_blank_header(&req);
initialize_initreq(p, &req);
if (sip_debug_test_pvt(p))
@@ -6000,7 +5974,6 @@
add_header(&req, "Supported", SUPPORTED_EXTENSIONS);
if (!ast_strlen_zero(p->our_contact))
add_header(&req, "Referred-By", p->our_contact);
- add_blank_header(&req);
return send_request(p, &req, 1, p->ocseq);
/* We should propably wait for a NOTIFY here until we ack the transfer */
@@ -6038,7 +6011,6 @@
struct sip_request resp;
reqprep(&resp, p, sipmethod, seqno, newbranch);
add_header_contentLength(&resp, 0);
- add_blank_header(&resp);
return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
}
@@ -6073,7 +6045,6 @@
}
add_header_contentLength(&resp, 0);
- add_blank_header(&resp);
return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
}
@@ -9315,7 +9286,6 @@
for (var = varlist; var; var = var->next)
add_header(&req, var->name, var->value);
- add_blank_header(&req);
/* Recalculate our side, and recalculate Call ID */
if (ast_sip_ouraddrfor(&p->sa.sin_addr, &p->ourip))
p->ourip = __ourip;
@@ -13260,7 +13230,10 @@
global_allowsubscribe = FALSE;
ast_copy_string(global_useragent, DEFAULT_USERAGENT, sizeof(global_useragent));
ast_copy_string(default_notifymime, DEFAULT_NOTIFYMIME, sizeof(default_notifymime));
- ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
+ if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME))
+ ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
+ else
+ ast_copy_string(global_realm, ast_config_AST_SYSTEM_NAME, sizeof(global_realm));
ast_copy_string(default_callerid, DEFAULT_CALLERID, sizeof(default_callerid));
compactheaders = DEFAULT_COMPACTHEADERS;
global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
Modified: team/oej/astum/configs/manager.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/astum/configs/manager.conf.sample?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/configs/manager.conf.sample (original)
+++ team/oej/astum/configs/manager.conf.sample Mon May 15 03:07:14 2006
@@ -21,6 +21,7 @@
; default is 60 seconds.
;
[general]
+displaysystemname = yes
enabled = no
;webenabled = yes
port = 5038
Modified: team/oej/astum/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/astum/configs/sip.conf.sample?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/configs/sip.conf.sample (original)
+++ team/oej/astum/configs/sip.conf.sample Mon May 15 03:07:14 2006
@@ -32,7 +32,8 @@
;allowtransfer=no ; Disable all transfers (unless enabled in peers or users)
; Default is enabled
;realm=mydomain.tld ; Realm for digest authentication
- ; defaults to "asterisk"
+ ; defaults to "asterisk". If you set a system name in
+ ; asterisk.conf, it defaults to that system name
; Realms MUST be globally unique according to RFC 3261
; Set this to your host name or domain name
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
Modified: team/oej/astum/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/dnsmgr.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/dnsmgr.c (original)
+++ team/oej/astum/dnsmgr.c Mon May 15 03:07:14 2006
@@ -58,7 +58,7 @@
char name[1];
};
-static AST_LIST_HEAD(entry_list, ast_dnsmgr_entry) entry_list;
+static AST_LIST_HEAD_STATIC(entry_list, ast_dnsmgr_entry);
AST_MUTEX_DEFINE_STATIC(refresh_lock);
@@ -285,7 +285,6 @@
ast_log(LOG_ERROR, "Unable to create schedule context.\n");
return -1;
}
- AST_LIST_HEAD_INIT(&entry_list);
ast_cli_register(&cli_reload);
ast_cli_register(&cli_status);
return do_reload(1);
Modified: team/oej/astum/doc/cliprompt.txt
URL: http://svn.digium.com/view/asterisk/team/oej/astum/doc/cliprompt.txt?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/doc/cliprompt.txt (original)
+++ team/oej/astum/doc/cliprompt.txt Mon May 15 03:07:14 2006
@@ -8,6 +8,7 @@
the current value by Asterisk:
%d Date (year-month-date)
+%s Asterisk system name (from asterisk.conf)
%h Full hostname
%H Short hostname
%t Time
Modified: team/oej/astum/funcs/func_logic.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/funcs/func_logic.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/funcs/func_logic.c (original)
+++ team/oej/astum/funcs/func_logic.c Mon May 15 03:07:14 2006
@@ -110,7 +110,7 @@
if (iffalse)
iffalse = ast_strip_quoted(iffalse, "\"", "\"");
- ast_copy_string(buf, ast_true(expr) ? iftrue : iffalse, len);
+ ast_copy_string(buf, pbx_checkcondition(expr) ? iftrue : iffalse, len);
return 0;
}
Propchange: team/oej/astum/include/asterisk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon May 15 03:07:14 2006
@@ -1,2 +1,3 @@
build.h
version.h
+buildopts.h
Modified: team/oej/astum/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/team/oej/astum/include/asterisk/linkedlists.h?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/include/asterisk/linkedlists.h (original)
+++ team/oej/astum/include/asterisk/linkedlists.h Mon May 15 03:07:14 2006
@@ -208,6 +208,12 @@
#define AST_LIST_FIRST(head) ((head)->first)
/*!
+ \brief Returns the last entry contained in a list.
+ \param head This is a pointer to the list tail structure
+ */
+#define AST_LIST_LAST(head) ((head)->last)
+
+/*!
\brief Returns the next entry in the list after the given entry.
\param elm This is a pointer to the current entry.
\param field This is the name of the field (declared using AST_LIST_ENTRY())
@@ -352,19 +358,6 @@
\brief Closes a safe loop traversal block.
*/
#define AST_LIST_TRAVERSE_SAFE_END }
-
-/*!
- \brief Initializes a list head structure.
- \param head This is a pointer to the list head structure
-
- This macro initializes a list head structure by setting the head
- entry to \a NULL (empty list) and recreating the embedded lock.
-*/
-#define AST_LIST_HEAD_INIT(head) { \
- (head)->first = NULL; \
- (head)->last = NULL; \
- ast_mutex_init(&(head)->lock); \
-}
/*!
\brief Destroys a list head structure.
Modified: team/oej/astum/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/oej/astum/include/asterisk/lock.h?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/include/asterisk/lock.h (original)
+++ team/oej/astum/include/asterisk/lock.h Mon May 15 03:07:14 2006
@@ -567,10 +567,10 @@
#else /* !DEBUG_THREADS */
-#define AST_MUTEX_INIT_VALUE PTHREAD_MUTEX_INIT_VALUE
-
typedef pthread_mutex_t ast_mutex_t;
+
+#define AST_MUTEX_INIT_VALUE ((ast_mutex_t)PTHREAD_MUTEX_INIT_VALUE)
static inline int ast_mutex_init(ast_mutex_t *pmutex)
{
Modified: team/oej/astum/include/asterisk/rtp.h
URL: http://svn.digium.com/view/asterisk/team/oej/astum/include/asterisk/rtp.h?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/include/asterisk/rtp.h (original)
+++ team/oej/astum/include/asterisk/rtp.h Mon May 15 03:07:14 2006
@@ -106,6 +106,8 @@
void ast_rtp_reset(struct ast_rtp *rtp);
+void ast_rtp_stun_request(struct ast_rtp *rtp, struct sockaddr_in *suggestion, const char *username);
+
void ast_rtp_set_callback(struct ast_rtp *rtp, ast_rtp_callback callback);
void ast_rtp_set_data(struct ast_rtp *rtp, void *data);
Modified: team/oej/astum/loader.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/loader.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/loader.c (original)
+++ team/oej/astum/loader.c Mon May 15 03:07:14 2006
@@ -722,8 +722,6 @@
if (m == NULL) /* MOD_0 modules may still have a mod_data entry */
m = find_symbol(cur, "mod_data", 0);
if (m != NULL) { /* new style module */
- ast_log(LOG_WARNING, "new style %s (0x%x) loaded RTLD_LOCAL\n",
- resource_name, m->flags);
cur->cb = m; /* use the mod_data from the module itself */
errors = check_exported(cur);
} else {
Modified: team/oej/astum/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/manager.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/manager.c (original)
+++ team/oej/astum/manager.c Mon May 15 03:07:14 2006
@@ -158,6 +158,7 @@
char inbuf[AST_MAX_MANHEADER_LEN];
int inlen;
int send_events;
+ int displaysystemname; /*!< Add system name to manager responses and events */
/* Queued events that we've not had the ability to send yet */
struct eventqent *eventq;
/* Timeout for ast_carefulwrite() */
@@ -772,6 +773,14 @@
while (v) {
if (!strcasecmp(v->name, "secret")) {
password = v->value;
+ } else if (!strcasecmp(v->name, "displaysystemname")) {
+ if (ast_true(v->value)) {
+ if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
+ s->displaysystemname = 1;
+ } else {
+ ast_log(LOG_ERROR, "Can't enable displaysystemname in manager.conf - no system name configured in asterisk.conf\n");
+ }
+ }
} else if (!strcasecmp(v->name, "permit") ||
!strcasecmp(v->name, "deny")) {
ha = ast_append_ha(v->name, v->value, ha);
Modified: team/oej/astum/pbx.c
URL: http://svn.digium.com/view/asterisk/team/oej/astum/pbx.c?rev=27185&r1=27184&r2=27185&view=diff
==============================================================================
--- team/oej/astum/pbx.c (original)
+++ team/oej/astum/pbx.c Mon May 15 03:07:14 2006
@@ -950,7 +950,7 @@
int match = extension_match_core(eroot->exten, exten, action);
/* 0 on fail, 1 on match, 2 on earlymatch */
[... 430 lines stripped ...]
More information about the svn-commits
mailing list