[asterisk-commits] branch oej/subscribemwi r15440 - in
/team/oej/subscribemwi: ./ agi/ apps/ cdr...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Mar 27 20:57:45 MST 2006
Author: oej
Date: Mon Mar 27 21:57:33 2006
New Revision: 15440
URL: http://svn.digium.com/view/asterisk?rev=15440&view=rev
Log:
resolve conflicts, update
Added:
team/oej/subscribemwi/apps/app_channelredirect.c
- copied unchanged from r15435, trunk/apps/app_channelredirect.c
team/oej/subscribemwi/configs/http.conf.sample
- copied unchanged from r15435, trunk/configs/http.conf.sample
team/oej/subscribemwi/doc/ip-tos.txt
- copied unchanged from r15435, trunk/doc/ip-tos.txt
team/oej/subscribemwi/http.c
- copied unchanged from r15435, trunk/http.c
team/oej/subscribemwi/include/asterisk/http.h
- copied unchanged from r15435, trunk/include/asterisk/http.h
team/oej/subscribemwi/res/res_convert.c
- copied unchanged from r15435, trunk/res/res_convert.c
Modified:
team/oej/subscribemwi/ (props changed)
team/oej/subscribemwi/Makefile
team/oej/subscribemwi/UPGRADE.txt
team/oej/subscribemwi/acl.c
team/oej/subscribemwi/agi/Makefile
team/oej/subscribemwi/app.c
team/oej/subscribemwi/apps/app_amd.c
team/oej/subscribemwi/apps/app_dial.c
team/oej/subscribemwi/apps/app_directory.c
team/oej/subscribemwi/apps/app_dumpchan.c
team/oej/subscribemwi/apps/app_meetme.c
team/oej/subscribemwi/apps/app_queue.c
team/oej/subscribemwi/apps/app_readfile.c
team/oej/subscribemwi/apps/app_rpt.c
team/oej/subscribemwi/apps/app_stack.c
team/oej/subscribemwi/apps/app_voicemail.c
team/oej/subscribemwi/ast_expr2.c
team/oej/subscribemwi/ast_expr2.h
team/oej/subscribemwi/ast_expr2.y
team/oej/subscribemwi/asterisk.c
team/oej/subscribemwi/astmm.c
team/oej/subscribemwi/cdr.c
team/oej/subscribemwi/cdr/Makefile
team/oej/subscribemwi/cdr/cdr_sqlite.c
team/oej/subscribemwi/channel.c
team/oej/subscribemwi/channels/chan_agent.c
team/oej/subscribemwi/channels/chan_iax2.c
team/oej/subscribemwi/channels/chan_misdn.c
team/oej/subscribemwi/channels/chan_sip.c
team/oej/subscribemwi/channels/chan_skinny.c
team/oej/subscribemwi/channels/chan_vpb.c
team/oej/subscribemwi/channels/chan_zap.c
team/oej/subscribemwi/channels/iax2-provision.c
team/oej/subscribemwi/channels/misdn/chan_misdn_config.h
team/oej/subscribemwi/channels/misdn/isdn_lib.c
team/oej/subscribemwi/channels/misdn_config.c
team/oej/subscribemwi/cli.c
team/oej/subscribemwi/codecs/Makefile
team/oej/subscribemwi/codecs/gsm/Makefile
team/oej/subscribemwi/codecs/gsm/libgsm.vcproj (props changed)
team/oej/subscribemwi/codecs/ilbc/libilbc.vcproj (props changed)
team/oej/subscribemwi/codecs/lpc10/liblpc10.vcproj (props changed)
team/oej/subscribemwi/configs/cdr.conf.sample
team/oej/subscribemwi/configs/features.conf.sample
team/oej/subscribemwi/configs/iax.conf.sample
team/oej/subscribemwi/configs/iaxprov.conf.sample
team/oej/subscribemwi/configs/indications.conf.sample
team/oej/subscribemwi/configs/misdn.conf.sample
team/oej/subscribemwi/configs/musiconhold.conf.sample
team/oej/subscribemwi/configs/sip.conf.sample
team/oej/subscribemwi/configs/zapata.conf.sample
team/oej/subscribemwi/contrib/init.d/rc.redhat.asterisk
team/oej/subscribemwi/contrib/utils/rawplayer.c
team/oej/subscribemwi/db.c
team/oej/subscribemwi/doc/enum.txt
team/oej/subscribemwi/editline/term.c
team/oej/subscribemwi/funcs/func_channel.c
team/oej/subscribemwi/funcs/func_enum.c
team/oej/subscribemwi/image.c
team/oej/subscribemwi/include/asterisk/acl.h
team/oej/subscribemwi/include/asterisk/cdr.h
team/oej/subscribemwi/include/asterisk/channel.h
team/oej/subscribemwi/include/asterisk/compat.h
team/oej/subscribemwi/include/asterisk/lock.h
team/oej/subscribemwi/include/asterisk/manager.h
team/oej/subscribemwi/include/asterisk/module.h
team/oej/subscribemwi/include/asterisk/options.h
team/oej/subscribemwi/include/asterisk/pbx.h
team/oej/subscribemwi/include/asterisk/say.h
team/oej/subscribemwi/include/asterisk/sched.h
team/oej/subscribemwi/include/asterisk/strings.h
team/oej/subscribemwi/include/asterisk/utils.h
team/oej/subscribemwi/include/solaris-compat/compat.h
team/oej/subscribemwi/loader.c
team/oej/subscribemwi/manager.c
team/oej/subscribemwi/pbx.c
team/oej/subscribemwi/res/res_features.c
team/oej/subscribemwi/res/res_musiconhold.c
team/oej/subscribemwi/res/res_snmp.c
team/oej/subscribemwi/rtp.c
team/oej/subscribemwi/sample.call
team/oej/subscribemwi/say.c
team/oej/subscribemwi/sched.c
team/oej/subscribemwi/sounds.txt
team/oej/subscribemwi/stdtime/localtime.c
team/oej/subscribemwi/strcompat.c
team/oej/subscribemwi/utils.c
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
automerge = hej
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Mar 27 21:57:33 2006
@@ -1,1 +1,1 @@
-/trunk:1-12645
+/trunk:1-15435
Modified: team/oej/subscribemwi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/Makefile?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/Makefile (original)
+++ team/oej/subscribemwi/Makefile Mon Mar 27 21:57:33 2006
@@ -357,14 +357,23 @@
SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
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 \
+ translate.o file.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 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 \
netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
- cryptostub.o sha1.o
+ cryptostub.o sha1.o http.o
+
+# 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
+
+# At the moment say.o is an optional component which can be overridden
+# by a module.
+OBJS+= say.o
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
OBJS+= poll.o
Modified: team/oej/subscribemwi/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/UPGRADE.txt?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/UPGRADE.txt (original)
+++ team/oej/subscribemwi/UPGRADE.txt Mon Mar 27 21:57:33 2006
@@ -53,6 +53,15 @@
* The ENUMLOOKUP() function with the 'c' option (for counting the number of records),
but the lookup fails to match any records, the returned value will now be "0" instead of blank.
+The IAX2 channel:
+
+* The "mailboxdetail" option has been deprecated. Previously, if this option
+ was not enabled, the 2 byte MSGCOUNT information element would be set to all
+ 1's to indicate there there is some number of messages waiting. With this
+ option enabled, the number of new messages were placed in one byte and the
+ number of old messages are placed in the other. This is now the default
+ (and the only) behavior.
+
The SIP channel:
* The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.
@@ -66,3 +75,11 @@
ASTETCDIR /usr/local/etc/asterisk
ASTBINDIR /usr/local/bin/asterisk
ASTSBINDIR /usr/local/sbin/asterisk
+
+Sounds:
+
+* The phonetic sounds directory has been removed from the asterisk-sounds package
+ because they are now included directly in Asterisk. However, it is important to
+ note that the phonetic sounds that existed in asterisk-sounds used a different
+ naming convention than the sounds in Asterisk. For example, instead of alpha.gsm
+ and bravo.gsm, Asterisk has a_p.gsm and b_p.gsm.
Modified: team/oej/subscribemwi/acl.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/acl.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/acl.c (original)
+++ team/oej/subscribemwi/acl.c Mon Mar 27 21:57:33 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -252,12 +252,55 @@
return 0;
}
-int ast_str2tos(const char *value, int *tos)
+struct dscp_codepoint {
+ char *name;
+ unsigned int space;
+};
+
+/* IANA registered DSCP codepoints */
+
+static const struct dscp_codepoint dscp_pool1[] = {
+ { "CS0", 0x00 },
+ { "CS1", 0x08 },
+ { "CS2", 0x10 },
+ { "CS3", 0x18 },
+ { "CS4", 0x20 },
+ { "CS5", 0x28 },
+ { "CS6", 0x30 },
+ { "CS7", 0x38 },
+ { "AF11", 0x0A },
+ { "AF12", 0x0C },
+ { "AF13", 0x0E },
+ { "AF21", 0x12 },
+ { "AF22", 0x14 },
+ { "AF23", 0x16 },
+ { "AF31", 0x1A },
+ { "AF32", 0x1C },
+ { "AF33", 0x1E },
+ { "AF41", 0x22 },
+ { "AF42", 0x24 },
+ { "AF43", 0x26 },
+ { "EF", 0x2E },
+};
+
+int ast_str2tos(const char *value, unsigned int *tos)
{
int fval;
- if (sscanf(value, "%i", &fval) == 1)
- *tos = fval & 0xff;
- else if (!strcasecmp(value, "lowdelay"))
+ unsigned int x;
+
+ if (sscanf(value, "%i", &fval) == 1) {
+ *tos = fval & 0xFF;
+ return 0;
+ }
+
+ for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+ if (!strcasecmp(value, dscp_pool1[x].name)) {
+ *tos = dscp_pool1[x].space << 2;
+ return 0;
+ }
+ }
+
+ if (!strcasecmp(value, "lowdelay"))
*tos = IPTOS_LOWDELAY;
else if (!strcasecmp(value, "throughput"))
*tos = IPTOS_THROUGHPUT;
@@ -269,7 +312,35 @@
*tos = 0;
else
return -1;
+
+ ast_log(LOG_WARNING, "tos value %s is deprecated. See doc/iptos.txt for more information.", value);
+
return 0;
+}
+
+const char *ast_tos2str(unsigned int tos)
+{
+ unsigned int x;
+
+ switch (tos) {
+ case 0:
+ return "none";
+ case IPTOS_LOWDELAY:
+ return "lowdelay";
+ case IPTOS_THROUGHPUT:
+ return "throughput";
+ case IPTOS_RELIABILITY:
+ return "reliability";
+ case IPTOS_MINCOST:
+ return "mincost";
+ default:
+ for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
+ if (dscp_pool1[x].space == (tos >> 2))
+ return dscp_pool1[x].name;
+ }
+ }
+
+ return "unknown";
}
int ast_get_ip(struct sockaddr_in *sin, const char *value)
Modified: team/oej/subscribemwi/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/agi/Makefile?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/agi/Makefile (original)
+++ team/oej/subscribemwi/agi/Makefile Mon Mar 27 21:57:33 2006
@@ -13,15 +13,11 @@
AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
-CFLAGS+=
+CFLAGS+=-DNO_AST_MM
LIBS=
ifeq ($(OSARCH),SunOS)
LIBS=-lsocket -lnsl ../strcompat.o
-endif
-
-ifeq ($(findstring BSD,${OSARCH}),BSD)
- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif
all: depend $(AGIS)
Modified: team/oej/subscribemwi/app.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/app.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/app.c (original)
+++ team/oej/subscribemwi/app.c Mon Mar 27 21:57:33 2006
@@ -1059,7 +1059,7 @@
if (ast_strlen_zero(group))
return 0;
- s = (!ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
+ s = S_OR(category, GROUP_CATEGORY_PREFIX);
ast_copy_string(cat, s, sizeof(cat));
chan = NULL;
@@ -1089,7 +1089,7 @@
if (regcomp(®exbuf, groupmatch, REG_EXTENDED | REG_NOSUB))
return 0;
- s = (!ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
+ s = S_OR(category, GROUP_CATEGORY_PREFIX);
ast_copy_string(cat, s, sizeof(cat));
chan = NULL;
Modified: team/oej/subscribemwi/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_amd.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_amd.c (original)
+++ team/oej/subscribemwi/apps/app_amd.c Mon Mar 27 21:57:33 2006
@@ -20,6 +20,10 @@
#include <stdio.h>
#include <stdlib.h>
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/lock.h"
Modified: team/oej/subscribemwi/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_dial.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_dial.c (original)
+++ team/oej/subscribemwi/apps/app_dial.c Mon Mar 27 21:57:33 2006
@@ -112,9 +112,10 @@
" other than the number assigned to the caller.\n"
" g - Proceed with dialplan execution at the current extension if the\n"
" destination channel hangs up.\n"
-" G(context^exten^pri) - If the call is answered, transfer both parties to\n"
-" the specified priority. Optionally, an extension, or extension and\n"
-" context may be specified. Otherwise, the current extension is used.\n"
+" G(context^exten^pri) - If the call is answered, transfer the calling party to\n"
+" the specified priority and the called party to the specified priority+1.\n"
+" Optionally, an extension, or extension and context may be specified. \n"
+" Otherwise, the current extension is used.\n"
" h - Allow the called party to hang up by sending the '*' DTMF digit.\n"
" H - Allow the calling party to hang up by hitting the '*' DTMF digit.\n"
" j - Jump to priority n+101 if all of the requested channels were busy.\n"
@@ -540,7 +541,7 @@
senddialevent(in, o->chan);
/* After calling, set callerid to extension */
if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID))
- ast_set_callerid(o->chan, ast_strlen_zero(in->macroexten) ? in->exten : in->macroexten, get_cid_name(cidname, sizeof(cidname), in), NULL);
+ ast_set_callerid(o->chan, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
}
}
/* Hangup the original channel now, in case we needed it */
@@ -1134,7 +1135,7 @@
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID))
- ast_set_callerid(tmp->chan, ast_strlen_zero(chan->macroexten) ? chan->exten : chan->macroexten, get_cid_name(cidname, sizeof(cidname), chan), NULL);
+ ast_set_callerid(tmp->chan, S_OR(chan->macroexten, chan->exten), get_cid_name(cidname, sizeof(cidname), chan), NULL);
}
/* Put them in the list of outgoing thingies... We're ready now.
XXX If we're forcibly removed, these outgoing calls won't get
Modified: team/oej/subscribemwi/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_directory.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_directory.c (original)
+++ team/oej/subscribemwi/apps/app_directory.c Mon Mar 27 21:57:33 2006
@@ -179,7 +179,7 @@
}
ast_stopstream(chan);
} else {
- res = ast_say_character_str(chan, !ast_strlen_zero(name) ? name : ext,
+ res = ast_say_character_str(chan, S_OR(name, ext),
AST_DIGIT_ANY, chan->language);
}
Modified: team/oej/subscribemwi/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_dumpchan.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_dumpchan.c (original)
+++ team/oej/subscribemwi/apps/app_dumpchan.c Mon Mar 27 21:57:33 2006
@@ -126,7 +126,7 @@
ast_print_group(cgrp, sizeof(cgrp), c->callgroup),
ast_print_group(pgrp, sizeof(pgrp), c->pickupgroup),
( c->appl ? c->appl : "(N/A)" ),
- ( c-> data ? (!ast_strlen_zero(c->data) ? c->data : "(Empty)") : "(None)"),
+ ( c-> data ? S_OR(c->data, "(Empty)") : "(None)"),
(ast_test_flag(c, AST_FLAG_BLOCKING) ? c->blockproc : "(Not Blocking)"));
return 0;
Modified: team/oej/subscribemwi/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_meetme.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_meetme.c (original)
+++ team/oej/subscribemwi/apps/app_meetme.c Mon Mar 27 21:57:33 2006
@@ -71,18 +71,18 @@
static const char *synopsis3 = "MeetMe conference Administration";
static const char *descrip =
-" MeetMe([confno][,[options][,pin]]): Enters the user into a specified MeetMe conference.\n"
-"If the conference number is omitted, the user will be prompted to enter\n"
-"one. \n"
-"User can exit the conference by hangup, or if the 'p' option is specified, by pressing '#'.\n"
+" MeetMe([confno][,[options][,pin]]): Enters the user into a specified MeetMe\n"
+"conference. If the conference number is omitted, the user will be prompted\n"
+"to enter one. User can exit the conference by hangup, or if the 'p' option\n"
+"is specified, by pressing '#'.\n"
"Please note: A ZAPTEL INTERFACE MUST BE INSTALLED FOR CONFERENCING TO WORK!\n\n"
"The option string may contain zero or more of the following characters:\n"
" 'a' -- set admin mode\n"
" 'A' -- set marked mode\n"
" 'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND}\n"
-" Default: conf-background.agi\n"
-" (Note: This does not work with non-Zap channels in the same conference)\n"
+" Default: conf-background.agi (Note: This does not work with\n"
+" non-Zap channels in the same conference)\n"
" 'c' -- announce user(s) count on joining a conference\n"
" 'd' -- dynamically add conference\n"
" 'D' -- dynamically add conference, prompting for a PIN\n"
@@ -91,31 +91,34 @@
" 'i' -- announce user join/leave\n"
" 'm' -- set monitor only mode (Listen only, no talking)\n"
" 'M' -- enable music on hold when the conference has a single caller\n"
+" 'o' -- set talker optimization - treats talkers who aren't speaking as\n"
+" being muted, meaning (a) No encode is done on transmission and\n"
+" (b) Received audio that is not registered as talking is omitted\n"
+" causing no buildup in background noise\n"
" 'p' -- allow user to exit the conference by pressing '#'\n"
" 'P' -- always prompt for the pin even if it is specified\n"
" 'q' -- quiet mode (don't play enter/leave sounds)\n"
" 'r' -- Record conference (records as ${MEETME_RECORDINGFILE}\n"
" using format ${MEETME_RECORDINGFORMAT}). Default filename is\n"
-" meetme-conf-rec-${CONFNO}-${UNIQUEID} and the default format is wav.\n"
+" meetme-conf-rec-${CONFNO}-${UNIQUEID} and the default format is\n"
+" wav.\n"
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
" 't' -- set talk only mode. (Talk only, no listening)\n"
" 'T' -- set talker detection (sent to manager interface and meetme list)\n"
-" 'o' -- set talker optimization - treats talkers who aren't speaking as\n"
-" being muted, meaning (a) No encode is done on transmission and\n"
-" (b) Received audio that is not registered as talking is omitted\n"
-" causing no buildup in background noise\n"
" 'v' -- video mode\n"
" 'w' -- wait until the marked user enters the conference\n"
" 'x' -- close the conference when last marked user exits\n"
" 'X' -- allow user to exit the conference by entering a valid single\n"
" digit extension ${MEETME_EXIT_CONTEXT} or the current context\n"
-" if that variable is not defined.\n";
+" if that variable is not defined.\n"
+" '1' -- do not play message when first person enters\n";
static const char *descrip2 =
" MeetMeCount(confno[|var]): Plays back the number of users in the specified\n"
"MeetMe conference. If var is specified, playback will be skipped and the value\n"
-"will be returned in the variable. Upon app completion, MeetMeCount will hangup the\n"
-"channel, unless priority n+1 exists, in which case priority progress will continue.\n"
+"will be returned in the variable. Upon app completion, MeetMeCount will hangup\n"
+"the channel, unless priority n+1 exists, in which case priority progress will\n"
+"continue.\n"
"A ZAPTEL INTERFACE MUST BE INSTALLED FOR CONFERENCING FUNCTIONALITY.\n";
static const char *descrip3 =
@@ -148,6 +151,7 @@
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 */
unsigned int isdynamic:1; /* Created on the fly? */
unsigned int locked:1; /* Is the conference locked? */
@@ -244,31 +248,33 @@
#define CONFFLAG_ALWAYSPROMPT (1 << 21)
#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 22) /* If set, when user joins the conference, they will be told the number of users that are already in */
#define CONFFLAG_OPTIMIZETALKER (1 << 23) /* If set, treats talking users as muted users */
+#define CONFFLAG_NOONLYPERSON (1 << 24) /* If set, won't speak the extra prompt when the first person enters the conference */
AST_APP_OPTIONS(meetme_opts, {
+ AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
AST_APP_OPTION('a', CONFFLAG_ADMIN ),
+ AST_APP_OPTION('b', CONFFLAG_AGI ),
AST_APP_OPTION('c', CONFFLAG_ANNOUNCEUSERCOUNT ),
+ AST_APP_OPTION('D', CONFFLAG_DYNAMICPIN ),
+ AST_APP_OPTION('d', CONFFLAG_DYNAMIC ),
+ AST_APP_OPTION('E', CONFFLAG_EMPTYNOPIN ),
+ AST_APP_OPTION('e', CONFFLAG_EMPTY ),
+ AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
+ AST_APP_OPTION('M', CONFFLAG_MOH ),
+ AST_APP_OPTION('m', CONFFLAG_MONITOR ),
+ AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
+ AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
+ AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
+ AST_APP_OPTION('q', CONFFLAG_QUIET ),
+ AST_APP_OPTION('r', CONFFLAG_RECORDCONF ),
+ AST_APP_OPTION('s', CONFFLAG_STARMENU ),
AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
- AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
- AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
- AST_APP_OPTION('m', CONFFLAG_MONITOR ),
- AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
- AST_APP_OPTION('s', CONFFLAG_STARMENU ),
AST_APP_OPTION('t', CONFFLAG_TALKER ),
- AST_APP_OPTION('q', CONFFLAG_QUIET ),
- AST_APP_OPTION('M', CONFFLAG_MOH ),
+ AST_APP_OPTION('w', CONFFLAG_WAITMARKED ),
+ AST_APP_OPTION('X', CONFFLAG_EXIT_CONTEXT ),
AST_APP_OPTION('x', CONFFLAG_MARKEDEXIT ),
- AST_APP_OPTION('X', CONFFLAG_EXIT_CONTEXT ),
- AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
- AST_APP_OPTION('b', CONFFLAG_AGI ),
- AST_APP_OPTION('w', CONFFLAG_WAITMARKED ),
- AST_APP_OPTION('r', CONFFLAG_RECORDCONF ),
- AST_APP_OPTION('d', CONFFLAG_DYNAMIC ),
- AST_APP_OPTION('D', CONFFLAG_DYNAMICPIN ),
- AST_APP_OPTION('e', CONFFLAG_EMPTY ),
- AST_APP_OPTION('E', CONFFLAG_EMPTYNOPIN ),
- AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
+ AST_APP_OPTION('1', CONFFLAG_NOONLYPERSON ),
});
static char *istalking(int x)
@@ -453,7 +459,7 @@
ast_autoservice_stop(chan);
}
-static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic)
+static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic, int refcount)
{
struct ast_conference *cnf;
struct zt_confinfo ztc;
@@ -473,6 +479,7 @@
ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
+ cnf->refcount = 0;
cnf->markedusers = 0;
cnf->chan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
if (cnf->chan) {
@@ -529,6 +536,9 @@
}
}
cnfout:
+ if (cnf){
+ cnf->refcount += refcount;
+ }
AST_LIST_UNLOCK(&confs);
return cnf;
}
@@ -769,6 +779,8 @@
f = ast_read(chan);
if (f)
ast_frfree(f);
+ else /* channel was hung up or something else happened */
+ break;
}
}
@@ -859,6 +871,12 @@
char *buf = __buf + AST_FRIENDLY_OFFSET;
if (!(user = ast_calloc(1, sizeof(*user)))) {
+ AST_LIST_LOCK(&confs);
+ conf->refcount--;
+ if (!conf->refcount){
+ conf_free(conf);
+ }
+ AST_LIST_UNLOCK(&confs);
return ret;
}
@@ -941,10 +959,12 @@
snprintf(user->namerecloc, sizeof(user->namerecloc),
"%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
conf->confno, user->user_no);
- ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
- }
-
- if (!(confflags & CONFFLAG_QUIET)) {
+ res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
+ if (res == -1)
+ goto outrun;
+ }
+
+ if ( !(confflags & (CONFFLAG_QUIET | CONFFLAG_NOONLYPERSON)) ) {
if (conf->users == 1 && !(confflags & CONFFLAG_WAITMARKED))
if (!ast_streamfile(chan, "conf-onlyperson", chan->language))
ast_waitstream(chan, "");
@@ -1671,14 +1691,17 @@
"<no name>", hr, min, sec);
conf->users--;
+ conf->refcount--;
/* Update table */
snprintf(members, sizeof(members), "%d", conf->users);
ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
if (confflags & CONFFLAG_MARKEDUSER)
conf->markedusers--;
if (!conf->users) {
- /* No more users -- close this one out */
- conf_free(conf);
+ /* close this one when no more users and no references*/
+ if (!conf->refcount){
+ conf_free(conf);
+ }
} else {
/* Remove the user struct */
if (user == conf->firstuser) {
@@ -1721,7 +1744,7 @@
/*
This function looks for a conference via the RealTime module
*/
-static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin)
+static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin, int refcount)
{
struct ast_variable *var;
@@ -1732,6 +1755,9 @@
AST_LIST_TRAVERSE(&confs, cnf, list) {
if (!strcmp(confno, cnf->confno))
break;
+ }
+ if (cnf){
+ cnf->refcount += refcount;
}
AST_LIST_UNLOCK(&confs);
@@ -1757,14 +1783,14 @@
}
ast_variables_destroy(var);
- cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic);
+ cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount);
}
return cnf;
}
-static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin)
+static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin, int refcount)
{
struct ast_config *cfg;
struct ast_variable *var;
@@ -1782,6 +1808,9 @@
if (!strcmp(confno, cnf->confno))
break;
}
+ if (cnf){
+ cnf->refcount += refcount;
+ }
AST_LIST_UNLOCK(&confs);
if (!cnf) {
@@ -1794,9 +1823,9 @@
if (ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0) < 0)
return NULL;
}
- cnf = build_conf(confno, dynamic_pin, "", make, dynamic);
+ cnf = build_conf(confno, dynamic_pin, "", make, dynamic, refcount);
} else {
- cnf = build_conf(confno, "", "", make, dynamic);
+ cnf = build_conf(confno, "", "", make, dynamic, refcount);
}
} else {
/* Check the config */
@@ -1805,28 +1834,20 @@
ast_log(LOG_WARNING, "No %s file :(\n", CONFIG_FILE_NAME);
return NULL;
}
- var = ast_variable_browse(cfg, "rooms");
- for (; var; var = var->next) {
+ for (var = ast_variable_browse(cfg, "rooms"); var; var = var->next) {
if (strcasecmp(var->name, "conf"))
continue;
if (!(parse = ast_strdupa(var->value)))
return NULL;
- AST_STANDARD_APP_ARGS(args, parse);
+ AST_NONSTANDARD_APP_ARGS(args, parse, ',');
if (!strcasecmp(args.confno, confno)) {
/* Bingo it's a valid conference */
- if (args.pin) {
- if (args.pinadmin)
- cnf = build_conf(args.confno, args.pin, args.pinadmin, make, dynamic);
- else
- cnf = build_conf(args.confno, args.pin, "", make, dynamic);
- } else {
- if (args.pinadmin)
- cnf = build_conf(args.confno, "", args.pinadmin, make, dynamic);
- else
- cnf = build_conf(args.confno, "", "", make, dynamic);
- }
+ cnf = build_conf(args.confno,
+ S_OR(args.pin, ""),
+ S_OR(args.pinadmin, ""),
+ make, dynamic, refcount);
break;
}
}
@@ -1874,7 +1895,7 @@
AST_STANDARD_APP_ARGS(args, localdata);
- conf = find_conf(chan, args.confno, 0, 0, NULL);
+ conf = find_conf(chan, args.confno, 0, 0, NULL, 0);
if (conf)
count = conf->users;
else
@@ -2001,7 +2022,7 @@
AST_LIST_UNLOCK(&confs);
if (!found) {
/* At this point, we have a confno_tmp (static conference) that is empty */
- if ((empty_no_pin && ((!stringp) || (stringp && (stringp[0] == '\0')))) || (!empty_no_pin)) {
+ if ((empty_no_pin && ast_strlen_zero(stringp)) || (!empty_no_pin)) {
/* Case 1: empty_no_pin and pin is nonexistent (NULL)
* Case 2: empty_no_pin and pin is blank (but not NULL)
* Case 3: not empty_no_pin
@@ -2060,9 +2081,9 @@
}
if (!ast_strlen_zero(confno)) {
/* Check the validity of the conference */
- cnf = find_conf(chan, confno, 1, dynamic, the_pin);
+ cnf = find_conf(chan, confno, 1, dynamic, the_pin, 1);
if (!cnf) {
- cnf = find_conf_realtime(chan, confno, 1, dynamic, the_pin);
+ cnf = find_conf_realtime(chan, confno, 1, dynamic, the_pin, 1);
}
if (!cnf) {
res = ast_streamfile(chan, "conf-invalid", chan->language);
@@ -2104,8 +2125,15 @@
res = ast_streamfile(chan, "conf-invalidpin", chan->language);
if (!res)
ast_waitstream(chan, AST_DIGIT_ANY);
- if (res < 0)
+ if (res < 0) {
+ AST_LIST_LOCK(&confs);
+ cnf->refcount--;
+ if (!cnf->refcount){
+ conf_free(cnf);
+ }
+ AST_LIST_UNLOCK(&confs);
break;
+ }
pin[0] = res;
pin[1] = '\0';
res = -1;
@@ -2118,8 +2146,9 @@
allowretry = 0;
/* see if we need to get rid of the conference */
AST_LIST_LOCK(&confs);
- if (!cnf->users) {
- conf_free(cnf);
+ cnf->refcount--;
+ if (!cnf->refcount) {
+ conf_free(cnf);
}
AST_LIST_UNLOCK(&confs);
break;
Modified: team/oej/subscribemwi/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_queue.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_queue.c (original)
+++ team/oej/subscribemwi/apps/app_queue.c Mon Mar 27 21:57:33 2006
@@ -952,7 +952,7 @@
}
AST_LIST_UNLOCK(&queues);
- if (!q) {
+ if (!q || q->realtime) {
/*! \note Load from realtime before taking the global qlock, to avoid blocking all
queue operations while waiting for the DB.
@@ -3357,7 +3357,7 @@
AST_LIST_UNLOCK(&queues);
}
-static int __queues_show(int manager, int fd, int argc, char **argv, int queue_show)
+static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv, int queue_show)
{
struct ast_call_queue *q;
struct queue_ent *qe;
@@ -3381,10 +3381,17 @@
AST_LIST_LOCK(&queues);
if (AST_LIST_EMPTY(&queues)) {
AST_LIST_UNLOCK(&queues);
- if (queue_show)
- ast_cli(fd, "No such queue: %s.%s",argv[2], term);
- else
- ast_cli(fd, "No queues.%s", term);
+ if (queue_show) {
+ if (s)
+ astman_append(s, "No such queue: %s.%s",argv[2], term);
+ else
+ ast_cli(fd, "No such queue: %s.%s",argv[2], term);
+ } else {
+ if (s)
+ astman_append(s, "No queues.%s", term);
+ else
+ ast_cli(fd, "No queues.%s", term);
+ }
return RESULT_SUCCESS;
}
AST_LIST_TRAVERSE(&queues, q, list) {
@@ -3409,10 +3416,17 @@
sl = 0;
if(q->callscompleted > 0)
sl = 100*((float)q->callscompletedinsl/(float)q->callscompleted);
- ast_cli(fd, "%-12.12s has %d calls (max %s) in '%s' strategy (%ds holdtime), W:%d, C:%d, A:%d, SL:%2.1f%% within %ds%s",
- q->name, q->count, max_buf, int2strat(q->strategy), q->holdtime, q->weight, q->callscompleted, q->callsabandoned,sl,q->servicelevel, term);
+ if (s)
+ astman_append(s, "%-12.12s has %d calls (max %s) in '%s' strategy (%ds holdtime), W:%d, C:%d, A:%d, SL:%2.1f%% within %ds%s",
+ q->name, q->count, max_buf, int2strat(q->strategy), q->holdtime, q->weight, q->callscompleted, q->callsabandoned,sl,q->servicelevel, term);
+ else
+ ast_cli(fd, "%-12.12s has %d calls (max %s) in '%s' strategy (%ds holdtime), W:%d, C:%d, A:%d, SL:%2.1f%% within %ds%s",
+ q->name, q->count, max_buf, int2strat(q->strategy), q->holdtime, q->weight, q->callscompleted, q->callsabandoned,sl,q->servicelevel, term);
if (q->members) {
- ast_cli(fd, " Members: %s", term);
+ if (s)
+ astman_append(s, " Members: %s", term);
+ else
+ ast_cli(fd, " Members: %s", term);
for (mem = q->members; mem; mem = mem->next) {
max_buf[0] = '\0';
max = max_buf;
@@ -3429,19 +3443,37 @@
mem->calls, (long)(time(NULL) - mem->lastcall));
} else
ast_build_string(&max, &max_left, " has taken no calls yet");
- ast_cli(fd, " %s%s%s", mem->interface, max_buf, term);
- }
- } else
+ if (s)
+ astman_append(s, " %s%s%s", mem->interface, max_buf, term);
+ else
+ ast_cli(fd, " %s%s%s", mem->interface, max_buf, term);
+ }
+ } else if (s)
+ astman_append(s, " No Members%s", term);
+ else
ast_cli(fd, " No Members%s", term);
if (q->head) {
pos = 1;
- ast_cli(fd, " Callers: %s", term);
- for (qe = q->head; qe; qe = qe->next)
- ast_cli(fd, " %d. %s (wait: %ld:%2.2ld, prio: %d)%s", pos++, qe->chan->name,
- (long)(now - qe->start) / 60, (long)(now - qe->start) % 60, qe->prio, term);
- } else
+ if (s)
+ astman_append(s, " Callers: %s", term);
+ else
+ ast_cli(fd, " Callers: %s", term);
+ for (qe = q->head; qe; qe = qe->next) {
+ if (s)
+ astman_append(s, " %d. %s (wait: %ld:%2.2ld, prio: %d)%s", pos++, qe->chan->name,
+ (long)(now - qe->start) / 60, (long)(now - qe->start) % 60, qe->prio, term);
+ else
+ ast_cli(fd, " %d. %s (wait: %ld:%2.2ld, prio: %d)%s", pos++, qe->chan->name,
+ (long)(now - qe->start) / 60, (long)(now - qe->start) % 60, qe->prio, term);
+ }
+ } else if (s)
+ astman_append(s, " No Callers%s", term);
+ else
ast_cli(fd, " No Callers%s", term);
- ast_cli(fd, "%s", term);
+ if (s)
+ astman_append(s, "%s", term);
+ else
+ ast_cli(fd, "%s", term);
ast_mutex_unlock(&q->lock);
if (queue_show)
break;
@@ -3452,12 +3484,12 @@
static int queues_show(int fd, int argc, char **argv)
{
- return __queues_show(0, fd, argc, argv, 0);
+ return __queues_show(NULL, 0, fd, argc, argv, 0);
}
static int queue_show(int fd, int argc, char **argv)
{
- return __queues_show(0, fd, argc, argv, 1);
+ return __queues_show(NULL, 0, fd, argc, argv, 1);
}
static char *complete_queue(const char *line, const char *word, int pos, int state)
@@ -3485,8 +3517,8 @@
static int manager_queues_show( struct mansession *s, struct message *m )
{
char *a[] = { "show", "queues" };
- __queues_show(1, s->fd, 2, a, 0);
- ast_cli(s->fd, "\r\n\r\n"); /* Properly terminate Manager output */
+ __queues_show(s, 1, -1, 2, a, 0);
+ astman_append(s, "\r\n\r\n"); /* Properly terminate Manager output */
return RESULT_SUCCESS;
}
@@ -3518,7 +3550,7 @@
if (ast_strlen_zero(queuefilter) || !strcmp(q->name, queuefilter)) {
if(q->callscompleted > 0)
sl = 100*((float)q->callscompletedinsl/(float)q->callscompleted);
- ast_cli(s->fd, "Event: QueueParams\r\n"
+ astman_append(s, "Event: QueueParams\r\n"
"Queue: %s\r\n"
"Max: %d\r\n"
"Calls: %d\r\n"
@@ -3535,7 +3567,7 @@
/* List Queue Members */
for (mem = q->members; mem; mem = mem->next) {
if (ast_strlen_zero(memberfilter) || !strcmp(mem->interface, memberfilter)) {
- ast_cli(s->fd, "Event: QueueMember\r\n"
+ astman_append(s, "Event: QueueMember\r\n"
"Queue: %s\r\n"
"Location: %s\r\n"
"Membership: %s\r\n"
@@ -3553,7 +3585,7 @@
/* List Queue Entries */
pos = 1;
for (qe = q->head; qe; qe = qe->next) {
- ast_cli(s->fd, "Event: QueueEntry\r\n"
+ astman_append(s, "Event: QueueEntry\r\n"
"Queue: %s\r\n"
"Position: %d\r\n"
"Channel: %s\r\n"
@@ -3572,7 +3604,7 @@
}
AST_LIST_UNLOCK(&queues);
- ast_cli(s->fd,
+ astman_append(s,
"Event: QueueStatusComplete\r\n"
"%s"
"\r\n",idText);
Modified: team/oej/subscribemwi/apps/app_readfile.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_readfile.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_readfile.c (original)
+++ team/oej/subscribemwi/apps/app_readfile.c Mon Mar 27 21:57:33 2006
@@ -92,15 +92,16 @@
}
}
- returnvar = ast_read_textfile(file);
- if(len > 0){
- if(len < strlen(returnvar))
- returnvar[len]='\0';
- else
- ast_log(LOG_WARNING,"%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
+ if ((returnvar = ast_read_textfile(file))) {
+ if (len > 0) {
+ if (len < strlen(returnvar))
+ returnvar[len]='\0';
+ else
+ ast_log(LOG_WARNING, "%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
+ }
+ pbx_builtin_setvar_helper(chan, varname, returnvar);
+ free(returnvar);
}
- pbx_builtin_setvar_helper(chan, varname, returnvar);
- free(returnvar);
LOCAL_USER_REMOVE(u);
return res;
}
Modified: team/oej/subscribemwi/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_rpt.c?rev=15440&r1=15439&r2=15440&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_rpt.c (original)
+++ team/oej/subscribemwi/apps/app_rpt.c Mon Mar 27 21:57:33 2006
@@ -2010,7 +2010,7 @@
strncpy(mychannel->exten, myrpt->exten, sizeof(mychannel->exten) - 1);
strncpy(mychannel->context, myrpt->ourcontext, sizeof(mychannel->context) - 1);
if (myrpt->acctcode)
- strncpy(mychannel->accountcode, myrpt->acctcode, sizeof(mychannel->accountcode) - 1);
+ ast_string_field_set(mychannel, accountcode, myrpt->acctcode);
mychannel->priority = 1;
ast_channel_undefer_dtmf(mychannel);
if (ast_pbx_start(mychannel) < 0)
Modified: team/oej/subscribemwi/apps/app_stack.c
[... 11924 lines stripped ...]
More information about the asterisk-commits
mailing list