[asterisk-commits] branch oej/test-this-branch r12987 - in /team/oej/test-this-branch: ./ apps/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 14 13:20:54 MST 2006


Author: oej
Date: Tue Mar 14 14:20:42 2006
New Revision: 12987

URL: http://svn.digium.com/view/asterisk?rev=12987&view=rev
Log:
- Resolve conflict, reset automerge
- Note that teh CDR/H extension patch is now merged

Added:
    team/oej/test-this-branch/res/res_convert.c
      - copied unchanged from r12962, trunk/res/res_convert.c
Modified:
    team/oej/test-this-branch/   (props changed)
    team/oej/test-this-branch/README.test-this-branch
    team/oej/test-this-branch/UPGRADE.txt
    team/oej/test-this-branch/apps/app_dial.c
    team/oej/test-this-branch/apps/app_queue.c
    team/oej/test-this-branch/apps/app_rpt.c
    team/oej/test-this-branch/apps/app_voicemail.c
    team/oej/test-this-branch/asterisk.c
    team/oej/test-this-branch/cdr.c
    team/oej/test-this-branch/cdr/cdr_sqlite.c
    team/oej/test-this-branch/channels/chan_iax2.c
    team/oej/test-this-branch/channels/chan_sip.c
    team/oej/test-this-branch/configs/cdr.conf.sample
    team/oej/test-this-branch/configs/iax.conf.sample
    team/oej/test-this-branch/contrib/utils/rawplayer.c
    team/oej/test-this-branch/include/asterisk/options.h
    team/oej/test-this-branch/pbx.c

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 14 14:20:42 2006
@@ -1,1 +1,1 @@
-/trunk:1-12887
+/trunk:1-12962

Modified: team/oej/test-this-branch/README.test-this-branch
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/README.test-this-branch?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/README.test-this-branch (original)
+++ team/oej/test-this-branch/README.test-this-branch Tue Mar 14 14:20:42 2006
@@ -44,7 +44,6 @@
 - Support SIP_CODEC for early media (oej, #6576)
 - Show threads CLI command (rizzo, #6053)
 - IFMODULE dialplan function (oej, #6671)
-- End CDR before 'h' extension (russellb, #6193)
 - LDAP realtime driver (mguesdon, #5768)
   See doc/rt_ldap.txt!
 - PostgreSQL realtime driver (mguesdoon, #5637)
@@ -52,6 +51,7 @@
 
 Things that has been commited to svn trunk:
 - Abandon Queue manager event (tim_ringenbach, #6459)
+- End CDR before 'h' extension (russellb, #6193)
 
 
 Coming here soon:

Modified: team/oej/test-this-branch/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/UPGRADE.txt?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/UPGRADE.txt (original)
+++ team/oej/test-this-branch/UPGRADE.txt Tue Mar 14 14:20:42 2006
@@ -53,6 +53,15 @@
 * The ENUMLOOKUP() function with the 'c' option (for counting the number of records),
   but the lookup fails to match any records, the returned value will now be "0" instead of blank.
 
+The IAX2 channel:
+
+* The "mailboxdetail" option has been deprecated.  Previously, if this option
+  was not enabled, the 2 byte MSGCOUNT information element would be set to all
+  1's to indicate there there is some number of messages waiting.  With this
+  option enabled, the number of new messages were placed in one byte and the
+  number of old messages are placed in the other.  This is now the default
+  (and the only) behavior.
+
 The SIP channel:
 
 * The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.
@@ -68,3 +77,4 @@
 	ASTETCDIR	/usr/local/etc/asterisk
 	ASTBINDIR	/usr/local/bin/asterisk
 	ASTSBINDIR	/usr/local/sbin/asterisk
+

Modified: team/oej/test-this-branch/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_dial.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_dial.c (original)
+++ team/oej/test-this-branch/apps/app_dial.c Tue Mar 14 14:20:42 2006
@@ -1425,7 +1425,6 @@
 			}
 			ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
 			ast_parseable_goto(peer, opt_args[OPT_ARG_GOTO]);
-			peer->priority++;
 			ast_pbx_start(peer);
 			hanguptree(outgoing, NULL);
 			LOCAL_USER_REMOVE(u);

Modified: team/oej/test-this-branch/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_queue.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_queue.c (original)
+++ team/oej/test-this-branch/apps/app_queue.c Tue Mar 14 14:20:42 2006
@@ -952,7 +952,7 @@
 	}
 	AST_LIST_UNLOCK(&queues);
 
-	if (!q) {
+	if (!q || q->realtime) {
 		/*! \note Load from realtime before taking the global qlock, to avoid blocking all
 		   queue operations while waiting for the DB.
 

Modified: team/oej/test-this-branch/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_rpt.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_rpt.c (original)
+++ team/oej/test-this-branch/apps/app_rpt.c Tue Mar 14 14:20:42 2006
@@ -2010,7 +2010,7 @@
 	strncpy(mychannel->exten, myrpt->exten, sizeof(mychannel->exten) - 1);
 	strncpy(mychannel->context, myrpt->ourcontext, sizeof(mychannel->context) - 1);
 	if (myrpt->acctcode)
-		strncpy(mychannel->accountcode, myrpt->acctcode, sizeof(mychannel->accountcode) - 1);
+		ast_string_field_set(mychannel, accountcode, myrpt->acctcode);
 	mychannel->priority = 1;
 	ast_channel_undefer_dtmf(mychannel);
 	if (ast_pbx_start(mychannel) < 0)

Modified: team/oej/test-this-branch/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/apps/app_voicemail.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/apps/app_voicemail.c (original)
+++ team/oej/test-this-branch/apps/app_voicemail.c Tue Mar 14 14:20:42 2006
@@ -5978,6 +5978,8 @@
 	char *fmt;
 	char *astemail;
  	char *astmailcmd = SENDMAIL;
+	char *astforcename;
+	char *astforcegreet;
 	char *s,*q,*stringp;
 	char *dialoutcxt = NULL;
 	char *callbackcxt = NULL;	
@@ -6150,14 +6152,14 @@
 		}
 
 		/* Force new user to record name ? */
-		if (!(astattach = ast_variable_retrieve(cfg, "general", "forcename"))) 
-			astattach = "no";
-		ast_set2_flag((&globalflags), ast_true(astattach), VM_FORCENAME);
+		if (!(astforcename = ast_variable_retrieve(cfg, "general", "forcename"))) 
+			astforcename = "no";
+		ast_set2_flag((&globalflags), ast_true(astforcename), VM_FORCENAME);
 
 		/* Force new user to record greetings ? */
-		if (!(astattach = ast_variable_retrieve(cfg, "general", "forcegreetings"))) 
-			astattach = "no";
-		ast_set2_flag((&globalflags), ast_true(astattach), VM_FORCEGREET);
+		if (!(astforcegreet = ast_variable_retrieve(cfg, "general", "forcegreetings"))) 
+			astforcegreet = "no";
+		ast_set2_flag((&globalflags), ast_true(astforcegreet), VM_FORCEGREET);
 
 		if ((s = ast_variable_retrieve(cfg, "general", "cidinternalcontexts"))){
 			if (option_debug > 1)

Modified: team/oej/test-this-branch/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/asterisk.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/asterisk.c (original)
+++ team/oej/test-this-branch/asterisk.c Tue Mar 14 14:20:42 2006
@@ -152,7 +152,7 @@
  */
 /*! @{ */
 
-struct ast_flags ast_options = { AST_OPT_FLAG_TRANSCODE_VIA_SLIN };
+struct ast_flags ast_options = { AST_DEFAULT_OPTIONS };
 
 int option_verbose = 0;				/*!< Verbosity level */
 int option_debug = 0;				/*!< Debug level */

Modified: team/oej/test-this-branch/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/cdr.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/cdr.c (original)
+++ team/oej/test-this-branch/cdr.c Tue Mar 14 14:20:42 2006
@@ -1121,6 +1121,7 @@
 	const char *batchsafeshutdown_value;
 	const char *size_value;
 	const char *time_value;
+	const char *end_before_h_value;
 	int cfg_size;
 	int cfg_time;
 	int was_enabled;
@@ -1171,6 +1172,8 @@
 			else
 				batchtime = cfg_time;
 		}
+		if ((end_before_h_value = ast_variable_retrieve(config, "general", "endbeforehexten")))
+			ast_set2_flag(&ast_options, ast_true(end_before_h_value), AST_OPT_END_CDR_BEFORE_H_EXTEN);
 	}
 
 	if (enabled && !batchmode) {

Modified: team/oej/test-this-branch/cdr/cdr_sqlite.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/cdr/cdr_sqlite.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/cdr/cdr_sqlite.c (original)
+++ team/oej/test-this-branch/cdr/cdr_sqlite.c Tue Mar 14 14:20:42 2006
@@ -36,6 +36,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <sqlite.h>
 
 #include "asterisk.h"

Modified: team/oej/test-this-branch/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_iax2.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_iax2.c (original)
+++ team/oej/test-this-branch/channels/chan_iax2.c Tue Mar 14 14:20:42 2006
@@ -265,7 +265,7 @@
 	IAX_USEJITTERBUF =	(1 << 5),	/*!< Use jitter buffer */
 	IAX_DYNAMIC =		(1 << 6),	/*!< dynamic peer */
 	IAX_SENDANI = 		(1 << 7),	/*!< Send ANI along with CallerID */
-	IAX_MESSAGEDETAIL =	(1 << 8),	/*!< Show exact numbers */
+	/* (1 << 8) is currently unused due to the deprecation of an old option. Go ahead, take it! */	
 	IAX_ALREADYGONE =	(1 << 9),	/*!< Already disconnected */
 	IAX_PROVISION =		(1 << 10),	/*!< This is a provisioning request */
 	IAX_QUELCH = 		(1 << 11),	/*!< Whether or not we quelch audio */
@@ -5916,19 +5916,13 @@
 		iax_ie_append_short(&ied, IAX_IE_REFRESH, p->expiry);
 		iax_ie_append_addr(&ied, IAX_IE_APPARENT_ADDR, &p->addr);
 		if (!ast_strlen_zero(p->mailbox)) {
-			if (ast_test_flag(p, IAX_MESSAGEDETAIL)) {
-				int new, old;
-				ast_app_messagecount(p->mailbox, &new, &old);
-				if (new > 255)
-					new = 255;
-				if (old > 255)
-					old = 255;
-				msgcount = (old << 8) | new;
-			} else {
-				msgcount = ast_app_has_voicemail(p->mailbox, NULL);
-				if (msgcount)
-					msgcount = 65535;
-			}
+			int new, old;
+			ast_app_messagecount(p->mailbox, &new, &old);
+			if (new > 255)
+				new = 255;
+			if (old > 255)
+				old = 255;
+			msgcount = (old << 8) | new;
 			iax_ie_append_short(&ied, IAX_IE_MSGCOUNT, msgcount);
 		}
 		if (ast_test_flag(p, IAX_HASCALLERID)) {
@@ -8516,7 +8510,7 @@
 		}
 	}
 	if (peer) {
-		ast_copy_flags(peer, &globalflags, IAX_MESSAGEDETAIL | IAX_USEJITTERBUF | IAX_FORCEJITTERBUF);
+		ast_copy_flags(peer, &globalflags, IAX_USEJITTERBUF | IAX_FORCEJITTERBUF);
 		peer->encmethods = iax2_encryption;
 		peer->secret[0] = '\0';
 		if (!found) {
@@ -8542,8 +8536,6 @@
 				ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
 			} else if (!strcasecmp(v->name, "dbsecret")) {
 				ast_copy_string(peer->dbsecret, v->value, sizeof(peer->dbsecret));
-			} else if (!strcasecmp(v->name, "mailboxdetail")) {
-				ast_set2_flag(peer, ast_true(v->value), IAX_MESSAGEDETAIL);	
 			} else if (!strcasecmp(v->name, "trunk")) {
 				ast_set2_flag(peer, ast_true(v->value), IAX_TRUNK);	
 				if (ast_test_flag(peer, IAX_TRUNK) && (timingfd < 0)) {
@@ -9095,8 +9087,6 @@
 			ast_set2_flag((&globalflags), ast_true(v->value), IAX_FORCEJITTERBUF);	
 		else if (!strcasecmp(v->name, "delayreject"))
 			delayreject = ast_true(v->value);
-		else if (!strcasecmp(v->name, "mailboxdetail"))
-			ast_set2_flag((&globalflags), ast_true(v->value), IAX_MESSAGEDETAIL);	
 		else if (!strcasecmp(v->name, "rtcachefriends"))
 			ast_set2_flag((&globalflags), ast_true(v->value), IAX_RTCACHEFRIENDS);	
 		else if (!strcasecmp(v->name, "rtignoreregexpire"))

Modified: team/oej/test-this-branch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_sip.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Tue Mar 14 14:20:42 2006
@@ -91,6 +91,7 @@
 #include "asterisk/devicestate.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/stringfields.h"
+#include "asterisk/monitor.h"
 
 #ifdef OSP_SUPPORT
 #include "asterisk/astosp.h"

Modified: team/oej/test-this-branch/configs/cdr.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/cdr.conf.sample?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/cdr.conf.sample (original)
+++ team/oej/test-this-branch/configs/cdr.conf.sample Tue Mar 14 14:20:42 2006
@@ -49,6 +49,13 @@
 ; is "yes".
 ;safeshutdown=yes
 ;
+
+; Normally, CDR's are not closed out until after all extensions are finished
+; executing.  By enabling this option, the CDR will be ended before executing
+; the "h" extension so that CDR values such as "end" and "billsec" may be
+; retrieved inside of of this extension.
+;endbeforehexten=no
+
 ;[csv]
 ;usegmtime=yes ;log date/time in GMT
 ;loguniqueid=yes ;log uniqueid

Modified: team/oej/test-this-branch/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/iax.conf.sample?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/iax.conf.sample (original)
+++ team/oej/test-this-branch/configs/iax.conf.sample Tue Mar 14 14:20:42 2006
@@ -216,13 +216,6 @@
 ;   none		-- No flags
 ;
 tos=lowdelay
-;
-; If mailboxdetail is set to "yes", the user receives
-; the actual new/old message counts, not just a yes/no
-; as to whether they have messages.  this can be set on
-; a per-peer basis as well
-;
-;mailboxdetail=yes
 ;
 ; If regcontext is specified, Asterisk will dynamically create and destroy
 ; a NoOp priority 1 extension for a given peer who registers or unregisters

Modified: team/oej/test-this-branch/contrib/utils/rawplayer.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/contrib/utils/rawplayer.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/contrib/utils/rawplayer.c (original)
+++ team/oej/test-this-branch/contrib/utils/rawplayer.c Tue Mar 14 14:20:42 2006
@@ -1,6 +1,10 @@
 /*
   Rawplayer.c simple raw file stdout player
   (c) Anthony C Minessale II <anthmct at yahoo.com>
+
+  2006-03-10: Bruno Rocha <bruno at 3gnt.net>
+  - include <stdlib.h> to remove compiler warning on some platforms
+  - check for read/write errors (avoid 100% CPU usage in some asterisk failures)
 */
 
 #define BUFLEN 320
@@ -8,21 +12,25 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <stdlib.h>
 
 static int deliver_file(char *path, int fdout) {
-	int fd = 0, bytes = 0;
+	int fd = 0, bytes = 0, error = 0;
 	short buf[BUFLEN];
 
 	if ((fd = open(path,O_RDONLY))) {
-		while ((bytes=read(fd, buf, BUFLEN))) {
-			write(fdout, buf, bytes);
+		while ((bytes=read(fd, buf, BUFLEN)) > 0) {
+			if(write(fdout, buf, bytes) < 0){
+				error = -2;
+				break;
+			}
 		}
 		if(fd)
 			close(fd);
 	} else 
 		return -1;
 	
-	return 0;
+	return error;
 }
 
 

Modified: team/oej/test-this-branch/include/asterisk/options.h
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/include/asterisk/options.h?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/include/asterisk/options.h (original)
+++ team/oej/test-this-branch/include/asterisk/options.h Tue Mar 14 14:20:42 2006
@@ -69,8 +69,13 @@
 	/*! Transmit Silence during Record() */
 	AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
 	/*! Suppress some warnings */
-	AST_OPT_FLAG_DONT_WARN = (1 << 18)
+	AST_OPT_FLAG_DONT_WARN = (1 << 18),
+	/*! End CDRs before the 'h' extension */
+	AST_OPT_END_CDR_BEFORE_H_EXTEN = (1 << 19)
 };
+
+/*! These are the options that set by default when Asterisk starts */
+#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
 
 #define ast_opt_exec_includes		ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
 #define ast_opt_no_fork			ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
@@ -91,6 +96,7 @@
 #define ast_opt_reconnect		ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT)
 #define ast_opt_transmit_silence	ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE)
 #define ast_opt_dont_warn		ast_test_flag(&ast_options, AST_OPT_FLAG_DONT_WARN)
+#define ast_opt_end_cdr_before_h_exten	ast_test_flag(&ast_options, AST_OPT_END_CDR_BEFORE_H_EXTEN)
 
 extern struct ast_flags ast_options;
 

Modified: team/oej/test-this-branch/pbx.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/pbx.c?rev=12987&r1=12986&r2=12987&view=diff
==============================================================================
--- team/oej/test-this-branch/pbx.c (original)
+++ team/oej/test-this-branch/pbx.c Tue Mar 14 14:20:42 2006
@@ -2278,7 +2278,7 @@
 		ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name);
 out:
 	if ((res != AST_PBX_KEEPALIVE) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) {
-		if (c->cdr)
+		if (c->cdr && ast_opt_end_cdr_before_h_exten)
 			ast_cdr_end(c->cdr);
 		c->exten[0] = 'h';
 		c->exten[1] = '\0';



More information about the asterisk-commits mailing list