On Wed, Dec 8, 2010 at 9:45 AM, Henry Dogger <h.dog...@telecats.nl> wrote:
> Unlike stated in issue: http://track.sipfoundry.org/browse/XX-8476 that a
> issue around these errors is fixed.
>
> I still see these lines in the logging: ERROR: duplicate key violates unique
> constraint "cdrs_call_id_unique"
>
> I’m using: sipXconfig (4.2.1-018971.dhubler 2010-08-21T04:59:23 build37)
>
> Is it something in sipXecs, or something I’m doing wrong?

I see that it's marked as fixed in 4.2.1 according to jira, however i
do not see it in the the git branch for 4.2.1.  It is in the upcoming
4.4 release.

Luckily, the fix is in ruby script and you can apply this patch
manually.  Let me know if this works

diff --git a/sipXproxy/src/cdr/lib/utils/sipx_logger.rb
b/sipXproxy/src/cdr/lib/utils/sipx_logger.rb
index 0611297..8f5b342 100644
--- a/sipXproxy/src/cdr/lib/utils/sipx_logger.rb
+++ b/sipXproxy/src/cdr/lib/utils/sipx_logger.rb
@@ -54,10 +54,16 @@ class SipxLogger < Logger
   # trying to imitate sipx log file format
   class SipxFormatter

+    @@seqnum = 0
+    @@maxseqnum = (2 ** 32) - 1
+    @@hostname = Socket.gethostname
+    @@taskname = "main"
     def call(severity, time, progname, msg)
       sipx_severity = LOG_LEVEL_LOGGER_TO_SIPX[severity]
       time_str = time.utc.strftime("%Y-%m-%dT%H:%M:%S.") << "%06dZ" % time.usec
-      %Q<"#{time_str}":#{sipx_severity}:#{msg.chomp}\n>
+      @@seqnum = 0 if @@seqnum >= @@maxseqnum
+      @@seqnum = @@seqnum + 1
+      
%Q<"#{time_str}":#{@@seqnum}:CDR:#{sipx_severity}:#{@@hostname}:#{@@taskname}:00000000:cdr:#{msg.chomp.dump}\n>
     end

   end
_______________________________________________
sipx-users mailing list
sipx-users@list.sipfoundry.org
List Archive: http://list.sipfoundry.org/archive/sipx-users/

Reply via email to