[asterisk-commits] juggie: branch juggie/NoLossCDR r85156 - in /team/juggie/NoLossCDR: ./ apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 9 14:15:01 CDT 2007


Author: juggie
Date: Tue Oct  9 14:15:01 2007
New Revision: 85156

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85156
Log:
Merged revisions 84336,84380,84414,84447,84489,84521,84558,84591,84618,84647,84676,84703,84731,84753,84795,84828,84862,84901,84934,84944,84967,85000,85034,85067,85107,85155 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/CDRfix5

................
r84336 | root | 2007-10-01 19:50:25 -0400 (Mon, 01 Oct 2007) | 1 line

automerge commit
................
r84380 | root | 2007-10-02 10:51:57 -0400 (Tue, 02 Oct 2007) | 1 line

automerge commit
................
r84414 | root | 2007-10-02 14:54:27 -0400 (Tue, 02 Oct 2007) | 1 line

automerge commit
................
r84447 | root | 2007-10-02 15:05:14 -0400 (Tue, 02 Oct 2007) | 1 line

automerge commit
................
r84489 | root | 2007-10-02 16:52:18 -0400 (Tue, 02 Oct 2007) | 1 line

automerge commit
................
r84521 | root | 2007-10-03 11:16:13 -0400 (Wed, 03 Oct 2007) | 1 line

automerge commit
................
r84558 | root | 2007-10-03 15:15:01 -0400 (Wed, 03 Oct 2007) | 1 line

automerge commit
................
r84591 | root | 2007-10-03 19:15:04 -0400 (Wed, 03 Oct 2007) | 1 line

automerge commit
................
r84618 | root | 2007-10-03 22:14:18 -0400 (Wed, 03 Oct 2007) | 1 line

automerge commit
................
r84647 | root | 2007-10-04 11:15:10 -0400 (Thu, 04 Oct 2007) | 1 line

automerge commit
................
r84676 | root | 2007-10-04 13:14:22 -0400 (Thu, 04 Oct 2007) | 1 line

automerge commit
................
r84703 | root | 2007-10-04 18:15:13 -0400 (Thu, 04 Oct 2007) | 1 line

automerge commit
................
r84731 | root | 2007-10-04 19:14:25 -0400 (Thu, 04 Oct 2007) | 1 line

automerge commit
................
r84753 | root | 2007-10-04 22:15:12 -0400 (Thu, 04 Oct 2007) | 1 line

automerge commit
................
r84795 | root | 2007-10-05 13:15:18 -0400 (Fri, 05 Oct 2007) | 1 line

automerge commit
................
r84828 | root | 2007-10-05 15:15:14 -0400 (Fri, 05 Oct 2007) | 1 line

automerge commit
................
r84862 | root | 2007-10-05 16:15:16 -0400 (Fri, 05 Oct 2007) | 1 line

automerge commit
................
r84901 | root | 2007-10-07 12:15:32 -0400 (Sun, 07 Oct 2007) | 1 line

automerge commit
................
r84934 | root | 2007-10-07 12:22:13 -0400 (Sun, 07 Oct 2007) | 1 line

automerge commit
................
r84944 | root | 2007-10-07 13:14:34 -0400 (Sun, 07 Oct 2007) | 1 line

automerge commit
................
r84967 | root | 2007-10-08 00:15:22 -0400 (Mon, 08 Oct 2007) | 1 line

automerge commit
................
r85000 | root | 2007-10-08 11:15:24 -0400 (Mon, 08 Oct 2007) | 1 line

automerge commit
................
r85034 | root | 2007-10-08 12:15:23 -0400 (Mon, 08 Oct 2007) | 1 line

automerge commit
................
r85067 | root | 2007-10-08 16:15:25 -0400 (Mon, 08 Oct 2007) | 1 line

automerge commit
................
r85107 | root | 2007-10-09 11:15:33 -0400 (Tue, 09 Oct 2007) | 1 line

automerge cancel
................
r85155 | murf | 2007-10-09 13:58:43 -0400 (Tue, 09 Oct 2007) | 41 lines

Merged revisions 85094,85097-85098,85140 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r85094 | file | 2007-10-09 08:31:27 -0600 (Tue, 09 Oct 2007) | 12 lines

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

........
r85093 | file | 2007-10-09 11:30:16 -0300 (Tue, 09 Oct 2007) | 4 lines

Don't perform a reinvite if a transfer is in progress.
(issue #10915)
Reported by: ramonpeek

........

................
r85097 | russell | 2007-10-09 09:10:14 -0600 (Tue, 09 Oct 2007) | 8 lines

Add jitterbuffer support for chan_local.  To enable it, you use the 'j' option
in the Dial command.  The 'j' option _must_ be used in conjunction with the 'n'
option.

This feature will allow you to use the existing jitterbuffer implementation to
put a jitterbuffer on incoming SIP calls connecting to Asterisk applications by
putting a local channel in the middle.

................
r85098 | russell | 2007-10-09 09:12:59 -0600 (Tue, 09 Oct 2007) | 2 lines

Note jitterbuffer support for chan_local in CHANGES

................
r85140 | tilghman | 2007-10-09 10:04:41 -0600 (Tue, 09 Oct 2007) | 2 lines

Remove redundant includes (patch by snuffy) (Closes issue #10922)

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

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

Modified:
    team/juggie/NoLossCDR/   (props changed)
    team/juggie/NoLossCDR/CHANGES
    team/juggie/NoLossCDR/Makefile
    team/juggie/NoLossCDR/Makefile.rules
    team/juggie/NoLossCDR/apps/app_adsiprog.c
    team/juggie/NoLossCDR/apps/app_dial.c
    team/juggie/NoLossCDR/apps/app_festival.c
    team/juggie/NoLossCDR/apps/app_minivm.c
    team/juggie/NoLossCDR/apps/app_queue.c
    team/juggie/NoLossCDR/apps/app_zapras.c
    team/juggie/NoLossCDR/build_tools/prep_tarball
    team/juggie/NoLossCDR/channels/chan_jingle.c
    team/juggie/NoLossCDR/channels/chan_local.c
    team/juggie/NoLossCDR/channels/chan_misdn.c
    team/juggie/NoLossCDR/channels/chan_sip.c
    team/juggie/NoLossCDR/channels/chan_zap.c
    team/juggie/NoLossCDR/configs/jabber.conf.sample
    team/juggie/NoLossCDR/doc/tex/extensions.tex
    team/juggie/NoLossCDR/doc/tex/localchannel.tex
    team/juggie/NoLossCDR/include/asterisk/jabber.h
    team/juggie/NoLossCDR/include/asterisk/pbx.h
    team/juggie/NoLossCDR/main/ast_expr2.c
    team/juggie/NoLossCDR/main/channel.c
    team/juggie/NoLossCDR/main/db.c
    team/juggie/NoLossCDR/main/manager.c
    team/juggie/NoLossCDR/main/pbx.c
    team/juggie/NoLossCDR/main/rtp.c
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-ntest10
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test1
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test18
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test19
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test3
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test5
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-test8
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-vtest13
    team/juggie/NoLossCDR/pbx/ael/ael-test/ref.ael-vtest17
    team/juggie/NoLossCDR/pbx/pbx_ael.c
    team/juggie/NoLossCDR/res/ael/ael.tab.c
    team/juggie/NoLossCDR/res/ael/ael.y
    team/juggie/NoLossCDR/res/ael/pval.c
    team/juggie/NoLossCDR/res/res_features.c
    team/juggie/NoLossCDR/res/res_jabber.c
    team/juggie/NoLossCDR/res/res_limit.c
    team/juggie/NoLossCDR/utils/astman.c
    team/juggie/NoLossCDR/utils/check_expr.c
    team/juggie/NoLossCDR/utils/conf2ael.c
    team/juggie/NoLossCDR/utils/hashtest2.c

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/juggie/NoLossCDR/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Oct  9 14:15:01 2007
@@ -1,1 +1,1 @@
-/team/group/CDRfix5:1-84327
+/team/group/CDRfix5:1-85155

Modified: team/juggie/NoLossCDR/CHANGES
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/CHANGES?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/CHANGES (original)
+++ team/juggie/NoLossCDR/CHANGES Tue Oct  9 14:15:01 2007
@@ -141,9 +141,9 @@
   * SMDI is now enabled in voicemail using the smdienable option.
   * A "lockmode" option has been added to asterisk.conf to configure the file
      locking method used for voicemail, and potentially other things in the
-	 future.  The default is the old behavior, lockfile.  However, there is a
-	 new method, "flock", that uses a different method for situations where the
-	 lockfile will not work, such as on SMB/CIFS mounts.
+     future.  The default is the old behavior, lockfile.  However, there is a
+     new method, "flock", that uses a different method for situations where the
+     lockfile will not work, such as on SMB/CIFS mounts.
 
 Queue changes
 -------------
@@ -289,6 +289,12 @@
      to just UNKNOWN if the extension exists.
   * When originating a call using AMI or pbx_spool that fails the reason for failure
      will now be available in the failed extension using the REASON dialplan variable.
+  * Added jitterbuffer support for chan_local.  This allows you to use the
+     generic jitterbuffer on incoming calls going to Asterisk applications.
+     For example, this would allow you to use a jitterbuffer for an incoming
+     SIP call to Voicemail by putting a Local channel in the middle.  This
+     feature is enabled by using the 'j' option in the Dial string to the Local
+     channel in conjunction with the existing 'n' option for local channels.
 
 CDR changes
 -----------

Modified: team/juggie/NoLossCDR/Makefile
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/Makefile?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/Makefile (original)
+++ team/juggie/NoLossCDR/Makefile Tue Oct  9 14:15:01 2007
@@ -728,7 +728,7 @@
 menuselect/gmenuselect: makeopts menuselect/menuselect.c menuselect/menuselect_gtk.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
 	@CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect _gmenuselect CONFIGURE_SILENT="--silent"
 
-menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
+menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml configure
 	@echo "Generating input for menuselect ..."
 	@build_tools/prep_moduledeps > $@
 

Modified: team/juggie/NoLossCDR/Makefile.rules
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/Makefile.rules?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/Makefile.rules (original)
+++ team/juggie/NoLossCDR/Makefile.rules Tue Oct  9 14:15:01 2007
@@ -40,11 +40,7 @@
 
 %.o: %.c
 	$(ECHO_PREFIX) echo "   [CC] $< -> $@"
-ifeq ($(AST_DEVMODE),yes)
 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
-else
-	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS)
-endif
 
 %.o: %.i
 	$(ECHO_PREFIX) echo "   [CC] $< -> $@"
@@ -64,19 +60,11 @@
 
 %.o: %.s
 	$(ECHO_PREFIX) echo "   [AS] $< -> $@"
-ifeq ($(AST_DEVMODE),yes)
 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
-else
-	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS)
-endif
 
 %.oo: %.cc
 	$(ECHO_PREFIX) echo "   [CXX] $< -> $@"
-ifeq ($(AST_DEVMODE),yes)
 	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS)) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP
-else
-	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS))
-endif
 
 %.c: %.y
 	$(ECHO_PREFIX) echo "   [BISON] $< -> $@"

Modified: team/juggie/NoLossCDR/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_adsiprog.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/apps/app_adsiprog.c (original)
+++ team/juggie/NoLossCDR/apps/app_adsiprog.c Tue Oct  9 14:15:01 2007
@@ -38,7 +38,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <stdlib.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <errno.h>

Modified: team/juggie/NoLossCDR/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_dial.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/apps/app_dial.c (original)
+++ team/juggie/NoLossCDR/apps/app_dial.c Tue Oct  9 14:15:01 2007
@@ -33,7 +33,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <sys/time.h>
 #include <sys/signal.h>

Modified: team/juggie/NoLossCDR/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_festival.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/apps/app_festival.c (original)
+++ team/juggie/NoLossCDR/apps/app_festival.c Tue Oct  9 14:15:01 2007
@@ -36,15 +36,12 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdio.h>
 #include <signal.h>
-#include <stdlib.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <ctype.h>
 

Modified: team/juggie/NoLossCDR/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_minivm.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/apps/app_minivm.c (original)
+++ team/juggie/NoLossCDR/apps/app_minivm.c Tue Oct  9 14:15:01 2007
@@ -145,7 +145,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/time.h>

Modified: team/juggie/NoLossCDR/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_queue.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/apps/app_queue.c (original)
+++ team/juggie/NoLossCDR/apps/app_queue.c Tue Oct  9 14:15:01 2007
@@ -815,7 +815,8 @@
 	q->monfmt[0] = '\0';
 	q->periodicannouncefrequency = 0;
 	q->sound_callerannounce[0] = '\0';	/* Default, don't announce the caller that he has been answered */
-	q->members = ao2_container_alloc(37, member_hash_fn, member_cmp_fn);
+	if(!q->members)
+		q->members = ao2_container_alloc(37, member_hash_fn, member_cmp_fn);
 	q->membercount = 0;
 	q->found = 1;
 	ast_copy_string(q->sound_next, "queue-youarenext", sizeof(q->sound_next));
@@ -4425,6 +4426,7 @@
 	int qmemcount = 0;
 	int qmemavail = 0;
 	int qchancount = 0;
+	int qlongestholdtime = 0;
 	const char *id = astman_get_header(m, "ActionID");
 	const char *queuefilter = astman_get_header(m, "Queue");
 	char idText[256] = "";
@@ -4444,6 +4446,12 @@
 
 		/* List queue properties */
 		if (ast_strlen_zero(queuefilter) || !strcmp(q->name, queuefilter)) {
+			/* Reset the necessary local variables if no queuefilter is set*/
+			qmemcount = 0;
+			qmemavail = 0;
+			qchancount = 0;
+			qlongestholdtime = 0;
+
 			/* List Queue Members */
 			mem_iter = ao2_iterator_init(q->members, 0);
 			while ((mem = ao2_iterator_next(&mem_iter))) {
@@ -4456,6 +4464,9 @@
 				ao2_ref(mem, -1);
 			}
 			for (qe = q->head; qe; qe = qe->next) {
+				if ((now - qe->start) > qlongestholdtime) {
+					qlongestholdtime = now - qe->start;
+				}
 				++qchancount;
 			}
 			astman_append(s, "Event: QueueSummary\r\n"
@@ -4464,9 +4475,10 @@
 				"Available: %d\r\n"
 				"Callers: %d\r\n" 
 				"HoldTime: %d\r\n"
+				"LongestHoldTime: %d\r\n"
 				"%s"
 				"\r\n",
-				q->name, qmemcount, qmemavail, qchancount, q->holdtime, idText);
+				q->name, qmemcount, qmemavail, qchancount, q->holdtime, qlongestholdtime, idText);
 		}
 		ao2_unlock(q);
 		queue_unref(q);
@@ -4824,7 +4836,7 @@
 				tmp = m->membername;
 				ao2_ref(m, -1);
 				queue_unref(q);
-				return tmp;
+				return ast_strdup(tmp);
 			}
 			ao2_ref(m, -1);
 		}

Modified: team/juggie/NoLossCDR/apps/app_zapras.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/apps/app_zapras.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/apps/app_zapras.c (original)
+++ team/juggie/NoLossCDR/apps/app_zapras.c Tue Oct  9 14:15:01 2007
@@ -44,7 +44,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>

Modified: team/juggie/NoLossCDR/build_tools/prep_tarball
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/build_tools/prep_tarball?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/build_tools/prep_tarball (original)
+++ team/juggie/NoLossCDR/build_tools/prep_tarball Tue Oct  9 14:15:01 2007
@@ -7,8 +7,6 @@
 
 make -C sounds all MENUSELECT_CORE_SOUNDS=CORE-SOUNDS-EN-GSM MENUSELECT_MOH=MOH-FREEPLAY-WAV WGET=wget DOWNLOAD=wget
 
-make menuselect-tree
-
 VERSION=`cat .version`
 sed -i -e "s/ASTERISKVERSION/${VERSION}/" doc/tex/asterisk.tex
 cd doc/tex && rubber --pdf asterisk.tex

Modified: team/juggie/NoLossCDR/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_jingle.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_jingle.c (original)
+++ team/juggie/NoLossCDR/channels/chan_jingle.c Tue Oct  9 14:15:01 2007
@@ -43,7 +43,6 @@
 #include <unistd.h>
 #include <sys/socket.h>
 #include <errno.h>
-#include <stdlib.h>
 #include <fcntl.h>
 #include <netdb.h>
 #include <netinet/in.h>

Modified: team/juggie/NoLossCDR/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_local.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_local.c (original)
+++ team/juggie/NoLossCDR/channels/chan_local.c Tue Oct  9 14:15:01 2007
@@ -65,6 +65,13 @@
 static const char tdesc[] = "Local Proxy Channel Driver";
 
 #define IS_OUTBOUND(a,b) (a == b->chan ? 1 : 0)
+
+static struct ast_jb_conf g_jb_conf = {
+	.flags = 0,
+	.max_size = -1,
+	.resync_threshold = -1,
+	.impl = "",
+};
 
 static struct ast_channel *local_request(const char *type, int format, void *data, int *cause);
 static int local_digit_begin(struct ast_channel *ast, char digit);
@@ -108,6 +115,7 @@
 	char context[AST_MAX_CONTEXT];		/* Context to call */
 	char exten[AST_MAX_EXTENSION];		/* Extension to call */
 	int reqformat;				/* Requested format */
+	struct ast_jb_conf jb_conf;		/*!< jitterbuffer configuration for this local channel */
 	struct ast_channel *owner;		/* Master Channel */
 	struct ast_channel *chan;		/* Outbound channel */
 	struct ast_module_user *u_owner;	/*! reference to keep the module loaded while in use */
@@ -563,11 +571,21 @@
 	ast_mutex_init(&tmp->lock);
 	ast_copy_string(tmp->exten, data, sizeof(tmp->exten));
 
+	memcpy(&tmp->jb_conf, &g_jb_conf, sizeof(tmp->jb_conf));
+
 	/* Look for options */
 	if ((opts = strchr(tmp->exten, '/'))) {
 		*opts++ = '\0';
 		if (strchr(opts, 'n'))
 			ast_set_flag(tmp, LOCAL_NO_OPTIMIZATION);
+		if (strchr(opts, 'j')) {
+			if (ast_test_flag(tmp, LOCAL_NO_OPTIMIZATION))
+				ast_set_flag(&tmp->jb_conf, AST_JB_ENABLED);
+			else {
+				ast_log(LOG_ERROR, "You must use the 'n' option for chan_local "
+					"to use the 'j' option to enable the jitterbuffer\n");
+			}
+		}
 	}
 
 	/* Look for a context */
@@ -652,6 +670,8 @@
 	tmp->priority = 1;
 	tmp2->priority = 1;
 
+	ast_jb_configure(tmp, &p->jb_conf);
+
 	return tmp;
 }
 

Modified: team/juggie/NoLossCDR/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_misdn.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_misdn.c (original)
+++ team/juggie/NoLossCDR/channels/chan_misdn.c Tue Oct  9 14:15:01 2007
@@ -302,7 +302,7 @@
 #define MISDN_ASTERISK_TECH_PVT(ast) ast->tech_pvt
 #define MISDN_ASTERISK_PVT(ast) 1
 
-#include <asterisk/strings.h>
+#include "asterisk/strings.h"
 
 /* #define MISDN_DEBUG 1 */
 

Modified: team/juggie/NoLossCDR/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_sip.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_sip.c (original)
+++ team/juggie/NoLossCDR/channels/chan_sip.c Tue Oct  9 14:15:01 2007
@@ -7737,7 +7737,7 @@
 			if (!ast_strlen_zero(p->refer->refer_to))
 				add_header(&req, "Refer-To", p->refer->refer_to);
 			if (!ast_strlen_zero(p->refer->referred_by)) {
-				sprintf(buf, "%s <%s>", p->refer->referred_by_name, p->refer->referred_by);
+				snprintf(buf, sizeof(buf), "%s <%s>", p->refer->referred_by_name, p->refer->referred_by);
 				add_header(&req, "Referred-By", buf);
 			}
 		}
@@ -18672,7 +18672,7 @@
 			changed = 1;
 		}
 	}
-	if (changed && !ast_test_flag(&p->flags[0], SIP_GOTREFER)) {
+	if (changed && !ast_test_flag(&p->flags[0], SIP_GOTREFER) && !ast_test_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER)) {
 		if (chan->_state != AST_STATE_UP) {	/* We are in early state */
 			if (p->do_history)
 				append_history(p, "ExtInv", "Initial invite sent with remote bridge proposal.");

Modified: team/juggie/NoLossCDR/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/channels/chan_zap.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/channels/chan_zap.c (original)
+++ team/juggie/NoLossCDR/channels/chan_zap.c Tue Oct  9 14:15:01 2007
@@ -1359,25 +1359,25 @@
 	case SIG_FXOKS:
 		return "FXO Kewlstart";
 	case SIG_PRI:
-		return "PRI Signalling";
+		return "ISDN PRI";
 	case SIG_SS7:
-		return "SS7 Signalling";
+		return "SS7";
 	case SIG_SF:
-		return "SF (Tone) Signalling Immediate";
+		return "SF (Tone) Immediate";
 	case SIG_SFWINK:
-		return "SF (Tone) Signalling Wink";
+		return "SF (Tone) Wink";
 	case SIG_SF_FEATD:
-		return "SF (Tone) Signalling with Feature Group D (DTMF)";
+		return "SF (Tone) with Feature Group D (DTMF)";
 	case SIG_SF_FEATDMF:
-		return "SF (Tone) Signalling with Feature Group D (MF)";
+		return "SF (Tone) with Feature Group D (MF)";
 	case SIG_SF_FEATB:
-		return "SF (Tone) Signalling with Feature Group B (MF)";
+		return "SF (Tone) with Feature Group B (MF)";
 	case SIG_GR303FXOKS:
-		return "GR-303 Signalling with FXOKS";
+		return "GR-303 with FXOKS";
 	case SIG_GR303FXSKS:
-		return "GR-303 Signalling with FXSKS";
+		return "GR-303 with FXSKS";
 	case 0:
-		return "Pseudo Signalling";
+		return "Pseudo";
 	default:
 		snprintf(buf, sizeof(buf), "Unknown signalling %d", sig);
 		return buf;
@@ -3475,7 +3475,11 @@
 		return AST_BRIDGE_FAILED_NOWARN;
 
 	ast_channel_lock(c0);
-	ast_channel_lock(c1);
+	while (ast_channel_trylock(c1)) {
+		ast_channel_unlock(c0);
+		usleep(1);
+		ast_channel_lock(c0);
+	}
 
 	p0 = c0->tech_pvt;
 	p1 = c1->tech_pvt;
@@ -3641,8 +3645,13 @@
 
 		/* Here's our main loop...  Start by locking things, looking for private parts, 
 		   and then balking if anything is wrong */
+		
 		ast_channel_lock(c0);
-		ast_channel_lock(c1);
+		while (ast_channel_trylock(c1)) {
+			ast_channel_unlock(c0);
+			usleep(1);
+			ast_channel_lock(c0);
+		}
 
 		p0 = c0->tech_pvt;
 		p1 = c1->tech_pvt;

Modified: team/juggie/NoLossCDR/configs/jabber.conf.sample
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/configs/jabber.conf.sample?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/configs/jabber.conf.sample (original)
+++ team/juggie/NoLossCDR/configs/jabber.conf.sample Tue Oct  9 14:15:01 2007
@@ -9,10 +9,13 @@
 					;;	talk.google.com
 ;username=asterisk at astjab.org/asterisk	;;Username with optional roster.
 ;secret=blah				;;Password
+;priority=1				;;Resource priority
 ;port=5222				;;Port to use defaults to 5222
 ;usetls=yes				;;Use tls or not
 ;usesasl=yes				;;Use sasl or not
 ;buddy=mogorman at astjab.org		;;Manual addition of buddy to list.
+;status=available			;;One of: chat, available, away,
+					;;	xaway, or dnd
 ;statusmessage="I am available"		;;Have custom status message for
 					;;Asterisk.
 ;timeout=100				;;Timeout on the message stack.

Modified: team/juggie/NoLossCDR/doc/tex/extensions.tex
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/doc/tex/extensions.tex?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/doc/tex/extensions.tex (original)
+++ team/juggie/NoLossCDR/doc/tex/extensions.tex Tue Oct  9 14:15:01 2007
@@ -66,6 +66,14 @@
           timeout is reached.  See "show function TIMEOUT" for more
           information on setting timeouts.	
   \end{itemize}
+  \item e
+  \begin{itemize}
+    \item This extension will substitute as a catchall for any of the
+          'i', 't', or 'T' extensions, if any of them do not exist and
+          catching the error in a single routine is desired.  The
+          function EXCEPTION may be used to query the type of exception
+          or the location where it occurred.
+  \end{itemize}
 \end{itemize}
 
 And finally, the extension context "default" is used when either a) an 

Modified: team/juggie/NoLossCDR/doc/tex/localchannel.tex
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/doc/tex/localchannel.tex?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/doc/tex/localchannel.tex (original)
+++ team/juggie/NoLossCDR/doc/tex/localchannel.tex Tue Oct  9 14:15:01 2007
@@ -8,6 +8,8 @@
 \end{verbatim}
 
 Adding "/n" at the end of the string will make the Local channel not do a native transfer (the "n" stands for "n"o release) upon the remote end answering the line. This is an esoteric, but important feature if you expect the Local channel to handle calls exactly like a normal channel. If you do not have the "no release" feature set, then as soon as the destination (inside of the Local channel) answers the line, the variables and dial plan will revert back to that of the original call, and the Local channel will become a zombie and be removed from the active channels list. This is desirable in some circumstances, but can result in unexpected dialplan behavior if you are doing fancy things with variables in your call handling.
+
+There is another option that can be used with local channels, which is the "j" option.  The "j" option must be used with the "n" option to make sure that the local channel does not get optimized out of the call.  This option will enable a jitterbuffer on the local channel.  The jitterbuffer will be used to de-jitter audio that it receives from the channel that called the local channel.  This is especially in the case of putting chan\_local in between an incoming SIP call and Asterisk applications, so that the incoming audio will be de-jittered.
 
 \subsection{Purpose}
 

Modified: team/juggie/NoLossCDR/include/asterisk/jabber.h
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/include/asterisk/jabber.h?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/include/asterisk/jabber.h (original)
+++ team/juggie/NoLossCDR/include/asterisk/jabber.h Tue Oct  9 14:15:01 2007
@@ -155,6 +155,8 @@
 	AST_LIST_HEAD(messages,aji_message) messages;
 	void *jingle;
 	pthread_t thread;
+	int priority;
+	enum ikshowtype status;
 };
 
 struct aji_client_container{

Modified: team/juggie/NoLossCDR/include/asterisk/pbx.h
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/include/asterisk/pbx.h?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/include/asterisk/pbx.h (original)
+++ team/juggie/NoLossCDR/include/asterisk/pbx.h Tue Oct  9 14:15:01 2007
@@ -37,6 +37,9 @@
 #define AST_PBX_REPLACE 1
 
 /*! \brief Special return values from applications to the PBX { */
+#define AST_PBX_HANGUP	        -1	/*!< Jump to the 'h' exten */
+#define AST_PBX_OK	        0	/*!< No errors */
+#define AST_PBX_ERROR	        1	/*!< Jump to the 'e' exten */
 #define AST_PBX_KEEPALIVE	10	/*!< Destroy the thread, but don't hang up the channel */
 #define AST_PBX_NO_HANGUP_PEER	11
 /*! } */
@@ -840,6 +843,7 @@
 void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp);
 void pbx_builtin_clear_globals(void);
 int pbx_builtin_setvar(struct ast_channel *chan, void *data);
+int pbx_builtin_raise_exception(struct ast_channel *chan, void *data);
 void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char *cp2,int count);
 void pbx_substitute_variables_varshead(struct varshead *headp, const char *cp1, char *cp2, int count);
 

Modified: team/juggie/NoLossCDR/main/ast_expr2.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/ast_expr2.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/main/ast_expr2.c (original)
+++ team/juggie/NoLossCDR/main/ast_expr2.c Tue Oct  9 14:15:01 2007
@@ -144,6 +144,8 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #define FP___PRINTF "%.18Lg"
 #define FP___TYPE    long double

Modified: team/juggie/NoLossCDR/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/channel.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/main/channel.c (original)
+++ team/juggie/NoLossCDR/main/channel.c Tue Oct  9 14:15:01 2007
@@ -4155,7 +4155,8 @@
 		    !nativefailed && !c0->monitor && !c1->monitor &&
 		    !c0->audiohooks && !c1->audiohooks && 
 		    !ast_test_flag(&(config->features_callee),AST_FEATURE_REDIRECT) &&
-		    !ast_test_flag(&(config->features_caller),AST_FEATURE_REDIRECT) ) {
+		    !ast_test_flag(&(config->features_caller),AST_FEATURE_REDIRECT) &&
+		    !c0->masq && !c0->masqr && !c1->masq && !c1->masqr) {
 			/* Looks like they share a bridge method and nothing else is in the way */
 			ast_set_flag(c0, AST_FLAG_NBRIDGE);
 			ast_set_flag(c1, AST_FLAG_NBRIDGE);

Modified: team/juggie/NoLossCDR/main/db.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/db.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/main/db.c (original)
+++ team/juggie/NoLossCDR/main/db.c Tue Oct  9 14:15:01 2007
@@ -63,7 +63,7 @@
 static int dbinit(void) 
 {
 	if (!astdb && !(astdb = dbopen((char *)ast_config_AST_DB, O_CREAT | O_RDWR, AST_FILE_MODE, DB_BTREE, NULL))) {
-		ast_log(LOG_WARNING, "Unable to open Asterisk database\n");
+		ast_log(LOG_WARNING, "Unable to open Asterisk database '%s': %s\n", ast_config_AST_DB, strerror(errno));
 		return -1;
 	}
 	return 0;

Modified: team/juggie/NoLossCDR/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/manager.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/main/manager.c (original)
+++ team/juggie/NoLossCDR/main/manager.c Tue Oct  9 14:15:01 2007
@@ -1302,8 +1302,8 @@
 }
 
 static char mandescr_updateconfig[] =
-"Description: A 'UpdateConfig' action will dump the contents of a configuration\n"
-"file by category and contents.\n"
+"Description: A 'UpdateConfig' action will modify, create, or delete\n"
+"configuration elements in Asterisk configuration files.\n"
 "Variables (X's represent 6 digit number beginning with 000000):\n"
 "   SrcFilename:   Configuration filename to read(e.g. foo.conf)\n"
 "   DstFilename:   Configuration filename to write(e.g. foo.conf)\n"

Modified: team/juggie/NoLossCDR/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/pbx.c?view=diff&rev=85156&r1=85155&r2=85156
==============================================================================
--- team/juggie/NoLossCDR/main/pbx.c (original)
+++ team/juggie/NoLossCDR/main/pbx.c Tue Oct  9 14:15:01 2007
@@ -248,6 +248,16 @@
 	.thread = AST_PTHREADT_NULL,
 };
 
+struct pbx_exception {
+	AST_DECLARE_STRING_FIELDS(
+		AST_STRING_FIELD(context);	/*!< Context associated with this exception */
+		AST_STRING_FIELD(exten);	/*!< Exten associated with this exception */
+		AST_STRING_FIELD(type);		/*!< The type of exception */
+	);
+
+	int priority;				/*!< Priority associated with this exception */
+};
+
 static int pbx_builtin_answer(struct ast_channel *, void *);
 static int pbx_builtin_goto(struct ast_channel *, void *);
 static int pbx_builtin_hangup(struct ast_channel *, void *);
@@ -270,7 +280,9 @@
 static int pbx_builtin_saycharacters(struct ast_channel *, void *);
 static int pbx_builtin_sayphonetic(struct ast_channel *, void *);
 int pbx_builtin_setvar(struct ast_channel *, void *);
+static int pbx_builtin_setvar_multiple(struct ast_channel *, void *);
 static int pbx_builtin_importvar(struct ast_channel *, void *);
+static void set_ext_pri(struct ast_channel *c, const char *exten, int pri);
 
 AST_RWLOCK_DEFINE_STATIC(globalslock);
 static struct varshead globals = AST_LIST_HEAD_NOLOCK_INIT_VALUE;
@@ -433,6 +445,13 @@
 	"be provided to the calling channel.\n"
 	},
 
+	{ "RaiseException", pbx_builtin_raise_exception,
+	"Handle an exceptional condition",
+	"  RaiseException(<reason>): This application will jump to the \"e\" extension\n"
+	"in the current context, setting the dialplan function EXCEPTION().  If the \"e\"\n"
+	"extension does not exist, the call will hangup.\n"
+	},
+
 	{ "ResetCDR", pbx_builtin_resetcdr,
 	"Resets the Call Data Record",
 	"  ResetCDR([options]):  This application causes the Call Data Record to be\n"
@@ -477,7 +496,7 @@
 	},
 
 	{ "Set", pbx_builtin_setvar,
-	"Set channel variable(s) or function value(s)",
+	"Set channel variable or function value",
 	"  Set(name=value)\n"
 	"This function can be used to set the value of channel variables or dialplan\n"
 	"functions. When setting variables, if the variable name is prefixed with _,\n"
@@ -485,6 +504,19 @@
 	"channel. If the variable name is prefixed with __, the variable will be\n"
 	"inherited into channels created from the current channel and all children\n"
 	"channels.\n"
+	},
+
+	{ "MSet", pbx_builtin_setvar_multiple,
+	"Set channel variable(s) or function value(s)",
+	"  MSet(name1=value1,name2=value2,...)\n"
+	"This function can be used to set the value of channel variables or dialplan\n"
+	"functions. When setting variables, if the variable name is prefixed with _,\n"
+	"the variable will be inherited into channels created from the current\n"
+	"channel. If the variable name is prefixed with __, the variable will be\n"
+	"inherited into channels created from the current channel and all children\n"
+	"channels.\n\n"
+	"MSet behaves in a similar fashion to the way Set worked in 1.2/1.4 and is thus\n"
+	"prone to doing things that you may not expect.  Avoid its use if possible.\n"
 	},
 
 	{ "SetAMAFlags", pbx_builtin_setamaflags,
@@ -1241,6 +1273,84 @@
 			*ret = substring(*ret, offset, length, workspace, workspacelen);
 	}
 }
+
+static void exception_store_free(void *data)
+{
+	struct pbx_exception *exception = data;
+	ast_string_field_free_pools(exception);
+	ast_free(exception);
+}
+
+static struct ast_datastore_info exception_store_info = {
+	.type = "EXCEPTION",
+	.destroy = exception_store_free,
+};
+
+int pbx_builtin_raise_exception(struct ast_channel *chan, void *vtype)
+{
+	const char *type = vtype;
+	struct ast_datastore *ds = ast_channel_datastore_find(chan, &exception_store_info, NULL);
+	struct pbx_exception *exception = NULL;
+
+	if (!ds) {
+		ds = ast_channel_datastore_alloc(&exception_store_info, NULL);
+		if (!ds)
+			return -1;
+		exception = ast_calloc(1, sizeof(struct pbx_exception));
+		if (!ds->data) {
+			ast_channel_datastore_free(ds);
+			return -1;
+		}
+		if (ast_string_field_init(exception, 128)) {
+			ast_free(exception);
+			ast_channel_datastore_free(ds);
+			return -1;
+		}
+		ds->data = exception;
+		ast_channel_datastore_add(chan, ds);
+	} else
+		exception = ds->data;
+
+	ast_string_field_set(exception, type, type);
+	ast_string_field_set(exception, context, chan->context);
+	ast_string_field_set(exception, exten, chan->exten);
+	exception->priority = chan->priority;
+	set_ext_pri(chan, "e", 1);
+	return 0;
+}
+
+static int acf_exception_read(struct ast_channel *chan, const char *name, char *data, char *buf, size_t buflen)
+{
+	struct ast_datastore *ds = ast_channel_datastore_find(chan, &exception_store_info, NULL);
+	struct pbx_exception *exception = NULL;
+	if (!ds || !ds->data)
+		return -1;
+	exception = ds->data;
+	if (!strcasecmp(data, "TYPE"))
+		ast_copy_string(buf, exception->type, buflen);
+	else if (!strcasecmp(data, "CONTEXT"))
+		ast_copy_string(buf, exception->context, buflen);
+	else if (!strncasecmp(data, "EXTEN", 5))
+		ast_copy_string(buf, exception->exten, buflen);
+	else if (!strcasecmp(data, "PRIORITY"))
+		snprintf(buf, buflen, "%d", exception->priority);
+	else
+		return -1;
+	return 0;
+}
+
+static struct ast_custom_function exception_function = {
+	.name = "EXCEPTION",
+	.synopsis = "Retrieve the details of the current dialplan exception",
+	.desc =
+"The following fields are available for retrieval:\n"
+"  type      INVALID, ERROR, RESPONSETIMEOUT, or ABSOLUTETIMEOUT\n"
+"  context   The context executing when the exception occurred\n"
+"  exten     The extension executing when the exception occurred\n"
+"  priority  The numeric priority executing when the exception occurred\n",
+	.syntax = "EXCEPTION(<field>)",
+	.read = acf_exception_read,
+};
 
 static char *handle_show_functions(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
@@ -2383,8 +2493,22 @@
 				}
 				ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
 				ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
+
+ 				if ((res == AST_PBX_ERROR) && ast_exists_extension(c, c->context, "e", 1, c->cid.cid_num)) {
+ 					/* if we are already on the 'e' exten, don't jump to it again */
+ 					if (!strcmp(c->exten, "e")) {
+ 						if (option_verbose > 1)
+ 							ast_verbose(VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited ERROR while already on 'e' exten on '%s'\n", c->context, c->exten, c->priority, c->name);
+ 						error = 1;
+						break;
+ 					} else {
+						pbx_builtin_raise_exception(c, "ERROR");
+ 						continue;
+ 					}
+ 				}
+
 				if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) {
-					c->_softhangup =0;
+					c->_softhangup = 0;
 				} else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT) {
 					/* atimeout, nothing bad */
 				} else {
@@ -2392,8 +2516,13 @@
 					break;
 				}
 			}
-			if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT && ast_exists_extension(c,c->context,"T",1,c->cid.cid_num)) {
+			if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT && ast_exists_extension(c, c->context, "T", 1, c->cid.cid_num)) {

[... 2041 lines stripped ...]



More information about the asterisk-commits mailing list