[asterisk-commits] simon.perreault: branch group/v6 r84403 - in /team/group/v6/trunk: ./ apps/ c...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Oct 2 10:06:49 CDT 2007
Author: simon.perreault
Date: Tue Oct 2 10:06:48 2007
New Revision: 84403
URL: http://svn.digium.com/view/asterisk?view=rev&rev=84403
Log:
Merged revisions 84159,84161-84162,84164-84165,84167-84169,84171-84174,84176,84207,84237,84272,84275,84300,84327,84329-84331,84368,84371 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r84159 | file | 2007-10-01 09:53:09 -0400 (Mon, 01 Oct 2007) | 12 lines
Merged revisions 84158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84158 | file | 2007-10-01 10:49:36 -0300 (Mon, 01 Oct 2007) | 4 lines
Only attempt early bridging if the options given to Dial() permit it.
(closes issue #10861)
Reported by: peekyb
........
................
r84161 | file | 2007-10-01 09:59:13 -0400 (Mon, 01 Oct 2007) | 14 lines
Merged revisions 84160 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84160 | file | 2007-10-01 10:57:42 -0300 (Mon, 01 Oct 2007) | 6 lines
Fix randomness. save_pos was being set to 0 initially instead of -1, causing it to jump to position 0 when moh started.
(closes issue #10859)
Reported by: jamesgolovich
Patches:
asterisk-mohpos2.diff.txt uploaded by jamesgolovich (license 176)
........
................
r84162 | file | 2007-10-01 10:02:26 -0400 (Mon, 01 Oct 2007) | 6 lines
Don't register the dnsmgr refresh CLI command twice.
(closes issue #10856)
Reported by: jamesgolovich
Patches:
asterisk-dnsmgrclireg.diff.txt uploaded by jamesgolovich (license 176)
................
r84164 | file | 2007-10-01 10:12:05 -0400 (Mon, 01 Oct 2007) | 11 lines
Blocked revisions 84163 via svnmerge
........
r84163 | file | 2007-10-01 11:10:47 -0300 (Mon, 01 Oct 2007) | 4 lines
Remove chan_usbradio config file from tree, it is not present in here.
(closes issue #10839)
Reported by: casper
........
................
r84165 | file | 2007-10-01 10:21:06 -0400 (Mon, 01 Oct 2007) | 6 lines
Add MP4 to part of the SDP code.
(closes issue #10820)
Reported by: ruikubo
Patches:
chan_sip.patch uploaded by ruikubo (license 250)
................
r84167 | russell | 2007-10-01 10:27:02 -0400 (Mon, 01 Oct 2007) | 10 lines
Merged revisions 84166 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84166 | russell | 2007-10-01 09:24:49 -0500 (Mon, 01 Oct 2007) | 2 lines
Simplify the CAN_EARLY_BRIDGE macro a bit.
........
................
r84168 | russell | 2007-10-01 10:43:56 -0400 (Mon, 01 Oct 2007) | 8 lines
Add a new option for files-based music on hold to ensure that the sort order
of the files is alphabetical.
(closes issue #10855)
Reported by: jamesgolovich
Patches:
asterisk-mohsortalpha.diff.txt uploaded by jamesgolovich (license 176)
................
r84169 | russell | 2007-10-01 10:55:10 -0400 (Mon, 01 Oct 2007) | 7 lines
Don't set the full command string until after verifying that there is not
another CLI command with the same command text registered. This prevents
a crash if someone accidentally calls ast_cli_register() on the same CLI
command data twice. This also fixes a small bug where the helpers list
would get unlocked without being locked if building the full command failed.
(closes issue #10858, reported by jamesgolovich, patched by me)
................
r84171 | russell | 2007-10-01 11:06:14 -0400 (Mon, 01 Oct 2007) | 14 lines
The trunk version of this patch also includes a couple more small clean fixes
from IgorG.
Merged revisions 84170 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84170 | russell | 2007-10-01 10:00:56 -0500 (Mon, 01 Oct 2007) | 3 lines
Remove another file in "make clean".
(closes issue #10814, paravoid)
........
................
r84172 | russell | 2007-10-01 11:17:15 -0400 (Mon, 01 Oct 2007) | 7 lines
Simplify code by using the -= and %= operators.
(closes issue #10848)
Reported by: opticron
Patches:
saymod.diff uploaded by opticron (license 267)
................
r84173 | russell | 2007-10-01 11:23:19 -0400 (Mon, 01 Oct 2007) | 8 lines
Corydon posted this janitor project to the bug tracker and mvanbaak provided
a patch for it. It replaces a bunch of simple calls to snprintf with ast_copy_string
(closes issue #10843)
Reported by: Corydon76
Patches:
2007092900_10843.diff uploaded by mvanbaak (license 7)
................
r84174 | russell | 2007-10-01 11:34:34 -0400 (Mon, 01 Oct 2007) | 4 lines
Change simple uses of snprintf to ast_copy_string. This was provided by
mvanbaak as a part of issue #10843, but this part didn't apply because of
a patch I applied right beforehand.
................
r84176 | file | 2007-10-01 11:57:04 -0400 (Mon, 01 Oct 2007) | 6 lines
Check to make sure a structure pointer is non-NULL before touching it... crashing is bad, mmmk?
(closes issue #10831)
Reported by: eliel
Patches:
chan_sip.c.patch uploaded by eliel (license 64)
................
r84207 | russell | 2007-10-01 15:40:21 -0400 (Mon, 01 Oct 2007) | 10 lines
Merged revisions 84206 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84206 | russell | 2007-10-01 14:34:12 -0500 (Mon, 01 Oct 2007) | 2 lines
Show rwlocks in the "core show locks" output. Before, it only showed mutexes.
........
................
r84237 | russell | 2007-10-01 15:58:29 -0400 (Mon, 01 Oct 2007) | 13 lines
Merged revisions 84236 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84236 | russell | 2007-10-01 14:56:28 -0500 (Mon, 01 Oct 2007) | 5 lines
Add another sanity check in the AGI read loop. We really don't care about
EAGAIN unless we didn't read an entire line. If there is a newline at the
end if the read buffer, break, because we got the whole thing.
(reported and patched by bmd)
........
................
r84272 | russell | 2007-10-01 17:15:57 -0400 (Mon, 01 Oct 2007) | 12 lines
Merged revisions 84271 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84271 | russell | 2007-10-01 16:07:06 -0500 (Mon, 01 Oct 2007) | 4 lines
Fulfull a feature request from Qwell on the "core show locks" output. It will
now note the lock type for each lock that a thread holds.
(mutex, rdlock, or wrlock)
........
................
r84275 | dhubbard | 2007-10-01 17:31:16 -0400 (Mon, 01 Oct 2007) | 9 lines
Merged revisions 84274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84274 | dhubbard | 2007-10-01 16:25:37 -0500 (Mon, 01 Oct 2007) | 1 line
moved get_base_channel() code from action_redirect to ast_channel_masquerade() for issue 7706 and BE-160
........
................
r84300 | qwell | 2007-10-01 17:54:41 -0400 (Mon, 01 Oct 2007) | 14 lines
Merged revisions 84291 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84291 | qwell | 2007-10-01 16:52:45 -0500 (Mon, 01 Oct 2007) | 6 lines
Add dist-clean support for subdirs.
Change h323 to only remove the Makefile on a dist-clean, rather than a clean.
This fixes a bug I found with trying to run make after a make clean
........
................
r84327 | murf | 2007-10-01 19:03:50 -0400 (Mon, 01 Oct 2007) | 9 lines
Merged revisions 84239 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84239 | murf | 2007-10-01 14:27:52 -0600 (Mon, 01 Oct 2007) | 1 line
closes issue #10777 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree.
........
................
r84329 | murf | 2007-10-01 19:20:20 -0400 (Mon, 01 Oct 2007) | 1 line
This mod will allow check_expr to compile in the presence of DEBUG_THREAD situations. At least, it does for me. And it's less expensive than several other approaches I tried.
................
r84330 | murf | 2007-10-01 19:26:50 -0400 (Mon, 01 Oct 2007) | 1 line
picky gcc versions... sigh.
................
r84331 | murf | 2007-10-01 19:33:07 -0400 (Mon, 01 Oct 2007) | 1 line
OK. THis a DEBUG_THREADS situation.
................
r84368 | file | 2007-10-02 09:58:19 -0400 (Tue, 02 Oct 2007) | 4 lines
Don't swap channel priority if using epoll as polling should/will only happen off the first channel.
(closes issue #10867)
Reported by: phsultan
................
r84371 | russell | 2007-10-02 10:13:28 -0400 (Tue, 02 Oct 2007) | 14 lines
Merged revisions 84370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r84370 | russell | 2007-10-02 09:12:35 -0500 (Tue, 02 Oct 2007) | 6 lines
Use snprintf instead of sprintf in one place. There is no vulnerability here
due to various buffer sizes around the code, but I still didn't like seeing a
non length-limited copy of data coming off of the wire into a stack buffer, as
this would be a problem in the future if buffer sizes elsewhere got changed or
size limitations removed ...
........
................
Modified:
team/group/v6/trunk/ (props changed)
team/group/v6/trunk/Makefile
team/group/v6/trunk/Makefile.rules
team/group/v6/trunk/apps/app_dial.c
team/group/v6/trunk/apps/app_meetme.c
team/group/v6/trunk/apps/app_minivm.c
team/group/v6/trunk/channels/Makefile
team/group/v6/trunk/channels/chan_agent.c
team/group/v6/trunk/channels/chan_iax2.c
team/group/v6/trunk/channels/chan_mgcp.c
team/group/v6/trunk/channels/chan_misdn.c
team/group/v6/trunk/channels/chan_sip.c
team/group/v6/trunk/channels/chan_skinny.c
team/group/v6/trunk/channels/iax2-parser.c
team/group/v6/trunk/codecs/g722/Makefile
team/group/v6/trunk/configs/musiconhold.conf.sample
team/group/v6/trunk/include/asterisk/lock.h
team/group/v6/trunk/main/asterisk.c
team/group/v6/trunk/main/channel.c
team/group/v6/trunk/main/cli.c
team/group/v6/trunk/main/dnsmgr.c
team/group/v6/trunk/main/frame.c
team/group/v6/trunk/main/manager.c
team/group/v6/trunk/main/rtp.c
team/group/v6/trunk/main/say.c
team/group/v6/trunk/main/utils.c
team/group/v6/trunk/pbx/dundi-parser.c
team/group/v6/trunk/pbx/pbx_ael.c
team/group/v6/trunk/res/Makefile
team/group/v6/trunk/res/ael/ael.tab.c
team/group/v6/trunk/res/ael/ael.y
team/group/v6/trunk/res/ael/pval.c
team/group/v6/trunk/res/res_agi.c
team/group/v6/trunk/res/res_config_odbc.c
team/group/v6/trunk/res/res_musiconhold.c
team/group/v6/trunk/utils/check_expr.c
Propchange: team/group/v6/trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/group/v6/trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/group/v6/trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Oct 2 10:06:48 2007
@@ -1,1 +1,1 @@
-/trunk:1-84153
+/trunk:1-84402
Modified: team/group/v6/trunk/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/Makefile?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/Makefile (original)
+++ team/group/v6/trunk/Makefile Tue Oct 2 10:06:48 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
@@ -731,4 +735,4 @@
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/group/v6/trunk/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/Makefile.rules?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/Makefile.rules (original)
+++ team/group/v6/trunk/Makefile.rules Tue Oct 2 10:06:48 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/group/v6/trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/apps/app_dial.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/apps/app_dial.c (original)
+++ team/group/v6/trunk/apps/app_dial.c Tue Oct 2 10:06:48 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/group/v6/trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/apps/app_meetme.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/apps/app_meetme.c (original)
+++ team/group/v6/trunk/apps/app_meetme.c Tue Oct 2 10:06:48 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/group/v6/trunk/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/apps/app_minivm.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/apps/app_minivm.c (original)
+++ team/group/v6/trunk/apps/app_minivm.c Tue Oct 2 10:06:48 2007
@@ -934,7 +934,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/group/v6/trunk/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/Makefile?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/Makefile (original)
+++ team/group/v6/trunk/channels/Makefile Tue Oct 2 10:06:48 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/group/v6/trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_agent.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/chan_agent.c (original)
+++ team/group/v6/trunk/channels/chan_agent.c Tue Oct 2 10:06:48 2007
@@ -702,17 +702,20 @@
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 = 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);
- } else {
- p = chan->tech_pvt;
+ return NULL;
+ }
+ p = chan->tech_pvt;
+ if (p->chan)
base = p->chan;
- }
return base;
}
Modified: team/group/v6/trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_iax2.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/chan_iax2.c (original)
+++ team/group/v6/trunk/channels/chan_iax2.c Tue Oct 2 10:06:48 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/group/v6/trunk/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_mgcp.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/chan_mgcp.c (original)
+++ team/group/v6/trunk/channels/chan_mgcp.c Tue Oct 2 10:06:48 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;
@@ -2066,11 +2066,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) {
@@ -2138,7 +2138,7 @@
ast_rtp_get_peer(rtp, (struct sockaddr*)&sub->tmpdest, &dummy);
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));
@@ -2168,7 +2168,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/group/v6/trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_misdn.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/chan_misdn.c (original)
+++ team/group/v6/trunk/channels/chan_misdn.c Tue Oct 2 10:06:48 2007
@@ -1701,7 +1701,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/group/v6/trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_sip.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/chan_sip.c (original)
+++ team/group/v6/trunk/channels/chan_sip.c Tue Oct 2 10:06:48 2007
@@ -2630,7 +2630,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);
}
}
@@ -5999,7 +5999,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) {
@@ -6328,7 +6328,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) {
@@ -7965,7 +7965,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);
}
}
@@ -19268,7 +19268,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/group/v6/trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_skinny.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/chan_skinny.c (original)
+++ team/group/v6/trunk/channels/chan_skinny.c Tue Oct 2 10:06:48 2007
@@ -4222,8 +4222,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;
@@ -4443,7 +4443,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/group/v6/trunk/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/iax2-parser.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/channels/iax2-parser.c (original)
+++ team/group/v6/trunk/channels/iax2-parser.c Tue Oct 2 10:06:48 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/group/v6/trunk/codecs/g722/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/codecs/g722/Makefile?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/codecs/g722/Makefile (original)
+++ team/group/v6/trunk/codecs/g722/Makefile Tue Oct 2 10:06:48 2007
@@ -14,3 +14,4 @@
clean:
rm -f $(LIB) *.o
+ rm -f .*.o.d
Modified: team/group/v6/trunk/configs/musiconhold.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/configs/musiconhold.conf.sample?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/configs/musiconhold.conf.sample (original)
+++ team/group/v6/trunk/configs/musiconhold.conf.sample Tue Oct 2 10:06:48 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/group/v6/trunk/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/include/asterisk/lock.h?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/include/asterisk/lock.h (original)
+++ team/group/v6/trunk/include/asterisk/lock.h Tue Oct 2 10:06:48 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/group/v6/trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/asterisk.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/main/asterisk.c (original)
+++ team/group/v6/trunk/main/asterisk.c Tue Oct 2 10:06:48 2007
@@ -1880,7 +1880,7 @@
} else if (remotehostname)
snprintf(prompt, sizeof(prompt), ASTERISK_PROMPT2, remotehostname);
else
- snprintf(prompt, sizeof(prompt), ASTERISK_PROMPT);
+ ast_copy_string(prompt, ASTERISK_PROMPT, sizeof(prompt));
return(prompt);
}
@@ -2206,7 +2206,7 @@
snprintf(tmp, sizeof(tmp), "core set debug atleast %d", option_debug);
fdprint(ast_consock, tmp);
if (ast_opt_mute) {
- snprintf(tmp, sizeof(tmp), "log and verbose output currently muted ('logger unmute' to unmute)");
+ ast_copy_string(tmp, "log and verbose output currently muted ('logger unmute' to unmute)", sizeof(tmp));
fdprint(ast_consock, tmp);
}
ast_verbose("Connected to Asterisk %s currently running on %s (pid = %d)\n", version, hostname, pid);
Modified: team/group/v6/trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/channel.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/main/channel.c (original)
+++ team/group/v6/trunk/main/channel.c Tue Oct 2 10:06:48 2007
@@ -3333,7 +3333,7 @@
int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone)
{
int res = -1;
- struct ast_channel *final_orig, *final_clone;
+ struct ast_channel *final_orig, *final_clone, *base;
retrymasq:
final_orig = original;
@@ -3353,6 +3353,10 @@
if (clone->_bridge && (clone->_bridge != ast_bridged_channel(clone)) && (clone->_bridge->_bridge != clone))
final_clone = clone->_bridge;
+
+ if (final_clone->tech->get_base_channel && (base = final_clone->tech->get_base_channel(final_clone))) {
+ final_clone = base;
+ }
if ((final_orig != original) || (final_clone != clone)) {
/* Lots and lots of deadlock avoidance. The main one we're competing with
Modified: team/group/v6/trunk/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/cli.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/main/cli.c (original)
+++ team/group/v6/trunk/main/cli.c Tue Oct 2 10:06:48 2007
@@ -1407,16 +1407,14 @@
}
*dst++ = NULL;
}
- if (set_full_cmd(e))
- goto done;
AST_RWLIST_WRLOCK(&helpers);
if (find_cli(e->cmda, 1)) {
ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", e->_full_cmd);
- ast_free(e->_full_cmd);
- e->_full_cmd = NULL;
goto done;
}
+ if (set_full_cmd(e))
+ goto done;
if (!ed) {
e->deprecated = 0;
} else {
Modified: team/group/v6/trunk/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/dnsmgr.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/main/dnsmgr.c (original)
+++ team/group/v6/trunk/main/dnsmgr.c Tue Oct 2 10:06:48 2007
@@ -408,7 +408,6 @@
if (ast_pthread_create_background(&refresh_thread, NULL, do_refresh, NULL) < 0) {
ast_log(LOG_ERROR, "Unable to start refresh thread.\n");
}
- ast_cli_register(&cli_refresh);
}
/* make a background refresh happen right away */
refresh_sched = ast_sched_add_variable(sched, 100, refresh_list, &master_refresh_info, 1);
Modified: team/group/v6/trunk/main/frame.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/frame.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/main/frame.c (original)
+++ team/group/v6/trunk/main/frame.c Tue Oct 2 10:06:48 2007
@@ -555,7 +555,7 @@
}
}
if (start == end)
- snprintf(start, size, "nothing)");
+ ast_copy_string(start, "nothing)", size);
else if (size > 1)
*(end -1) = ')';
return buf;
Modified: team/group/v6/trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/manager.c?view=diff&rev=84403&r1=84402&r2=84403
==============================================================================
--- team/group/v6/trunk/main/manager.c (original)
+++ team/group/v6/trunk/main/manager.c Tue Oct 2 10:06:48 2007
@@ -1787,7 +1787,7 @@
const char *exten = astman_get_header(m, "Exten");
const char *context = astman_get_header(m, "Context");
const char *priority = astman_get_header(m, "Priority");
- struct ast_channel *base, *chan, *chan2 = NULL;
+ struct ast_channel *chan, *chan2 = NULL;
int pi = 0;
int res;
@@ -1809,14 +1809,6 @@
astman_send_error(s, m, buf);
return 0;
}
- if (chan->tech->get_base_channel) {
- base = chan->tech->get_base_channel(chan);
- if (base) {
- ast_mutex_unlock(&chan->lock);
- chan = base;
- ast_mutex_lock(&chan->lock);
- }
- }
if (ast_check_hangup(chan)) {
astman_send_error(s, m, "Redirect failed, channel not up.\n");
ast_channel_unlock(chan);
@@ -1829,14 +1821,6 @@
ast_channel_unlock(chan);
ast_channel_unlock(chan2);
return 0;
- }
- if (chan2 && chan2->tech->get_base_channel) {
- base = chan2->tech->get_base_channel(chan2);
- if (base) {
- ast_mutex_unlock(&chan2->lock);
- chan2 = base;
[... 1934 lines stripped ...]
More information about the asterisk-commits
mailing list