[svn-commits] file: branch group/sip-tcptls r98995 - in /team/group/sip-tcptls: ./ apps/ bu...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 17 10:59:09 CST 2008


Author: file
Date: Thu Jan 17 10:59:09 2008
New Revision: 98995

URL: http://svn.digium.com/view/asterisk?view=rev&rev=98995
Log:
Merged revisions 98935,98944-98945,98947-98948,98952-98954,98956,98959,98961-98962,98965,98967-98969,98971,98974-98975,98978,98981,98983-98990,98992-98994 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r98935 | file | 2008-01-15 16:10:20 -0400 (Tue, 15 Jan 2008) | 12 lines

Merged revisions 98934 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98934 | file | 2008-01-15 16:08:43 -0400 (Tue, 15 Jan 2008) | 4 lines

Based on the boundary found move over the correct amount.
(closes issue #11750)
Reported by: tasker

........

................
r98944 | russell | 2008-01-15 19:31:53 -0400 (Tue, 15 Jan 2008) | 33 lines

Merged revisions 98943 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98943 | russell | 2008-01-15 17:26:52 -0600 (Tue, 15 Jan 2008) | 25 lines

Commit a fix for some memory access errors pointed out by the valgrind2.txt
output on issue #11698.

The issue here is that it is possible for an instance of a translator to get
destroyed while the frame allocated as a part of the translator is still being
processed.  Specifically, this is possible anywhere between a call to ast_read()
and ast_frame_free(), which is _a lot_ of places in the code.  The reason this
happens is that the channel might get masqueraded during this time.  During a
masquerade, existing translation paths get destroyed.

So, this patch fixes the issue in an API and ABI compatible way.  (This one is
 for you, paravoid!)

It changes an int in ast_frame to be used as flag bits.  The 1 bit is still used
to indicate that the frame contains timing information.  Also, a second flag has
been added to indicate that the frame came from a translator.  When a frame with
this flag gets released and has this flag, a function is called in translate.c to
let it know that this frame is doing being processed.  At this point, the flag gets
cleared.  Also, if the translator was requested to be destroyed while its internal
frame still had this flag set, its destruction has been deffered until it finds out
that the frame is no longer being processed.

Admittedly, this feels like a hack.  But, it does fix the issue, and I was not able 
to think of a better solution ...

........

................
r98945 | russell | 2008-01-15 19:35:29 -0400 (Tue, 15 Jan 2008) | 2 lines

Clean up something I did for ABI compatability in 1.4

................
r98947 | tilghman | 2008-01-15 19:52:11 -0400 (Tue, 15 Jan 2008) | 2 lines

Add the "filter" keyword

................
r98948 | russell | 2008-01-15 19:53:28 -0400 (Tue, 15 Jan 2008) | 19 lines

Merged revisions 98946 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98946 | russell | 2008-01-15 17:50:10 -0600 (Tue, 15 Jan 2008) | 11 lines

Change a buffer in check_auth() to be a thread local dynamically allocated
buffer, instead of a massive buffer on the stack.  This fixes a crash reported
by Qwell due to running out of stack space when building with LOW_MEMORY defined.

On a very related note, the usage of BUFSIZ in various places in chan_sip is
arbitrary and careless.  BUFSIZ is a system specific define.  On my machine,
it is 8192, but by definition (according to google) could be as small as 256.  
So, this buffer in check_auth was 16 kB.  We don't even support SIP messages 
larger than 4 kB!  Further usage of this define should be avoided, unless it 
is used in the proper context.

........

................
r98952 | file | 2008-01-15 21:17:25 -0400 (Tue, 15 Jan 2008) | 12 lines

Merged revisions 98951 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98951 | file | 2008-01-15 21:13:27 -0400 (Tue, 15 Jan 2008) | 4 lines

Add autoconf logic for speexdsp. Later versions use a separate library for some things so we need to use it if present in codec_speex.
(closes issue #11693)
Reported by: yzg

........

................
r98953 | murf | 2008-01-15 21:35:10 -0400 (Tue, 15 Jan 2008) | 1 line

Terry found this problem with running the expr2 parser on OSX. Make the #defines come out the same between the parser & lexer.
................
r98954 | file | 2008-01-15 22:30:13 -0400 (Tue, 15 Jan 2008) | 4 lines

Remove DNS lookup from sip_devicestate. This seems to come from way back when and I can't think of a reason for it being here, plus it could cause needless DNS lookups.
(closes issue #10983)
Reported by: jtodd

................
r98956 | file | 2008-01-15 23:09:11 -0400 (Tue, 15 Jan 2008) | 14 lines

Merged revisions 98955 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98955 | file | 2008-01-15 23:07:24 -0400 (Tue, 15 Jan 2008) | 6 lines

Don't drop the old record route information when dealing with packets related to a reinvite.
(closes issue #11545)
Reported by: kebl0155
Patches:
      reinvite-patch.txt uploaded by kebl0155 (license 356)

........

................
r98959 | file | 2008-01-16 11:04:08 -0400 (Wed, 16 Jan 2008) | 12 lines

Merged revisions 98958 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98958 | file | 2008-01-16 11:03:14 -0400 (Wed, 16 Jan 2008) | 4 lines

Add two more SDP names for ulaw and alaw.
(closes issue #11777)
Reported by: tootai

........

................
r98961 | file | 2008-01-16 11:09:37 -0400 (Wed, 16 Jan 2008) | 14 lines

Merged revisions 98960 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98960 | file | 2008-01-16 11:08:24 -0400 (Wed, 16 Jan 2008) | 6 lines

Introduce a lock into the dialing API that protects it when destroying the structure.
(closes issue #11687)
Reported by: callguy
Patches:
      11687.diff uploaded by file (license 11)

........

................
r98962 | twilson | 2008-01-16 12:06:06 -0400 (Wed, 16 Jan 2008) | 2 lines

Make users list static

................
r98965 | mmichelson | 2008-01-16 13:21:49 -0400 (Wed, 16 Jan 2008) | 18 lines

Merged revisions 98964 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98964 | mmichelson | 2008-01-16 11:20:11 -0600 (Wed, 16 Jan 2008) | 10 lines

Fix a deadlock in chan_local in local_hangup. There was contention because
the local_pvt was held and it was attempting to lock a channel, which is the
incorrect locking order.

(closes issue #11730)
Reported by: UDI-Doug
Patches:
      11730.patch uploaded by putnopvut (license 60)
	  Tested by: UDI-Doug

........

................
r98967 | file | 2008-01-16 13:51:52 -0400 (Wed, 16 Jan 2008) | 14 lines

Merged revisions 98966 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98966 | file | 2008-01-16 13:50:10 -0400 (Wed, 16 Jan 2008) | 6 lines

Add missing NULLs at end of two ast_load_realtimes.
(closes issue #11769)
Reported by: tequ
Patches:
      chaniax.patch uploaded by dimas (license 88)

........

................
r98968 | qwell | 2008-01-16 14:06:14 -0400 (Wed, 16 Jan 2008) | 1 line

Add logging for 'make update' command (also fixes updates in some places).  Issue #11766, initial patch by jmls.
................
r98969 | qwell | 2008-01-16 14:34:19 -0400 (Wed, 16 Jan 2008) | 1 line

Add note about new update.log to CHANGES, by request of jmls and further prodding by jsmith.
................
r98971 | qwell | 2008-01-16 15:41:25 -0400 (Wed, 16 Jan 2008) | 4 lines

Partially revert r93898, because it broke the way netsnmp was being detected.

rizzo, do you want to discuss so we can rethink this, or do you have another way?

................
r98974 | file | 2008-01-16 16:35:49 -0400 (Wed, 16 Jan 2008) | 9 lines

Blocked revisions 98972 via svnmerge

........
r98972 | file | 2008-01-16 16:33:47 -0400 (Wed, 16 Jan 2008) | 2 lines

Replace current spy architecture with backport of audiohooks. This should take care of current known spy issues.

........

................
r98975 | file | 2008-01-16 16:36:21 -0400 (Wed, 16 Jan 2008) | 9 lines

Blocked revisions 98973 via svnmerge

........
r98973 | file | 2008-01-16 16:34:30 -0400 (Wed, 16 Jan 2008) | 2 lines

Bump up cleancount due to previous commit that changed the channel structure.

........

................
r98978 | russell | 2008-01-16 17:53:10 -0400 (Wed, 16 Jan 2008) | 30 lines

Merge the changes from issue #10665 from the team/group/sip_session_timers branch.

This set of changes introduces SIP session timers support (RFC 4028).  In short,
this prevents stuck SIP sessions that were not properly torn down due to network
or endpoint failures during an established SIP session.

To quote some of the documentation supplied with the patch:
"The SIP Session-Timers is an extension of the SIP protocol that allows end-points and proxies to
refresh a session periodically. The sessions are kept alive by sending a RE-INVITE or UPDATE
request at a negotiated interval. If a session refresh fails then all the entities that support Session-
Timers clear their internal session state. In addition, UAs generate a BYE request in order to clear
the state in the proxies and the remote UA (this is done for the benefit of SIP entities in the path
that do not support Session-Timers)."

(closes issue #10665)
Reported by: rjain
Patches:
      chan_sip.c.1.diff uploaded by rjain (license 226)
      chan_sip.c.diff uploaded by rjain (license 226)
      sip.conf.sample.diff uploaded by rjain (license 226)
      proc_422_rsp_comment.diff uploaded by rjain (license 226)
      chan_sip.c.cache.diff uploaded by rjain (license 226)
      chan_sip.memalloc uploaded by rjain (license 226)
      chan_sip.memalloc.bugfix uploaded by rjain (license 226)

      Patches tracked in team/group/sip_session_timers, with some additional fixes
      by russell and oej.

Tested by: jtodd, rjain, loloski

................
r98981 | tilghman | 2008-01-16 18:20:45 -0400 (Wed, 16 Jan 2008) | 7 lines

New module res_config_curl (closes issue #11747)
 Reported by: Corydon76
 Patches: 
       res_config_curl.c uploaded by Corydon76 (license 14)
       20080116__bug11747.diff.txt uploaded by Corydon76 (license 14)
 Tested by: jmls

................
r98983 | russell | 2008-01-16 18:36:47 -0400 (Wed, 16 Jan 2008) | 12 lines

Blocked revisions 98982 via svnmerge

........
r98982 | russell | 2008-01-16 16:36:24 -0600 (Wed, 16 Jan 2008) | 5 lines

Add an unused pointer to the ast_channel struct.  This makes the ast_channel structure
retain the same size as it had in previous 1.4 releases.  Also, all of the offsets for
members in the structure are still the same (except for the two pointers that got replaced
for the new spy/whisper architecture.)

........

................
r98984 | tilghman | 2008-01-16 18:36:58 -0400 (Wed, 16 Jan 2008) | 2 lines

Info about res_config_curl

................
r98985 | qwell | 2008-01-16 19:08:11 -0400 (Wed, 16 Jan 2008) | 2 lines

Change AST_EXT_TOOL_CHECK to attempt to build against <package>_LIB, per recommendations from Russell.

................
r98986 | russell | 2008-01-16 20:05:13 -0400 (Wed, 16 Jan 2008) | 10 lines

Add support for an easy way to automatically execute some Asterisk CLI commands
immediately at startup.  Any commands in the startup_commands file in the Asterisk
config diretory will get executed.

(closes issue #11781)
Reported by: jamesgolovich
Patches:
      asterisk-startupcmds.diff.txt uploaded by jamesgolovich (license 176)
	    -- With some changes by me.

................
r98987 | tilghman | 2008-01-16 20:13:32 -0400 (Wed, 16 Jan 2008) | 4 lines

Change the way the new filter feature works, by allowing it to be a column NOT
logged into the database.  This will allow more granularity of a decision
evaluated in the dialplan, then takes effect when posting the CDR.

................
r98988 | twilson | 2008-01-16 23:09:32 -0400 (Wed, 16 Jan 2008) | 9 lines

Update res_phoneprov to default to setting the SERVER variable to the IP
the HTTP request for the config came in on and the SERVER_PORT to the
bindport setting in sip.conf.  I've left in the ability to override these
options, because I can't always guess how someone might decide to do something
weird with what is available to them--although needing to is pretty unlikely.

Documentation was updated to reflect preference for not setting serveraddr,
serveriface, or serverport.  Tested on Linux and OS X.

................
r98989 | kpfleming | 2008-01-17 11:04:54 -0400 (Thu, 17 Jan 2008) | 2 lines

resolve (valid) compiler warning about variable that could be used before being initialized

................
r98990 | kpfleming | 2008-01-17 12:17:52 -0400 (Thu, 17 Jan 2008) | 2 lines

major reliability and performance improvement in VWMI monitoring for FXO ports (code by markster, me and dbailey)

................
r98992 | qwell | 2008-01-17 12:21:38 -0400 (Thu, 17 Jan 2008) | 13 lines

Merged revisions 98991 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

(Closes issue #11784)
........
r98991 | qwell | 2008-01-17 10:19:46 -0600 (Thu, 17 Jan 2008) | 4 lines

Add a clarification about the immediate= option of zapata.conf

Issue 11784, patch by klaus3000.

........

................
r98993 | mmichelson | 2008-01-17 12:26:41 -0400 (Thu, 17 Jan 2008) | 4 lines

Get the device state of the state interface instead of the interface when creating a new queue member.
Thanks to Atis Lezdins for bringing this up on the Asterisk-Dev mailing list.


................
r98994 | mmichelson | 2008-01-17 12:33:24 -0400 (Thu, 17 Jan 2008) | 3 lines

state_interface could be NULL, so use the never-NULL cur->state_interface for this check


................

Added:
    team/group/sip-tcptls/res/res_config_curl.c
      - copied unchanged from r98994, trunk/res/res_config_curl.c
Modified:
    team/group/sip-tcptls/   (props changed)
    team/group/sip-tcptls/CHANGES
    team/group/sip-tcptls/CREDITS
    team/group/sip-tcptls/Makefile
    team/group/sip-tcptls/acinclude.m4
    team/group/sip-tcptls/apps/app_queue.c
    team/group/sip-tcptls/build_tools/menuselect-deps.in
    team/group/sip-tcptls/cdr/cdr_adaptive_odbc.c
    team/group/sip-tcptls/channels/chan_iax2.c
    team/group/sip-tcptls/channels/chan_local.c
    team/group/sip-tcptls/channels/chan_sip.c
    team/group/sip-tcptls/channels/chan_zap.c
    team/group/sip-tcptls/codecs/codec_speex.c
    team/group/sip-tcptls/codecs/codec_zap.c
    team/group/sip-tcptls/configs/cdr_adaptive_odbc.conf.sample
    team/group/sip-tcptls/configs/phoneprov.conf.sample
    team/group/sip-tcptls/configs/sip.conf.sample
    team/group/sip-tcptls/configs/zapata.conf.sample
    team/group/sip-tcptls/configure
    team/group/sip-tcptls/configure.ac
    team/group/sip-tcptls/doc/tex/phoneprov.tex
    team/group/sip-tcptls/include/asterisk/autoconfig.h.in
    team/group/sip-tcptls/include/asterisk/frame.h
    team/group/sip-tcptls/include/asterisk/translate.h
    team/group/sip-tcptls/main/abstract_jb.c
    team/group/sip-tcptls/main/ast_expr2.c
    team/group/sip-tcptls/main/ast_expr2.h
    team/group/sip-tcptls/main/ast_expr2.y
    team/group/sip-tcptls/main/asterisk.c
    team/group/sip-tcptls/main/dial.c
    team/group/sip-tcptls/main/frame.c
    team/group/sip-tcptls/main/rtp.c
    team/group/sip-tcptls/main/translate.c
    team/group/sip-tcptls/main/utils.c
    team/group/sip-tcptls/makeopts.in
    team/group/sip-tcptls/res/res_phoneprov.c

Propchange: team/group/sip-tcptls/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/group/sip-tcptls/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/sip-tcptls/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Jan 17 10:59:09 2008
@@ -23,3 +23,4 @@
 autom4te.cache
 makeopts.embed_rules
 aclocal.m4
+update.log

Propchange: team/group/sip-tcptls/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 17 10:59:09 2008
@@ -1,1 +1,1 @@
-/trunk:1-98904
+/trunk:1-98994

Modified: team/group/sip-tcptls/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/CHANGES?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/CHANGES (original)
+++ team/group/sip-tcptls/CHANGES Thu Jan 17 10:59:09 2008
@@ -79,6 +79,9 @@
      output to make debugging on busy systems much easier.
   * New CLI commands "dialplan set extenpatternmatching true/false"
   * New CLI command: "core set chanvar" to set a channel variable from the CLI.
+  * Added an easy way to execute Asterisk CLI commands at startup.  Any commands
+    listed in the startup_commands file in the Asterisk configuration directory
+    will get executed.
 
 SIP changes
 -----------
@@ -448,6 +451,10 @@
      on as the channel's audio.  This is very useful for building custom
      vocoders or doing recording or analysis of the channel's audio in another
      application.
+  * Added a new module, res_config_curl, which permits using a HTTP POST url
+     to retrieve, create, update, and delete realtime information from a remote
+     web server.  Note that this module requires func_curl.so to be loaded for
+     backend functionality.
 
 Miscellaneous 
 -------------
@@ -480,4 +487,5 @@
   * A new option when starting a remote asterisk (rasterisk, asterisk -r) for
      specifying which socket to use to connect to the running Asterisk daemon
      (-s)
-
+  * Added logging to 'make update' command.  See update.log
+

Modified: team/group/sip-tcptls/CREDITS
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/CREDITS?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/CREDITS (original)
+++ team/group/sip-tcptls/CREDITS Thu Jan 17 10:59:09 2008
@@ -16,6 +16,9 @@
 nic.at - ENUM support in Asterisk
 
 Paul Bagyenda, Digital Solutions - for initial Voicetronix driver development
+
+John Todd, TalkPlus, Inc.  and JR Richardson, Ntegrated Solutions. - for funding
+    the development of SIP Session Timers support.
 
 === WISHLIST CONTRIBUTERS ===
 Jeremy McNamara - SpeeX support

Modified: team/group/sip-tcptls/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/Makefile?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/Makefile (original)
+++ team/group/sip-tcptls/Makefile Thu Jan 17 10:59:09 2008
@@ -474,7 +474,10 @@
 update: 
 	@if [ -d .svn ]; then \
 		echo "Updating from Subversion..." ; \
+		fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
 		svn update | tee update.out; \
+		torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
+		echo "`date`  Updated from revision $${fromrev} to $${torev}." >> update.log; \
 		rm -f .version; \
 		if [ `grep -c ^C update.out` -gt 0 ]; then \
 			echo ; echo "The following files have conflicts:" ; \

Modified: team/group/sip-tcptls/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/acinclude.m4?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/acinclude.m4 (original)
+++ team/group/sip-tcptls/acinclude.m4 Thu Jan 17 10:59:09 2008
@@ -210,9 +210,9 @@
 
 # Check for a package using $2-config. Similar to AST_EXT_LIB_CHECK,
 # but use $2-config to determine cflags and libraries to use.
-# $3 and $4 can be used to replace --cflags and --libs in the request 
-
-# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs])
+# $3 and $4 can be used to replace --cflags and --libs in the request
+
+# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs], [includes], [expression])
 AC_DEFUN([AST_EXT_TOOL_CHECK],
 [
     if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
@@ -223,8 +223,27 @@
 	    $1_INCLUDE=$(${CONFIG_$1} $A)
 	    if test x"$4" = x ; then A=--libs ; else A="$4" ; fi
 	    $1_LIB=$(${CONFIG_$1} $A)
-	    PBX_$1=1
-	    AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
+	    if test x"$5" != x ; then
+		saved_cppflags="${CPPFLAGS}"
+		if test "x${$1_DIR}" != "x"; then
+		    $1_INCLUDE="-I${$1_DIR}/include"
+		fi
+		CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+		AC_COMPILE_IFELSE(
+		    [ AC_LANG_PROGRAM( [ $5 ],
+				       [ $6; ]
+				       )],
+		    [   PBX_$1=1
+			AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
+		    ],
+		    []
+		)
+		CPPFLAGS="${saved_cppflags}"
+	    else
+		PBX_$1=1
+		AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
+	    fi
 	fi
     fi
 ])

Modified: team/group/sip-tcptls/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/apps/app_queue.c?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/apps/app_queue.c (original)
+++ team/group/sip-tcptls/apps/app_queue.c Thu Jan 17 10:59:09 2008
@@ -842,7 +842,7 @@
 			ast_copy_string(cur->membername, interface, sizeof(cur->membername));
 		if (!strchr(cur->interface, '/'))
 			ast_log(LOG_WARNING, "No location at interface '%s'\n", interface);
-		cur->status = ast_device_state(interface);
+		cur->status = ast_device_state(cur->state_interface);
 	}
 
 	return cur;

Modified: team/group/sip-tcptls/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/build_tools/menuselect-deps.in?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/build_tools/menuselect-deps.in (original)
+++ team/group/sip-tcptls/build_tools/menuselect-deps.in Thu Jan 17 10:59:09 2008
@@ -29,6 +29,7 @@
 PRI=@PBX_PRI@
 RADIUS=@PBX_RADIUS@
 SPEEX=@PBX_SPEEX@
+SPEEXDSP=@PBX_SPEEXDSP@
 SQLITE3=@PBX_SQLITE3@
 SQLITE=@PBX_SQLITE@
 SS7=@PBX_SS7@

Modified: team/group/sip-tcptls/cdr/cdr_adaptive_odbc.c
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/cdr/cdr_adaptive_odbc.c?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/cdr/cdr_adaptive_odbc.c (original)
+++ team/group/sip-tcptls/cdr/cdr_adaptive_odbc.c Thu Jan 17 10:59:09 2008
@@ -56,6 +56,7 @@
 struct columns {
 	char *name;
 	char *cdrname;
+	char *filtervalue;
 	SQLSMALLINT type;
 	SQLINTEGER size;
 	SQLSMALLINT decimals;
@@ -152,6 +153,31 @@
 
 		ast_verb(3, "Found adaptive CDR table %s@%s.\n", tableptr->table, tableptr->connection);
 
+		/* Check for filters first */
+		for (var = ast_variable_browse(cfg, catg); var; var = var->next) {
+			if (strncmp(var->name, "filter", 6) == 0) {
+				char *cdrvar = ast_strdupa(var->name + 6);
+				cdrvar = ast_strip(cdrvar);
+				ast_verb(3, "Found filter %s for cdr variable %s in %s@%s\n", var->value, cdrvar, tableptr->table, tableptr->connection);
+
+				entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(cdrvar) + 1 + strlen(var->value) + 1);
+				if (!entry) {
+					ast_log(LOG_ERROR, "Out of memory creating filter entry for CDR variable '%s' in table '%s' on connection '%s'\n", cdrvar, table, connection);
+					res = -1;
+					break;
+				}
+
+				/* NULL column entry means this isn't a column in the database */
+				entry->name = NULL;
+				entry->cdrname = (char *)entry + sizeof(*entry);
+				entry->filtervalue = (char *)entry + sizeof(*entry) + strlen(cdrvar) + 1;
+				strcpy(entry->cdrname, cdrvar);
+				strcpy(entry->filtervalue, var->value);
+
+				AST_LIST_INSERT_TAIL(&(tableptr->columns), entry, list);
+			}
+		}
+
 		while ((res = SQLFetch(stmt)) != SQL_NO_DATA && res != SQL_ERROR) {
 			char *cdrvar = "";
 
@@ -164,13 +190,14 @@
 			 * really don't parse this file all that often, anyway.
 			 */
 			for (var = ast_variable_browse(cfg, catg); var; var = var->next) {
-				if (strcasecmp(var->value, columnname) == 0) {
+				if (strncmp(var->name, "alias", 5) == 0 && strcasecmp(var->value, columnname) == 0) {
 					char *tmp = ast_strdupa(var->name + 5);
 					cdrvar = ast_strip(tmp);
 					ast_verb(3, "Found alias %s for column %s in %s@%s\n", cdrvar, columnname, tableptr->table, tableptr->connection);
 					break;
 				}
 			}
+
 			entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(columnname) + 1 + strlen(cdrvar) + 1);
 			if (!entry) {
 				ast_log(LOG_ERROR, "Out of memory creating entry for column '%s' in table '%s' on connection '%s'\n", columnname, table, connection);
@@ -341,6 +368,21 @@
 				 strcasecmp(entry->cdrname, "end") == 0) ? 0 : 1);
 
 			if (colptr) {
+				/* Check first if the column filters this entry.  Note that this
+				 * is very specifically NOT ast_strlen_zero(), because the filter
+				 * could legitimately specify that the field is blank, which is
+				 * different from the field being unspecified (NULL). */
+				if (entry->filtervalue && strcasecmp(colptr, entry->filtervalue) != 0) {
+					ast_verb(4, "CDR column '%s' with value '%s' does not match filter of"
+						" '%s'.  Cancelling this CDR.\n",
+						entry->cdrname, colptr, entry->filtervalue);
+					goto early_release;
+				}
+
+				/* Only a filter? */
+				if (ast_strlen_zero(entry->name))
+					continue;
+
 				LENGTHEN_BUF1(strlen(entry->name));
 
 				switch (entry->type) {
@@ -567,6 +609,7 @@
 		if (rows == 0) {
 			ast_log(LOG_WARNING, "cdr_adaptive_odbc: Insert failed on '%s:%s'.  CDR failed: %s\n", tableptr->connection, tableptr->table, sql);
 		}
+early_release:
 		ast_odbc_release_obj(obj);
 	}
 	AST_RWLIST_UNLOCK(&odbc_tables);

Modified: team/group/sip-tcptls/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/channels/chan_iax2.c?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/channels/chan_iax2.c (original)
+++ team/group/sip-tcptls/channels/chan_iax2.c Thu Jan 17 10:59:09 2008
@@ -1935,7 +1935,7 @@
 	  the IAX thread with the iaxsl lock held. */
 	struct iax_frame *fr = data;
 	fr->retrans = -1;
-	fr->af.has_timing_info = 0;
+	ast_clear_flag(&fr->af, AST_FRFLAG_HAS_TIMING_INFO);
 	if (iaxs[fr->callno] && !ast_test_flag(iaxs[fr->callno], IAX_ALREADYGONE))
 		iax2_queue_frame(fr->callno, &fr->af);
 	/* Free our iax frame */
@@ -2951,7 +2951,7 @@
 	if (peername) {
 		var = ast_load_realtime("iaxpeers", "name", peername, "host", "dynamic", NULL);
 		if (!var && sin)
-			var = ast_load_realtime("iaxpeers", "name", peername, "host", ast_inet_ntoa(sin->sin_addr));
+			var = ast_load_realtime("iaxpeers", "name", peername, "host", ast_inet_ntoa(sin->sin_addr), NULL);
 	} else if (sin) {
 		char porta[25];
 		sprintf(porta, "%d", ntohs(sin->sin_port));
@@ -3068,7 +3068,7 @@
 
 	var = ast_load_realtime("iaxusers", "name", username, "host", "dynamic", NULL);
 	if (!var)
-		var = ast_load_realtime("iaxusers", "name", username, "host", ast_inet_ntoa(sin->sin_addr));
+		var = ast_load_realtime("iaxusers", "name", username, "host", ast_inet_ntoa(sin->sin_addr), NULL);
 	if (!var && sin) {
 		char porta[6];
 		snprintf(porta, sizeof(porta), "%d", ntohs(sin->sin_port));

Modified: team/group/sip-tcptls/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/channels/chan_local.c?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/channels/chan_local.c (original)
+++ team/group/sip-tcptls/channels/chan_local.c Thu Jan 17 10:59:09 2008
@@ -501,8 +501,16 @@
 	isoutbound = IS_OUTBOUND(ast, p);
 	if (isoutbound) {
 		const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
-		if ((status) && (p->owner))
+		if ((status) && (p->owner)) {
+			/* Deadlock avoidance */
+			while (ast_channel_trylock(p->owner)) {
+				ast_mutex_unlock(&p->lock);
+				usleep(1);
+				ast_mutex_lock(&p->lock);
+			}
 			pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
+			ast_channel_unlock(p->owner);
+		}
 		p->chan = NULL;
 		ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
 		ast_module_user_remove(p->u_chan);

Modified: team/group/sip-tcptls/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/sip-tcptls/channels/chan_sip.c?view=diff&rev=98995&r1=98994&r2=98995
==============================================================================
--- team/group/sip-tcptls/channels/chan_sip.c (original)
+++ team/group/sip-tcptls/channels/chan_sip.c Thu Jan 17 10:59:09 2008
@@ -86,6 +86,45 @@
         <depend>res_features</depend>
  ***/
 
+/*!  \page sip_session_timers SIP Session Timers in Asterisk Chan_sip
+
+	The SIP Session-Timers is an extension of the SIP protocol that allows end-points and proxies to
+	refresh a session periodically. The sessions are kept alive by sending a RE-INVITE or UPDATE
+	request at a negotiated interval. If a session refresh fails then all the entities that support Session-
+	Timers clear their internal session state. In addition, UAs generate a BYE request in order to clear
+	the state in the proxies and the remote UA (this is done for the benefit of SIP entities in the path
+	that do not support Session-Timers).
+
+	The Session-Timers can be configured on a system-wide, per-user, or per-peer basis. The peruser/
+	per-peer settings override the global settings. The following new parameters have been
+	added to the sip.conf file.
+		session-timers=["accept", "originate", "refuse"]
+		session-expires=[integer]
+		session-minse=[integer]
+		session-refresher=["uas", "uac"]
+
+	The session-timers parameter in sip.conf defines the mode of operation of SIP session-timers feature in
+	Asterisk. The Asterisk can be configured in one of the following three modes:
+
+	1. Accept :: In the "accept" mode, the Asterisk server honors session-timers requests
+		made by remote end-points. A remote end-point can request Asterisk to engage
+		session-timers by either sending it an INVITE request with a "Supported: timer"
+		header in it or by responding to Asterisk's INVITE with a 200 OK that contains
+		Session-Expires: header in it. In this mode, the Asterisk server does not 
+		request session-timers from remote end-points. This is the default mode.
+	2. Originate :: In the "originate" mode, the Asterisk server requests the remote 
+		end-points to activate session-timers in addition to honoring such requests
+		made by the remote end-pints. In order to get as much protection as possible
+		against hanging SIP channels due to network or end-point failures, Asterisk
+		resends periodic re-INVITEs even if a remote end-point does not support
+		the session-timers feature.
+	3. Refuse :: In the "refuse" mode, Asterisk acts as if it does not support session-
+		timers for inbound or outbound requests. If a remote end-point requests
+		session-timers in a dialog, then Asterisk ignores that request unless it's
+		noted as a requirement (Require: header), in which case the INVITE is 
+		rejected with a 420 Bad Extension response.
+
+*/
 
 #include "asterisk.h"
 
@@ -199,6 +238,9 @@
 
 #define INITIAL_CSEQ                 101              /*!< our initial sip sequence number */
 
+#define DEFAULT_MAX_SE               1800             /*!< Session-Timer Default Session-Expires period (RFC 4028) */
+#define DEFAULT_MIN_SE               90               /*!< Session-Timer Default Min-SE period (RFC 4028) */
+
 /*! \brief Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
 {
@@ -347,6 +389,22 @@
 	REG_STATE_FAILED,	/*!< Registration failed after several tries */
 		/* fatal - no chance to proceed */
 };
+
+/*! \brief Modes in which Asterisk can be configured to run SIP Session-Timers */
+enum st_mode {
+        SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */ 
+        SESSION_TIMER_MODE_ACCEPT,      /*!< Honor inbound Session-Timer requests */
+        SESSION_TIMER_MODE_ORIGINATE,   /*!< Originate outbound and honor inbound requests */
+        SESSION_TIMER_MODE_REFUSE       /*!< Ignore inbound Session-Timers requests */
+};
+
+/*! \brief The entity playing the refresher role for Session-Timers */
+enum st_refresher {
+        SESSION_TIMER_REFRESHER_AUTO,    /*!< Negotiated                      */
+        SESSION_TIMER_REFRESHER_UAC,     /*!< Session is refreshed by the UAC */
+        SESSION_TIMER_REFRESHER_UAS      /*!< Session is refreshed by the UAS */
+};
+
 
 /*! \brief definition of a sip proxy server
  *
@@ -459,6 +517,8 @@
 #define SIP_OPT_NOREFERSUB	(1 << 14)
 #define SIP_OPT_HISTINFO	(1 << 15)
 #define SIP_OPT_RESPRIORITY	(1 << 16)
+#define SIP_OPT_UNKNOWN		(1 << 17)
+
 
 /*! \brief List of well-known SIP options. If we get this in a require,
    we should check the list and answer accordingly. */
@@ -473,8 +533,8 @@
 	{ SIP_OPT_REPLACES,	SUPPORTED,	"replace" },	
 	/* RFC3262: PRACK 100% reliability */
 	{ SIP_OPT_100REL,	NOT_SUPPORTED,	"100rel" },	
-	/* RFC4028: SIP Session Timers */
-	{ SIP_OPT_TIMER,	NOT_SUPPORTED,	"timer" },
+	/* RFC4028: SIP Session-Timers */
+	{ SIP_OPT_TIMER,	SUPPORTED,	"timer" },
 	/* RFC3959: SIP Early session support */
 	{ SIP_OPT_EARLY_SESSION, NOT_SUPPORTED,	"early-session" },
 	/* RFC3911: SIP Join header support */
@@ -513,7 +573,7 @@
 #define ALLOWED_METHODS "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY"
 
 /*! \brief SIP Extensions we support */
-#define SUPPORTED_EXTENSIONS "replaces" 
+#define SUPPORTED_EXTENSIONS "replaces, timer" 
 
 /*! \brief Standard SIP and TLS port from RFC 3261. DO NOT CHANGE THIS */
 #define STANDARD_SIP_PORT	5060
@@ -668,6 +728,12 @@
 static struct ast_flags global_flags[2] = {{0}};        /*!< global SIP_ flags */
 static char used_context[AST_MAX_CONTEXT]; /*!< name of automatically created context for unloading */
 
+static enum st_mode global_st_mode;           /*!< Mode of operation for Session-Timers           */
+static enum st_refresher global_st_refresher; /*!< Session-Timer refresher                        */
+static int global_min_se;                     /*!< Lowest threshold for session refresh interval  */
+static int global_max_se;                     /*!< Highest threshold for session refresh interval */
+
+
 AST_MUTEX_DEFINE_STATIC(netlock);
 
 /*! \brief Protect the monitoring thread, so only one process can kill or start it, and not
@@ -1044,6 +1110,37 @@
 	int localtransfer;				/*!< Transfer to local domain? */
 	enum referstatus status;			/*!< REFER status */
 };
+
+
+/*! \brief Structure that encapsulates all attributes related to running 
+ *   SIP Session-Timers feature on a per dialog basis.
+ */
+struct sip_st_dlg {
+	int st_active;                          /*!< Session-Timers on/off */ 
+	int st_interval;                        /*!< Session-Timers negotiated session refresh interval */
+	int st_schedid;                         /*!< Session-Timers ast_sched scheduler id */
+	enum st_refresher st_ref;               /*!< Session-Timers session refresher */
+	int st_expirys;                         /*!< Session-Timers number of expirys */
+	int st_active_peer_ua;                  /*!< Session-Timers on/off in peer UA */
+	int st_cached_min_se;                   /*!< Session-Timers cached Min-SE */
+	int st_cached_max_se;                   /*!< Session-Timers cached Session-Expires */
+	enum st_mode st_cached_mode;            /*!< Session-Timers cached M.O. */
+	enum st_refresher st_cached_ref;        /*!< Session-Timers cached refresher */
+};
+
+
+/*! \brief Structure that encapsulates all attributes related to configuration 
+ *   of SIP Session-Timers feature on a per user/peer basis.
+ */
+struct sip_st_cfg {
+	enum st_mode st_mode_oper;      /*!< Mode of operation for Session-Timers           */
+	enum st_refresher st_ref;       /*!< Session-Timer refresher                        */
+	int st_min_se;                  /*!< Lowest threshold for session refresh interval  */
+	int st_max_se;                  /*!< Highest threshold for session refresh interval */
+};
+
+
+
 
 /*! \brief sip_pvt: structures used for each SIP dialog, ie. a call, a registration, a subscribe.
  * Created and initialized by sip_alloc(), the descriptor goes into the list of
@@ -1118,6 +1215,7 @@
 	int timer_t1;				/*!< SIP timer T1, ms rtt */
 	int timer_b;            /*!< SIP timer B, ms */
 	unsigned int sipoptions;		/*!< Supported SIP options on the other end */
+	unsigned int reqsipoptions;		/*!< Required SIP options on the other end */
 	struct ast_codec_pref prefs;		/*!< codec prefs */
 	int capability;				/*!< Special capability (codec) */
 	int jointcapability;			/*!< Supported capability at both ends (codecs) */
@@ -1138,6 +1236,8 @@
 	char tag[11];				/*!< Our tag for this session */
 	int sessionid;				/*!< SDP Session ID */
 	int sessionversion;			/*!< SDP Session Version */
+	int sessionversion_remote;		/*!< Remote UA's SDP Session Version */
+	int session_modify;			/*!< Session modification request true/false  */
 	struct sockaddr_in sa;			/*!< Our peer */
 	struct sockaddr_in redirip;		/*!< Where our RTP should be going if not to us */
 	struct sockaddr_in vredirip;		/*!< Where our Video RTP should be going if not to us */
@@ -1187,7 +1287,9 @@
 							before strolling to the Grokyzpå
 							(A bit unsure of this, please correct if
 							you know more) */
+	struct sip_st_dlg *stimer;		/*!< SIP Session-Timers */              
 };
+
 
 /*! Max entires in the history list for a sip_pvt */
 #define MAX_HISTORY_ENTRIES 50
@@ -1293,6 +1395,7 @@
 	struct ast_variable *chanvars;	/*!< Variables to set for channel created by user */
 	int maxcallbitrate;		/*!< Maximum Bitrate for a video call */
 	int autoframing;
+	struct sip_st_cfg stimer;	/*!< SIP Session-Timers */
 };
 
 /*!
@@ -1380,8 +1483,9 @@
 	struct ast_variable *chanvars;	/*!<  Variables to set for channel created by user */
 	struct sip_pvt *mwipvt;		/*!<  Subscription for MWI */
 	int autoframing;
-	int timer_t1;		/*!<  The maximum T1 value for the peer */
-	int timer_b;      /*!<  The maximum timer B (transaction timeouts) */
+	struct sip_st_cfg stimer;	/*!<  SIP Session-Timers */
+	int timer_t1;			/*!<  The maximum T1 value for the peer */
+	int timer_b;			/*!<  The maximum timer B (transaction timeouts) */
 };
 
 
@@ -1584,7 +1688,7 @@
 static int transmit_response(struct sip_pvt *p, const char *msg, const struct sip_request *req);
 static int transmit_response_reliable(struct sip_pvt *p, const char *msg, const struct sip_request *req);
 static int transmit_response_with_date(struct sip_pvt *p, const char *msg, const struct sip_request *req);
-static int transmit_response_with_sdp(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable);
+static int transmit_response_with_sdp(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable, int oldsdp);
 static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *unsupported);
 static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *rand, enum xmittype reliable, const char *header, int stale);
 static int transmit_response_with_allow(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable);
@@ -1592,7 +1696,7 @@
 static int transmit_request(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);

[... 3359 lines stripped ...]



More information about the svn-commits mailing list