Commit Graph

142 Commits

Author SHA1 Message Date
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
Tilghman Lesher 4c94d1ee23 Oops, merge reverted this fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 21:11:09 +00:00
Tilghman Lesher 832d1296c6 Remove the old stub files, preferring the optional_api method.
(closes issue #17475)
 Reported by: tilghman
 
Review: https://reviewboard.asterisk.org/r/695/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 20:48:59 +00:00
Kevin P. Fleming 8e7d01d484 Don't try to call an embedded module's backup_globals() function until
after confirming it exists.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 20:15:48 +00:00
Matthew Nicholson 7f145eeb1b Merged revisions 275182 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275182 | mnicholson | 2010-07-09 13:23:23 -0500 (Fri, 09 Jul 2010) | 2 lines
  
  give a better error message when attempting to unload a module that is not loaded
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 18:24:03 +00:00
Matthew Nicholson 3fd53f575c Merged revisions 275143 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275143 | mnicholson | 2010-07-09 12:50:05 -0500 (Fri, 09 Jul 2010) | 2 lines
  
  don't unload modules that returned AST_MODULE_LOAD_DECLINE when they were loaded
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 17:50:45 +00:00
Mark Michelson 6bb45831eb Fix transcode_via_sln option with SIP calls and improve PLC usage.
From reviewboard:
The problem here is a bit complex, so try to bear with me...

It was noticed by a Digium customer that generic PLC (as configured in
codecs.conf) did not appear to actually be having any sort of benefit when
packet loss was introduced on an RTP stream. I reproduced this issue myself
by streaming a file across an RTP stream and dropping approx. 5% of the
RTP packets. I saw no real difference between when PLC was enabled or disabled
when using wireshark to analyze the RTP streams.

After analyzing what was going on, it became clear that one of the problems
faced was that when running my tests, the translation paths were being set
up in such a way that PLC could not possibly work as expected. To illustrate,
if packets are lost on channel A's read stream, then we expect that PLC will
be applied to channel B's write stream. The problem is that generic PLC can
only be done when there is a translation path that moves from some codec to
SLINEAR. When I would run my tests, I found that every single time, read
and write translation paths would be set up on channel A instead of channel
B. There appeared to be no real way to predict which channel the translation
paths would be set up on.

This is where Kevin swooped in to let me know about the transcode_via_sln
option in asterisk.conf. It is supposed to work by placing a read translation
path on both channels from the channel's rawreadformat to SLINEAR. It also
will place a write translation path on both channels from SLINEAR to the
channel's rawwriteformat. Using this option allows one to predictably set up
translation paths on all channels. There are two problems with this, though.
First and foremost, the transcode_via_sln option did not appear to be working
properly when I was placing a SIP call between two endpoints which did not
share any common formats. Second, even if this option were to work, for PLC
to be applied, there had to be a write translation path that would go from
some format to SLINEAR. It would not work properly if the starting format
of translation was SLINEAR.

The one-line change presented in this review request in chan_sip.c fixed the
first issue for me. The problem was that in sip_request_call, the
jointcapability of the outbound channel was being set to the format passed to
sip_request_call. This is nativeformats of the inbound channel. Because of this,
when ast_channel_make_compatible was called by app_dial, both channels already
had compatibly read and write formats. Thus, no translation path was set up at
the time. My change is to set the jointcapability of the sip_pvt created during
sip_request_call to the intersection of the inbound channel's nativeformats and
the configured peer capability that we determined during the earlier call to
create_addr. Doing this got the translation paths set up as expected when using
transcode_via_sln.

The changes presented in channel.c fixed the second issue for me. First and
foremost, when Asterisk is started, we'll read codecs.conf to see the value of
the genericplc option. If this option is set, and ast_write is called for a
frame with no data, then we will attempt to fill in the missing samples for
the frame. The implementation uses a channel datastore for maintaining the
PLC state and for creating a buffer to store PLC samples in. Even when we
receive a frame with data, we'll call plc_rx so that the PLC state will have
knowledge of the previous voice frame, which it can use as a basis for when
it comes time to actually do a PLC fill-in.

So, reviewers, now I ask for your help. First off, there's the one line change
in chan_sip that I have put in. Is it right? By my logic it seems correct, but
I'm sure someone can tell me why it is not going to work. This is probably the
change I'm least concerned about, though. What concerns me much more is the
set of changes in channel.c. First off, am I even doing it right? When I run
tests, I can clearly see that when PLC is activated, I see a significant increase
in RTP traffic where I would expect it to be. However, in my humble opinion, the
audio sounds kind of crappy whenever the PLC fill-in is done. It sounds worse to
me than when no PLC is used at all. I need someone to review the logic I have used
to be sure that I'm not misusing anything. As far as I can see my pointer arithmetic
is correct, and my use of AST_FRIENDLY_OFFSET should be correct as well, but I'm
sure someone can point out somewhere where I've done something incorrectly.

As I was writing this review request up, I decided to give the code a test run under
valgrind, and I find that for some reason, calls to plc_rx are causing some invalid
reads. Apparently I'm reading past the end of a buffer somehow. I'll have to dig around
a bit to see why that is the case. If it's obvious to someone reviewing, speak up!

Finally, I have one other proposal that is not reflected in my code review. Since
without transcode_via_sln set, one cannot predict or control where a translation
path will be up, it seems to me that the current practice of using PLC only when
transcoding to SLINEAR is not useful. I recommend that once it has been determined
that the method used in this code review is correct and works as expected, then
the code in translate.c that invokes PLC should be removed.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 21:29:08 +00:00
Paul Belanger 7d53dc86d6 Notify CLI when modules is loaded / unloaded
(closes issue #17308)
Reported by: pabelanger
Patches:
      cli.modules.patch uploaded by pabelanger (license 224)
Tested by: pabelanger, russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-12 19:59:16 +00:00
Tilghman Lesher bbb5acc65e RTP documentation states that you can pass NULL as the module, so make sure that's really the case.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 07:01:13 +00:00
Jeff Peeler a170cd28e0 Add new option to asterisk.conf (lockconfdir) to protect conf dir during reloads
(closes issue #16358)
Reported by: raarts
Patches: 
      lockconfdir.diff uploaded by raarts (license 937)
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:29:49 +00:00
Olle Johansson ebc3aff1c3 Fixing trunk in a way so that it compiles again.
Thanks, Philippe :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 10:53:14 +00:00
Olle Johansson 75c015bfff Add the capability to require a module to be loaded, or else Asterisk exits.
Review: https://reviewboard.asterisk.org/r/426/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 08:52:28 +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
Terry Wilson ad37760473 Make LOAD_ORDER actually work
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-21 03:48:54 +00:00
David Brooks d81d6d3415 Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 16:33:50 +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
David Vossel 87c8658912 attempting to load running modules
Modules placed in the priority heap for loading were not properly removed from the linked list.  This resulted in some modules attempting to load twice.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 15:33:35 +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
David Vossel d532cbcd8a module load priority
This patch adds the option to give a module a load priority. The value represents the order in which a module's load() function is initialized.  The lower the value, the higher the priority.  The value is only checked if the AST_MODFLAG_LOAD_ORDER flag is set.  If the AST_MODFLAG_LOAD_ORDER flag is not set, the value will never be read and the module will be given the lowest possible priority
on load.  Since some modules are reliant on a timing interface, the timing modules have been given a high load priorty.

(closes issue #15191)
Reported by: alecdavis
Tested by: dvossel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-09 16:22:04 +00:00
Sean Bright befad10893 Merged revisions 199022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199022 | seanbright | 2009-06-04 10:14:57 -0400 (Thu, 04 Jun 2009) | 40 lines
  
  Safely handle AMI connections/reload requests that occur during startup.
  
  During asterisk startup, a lock on the list of modules is obtained by the
  primary thread while each module is initialized.  Issue 13778 pointed out a
  problem with this approach, however.  Because the AMI is loaded before other
  modules, it is possible for a module reload to be issued by a connected client
  (via Action: Command), causing a deadlock.
  
  The resolution for 13778 was to move initialization of the manager to happen
  after the other modules had already been lodaded.  While this fixed this
  particular issue, it caused a problem for users (like FreePBX) who call AMI
  scripts via an #exec in a configuration file (See issue 15189).
  
  The solution I have come up with is to defer any reload requests that come in
  until after the server is fully booted.  When a call comes in to
  ast_module_reload (from wherever) before we are fully booted, the request is
  added to a queue of pending requests.  Once we are done booting up, we then
  execute these deferred requests in turn.
  
  Note that I have tried to make this a bit more intelligent in that it will not
  queue up more than 1 request for the same module to be reloaded, and if a
  general reload request comes in ('module reload') the queue is flushed and we
  only issue a single deferred reload for the entire system.
  
  As for how this will impact existing installations - Before 13778, a reload
  issued before module initialization was completed would result in a deadlock.
  After 13778, you simply couldn't connect to the manager during startup (which
  causes problems with #exec-that-calls-AMI configuration files).  I believe this
  is a good general purpose solution that won't negatively impact existing
  installations.
  
  (closes issue #15189)
  (closes issue #13778)
  Reported by: p_lindheimer
  Patches:
        06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71)
  Tested by: p_lindheimer, seanbright
  
  Review: https://reviewboard.asterisk.org/r/272/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-04 14:31:24 +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
Joshua Colp 63de834395 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

Review: http://reviewboard.digium.com/r/209/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:20:52 +00:00
Russell Bryant 4210f17abb Merged revisions 183241 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r183241 | russell | 2009-03-19 12:52:52 -0500 (Thu, 19 Mar 2009) | 2 lines

Remove the use of RTLD_NOLOAD, as it is not behaving like expected.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 18:00:15 +00:00
Russell Bryant 4ec301360c Merge a large set of updates to the Asterisk indications API.
This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

Review: http://reviewboard.digium.com/r/149/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 20:41:24 +00:00
Tilghman Lesher 08af5bb312 Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating
when a file is invalid from when a file is missing.  This is most important when
we have two configuration files.  Consider the following example:

Old system:
sip.conf     users.conf     Old result               New result
========     ==========     ==========               ==========
Missing      Missing        SIP doesn't load         SIP doesn't load
Missing      OK             SIP doesn't load         SIP doesn't load
Missing      Invalid        SIP doesn't load         SIP doesn't load
OK           Missing        SIP loads                SIP loads
OK           OK             SIP loads                SIP loads
OK           Invalid        SIP loads incompletely   SIP doesn't load
Invalid      Missing        SIP doesn't load         SIP doesn't load
Invalid      OK             SIP doesn't load         SIP doesn't load
Invalid      Invalid        SIP doesn't load         SIP doesn't load

So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing with
an error, which may cause some calls not to get processed.  Worse yet, the old
system would do this with no indication that anything was even wrong.

(closes issue #10690)
 Reported by: dtyoo
 Patches: 
       20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 23:30:03 +00:00
Kevin P. Fleming 6291cd19bf remove remaining Zaptel references in various places
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-28 16:42:00 +00:00
Kevin P. Fleming 9a08061ea3 Merged revisions 131921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r131921 | kpfleming | 2008-07-18 11:15:41 -0500 (Fri, 18 Jul 2008) | 2 lines

remove the dlfcn compatibility stuff, because no platforms that Asterisk currently runs on it use it, and it doesn't build anyway

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 16:16:12 +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 90d75af346 Conditionally load the AGI command gosub, depending on whether or not res_agi
has been loaded, fix a return value in the loader, and ensure that the help
workhorse header does not print on load.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 15:58:11 +00:00
Tilghman Lesher ef4eff9a9b Add the "config reload <conffile>" command, which allows you to tell Asterisk
to reload any file that references a given configuration file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 18:39:06 +00:00
Tilghman Lesher 10609251f9 Revert several changes from revision 102525, as the changes were not
compatible, and, in fact, introduced regressions.
(Closes issue #12190)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 05:46:39 +00:00
Tilghman Lesher 8a411ccf83 Create a centralized configuration option for silencethreshold
(closes issue #11236)
 Reported by: philipps
 Patches: 
       20080218__bug11236.diff.txt uploaded by Corydon76 (license 14)
 Tested by: philipps


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 16:23:44 +00:00
Tilghman Lesher cfc1df4c1a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:04:29 +00:00
Joshua Colp b868d44342 Merged revisions 104596 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r104596 | file | 2008-02-27 13:07:33 -0400 (Wed, 27 Feb 2008) | 4 lines

Use the lock (which already existed, it just wasn't used) on the updaters list to protect the contents instead of the overall module list lock.
(closes issue #12080)
Reported by: ChaseVenters

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 17:12:08 +00:00
Joshua Colp ee5e39e04b Add a log message that appears when you try to unload a module that isn't loaded.
(closes issue #12033)
Reported by: jamesgolovich
Patches:
      asterisk-loader.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19 21:54:09 +00:00
Russell Bryant 75fd299f1b Merged revisions 103728 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103728 | russell | 2008-02-15 13:50:11 -0600 (Fri, 15 Feb 2008) | 4 lines

In the case that you try to directly reload a module has returned 
AST_MODULE_LOAD_DECLINE, log a message indicating that the module is not fully
initialized and must be initialized using "module load".

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 19:50:47 +00:00
Russell Bryant 71646d663b Merged revisions 103726 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103726 | russell | 2008-02-15 12:33:29 -0600 (Fri, 15 Feb 2008) | 6 lines

Don't attempt to execute the reload callback for a module that returned
AST_MODULE_LOAD_DECLINE.  This fixes a crash that was reported against
chan_console in trunk.

(closes issue #11953, reported by junky, fixed by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 18:34:42 +00:00
Mark Michelson fe9821cc10 Get rid of any remaining ast_verbose calls in the code in favor of
ast_verb

(closes issue #11934)
Reported by: mvanbaak
Patches:
      20080205_astverb-2.diff.txt uploaded by mvanbaak (license 7)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 23:00:15 +00:00
Jason Parker 3bd33214b9 Move code from res_features into (new file) main/features.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 23:09:11 +00:00
Joshua Colp 96f5a494cf Move ModuleLoad and ModuleCheck manager commands from loader.c to manager.c. Previously they would get registered twice because of the way manager.c operates.
(closes issue #11699)
Reported by: caio1982
Patches:
      manager_module_commands1.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-07 15:52:55 +00:00
Luigi Rizzo b9aeecdb66 some cleanup of this code while I am trying to debug a problem with
gdb dying while debugging asterisk. The problem seems to be related
with a race in the handling of module_list, which in turn is triggeded
by calling dlopen() on a system which uses initializers to create
locks.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 09:16:17 +00:00
Olle Johansson 9dc965eadd Merged revisions 91366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91366 | oej | 2007-12-06 13:54:11 +0100 (Tor, 06 Dec 2007) | 4 lines

Make sure logger is reloaded at general reload in the cli.

(Discovered during Asterisk training in Portugal)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 14:23:12 +00:00
Olle Johansson a30972ee65 More "moremanager" fixes. Manager commands to check module status.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 21:04:29 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00
Luigi Rizzo a23c055c3d move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:16:15 +00:00
Luigi Rizzo 915b97d300 move internal function declarations to include/asterisk/_private.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 22:18:21 +00:00
Kevin P. Fleming 4d522da4aa switch compile-time option checking to string storage mode in this branch too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 19:28:10 +00:00
Luigi Rizzo 9335ace850 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 19:09:03 +00:00
Luigi Rizzo 6cca49b9d0 define RTLD_LOCAL for platforms that don't have it.
This is only to complete the build, clearly the linker
behaviour will be completely different and likely to
cause trouble in those cases.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 09:51:45 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Kevin P. Fleming 547306835e Merged revisions 89325 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89325 | kpfleming | 2007-11-16 10:47:46 -0600 (Fri, 16 Nov 2007) | 4 lines

To help combat problems where people build external modules (asterisk-addons or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash.

If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 16:56:59 +00:00
Kevin P. Fleming edc78d6023 improve linked-list macros in two ways:
- the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +00:00
Luigi Rizzo d0b2d2dc62 remove a debugging message which i forgot in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 11:33:55 +00:00
Luigi Rizzo 81456f8493 Fix embedding of modules on FreeBSD:
the constructor for the list of modules was run
after the constructors for the embedded modules
(which appended entries to the list).
As a result, the list appeared empty when it was
time to use it.

On linux the order of execution of constructor
was evidently different (it may depend on the
ordering of modules in the ELF file).

This is only a workaround - there may be other
situations where the execution of constructors
causes problems, so if we manage to find a more
general solution this workaround can go away.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 17:05:13 +00:00
Kevin P. Fleming 6a0ae0aca4 merging patches that don't compile is bad... mmkay?
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 14:56:05 +00:00
Joshua Colp e4b75ab0e0 Merged revisions 86630 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r86630 | file | 2007-10-22 10:33:23 -0300 (Mon, 22 Oct 2007) | 6 lines

Fixes for building under OpenSolaris.
(closes issue #11047)
Reported by: snuffy
Patches:
      11047-fixes.diff uploaded by snuffy (license 35)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 13:36:13 +00:00
Tilghman Lesher 56b9568164 Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:09:46 +00:00
Russell Bryant f8483a0d04 Do a massive conversion for using the ast_verb() macro
(closes issue #10277, patches by mvanbaak)

Basically, this changes ...

if (option_verbose > 2)
   ast_verbose(VERBOSE_PREFIX_3, "Something\n");

to ...

ast_verb(3, "Something\n");


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 15:49:18 +00:00
Steve Murphy 0e969271ae After some study, thought, comparing, etc. I've backed out the previous universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 23:24:27 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Steve Murphy 8a7732f067 via 10206, I have added an option (e) to Dial to allow the h exten to get run on peer. Had to upgrade ast_flag stuff to 64 bits to do this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 19:40:29 +00:00
Russell Bryant 80166c6de8 Conversions to ast_debug()
(issue #9984, patches from eliel and dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 18:51:41 +00:00
Russell Bryant b179e2155f Convert uses of strdup() to ast_strdup()
(issue #9983, eliel)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 23:01:01 +00:00
Tilghman Lesher 9d05ff8ed5 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:20:11 +00:00
Russell Bryant 508d36f5ad Merged revisions 67308 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67308 | russell | 2007-06-05 10:51:53 -0500 (Tue, 05 Jun 2007) | 5 lines

When shutting down "gracefully", go through and run the unload() callbacks for
all of the modules.  "stop now" is considered a non-graceful shutdown and will
not go through this process.
(issue #9804, reported by chrisost, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 15:54:36 +00:00
Olle Johansson 0cc7c0640b Constifications
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 19:03:53 +00:00
Kevin P. Fleming 431b4a44d0 Merged revisions 62986 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r62986 | kpfleming | 2007-05-03 11:38:56 -0500 (Thu, 03 May 2007) | 2 lines

improve loader a bit, by avoiding trying to initialize embedded modules twice and avoiding trying to load modules from disk when they have been loaded already during the 'preload' pass (reported by blitzrage on IRC, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 16:43:49 +00:00
Jason Parker 8762bae610 Merged revisions 61705 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r61705 | qwell | 2007-04-20 16:15:29 -0500 (Fri, 20 Apr 2007) | 12 lines

Merged revisions 61704 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61704 | qwell | 2007-04-20 16:14:27 -0500 (Fri, 20 Apr 2007) | 4 lines

Fix an issue that I noticed while looking over issue 9571.

The reload timestamp was getting set after reloading the built-in stuff, and before the modules.

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 21:16:14 +00:00
Joshua Colp 42a36967c8 It is possible for mod to become invalid after we unload it (if it's a dynamic module) so move it around a bit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-19 22:32:40 +00:00
Joshua Colp 21b9973d21 Make the loader less noisy under valgrind.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 20:05:05 +00:00
Kevin P. Fleming 1bec2f5bfa give embedded modules a helping hand by backing up and restoring their global variables when they are loaded and unloaded
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 02:36:00 +00:00
Tilghman Lesher 588fcc7be7 Merged revisions 53532 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r53532 | tilghman | 2007-02-08 07:47:54 -0600 (Thu, 08 Feb 2007) | 2 lines

Issue 9007 - Mutex not released on early return

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-08 13:50:33 +00:00
Olle Johansson 0487368645 Take two, using find_resource on Kevin's suggestion.
Might need better locking support, giving up if we can't get the lock. Right now,
using existing locking in find_resource


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 08:08:56 +00:00
Olle Johansson 11d00cac15 Adding dialplan function IFMODULE, so you can create dialplans that handle
various PBX installations and checks if a module is loaded before using
it.
	example IFMODULE(chan_sip3.so)

issue #6671 in the bug tracker, finally gone. Thanks to mithraen for keeping
it updated.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 21:48:41 +00:00
Joshua Colp 62d3a11eb9 Merged revisions 45817 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r45817 | file | 2006-10-21 14:48:58 -0400 (Sat, 21 Oct 2006) | 2 lines

Don't use promotion on Darwin because it doesn't seem to work quite right in all cases, this should solve the unresolved symbol issue people have been seeing.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-21 18:52:33 +00:00
Kevin P. Fleming 41eb95e055 Merged revisions 44322 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44322 | kpfleming | 2006-10-03 19:25:44 -0500 (Tue, 03 Oct 2006) | 3 lines

ensure that local include files are always used
avoid a duplicate function name (term_init())

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 00:26:21 +00:00
Matt O'Gorman ae8cc3e18b bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 15:53:07 +00:00
Anthony LaMantia e421b69ce6 reveting modifaction to __ast_module_user_remove
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-15 05:00:27 +00:00
Joshua Colp 10e6fbc3bc Tweak changes that went in on revision 42891
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-13 22:45:44 +00:00
Anthony LaMantia 09d8972be6 small fix for 7944
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-13 19:27:27 +00:00
Kevin P. Fleming a757ca2947 ensure that unload_dynamic_module won't continue dereferencing a module pointer after the module has been unloaded from memory
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-26 19:45:16 +00:00
Kevin P. Fleming 970c6876c5 instead of reverting this supposedly 'stupid' change, let's try to get it working properly
also eliminate a warning from dlopen() because some flags were missing on the second dlopen() call


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-25 16:14:00 +00:00
Matthew Fredrickson 16157e26d6 Revert stupid RTLD_NOLOAD change that breaks module loading on some systems.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-24 17:24:33 +00:00
Kevin P. Fleming 7eecf0bfbc use RTLD_NOLOAD if it's available to make loading dynamic modules a little faster and less resource-intensive
also, keep trying to dlclose() a module until it actually goes away, since it may have other modules it brought in when it was loaded (thanks PCadach for pointing this problem out to me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-23 19:28:13 +00:00
Kevin P. Fleming e0df1dfd7c generate a message when a module cannot be found and loadable modules are disabled
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22 23:55:16 +00:00
Kevin P. Fleming e274fc0b54 minor improvements
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22 23:06:13 +00:00
Kevin P. Fleming 804f49e2c9 when loadable modules are disabled, if someone tries to load a module that does not exist, don't dereference a NULL pointer, just stop trying to load it...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-22 21:57:16 +00:00
Kevin P. Fleming 26fa229138 restore 'preload' functionality in loader
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 22:23:26 +00:00
Kevin P. Fleming 61755115c2 restore printing of module name during loading
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 19:56:30 +00:00
Kevin P. Fleming 5b03b3449b use a safer process for checking if a module wants to export symbols into the global namespace
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 14:42:03 +00:00
Kevin P. Fleming f3c518a70f don't declare these variables unless needed
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 03:06:41 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00