This message was generated by the Security Alerts service ( Free Trial 14th of 
August - 14th of September )
http://www.opensips.org/Resources/AlertsMain
*
SVN commit*:
http://opensips.svn.sourceforge.net/viewvc/opensips?view=revision&revision=9195

*Severity*: High

*Version*  : 1.8, trunk

*Affected modules*  : ACC

*Effect*  : Missing CDRs in the back-end

*Affected scenarios*: The issue appeared when the ACC module was set to 
generate proper
CDRs with the duration field also populated ( cdr_flag ). When also setting the
db_extra_bye parameter in order to have some extra accounting for variable 
evaluated at
BYE time, internally ended dialogs ( expired dialogs or forcefully terminated 
on the
OpenSIPS side via an MI command ) would not generate accounting records.

*Description:*  The bug was introduced along with the db_extra_bye feature, due 
to an
incorrectly treated error case.
In order to evaluate the pseudo-variables set in the db_extra_bye parameter, 
OpenSIPS
requires the BYE SIP message pointer  Because in the case of internally 
terminated dialogs
there is no actual SIP message received from the network level, OpenSIPS would 
fail to
evaluate the pseudo-variables, and then due to improper error handling, the 
accounting
process was stopped, and no CDR was generated in the back-end.

*Risks*  : When doing the new type of accounting with CDRs, there was the risk 
of having
some missing CDRs, and thus if using CDR type accounting, upgrading is critical.

*Update*  :
- if you have an SVN checkout, 1.8 and trunk were fixed; so
update to a revision later than 9194 (trunk) or 9195 (1.8 branch)
- if you have OpenSIPS from sources, download and apply the patch from
http://opensips.svn.sourceforge.net/viewvc/opensips?view=revision&revision=9195
or see the attached patch;
- if using tarballs, they were already regenerated (and include the fix)
- If using the official Debian package (apt.opensips.org), they are also
re-generated including the fix.

--
Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

--- modules/acc/acc.c	2012/08/08 21:28:32	9194
+++ modules/acc/acc.c	2012/08/08 21:38:04	9195
@@ -1562,7 +1562,7 @@
 	start += extra_len;
 
 	/* populate the extra from bye */
-	return  start + (msg?extra2strar(extra, msg, NULL, val_arr + start, 1):0);
+	return  start + extra2strar(extra, msg, NULL, val_arr + start, 1);
 }
 
 
--- modules/acc/acc_extra.c	2012/08/08 21:28:32	9194
+++ modules/acc/acc_extra.c	2012/08/08 21:38:04	9195
@@ -286,6 +286,16 @@
 		LM_ERR("Invalid buffer index %d - maximum %d\n", idx, MAX_ACC_BUFS-2);
 		return 0;
 	}
+	
+	if (!rq) {
+		/* no SIP message - probably internally terminated dialog
+			just nullify everything and skip them */
+		for (n=0; extra ; extra=extra->next,n++) {
+			val_arr[n].s = 0;
+			val_arr[n].len = 0;
+		}
+		return n;
+	}
 
 	for( n=0,r=0 ; extra ; extra=extra->next,n++) {
 		/* get the value */

_______________________________________________
Alerts mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/alerts
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to