[asterisk-commits] file: branch file/chan_jingle2 r368687 - in /team/file/chan_jingle2: ./ addon...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 7 17:32:38 CDT 2012


Author: file
Date: Thu Jun  7 17:32:06 2012
New Revision: 368687

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=368687
Log:
Yay! Up to date!

Added:
    team/file/chan_jingle2/autoconf/ast_pkgconfig.m4
      - copied unchanged from r368681, trunk/autoconf/ast_pkgconfig.m4
    team/file/chan_jingle2/channels/chan_sip.exports.in
      - copied unchanged from r368681, trunk/channels/chan_sip.exports.in
    team/file/chan_jingle2/configs/app_skel.conf.sample
      - copied unchanged from r368681, trunk/configs/app_skel.conf.sample
    team/file/chan_jingle2/configs/config_test.conf.sample
      - copied unchanged from r368681, trunk/configs/config_test.conf.sample
    team/file/chan_jingle2/funcs/func_presencestate.c
      - copied unchanged from r368681, trunk/funcs/func_presencestate.c
    team/file/chan_jingle2/include/asterisk/app_voicemail.h
      - copied unchanged from r368681, trunk/include/asterisk/app_voicemail.h
    team/file/chan_jingle2/include/asterisk/config_options.h
      - copied unchanged from r368681, trunk/include/asterisk/config_options.h
    team/file/chan_jingle2/include/asterisk/http_websocket.h
      - copied unchanged from r368681, trunk/include/asterisk/http_websocket.h
    team/file/chan_jingle2/include/asterisk/presencestate.h
      - copied unchanged from r368681, trunk/include/asterisk/presencestate.h
    team/file/chan_jingle2/include/asterisk/sip_api.h
      - copied unchanged from r368681, trunk/include/asterisk/sip_api.h
    team/file/chan_jingle2/main/config_options.c
      - copied unchanged from r368681, trunk/main/config_options.c
    team/file/chan_jingle2/main/presencestate.c
      - copied unchanged from r368681, trunk/main/presencestate.c
    team/file/chan_jingle2/res/res_http_websocket.c
      - copied unchanged from r368681, trunk/res/res_http_websocket.c
    team/file/chan_jingle2/res/res_http_websocket.exports.in
      - copied unchanged from r368681, trunk/res/res_http_websocket.exports.in
    team/file/chan_jingle2/tests/test_voicemail_api.c
      - copied unchanged from r368681, trunk/tests/test_voicemail_api.c
Modified:
    team/file/chan_jingle2/   (props changed)
    team/file/chan_jingle2/CHANGES
    team/file/chan_jingle2/Makefile
    team/file/chan_jingle2/UPGRADE.txt
    team/file/chan_jingle2/addons/format_mp3.c
    team/file/chan_jingle2/apps/app_chanspy.c
    team/file/chan_jingle2/apps/app_confbridge.c
    team/file/chan_jingle2/apps/app_dial.c
    team/file/chan_jingle2/apps/app_disa.c
    team/file/chan_jingle2/apps/app_externalivr.c
    team/file/chan_jingle2/apps/app_followme.c
    team/file/chan_jingle2/apps/app_meetme.c
    team/file/chan_jingle2/apps/app_minivm.c
    team/file/chan_jingle2/apps/app_mixmonitor.c
    team/file/chan_jingle2/apps/app_page.c
    team/file/chan_jingle2/apps/app_queue.c
    team/file/chan_jingle2/apps/app_record.c
    team/file/chan_jingle2/apps/app_skel.c
    team/file/chan_jingle2/apps/app_stack.c
    team/file/chan_jingle2/apps/app_voicemail.c
    team/file/chan_jingle2/apps/app_voicemail.exports.in
    team/file/chan_jingle2/build_tools/make_version
    team/file/chan_jingle2/channels/chan_agent.c
    team/file/chan_jingle2/channels/chan_alsa.c
    team/file/chan_jingle2/channels/chan_console.c
    team/file/chan_jingle2/channels/chan_dahdi.c
    team/file/chan_jingle2/channels/chan_gtalk.c
    team/file/chan_jingle2/channels/chan_h323.c
    team/file/chan_jingle2/channels/chan_iax2.c
    team/file/chan_jingle2/channels/chan_jingle.c
    team/file/chan_jingle2/channels/chan_local.c
    team/file/chan_jingle2/channels/chan_mgcp.c
    team/file/chan_jingle2/channels/chan_misdn.c
    team/file/chan_jingle2/channels/chan_oss.c
    team/file/chan_jingle2/channels/chan_phone.c
    team/file/chan_jingle2/channels/chan_sip.c
    team/file/chan_jingle2/channels/chan_skinny.c
    team/file/chan_jingle2/channels/chan_unistim.c
    team/file/chan_jingle2/channels/chan_vpb.cc
    team/file/chan_jingle2/channels/iax2-parser.c
    team/file/chan_jingle2/channels/iax2-provision.c
    team/file/chan_jingle2/channels/sig_analog.c
    team/file/chan_jingle2/channels/sig_pri.c
    team/file/chan_jingle2/channels/sig_ss7.c
    team/file/chan_jingle2/channels/sip/config_parser.c
    team/file/chan_jingle2/channels/sip/dialplan_functions.c
    team/file/chan_jingle2/channels/sip/include/dialog.h
    team/file/chan_jingle2/channels/sip/include/sip.h
    team/file/chan_jingle2/channels/sip/reqresp_parser.c
    team/file/chan_jingle2/codecs/codec_dahdi.c
    team/file/chan_jingle2/configs/followme.conf.sample
    team/file/chan_jingle2/configs/manager.conf.sample
    team/file/chan_jingle2/configs/queues.conf.sample
    team/file/chan_jingle2/configs/sip.conf.sample
    team/file/chan_jingle2/configure
    team/file/chan_jingle2/configure.ac
    team/file/chan_jingle2/contrib/editors/asterisk.vim
    team/file/chan_jingle2/contrib/realtime/mysql/voicemail_messages.sql
    team/file/chan_jingle2/formats/format_ogg_vorbis.c
    team/file/chan_jingle2/funcs/func_cdr.c
    team/file/chan_jingle2/funcs/func_channel.c
    team/file/chan_jingle2/funcs/func_devstate.c
    team/file/chan_jingle2/funcs/func_dialgroup.c
    team/file/chan_jingle2/funcs/func_frame_trace.c
    team/file/chan_jingle2/funcs/func_lock.c
    team/file/chan_jingle2/funcs/func_math.c
    team/file/chan_jingle2/funcs/func_odbc.c
    team/file/chan_jingle2/funcs/func_speex.c
    team/file/chan_jingle2/include/asterisk/app.h
    team/file/chan_jingle2/include/asterisk/astobj2.h
    team/file/chan_jingle2/include/asterisk/callerid.h
    team/file/chan_jingle2/include/asterisk/cel.h
    team/file/chan_jingle2/include/asterisk/channel.h
    team/file/chan_jingle2/include/asterisk/config.h
    team/file/chan_jingle2/include/asterisk/event_defs.h
    team/file/chan_jingle2/include/asterisk/file.h
    team/file/chan_jingle2/include/asterisk/frame.h
    team/file/chan_jingle2/include/asterisk/logger.h
    team/file/chan_jingle2/include/asterisk/manager.h
    team/file/chan_jingle2/include/asterisk/message.h
    team/file/chan_jingle2/include/asterisk/pbx.h
    team/file/chan_jingle2/include/asterisk/rtp_engine.h
    team/file/chan_jingle2/include/asterisk/stringfields.h
    team/file/chan_jingle2/include/asterisk/tcptls.h
    team/file/chan_jingle2/include/asterisk/utils.h
    team/file/chan_jingle2/main/acl.c
    team/file/chan_jingle2/main/app.c
    team/file/chan_jingle2/main/asterisk.c
    team/file/chan_jingle2/main/asterisk.exports.in
    team/file/chan_jingle2/main/astobj2.c
    team/file/chan_jingle2/main/callerid.c
    team/file/chan_jingle2/main/cdr.c
    team/file/chan_jingle2/main/cel.c
    team/file/chan_jingle2/main/channel.c
    team/file/chan_jingle2/main/channel_internal_api.c
    team/file/chan_jingle2/main/cli.c
    team/file/chan_jingle2/main/config.c
    team/file/chan_jingle2/main/data.c
    team/file/chan_jingle2/main/devicestate.c
    team/file/chan_jingle2/main/dial.c
    team/file/chan_jingle2/main/editline/readline.c
    team/file/chan_jingle2/main/editline/term.c
    team/file/chan_jingle2/main/editline/tokenizer.c
    team/file/chan_jingle2/main/enum.c
    team/file/chan_jingle2/main/event.c
    team/file/chan_jingle2/main/features.c
    team/file/chan_jingle2/main/file.c
    team/file/chan_jingle2/main/logger.c
    team/file/chan_jingle2/main/manager.c
    team/file/chan_jingle2/main/message.c
    team/file/chan_jingle2/main/netsock2.c
    team/file/chan_jingle2/main/pbx.c
    team/file/chan_jingle2/main/rtp_engine.c
    team/file/chan_jingle2/main/say.c
    team/file/chan_jingle2/main/tcptls.c
    team/file/chan_jingle2/main/udptl.c
    team/file/chan_jingle2/main/utils.c
    team/file/chan_jingle2/main/xmldoc.c
    team/file/chan_jingle2/makeopts.in
    team/file/chan_jingle2/pbx/dundi-parser.c
    team/file/chan_jingle2/pbx/pbx_config.c
    team/file/chan_jingle2/pbx/pbx_dundi.c
    team/file/chan_jingle2/res/ael/ael.flex
    team/file/chan_jingle2/res/ael/pval.c
    team/file/chan_jingle2/res/res_calendar.c
    team/file/chan_jingle2/res/res_calendar_caldav.c
    team/file/chan_jingle2/res/res_calendar_ews.c
    team/file/chan_jingle2/res/res_calendar_exchange.c
    team/file/chan_jingle2/res/res_calendar_icalendar.c
    team/file/chan_jingle2/res/res_config_odbc.c
    team/file/chan_jingle2/res/res_jabber.c
    team/file/chan_jingle2/res/res_monitor.c
    team/file/chan_jingle2/res/res_odbc.c
    team/file/chan_jingle2/res/res_rtp_asterisk.c
    team/file/chan_jingle2/res/res_srtp.c
    team/file/chan_jingle2/tests/test_astobj2.c
    team/file/chan_jingle2/tests/test_config.c

Propchange: team/file/chan_jingle2/
            ('branch-10-blocked' removed)

Propchange: team/file/chan_jingle2/
            ('branch-10-merged' removed)

Propchange: team/file/chan_jingle2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun  7 17:32:06 2012
@@ -1,1 +1,1 @@
-/trunk:1-365451
+/trunk:1-368682

Modified: team/file/chan_jingle2/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/CHANGES?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/CHANGES (original)
+++ team/file/chan_jingle2/CHANGES Thu Jun  7 17:32:06 2012
@@ -26,10 +26,18 @@
  * Threads belonging to a particular call are now linked with callids which get
    added to any log messages produced by those threads. Log messages can now be
    easily identified as involved with a certain call by looking at their call id.
-   This feature can be disabled in logger.conf with the display_callids option.
+   Call ids may also be attached to log messages for just about any case where
+   it can be determined to be related to a particular call.
  * The minimum DTMF duration can now be configured in asterisk.conf
    as "mindtmfduration". The default value is (as before) set to 80 ms.
    (previously it was only available in source code)
+ * Each logging destination and console now have an independent notion of the
+   current verbosity level.  Logger.conf now allows an optional argument to
+   the 'verbose' specifier, indicating the level of verbosity sent to that
+   particular logging destination.  Additionally, remote consoles now each
+   have their own verbosity level.  The command 'core set verbose' will now set
+   a separate level for each remote console without affecting any other
+   console.
 
 CLI Changes
 -------------------
@@ -124,6 +132,14 @@
 -------------
  * Added queue options autopausebusy and autopauseunavail for automatically
    pausing a queue member when their device reports busy or congestion.
+ * The 'ignorebusy' option for queue members has been deprecated in favor of
+   the option 'ringinuse. Also a 'queue set ringinuse' CLI command has been
+   added as well as an AMI action 'QueueMemberRingInUse' to set this variable on a
+   per interface basis. Individual ringinuse values can now be set in
+   queues.conf via an argument to member definitions. Lastly, the queue
+   'ringinuse' setting now only determines defaults for the per member
+   'ringinuse' setting and does not override per member settings like it does
+   in earlier versions.
 
 Voicemail changes
 -----------------
@@ -194,16 +210,6 @@
  * Allow the built in variables ${NUMBER}, ${IPADDR} and ${SECRET} to be
    used within the dynamic weight attribute when specifying a mapping.
 
-Core changes
-------------
- * Each logging destination and console now have an independent notion of the
-   current verbosity level.  Logger.conf now allows an optional argument to
-   the 'verbose' specifier, indicating the level of verbosity sent to that
-   particular logging destination.  Additionally, remote consoles now each
-   have their own verbosity level.  The command 'core set verbose' will now set
-   a separate level for each remote console without affecting any other
-   console.
-
 Dialplan functions
 ------------------
  * Addition of the VM_INFO function that can be used to retrieve voicemail
@@ -225,6 +231,8 @@
    connected line changes when they occur.  This is similar to app_dial
    and app_queue.
  * The 'N' option is now ignored if the call is already answered.
+ * Added 'b' and 'B' options to FollowMe that execute a Gosub on callee
+   and caller channels respectively before the callee channels are called.
 
 RTP changes
 -------------

Modified: team/file/chan_jingle2/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/Makefile?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/Makefile (original)
+++ team/file/chan_jingle2/Makefile Thu Jun  7 17:32:06 2012
@@ -191,6 +191,7 @@
   _ASTCFLAGS+=-Wunused
   _ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
   _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
+  _ASTCFLAGS+=$(AST_TRAMPOLINES)
   _ASTCFLAGS+=-Wundef
   _ASTCFLAGS+=-Wmissing-format-attribute
   _ASTCFLAGS+=-Wformat=2
@@ -884,7 +885,9 @@
 	- at menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 # options for make in menuselect/
-MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
+MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="" LD="" AR="" RANLIB="" \
+		CFLAGS="$(BUILD_CFLAGS)" LDFLAGS="$(BUILD_LDFLAGS)" \
+		$(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
 
 menuselect/menuselect: menuselect/makeopts
 	+$(MAKE_MENUSELECT) menuselect

Modified: team/file/chan_jingle2/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/UPGRADE.txt?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/UPGRADE.txt (original)
+++ team/file/chan_jingle2/UPGRADE.txt Thu Jun  7 17:32:06 2012
@@ -25,6 +25,11 @@
 Parking:
  - The comebacktoorigin setting must now be set per parking lot. The setting in
    the general section will not be applied automatically to each parking lot.
+ - The BLINDTRANSFER channel variable is deleted from a channel when it is
+   bridged to prevent subtle bugs in the parking feature.  The channel
+   variable is used by Asterisk internally for the Park application to work
+   properly.  If you were using it for your own purposes, copy it to your
+   own channel variable before the channel is bridged.
 
 res_ais:
  - Users of res_ais in versions of Asterisk prior to Asterisk 11 must change
@@ -79,6 +84,11 @@
   - The 'c' option (announce user count) will now work even if the 'q' (quiet)
     option is enabled.
 
+app_followme:
+ - Answered outgoing calls no longer get cut off when the next step is started.
+   You now have until the last step times out to decide if you want to accept
+   the call or not before being disconnected.
+
 SIP
 ===
  - A new option "tonezone" for setting default tonezone for the channel driver
@@ -86,6 +96,11 @@
  - A new manager event, "SessionTimeout" has been added and is triggered when
    a call is terminated due to RTP stream inactivity or SIP session timer
    expiration.
+ - SIP_CAUSE is now deprecated.  It has been modified to use the same
+   mechanism as HANGUPCAUSE.  Behavior should not change, but performance
+   should be vastly improved.  The HANGUPCAUSE hash should now be used instead
+   of SIP_CAUSE. Because of this, the storesipcause option in sip.conf is also
+   deprecated.
 
 chan_unistim
  - Due to massive update in chan_unistim phone keys functions and on-screen 

Modified: team/file/chan_jingle2/addons/format_mp3.c
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/addons/format_mp3.c?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/addons/format_mp3.c (original)
+++ team/file/chan_jingle2/addons/format_mp3.c Thu Jun  7 17:32:06 2012
@@ -9,7 +9,7 @@
  * Thanks to mpglib from http://www.mpg123.org/
  * and Chris Stenton [jacs at gnome.co.uk]
  * for coding the ability to play stereo and non-8khz files
- 
+
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
  * any of the maintainers of this project for assistance;
@@ -48,20 +48,20 @@
 #define MP3_DCACHE 8192
 
 struct mp3_private {
-	char waste[AST_FRIENDLY_OFFSET];	/* Buffer for sending frames, etc */
-	char empty;				/* Empty character */
-	int lasttimeout;
-	int maxlen;
-	struct timeval last;
+	/*! state for the mp3 decoder */
 	struct mpstr mp;
+	/*! buffer to hold mp3 data after read from disk */
 	char sbuf[MP3_SCACHE];
+	/*! buffer for slinear audio after being decoded out of sbuf */
 	char dbuf[MP3_DCACHE];
+	/*! how much data has been written to the output buffer in the ast_filestream */
 	int buflen;
+	/*! how much data has been written to sbuf */
 	int sbuflen;
+	/*! how much data is left to be read out of dbuf, starting at dbufoffset */
 	int dbuflen;
+	/*! current offset for reading data out of dbuf */
 	int dbufoffset;
-	int sbufoffset;
-	int lastseek;
 	int offset;
 	long seek;
 };
@@ -107,17 +107,17 @@
 static void mp3_close(struct ast_filestream *s)
 {
 	struct mp3_private *p = s->_private;
-	
+
 	ExitMP3(&p->mp);
 	return;
 }
 
-static int mp3_squeue(struct ast_filestream *s) 
+static int mp3_squeue(struct ast_filestream *s)
 {
 	struct mp3_private *p = s->_private;
 	int res=0;
-	
-	p->lastseek = ftell(s->f);
+
+	res = ftell(s->f);
 	p->sbuflen = fread(p->sbuf, 1, MP3_SCACHE, s->f);
 	if(p->sbuflen < 0) {
 		ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", p->sbuflen, strerror(errno));
@@ -131,11 +131,11 @@
 	return 0;
 }
 
-static int mp3_dqueue(struct ast_filestream *s) 
+static int mp3_dqueue(struct ast_filestream *s)
 {
 	struct mp3_private *p = s->_private;
 	int res=0;
-	
+
 	if((res = decodeMP3(&p->mp,NULL,0,p->dbuf,MP3_DCACHE,&p->dbuflen)) == MP3_OK) {
 		p->sbuflen -= p->dbuflen;
 		p->dbufoffset = 0;
@@ -147,7 +147,7 @@
 {
 	struct mp3_private *p = s->_private;
 	int res = 0, bytes = 0;
-	
+
 	if(p->seek) {
 		ExitMP3(&p->mp);
 		InitMP3(&p->mp, OUTSCALE);
@@ -167,7 +167,7 @@
 			if(res == MP3_ERR)
 				return -1;
 		}
-		
+
 		p->seek = 0;
 		return 0;
 	}
@@ -181,7 +181,7 @@
 			if(mp3_squeue(s))
 				return -1;
 		}
-		
+
 	}
 
 	return 0;
@@ -194,36 +194,41 @@
 	int delay =0;
 	int save=0;
 
-	/* Send a frame from the file to the appropriate channel */
-
-	if(mp3_queue(s))
+	/* Pre-populate the buffer that holds audio to be returned (dbuf) */
+	if (mp3_queue(s)) {
 		return NULL;
-
-	if(p->dbuflen) {
-		for(p->buflen=0; p->buflen < MP3_BUFLEN && p->buflen < p->dbuflen; p->buflen++) {
-			s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[p->buflen+p->dbufoffset];
-			p->sbufoffset++;
+	}
+
+	if (p->dbuflen) {
+		/* Read out what's waiting in dbuf */
+		for (p->buflen = 0; p->buflen < MP3_BUFLEN && p->buflen < p->dbuflen; p->buflen++) {
+			s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[p->buflen + p->dbufoffset];
 		}
 		p->dbufoffset += p->buflen;
 		p->dbuflen -= p->buflen;
-
-		if(p->buflen < MP3_BUFLEN) {
-			if(mp3_queue(s))
-				return NULL;
-
-			for(save = p->buflen; p->buflen < MP3_BUFLEN; p->buflen++) {
-				s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[(p->buflen-save)+p->dbufoffset];
-				p->sbufoffset++;
+	}
+
+	if (p->buflen < MP3_BUFLEN) {
+		/* dbuf didn't have enough, so reset dbuf, fill it back up and continue */
+		p->dbuflen = p->dbufoffset = 0;
+
+		if (mp3_queue(s)) {
+			return NULL;
+		}
+
+		/* Make sure dbuf has enough to complete this read attempt */
+		if (p->dbuflen >= (MP3_BUFLEN - p->buflen)) {
+			for (save = p->buflen; p->buflen < MP3_BUFLEN; p->buflen++) {
+				s->buf[p->buflen + AST_FRIENDLY_OFFSET] = p->dbuf[(p->buflen - save) + p->dbufoffset];
 			}
 			p->dbufoffset += (MP3_BUFLEN - save);
 			p->dbuflen -= (MP3_BUFLEN - save);
-
-		} 
-
-	}
-	
+		}
+
+	}
+
 	p->offset += p->buflen;
-	delay = p->buflen/2;
+	delay = p->buflen / 2;
 	s->fr.frametype = AST_FRAME_VOICE;
 	ast_format_set(&s->fr.subclass.format, AST_FORMAT_SLINEAR, 0);
 	AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, p->buflen);
@@ -266,16 +271,16 @@
 
 	p->seek = offset;
 	return fseek(s->f, offset, SEEK_SET);
-	
-}
-
-static int mp3_rewrite(struct ast_filestream *s, const char *comment) 
+
+}
+
+static int mp3_rewrite(struct ast_filestream *s, const char *comment)
 {
 	ast_log(LOG_ERROR,"I Can't write MP3 only read them.\n");
 	return -1;
 }
 
-static int mp3_trunc(struct ast_filestream *s) 
+static int mp3_trunc(struct ast_filestream *s)
 {
 
 	ast_log(LOG_ERROR,"I Can't write MP3 only read them.\n");
@@ -285,7 +290,7 @@
 static off_t mp3_tell(struct ast_filestream *s)
 {
 	struct mp3_private *p = s->_private;
-	
+
 	return p->offset/2;
 }
 
@@ -321,6 +326,6 @@
 static int unload_module(void)
 {
 	return ast_format_def_unregister(name);
-}	
+}
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MP3 format [Any rate but 8000hz mono is optimal]");

Modified: team/file/chan_jingle2/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/apps/app_chanspy.c?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/apps/app_chanspy.c (original)
+++ team/file/chan_jingle2/apps/app_chanspy.c Thu Jun  7 17:32:06 2012
@@ -1249,6 +1249,7 @@
 		}
 
 	} else {
+		/* Coverity - This uninit_use should be ignored since this macro initializes the flags */
 		ast_clear_flag(&flags, AST_FLAGS_ALL);
 	}
 
@@ -1293,6 +1294,7 @@
 	int res;
 	char *mygroup = NULL;
 
+	/* Coverity - This uninit_use should be ignored since this macro initializes the flags */
 	ast_clear_flag(&flags, AST_FLAGS_ALL);
 	ast_format_clear(&oldwf);
 	if (!ast_strlen_zero(data)) {

Modified: team/file/chan_jingle2/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/apps/app_confbridge.c?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/apps/app_confbridge.c (original)
+++ team/file/chan_jingle2/apps/app_confbridge.c Thu Jun  7 17:32:06 2012
@@ -1159,8 +1159,8 @@
 	struct ast_channel *underlying_channel;
 
 	/* Do not waste resources trying to play files that do not exist */
-	if (!ast_fileexists(filename, NULL, NULL)) {
-		ast_log(LOG_WARNING, "File %s does not exist in any format\n", filename);
+	if (!ast_strlen_zero(filename) && !ast_fileexists(filename, NULL, NULL)) {
+		ast_log(LOG_WARNING, "File %s does not exist in any format\n", !ast_strlen_zero(filename) ? filename : "<unknown>");
 		return 0;
 	}
 
@@ -1180,7 +1180,7 @@
 	/* The channel is all under our control, in goes the prompt */
 	if (!ast_strlen_zero(filename)) {
 		ast_stream_and_wait(conference_bridge->playback_chan, filename, "");
-	} else {
+	} else if (say_number >= 0) {
 		ast_say_number(conference_bridge->playback_chan, say_number, "", ast_channel_language(conference_bridge->playback_chan), NULL);
 	}
 
@@ -1203,7 +1203,7 @@
  */
 static int play_sound_file(struct conference_bridge *conference_bridge, const char *filename)
 {
-	return play_sound_helper(conference_bridge, filename, 0);
+	return play_sound_helper(conference_bridge, filename, -1);
 }
 
 /*!

Modified: team/file/chan_jingle2/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/apps/app_dial.c?view=diff&rev=368687&r1=368686&r2=368687
==============================================================================
--- team/file/chan_jingle2/apps/app_dial.c (original)
+++ team/file/chan_jingle2/apps/app_dial.c Thu Jun  7 17:32:06 2012
@@ -92,7 +92,7 @@
 				<para>If not specified, this defaults to 136 years.</para>
 			</parameter>
 			<parameter name="options" required="false">
-			   <optionlist>
+				<optionlist>
 				<option name="A">
 					<argument name="x" required="true">
 						<para>The file to play to the called party</para>
@@ -109,8 +109,8 @@
 					this option, the default behavior is adequate in most cases.</para>
 				</option>
 				<option name="b" argsep="^">
-					<para>Before initiating the actual call, Gosub to the specified
-					location using the newly created channel(s).  The Gosub will be
+					<para>Before initiating an outgoing call, Gosub to the specified
+					location using the newly created channel.  The Gosub will be
 					executed for each destination channel.</para>
 					<argument name="context" required="false" />
 					<argument name="exten" required="false" />
@@ -120,7 +120,7 @@
 					</argument>
 				</option>
 				<option name="B" argsep="^">
-					<para>Before initiating the actual call, Gosub to the specified
+					<para>Before initiating the outgoing call(s), Gosub to the specified
 					location using the current channel.</para>
 					<argument name="context" required="false" />
 					<argument name="exten" required="false" />
@@ -133,8 +133,7 @@
 					<para>Reset the call detail record (CDR) for this call.</para>
 				</option>
 				<option name="c">
-					<para>If the Dial() application cancels this call, always set the flag to tell the channel
-					driver that the call is answered elsewhere.</para>
+					<para>If the Dial() application cancels this call, always set HANGUPCAUSE to 'answered elsewhere'</para>
 				</option>
 				<option name="d">
 					<para>Allow the calling user to dial a 1 digit extension while waiting for
@@ -324,8 +323,8 @@
 					Macro()</para></warning>
 				</option>
 				<option name="n">
-				        <argument name="delete">
-					        <para>With <replaceable>delete</replaceable> either not specified or set to <literal>0</literal>,
+					<argument name="delete">
+						<para>With <replaceable>delete</replaceable> either not specified or set to <literal>0</literal>,
 						the recorded introduction will not be deleted if the caller hangs up while the remote party has not
 						yet answered.</para>
 						<para>With <replaceable>delete</replaceable> set to <literal>1</literal>, the introduction will
@@ -727,8 +726,6 @@
 		/* Hangup any existing lines we have open */
 		if (outgoing->chan && (outgoing->chan != exception)) {
 			if (answered_elsewhere) {
-				/* The flag is used for local channel inheritance and stuff */
-				ast_set_flag(ast_channel_flags(outgoing->chan), AST_FLAG_ANSWERED_ELSEWHERE);
 				/* This is for the channel drivers */
 				ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 			}
@@ -859,7 +856,8 @@
  * \param o Outgoing call channel list.
  * \param num Incoming call channel cause accumulation
  * \param peerflags Dial option flags
- * \param single_caller_bored From wait_for_answer: single && !caller_entertained
+ * \param single TRUE if there is only one outgoing call.
+ * \param caller_entertained TRUE if the caller is being entertained by MOH or ringback.
  * \param to Remaining call timeout time.
  * \param forced_clid OPT_FORCECLID caller id to send
  * \param stored_clid Caller id representing the called party if needed
@@ -869,8 +867,8 @@
  *
  * \todo eventually this function should be intergrated into and replaced by ast_call_forward()
  */
-static void do_forward(struct chanlist *o,
-	struct cause_args *num, struct ast_flags64 *peerflags, int single_caller_bored, int *to,
+static void do_forward(struct chanlist *o, struct cause_args *num,
+	struct ast_flags64 *peerflags, int single, int caller_entertained, int *to,
 	struct ast_party_id *forced_clid, struct ast_party_id *stored_clid)
 {
 	char tmpchan[256];
@@ -897,6 +895,14 @@
 		ast_channel_unlock(c);
 		stuff = tmpchan;
 		tech = "Local";
+	}
+	if (!strcasecmp(tech, "Local")) {
+		/*
+		 * Drop the connected line update block for local channels since
+		 * this is going to run dialplan and the user can change his
+		 * mind about what connected line information he wants to send.
+		 */
+		ast_clear_flag64(o, OPT_IGNORE_CONNECTEDLINE);
 	}
 
 	ast_cel_report_event(in, AST_CEL_FORWARD, NULL, ast_channel_call_forward(c), NULL);
@@ -912,11 +918,14 @@
 		/* Setup parameters */
 		c = o->chan = ast_request(tech, ast_channel_nativeformats(in), in, stuff, &cause);
 		if (c) {
-			if (single_caller_bored) {
+			if (single && !caller_entertained) {
 				ast_channel_make_compatible(o->chan, in);
 			}
+			ast_channel_lock_both(in, o->chan);
 			ast_channel_inherit_variables(in, o->chan);
 			ast_channel_datastore_inherit(in, o->chan);
+			ast_channel_unlock(in);
+			ast_channel_unlock(o->chan);
 			/* When a call is forwarded, we don't want to track new interfaces
 			 * dialed for CC purposes. Setting the done flag will ensure that
 			 * any Dial operations that happen later won't record CC interfaces.
@@ -933,15 +942,18 @@
 		handle_cause(cause, num);
 		ast_hangup(original);
 	} else {
-		struct ast_party_redirecting redirecting;
+		ast_channel_lock_both(c, original);
+		ast_party_redirecting_copy(ast_channel_redirecting(c),
+			ast_channel_redirecting(original));
+		ast_channel_unlock(c);
+		ast_channel_unlock(original);
 
 		ast_channel_lock_both(c, in);
 
-		if (single_caller_bored && CAN_EARLY_BRIDGE(peerflags, c, in)) {
+		if (single && !caller_entertained && CAN_EARLY_BRIDGE(peerflags, c, in)) {
 			ast_rtp_instance_early_bridge_make_compatible(c, in);
 		}
 
-		ast_channel_set_redirecting(c, ast_channel_redirecting(original), NULL);
 		if (!ast_channel_redirecting(c)->from.number.valid
 			|| ast_strlen_zero(ast_channel_redirecting(c)->from.number.str)) {
 			/*
@@ -962,6 +974,7 @@
 		if (ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 			caller.id = *stored_clid;
 			ast_channel_set_caller_event(c, &caller, NULL);
+			ast_set_flag64(o, DIAL_CALLERID_ABSENT);
 		} else if (ast_strlen_zero(S_COR(ast_channel_caller(c)->id.number.valid,
 			ast_channel_caller(c)->id.number.str, NULL))) {
 			/*
@@ -970,6 +983,9 @@
 			 */
 			caller.id = *stored_clid;
 			ast_channel_set_caller_event(c, &caller, NULL);
+			ast_set_flag64(o, DIAL_CALLERID_ABSENT);
+		} else {
+			ast_clear_flag64(o, DIAL_CALLERID_ABSENT);
 		}
 
 		/* Determine CallerID for outgoing channel to send. */
@@ -987,23 +1003,33 @@
 
 		ast_channel_appl_set(c, "AppDial");
 		ast_channel_data_set(c, "(Outgoing Line)");
-		/*
-		 * We must unlock c before calling ast_channel_redirecting_macro, because
-		 * we put c into autoservice there. That is pretty much a guaranteed
-		 * deadlock. This is why the handling of c's lock may seem a bit unusual
-		 * here.
-		 */
-		ast_party_redirecting_init(&redirecting);
-		ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(c));
-		ast_channel_unlock(c);
-		if (ast_channel_redirecting_sub(c, in, &redirecting, 0) &&
-			ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
-			ast_channel_update_redirecting(in, &redirecting, NULL);
-		}
-		ast_party_redirecting_free(&redirecting);
+
 		ast_channel_unlock(in);
-
-		ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE);
+		if (single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
+			struct ast_party_redirecting redirecting;
+
+			/*
+			 * Redirecting updates to the caller make sense only on single
+			 * calls.
+			 *
+			 * We must unlock c before calling
+			 * ast_channel_redirecting_macro, because we put c into
+			 * autoservice there.  That is pretty much a guaranteed
+			 * deadlock.  This is why the handling of c's lock may seem a
+			 * bit unusual here.
+			 */
+			ast_party_redirecting_init(&redirecting);
+			ast_party_redirecting_copy(&redirecting, ast_channel_redirecting(c));
+			ast_channel_unlock(c);
+			if (ast_channel_redirecting_sub(c, in, &redirecting, 0) &&
+				ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
+				ast_channel_update_redirecting(in, &redirecting, NULL);
+			}
+			ast_party_redirecting_free(&redirecting);
+		} else {
+			ast_channel_unlock(c);
+		}
+
 		if (ast_test_flag64(peerflags, OPT_CANCEL_TIMEOUT)) {
 			*to = -1;
 		}
@@ -1024,7 +1050,7 @@
 			/* Hangup the original channel now, in case we needed it */
 			ast_hangup(original);
 		}
-		if (single_caller_bored) {
+		if (single && !caller_entertained) {
 			ast_indicate(in, -1);
 		}
 	}
@@ -1085,7 +1111,8 @@
 			}
 		}
 
-		if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
+		if (!ast_test_flag64(outgoing, OPT_IGNORE_CONNECTEDLINE)
+			&& !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
 			ast_channel_lock(outgoing->chan);
 			ast_connected_line_copy_from_caller(&connected_caller, ast_channel_caller(outgoing->chan));
 			ast_channel_unlock(outgoing->chan);
@@ -1148,7 +1175,7 @@
 			if (ast_test_flag64(o, DIAL_STILLGOING) && ast_channel_state(c) == AST_STATE_UP) {
 				if (!peer) {
 					ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
-					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+					if (!single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
 						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_sub(c, in, &o->connected, 0) &&
 								ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
@@ -1201,8 +1228,37 @@
 					}
 					ast_frfree(f);
 				}
-				do_forward(o, &num, peerflags, single && !caller_entertained, to,
+
+				if (o->pending_connected_update) {
+					/*
+					 * Re-seed the chanlist's connected line information with
+					 * previously acquired connected line info from the incoming
+					 * channel.  The previously acquired connected line info could
+					 * have been set through the CONNECTED_LINE dialplan function.
+					 */
+					o->pending_connected_update = 0;
+					ast_channel_lock(in);
+					ast_party_connected_line_copy(&o->connected, ast_channel_connected(in));
+					ast_channel_unlock(in);
+				}
+
+				do_forward(o, &num, peerflags, single, caller_entertained, to,
 					forced_clid, stored_clid);
+
+				if (single && o->chan
+					&& !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)
+					&& !ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
+					ast_channel_lock(o->chan);
+					ast_connected_line_copy_from_caller(&connected_caller,
+						ast_channel_caller(o->chan));
+					ast_channel_unlock(o->chan);
+					connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+					if (ast_channel_connected_line_sub(o->chan, in, &connected_caller, 0) &&
+						ast_channel_connected_line_macro(o->chan, in, &connected_caller, 1, 0)) {
+						ast_channel_update_connected_line(in, &connected_caller, NULL);
+					}
+					ast_party_connected_line_free(&connected_caller);
+				}
 				continue;
 			}
 			f = ast_read(winner);
@@ -1224,7 +1280,7 @@
 					/* This is our guy if someone answered. */
 					if (!peer) {
 						ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
-						if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+						if (!single && !ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
 							if (o->pending_connected_update) {
 								if (ast_channel_connected_line_sub(c, in, &o->connected, 0) &&
 									ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
@@ -1358,21 +1414,25 @@
 					ast_indicate(in, f->subclass.integer);
 					break;
 				case AST_CONTROL_CONNECTED_LINE:
-					if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+					if (ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
 						ast_verb(3, "Connected line update to %s prevented.\n", ast_channel_name(in));
-					} else if (!single) {
+						break;
+					}
+					if (!single) {
 						struct ast_party_connected_line connected;
-						ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", ast_channel_name(c), ast_channel_name(in));
+
+						ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n",
+							ast_channel_name(c), ast_channel_name(in));
 						ast_party_connected_line_set_init(&connected, &o->connected);
 						ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
 						ast_party_connected_line_set(&o->connected, &connected, NULL);
 						ast_party_connected_line_free(&connected);
 						o->pending_connected_update = 1;
-					} else {
-						if (ast_channel_connected_line_sub(c, in, f, 1) &&
-							ast_channel_connected_line_macro(c, in, f, 1, 1)) {
-							ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
-						}
+						break;
+					}
+					if (ast_channel_connected_line_sub(c, in, f, 1) &&
+						ast_channel_connected_line_macro(c, in, f, 1, 1)) {
+						ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
 					}
 					break;
 				case AST_CONTROL_AOC:
@@ -1387,16 +1447,24 @@
 					}
 					break;
 				case AST_CONTROL_REDIRECTING:
-					if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+					if (!single) {
+						/*
+						 * Redirecting updates to the caller make sense only on single
+						 * calls.
+						 */
+						break;
+					}
+					if (ast_test_flag64(o, OPT_IGNORE_CONNECTEDLINE)) {
 						ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(in));
-					} else if (single) {
-						ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
-						if (ast_channel_redirecting_sub(c, in, f, 1) &&
-							ast_channel_redirecting_macro(c, in, f, 1, 1)) {
-							ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
-						}
-						pa->sentringing = 0;
+						break;
 					}
+					ast_verb(3, "%s redirecting info has changed, passing it to %s\n",
+						ast_channel_name(c), ast_channel_name(in));
+					if (ast_channel_redirecting_sub(c, in, f, 1) &&
+						ast_channel_redirecting_macro(c, in, f, 1, 1)) {
+						ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
+					}
+					pa->sentringing = 0;
 					break;
 				case AST_CONTROL_PROCEEDING:
 					ast_verb(3, "%s is proceeding passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
@@ -1426,6 +1494,9 @@
 						ast_handle_cc_control_frame(in, c, f->data.ptr);
 						cc_frame_received = 1;
 					}
+					break;
+				case AST_CONTROL_PVT_CAUSE_CODE:
+					ast_indicate_data(in, AST_CONTROL_PVT_CAUSE_CODE, f->data.ptr, f->datalen);
 					break;
 				case -1:
 					if (single && !caller_entertained) {
@@ -2199,8 +2270,11 @@
 		outbound_group = ast_strdupa(outbound_group);
 	}
 	ast_channel_unlock(chan);
-	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE |
-			 OPT_CANCEL_TIMEOUT | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB | OPT_FORCECLID);
+
+	/* Set per dial instance flags.  These flags are also passed back to RetryDial. */
+	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID
+		| OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_CANCEL_TIMEOUT
+		| OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB | OPT_FORCECLID);
 
 	/* PREDIAL: Run gosub on the caller's channel */
 	if (ast_test_flag64(&opts, OPT_PREDIAL_CALLER)
@@ -2248,6 +2322,7 @@
 		tmp->number = cur;
 
 		if (opts.flags) {
+			/* Set per outgoing call leg options. */
 			ast_copy_flags64(tmp, &opts,
 				OPT_CANCEL_ELSEWHERE |
 				OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -2255,7 +2330,7 @@
 				OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
 				OPT_CALLEE_PARK | OPT_CALLER_PARK |
 				OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
-				OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
+				OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID | OPT_IGNORE_CONNECTEDLINE);
 			ast_set2_flag64(tmp, args.url, DIAL_NOFORWARDHTML);
 		}
 
@@ -2437,12 +2512,12 @@
 		if (outbound_group)
 			ast_app_group_set_channel(tc, outbound_group);

[... 18738 lines stripped ...]



More information about the asterisk-commits mailing list