dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

315 Commits

Author SHA1 Message Date
seanbright 78c6aec64b 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: http://svn.digium.com/svn/asterisk/trunk@203846 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 22:08:05 +00:00
russell ac3b35dcc7 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: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:28:53 +00:00
seanbright 8e9ec1d622 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: http://svn.digium.com/svn/asterisk/trunk@202887 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-24 13:47:55 +00:00
seanbright 3c7fb49836 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: http://svn.digium.com/svn/asterisk/trunk@202417 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-22 16:09:50 +00:00
russell 11b12267fe Note a bug in cdr_sqlite3_custom so I don't forget about it.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@202301 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-21 16:36:55 +00:00
russell 8e7f647630 Fix possibility of crashiness during reload in custom fields handling.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@202262 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-21 16:11:48 +00:00
russell caf4195f55 Standardize return values of load_config() so reload() doesn't report an error on success.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@202258 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-21 16:00:23 +00:00
russell 444f87a06f Leave a note about some unsafe code in cdr_manager
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@202223 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-20 20:56:13 +00:00
russell 0699bad154 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: http://svn.digium.com/svn/asterisk/trunk@202109 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-20 14:09:40 +00:00
kpfleming 5fa0b7c277 More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200620 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 17:34:30 +00:00
seanbright 9d7571a441 Use a properly allocated channel for substitution in cdr_sqlite3_custom.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196725 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-26 13:56:30 +00:00
seanbright 8122e053ce Use a properly allocated channel for substitution in cdr_manager.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196622 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-26 12:14:14 +00:00
seanbright 91b93e83f7 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: http://svn.digium.com/svn/asterisk/trunk@196520 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-23 15:16:59 +00:00
kpfleming 230a66da7d 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: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 21:13:09 +00:00
seanbright c70e0277d9 Remove some unused code.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195279 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 17:08:25 +00:00
seanbright f4180e39d4 Const-ify a string, fix a log message, and use the correct signature for the
load_module function.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195210 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 15:55:53 +00:00
seanbright e586239816 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: http://svn.digium.com/svn/asterisk/trunk@195165 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 14:54:43 +00:00
tilghman 8fc2c0f724 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: http://svn.digium.com/svn/asterisk/trunk@191140 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 18:53:01 +00:00
russell dfc0f2488d 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: http://svn.digium.com/svn/asterisk/trunk@186230 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 02:03:48 +00:00
tilghman 6628131bf6 Backport 1.6.0 fix to trunk (failsafe if db is not loaded)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179361 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-02 17:18:48 +00:00
tilghman d532b92cd0 If config file is blank, don't load module.
(Closes issue #14563)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179161 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-27 21:32:13 +00:00
kpfleming fe480759d9 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: http://svn.digium.com/svn/asterisk/trunk@168734 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-15 20:18:53 +00:00
tilghman 9b133b4c0b When querying for the structure of the CDR table, remove the schema, if it
exists.
(Closes issue #14058)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@164349 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15 18:09:58 +00:00
tilghman a41b34a63c Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 08:36:35 +00:00
kpfleming 246ce365ae 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: http://svn.digium.com/svn/asterisk/trunk@159818 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-29 17:57:39 +00:00
twilson 1f5264224f 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: http://svn.digium.com/svn/asterisk/trunk@158374 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21 17:08:16 +00:00
twilson 9be5084204 Begin on a crusade to end trailing whitespace!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@158072 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-20 17:48:58 +00:00
twilson f93ebdba02 Fix checking for CONFIG_STATUS_FILEINVALID so that modules don't crash upon trying to parse an invalid config
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@157818 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-19 19:25:14 +00:00
tilghman 50a02870ae Allow setting static values in CDRs
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@157006 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-14 22:36:30 +00:00
kpfleming a73e71ff1e 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: http://svn.digium.com/svn/asterisk/trunk@154151 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-04 15:07:54 +00:00
seanbright fffaf0b978 Keep up with shadow warnings. One day I'll actually enable this in the Makefile.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@147457 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-08 12:15:06 +00:00
mvanbaak 7c30763fbe 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: http://svn.digium.com/svn/asterisk/trunk@146925 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06 23:14:33 +00:00
seanbright 1c21496de6 Build under dev-mode
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@142635 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12 00:49:31 +00:00
tilghman 171dc6a016 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: http://svn.digium.com/svn/asterisk/trunk@142536 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-11 21:45:07 +00:00
seanbright 706602fc52 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: http://svn.digium.com/svn/asterisk/trunk@140821 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-03 13:48:12 +00:00
tilghman 80ece487c2 Oops
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@140355 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-27 23:23:56 +00:00
tilghman 6a7394d3c3 Memory leak
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@139707 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-24 16:26:48 +00:00
tilghman 980a351bb3 Eliminate open coding of ast_str
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@139704 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-24 16:23:15 +00:00
seanbright f0179a2d10 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: http://svn.digium.com/svn/asterisk/trunk@137933 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-14 18:47:28 +00:00
seanbright 1a0b3cb4c4 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: http://svn.digium.com/svn/asterisk/trunk@137780 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-14 15:03:03 +00:00
seanbright cbb6473eba Use the ast_vasprintf macro instead of vasprintf directly.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137403 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-13 14:22:47 +00:00
seanbright ff2f832957 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: http://svn.digium.com/svn/asterisk/trunk@137203 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-11 14:25:15 +00:00
tilghman 777979c9d9 Fix runtime symbol error
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@136406 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-07 15:10:53 +00:00
seanbright 4965ac5e36 More from the resolve-shadow-warnings branch. This time the cdr/ directory.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@136300 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-07 00:52:23 +00:00
bbryant b2c8abebab 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: http://svn.digium.com/svn/asterisk/trunk@132050 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18 17:55:41 +00:00
seanbright 745361390b Fix a bug I noticed while doing the previous merge
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127398 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-02 14:30:09 +00:00
seanbright 0673fac47e 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: http://svn.digium.com/svn/asterisk/trunk@126513 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-30 11:57:42 +00:00
seanbright 8530e0fda8 This was bogus, need to find a better way.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@126319 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-29 13:20:01 +00:00
seanbright 76942ba4d3 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: http://svn.digium.com/svn/asterisk/trunk@126312 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-29 13:11:55 +00:00
seanbright e4e30b0abe Quote column names when inserting CDRs into postgres to avoid conflicts
with reserved words.

(closes issue #12947)
Reported by: panolex


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@126274 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-29 12:06:46 +00:00