Commit Graph

23 Commits

Author SHA1 Message Date
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Tzafrir Cohen 11cefdf621 cdr_mysql: avoid releasing a config string
Fixes a memory corruption issue after a reload of cdr_mysql.

Issue was accidentally included in 747beb1ed1 .

ASTERISK-27270 #close

Change-Id: I90b6a9d18710c0f9009466370bd5f4bac5d5d12e
2017-10-10 17:52:20 +03:00
alex 1199927fc0 cdr_mysql.c: Apply cdrzone to start and answer
Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
2017-09-18 07:03:20 -05:00
George Joseph 747beb1ed1 modules: change module LOAD_FAILUREs to LOAD_DECLINES
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed
to AST_MODULE_LOAD_DECLINE.  This prevents asterisk from exiting
if a module can't be loaded.  If the user wishes to retain the
FAILURE behavior for a specific module, they can use the "require"
or "preload-require" keyword in modules.conf.

A new API was added to logger: ast_is_logger_initialized().  This
allows asterisk.c/check_init() to print to the error log once the
logger subsystem is ready instead of just to stdout.  If something
does fail before the logger is initialized, we now print to stderr
instead of stdout.

Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-04-12 15:57:21 -06:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Tzafrir Cohen d3ddf4b0fd cdr_mysql: fix UTC support
* Make 'cdrzone=UTC' work properly.
* Fix the documentation of cdr_mysql.conf: it's cdrzone and not timezone

ASTERISK-26359 #close

Change-Id: I2a6f67b71bbbe77cac31a34d0bbfb1d67c933778
2016-09-15 13:16:04 +03:00
Rodrigo Ramírez Norambuena 0ec9fe5421 main/cli.c: Refactor function to print seconds formatted
Refactor and created function ast_cli_print_timestr_fromseconds to print
seconds formatted:  year(s) week(s) day(s) hour(s) second(s)

This function now is used in addons/cdr_mysql.c,cdr_pgsql.c, main/cli.c,
res_config_ldap.c, res_config_pgsql.c.

Change-Id: Ibeb8634102cd11d3f8623398b279cb731bcde36c
2016-03-07 03:42:18 -03:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Mark Michelson dcf1ad14da Add module support level to ast_module_info structure. Print it in CLI "module show" .
ASTERISK-23919 #close
Reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25 16:47:17 +00:00
Matthew Jordan 3713fa5c9f Prevent CDR backends from unregistering while billing data is in flight
This patch makes it so that CDR backends cannot be unregistered while active
CDR records exist. This helps to prevent billing data from being lost during
restarts and shutdowns.

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

Merged revisions 402081 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-27 20:04:17 +00:00
Matthew Jordan 2b992bc74d Make cdr_mysql compile again by not directly setting the run-time CDR object
A stray ast_cdr_setvar was missed in cdr_mysql (silly addons). This has now
been refactored to not set the property, as the property would have been set
on a run-time object that was already dispatched to the backend. The module
simply remembers the value it wanted to set and writes it to MySQL later
in the processing.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 03:31:19 +00:00
Matthew Jordan 6258bbe7bd Update Asterisk's CDRs for the new bridging framework
This patch is the initial push to update Asterisk's CDR engine for the new
bridging framework. This patch guts the existing CDR engine and builds the new
on top of messages coming across Stasis. As changes in channel state and bridge
state are detected, CDRs are built and dispatched accordingly. This
fundamentally changes CDRs in a few ways.
(1) CDRs are now *very* reflective of the actual state of channels and bridges.
    This means CDRs track well with what an actual channel is doing - which
    is useful in transfer scenarios (which were previously difficult to pin
    down). It does, however, mean that CDRs cannot be 'fooled'. Previous
    behavior in Asterisk allowed for CDR applications, channels, and other
    properties to be spoofed in parts of the code - this no longer works.
(2) CDRs have defined behavior in multi-party scenarios. This behavior will not
    be what everyone wants, but it is a defined behavior and as such, it is
    predictable.
(3) The CDR manipulation functions and applications have been overhauled. Major
    changes have been made to ResetCDR and ForkCDR in particular. Many of the
    options for these two applications no longer made any sense with the new
    framework and the (slightly) more immutable nature of CDRs.

There are a plethora of other changes. For a full description of CDR behavior,
see the CDR specification on the Asterisk wiki.

(closes issue ASTERISK-21196)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 03:00:38 +00:00
Tilghman Lesher 58b5edbc1e Remove some dead code and additionally handle a case that wasn't handled.
........

Merged revisions 377487 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377504 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377505 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 01:29:32 +00:00
Terry Wilson dd9405db05 Fix setting CDR variables in the hangup extension
A previous CDR fix for setting CDR variables during a bridge via
custom dialplan features broke setting CDR variables in the
hangup extension. This patch fixes the issue.

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

Merged revisions 358978 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 358989 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-28 19:39:24 +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
Tilghman Lesher fbe3c85dee Merged revisions 316429 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316429 | tilghman | 2011-05-03 19:12:25 -0500 (Tue, 03 May 2011) | 7 lines
  
  Escape column names in case they contain illegal characters ('-') or reserved words.
  
  (closes issue #19063)
   Reported by: festr
   Patches: 
         patch uploaded by festr (license 443)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-04 00:13:23 +00:00
Tilghman Lesher 3731fd9ccc Merged revisions 312286,312288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r312286 | tilghman | 2011-04-01 05:44:33 -0500 (Fri, 01 Apr 2011) | 2 lines
  
  Reload must react correctly against a possibly changed table, so dropping the conditional reload flag.
................
  r312288 | tilghman | 2011-04-01 05:58:45 -0500 (Fri, 01 Apr 2011) | 21 lines
  
  Merged revisions 312287 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r312287 | tilghman | 2011-04-01 05:51:24 -0500 (Fri, 01 Apr 2011) | 14 lines
    
    Merged revisions 312285 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r312285 | tilghman | 2011-04-01 05:36:42 -0500 (Fri, 01 Apr 2011) | 7 lines
      
      Found some leaking file descriptors while looking at ast_FD_SETSIZE dead code.
      
      (issue #18969)
       Reported by: oej
       Patches: 
             20110315__issue18969__14.diff.txt uploaded by tilghman (license 14)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-01 10:59:32 +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
Tilghman Lesher b4504ada8b Permit dates and times to be stored in timezones other than the default (typically, UTC)
(closes issue #16401)
 Reported by: lordmortis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-11 21:03:46 +00:00
Olle Johansson 5fcf1c9268 If CDR logging is disabled, it's considered a FAILURE
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 09:22:04 +00:00
Tilghman Lesher c0b3c923a4 Fix various problems detected with Valgrind.
* chan_console accessed pvts after deallocation.
 * cdr_mysql stored a pointer that was freed by realloc()
 * The module loader did not check usecount on shutdown, which led to chan_iax2
 reading a timer that was already unloaded.
 * The event subsystem sometimes creates an event with no IEs.  Due to a corner
 condition, the code would read beyond the memory boundary.
 * res_pktccops did not correctly check whether its monitor thread was started.
(closes issue #16062)
 Reported by: alexanderheinz
 Patches: 
       20091109__issue16062.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-09 07:37:52 +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
Russell Bryant 423fdaa324 Rename cdr_addon_mysql to cdr_mysql
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-30 17:09:04 +00:00