[svn-commits] oej: branch group/bufo-manager-setvar-trunk r338041 - in /team/group/bufo-man...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Sep 27 07:10:21 CDT 2011


Author: oej
Date: Tue Sep 27 07:10:13 2011
New Revision: 338041

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338041
Log:
Reset, resolve 

Added:
    team/group/bufo-manager-setvar-trunk/channels/sip/include/security_events.h
      - copied unchanged from r337975, trunk/channels/sip/include/security_events.h
    team/group/bufo-manager-setvar-trunk/channels/sip/security_events.c
      - copied unchanged from r337975, trunk/channels/sip/security_events.c
Modified:
    team/group/bufo-manager-setvar-trunk/   (props changed)
    team/group/bufo-manager-setvar-trunk/CHANGES
    team/group/bufo-manager-setvar-trunk/Makefile
    team/group/bufo-manager-setvar-trunk/apps/app_confbridge.c
    team/group/bufo-manager-setvar-trunk/apps/app_dial.c
    team/group/bufo-manager-setvar-trunk/apps/app_echo.c
    team/group/bufo-manager-setvar-trunk/apps/app_followme.c
    team/group/bufo-manager-setvar-trunk/apps/app_meetme.c
    team/group/bufo-manager-setvar-trunk/apps/app_minivm.c
    team/group/bufo-manager-setvar-trunk/apps/app_mixmonitor.c
    team/group/bufo-manager-setvar-trunk/apps/app_morsecode.c
    team/group/bufo-manager-setvar-trunk/apps/app_mp3.c
    team/group/bufo-manager-setvar-trunk/apps/app_originate.c
    team/group/bufo-manager-setvar-trunk/apps/app_queue.c
    team/group/bufo-manager-setvar-trunk/apps/app_saycounted.c
    team/group/bufo-manager-setvar-trunk/apps/app_voicemail.c
    team/group/bufo-manager-setvar-trunk/cel/cel_custom.c
    team/group/bufo-manager-setvar-trunk/cel/cel_sqlite3_custom.c
    team/group/bufo-manager-setvar-trunk/channels/chan_h323.c
    team/group/bufo-manager-setvar-trunk/channels/chan_sip.c
    team/group/bufo-manager-setvar-trunk/channels/sig_pri.c
    team/group/bufo-manager-setvar-trunk/channels/sig_ss7.c
    team/group/bufo-manager-setvar-trunk/channels/sip/include/sdp_crypto.h
    team/group/bufo-manager-setvar-trunk/channels/sip/include/sip.h
    team/group/bufo-manager-setvar-trunk/channels/sip/include/srtp.h
    team/group/bufo-manager-setvar-trunk/channels/sip/sdp_crypto.c
    team/group/bufo-manager-setvar-trunk/codecs/gsm/Makefile
    team/group/bufo-manager-setvar-trunk/configs/extensions.conf.sample
    team/group/bufo-manager-setvar-trunk/configs/logger.conf.sample
    team/group/bufo-manager-setvar-trunk/configs/res_pktccops.conf.sample
    team/group/bufo-manager-setvar-trunk/configs/rtp.conf.sample
    team/group/bufo-manager-setvar-trunk/configs/sip.conf.sample
    team/group/bufo-manager-setvar-trunk/configure
    team/group/bufo-manager-setvar-trunk/configure.ac
    team/group/bufo-manager-setvar-trunk/funcs/func_curl.c
    team/group/bufo-manager-setvar-trunk/funcs/func_odbc.c
    team/group/bufo-manager-setvar-trunk/funcs/func_strings.c
    team/group/bufo-manager-setvar-trunk/include/asterisk/app.h
    team/group/bufo-manager-setvar-trunk/include/asterisk/autoconfig.h.in
    team/group/bufo-manager-setvar-trunk/include/asterisk/cel.h
    team/group/bufo-manager-setvar-trunk/include/asterisk/channel.h
    team/group/bufo-manager-setvar-trunk/include/asterisk/event_defs.h
    team/group/bufo-manager-setvar-trunk/include/asterisk/optional_api.h
    team/group/bufo-manager-setvar-trunk/include/asterisk/security_events_defs.h
    team/group/bufo-manager-setvar-trunk/main/Makefile
    team/group/bufo-manager-setvar-trunk/main/app.c
    team/group/bufo-manager-setvar-trunk/main/cel.c
    team/group/bufo-manager-setvar-trunk/main/channel.c
    team/group/bufo-manager-setvar-trunk/main/event.c
    team/group/bufo-manager-setvar-trunk/main/logger.c
    team/group/bufo-manager-setvar-trunk/main/manager.c
    team/group/bufo-manager-setvar-trunk/main/pbx.c
    team/group/bufo-manager-setvar-trunk/main/security_events.c
    team/group/bufo-manager-setvar-trunk/res/res_musiconhold.c
    team/group/bufo-manager-setvar-trunk/res/res_rtp_asterisk.c
    team/group/bufo-manager-setvar-trunk/res/res_srtp.c
    team/group/bufo-manager-setvar-trunk/tests/test_gosub.c
    team/group/bufo-manager-setvar-trunk/tests/test_pbx.c

Propchange: team/group/bufo-manager-setvar-trunk/
            ('svnmerge-integrated' removed)

Modified: team/group/bufo-manager-setvar-trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/CHANGES?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/CHANGES (original)
+++ team/group/bufo-manager-setvar-trunk/CHANGES Tue Sep 27 07:10:13 2011
@@ -217,6 +217,8 @@
 SIP Changes
 -----------
  * Add T38 support for REJECTED state where T.38 Negotiation is explicitly rejected.
+ * Add option encryption_taglen to set auth taglen only 32 and 80 are supported currently.
+ * SIP now generates security events using the Security Events Framework for REGISTER and INVITE.
 
 Queue changes
 -------------
@@ -236,6 +238,7 @@
    a MeetMe conference
  * Added 'k' option to MeetMe to automatically kill the conference when there's only
    one participant left (much like a normal call bridge)
+ * Added extra argument to Originate to set timeout.
 
 Asterisk Database
 -----------------
@@ -252,8 +255,28 @@
 
 IAX2 Changes
 ------------
-* authdebug is now disabled by default. To enable this functionaility again
+ * authdebug is now disabled by default. To enable this functionaility again
    set authdebug = yes in iax.conf.
+
+RTP Changes
+-----------
+ * The rtp.conf setting "strictrtp" is now enabled by default. In previous
+   releases it was disabled.
+
+PBX Core
+--------
+ * The PBX core previously made a call with a non-existing extension test for
+   extension s at default and jump there if the extension existed.
+   This was a bad default behaviour and violated the principle of least surprise.
+   It has therefore been changed in this release. It may affect some
+   applications and configurations that rely on this behaviour. Most channel
+   drivers have avoided this for many releases by testing whether the extension
+   called exists before starting the PBX and generating a local error.
+   This behaviour still exists and works as before.
+
+   Extension "s" is used when no extension is given in a channel driver,
+   like immediate answer in DAHDI or calling to a domain with no user part
+   in a SIP uri.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------

Modified: team/group/bufo-manager-setvar-trunk/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/Makefile?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/Makefile (original)
+++ team/group/bufo-manager-setvar-trunk/Makefile Tue Sep 27 07:10:13 2011
@@ -286,7 +286,7 @@
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
   SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
-  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.7)
+  ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
     SOLINK+=/usr/lib/bundle1.o
   endif
   _ASTLDFLAGS+=-L/usr/local/lib

Modified: team/group/bufo-manager-setvar-trunk/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_confbridge.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_confbridge.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_confbridge.c Tue Sep 27 07:10:13 2011
@@ -1283,6 +1283,7 @@
 		10,
 		"sln",
 		&duration,
+		NULL,
 		ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE),
 		0,
 		NULL);

Modified: team/group/bufo-manager-setvar-trunk/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_dial.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_dial.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_dial.c Tue Sep 27 07:10:13 2011
@@ -1772,7 +1772,7 @@
 			*/
 			silencethreshold = ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE);
 			ast_answer(chan);
-			res = ast_play_and_record(chan, "priv-recordintro", pa->privintro, 4, "sln", &duration, silencethreshold, 2000, 0);  /* NOTE: I've reduced the total time to 4 sec */
+			res = ast_play_and_record(chan, "priv-recordintro", pa->privintro, 4, "sln", &duration, NULL, silencethreshold, 2000, 0);  /* NOTE: I've reduced the total time to 4 sec */
 									/* don't think we'll need a lock removed, we took care of
 									   conflicts by naming the pa.privintro file */
 			if (res == -1) {
@@ -2325,7 +2325,9 @@
 			ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
 
 		ast_channel_unlock(tc);
+		ast_channel_unlock(chan);
 		res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */
+		ast_channel_lock(chan);
 
 		/* Save the info in cdr's that we called them */
 		if (chan->cdr)

Modified: team/group/bufo-manager-setvar-trunk/apps/app_echo.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_echo.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_echo.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_echo.c Tue Sep 27 07:10:13 2011
@@ -46,6 +46,8 @@
 		<description>
 			<para>Echos back any audio, video or DTMF frames read from the calling 
 			channel back to itself. Note: If '#' detected application exits</para>
+			<para>This application does not automatically answer and should be
+			preceeded by an application such as Answer() or Progress().</para>
 		</description>
 	</application>
  ***/

Modified: team/group/bufo-manager-setvar-trunk/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_followme.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_followme.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_followme.c Tue Sep 27 07:10:13 2011
@@ -1123,7 +1123,7 @@
 			ast_stream_and_wait(chan, targs.statusprompt, "");
 
 		if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_RECORDNAME)) 
-			if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL) < 0)
+			if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, NULL, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL) < 0)
 				goto outrun;
 
 		if (!ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_DISABLEHOLDPROMPT)) {

Modified: team/group/bufo-manager-setvar-trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_meetme.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_meetme.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_meetme.c Tue Sep 27 07:10:13 2011
@@ -2548,7 +2548,7 @@
 
 		res = 0;
 		if (ast_test_flag64(confflags, CONFFLAG_INTROUSERNOREVIEW) && !ast_fileexists(user->namerecloc, NULL, NULL))
-			res = ast_play_and_record(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL);
+			res = ast_play_and_record(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE), 0, NULL);
 		else if (ast_test_flag64(confflags, CONFFLAG_INTROUSER) && !ast_fileexists(user->namerecloc, NULL, NULL))
 			res = ast_record_review(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, NULL);
 		if (res == -1)

Modified: team/group/bufo-manager-setvar-trunk/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_minivm.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_minivm.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_minivm.c Tue Sep 27 07:10:13 2011
@@ -1313,6 +1313,9 @@
 	}
 	/* Allocate channel used for chanvar substitution */
 	ast = ast_dummy_channel_alloc();
+	if (!ast) {
+		return -1;
+	}
 
 	snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
 
@@ -1473,8 +1476,7 @@
 	ast_safe_system(tmp2);
 	ast_debug(1, "Sent message to %s with command '%s' - %s\n", vmu->email, global_mailcmd, template->attachment ? "(media attachment)" : "");
 	ast_debug(3, "Actual command used: %s\n", tmp2);
-	if (ast)
-		ast = ast_channel_release(ast);
+	ast = ast_channel_unref(ast);
 	ast_free(str1);
 	ast_free(str2);
 	return 0;
@@ -1603,7 +1605,7 @@
 /*!\internal
  * \brief Record voicemail message & let caller review or re-record it, or set options if applicable */
 static int play_record_review(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt,
-			      int outsidecaller, struct minivm_account *vmu, int *duration, const char *unlockdir,
+			      int outsidecaller, struct minivm_account *vmu, int *duration, int *sound_duration, const char *unlockdir,
 			      signed char record_gain)
 {
 	int cmd = 0;
@@ -1653,7 +1655,7 @@
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 			if (ast_test_flag(vmu, MVM_OPERATOR))
 				canceldtmf = "0";
-			cmd = ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, global_silencethreshold, global_maxsilence, unlockdir, acceptdtmf, canceldtmf);
+			cmd = ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, sound_duration, global_silencethreshold, global_maxsilence, unlockdir, acceptdtmf, canceldtmf);
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &zero_gain, sizeof(zero_gain), 0);
 			if (cmd == -1) /* User has hung up, no options to give */
@@ -1842,6 +1844,7 @@
 	FILE *txt;
 	int res = 0, txtdes;
 	int duration = 0;
+	int sound_duration = 0;
 	char date[256];
 	char tmpdir[PATH_MAX];
 	char ext_context[256] = "";
@@ -1917,7 +1920,7 @@
 	/* Store information */
 	ast_debug(2, "Open file for metadata: %s\n", tmptxtfile);
 
-	res = play_record_review(chan, NULL, tmptxtfile, global_vmmaxmessage, fmt, 1, vmu, &duration, NULL, options->record_gain);
+	res = play_record_review(chan, NULL, tmptxtfile, global_vmmaxmessage, fmt, 1, vmu, &duration, &sound_duration, NULL, options->record_gain);
 
 	txt = fdopen(txtdes, "w+");
 	if (!txt) {
@@ -1958,8 +1961,8 @@
 			ast_mutex_unlock(&minivmloglock);
 		}
 
-		if (duration < global_vmminmessage) {
-			ast_verb(3, "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, global_vmminmessage);
+		if (sound_duration < global_vmminmessage) {
+			ast_verb(3, "Recording was %d seconds long but needs to be at least %d - abandoning\n", sound_duration, global_vmminmessage);
 			fclose(txt);
 			ast_filedelete(tmptxtfile, NULL);
 			unlink(tmptxtfile);
@@ -2536,7 +2539,7 @@
 	}
 	snprintf(filename,sizeof(filename), "%s%s/%s/%s", MVM_SPOOL_DIR, vmu->domain, vmu->username, message);
 	/* Maybe we should check the result of play_record_review ? */
-	play_record_review(chan, prompt, filename, global_maxgreet, default_vmformat, 0, vmu, &duration, NULL, FALSE);
+	play_record_review(chan, prompt, filename, global_maxgreet, default_vmformat, 0, vmu, &duration, NULL, NULL, FALSE);
 
 	ast_debug(1, "Recorded new %s message in %s (duration %d)\n", message, filename, duration);
 

Modified: team/group/bufo-manager-setvar-trunk/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_mixmonitor.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_mixmonitor.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_mixmonitor.c Tue Sep 27 07:10:13 2011
@@ -117,6 +117,8 @@
 		</syntax>
 		<description>
 			<para>Records the audio on the current channel to the specified file.</para>
+			<para>This application does not automatically answer and should be preceeded by
+			an application such as Answer or Progress().</para>
 			<variablelist>
 				<variable name="MIXMONITOR_FILENAME">
 					<para>Will contain the filename used to record.</para>

Modified: team/group/bufo-manager-setvar-trunk/apps/app_morsecode.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_morsecode.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_morsecode.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_morsecode.c Tue Sep 27 07:10:13 2011
@@ -50,7 +50,8 @@
 		</syntax>
 		<description>
 			<para>Plays the Morse code equivalent of the passed string.</para>
-
+			<para>This application does not automatically answer and should be preceeded by
+			an application such as Answer() or Progress().</para>
 			<para>This application uses the following variables:</para>
 			<variablelist>
 				<variable name="MORSEDITLEN">

Modified: team/group/bufo-manager-setvar-trunk/apps/app_mp3.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_mp3.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_mp3.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_mp3.c Tue Sep 27 07:10:13 2011
@@ -65,9 +65,11 @@
 		<description>
 			<para>Executes mpg123 to play the given location, which typically would be a mp3 filename
 			or m3u playlist filename or a URL. Please read http://en.wikipedia.org/wiki/M3U
-			to see how M3U playlist file format is like, Example usage would be 
+			to see how M3U playlist file format is like, Example usage would be
 			exten => 1234,1,MP3Player(/var/lib/asterisk/playlist.m3u)
 			User can exit by pressing any key on the dialpad, or by hanging up.</para>
+			<para>This application does not automatically answer and should be preceeded by an
+			application such as Answer() or Progress().</para>
 		</description>
 	</application>
 

Modified: team/group/bufo-manager-setvar-trunk/apps/app_originate.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_originate.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_originate.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_originate.c Tue Sep 27 07:10:13 2011
@@ -69,6 +69,9 @@
 			</parameter>
 			<parameter name="arg3" required="false">
 				<para>If the type is <literal>exten</literal>, then this is the priority that the channel is sent to.  If the type is <literal>app</literal>, then this parameter is ignored.</para>
+			</parameter>
+			<parameter name="timeout" required="false">
+				<para>Timeout in seconds. Default is 30 seconds.</para>
 			</parameter>
 		</syntax>
 		<description>
@@ -101,12 +104,13 @@
 		AST_APP_ARG(arg1);
 		AST_APP_ARG(arg2);
 		AST_APP_ARG(arg3);
+		AST_APP_ARG(timeout);
 	);
 	char *parse;
 	char *chantech, *chandata;
 	int res = -1;
 	int outgoing_status = 0;
-	static const unsigned int timeout = 30;
+	unsigned int timeout = 30;
 	static const char default_exten[] = "s";
 	struct ast_format tmpfmt;
 	struct ast_format_cap *cap_slin = ast_format_cap_alloc_nolock();
@@ -129,6 +133,13 @@
 	if (args.argc < 3) {
 		ast_log(LOG_ERROR, "Incorrect number of arguments\n");
 		goto return_cleanup;
+	}
+
+	if (!ast_strlen_zero(args.timeout)) {
+		if(sscanf(args.timeout, "%u", &timeout) != 1) {
+			ast_log(LOG_NOTICE, "Invalid timeout: '%s'. Setting timeout to 30 seconds\n", args.timeout);
+			timeout = 30;
+		}
 	}
 
 	chandata = ast_strdupa(args.tech_data);

Modified: team/group/bufo-manager-setvar-trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_queue.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_queue.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_queue.c Tue Sep 27 07:10:13 2011
@@ -224,6 +224,8 @@
 			up by another user.</para>
 			<para>This application will return to the dialplan if the queue does not exist, or
 			any of the join options cause the caller to not enter the queue.</para>
+			<para>This application does not automatically answer and should be preceeded
+			by an application such as Answer(), Progress(), or Ringing().</para>
 			<para>This application sets the following channel variable upon completion:</para>
 			<variablelist>
 				<variable name="QUEUESTATUS">
@@ -5075,8 +5077,34 @@
 		qe->handled++;
 		ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
 													(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
-		if (update_cdr && qe->chan->cdr) 
-			ast_copy_string(qe->chan->cdr->dstchannel, member->membername, sizeof(qe->chan->cdr->dstchannel));
+
+		if (qe->chan->cdr) {
+			struct ast_cdr *cdr;
+			struct ast_cdr *newcdr;
+
+			/* Only work with the last CDR in the stack*/
+			cdr = qe->chan->cdr;
+			while (cdr->next) {
+				cdr = cdr->next;
+			}
+
+			/* If this CDR is not related to us add new one*/
+			if ((strcasecmp(cdr->uniqueid, qe->chan->uniqueid)) &&
+			    (strcasecmp(cdr->linkedid, qe->chan->uniqueid)) &&
+			    (newcdr = ast_cdr_dup(cdr))) {
+				ast_cdr_init(newcdr, qe->chan);
+				ast_cdr_reset(newcdr, 0);
+				ast_channel_lock(qe->chan);
+				cdr = ast_cdr_append(cdr, newcdr);
+				cdr = cdr->next;
+				ast_channel_unlock(qe->chan);
+			}
+
+			if (update_cdr) {
+				ast_copy_string(cdr->dstchannel, member->membername, sizeof(cdr->dstchannel));
+			}
+		}
+
 		if (qe->parent->eventwhencalled)
 			manager_event(EVENT_FLAG_AGENT, "AgentConnect",
 					"Queue: %s\r\n"

Modified: team/group/bufo-manager-setvar-trunk/apps/app_saycounted.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_saycounted.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_saycounted.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_saycounted.c Tue Sep 27 07:10:13 2011
@@ -62,6 +62,8 @@
 			file name is never seen by the end user, there is no need to
 			implement complicated spelling rules.  We simply record the word
 			"men" in the sound file named "mans".</para>
+			<para>This application does not automatically answer and should be
+			preceeded by an application such as Answer() or Progress.</para>
 		</description>
 		<see-also>
 			<ref type="application">SayCountedAdj</ref>
@@ -99,6 +101,9 @@
 			will play sound file "newa" (containing the word "novaya"), but
 			SayCountedAdj(5,new,f) will play sound file "newx" (containing the
 			word "novikh").</para>
+			<para>This application does not automatically answer and should be
+			preceeded by an application such as Answer(), Progress(), or
+			Proceeding().</para>
 		</description>
 		<see-also>
 			<ref type="application">SayCountedNoun</ref>

Modified: team/group/bufo-manager-setvar-trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/apps/app_voicemail.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/apps/app_voicemail.c (original)
+++ team/group/bufo-manager-setvar-trunk/apps/app_voicemail.c Tue Sep 27 07:10:13 2011
@@ -435,8 +435,8 @@
 #define ASTERISK_USERNAME "asterisk"
 
 /* Define fast-forward, pause, restart, and reverse keys
-   while listening to a voicemail message - these are
-   strings, not characters */
+ * while listening to a voicemail message - these are
+ * strings, not characters */
 #define DEFAULT_LISTEN_CONTROL_FORWARD_KEY "#"
 #define DEFAULT_LISTEN_CONTROL_REVERSE_KEY "*"
 #define DEFAULT_LISTEN_CONTROL_PAUSE_KEY "0"
@@ -445,7 +445,7 @@
 #define VALID_DTMF "1234567890*#" /* Yes ABCD are valid dtmf but what phones have those? */
 
 /* Default mail command to mail voicemail. Change it with the
-    mailcmd= command in voicemail.conf */
+ * mailcmd= command in voicemail.conf */
 #define SENDMAIL "/usr/sbin/sendmail -t"
 
 #define INTRO "vm-intro"
@@ -905,7 +905,7 @@
 static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msg, int option, signed char record_gain);
 static int dialout(struct ast_channel *chan, struct ast_vm_user *vmu, char *num, char *outgoing_context);
 static int play_record_review(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime,
-			char *fmt, int outsidecaller, struct ast_vm_user *vmu, int *duration, const char *unlockdir,
+			char *fmt, int outsidecaller, struct ast_vm_user *vmu, int *duration, int *sound_duration, const char *unlockdir,
 			signed char record_gain, struct vm_state *vms, char *flag);
 static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain);
 static int vm_play_folder_name(struct ast_channel *chan, char *mbox);
@@ -3245,9 +3245,9 @@
 #endif /* IMAP_STORAGE */
 
 /*! \brief Lock file path
-    only return failure if ast_lock_path returns 'timeout',
-   not if the path does not exist or any other reason
-*/
+ * only return failure if ast_lock_path returns 'timeout',
+ * not if the path does not exist or any other reason
+ */
 static int vm_lock_path(const char *path)
 {
 	switch (ast_lock_path(path)) {
@@ -4573,7 +4573,7 @@
 			} else {
 				fprintf(p, "From: %s <%s>" ENDL, ast_str_quote(&str2, 0, ast_str_buffer(str1)), who);
 			}
-			ast = ast_channel_release(ast);
+			ast = ast_channel_unref(ast);
 		} else {
 			ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
 		}
@@ -4618,7 +4618,7 @@
 			} else {
 				fprintf(p, "Subject: %s" ENDL, ast_str_buffer(str1));
 			}
-			ast = ast_channel_release(ast);
+			ast = ast_channel_unref(ast);
 		} else {
 			ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
 		}
@@ -4704,7 +4704,7 @@
 #else
 			fprintf(p, "%s" ENDL, ast_str_buffer(str1));
 #endif
-			ast = ast_channel_release(ast);
+			ast = ast_channel_unref(ast);
 		} else {
 			ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
 		}
@@ -4931,7 +4931,7 @@
 			} else {
 				fprintf(p, "From: %s <%s>" ENDL, ast_str_quote(&str2, 0, ast_str_buffer(str1)), who);
 			}
-			ast = ast_channel_release(ast);
+			ast = ast_channel_unref(ast);
 		} else {
 			ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
 		}
@@ -4975,7 +4975,7 @@
 			} else {
 				fprintf(p, "Subject: %s" ENDL, ast_str_buffer(str1));
 			}
-			ast = ast_channel_release(ast);
+			ast = ast_channel_unref(ast);
 		} else {
 			ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
 		}
@@ -4993,7 +4993,7 @@
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, pagerbody);
 			fprintf(p, "%s" ENDL, ast_str_buffer(str1));
-			ast = ast_channel_release(ast);
+			ast = ast_channel_unref(ast);
 		} else {
 			ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
 		}
@@ -5577,6 +5577,7 @@
 	int res = 0;
 	int msgnum;
 	int duration = 0;
+	int sound_duration = 0;
 	int ausemacro = 0;
 	int ousemacro = 0;
 	int ouseexten = 0;
@@ -5964,13 +5965,13 @@
 			res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
 			goto leave_vm_out;
 		}
-		res = play_record_review(chan, NULL, tmptxtfile, vmu->maxsecs, fmt, 1, vmu, &duration, NULL, options->record_gain, vms, flag);
+		res = play_record_review(chan, NULL, tmptxtfile, vmu->maxsecs, fmt, 1, vmu, &duration, &sound_duration, NULL, options->record_gain, vms, flag);
 
 		if (txt) {
 			fprintf(txt, "flag=%s\n", flag);
-			if (duration < vmu->minsecs) {
+			if (sound_duration < vmu->minsecs) {
 				fclose(txt);
-				ast_verb(3, "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmu->minsecs);
+				ast_verb(3, "Recording was %d seconds long but needs to be at least %d - abandoning\n", sound_duration, vmu->minsecs);
 				ast_filedelete(tmptxtfile, NULL);
 				unlink(tmptxtfile);
 				if (ast_check_realtime("voicemail_data")) {
@@ -6092,7 +6093,7 @@
 		} else if (res > 0 && res != 't')
 			res = 0;
 
-		if (duration < vmu->minsecs)
+		if (sound_duration < vmu->minsecs)
 			/* XXX We should really give a prompt too short/option start again, with leave_vm_out called only after a timeout XXX */
 			pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
 		else
@@ -6124,30 +6125,31 @@
 #if !defined(IMAP_STORAGE)
 static int resequence_mailbox(struct ast_vm_user *vmu, char *dir, int stopcount)
 {
-    /* we know the actual number of messages, so stop process when number is hit */
-
-    int x, dest;
-    char sfn[PATH_MAX];
-    char dfn[PATH_MAX];
-
-    if (vm_lock_path(dir))
-        return ERROR_LOCK_PATH;
-
-    for (x = 0, dest = 0; dest != stopcount && x < vmu->maxmsg + 10; x++) {
-        make_file(sfn, sizeof(sfn), dir, x);
-        if (EXISTS(dir, x, sfn, NULL)) {
-
-            if (x != dest) {
-                make_file(dfn, sizeof(dfn), dir, dest);
-                RENAME(dir, x, vmu->mailbox, vmu->context, dir, dest, sfn, dfn);
-            }
-
-            dest++;
-        }
-    }
-    ast_unlock_path(dir);
-
-    return dest;
+	/* we know the actual number of messages, so stop process when number is hit */
+
+	int x, dest;
+	char sfn[PATH_MAX];
+	char dfn[PATH_MAX];
+
+	if (vm_lock_path(dir)) {
+		return ERROR_LOCK_PATH;
+	}
+
+	for (x = 0, dest = 0; dest != stopcount && x < vmu->maxmsg + 10; x++) {
+		make_file(sfn, sizeof(sfn), dir, x);
+		if (EXISTS(dir, x, sfn, NULL)) {
+
+			if (x != dest) {
+				make_file(dfn, sizeof(dfn), dir, dest);
+				RENAME(dir, x, vmu->mailbox, vmu->context, dir, dest, sfn, dfn);
+			}
+
+			dest++;
+		}
+	}
+	ast_unlock_path(dir);
+
+	return dest;
 }
 #endif
 
@@ -6870,7 +6872,7 @@
 			strncat(vms->introfn, "intro", sizeof(vms->introfn));
 			res = ast_play_and_wait(chan, INTRO);
 			res = ast_play_and_wait(chan, "beep");
-			res = play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, record_gain, vms, flag);
+			res = play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vm_fmts, 1, vmu, (int *) duration, NULL, NULL, record_gain, vms, flag);
 			cmd = 't';
 #else
 
@@ -6903,7 +6905,7 @@
 			if (record_gain)
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 
-			cmd = ast_play_and_prepend(chan, NULL, msgfile, 0, vm_fmts, &prepend_duration, 1, silencethreshold, maxsilence);
+			cmd = ast_play_and_prepend(chan, NULL, msgfile, 0, vm_fmts, &prepend_duration, NULL, 1, silencethreshold, maxsilence);
 
 			if (cmd == 'S') { /* If we timed out, tell the user it didn't work properly and clean up the files */
 				ast_stream_and_wait(chan, vm_pls_try_again, ""); /* this might be removed if a proper vm_prepend_timeout is ever recorded */
@@ -9237,7 +9239,7 @@
 	if (ast_test_flag(vmu, VM_FORCENAME)) {
 		snprintf(prefile, sizeof(prefile), "%s%s/%s/greet", VM_SPOOL_DIR, vmu->context, vms->username);
 		if (ast_fileexists(prefile, NULL, NULL) < 1) {
-			cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			if (cmd < 0 || cmd == 't' || cmd == '#')
 				return cmd;
 		}
@@ -9247,14 +9249,14 @@
 	if (ast_test_flag(vmu, VM_FORCEGREET)) {
 		snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, vms->username);
 		if (ast_fileexists(prefile, NULL, NULL) < 1) {
-			cmd = play_record_review(chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			cmd = play_record_review(chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			if (cmd < 0 || cmd == 't' || cmd == '#')
 				return cmd;
 		}
 
 		snprintf(prefile, sizeof(prefile), "%s%s/%s/busy", VM_SPOOL_DIR, vmu->context, vms->username);
 		if (ast_fileexists(prefile, NULL, NULL) < 1) {
-			cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			if (cmd < 0 || cmd == 't' || cmd == '#')
 				return cmd;
 		}
@@ -9289,15 +9291,15 @@
 		switch (cmd) {
 		case '1': /* Record your unavailable message */
 			snprintf(prefile, sizeof(prefile), "%s%s/%s/unavail", VM_SPOOL_DIR, vmu->context, vms->username);
-			cmd = play_record_review(chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			cmd = play_record_review(chan, "vm-rec-unv", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			break;
 		case '2':  /* Record your busy message */
 			snprintf(prefile, sizeof(prefile), "%s%s/%s/busy", VM_SPOOL_DIR, vmu->context, vms->username);
-			cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			cmd = play_record_review(chan, "vm-rec-busy", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			break;
 		case '3': /* Record greeting */
 			snprintf(prefile, sizeof(prefile), "%s%s/%s/greet", VM_SPOOL_DIR, vmu->context, vms->username);
-			cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			cmd = play_record_review(chan, "vm-rec-name", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			break;
 		case '4':  /* manage the temporary greeting */
 			cmd = vm_tempgreeting(chan, vmu, vms, fmtc, record_gain);
@@ -9431,12 +9433,12 @@
 			retries = 0;
 		RETRIEVE(prefile, -1, vmu->mailbox, vmu->context);
 		if (ast_fileexists(prefile, NULL, NULL) <= 0) {
-			play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+			play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 			cmd = 't';	
 		} else {
 			switch (cmd) {
 			case '1':
-				cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, record_gain, vms, NULL);
+				cmd = play_record_review(chan, "vm-rec-temp", prefile, maxgreet, fmtc, 0, vmu, &duration, NULL, NULL, record_gain, vms, NULL);
 				break;
 			case '2':
 				DELETE(prefile, -1, prefile, vmu);
@@ -12687,6 +12689,9 @@
 		!(vmu = find_or_create(testcontext, testmailbox))) {
 		ast_test_status_update(test, "Cannot create vmu structure\n");
 		ast_unreplace_sigchld();
+#ifdef IMAP_STORAGE
+		chan = ast_channel_unref(chan);
+#endif
 		return AST_TEST_FAIL;
 	}
 
@@ -12706,6 +12711,9 @@
 				ast_test_status_update(test, "Unable to create test voicemail: %s\n",
 					syserr > 0 ? strerror(syserr) : "unable to fork()");
 				ast_unreplace_sigchld();
+#ifdef IMAP_STORAGE
+				chan = ast_channel_unref(chan);
+#endif
 				return AST_TEST_FAIL;
 			}
 		}
@@ -12779,7 +12787,7 @@
 	}
 
 #ifdef IMAP_STORAGE
-	chan = ast_channel_release(chan);
+	chan = ast_channel_unref(chan);
 #endif
 
 	/* And remove test directory */
@@ -13252,7 +13260,7 @@
 }
 
 static int play_record_review(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt,
-			int outsidecaller, struct ast_vm_user *vmu, int *duration, const char *unlockdir,
+			int outsidecaller, struct ast_vm_user *vmu, int *duration, int *sound_duration, const char *unlockdir,
 			signed char record_gain, struct vm_state *vms, char *flag)
 {
 	/* Record message & let caller review or re-record it, or set options if applicable */
@@ -13327,7 +13335,7 @@
 				ast_channel_setoption(chan, AST_OPTION_RXGAIN, &record_gain, sizeof(record_gain), 0);
 			if (ast_test_flag(vmu, VM_OPERATOR))
 				canceldtmf = "0";
-			cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf);
+			cmd = ast_play_and_record_full(chan, playfile, tempfile, maxtime, fmt, duration, sound_duration, silencethreshold, maxsilence, unlockdir, acceptdtmf, canceldtmf);
 			if (strchr(canceldtmf, cmd)) {
 			/* need this flag here to distinguish between pressing '0' during message recording or after */
 				canceleddtmf = 1;
@@ -13347,13 +13355,13 @@
 			} else if (cmd == '*') {
 				break;
 #if 0
-			} else if (vmu->review && (*duration < 5)) {
+			} else if (vmu->review && sound_duration && (*sound_duration < 5)) {
 				/* Message is too short */
 				ast_verb(3, "Message too short\n");
 				cmd = ast_play_and_wait(chan, "vm-tooshort");
 				cmd = ast_filedelete(tempfile, NULL);
 				break;
-			} else if (vmu->review && (cmd == 2 && *duration < (maxsilence + 3))) {
+			} else if (vmu->review && (cmd == 2 && sound_duration && *sound_duration < (maxsilence + 3))) {
 				/* Message is all silence */
 				ast_verb(3, "Nothing recorded\n");
 				cmd = ast_filedelete(tempfile, NULL);

Modified: team/group/bufo-manager-setvar-trunk/cel/cel_custom.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/cel/cel_custom.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/cel/cel_custom.c (original)
+++ team/group/bufo-manager-setvar-trunk/cel/cel_custom.c Tue Sep 27 07:10:13 2011
@@ -128,7 +128,6 @@
 	}
 
 	dummy = ast_cel_fabricate_channel_from_event(event);
-
 	if (!dummy) {
 		ast_log(LOG_ERROR, "Unable to fabricate channel from CEL event.\n");
 		return;
@@ -163,7 +162,7 @@
 
 	AST_RWLIST_UNLOCK(&sinks);
 
-	ast_channel_release(dummy);
+	ast_channel_unref(dummy);
 }
 
 static int unload_module(void)

Modified: team/group/bufo-manager-setvar-trunk/cel/cel_sqlite3_custom.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bufo-manager-setvar-trunk/cel/cel_sqlite3_custom.c?view=diff&rev=338041&r1=338040&r2=338041
==============================================================================
--- team/group/bufo-manager-setvar-trunk/cel/cel_sqlite3_custom.c (original)
+++ team/group/bufo-manager-setvar-trunk/cel/cel_sqlite3_custom.c Tue Sep 27 07:10:13 2011
@@ -262,7 +262,7 @@
 		}
 		sql = sqlite3_mprintf("INSERT INTO %q (%s) VALUES (%s)", table, columns, ast_str_buffer(value_string));
 		ast_debug(1, "About to log: %s\n", sql);
-		dummy = ast_channel_release(dummy);

[... 4771 lines stripped ...]



More information about the svn-commits mailing list