[svn-commits] branch group/rtpjitterbuffer r26844 - in /team/group/rtpjitterbuffer: ./ buil...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu May 11 03:16:33 MST 2006


Author: russell
Date: Thu May 11 05:16:32 2006
New Revision: 26844

URL: http://svn.digium.com/view/asterisk?rev=26844&view=rev
Log:
resolve conflict, enable automerge

Added:
    team/group/rtpjitterbuffer/build_tools/make_buildopts_h
      - copied unchanged from r26840, trunk/build_tools/make_buildopts_h
Modified:
    team/group/rtpjitterbuffer/   (props changed)
    team/group/rtpjitterbuffer/.cleancount
    team/group/rtpjitterbuffer/Makefile
    team/group/rtpjitterbuffer/build_tools/Makefile
    team/group/rtpjitterbuffer/build_tools/cflags.xml
    team/group/rtpjitterbuffer/channels/chan_sip.c
    team/group/rtpjitterbuffer/configure.ac
    team/group/rtpjitterbuffer/include/autoconfig.h.in

Propchange: team/group/rtpjitterbuffer/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/rtpjitterbuffer/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/group/rtpjitterbuffer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 11 05:16:32 2006
@@ -1,1 +1,1 @@
-/trunk:1-26764
+/trunk:1-26842

Modified: team/group/rtpjitterbuffer/.cleancount
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/.cleancount?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/.cleancount (original)
+++ team/group/rtpjitterbuffer/.cleancount Thu May 11 05:16:32 2006
@@ -1,1 +1,1 @@
-15
+16

Modified: team/group/rtpjitterbuffer/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/Makefile?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/Makefile (original)
+++ team/group/rtpjitterbuffer/Makefile Thu May 11 05:16:32 2006
@@ -195,7 +195,6 @@
   include makeopts
 endif
 
-ASTCFLAGS+=$(MENUSELECT_CFLAGS)
 TOPDIR_CFLAGS=-include include/autoconfig.h -Iinclude
 MOD_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
 OTHER_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
@@ -432,7 +431,7 @@
 	@echo " +               make install                +"  
 	@echo " +-------------------------------------------+"  
 
-all: config.status menuselect.makeopts cleantest depend asterisk subdirs
+all: cleantest config.status menuselect.makeopts depend asterisk subdirs
 
 config.status: configure
 	@CFLAGS="" ./configure
@@ -525,10 +524,17 @@
 	fi
 	@rm -f $@.tmp
 
+include/asterisk/buildopts.h: menuselect.makeopts
+	@build_tools/make_buildopts_h > $@.tmp
+	@if cmp -s $@.tmp $@ ; then echo; else \
+		mv $@.tmp $@ ; \
+	fi
+	@rm -f $@.tmp
+
 stdtime/libtime.a:
 	CFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a
 
-asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
+asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
 	build_tools/make_build_h > include/asterisk/build.h.tmp
 	if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
 		mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
@@ -567,6 +573,7 @@
 	rm -f menuselect.makeopts makeopts makeopts.xml
 	rm -f config.log config.status
 	rm -f include/autoconfig.h
+	rm -f include/asterisk/buildopts.h
 	$(MAKE) -C mxml clean
 	$(MAKE) -C build_tools dist-clean
 
@@ -675,7 +682,7 @@
 	if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
 	ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
 	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/	
+	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
 	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
 		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
 		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
@@ -862,7 +869,7 @@
 
 rpm: __rpm
 
-__rpm: include/asterisk/version.h spec
+__rpm: include/asterisk/version.h include/asterisk/buildopts.h spec
 	rm -rf /tmp/asterisk ; \
 	mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
 	$(MAKE) DESTDIR=/tmp/asterisk install ; \
@@ -911,10 +918,10 @@
 
 valgrind: dont-optimize
 
-depend: include/asterisk/version.h .depend defaults.h 
+depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h 
 	@for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
 
-.depend: include/asterisk/version.h defaults.h
+.depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h
 	build_tools/mkdep $(CFLAGS) $(wildcard *.c)
 
 .tags-depend:
@@ -958,7 +965,7 @@
 
 cleantest:
 	@if cmp -s .cleancount .lastclean ; then echo ; else \
-		$(MAKE) clean; cp -f .cleancount .lastclean;\
+		$(MAKE) dist-clean; cp -f .cleancount .lastclean;\
 	fi
 
 _uninstall:

Modified: team/group/rtpjitterbuffer/build_tools/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/build_tools/Makefile?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/build_tools/Makefile (original)
+++ team/group/rtpjitterbuffer/build_tools/Makefile Thu May 11 05:16:32 2006
@@ -1,5 +1,5 @@
 MENUSELECT_OBJS=menuselect.o menuselect_curses.o
-MENUSELECT_CFLAGS=-g -c -D_GNU_SOURCE -I../ -I../include/
+MENUSELECT_CFLAGS=-g -c -D_GNU_SOURCE -DMENUSELECT -I../ -I../include/
 MENUSELECT_LIBS=../mxml/libmxml.a
 
 ifeq ($(OSARCH),SunOS)

Modified: team/group/rtpjitterbuffer/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/build_tools/cflags.xml?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/build_tools/cflags.xml (original)
+++ team/group/rtpjitterbuffer/build_tools/cflags.xml Thu May 11 05:16:32 2006
@@ -1,23 +1,23 @@
 	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
-		<member name="-DAST_JB">
+		<member name="AST_JB">
 			<defaultenabled>yes</defaultenabled>
 		</member>
-		<member name="-DDEBUG_SCHEDULER">
+		<member name="DEBUG_SCHEDULER">
 		</member>
-		<member name="-DDEBUG_THREADS">
+		<member name="DEBUG_THREADS">
 		</member>
-		<member name="-DDETECT_DEADLOCKS">
+		<member name="DETECT_DEADLOCKS">
 		</member>
-		<member name="-DDUMP_SCHEDULER">
+		<member name="DUMP_SCHEDULER">
 		</member>
-		<member name="-DLOW_MEMORY">
+		<member name="LOW_MEMORY">
 		</member>
-		<member name="-DMALLOC_DEBUG">
+		<member name="MALLOC_DEBUG">
 		</member>
-		<member name="-DRADIO_RELAX">
+		<member name="RADIO_RELAX">
 		</member>
-		<member name="-DTRACE_FRAMES">
+		<member name="TRACE_FRAMES">
 		</member>
-		<member name="-DMTX_PROFILE">
+		<member name="MTX_PROFILE">
 		</member>
 	</category>

Modified: team/group/rtpjitterbuffer/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_sip.c?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_sip.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_sip.c Thu May 11 05:16:32 2006
@@ -1040,7 +1040,7 @@
 static int ourport;
 static struct sockaddr_in debugaddr;
 
-struct ast_config *notify_types;		/*!< The list of manual NOTIFY types we know how to send */
+static struct ast_config *notify_types;		/*!< The list of manual NOTIFY types we know how to send */
 
 /*---------------------------- Forward declarations of functions in chan_sip.c */
 /*! \note Sorted up from start to build_rpid.... Will continue categorization in order to
@@ -1204,7 +1204,7 @@
 static void initialize_initreq(struct sip_pvt *p, struct sip_request *req);
 static int init_req(struct sip_request *req, int sipmethod, const char *recip);
 static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, int seqno, int newbranch);
-static int init_resp(struct sip_request *req, const char *resp, struct sip_request *orig);
+static int init_resp(struct sip_request *resp, const char *msg);
 static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg, struct sip_request *req);
 static const struct sockaddr_in *sip_real_dst(const struct sip_pvt *p);
 static void build_via(struct sip_pvt *p);
@@ -1279,6 +1279,15 @@
 	.send_text = sip_sendtext,
 };
 
+/**--- some list management macros. **/
+ 
+#define UNLINK(element, head, prev) do {	\
+	if (prev)				\
+		(prev)->next = (element)->next;	\
+	else					\
+		(head) = (element)->next;	\
+	} while (0)
+
 /*! \brief Interface structure with callbacks used to connect to RTP module */
 static struct ast_rtp_protocol sip_rtp = {
 	type: "SIP",
@@ -1736,10 +1745,7 @@
 				p->pendinginvite = 0;
 			}
 			/* this is our baby */
-			if (prev)
-				prev->next = cur->next;
-			else
-				p->packets = cur->next;
+			UNLINK(cur, p->packets, prev);
 			if (cur->retransid > -1) {
 				if (sipdebug && option_debug > 3)
 					ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
@@ -1758,27 +1764,20 @@
 }
 
 /*! \brief Pretend to ack all packets */
+/* maybe the lock on p is not strictly necessary but there might be a race */
 static int __sip_pretend_ack(struct sip_pvt *p)
 {
 	struct sip_pkt *cur = NULL;
 
 	while (p->packets) {
+		int method;
 		if (cur == p->packets) {
 			ast_log(LOG_WARNING, "Have a packet that doesn't want to give up! %s\n", sip_methods[cur->method].text);
 			return -1;
 		}
 		cur = p->packets;
-		if (cur->method)
-			__sip_ack(p, p->packets->seqno, (ast_test_flag(p->packets, FLAG_RESPONSE)), cur->method, FALSE);
-		else {	/* Unknown packet type */
-			char *c;
-			char method[128];
-
-			ast_copy_string(method, p->packets->data, sizeof(method));
-			c = ast_skip_blanks(method); /* XXX what ? */
-			*c = '\0';
-			__sip_ack(p, p->packets->seqno, (ast_test_flag(p->packets, FLAG_RESPONSE)), find_sip_method(method), FALSE);
-		}
+		method = (cur->method) ? cur->method : find_sip_method(cur->data);
+		__sip_ack(p, cur->seqno, ast_test_flag(cur, FLAG_RESPONSE), method, FALSE);
 	}
 	return 0;
 }
@@ -2514,10 +2513,7 @@
 
 	for (prev = NULL, cur = iflist; cur; prev = cur, cur = cur->next) {
 		if (cur == p) {
-			if (prev)
-				prev->next = cur->next;
-			else
-				iflist = cur->next;
+			UNLINK(cur, iflist, prev);
 			break;
 		}
 	}
@@ -4418,37 +4414,31 @@
 }
 
 /*! \brief Initialize SIP response, based on SIP request */
-static int init_resp(struct sip_request *req, const char *resp, struct sip_request *orig)
+static int init_resp(struct sip_request *resp, const char *msg)
 {
 	/* Initialize a response */
-	if (req->headers || req->len) {
-		ast_log(LOG_WARNING, "Request already initialized?!?\n");
-		return -1;
-	}
-	req->method = SIP_RESPONSE;
-	req->header[req->headers] = req->data + req->len;
-	snprintf(req->header[req->headers], sizeof(req->data) - req->len, "SIP/2.0 %s\r\n", resp);
-	req->len += strlen(req->header[req->headers]);
+	memset(resp, 0, sizeof(*resp));
+	resp->method = SIP_RESPONSE;
+	resp->header[0] = resp->data;
+	snprintf(resp->header[0], sizeof(resp->data), "SIP/2.0 %s\r\n", msg);
+	resp->len = strlen(resp->header[0]);
+	resp->headers++;
+	return 0;
+}
+
+/*! \brief Initialize SIP request */
+static int init_req(struct sip_request *req, int sipmethod, const char *recip)
+{
+	/* Initialize a request */
+	memset(req, 0, sizeof(*req));
+        req->method = sipmethod;
+	req->header[0] = req->data;
+	snprintf(req->header[0], sizeof(req->data), "%s %s SIP/2.0\r\n", sip_methods[sipmethod].text, recip);
+	req->len = strlen(req->header[0]);
 	req->headers++;
 	return 0;
 }
 
-/*! \brief Initialize SIP request */
-static int init_req(struct sip_request *req, int sipmethod, const char *recip)
-{
-	/* Initialize a response */
-	if (req->headers || req->len) {
-		ast_log(LOG_WARNING, "Request already initialized?!?\n");
-		return -1;
-	}
-	req->header[req->headers] = req->data + req->len;
-	snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %s SIP/2.0\r\n", sip_methods[sipmethod].text, recip);
-	req->len += strlen(req->header[req->headers]);
-	req->headers++;
-	req->method = sipmethod;
-	return 0;
-}
-
 
 /*! \brief Prepare SIP response packet */
 static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg, struct sip_request *req)
@@ -4456,8 +4446,7 @@
 	char newto[256];
 	const char *ot;
 
-	memset(resp, 0, sizeof(*resp));
-	init_resp(resp, msg, req);
+	init_resp(resp, msg);
 	copy_via_headers(p, resp, req, "Via");
 	if (msg[0] == '2')
 		copy_all_header(resp, req, "Record-Route");
@@ -5327,7 +5316,6 @@
 		snprintf(to, sizeof(to), "<%s>", p->uri);
 	}
 	
-	memset(req, 0, sizeof(struct sip_request));
 	init_req(req, sipmethod, p->uri);
 	snprintf(tmp, sizeof(tmp), "%d %s", ++p->ocseq, sip_methods[sipmethod].text);
 
@@ -5915,7 +5903,6 @@
 
 	p->branch ^= ast_random();
 
-	memset(&req, 0, sizeof(req));
 	init_req(&req, sipmethod, addr);
 
 	/* Add to CSEQ */

Modified: team/group/rtpjitterbuffer/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/configure.ac?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/configure.ac (original)
+++ team/group/rtpjitterbuffer/configure.ac Thu May 11 05:16:32 2006
@@ -111,6 +111,10 @@
 AC_GNU_SOURCE
 
 AH_TOP(
+#ifndef MENUSELECT
+#include "asterisk/buildopts.h"
+#endif
+
 #ifndef _REENTRANT
 #define _REENTRANT
 #endif

Modified: team/group/rtpjitterbuffer/include/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/include/autoconfig.h.in?rev=26844&r1=26843&r2=26844&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/include/autoconfig.h.in (original)
+++ team/group/rtpjitterbuffer/include/autoconfig.h.in Thu May 11 05:16:32 2006
@@ -1,4 +1,8 @@
 /* include/autoconfig.h.in.  Generated from configure.ac by autoheader.  */
+
+#ifndef MENUSELECT
+#include "asterisk/buildopts.h"
+#endif
 
 #ifndef _REENTRANT
 #define _REENTRANT



More information about the svn-commits mailing list