[asterisk-commits] juggie: branch juggie/NoLossCDR r84328 - in /team/juggie/NoLossCDR: ./ apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 1 18:14:28 CDT 2007


Author: juggie
Date: Mon Oct  1 18:14:27 2007
New Revision: 84328

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84328
Log:
Merged revisions 84185,84216,84251,84284,84315 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/CDRfix5

........
r84185 | root | 2007-10-01 12:51:39 -0400 (Mon, 01 Oct 2007) | 1 line

automerge commit
........
r84216 | root | 2007-10-01 15:51:15 -0400 (Mon, 01 Oct 2007) | 1 line

automerge commit
........
r84251 | root | 2007-10-01 16:51:13 -0400 (Mon, 01 Oct 2007) | 1 line

automerge commit
........
r84284 | root | 2007-10-01 17:51:13 -0400 (Mon, 01 Oct 2007) | 1 line

automerge commit
........
r84315 | root | 2007-10-01 17:57:57 -0400 (Mon, 01 Oct 2007) | 1 line

automerge commit
........

Added:
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/
      - copied from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/extensions.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/extensions.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/qq.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/qq.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t1/
      - copied from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t1/
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t1/a.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t1/a.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t1/b.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t1/b.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t1/c.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t1/c.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t2/
      - copied from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t2/
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t2/d.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t2/d.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t2/e.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t2/e.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t2/f.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t2/f.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t3/
      - copied from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t3/
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t3/g.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t3/g.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t3/h.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t3/h.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t3/i.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t3/i.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ael-ntest22/t3/j.ael
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ael-ntest22/t3/j.ael
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-ntest22
      - copied unchanged from r84315, team/group/CDRfix5/pbx/ael/ael-test/ref.ael-ntest22
Modified:
    team/juggie/NoLossCDR/   (props changed)
    team/juggie/NoLossCDR/Makefile
    team/juggie/NoLossCDR/Makefile.rules
    team/juggie/NoLossCDR/apps/app_dial.c
    team/juggie/NoLossCDR/apps/app_meetme.c
    team/juggie/NoLossCDR/apps/app_minivm.c
    team/juggie/NoLossCDR/cdr/cdr_manager.c
    team/juggie/NoLossCDR/channels/Makefile
    team/juggie/NoLossCDR/channels/chan_agent.c
    team/juggie/NoLossCDR/channels/chan_iax2.c
    team/juggie/NoLossCDR/channels/chan_mgcp.c
    team/juggie/NoLossCDR/channels/chan_misdn.c
    team/juggie/NoLossCDR/channels/chan_sip.c
    team/juggie/NoLossCDR/channels/chan_skinny.c
    team/juggie/NoLossCDR/channels/iax2-parser.c
    team/juggie/NoLossCDR/codecs/g722/Makefile
    team/juggie/NoLossCDR/configs/musiconhold.conf.sample
    team/juggie/NoLossCDR/funcs/func_lock.c
    team/juggie/NoLossCDR/include/asterisk/lock.h
    team/juggie/NoLossCDR/include/asterisk/module.h
    team/juggie/NoLossCDR/main/asterisk.c
    team/juggie/NoLossCDR/main/channel.c
    team/juggie/NoLossCDR/main/cli.c
    team/juggie/NoLossCDR/main/dnsmgr.c
    team/juggie/NoLossCDR/main/frame.c
    team/juggie/NoLossCDR/main/manager.c
    team/juggie/NoLossCDR/main/rtp.c
    team/juggie/NoLossCDR/main/say.c
    team/juggie/NoLossCDR/main/translate.c
    team/juggie/NoLossCDR/main/utils.c
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test2
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test3
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test4
    team/juggie/NoLossCDR/pbx/dundi-parser.c
    team/juggie/NoLossCDR/res/Makefile
    team/juggie/NoLossCDR/res/ael/ael.flex
    team/juggie/NoLossCDR/res/ael/ael_lex.c
    team/juggie/NoLossCDR/res/res_agi.c
    team/juggie/NoLossCDR/res/res_config_odbc.c
    team/juggie/NoLossCDR/res/res_musiconhold.c

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Oct  1 18:14:27 2007
@@ -1,1 +1,1 @@
-/team/group/CDRfix5:1-84149
+/team/group/CDRfix5:1-84327

Modified: team/juggie/NoLossCDR/Makefile
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/Makefile?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/Makefile (original)
+++ team/juggie/NoLossCDR/Makefile Mon Oct  1 18:14:27 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/juggie/NoLossCDR/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/Makefile.rules?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/Makefile.rules (original)
+++ team/juggie/NoLossCDR/Makefile.rules Mon Oct  1 18:14:27 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/juggie/NoLossCDR/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_dial.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/apps/app_dial.c (original)
+++ team/juggie/NoLossCDR/apps/app_dial.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_meetme.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/apps/app_meetme.c (original)
+++ team/juggie/NoLossCDR/apps/app_meetme.c Mon Oct  1 18:14:27 2007
@@ -1479,7 +1479,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/juggie/NoLossCDR/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_minivm.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/apps/app_minivm.c (original)
+++ team/juggie/NoLossCDR/apps/app_minivm.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/cdr/cdr_manager.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/cdr/cdr_manager.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/cdr/cdr_manager.c (original)
+++ team/juggie/NoLossCDR/cdr/cdr_manager.c Mon Oct  1 18:14:27 2007
@@ -114,6 +114,7 @@
 		ast_cdr_unregister(name, NULL);
 	else if (!enablecdr && newenablecdr)
 		ast_cdr_register(name, NULL, "Asterisk Manager Interface CDR Backend", manager_log, NULL, NULL);
+	enablecdr = newenablecdr;
 
 	return 1;
 }

Modified: team/juggie/NoLossCDR/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/Makefile?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/Makefile (original)
+++ team/juggie/NoLossCDR/channels/Makefile Mon Oct  1 18:14:27 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/juggie/NoLossCDR/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_agent.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_agent.c (original)
+++ team/juggie/NoLossCDR/channels/chan_agent.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_iax2.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_iax2.c (original)
+++ team/juggie/NoLossCDR/channels/chan_iax2.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_mgcp.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_mgcp.c (original)
+++ team/juggie/NoLossCDR/channels/chan_mgcp.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_misdn.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_misdn.c (original)
+++ team/juggie/NoLossCDR/channels/chan_misdn.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_sip.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_sip.c (original)
+++ team/juggie/NoLossCDR/channels/chan_sip.c Mon Oct  1 18:14:27 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);
 	}
 }
@@ -5856,7 +5856,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) {
@@ -6175,7 +6175,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) {
@@ -18944,7 +18944,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/juggie/NoLossCDR/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_skinny.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_skinny.c (original)
+++ team/juggie/NoLossCDR/channels/chan_skinny.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/iax2-parser.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/channels/iax2-parser.c (original)
+++ team/juggie/NoLossCDR/channels/iax2-parser.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/codecs/g722/Makefile
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/codecs/g722/Makefile?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/codecs/g722/Makefile (original)
+++ team/juggie/NoLossCDR/codecs/g722/Makefile Mon Oct  1 18:14:27 2007
@@ -14,3 +14,4 @@
 
 clean:
 	rm -f $(LIB) *.o
+	rm -f .*.o.d

Modified: team/juggie/NoLossCDR/configs/musiconhold.conf.sample
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/configs/musiconhold.conf.sample?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/configs/musiconhold.conf.sample (original)
+++ team/juggie/NoLossCDR/configs/musiconhold.conf.sample Mon Oct  1 18:14:27 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/juggie/NoLossCDR/funcs/func_lock.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/funcs/func_lock.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/funcs/func_lock.c (original)
+++ team/juggie/NoLossCDR/funcs/func_lock.c Mon Oct  1 18:14:27 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(&current->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/juggie/NoLossCDR/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/include/asterisk/lock.h?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/include/asterisk/lock.h (original)
+++ team/juggie/NoLossCDR/include/asterisk/lock.h Mon Oct  1 18:14:27 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/juggie/NoLossCDR/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/include/asterisk/module.h?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/include/asterisk/module.h (original)
+++ team/juggie/NoLossCDR/include/asterisk/module.h Mon Oct  1 18:14:27 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/juggie/NoLossCDR/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/asterisk.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/asterisk.c (original)
+++ team/juggie/NoLossCDR/main/asterisk.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/channel.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/channel.c (original)
+++ team/juggie/NoLossCDR/main/channel.c Mon Oct  1 18:14:27 2007
@@ -3296,7 +3296,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;
@@ -3316,6 +3316,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/juggie/NoLossCDR/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/cli.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/cli.c (original)
+++ team/juggie/NoLossCDR/main/cli.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/dnsmgr.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/dnsmgr.c (original)
+++ team/juggie/NoLossCDR/main/dnsmgr.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/main/frame.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/frame.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/frame.c (original)
+++ team/juggie/NoLossCDR/main/frame.c Mon Oct  1 18:14:27 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/juggie/NoLossCDR/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/manager.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/manager.c (original)
+++ team/juggie/NoLossCDR/main/manager.c Mon Oct  1 18:14:27 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;
-			ast_mutex_lock(&chan2->lock);
-		}
 	}
 	res = ast_async_goto(chan, context, exten, pi);
 	if (!res) {

Modified: team/juggie/NoLossCDR/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/rtp.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/rtp.c (original)
+++ team/juggie/NoLossCDR/main/rtp.c Mon Oct  1 18:14:27 2007
@@ -2113,7 +2113,7 @@
 	}
 
 	if (start == end)
-		snprintf(start, size, "nothing)"); 
+		ast_copy_string(start, "nothing)", size); 
 	else if (size > 1)
 		*(end -1) = ')';
 	

Modified: team/juggie/NoLossCDR/main/say.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/say.c?view=diff&rev=84328&r1=84327&r2=84328
==============================================================================
--- team/juggie/NoLossCDR/main/say.c (original)
+++ team/juggie/NoLossCDR/main/say.c Mon Oct  1 18:14:27 2007
@@ -486,40 +486,40 @@
 
 	while (!res && (num || playh)) {
 		if (num < 0) {
-			snprintf(fn, sizeof(fn), "digits/minus");
+			ast_copy_string(fn, "digits/minus", sizeof(fn));
 			if ( num > INT_MIN ) {
 				num = -num;
 			} else {
 				num = 0;
 			}	
 		} else if (playh) {
-			snprintf(fn, sizeof(fn), "digits/hundred");
+			ast_copy_string(fn, "digits/hundred", sizeof(fn));
 			playh = 0;
 		} else	if (num < 20) {
 			snprintf(fn, sizeof(fn), "digits/%d", num);
 			num = 0;
 		} else	if (num < 100) {
 			snprintf(fn, sizeof(fn), "digits/%d", (num /10) * 10);
-			num -= ((num / 10) * 10);
+			num %= 10;
 		} else {
 			if (num < 1000){
 				snprintf(fn, sizeof(fn), "digits/%d", (num/100));
 				playh++;
-				num -= ((num / 100) * 100);
+				num %= 100;
 			} else {
 				if (num < 1000000) { /* 1,000,000 */
 					res = ast_say_number_full_en(chan, num / 1000, ints, language, audiofd, ctrlfd);
 					if (res)
 						return res;
-					num = num % 1000;
+					num %= 1000;
 					snprintf(fn, sizeof(fn), "digits/thousand");
 				} else {
 					if (num < 1000000000) {	/* 1,000,000,000 */
 						res = ast_say_number_full_en(chan, num / 1000000, ints, language, audiofd, ctrlfd);
 						if (res)
 							return res;
-						num = num % 1000000;
-						snprintf(fn, sizeof(fn), "digits/million");
+						num %= 1000000;
+						ast_copy_string(fn, "digits/million", sizeof(fn));
 					} else {
 						ast_debug(1, "Number '%d' is too big for me\n", num);
 						res = -1;
@@ -588,7 +588,7 @@
 	
 	while (!res && (num || playh)) {
 		if (num < 0) {
-			snprintf(fn, sizeof(fn), "digits/minus");
+			ast_copy_string(fn, "digits/minus", sizeof(fn));
 			if ( num > INT_MIN ) {
 				num = -num;
 			} else {
@@ -604,21 +604,21 @@
 			num = 0;
 		} else if (num < 100) {
 			snprintf(fn, sizeof(fn), "digits/%d", (num /10) * 10);
-			num -= ((num / 10) * 10);
+			num %= 10;

[... 3122 lines stripped ...]



More information about the asterisk-commits mailing list