[asterisk-commits] russell: branch russell/cdr-q r258753 - in /team/russell/cdr-q: ./ main/ utils/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 22 17:37:54 CDT 2010


Author: russell
Date: Thu Apr 22 17:37:43 2010
New Revision: 258753

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=258753
Log:
resolve, reset

Modified:
    team/russell/cdr-q/   (props changed)
    team/russell/cdr-q/main/cdr.c
    team/russell/cdr-q/main/channel.c
    team/russell/cdr-q/main/features.c
    team/russell/cdr-q/utils/Makefile
    team/russell/cdr-q/utils/extconf.c

Propchange: team/russell/cdr-q/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/russell/cdr-q/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/cdr-q/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Apr 22 17:37:43 2010
@@ -1,1 +1,1 @@
-/trunk:1-258660
+/trunk:1-258752

Modified: team/russell/cdr-q/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/russell/cdr-q/main/cdr.c?view=diff&rev=258753&r1=258752&r2=258753
==============================================================================
--- team/russell/cdr-q/main/cdr.c (original)
+++ team/russell/cdr-q/main/cdr.c Thu Apr 22 17:37:43 2010
@@ -1031,9 +1031,7 @@
 	for (; cdr; cdr = cdr->next) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
 			check_post(cdr);
-			if (cdr->disposition < AST_CDR_BUSY) {
-				cdr->disposition = AST_CDR_BUSY;
-			}
+			cdr->disposition = AST_CDR_BUSY;
 		}
 	}
 }
@@ -1058,12 +1056,8 @@
 	for (; cdr; cdr = cdr->next) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
 			chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
-			if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED)) {
-				ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
-			}
-			if (cdr->disposition < AST_CDR_NOANSWER) {
-				cdr->disposition = AST_CDR_NOANSWER;
-			}
+			check_post(cdr);
+			cdr->disposition = AST_CDR_NOANSWER;
 		}
 	}
 }

Modified: team/russell/cdr-q/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/russell/cdr-q/main/channel.c?view=diff&rev=258753&r1=258752&r2=258753
==============================================================================
--- team/russell/cdr-q/main/channel.c (original)
+++ team/russell/cdr-q/main/channel.c Thu Apr 22 17:37:43 2010
@@ -4522,8 +4522,19 @@
 					break;
 
 				case AST_CONTROL_BUSY:
+					ast_cdr_busy(chan->cdr);
+					*outstate = f->subclass.integer;
+					timeout = 0;
+					break;
+
 				case AST_CONTROL_CONGESTION:
+					ast_cdr_failed(chan->cdr);
+					*outstate = f->subclass.integer;
+					timeout = 0;
+					break;
+
 				case AST_CONTROL_ANSWER:
+					ast_cdr_answer(chan->cdr);
 					*outstate = f->subclass.integer;
 					timeout = 0;		/* trick to force exit from the while() */
 					break;
@@ -4660,7 +4671,6 @@
 	if (!ast_test_flag(chan, AST_FLAG_ZOMBIE) && !ast_check_hangup(chan)) {
 		if (chan->cdr) {
 			ast_set_flag(chan->cdr, AST_CDR_FLAG_DIALED);
-			ast_set_flag(chan->cdr, AST_CDR_FLAG_ORIGINATED);
 		}
 		if (chan->tech->call)
 			res = chan->tech->call(chan, addr, timeout);

Modified: team/russell/cdr-q/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/russell/cdr-q/main/features.c?view=diff&rev=258753&r1=258752&r2=258753
==============================================================================
--- team/russell/cdr-q/main/features.c (original)
+++ team/russell/cdr-q/main/features.c Thu Apr 22 17:37:43 2010
@@ -3097,6 +3097,11 @@
 				ast_set_flag(peer_cdr, AST_CDR_FLAG_BRIDGED);
 			}
 		}
+		/* the DIALED flag may be set if a dialed channel is transfered
+		 * and then bridged to another channel.  In order for the
+		 * bridge CDR to be written, the DIALED flag must not be
+		 * present. */
+		ast_clear_flag(bridge_cdr, AST_CDR_FLAG_DIALED);
 	}
 	ast_cel_report_event(chan, AST_CEL_BRIDGE_START, NULL, NULL, NULL);
 	for (;;) {

Modified: team/russell/cdr-q/utils/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/russell/cdr-q/utils/Makefile?view=diff&rev=258753&r1=258752&r2=258753
==============================================================================
--- team/russell/cdr-q/utils/Makefile (original)
+++ team/russell/cdr-q/utils/Makefile Thu Apr 22 17:37:43 2010
@@ -86,7 +86,7 @@
 	rm -f *.o $(ALL_UTILS) check_expr
 	rm -f .*.d
 	rm -f *.s *.i
-	rm -f md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c
+	rm -f md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c lock.c
 	rm -f aelparse.c aelbison.c conf2ael
 	rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest refcounter
 
@@ -105,6 +105,10 @@
 	$(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
 	$(CMD_PREFIX) cp "$<" "$@"
 
+lock.c: $(ASTTOPDIR)/main/lock.c
+	$(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
+	$(CMD_PREFIX) cp "$<" "$@"
+
 strcompat.c: $(ASTTOPDIR)/main/strcompat.c
 	$(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
 	$(CMD_PREFIX) cp "$<" "$@"
@@ -143,7 +147,7 @@
 
 aelparse.o: _ASTCFLAGS+=-I$(ASTTOPDIR)/res -Wno-unused
 aelparse: LIBS+=-lm
-aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
+aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o lock.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
 
 astobj2.c: $(ASTTOPDIR)/main/astobj2.c
 	$(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
@@ -170,17 +174,17 @@
 	$(CMD_PREFIX) cp "$<" "$@"
 
 hashtest2.o: _ASTCFLAGS+=-O0
-hashtest2: hashtest2.o md5.o utils.o strings.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
-
-hashtest: hashtest.o md5.o hashtab.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
+hashtest2: hashtest2.o md5.o lock.o utils.o strings.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
+
+hashtest: hashtest.o md5.o hashtab.o lock.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
 hashtest.o: _ASTCFLAGS+=-O0
 
-refcounter: refcounter.o md5.o hashtab.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
+refcounter: refcounter.o md5.o hashtab.o lock.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
 refcounter.o: _ASTCFLAGS+=-O0
 
 extconf.o: extconf.c
 
-conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o hashtab.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
+conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o hashtab.o lock.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
 
 check_expr2: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h
 	$(ECHO_PREFIX) echo "   [CC] ast_expr2f.c -> ast_expr2fz.o"

Modified: team/russell/cdr-q/utils/extconf.c
URL: http://svnview.digium.com/svn/asterisk/team/russell/cdr-q/utils/extconf.c?view=diff&rev=258753&r1=258752&r2=258753
==============================================================================
--- team/russell/cdr-q/utils/extconf.c (original)
+++ team/russell/cdr-q/utils/extconf.c Thu Apr 22 17:37:43 2010
@@ -2799,6 +2799,63 @@
 		return -1;
 
 	return 0;
+}
+
+#define ONE_MILLION	1000000
+/*
+ * put timeval in a valid range. usec is 0..999999
+ * negative values are not allowed and truncated.
+ */
+static struct timeval tvfix(struct timeval a)
+{
+	if (a.tv_usec >= ONE_MILLION) {
+		ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
+			(long)a.tv_sec, (long int) a.tv_usec);
+		a.tv_sec += a.tv_usec / ONE_MILLION;
+		a.tv_usec %= ONE_MILLION;
+	} else if (a.tv_usec < 0) {
+		ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
+			(long)a.tv_sec, (long int) a.tv_usec);
+		a.tv_usec = 0;
+	}
+	return a;
+}
+
+struct timeval ast_tvadd(struct timeval a, struct timeval b);
+struct timeval ast_tvadd(struct timeval a, struct timeval b)
+{
+	/* consistency checks to guarantee usec in 0..999999 */
+	a = tvfix(a);
+	b = tvfix(b);
+	a.tv_sec += b.tv_sec;
+	a.tv_usec += b.tv_usec;
+	if (a.tv_usec >= ONE_MILLION) {
+		a.tv_sec++;
+		a.tv_usec -= ONE_MILLION;
+	}
+	return a;
+}
+
+struct timeval ast_tvsub(struct timeval a, struct timeval b);
+struct timeval ast_tvsub(struct timeval a, struct timeval b)
+{
+	/* consistency checks to guarantee usec in 0..999999 */
+	a = tvfix(a);
+	b = tvfix(b);
+	a.tv_sec -= b.tv_sec;
+	a.tv_usec -= b.tv_usec;
+	if (a.tv_usec < 0) {
+		a.tv_sec-- ;
+		a.tv_usec += ONE_MILLION;
+	}
+	return a;
+}
+#undef ONE_MILLION
+
+void ast_mark_lock_failed(void *lock_addr);
+void ast_mark_lock_failed(void *lock_addr)
+{
+	/* Pretend to do something. */
 }
 
 /* stolen from pbx.c */




More information about the asterisk-commits mailing list