[asterisk-commits] branch oej/test-this-branch r12463 - in /team/oej/test-this-branch: ./ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 8 10:25:28 MST 2006


Author: oej
Date: Wed Mar  8 11:25:24 2006
New Revision: 12463

URL: http://svn.digium.com/view/asterisk?rev=12463&view=rev
Log:
- Fix for chan_sip
- Issue #6193, End CDR before 'h' extension (russellb)

Modified:
    team/oej/test-this-branch/README.test-this-branch
    team/oej/test-this-branch/cdr.c
    team/oej/test-this-branch/channels/chan_sip.c
    team/oej/test-this-branch/pbx.c

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=12463&r1=12462&r2=12463&view=diff
==============================================================================
--- team/oej/test-this-branch/README.test-this-branch (original)
+++ team/oej/test-this-branch/README.test-this-branch Wed Mar  8 11:25:24 2006
@@ -9,6 +9,10 @@
 This is a combined branch of many patches and branches from the
 bug tracker that needs your testing.  Please test and report
 your results in the bug tracker reports for each patch.
+
+How do I work with subversion branches?
+---------------------------------------
+See http://www.voip-forum.com/?p=189&more=1
 
 What's in this branch?
 ----------------------
@@ -38,6 +42,7 @@
 - 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)
 
 Coming here soon:
 - siptransfer: Improved SIP transfer support
@@ -127,6 +132,22 @@
 parking lots and the channel configurations for setting default
 parking lot for a device/channel. 
 
+* End CDR before 'h' extension
+------------------------------
+In Asterisk 1.2 you will not get values from ${CDR(end)} or ${CDR(billsec)}
+from the 'h' extension. The reason is that the CDR is not ended before
+executing the 'h' extension.
+
+This means that a customer would be billed for all of the time that
+the 'h' extension is being executed.
+
+This patch simply ends the CDR before starting to execute the 'h' extension.
+If the 'h' extension does not exist, the cdr will be ended shortly after
+in ast_hangup().
+
+The CDR is still only posted in ast_hangup, because we want the CDR to
+be ended, but still present in the 'h' extension so that all values can
+still be read from it.
 
 * 6251: Support for HDLC mode in ZAP channels
 ----------------------------------------------
@@ -205,3 +226,7 @@
 
 * Dus.net GMBH, Germany
 
+MAINTAINER
+----------
+Olle E. Johansson, Asterisk developer, trainer, bug marshal
+http://edvina.net

Modified: team/oej/test-this-branch/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/cdr.c?rev=12463&r1=12462&r2=12463&view=diff
==============================================================================
--- team/oej/test-this-branch/cdr.c (original)
+++ team/oej/test-this-branch/cdr.c Wed Mar  8 11:25:24 2006
@@ -657,6 +657,11 @@
 			ast_log(LOG_WARNING, "CDR on channel '%s' has not started\n", chan);
 		if (ast_tvzero(cdr->end))
 			cdr->end = ast_tvnow();
+		cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec + (cdr->end.tv_usec - cdr->start.tv_usec) / 1000000;
+		if (!ast_tvzero(cdr->answer))
+			cdr->billsec = cdr->end.tv_sec - cdr->answer.tv_sec + (cdr->end.tv_usec - cdr->answer.tv_usec) / 1000000;
+		else
+			cdr->billsec = 0;
 		cdr = cdr->next;
 	}
 }
@@ -804,11 +809,6 @@
 			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start))
 			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
-		cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec + (cdr->end.tv_usec - cdr->start.tv_usec) / 1000000;
-		if (!ast_tvzero(cdr->answer))
-			cdr->billsec = cdr->end.tv_sec - cdr->answer.tv_sec + (cdr->end.tv_usec - cdr->answer.tv_usec) / 1000000;
-		else
-			cdr->billsec = 0;
 		ast_set_flag(cdr, AST_CDR_FLAG_POSTED);
 		AST_LIST_LOCK(&be_list);
 		AST_LIST_TRAVERSE(&be_list, i, list) {

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=12463&r1=12462&r2=12463&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Wed Mar  8 11:25:24 2006
@@ -12137,7 +12137,7 @@
 /*! \brief Set device defaults before configuring specific configurations */
 static void set_device_defaults(struct sip_peer *device)
 {
-	if (peer->expire == 0) {
+	if (device->expire == 0) {
 		/* Don't reset expire or port time during reload 
 		   if we have an active registration 
 		*/

Modified: team/oej/test-this-branch/pbx.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/pbx.c?rev=12463&r1=12462&r2=12463&view=diff
==============================================================================
--- team/oej/test-this-branch/pbx.c (original)
+++ team/oej/test-this-branch/pbx.c Wed Mar  8 11:25:24 2006
@@ -2273,6 +2273,8 @@
 		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)
+			ast_cdr_end(c->cdr);
 		c->exten[0] = 'h';
 		c->exten[1] = '\0';
 		c->priority = 1;



More information about the asterisk-commits mailing list