[svn-commits] oej: branch oej/codename-pineapple r47602 - in /team/oej/codename-pineapple: ...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Nov 14 07:34:45 MST 2006


Author: oej
Date: Tue Nov 14 08:34:44 2006
New Revision: 47602

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47602
Log:
Trying to reset automerge...

Modified:
    team/oej/codename-pineapple/   (props changed)
    team/oej/codename-pineapple/CHANGES
    team/oej/codename-pineapple/Makefile
    team/oej/codename-pineapple/UPGRADE.txt
    team/oej/codename-pineapple/acinclude.m4
    team/oej/codename-pineapple/apps/app_chanspy.c
    team/oej/codename-pineapple/apps/app_meetme.c
    team/oej/codename-pineapple/apps/app_queue.c
    team/oej/codename-pineapple/apps/app_read.c
    team/oej/codename-pineapple/apps/app_sms.c
    team/oej/codename-pineapple/apps/app_voicemail.c
    team/oej/codename-pineapple/build_tools/prep_moduledeps
    team/oej/codename-pineapple/cdr/cdr_pgsql.c
    team/oej/codename-pineapple/channels/chan_h323.c
    team/oej/codename-pineapple/channels/chan_iax2.c
    team/oej/codename-pineapple/channels/chan_mgcp.c
    team/oej/codename-pineapple/channels/chan_phone.c
    team/oej/codename-pineapple/channels/chan_sip.c
    team/oej/codename-pineapple/channels/chan_sip3.c
    team/oej/codename-pineapple/channels/chan_skinny.c
    team/oej/codename-pineapple/channels/chan_vpb.cc
    team/oej/codename-pineapple/channels/chan_zap.c
    team/oej/codename-pineapple/channels/sip3/sip3.h
    team/oej/codename-pineapple/channels/sip3/sip3_cliami.c
    team/oej/codename-pineapple/channels/sip3/sip3_dialog.c
    team/oej/codename-pineapple/codecs/codec_zap.c
    team/oej/codename-pineapple/configs/manager.conf.sample
    team/oej/codename-pineapple/configs/musiconhold.conf.sample
    team/oej/codename-pineapple/configs/queues.conf.sample
    team/oej/codename-pineapple/configs/res_odbc.conf.sample
    team/oej/codename-pineapple/configs/sip.conf.sample
    team/oej/codename-pineapple/configs/zapata.conf.sample
    team/oej/codename-pineapple/configure
    team/oej/codename-pineapple/configure.ac
    team/oej/codename-pineapple/include/asterisk/app.h
    team/oej/codename-pineapple/include/asterisk/term.h
    team/oej/codename-pineapple/main/app.c
    team/oej/codename-pineapple/main/asterisk.c
    team/oej/codename-pineapple/main/channel.c
    team/oej/codename-pineapple/main/cli.c
    team/oej/codename-pineapple/main/config.c
    team/oej/codename-pineapple/main/frame.c
    team/oej/codename-pineapple/main/logger.c
    team/oej/codename-pineapple/main/pbx.c
    team/oej/codename-pineapple/main/term.c
    team/oej/codename-pineapple/pbx/ael/ael-test/ref.ael-test3
    team/oej/codename-pineapple/pbx/pbx_ael.c
    team/oej/codename-pineapple/pbx/pbx_dundi.c
    team/oej/codename-pineapple/res/res_odbc.c
    team/oej/codename-pineapple/utils/astman.c
    team/oej/codename-pineapple/utils/check_expr.c
    team/oej/codename-pineapple/utils/streamplayer.c

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
--- svn:externals (original)
+++ svn:externals Tue Nov 14 08:34:44 2006
@@ -1,1 +1,1 @@
-menuselect	http://svn.digium.com/svn/menuselect/branches/1.0
+menuselect	https://origsvn.digium.com/svn/menuselect/branches/1.0

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Nov 14 08:34:44 2006
@@ -22,3 +22,4 @@
 menuselect-tree
 autom4te.cache
 makeopts.embed_rules
+aclocal.m4

Propchange: team/oej/codename-pineapple/
            ('svnmerge-blocked' removed)

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 14 08:34:44 2006
@@ -1,1 +1,1 @@
-/trunk:1-47167
+/trunk:1-47601

Modified: team/oej/codename-pineapple/CHANGES
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/CHANGES?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/CHANGES (original)
+++ team/oej/codename-pineapple/CHANGES Tue Nov 14 08:34:44 2006
@@ -58,3 +58,6 @@
   * Added QUEUE_VARIABLES function to set queue variables added setqueuevar and 
     setqueueentryvar options for each queue, see queues.conf.sample for details.
   * Brazilian Portuguese (pt-BR) in VM, and say.c was added via patch from cfassoni.
+  * CID matching information is now shown when doing 'dialplan show'.
+  * app_queue now has a 'loose' option which is almost exactly like 'strict' except it
+     does not count paused queue members as unavailable.

Modified: team/oej/codename-pineapple/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/Makefile?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/Makefile (original)
+++ team/oej/codename-pineapple/Makefile Tue Nov 14 08:34:44 2006
@@ -683,6 +683,8 @@
 	rm -rf $(DESTDIR)$(ASTETCDIR)
 	rm -rf $(DESTDIR)$(ASTLOGDIR)
 
+menuconfig: menuselect
+
 menuselect: menuselect/menuselect menuselect-tree
 	- at menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 

Modified: team/oej/codename-pineapple/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/UPGRADE.txt?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/UPGRADE.txt (original)
+++ team/oej/codename-pineapple/UPGRADE.txt Tue Nov 14 08:34:44 2006
@@ -3,6 +3,6 @@
 
 Manager:
 
-* The CallerID fields across manager events have now been made more
+* The CallerID fields across Manager events have now been made more
   consistent. CallerID Number will be sent as CallerIDNum and CallerID
   Name will be sent as CallerIDName wherever used.

Modified: team/oej/codename-pineapple/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/acinclude.m4?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/acinclude.m4 (original)
+++ team/oej/codename-pineapple/acinclude.m4 Tue Nov 14 08:34:44 2006
@@ -567,3 +567,140 @@
       [ac_cv_func_fork_works=no],
       [ac_cv_func_fork_works=cross])])]
 )# _AST_FUNC_FORK
+
+# AST_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AST_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([AST_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AST_PROG_LD_GNU
+])# AST_PROG_LD
+
+
+# AST_PROG_LD_GNU
+# --------------
+AC_DEFUN([AST_PROG_LD_GNU],
+[AC_REQUIRE([AST_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AST_PROG_LD_GNU
+
+# AST_PROG_EGREP
+# -------------
+m4_ifndef([AST_PROG_EGREP], [AC_DEFUN([AST_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])]) # AST_PROG_EGREP
+
+# AST_PROG_SED
+# -----------
+# Check for a fully functional sed program that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([AST_PROG_SED],
+[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
+    [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
+     dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
+     ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" | sed 99q >conftest.sed
+     $as_unset ac_script || ac_script=
+     _AC_PATH_PROG_FEATURE_CHECK(SED, [sed gsed],
+	[_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED],
+		["$ac_path_SED" -f conftest.sed])])])
+ SED="$ac_cv_path_SED"
+ AC_SUBST([SED])dnl
+ rm -f conftest.sed
+])# AST_PROG_SED
+

Modified: team/oej/codename-pineapple/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_chanspy.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/apps/app_chanspy.c (original)
+++ team/oej/codename-pineapple/apps/app_chanspy.c Tue Nov 14 08:34:44 2006
@@ -658,7 +658,8 @@
 
 	if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
 		context = argv[0];
-		exten = strsep(&context, "@");
+		if (!ast_strlen_zero(argv[0]))
+			exten = strsep(&context, "@");
 		if (ast_strlen_zero(context))
 			context = ast_strdupa(chan->context);
 		if (argc > 1)

Modified: team/oej/codename-pineapple/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_meetme.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/apps/app_meetme.c (original)
+++ team/oej/codename-pineapple/apps/app_meetme.c Tue Nov 14 08:34:44 2006
@@ -2315,10 +2315,12 @@
 					ast_waitstream(chan, "");
 			} else {
 				if (sscanf(confno, "%d", &confno_int) == 1) {
-					res = ast_streamfile(chan, "conf-enteringno", chan->language);
-					if (!res) {
-						ast_waitstream(chan, "");
-						res = ast_say_digits(chan, confno_int, "", chan->language);
+					if (!ast_test_flag(&confflags, CONFFLAG_QUIET)) {
+						res = ast_streamfile(chan, "conf-enteringno", chan->language);
+						if (!res) {
+							ast_waitstream(chan, "");
+							res = ast_say_digits(chan, confno_int, "", chan->language);
+						}
 					}
 				} else {
 					ast_log(LOG_ERROR, "Could not scan confno '%s'\n", confno);

Modified: team/oej/codename-pineapple/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_queue.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/apps/app_queue.c (original)
+++ team/oej/codename-pineapple/apps/app_queue.c Tue Nov 14 08:34:44 2006
@@ -338,6 +338,7 @@
 /* values used in multi-bit flags in call_queue */
 #define QUEUE_EMPTY_NORMAL 1
 #define QUEUE_EMPTY_STRICT 2
+#define QUEUE_EMPTY_LOOSE 3
 #define ANNOUNCEHOLDTIME_ALWAYS 1
 #define ANNOUNCEHOLDTIME_ONCE 2
 #define QUEUE_EVENT_VARIABLES 3
@@ -488,6 +489,7 @@
 enum queue_member_status {
 	QUEUE_NO_MEMBERS,
 	QUEUE_NO_REACHABLE_MEMBERS,
+	QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS,
 	QUEUE_NORMAL
 };
 
@@ -500,19 +502,23 @@
 	for (member = q->members; member; member = member->next) {
 		if (max_penalty && (member->penalty > max_penalty))
 			continue;
-
-		if (member->paused) continue;
 
 		switch (member->status) {
 		case AST_DEVICE_INVALID:
 			/* nothing to do */
 			break;
 		case AST_DEVICE_UNAVAILABLE:
-			result = QUEUE_NO_REACHABLE_MEMBERS;
+			if (result != QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS) 
+				result = QUEUE_NO_REACHABLE_MEMBERS;
 			break;
 		default:
-			ast_mutex_unlock(&q->lock);
-			return QUEUE_NORMAL;
+			if (member->paused) {
+				result = QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS;
+			} else {
+				ast_mutex_unlock(&q->lock);
+				return QUEUE_NORMAL;
+			}
+			break;
 		}
 	}
 	
@@ -903,14 +909,18 @@
 			q->strategy = QUEUE_STRATEGY_RINGALL;
 		}
 	} else if (!strcasecmp(param, "joinempty")) {
-		if (!strcasecmp(val, "strict"))
+		if (!strcasecmp(val, "loose"))
+			q->joinempty = QUEUE_EMPTY_LOOSE;
+		else if (!strcasecmp(val, "strict"))
 			q->joinempty = QUEUE_EMPTY_STRICT;
 		else if (ast_true(val))
 			q->joinempty = QUEUE_EMPTY_NORMAL;
 		else
 			q->joinempty = 0;
 	} else if (!strcasecmp(param, "leavewhenempty")) {
-		if (!strcasecmp(val, "strict"))
+		if (!strcasecmp(val, "loose"))
+			q->leavewhenempty = QUEUE_EMPTY_LOOSE;
+		else if (!strcasecmp(val, "strict"))
 			q->leavewhenempty = QUEUE_EMPTY_STRICT;
 		else if (ast_true(val))
 			q->leavewhenempty = QUEUE_EMPTY_NORMAL;
@@ -1189,7 +1199,9 @@
 	stat = get_member_status(q, qe->max_penalty);
 	if (!q->joinempty && (stat == QUEUE_NO_MEMBERS))
 		*reason = QUEUE_JOINEMPTY;
-	else if ((q->joinempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS))
+	else if ((q->joinempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS || stat == QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS))
+		*reason = QUEUE_JOINUNAVAIL;
+	else if ((q->joinempty == QUEUE_EMPTY_LOOSE) && (stat == QUEUE_NO_REACHABLE_MEMBERS))
 		*reason = QUEUE_JOINUNAVAIL;
 	else if (q->maxlen && (q->count >= q->maxlen))
 		*reason = QUEUE_FULL;
@@ -2207,7 +2219,13 @@
 		}
 
 		/* leave the queue if no reachable agents, if enabled */
-		if ((qe->parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
+		if ((qe->parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS || stat == QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS)) {
+			*reason = QUEUE_LEAVEUNAVAIL;
+			ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long)time(NULL) - qe->start);
+			leave_queue(qe);
+			break;
+		}
+		if ((qe->parent->leavewhenempty == QUEUE_EMPTY_LOOSE) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
 			*reason = QUEUE_LEAVEUNAVAIL;
 			ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long)time(NULL) - qe->start);
 			leave_queue(qe);
@@ -3200,8 +3218,8 @@
 
 	switch (remove_from_queue(args.queuename, args.interface)) {
 	case RES_OKAY:
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Removed interface '%s' from queue '%s'\n", args.interface, args.queuename);
+		ast_queue_log(args.queuename, chan->uniqueid, args.interface, "REMOVEMEMBER", "%s", "");
+		ast_log(LOG_NOTICE, "Removed interface '%s' from queue '%s'\n", args.interface, args.queuename);
 		pbx_builtin_setvar_helper(chan, "RQMSTATUS", "REMOVED");
 		res = 0;
 		break;
@@ -3276,6 +3294,7 @@
 
 	switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members)) {
 	case RES_OKAY:
+		ast_queue_log(args.queuename, chan->uniqueid, args.interface, "ADDMEMBER", "%s", "");
 		ast_log(LOG_NOTICE, "Added interface '%s' to queue '%s'\n", args.interface, args.queuename);
 		pbx_builtin_setvar_helper(chan, "AQMSTATUS", "ADDED");
 		res = 0;
@@ -3531,7 +3550,13 @@
 				}
 
 				/* leave the queue if no reachable agents, if enabled */
-				if ((qe.parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
+				if ((qe.parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS || stat == QUEUE_NO_UNPAUSED_REACHABLE_MEMBERS)) {
+					record_abandoned(&qe);
+					reason = QUEUE_LEAVEUNAVAIL;
+					res = 0;
+					break;
+				}
+				if ((qe.parent->leavewhenempty == QUEUE_EMPTY_LOOSE) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
 					record_abandoned(&qe);
 					reason = QUEUE_LEAVEUNAVAIL;
 					res = 0;
@@ -4365,6 +4390,7 @@
 
 	switch (add_to_queue(queuename, interface, membername, penalty, paused, queue_persistent_members)) {
 	case RES_OKAY:
+		ast_queue_log(queuename, "MANAGER", interface, "ADDMEMBER", "%s", "");
 		astman_send_ack(s, m, "Added interface to queue");
 		break;
 	case RES_EXISTS:
@@ -4395,6 +4421,7 @@
 
 	switch (remove_from_queue(queuename, interface)) {
 	case RES_OKAY:
+		ast_queue_log(queuename, "MANAGER", interface, "REMOVEMEMBER", "%s", "");
 		astman_send_ack(s, m, "Removed interface from queue");
 		break;
 	case RES_EXISTS:
@@ -4473,6 +4500,7 @@
 
 	switch (add_to_queue(queuename, interface, membername, penalty, 0, queue_persistent_members)) {
 	case RES_OKAY:
+		ast_queue_log(queuename, "CLI", interface, "ADDMEMBER", "%s", "");
 		ast_cli(fd, "Added interface '%s' to queue '%s'\n", interface, queuename);
 		return RESULT_SUCCESS;
 	case RES_EXISTS:
@@ -4535,6 +4563,7 @@
 
 	switch (remove_from_queue(queuename, interface)) {
 	case RES_OKAY:
+		ast_queue_log(queuename, "CLI", interface, "REMOVEMEMBER", "%s", "");
 		ast_cli(fd, "Removed interface '%s' from queue '%s'\n", interface, queuename);
 		return RESULT_SUCCESS;
 	case RES_EXISTS:

Modified: team/oej/codename-pineapple/apps/app_read.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_read.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/apps/app_read.c (original)
+++ team/oej/codename-pineapple/apps/app_read.c Tue Nov 14 08:34:44 2006
@@ -62,10 +62,10 @@
 static char *synopsis = "Read a variable";
 
 static char *descrip = 
-"  Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n"
+"  Read(variable[|filename[&filename2...]][|maxdigits][|option][|attempts][|timeout])\n\n"
 "Reads a #-terminated string of digits a certain number of times from the\n"
 "user in to the given variable.\n"
-"  filename   -- file to play before reading digits or tone with option i\n"
+"  filename   -- file(s) to play before reading digits or tone with option i\n"
 "  maxdigits  -- maximum acceptable number of digits. Stops reading after\n"
 "                maxdigits have been entered (without requiring the user to\n"
 "                press the '#' key).\n"

Modified: team/oej/codename-pineapple/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_sms.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/apps/app_sms.c (original)
+++ team/oej/codename-pineapple/apps/app_sms.c Tue Nov 14 08:34:44 2006
@@ -1046,7 +1046,7 @@
 		unsigned char p = 2;
 		h->omsg[0] = 0x91;		  /* SMS_DATA */
 		if (h->smsc) {			 /* deliver */
-			h->omsg[p++] = (more ? 4 : 0);
+			h->omsg[p++] = (more ? 4 : 0) + ((h->udhl > 0) ? 0x40 : 0);
 			p += packaddress (h->omsg + p, h->oa);
 			h->omsg[p++] = h->pid;
 			h->omsg[p++] = h->dcs;

Modified: team/oej/codename-pineapple/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_voicemail.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/apps/app_voicemail.c (original)
+++ team/oej/codename-pineapple/apps/app_voicemail.c Tue Nov 14 08:34:44 2006
@@ -7512,13 +7512,17 @@
 			tmpread = tmpwrite = emailbody;
 			while ((tmpwrite = strchr(tmpread,'\\'))) {
 				switch (tmpwrite[1]) {
+				case 'r':
+					memmove(tmpwrite + 1, tmpwrite + 2, strlen(tmpwrite + 2) + 1);
+					*tmpwrite = '\r';
+					break;
 				case 'n':
-					*tmpwrite++ = '\n';
-					memmove(tmpwrite, tmpwrite + 1, strlen(tmpwrite + 1) + 1);
+					memmove(tmpwrite + 1, tmpwrite + 2, strlen(tmpwrite + 2) + 1);
+					*tmpwrite = '\n';
 					break;
 				case 't':
-					*tmpwrite++ = '\t';
-					memmove(tmpwrite, tmpwrite + 1, strlen(tmpwrite + 1) + 1);
+					memmove(tmpwrite + 1, tmpwrite + 2, strlen(tmpwrite + 2) + 1);
+					*tmpwrite = '\t';
 					break;
 				default:
 					ast_log(LOG_NOTICE, "Substitution routine does not support this character: %c\n", tmpwrite[1]);
@@ -7536,13 +7540,17 @@
 			tmpread = tmpwrite = pagerbody;
 			while ((tmpwrite = strchr(tmpread, '\\'))) {
 				switch (tmpwrite[1]) {
+				case 'r':
+					memmove(tmpwrite + 1, tmpwrite + 2, strlen(tmpwrite + 2) + 1);
+					*tmpwrite = '\r';
+					break;
 				case 'n':
-					*tmpwrite++ = '\n';
-					memmove(tmpwrite, tmpwrite + 1, strlen(tmpwrite + 1) + 1);
+					memmove(tmpwrite + 1, tmpwrite + 2, strlen(tmpwrite + 2) + 1);
+					*tmpwrite = '\n';
 					break;
 				case 't':
-					*tmpwrite++ = '\t';
-					memmove(tmpwrite, tmpwrite + 1, strlen(tmpwrite + 1) + 1);
+					memmove(tmpwrite + 1, tmpwrite + 2, strlen(tmpwrite + 2) + 1);
+					*tmpwrite = '\t';
 					break;
 				default:
 					ast_log(LOG_NOTICE, "Substitution routine does not support this character: %c\n", tmpwrite[1]);
@@ -8765,6 +8773,10 @@
 }
 
 #endif /* IMAP_STORAGE */
+
+/* This is a workaround so that menuselect displays a proper description
+ * AST_MODULE_INFO(, , "Comedian Mail (Voicemail System)"
+ */
  
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
 		.load = load_module,

Modified: team/oej/codename-pineapple/build_tools/prep_moduledeps
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/build_tools/prep_moduledeps?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/build_tools/prep_moduledeps (original)
+++ team/oej/codename-pineapple/build_tools/prep_moduledeps Tue Nov 14 08:34:44 2006
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 get_description() {
-	TDESC=`grep -e AST_MODULE_INFO ${1} | cut -d '"' -f 2`
+	TDESC=`grep -e AST_MODULE_INFO ${1} | head -n 1 | cut -d '"' -f 2`
 }
 
 process_dir() {

Modified: team/oej/codename-pineapple/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/cdr/cdr_pgsql.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/cdr/cdr_pgsql.c (original)
+++ team/oej/codename-pineapple/cdr/cdr_pgsql.c Tue Nov 14 08:34:44 2006
@@ -66,8 +66,8 @@
 
 AST_MUTEX_DEFINE_STATIC(pgsql_lock);
 
-static PGconn	*conn;
-static PGresult	*result;
+static PGconn	*conn = NULL;
+static PGresult	*result = NULL;
 
 static int pgsql_log(struct ast_cdr *cdr)
 {

Modified: team/oej/codename-pineapple/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_h323.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/channels/chan_h323.c (original)
+++ team/oej/codename-pineapple/channels/chan_h323.c Tue Nov 14 08:34:44 2006
@@ -2611,17 +2611,17 @@
 
 static int h323_do_trace(int fd, int argc, char *argv[])
 {
-	if (argc != 3) {
+	if (argc != 4) {
 		return RESULT_SHOWUSAGE;
 	}
-	h323_debug(1, atoi(argv[2]));
+	h323_debug(1, atoi(argv[3]));
 	ast_cli(fd, "H.323 trace set to level %s\n", argv[2]);
 	return RESULT_SUCCESS;
 }
 
 static int h323_no_trace(int fd, int argc, char *argv[])
 {
-	if (argc != 3) {
+	if (argc < 3 || argc > 4) {
 		return RESULT_SHOWUSAGE;
 	}
 	h323_debug(0,0);
@@ -2631,7 +2631,7 @@
 
 static int h323_do_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 2) {
+	if (argc < 2 || argc > 3) {
 		return RESULT_SHOWUSAGE;
 	}
 	h323debug = 1;
@@ -2641,7 +2641,7 @@
 
 static int h323_no_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 3) {
+	if (argc < 3 || argc > 4) {
 		return RESULT_SHOWUSAGE;
 	}
 	h323debug = 0;
@@ -2754,20 +2754,35 @@
 	h323_tokens_show, "Show all active call tokens",
 	show_tokens_usage };
 
+static struct ast_cli_entry cli_h323_debug_deprecated = {
+	{ "h.323", "debug", NULL },
+	h323_do_debug, "Enable H.323 debug",
+	debug_usage };
+
+static struct ast_cli_entry cli_h323_trace_deprecated = {
+	{ "h.323", "trace", NULL },
+	h323_do_trace, "Enable H.323 Stack Tracing",
+	trace_usage };
+
+static struct ast_cli_entry cli_h323_gk_cycle_deprecated = {
+	{ "h323", "cycle", "gk", NULL },
+	h323_gk_cycle, "Manually re-register with the Gatekeper",
+	show_cycle_usage };
+
 static struct ast_cli_entry cli_h323[] = {
-	{ { "h323", "trace", NULL },
+	{ { "h323", "set", "trace", NULL },
 	h323_do_trace, "Enable H.323 Stack Tracing",
 	trace_usage, NULL, &cli_h323_trace_deprecated },
 
-	{ { "h323", "trace", "off", NULL },
+	{ { "h323", "set", "trace", "off", NULL },
 	h323_no_trace, "Disable H.323 Stack Tracing",
 	no_trace_usage, NULL, &cli_h323_no_trace_deprecated },
 
-	{ { "h323", "debug", NULL },
+	{ { "h323", "set", "debug", NULL },
 	h323_do_debug, "Enable H.323 debug",
 	debug_usage, NULL, &cli_h323_debug_deprecated },
 
-	{ { "h323", "debug", "off", NULL },
+	{ { "h323", "set", "debug", "off", NULL },
 	h323_no_debug, "Disable H.323 debug",
 	no_debug_usage, NULL, &cli_h323_no_debug_deprecated },
 

Modified: team/oej/codename-pineapple/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_iax2.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/channels/chan_iax2.c (original)
+++ team/oej/codename-pineapple/channels/chan_iax2.c Tue Nov 14 08:34:44 2006
@@ -4222,30 +4222,22 @@
 
 static int iax2_show_firmware(int fd, int argc, char *argv[])
 {
-#define FORMAT2 "%-15.15s  %-15.15s %-15.15s\n"
-#if !defined(__FreeBSD__)
-#define FORMAT "%-15.15s  %-15d %-15d\n"
-#else /* __FreeBSD__ */
-#define FORMAT "%-15.15s  %-15d %-15d\n" /* XXX 2.95 ? */
-#endif /* __FreeBSD__ */
 	struct iax_firmware *cur = NULL;
 
 	if ((argc != 3) && (argc != 4))
 		return RESULT_SHOWUSAGE;
 
+	ast_cli(fd, "%-15.15s  %-15.15s %-15.15s\n", "Device", "Version", "Size");
 	AST_LIST_LOCK(&firmwares);
-	
-	ast_cli(fd, FORMAT2, "Device", "Version", "Size");
-	AST_LIST_TRAVERSE(&firmwares, cur, list)
-		if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname))) 
-			ast_cli(fd, FORMAT, cur->fwh->devname, ntohs(cur->fwh->version),
-				(int)ntohl(cur->fwh->datalen));
-
+	AST_LIST_TRAVERSE(&firmwares, cur, list) {
+		if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname)))  {
+			ast_cli(fd, "%-15.15s  %-15d %-15d\n", cur->fwh->devname, 
+				ntohs(cur->fwh->version), (int)ntohl(cur->fwh->datalen));
+		}
+	}
 	AST_LIST_UNLOCK(&firmwares);
 
 	return RESULT_SUCCESS;
-#undef FORMAT
-#undef FORMAT2
 }
 
 /* JDG: callback to display iax peers in manager */
@@ -4449,7 +4441,7 @@
 
 static int iax2_do_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 2)
+	if (argc < 2 || argc > 3)
 		return RESULT_SHOWUSAGE;
 	iaxdebug = 1;
 	ast_cli(fd, "IAX2 Debugging Enabled\n");
@@ -4458,7 +4450,7 @@
 
 static int iax2_do_trunk_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 3)
+	if (argc < 3 || argc > 4)
 		return RESULT_SHOWUSAGE;
 	iaxtrunkdebug = 1;
 	ast_cli(fd, "IAX2 Trunk Debug Requested\n");
@@ -4467,7 +4459,7 @@
 
 static int iax2_do_jb_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 3)
+	if (argc < 3 || argc > 4)
 		return RESULT_SHOWUSAGE;
 	jb_setoutput(jb_error_output, jb_warning_output, jb_debug_output);
 	ast_cli(fd, "IAX2 Jitterbuffer Debugging Enabled\n");
@@ -4476,7 +4468,7 @@
 
 static int iax2_no_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 3)
+	if (argc < 3 || argc > 4)
 		return RESULT_SHOWUSAGE;
 	iaxdebug = 0;
 	ast_cli(fd, "IAX2 Debugging Disabled\n");
@@ -4485,7 +4477,7 @@
 
 static int iax2_no_trunk_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 4)
+	if (argc < 4 || argc > 5)
 		return RESULT_SHOWUSAGE;
 	iaxtrunkdebug = 0;
 	ast_cli(fd, "IAX2 Trunk Debugging Disabled\n");
@@ -4494,7 +4486,7 @@
 
 static int iax2_no_jb_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 4)
+	if (argc < 4 || argc > 5)
 		return RESULT_SHOWUSAGE;
 	iaxtrunkdebug = 0;
 	ast_cli(fd, "IAX2 Trunk Debugging Disabled\n");
@@ -9502,14 +9494,14 @@
 	struct iax2_peer *peer;
 	char *peername, *colname;
 
-	if (chan->tech != &iax2_tech)
-		return -1;
-
 	peername = ast_strdupa(data);
 
 	/* if our channel, return the IP address of the endpoint of current channel */
 	if (!strcmp(peername,"CURRENTCHANNEL")) {
-	        unsigned short callno = PTR_TO_CALLNO(chan->tech_pvt);
+	        unsigned short callno;
+		if (chan->tech != &iax2_tech)
+			return -1;
+		callno = PTR_TO_CALLNO(chan->tech_pvt);	
 		ast_copy_string(buf, iaxs[callno]->addr.sin_addr.s_addr ? ast_inet_ntoa(iaxs[callno]->addr.sin_addr) : "", len);
 		return 0;
 	}
@@ -9699,27 +9691,27 @@
 "       Lists all registration requests and status.\n";
 
 static char debug_usage[] = 
-"Usage: iax2 debug\n"
+"Usage: iax2 set debug\n"
 "       Enables dumping of IAX packets for debugging purposes\n";
 
 static char no_debug_usage[] = 
-"Usage: iax2 nodebug\n"
+"Usage: iax2 set debug off\n"
 "       Disables dumping of IAX packets for debugging purposes\n";
 
 static char debug_trunk_usage[] =
-"Usage: iax2 debug trunk\n"
+"Usage: iax2 set debug trunk\n"
 "       Requests current status of IAX trunking\n";
 
 static char no_debug_trunk_usage[] =
-"Usage: iax2 nodebug trunk\n"
+"Usage: iax2 set debug trunk off\n"
 "       Requests current status of IAX trunking\n";
 
 static char debug_jb_usage[] =
-"Usage: iax2 debug jb\n"
+"Usage: iax2 set debug jb\n"
 "       Enables jitterbuffer debugging information\n";
 
 static char no_debug_jb_usage[] =
-"Usage: iax2 nodebug jb\n"
+"Usage: iax2 set debug jb off\n"
 "       Disables jitterbuffer debugging information\n";
 
 static char iax2_test_losspct_usage[] =
@@ -9793,27 +9785,27 @@
 	iax2_show_peer, "Show details on specific IAX peer",
 	show_peer_usage, complete_iax2_show_peer },
 
-	{ { "iax2", "debug", NULL },
+	{ { "iax2", "set", "debug", NULL },
 	iax2_do_debug, "Enable IAX debugging",
 	debug_usage },
 
-	{ { "iax2", "debug", "trunk", NULL },
+	{ { "iax2", "set", "debug", "trunk", NULL },
 	iax2_do_trunk_debug, "Enable IAX trunk debugging",
 	debug_trunk_usage },
 
-	{ { "iax2", "debug", "jb", NULL },
+	{ { "iax2", "set", "debug", "jb", NULL },
 	iax2_do_jb_debug, "Enable IAX jitterbuffer debugging",
 	debug_jb_usage },
 
-	{ { "iax2", "debug", "off", NULL },
+	{ { "iax2", "set", "debug", "off", NULL },
 	iax2_no_debug, "Disable IAX debugging",
 	no_debug_usage },
 
-	{ { "iax2", "debug", "trunk", "off", NULL },
+	{ { "iax2", "set", "debug", "trunk", "off", NULL },
 	iax2_no_trunk_debug, "Disable IAX trunk debugging",
 	no_debug_trunk_usage },
 
-	{ { "iax2", "debug", "jb", "off", NULL },
+	{ { "iax2", "set", "debug", "jb", "off", NULL },
 	iax2_no_jb_debug, "Disable IAX jitterbuffer debugging",
 	no_debug_jb_usage },
 

Modified: team/oej/codename-pineapple/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_mgcp.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/channels/chan_mgcp.c (original)
+++ team/oej/codename-pineapple/channels/chan_mgcp.c Tue Nov 14 08:34:44 2006
@@ -1054,11 +1054,11 @@
 "       mgcp debug MUST be on to see the results of this command.\n";
 
 static char debug_usage[] = 
-"Usage: mgcp debug\n"
+"Usage: mgcp set debug\n"
 "       Enables dumping of MGCP packets for debugging purposes\n";
 
 static char no_debug_usage[] = 
-"Usage: mgcp debug off\n"
+"Usage: mgcp set debug off\n"
 "       Disables dumping of MGCP packets for debugging purposes\n";
 
 static char mgcp_reload_usage[] =
@@ -1121,7 +1121,7 @@
 
 static int mgcp_do_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 2)
+	if (argc != 3)
 		return RESULT_SHOWUSAGE;
 	mgcpdebug = 1;
 	ast_cli(fd, "MGCP Debugging Enabled\n");
@@ -1130,7 +1130,7 @@
 
 static int mgcp_no_debug(int fd, int argc, char *argv[])
 {
-	if (argc != 3)
+	if (argc != 4)
 		return RESULT_SHOWUSAGE;
 	mgcpdebug = 0;
 	ast_cli(fd, "MGCP Debugging Disabled\n");
@@ -1146,11 +1146,11 @@
 	mgcp_show_endpoints, "List defined MGCP endpoints",
 	show_endpoints_usage },
 
-	{ { "mgcp", "debug", NULL },
+	{ { "mgcp", "set", "debug", NULL },
 	mgcp_do_debug, "Enable MGCP debugging",
 	debug_usage },
 
-	{ { "mgcp", "debug", "off", NULL },
+	{ { "mgcp", "set", "debug", "off", NULL },
 	mgcp_no_debug, "Disable MGCP debugging",
 	no_debug_usage },
 

Modified: team/oej/codename-pineapple/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_phone.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/channels/chan_phone.c (original)
+++ team/oej/codename-pineapple/channels/chan_phone.c Tue Nov 14 08:34:44 2006
@@ -49,7 +49,9 @@
 /* Still use some IXJ specific stuff */
 #include <linux/version.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
 # include <linux/compiler.h>
+#endif
 #endif
 #include <linux/ixjuser.h>
 

Modified: team/oej/codename-pineapple/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_sip.c?view=diff&rev=47602&r1=47601&r2=47602
==============================================================================
--- team/oej/codename-pineapple/channels/chan_sip.c (original)
+++ team/oej/codename-pineapple/channels/chan_sip.c Tue Nov 14 08:34:44 2006
@@ -761,8 +761,8 @@
 #define SIP_PAGE2_T38SUPPORT_TCP	(4 << 20)	/*!< 22: T38 Fax Passthrough Support (not implemented) */
 #define SIP_PAGE2_CALL_ONHOLD		(3 << 23)	/*!< Call states */
 #define SIP_PAGE2_CALL_ONHOLD_ONEDIR	(1 << 23)	/*!< 23: One directional hold */
-#define SIP_PAGE2_CALL_ONHOLD_INACTIVE	(2 << 24)	/*!< 24: Inactive  */
-#define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 26)
+#define SIP_PAGE2_CALL_ONHOLD_INACTIVE	(1 << 24)	/*!< 24: Inactive  */
+#define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 25)
 
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE)
@@ -771,8 +771,6 @@
 #define SIP_PKT_DEBUG		(1 << 0)	/*!< Debug this packet */
 #define SIP_PKT_WITH_TOTAG	(1 << 1)	/*!< This packet has a to-tag */
 #define SIP_PKT_IGNORE 		(1 << 2)	/*!< This is a re-transmit, ignore it */
-#define SIP_PKT_IGNORE_RESP	(1 << 3)	/*!< Resp ignore - ??? */
-#define SIP_PKT_IGNORE_REQ	(1 << 4)	/*!< Req ignore - ??? */
 
 /* T.38 set of flags */
 #define T38FAX_FILL_BIT_REMOVAL		(1 << 0)	/*!< Default: 0 (unset)*/
@@ -1259,7 +1257,7 @@
 static void sip_cancel_destroy(struct sip_pvt *p);
 static void sip_destroy(struct sip_pvt *p);
 static void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist);
-static void __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod, int reset);
+static void __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod);
 static void __sip_pretend_ack(struct sip_pvt *p);
 static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod);
 static int auto_congest(void *nothing);
@@ -1633,14 +1631,16 @@
 	a dialog */
 static void initialize_initreq(struct sip_pvt *p, struct sip_request *req)
 {
-	if (p->initreq.headers && option_debug) {
-		ast_log(LOG_DEBUG, "Initializing already initialized SIP dialog %s (presumably reinvite)\n", p->callid);
+	if (option_debug) {
+		if (p->initreq.headers)
+			ast_log(LOG_DEBUG, "Initializing already initialized SIP dialog %s (presumably reinvite)\n", p->callid);
+		ast_log(LOG_DEBUG, "Initializing initreq for method %s - callid %s\n", sip_methods[req->method].text, p->callid);
 	}
 	/* Use this as the basis */
 	copy_request(&p->initreq, req);
 	parse_request(&p->initreq);
 	if (ast_test_flag(req, SIP_PKT_DEBUG))
-		ast_verbose("%d headers, %d lines\n", p->initreq.headers, p->initreq.lines);
+		ast_verbose("Initreq: %d headers, %d lines\n", p->initreq.headers, p->initreq.lines);
 }
 
 
@@ -1927,26 +1927,24 @@
 			ast_channel_unlock(pkt->owner->owner);
 		} else {
 			/* If no channel owner, destroy now */
-			ast_set_flag(&pkt->owner->flags[0], SIP_NEEDDESTROY);	
-		}
-	}
-	/* In any case, go ahead and remove the packet */
+
+			/* Let the peerpoke system expire packets when the timer expires for poke_noanswer */
+			if (pkt->method != SIP_OPTIONS)
+				ast_set_flag(&pkt->owner->flags[0], SIP_NEEDDESTROY);	
+		}
+	}
+	/* Remove the packet */
 	for (prev = NULL, cur = pkt->owner->packets; cur; prev = cur, cur = cur->next) {
-		if (cur == pkt)
-			break;
-	}
-	if (cur) {
-		if (prev)
-			prev->next = cur->next;
-		else
-			pkt->owner->packets = cur->next;
-		sip_pvt_unlock(pkt->owner);
-		free(cur);
-		pkt = NULL;
-	} else
-		ast_log(LOG_WARNING, "Weird, couldn't find packet owner!\n");
-	if (pkt)
-		sip_pvt_unlock(pkt->owner);
+		if (cur == pkt) {
+			UNLINK(cur, pkt->owner->packets, prev);
+			sip_pvt_unlock(pkt->owner);
+			free(pkt);
+			return 0;
+		}
+	}
+	/* error case */
+	ast_log(LOG_WARNING, "Weird, couldn't find packet owner!\n");
+	sip_pvt_unlock(pkt->owner);
 	return 0;
 }
 
@@ -2012,16 +2010,21 @@
 	/* Reset schedule ID */
 	p->autokillid = -1;
 
-	if (option_debug)
-		ast_log(LOG_DEBUG, "Auto destroying SIP dialog '%s'\n", p->callid);
-	append_history(p, "AutoDestroy", "%s", p->callid);
 	if (p->owner) {
 		ast_log(LOG_WARNING, "Autodestruct on dialog '%s' with owner in place (Method: %s)\n", p->callid, sip_methods[p->method].text);
 		ast_queue_hangup(p->owner);
-	} else if (p->refer)
+	} else if (p->refer) {
+		if (option_debug > 2)
+			ast_log(LOG_DEBUG, "Finally hanging up channel after transfer: %s\n", p->callid);
 		transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
-	else 
-		sip_destroy(p);

[... 2525 lines stripped ...]


More information about the svn-commits mailing list