Commit Graph

404 Commits

Author SHA1 Message Date
Kinsey Moore 71a8457d53 Support schema selection in cdr_adaptive_odbc
Asterisk now supports using ODBC with databases where a single schema must be
selected.  Previously, INSERTs would fail because they did not take into
account extra fields cause by having multiple schemas.  This also corrects
some SQL resource leaks.

(closes issue ASTERISK-17106)
Patch-by: Alexander Frolkin
Patch-by: Tilgnman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-03 16:50:49 +00:00
Olle Johansson 383b073966 Add CLI command "cdr show pgsql status" based on "cdr mysql status"
Review: https://reviewboard.asterisk.org/r/923/

Thanks all for the code reviews and feedback.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-29 12:03:23 +00:00
Richard Mudgett 55b70ae625 Merged revisions 337974 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r337974 | rmudgett | 2011-09-26 14:35:23 -0500 (Mon, 26 Sep 2011) | 37 lines
  
  Merged revisions 337973 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r337973 | rmudgett | 2011-09-26 14:30:39 -0500 (Mon, 26 Sep 2011) | 30 lines
    
    Fix deadlock when using dummy channels.
    
    Dummy channels created by ast_dummy_channel_alloc() should be destoyed by
    ast_channel_unref().  Using ast_channel_release() needlessly grabs the
    channel container lock and can cause a deadlock as a result.
    
    * Analyzed use of ast_dummy_channel_alloc() and made use
    ast_channel_unref() when done with the dummy channel.  (Primary reason for
    the reported deadlock.)
    
    * Made app_dial.c:dial_exec_full() not call ast_call() holding any channel
    locks.  Chan_local could not perform deadlock avoidance correctly.
    (Potential deadlock exposed by this issue.  Secondary reason for the
    reported deadlock since the held lock was part of the deadlock chain.)
    
    * Fixed some uses of ast_dummy_channel_alloc() not checking the returned
    channel pointer for failure.
    
    * Fixed some potential chan=NULL pointer usage in func_odbc.c.  Protected
    by testing the bogus_chan value.
    
    * Fixed needlessly clearing a 1024 char auto array when setting the first
    char to zero is enough in manager.c:action_getvar().
    
    (closes issue ASTERISK-18613)
    Reported by: Thomas Arimont
    Patches:
          jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett
    Tested by: Thomas Arimont
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-26 19:40:12 +00:00
Paul Belanger 2d18de5f8f Clean up cdr.conf parsing for [csv] section
Review: https://reviewboard.asterisk.org/r/1427/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 14:25:43 +00:00
Tilghman Lesher 353bcc99c1 Merged revisions 329614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r329614 | tilghman | 2011-07-26 23:25:26 -0500 (Tue, 26 Jul 2011) | 13 lines
  
  Merged revisions 329613 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r329613 | tilghman | 2011-07-26 23:23:46 -0500 (Tue, 26 Jul 2011) | 6 lines
    
    Duration and billsec are swapped in high resolution time.
    
    Closes ASTERISK-18024
    Patches:
    	20110726__ASTERISK-18024.diff by Tilghman Lesher (License 5003)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-27 04:27:19 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
Richard Mudgett c8548bad22 Merged revisions 321926 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r321926 | rmudgett | 2011-06-03 17:09:36 -0500 (Fri, 03 Jun 2011) | 18 lines
  
  Asterisk crash when unloading cdr_radius/cel_radius.
  
  The rc_openlog() API call is passed a string that is used by openlog() to
  format log messages.  The openlog() does not copy the string it just keeps
  a pointer to it.  When the module is unloaded, the string is gone from
  memory.  Depending upon module load order and if the other module then has
  an error, a crash happens.
  
  * Pass rc_openlog() a strdup'd string with the understanding that there
  will be a small memory leak if the cdr_radius/cel_radius modules are
  unloaded.
  
  * Call rc_destroy() to free the rc handle memory when the module is
  unloaded.
  
  JIRA AST-483
  JIRA SWP-3062
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-03 22:15:56 +00:00
Russell Bryant 15b8740f80 Merged revisions 317480 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317480 | russell | 2011-05-05 18:00:55 -0500 (Thu, 05 May 2011) | 8 lines
  
  Don't lose cdr_syslog config on a reload.
  
  (closes issue #18679)
  Reported by: enegaard
  Patches:
        issue18679_seanbright.patch uploaded by seanbright (license 71)
  Tested by: enegaard
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 23:02:11 +00:00
Russell Bryant f0f5e237bf Merged revisions 317474 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317474 | russell | 2011-05-05 17:36:33 -0500 (Thu, 05 May 2011) | 2 lines
  
  Fix more "set but unused" warnings.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 22:44:52 +00:00
Paul Belanger 8b23fd448c Merged revisions 300575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r300575 | pabelanger | 2011-01-05 11:29:19 -0500 (Wed, 05 Jan 2011) | 13 lines
  
  Merged revisions 300574 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r300574 | pabelanger | 2011-01-05 11:28:07 -0500 (Wed, 05 Jan 2011) | 6 lines
    
    Change deprecated message to LOG_WARNING
    
    Also removed latter part of message
    
    Discussed on #asterisk-dev
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-05 16:30:56 +00:00
Tilghman Lesher 96b7a9950c Support negative filters.
(closes issue #17979)
 Reported by: tilghman
 Patches: 
       20100911__for_blitzrage.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-31 09:29:10 +00:00
Tilghman Lesher 55c861888a Merged revisions 299131 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r299131 | tilghman | 2010-12-20 11:47:10 -0600 (Mon, 20 Dec 2010) | 18 lines
  
  Merged revisions 299130 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r299130 | tilghman | 2010-12-20 11:41:24 -0600 (Mon, 20 Dec 2010) | 11 lines
    
    If a call was not answered, then the billsec was calculated unusually large.
    
    Also, due to a copy and paste error, a request for the answer field would have
    given the start value, instead.
    
    (closes issue #18460)
     Reported by: joscas
     Patches: 
           20101215__issue18460.diff.txt uploaded by tilghman (license 14)
     Tested by: joscas
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 17:48:09 +00:00
Tilghman Lesher e0c1aed520 Merged revisions 298394 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r298394 | tilghman | 2010-12-15 18:30:04 -0600 (Wed, 15 Dec 2010) | 22 lines
  
  Merged revisions 298393 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r298393 | tilghman | 2010-12-15 18:29:10 -0600 (Wed, 15 Dec 2010) | 15 lines
    
    Merged revisions 298392 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r298392 | tilghman | 2010-12-15 18:28:04 -0600 (Wed, 15 Dec 2010) | 8 lines
      
      Unregister before shutting down the connection, to avoid a race.
      
      (closes issue #18481)
       Reported by: pabelanger
       Patches: 
             20101215__issue18481.diff.txt uploaded by tilghman (license 14)
       Tested by: pabelanger
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-16 06:51:51 +00:00
Tilghman Lesher a95c0f2f0d Merged revisions 291038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r291038 | tilghman | 2010-10-09 18:25:37 -0500 (Sat, 09 Oct 2010) | 2 lines
  
  Add missing option to set calls to be logged in GMT/UTC.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-11 03:20:17 +00:00
Olle Johansson 6cb355abbe Formating changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-27 19:30:18 +00:00
Tilghman Lesher f8180257e0 Merged revisions 288638 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288638 | tilghman | 2010-09-23 22:39:29 -0500 (Thu, 23 Sep 2010) | 16 lines
  
  Merged revisions 288637 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288637 | tilghman | 2010-09-23 22:36:01 -0500 (Thu, 23 Sep 2010) | 9 lines
    
    Merged revisions 288636 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288636 | tilghman | 2010-09-23 22:20:24 -0500 (Thu, 23 Sep 2010) | 2 lines
      
      Solaris compatibility fixes
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-24 03:41:02 +00:00
Tilghman Lesher d5b09e2a36 Merged revisions 288268 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288268 | tilghman | 2010-09-22 10:14:02 -0500 (Wed, 22 Sep 2010) | 30 lines
  
  Merged revisions 288267 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288267 | tilghman | 2010-09-22 10:11:09 -0500 (Wed, 22 Sep 2010) | 23 lines
    
    Merged revisions 288265-288266 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288265 | tilghman | 2010-09-22 09:48:04 -0500 (Wed, 22 Sep 2010) | 9 lines
      
      Allow the encoding to be set, in case local charset does not agree with database.
      
      (closes issue #16940)
       Reported by: jamicque
       Patches: 
             20100827__issue16940.diff.txt uploaded by tilghman (license 14)
             20100921__issue16940__1.6.2.diff.txt uploaded by tilghman (license 14)
       Tested by: jamicque
    ........
      r288266 | tilghman | 2010-09-22 10:04:52 -0500 (Wed, 22 Sep 2010) | 5 lines
      
      Document addition of encoding parameter.
      
      (issue #16940)
      Reported by: jamicque
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-22 15:18:49 +00:00
Tilghman Lesher 20d02604df Merged revisions 283319 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r283319 | tilghman | 2010-08-23 16:33:47 -0500 (Mon, 23 Aug 2010) | 9 lines
  
  Merged revisions 283318 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r283318 | tilghman | 2010-08-23 16:32:14 -0500 (Mon, 23 Aug 2010) | 2 lines
    
    CDR drivers depend upon res_odbc, not directly on the ODBC libraries
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-23 21:35:09 +00:00
Tilghman Lesher b190d76f7f Merged revisions 279410 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r279410 | tilghman | 2010-07-25 13:21:27 -0500 (Sun, 25 Jul 2010) | 8 lines
  
  Don't re-register CDR module on reload.
  
  (closes issue #17304)
   Reported by: jnemeth
   Patches: 
         20100507__issue17304.diff.txt uploaded by tilghman (license 14)
   Tested by: jnemeth
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-25 18:22:13 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Leif Madsen 0c7357c94e cdr_pgsql does not detect when a table is found.
This change adds an ERROR message to let you know when a failure exists to
get the columns from the pgsql database, which typically means that the
table does not exist.

(closes issue #17478)
Reported by: kobaz
Patches:
      cdr_pgsql.patch uploaded by kobaz (license 834)
Tested by: kobaz, russell, lmadsen

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-12 15:37:01 +00:00
Olle Johansson 28cbe2f75e Make it possible to disable individual cdr files per accountcode in cdr_csv
Review: https://reviewboard.asterisk.org/r/678/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 11:06:19 +00:00
Bradley Latus 4405813297 Add High Resolution Times to CDRs for Asterisk
People expressed an interest in having access to the exact length of calls to a finer degree than seconds. See the CHANGES and UPGRADE.txt for usage also updated the sample configs to note the change.

Patch by snuffy.

(closes issue #16559)
Reported by: cianmaher
Tested by: cianmaher, snuffy

Review: https://reviewboard.asterisk.org/r/461/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 23:48:17 +00:00
Sean Bright 285ef284ef Merged revisions 269006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r269006 | seanbright | 2010-06-08 11:28:49 -0400 (Tue, 08 Jun 2010) | 11 lines
  
  Reduce startup time for cdr_tds with large CDR tables.
  
  Since we are just checking for table existence, add a WHERE clause that will
  return no rows but will raise an error if the table doesn't exist.
  
  (closes issue #17380)
  Reported by: kkwong
  Patches:
        issue17380-01.patch uploaded by seanbright (license 71)
  Tested by: kkwong
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 15:39:52 +00:00
Tilghman Lesher 012979b835 Ensure that we can have commas within cdr values.
(closes issue #17001)
 Reported by: snuffy
 Patches: 
       20100412__issue17001.diff.txt uploaded by tilghman (license 14)
 Tested by: snuffy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-13 16:33:21 +00:00
Russell Bryant 3da9f8ed19 Resolve more compiler warnings on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 12:03:07 +00:00
Sean Bright 9a3d1b76e3 Fix building CDR and CEL SQLite3 modules.
They added a sqlite3_log() function which was conflicting with our function
names.

(closes issue #17017)
Reported by: alephlg


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-14 17:43:46 +00:00
Russell Bryant a297f2d04e formatting tweaks and constification
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:45:11 +00:00
Russell Bryant 1f2f5fadcc trivial formatting tweak (working on reducing diff against trunk for cdr-q)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:08:38 +00:00
Russell Bryant 2abbaa5b6d remove include
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:07:27 +00:00
Russell Bryant 022e262d71 constification, remove include
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:07:09 +00:00
Russell Bryant ab9741edbb Remove unnecessary includes, formatting tweak
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:05:36 +00:00
Russell Bryant 5e9c39468b constification and remove unnecessary include
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:04:07 +00:00
Sean Bright e612d87695 Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 18:21:50 +00:00
Tilghman Lesher 98a07b127f When the field is blank, don't warn about the field being unable to be coerced, just skip the column.
(closes http://lists.digium.com/pipermail/asterisk-dev/2009-December/041362.html)
Reported by Nic Colledge on the -dev list, fixed by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-30 17:53:29 +00:00
Matthew Nicholson c7358b39b7 Don't close the sqlite database when reloading. Only close the database when unloading.
(closes issue #15953)
Reported by: frawd
Patches:
      sqlite3_rev220097.diff uploaded by frawd (license 610)
Tested by: frawd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-09 17:14:38 +00:00
Olle Johansson fff998bf41 Use extref for doxygen references to external libraries (in this case PostgreSQL)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 18:55:25 +00:00
Tilghman Lesher 2d60b75594 Change schema query to involve the use of an optional schema parameter.
This change is done in such a way as to allow the driver to continue to
function with older databases which don't have these features.
(closes issue #16000)
 Reported by: jamicque
 Patches: 
       20091002__issue16000.diff.txt uploaded by tilghman (license 14)
       20091002__issue16000__1.6.1.diff.txt uploaded by tilghman (license 14)
 Tested by: jamicque


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 19:31:39 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Sean Bright a4284a507b Add a new module, cdr_syslog, which allows writing CDRs to syslog.
The original patch for this was written by Brett Bryant, and I split it out into
it's own module.

(closes issue #12876)
Reported by: bbryant
Patches:
      06162008_cdr_custom_syslog.diff uploaded by bbryant (license 36)
      05212009_cdr_syslog.patch uploaded by seanbright (license 71)
Tested by: seanbright

Review: https://reviewboard.asterisk.org/r/297/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 22:08:05 +00:00
Russell Bryant 0264eef115 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

Review: https://reviewboard.asterisk.org/r/239/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:28:53 +00:00
Sean Bright 1fa4796b19 Update sample cdr_tds configuration to try and eliminate some confusion.
Also change the preferred configuration option from 'hostname' (which was
misleading because it didn't actually treat the value as a hostname) to
'connection' and added some verbage explaining that the user would need to
refer to their freetds.conf file for those settings.  'hostname' was kept
as a backwards compatible configuration parameter.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-24 13:47:55 +00:00
Sean Bright 8d3fb80928 Fix lock usage in cdr_sqlite3_custom to avoid potential crashes during reload.
Pointed out by Russell while working on the CEL branch.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 16:09:50 +00:00
Russell Bryant 356c0e2f8c Note a bug in cdr_sqlite3_custom so I don't forget about it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-21 16:36:55 +00:00
Russell Bryant eccfeaf9b4 Fix possibility of crashiness during reload in custom fields handling.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-21 16:11:48 +00:00
Russell Bryant 32fdcc00b2 Standardize return values of load_config() so reload() doesn't report an error on success.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-21 16:00:23 +00:00
Russell Bryant f57752d380 Leave a note about some unsafe code in cdr_manager
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-20 20:56:13 +00:00
Russell Bryant b390327dd7 Remove unnecessary usleep() from a couple of module unload callbacks.
In passing, also tweak cdr_unregister() to hold the list lock a bit less time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-20 14:09:40 +00:00
Kevin P. Fleming 82fb56886e More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:34:30 +00:00
Sean Bright 9a83ed9d93 Use a properly allocated channel for substitution in cdr_sqlite3_custom.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 13:56:30 +00:00
Sean Bright b543887664 Use a properly allocated channel for substitution in cdr_manager.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 12:14:14 +00:00
Sean Bright 1d28f5acd4 Fix errors in cdr_custom that cause reference errors when non-CDR variable
substitution is done.

cdr_custom was creating a ast_channel struct directly and passing it into the
core for variable substition.  This was fine as long as the format string
contained only calls to the CDR() function.  Doing something like ${EPOCH} on
the other hand tried to lock the channel, which would fail and throw an error
because the passed channel hadn't been allocated as an ao2 object.  So now we
create the dummy channel with ast_channel_alloc, and everything works as
expected.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-23 15:16:59 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Sean Bright c890725398 Remove some unused code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 17:08:25 +00:00
Sean Bright dd0cd47630 Const-ify a string, fix a log message, and use the correct signature for the
load_module function.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 15:55:53 +00:00
Sean Bright f223598207 Allow cdr_custom to write to multiple files instead of just one.
Up to now, cdr_custom would only accept a single filename/format from
cdr_custom.conf.  This change allows you to specify multiple filename
& format directives.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 14:54:43 +00:00
Tilghman Lesher a866a75900 Merge str_substitution branch.
This branch adds additional methods to dialplan functions, whereby the result
buffers are now dynamic buffers, which can be expanded to the size of any
result.  No longer are variable substitutions limited to 4095 bytes of data.
In addition, the common case of needing buffers much smaller than that will
enable substitution to only take up the amount of memory actually needed.
The existing variable substitution routines are still available, but users
of those API calls should transition to using the dynamic-buffer APIs.
Reviewboard: http://reviewboard.digium.com/r/174/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 18:53:01 +00:00
Russell Bryant fde695bb7f Merged revisions 186229 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r186229 | russell | 2009-04-02 20:57:44 -0500 (Thu, 02 Apr 2009) | 21 lines

Fix a memory leak in cdr_radius.

I came across this while doing some testing of my ast_channel_ao2 branch.
After running a test overnight that generated over 5 million calls, Asterisk
had taken up about 1 GB of my system memory.  So, I re-ran the test with
MALLOC_DEBUG turned on.  However, it showed no leaks in Asterisk during the
test, even though Asterisk was still consuming it somehow.

Instead, I turned to valgrind, which when run with --leak-check=full, told
me exactly where the leak came from, which was from allocations inside the
radiusclient-ng library.  This explains why MALLOC_DEBUG did not report it.

After a bit of analysis, I found that we were leaking a little bit of memory
every time a CDR record was passed to cdr_radius.

I don't actually have a radius server set up to receive CDR records.  However,
I always have my development systems compile and install all modules.  In
addition to making sure there are not build errors across modules, always
loading modules helps find bugs like this, too, so it is strongly recommend for
all developers.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 02:03:48 +00:00
Tilghman Lesher 5120334acc Backport 1.6.0 fix to trunk (failsafe if db is not loaded)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@179361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-02 17:18:48 +00:00
Tilghman Lesher 31ae1bfa0d If config file is blank, don't load module.
(Closes issue #14563)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@179161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-27 21:32:13 +00:00
Kevin P. Fleming 9a7efae8fd remove the PBX_ODBC logic from the configure script, and add GENERIC_ODCB logic that includes copying the relevant LIB and INCLUDE data from either UnixODBC or iODBC, based on which was found; if both were found, prefer UnixODBC
this stops modules from being linked against both sets of libraries on systems that have both installed



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 20:18:53 +00:00
Tilghman Lesher b584784f85 When querying for the structure of the CDR table, remove the schema, if it
exists.
(Closes issue #14058)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 18:09:58 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Kevin P. Fleming 887e28d7aa incorporates r159808 from branches/1.4:
------------------------------------------------------------------------
r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines

update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors

since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them

format attributes in a consistent way


------------------------------------------------------------------------

in addition:

move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29 17:57:39 +00:00
Terry Wilson 3a4177f52e Reloading the config and having no changes still initialized some settings to 0. Initialize settings after doing all of the cfg checks.
(closes issue #13942)
Reported by: davidw
Patches: 
      cdr_diff.txt uploaded by otherwiseguy (license 396)
Tested by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 17:08:16 +00:00
Terry Wilson 4f8242904a Begin on a crusade to end trailing whitespace!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:48:58 +00:00
Terry Wilson d66a8cd264 Fix checking for CONFIG_STATUS_FILEINVALID so that modules don't crash upon trying to parse an invalid config
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 19:25:14 +00:00
Tilghman Lesher 03b1a5a384 Allow setting static values in CDRs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 22:36:30 +00:00
Kevin P. Fleming 448562af93 improve configure script to remember the previous value of each dependency in build_tools/menuselect-deps, so that (once it has been written) menuselect can use this information to warn the user when a previously met dependency is no longer met
along the way, change tags used in configure script, menuselect-deps and code for various dependencies to be consistently named



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 15:07:54 +00:00
Sean Bright ceee55ea63 Keep up with shadow warnings. One day I'll actually enable this in the Makefile.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-08 12:15:06 +00:00
Michiel van Baak 4560279c69 All ODBC parts can now use either unixodbc or iodbc.
This allows for the ODBC parts to work on OpenBSD as well.

99.99% of the work is done by seanbright (bow, bow) and I actually
did nothing but test and yell at him that it still didn't work :)

Thanks for helping out !


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 23:14:33 +00:00
Sean Bright e189fb406f Build under dev-mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 00:49:31 +00:00
Tilghman Lesher 3a67cc8016 Add usegmtime, as per the recent -users list discussion, and also add my
explanation to the file, since that additional text helps people understand
the concept.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-11 21:45:07 +00:00
Sean Bright a8a0ecb509 Move some duplicated code into a separate function.
Also try to do some wacky stuff in the commit message, like:
a newline \n
a bell \a
a tab \t
a format specification %p

That is all.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-03 13:48:12 +00:00
Tilghman Lesher b95a4f4680 Oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-27 23:23:56 +00:00
Tilghman Lesher 8be98abf79 Memory leak
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-24 16:26:48 +00:00
Tilghman Lesher a88af95df4 Eliminate open coding of ast_str
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-24 16:23:15 +00:00
Sean Bright 2fbd22bbc2 Fix memory leak in cdr_sqlite3_custom.
(closes issue #13304)
Reported by: eliel
Patches:
      sqlite.patch uploaded by eliel (license 64)
      (Slightly modified by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 18:47:28 +00:00
Sean Bright 297ebf779f If we detect that we are no longer connected, try to reconnect a few times
before giving up.  This relies on the timeout settings in the freetds.conf
file and, unfortunately, on a recent version of FreeTDS (0.82 or newer).

I either need to change the current execs to be non-blocking (which I do
not want to do) or we have to force people to run with the latest and
greatest of FreeTDS.  I'm on the fence...


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 15:03:03 +00:00
Sean Bright c2faa7bfda Use the ast_vasprintf macro instead of vasprintf directly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 14:22:47 +00:00
Sean Bright 9c7099faae Log the userfield CDR variable like the other CDR backends, assuming the
column is actually there.  If it's not, we still log everything else as
before.

(closes issue #13281)
Reported by: falves11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-11 14:25:15 +00:00
Tilghman Lesher 8397209316 Fix runtime symbol error
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 15:10:53 +00:00
Sean Bright 778b3d88a7 More from the resolve-shadow-warnings branch. This time the cdr/ directory.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 00:52:23 +00:00
Brett Bryant 86e5bb8b7d Fix magic Revision keywords in hashtab.c and change cdr_radius.c to use
the same keyword as the other files (patch by eliel).

(closes issue #13104)
Reported by: eliel
Patches:
      revision.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 17:55:41 +00:00
Sean Bright 097ac98034 Fix a bug I noticed while doing the previous merge
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02 14:30:09 +00:00
Sean Bright dd0c0f3d38 Cast a few more strings to char *, so that we can compile cleanly against
FreeTDS 0.60.  Update the docs to reflect that we can now compile and run
against all modern releases of FreeTDS (0.60 through 0.82)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 11:57:42 +00:00
Sean Bright a61f8794e3 This was bogus, need to find a better way.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-29 13:20:01 +00:00
Sean Bright e41a7c3d51 While we're at it, escape all the columns in our TDS queries as well. Double
quotes seems to be more standard than square brackets (Sybase and SQL Server
both support them).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-29 13:11:55 +00:00
Sean Bright 044a7b945f Quote column names when inserting CDRs into postgres to avoid conflicts
with reserved words.

(closes issue #12947)
Reported by: panolex


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-29 12:06:46 +00:00
Sean Bright 19830f3359 Merge in changes from my cdr-tds-conversion branch. This changes the internal
implementation from using the volatile libtds, to using the db-lib front end.
The unintended side effect of this is that we support (at least) versions 0.62
through 0.82 of the FreeTDS distribution without any #ifdef ugliness.

(closes issue #12844)
Reported by: jcollie


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-28 21:28:16 +00:00
Steve Murphy c23e5fea96 This solves a crash in the cdr_tds module on 'stop gracefully', for situations where 'settings' is not set to a pointer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 20:00:36 +00:00
Sean Bright f0b9647b09 Last commit for a bit, minor cleanups and move the lock initialization.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 17:33:10 +00:00
Sean Bright 4ee3510f10 Convert to use stringfields. Still some more work to do on config load/reload.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 17:14:11 +00:00
Sean Bright 852c514e25 Remove some unused variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 16:29:18 +00:00
Sean Bright 8b1ed7aa5b Coding guidelines stuff only.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 15:25:03 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Tilghman Lesher 1207e9207e Don't unload config on reload, when config has not changed.
(Closes issue #12652)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-15 17:58:22 +00:00
Tilghman Lesher 0c08b7727d Ensure that "calldate" is acceptable for a column name.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-10 14:19:41 +00:00
Sean Bright 87973ccea2 Minor logging cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-20 14:52:07 +00:00
Tilghman Lesher 369ccdef5e Oops, buffer wasn't long enough for query
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 20:51:08 +00:00