[asterisk-commits] branch oej/02-labarea r26916 - in
/team/oej/02-labarea: ./ build_tools/ chann...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu May 11 07:43:25 MST 2006
Author: oej
Date: Thu May 11 09:43:24 2006
New Revision: 26916
URL: http://svn.digium.com/view/asterisk?rev=26916&view=rev
Log:
Update, reset
Added:
team/oej/02-labarea/build_tools/make_buildopts_h
- copied unchanged from r26884, trunk/build_tools/make_buildopts_h
Modified:
team/oej/02-labarea/ (props changed)
team/oej/02-labarea/.cleancount
team/oej/02-labarea/Makefile
team/oej/02-labarea/asterisk.c
team/oej/02-labarea/build_tools/Makefile
team/oej/02-labarea/build_tools/cflags.xml
team/oej/02-labarea/channel.c
team/oej/02-labarea/channels/chan_sip.c
team/oej/02-labarea/configs/manager.conf.sample
team/oej/02-labarea/configs/sip.conf.sample
team/oej/02-labarea/configure.ac
team/oej/02-labarea/doc/cliprompt.txt
team/oej/02-labarea/enum.c
team/oej/02-labarea/include/asterisk/ (props changed)
team/oej/02-labarea/include/autoconfig.h.in
team/oej/02-labarea/manager.c
team/oej/02-labarea/rtp.c
Propchange: team/oej/02-labarea/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/02-labarea/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/02-labarea/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/02-labarea/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 11 09:43:24 2006
@@ -1,1 +1,1 @@
-/trunk:1-26730
+/trunk:1-26885
Modified: team/oej/02-labarea/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/.cleancount?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/.cleancount (original)
+++ team/oej/02-labarea/.cleancount Thu May 11 09:43:24 2006
@@ -1,1 +1,1 @@
-15
+16
Modified: team/oej/02-labarea/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/Makefile?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/Makefile (original)
+++ team/oej/02-labarea/Makefile Thu May 11 09:43:24 2006
@@ -69,7 +69,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3 #-pg
+DEBUG=-g3
# Set NOCRYPTO to yes if you do not want to have crypto support or dependencies
#NOCRYPTO=yes
@@ -85,17 +85,7 @@
#endif
# Asterisk SMDI integration
-WITH_SMDI = 1
-
-# Optional debugging parameters
-DEBUG_THREADS = #-DDUMP_SCHEDULER #-DDEBUG_SCHEDULER #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
-
-# If you want to debug channel locking, try this (depends on code using
-# ast_channel_lock and companions to work)
-DEBUG_THREADS += #-DDEBUG_CHANNEL_LOCKS
-
-# Uncomment next one to enable ast_frame tracing (for debugging)
-TRACE_FRAMES = #-DTRACE_FRAMES
+WITH_SMDI=1
# Where to install asterisk after compiling
# Default -> leave empty
@@ -110,16 +100,16 @@
#DESTDIR?=/tmp/asterisk
# Original busydetect routine
-BUSYDETECT = #-DBUSYDETECT
+#BUSYDETECT = -DBUSYDETECT
# Improved busydetect routine, comment the previous one if you use this one
-BUSYDETECT+= #-DBUSYDETECT_MARTIN
+#BUSYDETECT+= -DBUSYDETECT_MARTIN
# Detect the busy signal looking only at tone lengths
# For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
-BUSYDETECT+= #-DBUSYDETECT_TONEONLY
+#BUSYDETECT+= -DBUSYDETECT_TONEONLY
# Enforce the detection of busy signal (get rid of false hangups)
# Don't use together with -DBUSYDETECT_TONEONLY
-BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
+#BUSYDETECT+= -DBUSYDETECT_COMPARE_TONE_AND_SILENCE
# Define standard directories for various platforms
# These apply if they are not redefined in asterisk.conf
@@ -195,7 +185,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..
@@ -252,7 +241,7 @@
ID=/usr/xpg4/bin/id
endif
-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) #-DMAKE_VALGRIND_HAPPY
+ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE)
ASTCFLAGS+=$(OPTIMIZE)
ifeq ($(AST_DEVMODE),yes)
@@ -260,7 +249,7 @@
endif
ifeq ($(shell gcc -v 2>&1 | grep 'gcc version' | cut -f3 -d' ' | cut -f1 -d.),4)
-ASTCFLAGS+= -Wno-pointer-sign
+ASTCFLAGS+=-Wno-pointer-sign
endif
ASTOBJ=-o asterisk
@@ -323,13 +312,9 @@
endif
endif
-ASTCFLAGS+= $(DEBUG_THREADS)
-ASTCFLAGS+= $(TRACE_FRAMES)
-ASTCFLAGS+= $(MALLOC_DEBUG)
-ASTCFLAGS+= $(BUSYDETECT)
-ASTCFLAGS+= $(OPTIONS)
+ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
ifeq ($(findstring dont-optimize,$(MAKECMDGOALS)),)
-ASTCFLAGS+= -fomit-frame-pointer
+ASTCFLAGS+=-fomit-frame-pointer
endif
MOD_SUBDIRS=res channels pbx apps codecs formats cdr funcs
@@ -348,11 +333,11 @@
# we need to link in the objects statically, not as a library, because
# otherwise modules will not have them available if none of the static
# objects use it.
-OBJS+= stdtime/localtime.o
+OBJS+=stdtime/localtime.o
# At the moment say.o is an optional component which can be overridden
# by a module.
-OBJS+= say.o
+OBJS+=say.o
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
OBJS+= poll.o
@@ -432,7 +417,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 +510,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 +559,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 +668,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 +855,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 +904,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:
Modified: team/oej/02-labarea/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/asterisk.c?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/asterisk.c (original)
+++ team/oej/02-labarea/asterisk.c Thu May 11 09:43:24 2006
@@ -1644,6 +1644,9 @@
}
break;
#endif
+ case 's': /* Asterisk system name (from asterisk.conf) */
+ strncat(p, ast_config_AST_SYSTEM_NAME, sizeof(prompt) - strlen(prompt) - 1);
+ break;
case 't': /* time */
memset(&tm, 0, sizeof(tm));
time(&ts);
Modified: team/oej/02-labarea/build_tools/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/build_tools/Makefile?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/build_tools/Makefile (original)
+++ team/oej/02-labarea/build_tools/Makefile Thu May 11 09:43:24 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/oej/02-labarea/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/build_tools/cflags.xml?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/build_tools/cflags.xml (original)
+++ team/oej/02-labarea/build_tools/cflags.xml Thu May 11 09:43:24 2006
@@ -1,20 +1,20 @@
<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
- <member name="-DDEBUG_SCHEDULER">
+ <member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">
</member>
- <member name="-DDEBUG_THREADS">
+ <member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
</member>
- <member name="-DDETECT_DEADLOCKS">
+ <member name="DETECT_DEADLOCKS" displayname="Detect Deadlocks">
</member>
- <member name="-DDUMP_SCHEDULER">
+ <member name="DUMP_SCHEDULER" displayname="Dump Scheduler Contents for Debugging">
</member>
- <member name="-DLOW_MEMORY">
+ <member name="LOW_MEMORY" displayname="Optimize for Low Memory Usage">
</member>
- <member name="-DMALLOC_DEBUG">
+ <member name="MALLOC_DEBUG" displayname="Keep Track of Memory Allocations">
</member>
- <member name="-DRADIO_RELAX">
+ <member name="RADIO_RELAX" displayname="Relax DTMF for Radio Applications">
</member>
- <member name="-DTRACE_FRAMES">
+ <member name="TRACE_FRAMES" displayname="Trace Frame Allocations">
</member>
- <member name="-DMTX_PROFILE">
+ <member name="MTX_PROFILE" displayname="Enable Code Profiling Using TSC Counters">
</member>
</category>
Modified: team/oej/02-labarea/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/channel.c?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/channel.c (original)
+++ team/oej/02-labarea/channel.c Thu May 11 09:43:24 2006
@@ -3328,7 +3328,6 @@
if (!f) {
*fo = NULL;
*rc = who;
- res = AST_BRIDGE_COMPLETE;
ast_log(LOG_DEBUG, "Didn't get a frame from channel: %s\n",who->name);
break;
}
@@ -3336,6 +3335,8 @@
other = (who == c0) ? c1 : c0; /* the 'other' channel */
if ((f->frametype == AST_FRAME_CONTROL) && !(config->flags & AST_BRIDGE_IGNORE_SIGS)) {
+ int bridge_exit = 0;
+
switch (f->subclass) {
case AST_CONTROL_HOLD:
case AST_CONTROL_UNHOLD:
@@ -3345,11 +3346,11 @@
default:
*fo = f;
*rc = who;
- res = AST_BRIDGE_COMPLETE;
+ bridge_exit = 1;
ast_log(LOG_DEBUG, "Got a FRAME_CONTROL (%d) frame on channel %s\n", f->subclass, who->name);
break;
}
- if (res == AST_BRIDGE_COMPLETE)
+ if (bridge_exit)
break;
}
if ((f->frametype == AST_FRAME_VOICE) ||
@@ -3365,7 +3366,6 @@
if (f->frametype == AST_FRAME_DTMF && monitored_source) {
*fo = f;
*rc = who;
- res = AST_BRIDGE_COMPLETE;
ast_log(LOG_DEBUG, "Got DTMF on channel (%s)\n", who->name);
break;
}
Modified: team/oej/02-labarea/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/channels/chan_sip.c?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/channels/chan_sip.c (original)
+++ team/oej/02-labarea/channels/chan_sip.c Thu May 11 09:43:24 2006
@@ -1051,7 +1051,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
@@ -1200,7 +1200,6 @@
static unsigned int parse_sip_options(struct sip_pvt *pvt, const char *supported);
static void parse_request(struct sip_request *req);
static const char *get_header(const struct sip_request *req, const char *name);
-static void copy_request(struct sip_request *dst,struct sip_request *src);
static char *referstatus2str(enum referstatus rstatus);
static int method_match(enum sipmethod id, const char *name);
static void parse_copy(struct sip_request *dst, struct sip_request *src);
@@ -1216,7 +1215,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);
@@ -1288,6 +1287,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",
@@ -1347,7 +1355,7 @@
* matches the sip method 'id'.
* Strictly speaking, SIP methods are case SENSITIVE, but we do
* a case-insensitive comparison to be more tolerant.
- * following Jon Postel's rule: Be gentle in what you accept, strict with what you send
+ * following Jon Postel's rule: Be gentle in what you accept, strict with what you send
*/
static int method_match(enum sipmethod id, const char *name)
{
@@ -1762,10 +1770,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);
@@ -1784,27 +1789,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;
}
@@ -2540,10 +2538,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;
}
}
@@ -4176,6 +4171,8 @@
/*! \brief Add header to SIP message */
static int add_header(struct sip_request *req, const char *var, const char *value)
{
+ int maxlen = sizeof(req->data) - 4 - req->len; /* 4 bytes are for two \r\n ? */
+
if (req->headers == SIP_MAX_HEADERS) {
ast_log(LOG_WARNING, "Out of SIP header space\n");
return -1;
@@ -4186,7 +4183,7 @@
return -1;
}
- if (req->len >= sizeof(req->data) - 4) {
+ if (maxlen <= 0) {
ast_log(LOG_WARNING, "Out of space, can't add anymore (%s:%s)\n", var, value);
return -1;
}
@@ -4196,7 +4193,7 @@
if (compactheaders)
var = find_alias(var, var);
- snprintf(req->header[req->headers], sizeof(req->data) - req->len - 4, "%s: %s\r\n", var, value);
+ snprintf(req->header[req->headers], maxlen, "%s: %s\r\n", var, value);
req->len += strlen(req->header[req->headers]);
req->headers++;
@@ -4446,37 +4443,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)
@@ -4484,8 +4475,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");
@@ -5370,7 +5360,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);
@@ -5965,7 +5954,6 @@
ast_string_field_set(p, uri, addr);
- memset(&req, 0, sizeof(req));
init_req(&req, sipmethod, addr);
/* Add to CSEQ */
@@ -6905,6 +6893,9 @@
switch (parse_register_contact(p, peer, req)) {
case PARSE_REGISTER_FAILED:
ast_log(LOG_WARNING, "Failed to parse contact info\n");
+ transmit_response_with_date(p, "400 Bad Request", req);
+ peer->lastmsgssent = -1;
+ res = 0;
break;
case PARSE_REGISTER_QUERY:
transmit_response_with_date(p, "200 OK", req);
@@ -6928,11 +6919,13 @@
peer = temp_peer(name);
if (peer) {
ASTOBJ_CONTAINER_LINK(&peerl, peer);
- peer->lastmsgssent = -1;
sip_cancel_destroy(p);
switch (parse_register_contact(p, peer, req)) {
case PARSE_REGISTER_FAILED:
ast_log(LOG_WARNING, "Failed to parse contact info\n");
+ transmit_response_with_date(p, "400 Bad Request", req);
+ peer->lastmsgssent = -1;
+ res = 0;
break;
case PARSE_REGISTER_QUERY:
transmit_response_with_date(p, "200 OK", req);
@@ -10554,7 +10547,7 @@
case 481: /* Call leg does not exist */
if (sipmethod == SIP_INVITE) {
/* First we ACK */
- transmit_request(p, SIP_ACK, seqno, 0, 0);
+ transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
ast_log(LOG_WARNING, "INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
if (owner)
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
@@ -11540,13 +11533,14 @@
check_via(p, req);
ast_set_flag(&p->flags[0], SIP_ALREADYGONE);
+
if (p->owner && p->owner->_state == AST_STATE_UP) {
- /* This call is up, cancel is not accepted, we need a bye */
+ /* This call is up, cancel is ignored, we need a bye */
transmit_response(p, "200 OK", req);
- ast_log(LOG_NOTICE, "Got CANCEL on a call that is already up...Call-ID: %s\n", p->callid);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Got CANCEL on an answered call. Ignoring... \n");
return 0;
}
-
if (p->owner)
ast_queue_hangup(p->owner);
if (p->rtp) {
@@ -12989,6 +12983,7 @@
ast_copy_flags(&user->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY);
user->capability = global_capability;
user->allowtransfer = global_allowtransfer;
+ user->maxcallbitrate = default_maxcallbitrate;
user->prefs = default_prefs;
/* set default context */
strcpy(user->context, default_context);
@@ -13426,7 +13421,10 @@
global_allowsubscribe = FALSE;
ast_copy_string(global_useragent, DEFAULT_USERAGENT, sizeof(global_useragent));
ast_copy_string(default_notifymime, DEFAULT_NOTIFYMIME, sizeof(default_notifymime));
- ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
+ if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME))
+ ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
+ else
+ ast_copy_string(global_realm, ast_config_AST_SYSTEM_NAME, sizeof(global_realm));
ast_copy_string(default_callerid, DEFAULT_CALLERID, sizeof(default_callerid));
compactheaders = DEFAULT_COMPACTHEADERS;
global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
Modified: team/oej/02-labarea/configs/manager.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/configs/manager.conf.sample?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/configs/manager.conf.sample (original)
+++ team/oej/02-labarea/configs/manager.conf.sample Thu May 11 09:43:24 2006
@@ -21,6 +21,7 @@
; default is 60 seconds.
;
[general]
+displaysystemname = yes
enabled = no
;webenabled = yes
port = 5038
Modified: team/oej/02-labarea/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/configs/sip.conf.sample?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/configs/sip.conf.sample (original)
+++ team/oej/02-labarea/configs/sip.conf.sample Thu May 11 09:43:24 2006
@@ -32,7 +32,8 @@
;allowtransfer=no ; Disable all transfers (unless enabled in peers or users)
; Default is enabled
;realm=mydomain.tld ; Realm for digest authentication
- ; defaults to "asterisk"
+ ; defaults to "asterisk". If you set a system name in
+ ; asterisk.conf, it defaults to that system name
; Realms MUST be globally unique according to RFC 3261
; Set this to your host name or domain name
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
Modified: team/oej/02-labarea/configure.ac
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/configure.ac?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/configure.ac (original)
+++ team/oej/02-labarea/configure.ac Thu May 11 09:43:24 2006
@@ -111,6 +111,10 @@
AC_GNU_SOURCE
AH_TOP(
+#ifndef MENUSELECT
+#include "asterisk/buildopts.h"
+#endif
+
#ifndef _REENTRANT
#define _REENTRANT
#endif
Modified: team/oej/02-labarea/doc/cliprompt.txt
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/doc/cliprompt.txt?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/doc/cliprompt.txt (original)
+++ team/oej/02-labarea/doc/cliprompt.txt Thu May 11 09:43:24 2006
@@ -8,6 +8,7 @@
the current value by Asterisk:
%d Date (year-month-date)
+%s Asterisk system name (from asterisk.conf)
%h Full hostname
%H Short hostname
%t Time
Modified: team/oej/02-labarea/enum.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/enum.c?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/enum.c (original)
+++ team/oej/02-labarea/enum.c Thu May 11 09:43:24 2006
@@ -95,7 +95,7 @@
} __attribute__ ((__packed__));
/*! \brief Parse NAPTR record information elements */
-static int parse_ie(char *data, int maxdatalen, char *src, int srclen)
+static int parse_ie(unsigned char *data, int maxdatalen, unsigned char *src, int srclen)
{
int len, olen;
@@ -113,7 +113,7 @@
}
/*! \brief Parse DNS NAPTR record used in ENUM ---*/
-static int parse_naptr(char *dst, int dstsize, char *tech, int techsize, char *answer, int len, char *naptrinput)
+static int parse_naptr(unsigned char *dst, int dstsize, char *tech, int techsize, unsigned char *answer, int len, unsigned char *naptrinput)
{
char tech_return[80];
Propchange: team/oej/02-labarea/include/asterisk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu May 11 09:43:24 2006
@@ -1,2 +1,3 @@
build.h
version.h
+buildopts.h
Modified: team/oej/02-labarea/include/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/include/autoconfig.h.in?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/include/autoconfig.h.in (original)
+++ team/oej/02-labarea/include/autoconfig.h.in Thu May 11 09:43:24 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
Modified: team/oej/02-labarea/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/manager.c?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/manager.c (original)
+++ team/oej/02-labarea/manager.c Thu May 11 09:43:24 2006
@@ -158,6 +158,7 @@
char inbuf[AST_MAX_MANHEADER_LEN];
int inlen;
int send_events;
+ int displaysystemname; /*!< Add system name to manager responses and events */
/* Queued events that we've not had the ability to send yet */
struct eventqent *eventq;
/* Timeout for ast_carefulwrite() */
@@ -772,6 +773,14 @@
while (v) {
if (!strcasecmp(v->name, "secret")) {
password = v->value;
+ } else if (!strcasecmp(v->name, "displaysystemname")) {
+ if (ast_true(v->value)) {
+ if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
+ s->displaysystemname = 1;
+ } else {
+ ast_log(LOG_ERROR, "Can't enable displaysystemname in manager.conf - no system name configured in asterisk.conf\n");
+ }
+ }
} else if (!strcasecmp(v->name, "permit") ||
!strcasecmp(v->name, "deny")) {
ha = ast_append_ha(v->name, v->value, ha);
Modified: team/oej/02-labarea/rtp.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/rtp.c?rev=26916&r1=26915&r2=26916&view=diff
==============================================================================
--- team/oej/02-labarea/rtp.c (original)
+++ team/oej/02-labarea/rtp.c Thu May 11 09:43:24 2006
@@ -93,6 +93,7 @@
struct ast_frame f;
unsigned char rawdata[8192 + AST_FRIENDLY_OFFSET];
unsigned int ssrc; /*!< Synchronization source, RFC 3550, page 10. */
+ unsigned int rxssrc;
unsigned int lastts;
unsigned int lastdigitts;
unsigned int lastrxts;
@@ -430,6 +431,7 @@
int ext;
int x;
char iabuf[INET_ADDRSTRLEN];
+ unsigned int ssrc;
unsigned int timestamp;
unsigned int *rtpheader;
struct rtpPayloadType rtpPT;
@@ -485,6 +487,14 @@
ext = seqno & (1 << 28);
seqno &= 0xffff;
timestamp = ntohl(rtpheader[1]);
+ ssrc = ntohl(rtpheader[2]);
+
+ if (!mark && rtp->rxssrc && rtp->rxssrc != ssrc) {
+ ast_log(LOG_WARNING, "Forcing Marker bit, because SSRC has changed\n");
+ mark = 1;
+ }
+
+ rtp->rxssrc = ssrc;
if (padding) {
/* Remove padding bytes */
More information about the asterisk-commits
mailing list