Commit Graph

352 Commits

Author SHA1 Message Date
David M. Lee 9fca378b36 Fixes for OS X
* Add some type casting so tv_usec can really be a long, instead of
   some strange platform specific type.

 * Add some .dylib style files to .gitignore.

 * Switch from using -Xlinker to -Wl,. For [reasons unknown][], newer
   versions of GCC, when compiling the Homebrew formula for Asterisk,
   are not properly passing the -Xlinker options to the linker. Given
   that -Wl, does exactly the [same thing][], and does it properly, this
   patch changes the -Xlinker options to use -Wl, instead.

 [reasons unknown]: http://bit.ly/1SUbEYx
 [same thing]: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Change-Id: Id5e6b3c6cc86282ea5fca630dc3991137c5bf4dd
2015-06-05 11:23:16 -05:00
Matt Jordan d8698b7f3f doxygen: Fix doxygen errors
This patch fixes a number of errors and warning messages in the doxygen
log. Specifically, it addresses:
* A number of files incorrectly places a '\brief' tag immediately after
  a '\file' tag. Doing so emits a warning, as '\file' takes an optional
  argument specifying which file the doxygen comment is for. As '\brief'
  is not a file, doxygen was unamused.
* A grouping of Stasis Topics and Messages in rtp_engine.h was
  incorrectly terminated. We now correctly terminate the grouping, which
  prevents members of rtp_engine.h from showing up in the wrong group.
* Group indicators which are not part of the Stasis Topics and Messages
  group were removed. Group indicators without an \addtogroup or
  \ingroup have no meaning.

Change-Id: Ia1415ffec6767e27233ae1cae5ed5970de5656d4
2015-05-19 21:11:21 -05:00
Corey Farrell 478fb4a388 MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC.
There are 3 ways that calls directly to standard allocator functions can
be dealt with:
1. Block their use, cause them to generate an error.  This is the default.
2. Replace them with the Asterisk equivalent function calls.
3. Leave them alone.

This change allows one of these 3 options to be selected by any source.
The source just needs to define ASTMM_LIBC to ASTMM_BLOCK, ASTMM_REDIRECT,
or ASTMM_IGNORE to use option 1, 2 or 3 respectively.  Normally ASTMM_BLOCK
is the correct option, so it is default when ASTMM_LIBC is not defined.
In some cases when building 3rd party code it is desirable to have it use
Asterisk functions, without changing the whole source - ASTMM_REDIRECT
accomplishes this.  When using 3rd party libraries sometimes a static
inline function will make use of malloc or free.  In these cases it may
be unsafe to replace the allocator in the header, as it's possible the
memory could be freed by the library using standard allocators.  For
those cases ASTMM_IGNORE is needed.

Change-Id: I8afef4bc7f3b93914263ae27d3a5858b69663fc7
2015-05-13 21:55:07 -04:00
Rodrigo Ramírez Norambuena 2ed5e6a9ba utils: Remove trailing whitespace
Change-Id: I4644f43a6a1ca9b5130cd2a6746772b888eb4f7a
2015-05-03 05:28:07 -04:00
Corey Farrell df6c1d755f CLI: Enable automatic references to modules.
* Pass module to ast_cli_register and ast_cli_register_multiple.
* Add a module reference before executing any CLI callback, remove
  the reference when complete.

ASTERISK-25049 #close
Reported by: Corey Farrell

Change-Id: I7aafc7c9f2b912918f28fe51d51e9e8a755750e3
2015-05-04 20:47:18 -04:00
Corey Farrell a8bfa9e104 Modules: Make ast_module_info->self available to auxiliary sources.
ast_module_info->self is often needed to register items with the core.  Many
modules have ad-hoc code to make this pointer available to auxiliary sources.
This change updates the module build process to make the needed information
available to all sources in a module.

ASTERISK-25056 #close
Reported by: Corey Farrell

Change-Id: I18c8cd58fbcb1b708425f6757becaeca9fa91815
2015-05-04 20:47:01 -04:00
David M. Lee a573b77f78 Fixing extconf compile
During the mass code deletion for clang support, a stray backslash was
left behind that was causing utils to fail to compile.

Change-Id: I60e5fa58c9a5b248bde23aaada79ff663f87a2a1
2015-04-13 14:44:44 -05: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
George Joseph b35e184d41 Add .gitignore and .gitreview files
Add the .gitignore and .gitreview files to the asterisk repo.

NB:  You can add local ignores to the .git/info/exclude file
without having to do a commit.

Common ignore patterns are in the top-level .gitignore file.
Subdirectory-specific ignore patterns are in their own .gitignore
files.

Change-Id: I842a1588ff27d8a0189f12d597f0a7af033d6c69
Tested-by: George Joseph
2015-04-11 19:43:43 -06:00
Matthew Jordan 0543879228 clang compiler warnings: Remove large chunks of unused code from extconf
This patch fixes a warning caught by clang, in which it detected that large
chunks of extconf were unused. Frankly, I wish we could pretend that all of
extconf was unused, but alas, that is not yet the case.

A few extraneous functions in the parking tests were removed as well, for
the same reason.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4553.patch submitted by dkdegroot (License 6600)
........

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

Merged revisions 434097 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 18:18:32 +00:00
Matthew Jordan d2776d4d45 clang compiler warnings: Fix a variety of "unused" warnings
This patch fixes the -Wunused-value -Wunused-variable -Wunused-const-variable
errors caught by clang. Specifically:

* apps/app_queue.c: removed unused qpm_cmd_usage[], qum_cmd_usage[],
                    qsmp_cmd_usage[]
* cel/cel_sqlite3_custom.c: removed unused name[] = "cel_sqlite3_custom"
* channels/chan_pjsip.c: removed unused desc[] = "PJSIP Channel"
* codecs/gsm/src/gsm_create.c: removed unused ident[] = "$Header$"
* funcs/func_env.c:729: Fixed ast_str_append_substr.
* main/editline/np/strlcat.c: removed unused rcsid variable
* main/editline/np/strlcpy.c: removed unused rcsid variable
* main/security_events.c: removed unused TIMESTAMP_STR_LEN
* utils/conf2ael.c: removed unused cfextension_states
* utils/extconf.c: removed unused cfextension_states

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4526.patch submitted by dkdegroot (License 6600)
........

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

Merged revisions 433694 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:56:43 +00:00
Matthew Jordan e9520dbe0d clang compiler warnings: Fix -Wparantheses-equality warnings
Clang will treat ((a == b)) as a warning, as it reasonably expects that the
developer may have intended to write (a == b) or ((a = b)). This patch cleans
up all instances where equality, not assignment, was intended between two
parantheses.

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

ASTERISK-24917
Repoted by: dkdegroot
patches:
  rb4531.patch submitted by dkdegroot (License 6600)
........

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

Merged revisions 433688 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:41:24 +00:00
Corey Farrell 554eb74516 Fix compile errors caused by r4500 / r4501.
* Add ast_register_cleanup to utils/clicompat.c to deal with
  any utils that copy sources from main.
* Asterisk 13+: remove unused variables from core_local.c.

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

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

Merged revisions 433500 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-26 23:09:04 +00:00
Walter Doekes 8b6ecc449c Fix printf problems with high ascii characters after r413586 (1.8).
In r413586 (1.8) various casts were added to silence gcc 4.10 warnings.
Those fixes included things like:

    -out += sprintf(out, "%%%02X", (unsigned char) *ptr);
    +out += sprintf(out, "%%%02X", (unsigned) *ptr);

That works for low ascii characters, but for the high range that yields
e.g. FFFFFFC3 when C3 is expected.

This changeset:
- fixes those casts to use the 'hh' unsigned char modifier instead
- consistently uses %02x instead of %2.2x (or other non-standard usage)
- adds a few 'h' modifiers in various places
- fixes a 'replcaes' typo
- dev/urandon typo (in 13+ patch)

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

ASTERISK-24619 #close
Reported by: Stefan27 (on IRC)
........

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

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

Merged revisions 429675 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-17 10:23:32 +00:00
Walter Doekes 37179a2b1f core: Don't allow free to mean ast_free (and malloc, etc..).
This gets rid of most old libc free/malloc/realloc and replaces them
with ast_free and friends. When compiling with MALLOC_DEBUG you'll
notice it when you're mistakenly using one of the libc variants. For
the legacy cases you can define WRAP_LIBC_MALLOC before including
asterisk.h.

Even better would be if the errors were also enabled when compiling
without MALLOC_DEBUG, but that's a slightly more invasive header
file change.

Those compiling addons/format_mp3 will need to rerun
./contrib/scripts/get_mp3_source.sh.

ASTERISK-24348 #related
Review: https://reviewboard.asterisk.org/r/4015/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-26 14:41:38 +00:00
Matthew Jordan 97834718c2 Remove many deprecated modules
Billing records are fair,
To get paid is quite bright,
You should really use ODBC;
Good-bye cdr_sqlite.

Microsoft did once push H.323,
Hell, we all remember NetMeeting.
But try to compile chan_h323 now
And you will take quite a beating.

The XMPP and SIP war was fierce,
And in the distant fray
Was birthed res_jabber/chan_jingle;
But neither to stay.

For everyone did care and chase what Google professed.
"Free Internet Calling" was what devotees cried,
But Google did change the specs so often
That the developers were happy the day chan_gtalk died.

And then there was that odd application
Dedicated to the Polish tongue.
app_saycountpl was subsumed by Say;
One could say its bell was rung.

To read and parse a file from the dialplan
You could (I guess) use an application.
app_readfile did fill that purpose, but I think
A function is perhaps better in its creation.

Barging is rude, I'm not sure why we do it.
Inwardly, the caller will probably sigh.
But if you really must do it,
Don't use app_dahdibarge, use ChanSpy.

We all despise the sound of tinny robots
It makes our queues so cold.
To control such an abomination
It's better to not use Wait/SetMusicOnHold.

It's often nice to know properties of a channel
It makes our calls right
We have a nice function called CHANNEL
And so SIPCHANINFO is sent off into the night.

And now things get odd;
Apparently one could delimit with a colon
Properties from the SIPPEER function!
Commas are in; all others are done.

Finally, a word on pipes and commas.
We're sorry. We can't say it enough.
But those compatibility options in asterisk.conf;
To maintain them forever was just too tough.

This patch removes:

* cdr_sqlite
* chan_gtalk
* chan_jingle
* chan_h323
* res_jabber
* app_saycountpl
* app_readfile
* app_dahdibarge

It removes the following applications/functions:

* WaitMusicOnHold
* SetMusicOnHold
* SIPCHANINFO

It removes the colon delimiter from the SIPPEER function.

Finally, it also removes all compatibility options that were configurable from
asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-04 13:26:37 +00:00
Richard Mudgett 43bcf51204 utils dir: Remove no longer needed traces of refcounter except in the clean make target.
* Removed no longer needed files from the svn:ignore property to make them visible.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-11 18:04:41 +00:00
Matthew Jordan 4f30c7e91f main/astobj2: Make REF_DEBUG a menuselect item; improve REF_DEBUG output
This patch does the following:
(1) It makes REF_DEBUG a meneselect item. Enabling REF_DEBUG now enables
    REF_DEBUG globally throughout Asterisk.
(2) The ref debug log file is now created in the AST_LOG_DIR directory.
    Every run will now blow away the previous run (as large ref files
    sometimes caused issues). We now also no longer open/close the file
    on each write, instead relying on fflush to make sure data gets written
    to the file (in case the ao2 call being performed is about to cause a
    crash)
(3) It goes with a comma delineated format for the ref debug file. This
    makes parsing much easier. This also now includes the thread ID of the
    thread that caused ref change.
(4) A new python script instead for refcounting has been added in the
    contrib/scripts folder.
(5) The old refcounter implementation in utils/ has been removed.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-11 02:59:19 +00:00
Richard Mudgett 03beadb6e9 internal_timing: Remove the option and always make it enabled if a timing module is loaded.
The masquerade supertest frequently fails because either the local channel
chain doesn't completely optimize out or the DTMF handshake doesn't
completely get accross.  Local channel optimization requires frames
flowing to trigger when optimization can happen.  When optimization
happens the media frame that triggered the optimization is dropped.
Sending DTMF requires frames to flow in the other direction for timing
purposes while sending nothing.  If internal timing is not enabled when
MOH is playing, Asterisk switches to received timing when an audio frame
is received.  With optimization dropping media frames and MOH not sending
frames unless it receives frames, occasionaly there are no more frames
being passed and the test fails.

* The asterisk command line -I option and the asterisk.conf
internal_timing option are removed.  Asterisk now always uses internal
timing when needed if any timing module is loaded.  The issue
ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken
if other internal timing modules besides DAHDI are used.  The
ast_read_generator_actions() now only does received timing if it has no
choice for frame generators like MOH, silence, and playback streaming.

* Cleaned up some code dealing with frame generators in
ast_deactivate_generator(), generator_write_format_change(),
ast_activate_generator(), and ast_channel_stop_silence_generator().

* Removed ast_internal_timing_enabled(), AST_OPT_FLAG_INTERNAL_TIMING, and
ast_opt_internal_timing.

ASTERISK-22846 #close
Reported by: Matt Jordan

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-04 19:19:55 +00:00
Richard Mudgett c8ebf3e3c7 Revert -r411073. It didn't help and blew up the system.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-25 15:47:17 +00:00
Richard Mudgett 89e12de79d locking: Add temporary sanity checks.
Add some temporary sanity checks to hunt for locking problems with the
masquerade supertest.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411073 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-24 23:36:36 +00:00
Sean Bright b44d324891 Make the AEL load process less chatty.
Switched a bunch of LOG_NOTICEs to ast_debug.  This time without breaking the
build.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-21 15:50:11 +00:00
David M. Lee be3cab0a3a Fix memory stomping bug in astman.
This memset complained in dev mod on my Ubuntu box. The memset is both
unnecessary and dangerous. At this point, m hasn't been initialized
yet, so the memset will write off to whatever address happens to be
on the stack at the time.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-27 16:26:18 +00:00
Corey Farrell e468e73b9e Remove extra defines of AST_PBX_MAX_STACK.
* Ensure AST_PBX_MAX_STACK is only defined in extconf.h and pbx.h.
* Fix incorrect function parameters in utils/extconf.c.

(closes issue ASTERISK-23141)
Reported by: Maxim
Review: https://reviewboard.asterisk.org/r/3241/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-22 02:31:04 +00:00
Scott Griepentrog 64e2e1d5d8 pbx.c: Pre-initialize timezone to avoid crash on destroy
In ast_build_timing, initialize the timezone value to NULL
in order to avoid deferencing an uninitialized value later
when calling ast_destroy_timing.  The timezone value could
be uninitialized if ast_build_timing were to fail due to a
zero length time string.

(closes issue ASTERISK-22861)
Reported by: Sebastian Murray-Roberts
Review: https://reviewboard.asterisk.org/r/3134/
Patches:
     ast_build_timing-initialize-timezone.patch uploaded by coreyfarrell (license 5909)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 22:24:39 +00:00
Kevin Harwell 2564ed26f7 app_dahdiras: Use waitpid instead of wait4.
Several places in the code were using wait4 while other places were using
waitpid.  This change makes all places use waitpid in order to make things
more consistent and since the 'rusage' object passed in/out of wait4 was
never used.

(closes issue ASTERISK-22557)
Reported by: YvesGael
Patches:
     asterisk-11.5.1-wait4.patch uploaded by hurdman (license 6537)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-08 14:58:13 +00:00
Jonathan Rose e920fc0669 Put clicompat-r2.patch back in
We've figured out how to resolve the problems this was causing in 12/trunk,
so this can go back in now.

(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
    clicompat-r2.patch uploaded by coreyfarrell (license 5909)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25 17:32:17 +00:00
Jonathan Rose b7763842a7 revert clicompat-r2.patch from r401704
Patch caused the following build errors against testsuite
https://bamboo.asterisk.org/bamboo/browse/AST-ATRUNKBUILD4-244

(issue ASTERISK-22467)
Reported by: Corey Farrell
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25 16:59:33 +00:00
Jonathan Rose 4ca0f222e8 memory leaks: Memory leak cleanup patch by Corey Farrell (second set)
Also covers ast_app_parse_timelen-fail-zero-length.patch, but the patch was
replaced with one of my own.

(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
    chan_dahdi-cleanup_push.patch uploaded by coreyfarrell (license 5909)
    clicompat-r2.patch uploaded by coreyfarrell (license 5909)
    codecs-ilbc-doCPLC.patch uploaded by coreyfarrell (license 5909)
    data-cleanup-test-registration.patch uploaded by coreyfarrell (license 5909)
    main-asterisk-kill-listener.patch uploaded by coreyfarrell (license 5909)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-24 17:00:27 +00:00
David M. Lee 87cf916cdb Fixed utils directory breakage from r398748, this time with extra hate.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-10 17:50:13 +00:00
David M. Lee 6a1f3d626b Fixed utils directory breakage from r398648
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-10 17:26:19 +00:00
Walter Doekes ccdfe67bf2 Check result of ast_var_assign() calls for memory allocation failure.
We try to keep the system running even when all available memory is
spent.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06 08:36:15 +00:00
David M. Lee 357b275239 Fix res_ari_asterisk load issue
The new res_ari_asterisk.so module presents several config options
from asterisk main. Unfortunately, they aren't exported, so the module
won't load on Linux.

This patch renames the variables, adding the ast_ prefix so they will
be exported.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 14:35:00 +00:00
Kinsey Moore 41d6be2432 Move ast_str_container_alloc and friends
This moves ast_str_container_alloc, ast_str_container_add,
ast_str_container_remove, and related private functions into
strings.c/h since they really don't belong in astobj2.c/h.

As a result of this move, utils also had to be updated.

Review: https://reviewboard.asterisk.org/r/2719/
(closes issue ASTERISK-22041)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 14:08:34 +00:00
David M. Lee 5601b0f50c Fixed warning in astman for gcc-4.8.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395984 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 16:56:51 +00:00
Matthew Jordan 988295c6a8 Make the utils directory compile... again.
Utils is a source folder that lies,
eventually all developers will cry,
"I know I must maintain it,
But really with this last commit
I can kiss my software ethics good-bye."



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-13 21:53:45 +00:00
Matthew Jordan c43f380d03 Add backtrace generation to MALLOC_DEBUG memory corruption reports
This patch allows astmm to access the backtrace generation code in Asterisk.
When memory is allocated, a backtrace is created and stored with the memory
region that tracks the allocation. If a memory corruption is detected, the
backtrace is printed to the astmm log. The backtrace will make use of the
BETTER_BACKTRACES build option if available.

As a result, this patch moves the backtrace generation code into its own file
and uses the non-wrapped versions of the C library memory allocation routines.
This allows the memory allocation code to safely use the backtrace generation
routines without infinitely recursing.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-08 22:09:07 +00:00
Matthew Jordan e5ad3cdc3a Update utils Makefile to handle r387294
Alec's patch that added the Asterisk version to 'core show locks' angered the
items in utils, as they exist somewhat outside of the Asterisk build system.
Some day, this Makefile should get nuked from high orbit, but for now, include
version.c in its list of stuff to pile in.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 17:15:46 +00:00
David M. Lee 8e07045eb0 Fixed extconf.c breakage introduced in r376306.
To quote wdoekes:
> Note that I'm not confirming legitimacy of having that file in tree at
> all. Is anyone using aelparse/conf2ael?
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-16 00:15:30 +00:00
David M. Lee 752ffc69d4 Migrate hashtest/hashtest2 to be unit tests.
Both hashtest and hashtest2 are manual testing apps that thrash hash
tables (hashtab and ao2 containers, respectively), by spinning up
several threads that randomly insert, delete, lookup and iterate over
the hash table. If the app doesn't crash, the hash table probably passes
the test. Those utils are not a part of the typical Asterisk build, so
they do not usually get compiled. This all makes them less that useful.

This patch removes those manual test programs and replaces them with
Asterisk unit test modules (test_{hashtab,astobj2}_thrash.so). It also
attempts to make the tests more deterministic.

* Rather than spinning up some number of threads that operate on the
  hash table randomly, spin up four threads that concurrenly add,
  remove, lookup and iterate over the hash table.
* Each thread checks the state of the hash table both during and after
  execution, and indicates a test failure if things are not as expected.
* Each thread times out after 60 seconds to prevent deadlocking the unit
  test run.

(closes issue ASTERISK-20505)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2189/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-16 00:08:00 +00:00
Andrew Latham 00a9699e05 Doxygen Updates
Update and extend the configuration_file group and enable linking.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:57:42 +00:00
Andrew Latham b106b77041 Title update
Update title that was left behind many years ago. Used revision 6596 as my guide for what it should be.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:56:13 +00:00
Matthew Jordan 0be8d5c64c Modify hashtest2 to compile after r374213. Someone, somewhere, may care.
Because hashtest2 has to provide symbols for things in asterisk that items
it includes may use, when astobj2 decided to use ast_register_atexit it needed
to provide a declaration for that as well.  Otherwise - no linky.

On a related note, ASTERISK-20505 was filed to convert hashtest/hashtest2 into
actual unit tests, so we don't run into this problem again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 20:45:22 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Matthew Jordan 294365edd2 Update module support level on a variety of modules and compiler options
Some core support modules and compiler options were no longer tagged with a
module support level.  This patch adds 'core' back to those options.

Note that this patch modifies a few of the patches provided by Andrew Latham
slightly.  res_curl and res_fax are both 'core' supported modules.

(closes issue ASTERISK-20215)
Reported by: Andrew Latham
Tested by: mjordan
Patches:
  astcanary.diff (license #5985) uploaded by Andrew Latham
  cflagsxml.diff (license #5985) uploaded by Andrew Latham
  curl_fax.diff (license #5985) uploaded by Andrew Latham
  soundsxml.diff (license #5985) uploaded by Andrew Latham
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-18 01:14:42 +00:00
Kinsey Moore ee0d991102 Revert alloca changes for utils
These changes were a tad overzealous in the utils directory.
Unfortunately, these don't compile with a "make".
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-01 02:26:53 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Matthew Jordan f78290068a Fix a variety of potential buffer overflows
* chan_mobile: Fixed an overrun where the cind_state buffer (an integer array
  of size 16) would be overrun due to improper bounds checking. At worst, the
  buffer can be overrun by a total of 48 bytes (assuming 4-byte integers),
  which would still leave it within the allocated memory of struct hfp.  This
  would corrupt other elements in that struct but not necessarily cause any
  further issues.

* app_sms: The array imsg is of size 250, while the array (ud) that the data
  is copied into is of size 160.  If the size of the inbound message is 
  greater then 160, up to 90 bytes could be overrun in ud.  This would corrupt
  the user data header (array udh) adjacent to ud.

* chan_unistim: A number of invalid memmoves are corrected.  These would move
  data (which may or may not be valid) into the ends of these buffers.

* asterisk: ast_console_toggle_loglevel does not check that the console log
  level being set is less then or equal to the allowed log levels of 32.

* format_pref: In ast_codec_pref_prepend, if any occurrence of the specified
  codec is not found, the value used to index into the array pref->order
  would be one greater then the maximum size of the array.

* jitterbuf: If the element being placed into the jitter buffer lands in the
  last available slot in the jitter history buffer, the insertion sort attempts
  to move the last entry in the buffer into one slot past the maximum length
  of the buffer.  Note that this occurred for both the min and max jitter
  history buffers.

* tdd: If a read from fsk_serial returns a character that is greater then 32,
  an attempt to read past one of the statically defined arrays containing the
  values that character maps to would occur.

* localtime: struct ast_time and tm are not the same size - ast_time is larger,
  although it contains the elements of tm within it in the same layout.  Hence,
  when using memcpy to copy the contents of tm into ast_time, the size of tm
  should be used, as opposed to the size of ast_time.

* extconf: this treats ast_timing's minmask array as if it had a length of 48,
  when it has defined the size of the array as 24.  pbx.h defines minmask as
  having a size of 48.

(issue ASTERISK-19668)
Reported by: Matt Jordan
........

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

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19 02:40:55 +00:00
Russell Bryant c1d9194482 Fix incorrect sizeof() in astman.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 00:45:02 +00:00