[asterisk-commits] russell: branch russell/chan_refcount r84686 - in /team/russell/chan_refcount...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Oct 4 14:15:13 CDT 2007
Author: russell
Date: Thu Oct 4 14:15:12 2007
New Revision: 84686
URL: http://svn.digium.com/view/asterisk?view=rev&rev=84686
Log:
resolve, reset
Added:
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/
- copied from r84671, trunk/pbx/ael/ael-test/ael-ntest22/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/extensions.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/extensions.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/qq.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/qq.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t1/
- copied from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t1/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t1/a.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t1/a.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t1/b.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t1/b.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t1/c.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t1/c.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t2/
- copied from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t2/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t2/d.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t2/d.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t2/e.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t2/e.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t2/f.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t2/f.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t3/
- copied from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t3/
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t3/g.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t3/g.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t3/h.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t3/h.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t3/i.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t3/i.ael
team/russell/chan_refcount/pbx/ael/ael-test/ael-ntest22/t3/j.ael
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ael-ntest22/t3/j.ael
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-ntest22
- copied unchanged from r84671, trunk/pbx/ael/ael-test/ref.ael-ntest22
Modified:
team/russell/chan_refcount/ (props changed)
team/russell/chan_refcount/Makefile
team/russell/chan_refcount/Makefile.rules
team/russell/chan_refcount/apps/app_dial.c
team/russell/chan_refcount/apps/app_meetme.c
team/russell/chan_refcount/apps/app_minivm.c
team/russell/chan_refcount/apps/app_queue.c
team/russell/chan_refcount/build_tools/prep_tarball
team/russell/chan_refcount/cdr/cdr_manager.c
team/russell/chan_refcount/channels/Makefile
team/russell/chan_refcount/channels/chan_agent.c
team/russell/chan_refcount/channels/chan_iax2.c
team/russell/chan_refcount/channels/chan_mgcp.c
team/russell/chan_refcount/channels/chan_misdn.c
team/russell/chan_refcount/channels/chan_sip.c
team/russell/chan_refcount/channels/chan_skinny.c
team/russell/chan_refcount/channels/iax2-parser.c
team/russell/chan_refcount/codecs/g722/Makefile
team/russell/chan_refcount/configs/musiconhold.conf.sample
team/russell/chan_refcount/configure
team/russell/chan_refcount/configure.ac
team/russell/chan_refcount/doc/tex/extensions.tex
team/russell/chan_refcount/funcs/func_lock.c
team/russell/chan_refcount/include/asterisk/channel.h
team/russell/chan_refcount/include/asterisk/lock.h
team/russell/chan_refcount/include/asterisk/module.h
team/russell/chan_refcount/include/asterisk/pbx.h
team/russell/chan_refcount/main/asterisk.c
team/russell/chan_refcount/main/channel.c
team/russell/chan_refcount/main/cli.c
team/russell/chan_refcount/main/dnsmgr.c
team/russell/chan_refcount/main/frame.c
team/russell/chan_refcount/main/pbx.c
team/russell/chan_refcount/main/rtp.c
team/russell/chan_refcount/main/say.c
team/russell/chan_refcount/main/translate.c
team/russell/chan_refcount/main/utils.c
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-ntest10
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test1
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test18
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test19
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test2
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test3
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test4
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test5
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-test8
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-vtest13
team/russell/chan_refcount/pbx/ael/ael-test/ref.ael-vtest17
team/russell/chan_refcount/pbx/dundi-parser.c
team/russell/chan_refcount/pbx/pbx_ael.c
team/russell/chan_refcount/res/Makefile
team/russell/chan_refcount/res/ael/ael.flex
team/russell/chan_refcount/res/ael/ael.tab.c
team/russell/chan_refcount/res/ael/ael.y
team/russell/chan_refcount/res/ael/ael_lex.c
team/russell/chan_refcount/res/ael/pval.c
team/russell/chan_refcount/res/res_agi.c
team/russell/chan_refcount/res/res_config_odbc.c
team/russell/chan_refcount/res/res_features.c
team/russell/chan_refcount/res/res_jabber.c
team/russell/chan_refcount/res/res_musiconhold.c
team/russell/chan_refcount/utils/check_expr.c
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
automerge = *
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Oct 4 14:15:12 2007
@@ -1,1 +1,1 @@
-/trunk:1-84001
+/trunk:1-84685
Modified: team/russell/chan_refcount/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/Makefile?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/Makefile (original)
+++ team/russell/chan_refcount/Makefile Thu Oct 4 14:15:12 2007
@@ -260,6 +260,7 @@
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
+SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
@@ -373,6 +374,9 @@
$(SUBDIRS_CLEAN):
@$(MAKE) --no-print-directory -C $(@:-clean=) clean
+$(SUBDIRS_DIST_CLEAN):
+ @$(MAKE) --no-print-directory -C $(@:-dist-clean=) dist-clean
+
clean: $(SUBDIRS_CLEAN)
rm -f defaults.h
rm -f include/asterisk/build.h
@@ -382,7 +386,7 @@
dist-clean: distclean
-distclean: clean
+distclean: $(SUBDIRS_DIST_CLEAN) clean
@$(MAKE) -C menuselect dist-clean
@$(MAKE) -C sounds dist-clean
rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
@@ -724,11 +728,11 @@
menuselect/gmenuselect: makeopts menuselect/menuselect.c menuselect/menuselect_gtk.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
@CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect _gmenuselect CONFIGURE_SILENT="--silent"
-menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
+menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml configure
@echo "Generating input for menuselect ..."
@build_tools/prep_moduledeps > $@
asterisk.pdf:
$(MAKE) -C doc/tex asterisk.pdf
-.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts
+.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) menuselect.makeopts
Modified: team/russell/chan_refcount/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/Makefile.rules?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/Makefile.rules (original)
+++ team/russell/chan_refcount/Makefile.rules Thu Oct 4 14:15:12 2007
@@ -16,6 +16,8 @@
# behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command.
-include $(ASTTOPDIR)/makeopts
+
+.PHONY: dist-clean
ifeq ($(NOISY_BUILD),)
ECHO_PREFIX=@
@@ -107,3 +109,5 @@
%: %.o
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $^ $(PTHREAD_LIBS) $(LIBS)
+
+dist-clean::
Modified: team/russell/chan_refcount/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_dial.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/apps/app_dial.c (original)
+++ team/russell/chan_refcount/apps/app_dial.c Thu Oct 4 14:15:12 2007
@@ -313,6 +313,10 @@
AST_APP_OPTION('W', OPT_CALLER_MONITOR),
});
+#define CAN_EARLY_BRIDGE(flags) (!ast_test_flag64(flags, OPT_CALLEE_HANGUP | \
+ OPT_CALLER_HANGUP | OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | \
+ OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK | OPT_CALLER_PARK))
+
/*
* The list of active channels
*/
@@ -660,8 +664,9 @@
DIAL_NOFORWARDHTML);
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
ast_copy_string(c->exten, "", sizeof(c->exten));
- /* Setup early bridge if appropriate */
- ast_channel_early_bridge(in, peer);
+ if (CAN_EARLY_BRIDGE(peerflags))
+ /* Setup early bridge if appropriate */
+ ast_channel_early_bridge(in, peer);
}
/* If call has been answered, then the eventual hangup is likely to be normal hangup */
in->hangupcause = AST_CAUSE_NORMAL_CLEARING;
@@ -686,7 +691,7 @@
case AST_CONTROL_RINGING:
ast_verb(3, "%s is ringing\n", c->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!(pa->sentringing) && !ast_test_flag64(outgoing, OPT_MUSICBACK)) {
ast_indicate(in, AST_CONTROL_RINGING);
@@ -696,7 +701,7 @@
case AST_CONTROL_PROGRESS:
ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROGRESS);
@@ -707,7 +712,7 @@
break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
Modified: team/russell/chan_refcount/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_meetme.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/apps/app_meetme.c (original)
+++ team/russell/chan_refcount/apps/app_meetme.c Thu Oct 4 14:15:12 2007
@@ -1477,7 +1477,7 @@
}
conf->recordingformat = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT");
if (!conf->recordingformat) {
- snprintf(recordingtmp, sizeof(recordingtmp), "wav");
+ ast_copy_string(recordingtmp, "wav", sizeof(recordingtmp));
conf->recordingformat = ast_strdupa(recordingtmp);
}
ast_verb(4, "Starting recording of MeetMe Conference %s into file %s.%s.\n",
Modified: team/russell/chan_refcount/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_minivm.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/apps/app_minivm.c (original)
+++ team/russell/chan_refcount/apps/app_minivm.c Thu Oct 4 14:15:12 2007
@@ -938,7 +938,7 @@
char tmpcmd[PATH_MAX];
int tmpfd;
- snprintf(newtmp, sizeof(newtmp), "/tmp/XXXXXX");
+ ast_copy_string(newtmp, "/tmp/XXXXXX", sizeof(newtmp));
ast_debug(3, "newtmp: %s\n", newtmp);
tmpfd = mkstemp(newtmp);
snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, filename, format, newtmp, format);
Modified: team/russell/chan_refcount/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_queue.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/apps/app_queue.c (original)
+++ team/russell/chan_refcount/apps/app_queue.c Thu Oct 4 14:15:12 2007
@@ -4824,7 +4824,7 @@
tmp = m->membername;
ao2_ref(m, -1);
queue_unref(q);
- return tmp;
+ return ast_strdup(tmp);
}
ao2_ref(m, -1);
}
Modified: team/russell/chan_refcount/build_tools/prep_tarball
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/build_tools/prep_tarball?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/build_tools/prep_tarball (original)
+++ team/russell/chan_refcount/build_tools/prep_tarball Thu Oct 4 14:15:12 2007
@@ -7,8 +7,6 @@
make -C sounds all MENUSELECT_CORE_SOUNDS=CORE-SOUNDS-EN-GSM MENUSELECT_MOH=MOH-FREEPLAY-WAV WGET=wget DOWNLOAD=wget
-make menuselect-tree
-
VERSION=`cat .version`
sed -i -e "s/ASTERISKVERSION/${VERSION}/" doc/tex/asterisk.tex
cd doc/tex && rubber --pdf asterisk.tex
Modified: team/russell/chan_refcount/cdr/cdr_manager.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/cdr/cdr_manager.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/cdr/cdr_manager.c (original)
+++ team/russell/chan_refcount/cdr/cdr_manager.c Thu Oct 4 14:15:12 2007
@@ -114,6 +114,7 @@
ast_cdr_unregister(name);
else if (!enablecdr && newenablecdr)
ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
+ enablecdr = newenablecdr;
return 1;
}
Modified: team/russell/chan_refcount/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/Makefile?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/Makefile (original)
+++ team/russell/chan_refcount/channels/Makefile Thu Oct 4 14:15:12 2007
@@ -80,6 +80,9 @@
$(CMD_PREFIX) exit 1
endif
+dist-clean::
+ rm -f h323/Makefile
+
gentone: gentone.c
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(HOST_CC) $(STATIC_BUILD) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $^ $(LIBS)
Modified: team/russell/chan_refcount/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_agent.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/chan_agent.c (original)
+++ team/russell/chan_refcount/channels/chan_agent.c Thu Oct 4 14:15:12 2007
@@ -231,6 +231,8 @@
static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge);
static void set_agentbycallerid(const char *callerid, const char *agent);
static char *complete_agent_logoff_cmd(const char *line, const char *word, int pos, int state);
+static struct ast_channel* agent_get_base_channel(struct ast_channel *chan);
+static int agent_set_base_channel(struct ast_channel *chan, struct ast_channel *base);
/*! \brief Channel interface description for PBX integration */
static const struct ast_channel_tech agent_tech = {
@@ -253,6 +255,8 @@
.indicate = agent_indicate,
.fixup = agent_fixup,
.bridged_channel = agent_bridgedchannel,
+ .get_base_channel = agent_get_base_channel,
+ .set_base_channel = agent_set_base_channel,
};
/*!
@@ -701,6 +705,40 @@
snprintf(buf, sizeof(buf), "%s_%s", GETAGENTBYCALLERID, callerid);
pbx_builtin_setvar_helper(NULL, buf, agent);
+}
+
+/*! \brief return the channel or base channel if one exists. This function assumes the channel it is called on is already locked */
+struct ast_channel* agent_get_base_channel(struct ast_channel *chan)
+{
+ struct agent_pvt *p = NULL;
+ struct ast_channel *base = chan;
+
+ /* chan is locked by the calling function */
+ if (!chan || !chan->tech_pvt) {
+ ast_log(LOG_ERROR, "whoa, you need a channel (0x%ld) with a tech_pvt (0x%ld) to get a base channel.\n", (long)chan, (chan)?(long)chan->tech_pvt:(long)NULL);
+ return NULL;
+ }
+ p = chan->tech_pvt;
+ if (p->chan)
+ base = p->chan;
+ return base;
+}
+
+int agent_set_base_channel(struct ast_channel *chan, struct ast_channel *base)
+{
+ struct agent_pvt *p = NULL;
+
+ if (!chan || !base) {
+ ast_log(LOG_ERROR, "whoa, you need a channel (0x%ld) and a base channel (0x%ld) for setting.\n", (long)chan, (long)base);
+ return -1;
+ }
+ p = chan->tech_pvt;
+ if (!p) {
+ ast_log(LOG_ERROR, "whoa, channel %s is missing his tech_pvt structure!!.\n", chan->name);
+ return -1;
+ }
+ p->chan = base;
+ return 0;
}
static int agent_hangup(struct ast_channel *ast)
Modified: team/russell/chan_refcount/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_iax2.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/chan_iax2.c (original)
+++ team/russell/chan_refcount/channels/chan_iax2.c Thu Oct 4 14:15:12 2007
@@ -5969,9 +5969,9 @@
else if (reg->messages > 1)
snprintf(msgstatus, sizeof(msgstatus), " with %d new messages waiting\n", reg->messages);
else if (reg->messages > 0)
- snprintf(msgstatus, sizeof(msgstatus), " with 1 new message waiting\n");
+ ast_copy_string(msgstatus, " with 1 new message waiting\n", sizeof(msgstatus));
else
- snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
+ ast_copy_string(msgstatus, " with no messages waiting\n", sizeof(msgstatus));
snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
ast_verb(3, "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
Modified: team/russell/chan_refcount/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_mgcp.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/chan_mgcp.c (original)
+++ team/russell/chan_refcount/channels/chan_mgcp.c Thu Oct 4 14:15:12 2007
@@ -882,7 +882,7 @@
ast_verb(3, "MGCP distinctive callwait %s\n", tone);
}
} else {
- snprintf(tone, sizeof(tone), "L/wt");
+ ast_copy_string(tone, "L/wt", sizeof(tone));
if (mgcpdebug) {
ast_verb(3, "MGCP normal callwait %s\n", tone);
}
@@ -896,7 +896,7 @@
ast_verb(3, "MGCP distinctive ring %s\n", tone);
}
} else {
- snprintf(tone, sizeof(tone), "L/rg");
+ ast_copy_string(tone, "L/rg", sizeof(tone));
if (mgcpdebug) {
ast_verb(3, "MGCP default ring\n");
}
@@ -1932,7 +1932,7 @@
}
if (!req->lines) {
/* Add extra empty return */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
+ ast_copy_string(req->data + req->len, "\r\n", sizeof(req->data) - req->len);
req->len += strlen(req->data + req->len);
}
req->line[req->lines] = req->data + req->len;
@@ -2065,11 +2065,11 @@
if (mgcpdebug) {
ast_verbose("We're at %s port %d\n", ast_inet_ntoa(p->parent->ourip), ntohs(sin.sin_port));
}
- snprintf(v, sizeof(v), "v=0\r\n");
+ ast_copy_string(v, "v=0\r\n", sizeof(v));
snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", (int)getpid(), (int)getpid(), ast_inet_ntoa(dest.sin_addr));
- snprintf(s, sizeof(s), "s=session\r\n");
+ ast_copy_string(s, "s=session\r\n", sizeof(s));
snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", ast_inet_ntoa(dest.sin_addr));
- snprintf(t, sizeof(t), "t=0 0\r\n");
+ ast_copy_string(t, "t=0 0\r\n", sizeof(t));
snprintf(m, sizeof(m), "m=audio %d RTP/AVP", ntohs(dest.sin_port));
for (x = 1; x <= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
@@ -2136,7 +2136,7 @@
ast_rtp_get_peer(rtp, &sub->tmpdest);
return 0;
}
- snprintf(local, sizeof(local), "p:20");
+ ast_copy_string(local, "p:20", sizeof(local));
for (x=1;x<= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
snprintf(tmp, sizeof(tmp), ", a:%s", ast_rtp_lookup_mime_subtype(1, x, 0));
@@ -2166,7 +2166,7 @@
int x;
struct mgcp_endpoint *p = sub->parent;
- snprintf(local, sizeof(local), "p:20");
+ ast_copy_string(local, "p:20", sizeof(local));
for (x=1;x<= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
snprintf(tmp, sizeof(tmp), ", a:%s", ast_rtp_lookup_mime_subtype(1, x, 0));
Modified: team/russell/chan_refcount/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_misdn.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/chan_misdn.c (original)
+++ team/russell/chan_refcount/channels/chan_misdn.c Thu Oct 4 14:15:12 2007
@@ -1679,7 +1679,7 @@
misdn_cfg_get(bc->port, MISDN_CFG_ECHOCANCEL, &ec, sizeof(ec));
if (ec == 1)
- snprintf(bc->pipeline, sizeof(bc->pipeline), "mg2ec");
+ ast_copy_string(bc->pipeline, "mg2ec", sizeof(bc->pipeline));
else if (ec > 1)
snprintf(bc->pipeline, sizeof(bc->pipeline), "mg2ec(deftaps=%d)", ec);
Modified: team/russell/chan_refcount/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_sip.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/chan_sip.c (original)
+++ team/russell/chan_refcount/channels/chan_sip.c Thu Oct 4 14:15:12 2007
@@ -2586,7 +2586,7 @@
{
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");
+ ast_copy_string(req->data + req->len, "\r\n", sizeof(req->data) - req->len);
req->len += strlen(req->data + req->len);
}
}
@@ -5858,7 +5858,7 @@
/* Note: should really look at the 'freq' and '#chans' params too */
/* Note: This should all be done in the context of the m= above */
- if (!strncasecmp(mimeSubtype, "H26",3)) { /* Video */
+ if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) { /* Video */
/* Not going to do anything here for the moment, but we will soon */
} else if (!strncasecmp(mimeSubtype, "T140",4)) { /* Text */
if (p->trtp) {
@@ -6177,7 +6177,7 @@
}
if (!req->lines) {
/* Add extra empty return */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
+ ast_copy_string(req->data + req->len, "\r\n", sizeof(req->data) - req->len);
req->len += strlen(req->data + req->len);
}
if (req->len >= sizeof(req->data) - 4) {
@@ -7739,7 +7739,7 @@
if (!ast_strlen_zero(p->refer->refer_to))
add_header(&req, "Refer-To", p->refer->refer_to);
if (!ast_strlen_zero(p->refer->referred_by)) {
- sprintf(buf, "%s <%s>", p->refer->referred_by_name, p->refer->referred_by);
+ snprintf(buf, sizeof(buf), "%s <%s>", p->refer->referred_by_name, p->refer->referred_by);
add_header(&req, "Referred-By", buf);
}
}
@@ -18921,7 +18921,7 @@
ast_verbose("Previous SIP reload not yet done\n");
else {
sip_reloading = TRUE;
- sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
+ sip_reloadreason = (a && a->fd) ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
}
ast_mutex_unlock(&sip_reload_lock);
restart_monitor();
Modified: team/russell/chan_refcount/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_skinny.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/chan_skinny.c (original)
+++ team/russell/chan_refcount/channels/chan_skinny.c Thu Oct 4 14:15:12 2007
@@ -4221,8 +4221,8 @@
return -1;
req->data.speeddialreq.speedDialNumber = htolel(instance);
- snprintf(req->data.speeddial.speedDialDirNumber, sizeof(req->data.speeddial.speedDialDirNumber), sd->exten);
- snprintf(req->data.speeddial.speedDialDisplayName, sizeof(req->data.speeddial.speedDialDisplayName), sd->label);
+ ast_copy_string(req->data.speeddial.speedDialDirNumber, sd->exten, sizeof(req->data.speeddial.speedDialDirNumber));
+ ast_copy_string(req->data.speeddial.speedDialDisplayName, sd->label, sizeof(req->data.speeddial.speedDialDisplayName));
transmit_response(s, req);
return 1;
@@ -4442,7 +4442,7 @@
if (!(req = req_alloc(sizeof(struct version_res_message), VERSION_RES_MESSAGE)))
return -1;
- snprintf(req->data.version.version, sizeof(req->data.version.version), d->version_id);
+ ast_copy_string(req->data.version.version, d->version_id, sizeof(req->data.version.version));
transmit_response(s, req);
return 1;
}
Modified: team/russell/chan_refcount/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/iax2-parser.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/channels/iax2-parser.c (original)
+++ team/russell/chan_refcount/channels/iax2-parser.c Thu Oct 4 14:15:12 2007
@@ -82,7 +82,7 @@
memcpy(&sin, value, len);
snprintf(output, maxlen, "IPV4 %s:%d", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
} else {
- snprintf(output, maxlen, "Invalid Address");
+ ast_copy_string(output, "Invalid Address", maxlen);
}
}
Modified: team/russell/chan_refcount/codecs/g722/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/g722/Makefile?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/codecs/g722/Makefile (original)
+++ team/russell/chan_refcount/codecs/g722/Makefile Thu Oct 4 14:15:12 2007
@@ -14,3 +14,4 @@
clean:
rm -f $(LIB) *.o
+ rm -f .*.o.d
Modified: team/russell/chan_refcount/configs/musiconhold.conf.sample
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/configs/musiconhold.conf.sample?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/configs/musiconhold.conf.sample (original)
+++ team/russell/chan_refcount/configs/musiconhold.conf.sample Thu Oct 4 14:15:12 2007
@@ -39,11 +39,16 @@
;[native-random]
;mode=files
;directory=/var/lib/asterisk/moh
-;random=yes ; Play the files in a random order
;digit=# ; If this option is set for a class, then when callers are
; ; listening to music on hold, they can press this digit, and
; ; they will switch to listening to this music class.
+;sort=random ; Sort the files in random order
+;[native-alphabetical]
+;mode=files
+;directory=/var/lib/asterisk/moh
+;sort=alpha ; Sort the files in alphabetical order. If this option is
+; ; not specified, the sort order is undefined.
; =========
; Other (non-native) playback methods
Modified: team/russell/chan_refcount/configure
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/configure?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/configure (original)
+++ team/russell/chan_refcount/configure Thu Oct 4 14:15:12 2007
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 83431 .
+# From configure.ac Revision: 83517 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61.
#
Modified: team/russell/chan_refcount/configure.ac
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/configure.ac?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/configure.ac (original)
+++ team/russell/chan_refcount/configure.ac Thu Oct 4 14:15:12 2007
@@ -6,7 +6,7 @@
# this file just have to remember to set the AC_PREREQ argument
# to something that suits their needs.
-AC_PREREQ(2.59)
+AC_PREREQ(2.60)
m4_define([PBX_VERSION],
m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
Modified: team/russell/chan_refcount/doc/tex/extensions.tex
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/doc/tex/extensions.tex?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/doc/tex/extensions.tex (original)
+++ team/russell/chan_refcount/doc/tex/extensions.tex Thu Oct 4 14:15:12 2007
@@ -66,6 +66,14 @@
timeout is reached. See "show function TIMEOUT" for more
information on setting timeouts.
\end{itemize}
+ \item e
+ \begin{itemize}
+ \item This extension will substitute as a catchall for any of the
+ 'i', 't', or 'T' extensions, if any of them do not exist and
+ catching the error in a single routine is desired. The
+ function EXCEPTION may be used to query the type of exception
+ or the location where it occurred.
+ \end{itemize}
\end{itemize}
And finally, the extension context "default" is used when either a) an
Modified: team/russell/chan_refcount/funcs/func_lock.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/funcs/func_lock.c?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/funcs/func_lock.c (original)
+++ team/russell/chan_refcount/funcs/func_lock.c Thu Oct 4 14:15:12 2007
@@ -187,11 +187,12 @@
/* Okay, we have both frames, so now we need to try to lock the mutex. */
if (count_channel_locks > 1) {
- /* If we fail after a certain number of attempts, assume a possible deadlock and bail. */
- int x;
- for (x = 0; x < 30; x++) {
+ struct timeval start = ast_tvnow();
+ for (;;) {
if ((res = ast_mutex_trylock(¤t->mutex)) == 0)
break;
+ if (ast_tvdiff_ms(ast_tvnow(), start) > 3000)
+ break; /* bail after 3 seconds of waiting */
usleep(1);
}
} else {
@@ -256,13 +257,19 @@
static int lock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
+ ast_autoservice_start(chan);
ast_copy_string(buf, get_lock(chan, data, 0) ? "0" : "1", len);
+ ast_autoservice_stop(chan);
+
return 0;
}
static int trylock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
+ ast_autoservice_start(chan);
ast_copy_string(buf, get_lock(chan, data, 1) ? "0" : "1", len);
+ ast_autoservice_stop(chan);
+
return 0;
}
Modified: team/russell/chan_refcount/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/include/asterisk/channel.h?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/include/asterisk/channel.h (original)
+++ team/russell/chan_refcount/include/asterisk/channel.h Thu Oct 4 14:15:12 2007
@@ -316,6 +316,12 @@
/*! \brief Provide additional write items for CHANNEL() dialplan function */
int (* func_channel_write)(struct ast_channel *chan, const char *function, char *data, const char *value);
+
+ /*! \brief Retrieve base channel (agent and local) */
+ struct ast_channel* (* get_base_channel)(struct ast_channel *chan);
+
+ /*! \brief Set base channel (agent and local) */
+ int (* set_base_channel)(struct ast_channel *chan, struct ast_channel *base);
};
struct ast_epoll_data;
Modified: team/russell/chan_refcount/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/include/asterisk/lock.h?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/include/asterisk/lock.h (original)
+++ team/russell/chan_refcount/include/asterisk/lock.h Thu Oct 4 14:15:12 2007
@@ -126,6 +126,12 @@
static pthread_mutex_t empty_mutex;
+enum ast_lock_type {
+ AST_MUTEX,
+ AST_RDLOCK,
+ AST_WRLOCK,
+};
+
/*!
* \brief Store lock info for the current thread
*
@@ -134,8 +140,8 @@
* lock info struct. The lock is marked as pending as the thread is waiting
* on the lock. ast_mark_lock_acquired() will mark it as held by this thread.
*/
-void ast_store_lock_info(const char *filename, int line_num,
- const char *func, const char *lock_name, void *lock_addr);
+void ast_store_lock_info(enum ast_lock_type type, const char *filename,
+ int line_num, const char *func, const char *lock_name, void *lock_addr);
/*!
* \brief Mark the last lock as acquired
@@ -249,7 +255,7 @@
int canlog = strcmp(filename, "logger.c");
if (t->track)
- ast_store_lock_info(filename, lineno, func, mutex_name, &t->mutex);
+ ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, &t->mutex);
#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
@@ -333,7 +339,7 @@
#endif /* AST_MUTEX_INIT_W_CONSTRUCTORS */
if (t->track)
- ast_store_lock_info(filename, lineno, func, mutex_name, &t->mutex);
+ ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, &t->mutex);
if (!(res = pthread_mutex_trylock(&t->mutex))) {
if (t->track)
@@ -469,7 +475,7 @@
DO_THREAD_CRASH;
} else {
if (t->track)
- ast_store_lock_info(filename, lineno, func, mutex_name, &t->mutex);
+ ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, &t->mutex);
if (t->reentrancy < AST_MAX_REENTRANCY) {
t->file[t->reentrancy] = filename;
@@ -530,7 +536,7 @@
DO_THREAD_CRASH;
} else {
if (t->track)
- ast_store_lock_info(filename, lineno, func, mutex_name, &t->mutex);
+ ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, &t->mutex);
if (t->reentrancy < AST_MAX_REENTRANCY) {
t->file[t->reentrancy] = filename;
@@ -702,6 +708,85 @@
return pthread_rwlock_destroy(prwlock);
}
+#ifdef DEBUG_THREADS
+#define ast_rwlock_unlock(a) \
+ _ast_rwlock_unlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_unlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ res = pthread_rwlock_unlock(lock);
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_rdlock(a) \
+ _ast_rwlock_rdlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_rdlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(AST_RDLOCK, file, line, func, name, lock);
+ res = pthread_rwlock_rdlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_wrlock(a) \
+ _ast_rwlock_wrlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_wrlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(AST_WRLOCK, file, line, func, name, lock);
+ res = pthread_rwlock_wrlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_tryrdlock(a) \
+ _ast_rwlock_tryrdlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_tryrdlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(AST_RDLOCK, file, line, func, name, lock);
+ res = pthread_rwlock_tryrdlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_trywrlock(a) \
+ _ast_rwlock_trywrlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_trywrlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(AST_WRLOCK, file, line, func, name, lock);
+ res = pthread_rwlock_trywrlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#else
+
static inline int ast_rwlock_unlock(ast_rwlock_t *prwlock)
{
return pthread_rwlock_unlock(prwlock);
@@ -726,6 +811,7 @@
{
return pthread_rwlock_trywrlock(prwlock);
}
+#endif /* DEBUG_THREADS */
/* Statically declared read/write locks */
Modified: team/russell/chan_refcount/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/include/asterisk/module.h?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/include/asterisk/module.h (original)
+++ team/russell/chan_refcount/include/asterisk/module.h Thu Oct 4 14:15:12 2007
@@ -237,8 +237,8 @@
static struct ast_module_info __mod_info = { \
NULL, \
load_func, \
+ reload_func, \
unload_func, \
- reload_func, \
AST_MODULE, \
desc, \
keystr, \
Modified: team/russell/chan_refcount/include/asterisk/pbx.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/include/asterisk/pbx.h?view=diff&rev=84686&r1=84685&r2=84686
==============================================================================
--- team/russell/chan_refcount/include/asterisk/pbx.h (original)
[... 5281 lines stripped ...]
More information about the asterisk-commits
mailing list