summaryrefslogtreecommitdiff
path: root/main/loader.c
AgeCommit message (Collapse)Author
2013-08-30optional_api: Fix linking problems between modules that export global symbolsDavid M. Lee
With the new work in Asterisk 12, there are some uses of the optional_api that are prone to failure. The details are rather involved, and captured on [the wiki][1]. This patch addresses the issue by removing almost all of the magic from the optional API implementation. Instead of relying on weak symbol resolution, a new optional_api.c module was added to Asterisk core. For modules providing an optional API, the pointer to the implementation function is registered with the core. For modules that use an optional API, a pointer to a stub function, along with a optional_ref function pointer are registered with the core. The optional_ref function pointers is set to the implementation function when it's provided, or the stub function when it's now. Since the implementation no longer relies on magic, it is now supported on all platforms. In the spirit of choice, an OPTIONAL_API flag was added, so we can disable the optional_api if needed (maybe it's buggy on some bizarre platform I haven't tested on) The AST_OPTIONAL_API*() macros themselves remained unchanged, so existing code could remain unchanged. But to help with debugging the optional_api, the patch limits the #include of optional API's to just the modules using the API. This also reduces resource waste maintaining optional_ref pointers that aren't used. Other changes made as a part of this patch: * The stubs for http_websocket that wrap system calls set errno to ENOSYS. * res_http_websocket now properly increments module use count. * In loader.c, the while() wrappers around dlclose() were removed. The while(!dlclose()) is actually an anti-pattern, which can lead to infinite loops if the module you're attempting to unload exports a symbol that was directly linked to. * The special handling of nonoptreq on systems without weak symbol support was removed, since we no longer rely on weak symbols for optional_api. [1]: https://wiki.asterisk.org/wiki/x/wACUAQ (closes issue ASTERISK-22296) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2797/ ........ Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16Improve sounds indexer CLI commandsKinsey Moore
This reworks the CLI commands used to access sounds information from "sounds show[ soundid]" to "core show sounds" and "core show sound <soundid>". This also reworks the "sounds reload" CLI command to fall under normal module reloading ("module reload sounds"). Also, make trunk build when DEBUG_MALLOC is not enabled. Review: https://reviewboard.asterisk.org/r/2745/ (closes issue ASTERISK-22141) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-29Put the include in thereMatthew Jordan
Mea culpa... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-29When performing a reload, reload the new features_config and not the oldMatthew Jordan
Performing a module reload of core components causes specific functions compiled into the Asterisk binary to be reloaded. The table of said functions was still pointing to the old features reload mechanism, and not the new one. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-12Fix memory leak while loading modules, adding formats, and destroying endpointsMatthew Jordan
This patch fixes three memory leaks * When we load a module with the LOAD_PRIORITY flag, we remove its entry from the load order list. Unfortunately, we don't free the memory associated with entry in the list. This patch corrects that and properly frees the memory for the module in the list. * When adding a custom format (such as SILK or CELT), the routine for adding the format was leaking a reference. RAII_VAR cleans this up properly. * We now de-ref the channel_snapshot appropriately when an endpoint is disposed of ........ Merged revisions 391489 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391507 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10Make the reload stasis message bump the ref count of its sub-objectMatthew Jordan
JSON objects are reference stealing. Hence, if you've RAII_VAR'd some subobject and want to pack it into another JSON object, you have to bump the reference count. Using the 'O' option during the pack will bump the reference count for you. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24Migrate a large number of AMI events over to Stasis-CoreMatthew Jordan
This patch moves a number of AMI events over to the Stasis-Core message bus. This includes: * ChanSpyStart/Stop * MonitorStart/Stop * MusicOnHoldStart/Stop * FullyBooted/Reload * All Voicemail/MWI related events In addition, it adds some Stasis-Core and AMI support for generic AMI messages, refactors the message router in AMI to use a single router with topic forwarding for the topics that AMI cares about, and refactors MWI message types and topics to be more name compliant. Review: https://reviewboard.asterisk.org/r/2532 (closes issue ASTERISK-21462) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10Address unload order issues for res_stasis* modulesDavid M. Lee
I've noticed when doing a graceful shutdown that the res_stasis_http.so module gets unloaded before the modules that use it, which causes some asserts during their unload. While r386928 was a quick hack to get it to not assert and die, this patch increases the use counts on res_stasis.so and res_stasis_http.so properly. It's a bigger change than I expected, hence the review instead of just committing it. Review: https://reviewboard.asterisk.org/r/2489/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01Make mod_load_cmp() not as klunky.Richard Mudgett
There is a reason the heap comparison functions like qsort(), and other comparison functions specify <0, >0, and =0 for the return values. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26By popular demand, putting the about-to-load-module printf back.David M. Lee
But now it only prints during the initial startup, and prints at verbose 1 level. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26Removing stray printf from r386540David M. Lee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25Merge the pimp_my_sip branch into trunk.Mark Michelson
The pimp_my_sip branch is being merged at this point because it offers basic functionality, and from an API standpoint, things are complete. SIP work is *not* feature-complete; however, with the completion of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have been created, and thus it is possible for developers to attempt to create new SIP work. API documentation can be found in the doxygen in the code, but usability documentation is still lacking. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-19Add The Status Of A Module To The Output Of "CLI> module show"Michael L. Young
When a module's configuration is not loadable, we still load the module but it is not in a running state. When trying to troubleshoot, let's say, why chan_motif is ignoring inbound XMPP traffic, there is no way to indicate that a loaded module is not currently running. (closes issue ASTERISK-21108) Reported by: Rusty Newton Tested by: Michael L. Young Patches: asterisk-21108_add_status-v2.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2331/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17Fix potential double free when unloading a module.Richard Mudgett
........ Merged revisions 378092 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378093 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378094 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05Add safety NULL pointer check in module user references.Richard Mudgett
Made __ast_module_user_remove() check for NULL pointers. ........ Merged revision 375860 from C.3 ........ Merged revisions 375862 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375863 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375864 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27loader: Ensure dependent modules are properly initialized.Joshua Colp
If an Asterisk module specifies a dependency in ast_module_info.nonoptreq, it is possible for Asterisk to skip calling the modules's .load function. Asterisk was loading and linking the module via load_dynamic_module() but was not adding the module to the resource_heap. Therefore the module was not initialized based on it's priority along with the other modules in the heap. Now use load_resource() instead of load_dynamic_module() for non-optional requirement. This will add the module to the resource_heap so the module can be properly initialized in the correct order. This is required if there are any module global data structures initialized in the .load() callback for the module on platforms which do not support weak references. (issue ASTERISK-20439) Reported by: sruffell Patches: 0001-loader-Ensure-dependent-modules-are-properly-initial.patch uploaded by sruffell (license 5417) ........ Merged revisions 373909 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 373910 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 373911 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-17Add instrumentation to subsystem reloadsKinsey Moore
When Asterisk is built with TEST_FRAMEWORK defined, Asterisk will now generate TestEvent AMI events on subsystem reloads such as cdr, dnsmgr, extconfig, etc. (issue PQ-1126) ........ Merged revisions 371436 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371437 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371438 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-16Add module reload instrumentation for TEST_FRAMEWORKKinsey Moore
This adds AMI events for module reloads when Asterisk is built with TEST_FRAMEWORK enabled and corrects generation of the module load AMI event. (issue PQ-1126) ........ Merged revisions 371393 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371394 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371395 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-13Add test instrumentationKinsey Moore
This adds test instrumentation for loading and unloading of modules and for certain actions in MeetMe to be used in the testsuite or any other consumer of AMI events. These will only be generated when Asterisk is built with TEST_FRAMEWORK enabled. (issue PQ-1131) (issue PQ-1133) ........ Merged revisions 371201 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371203 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371227 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11Named ACLs: Introduces a system for creating and sharing ACLsJonathan Rose
This patch adds Named ACL functionality to Asterisk. This allows system administrators to define an ACL and refer to it by a unique name. Configurable items can then refer to that name when specifying access control lists. It also includes updates to all core supported consumers of ACLs. That includes manager, chan_sip, and chan_iax2. This feature is based on the deluxepine-trunk by Olle E. Johansson and provides a subset of the Named ACL functionality implemented in that branch. For more information on this feature, see acl.conf and/or the Asterisk wiki. Review: https://reviewboard.asterisk.org/r/1978/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11Fix validation errors when producing documentation using default build scriptMatthew Jordan
The awk script parses out the first instance of the DOCUMENTATION tag that it finds within a file. If a file did not previously have a DOCUMENTATION tag but received one due to it having an AMI event, then the XML fragment associated with the AMI event was erroneously placed in the resulting XML file. Without the python scripts, these XML fragments will not validate. This patch adds DOCUMENTATION tags at the top of those files that did not previously have them to prevent the awk script from pulling AMI event documentation. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10Add some additional documentation for core AMI eventsMatthew Jordan
This patch adds some basic documentation for a number of modules. This includes core source files in Asterisk (those in main), as well as chan_agent, chan_dahdi, chan_local, sig_analog, and sig_pri. The DTD has also been updated to allow referencing of AMI commands. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Multiple revisions 369001-369002Kevin P. Fleming
........ 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-11Fix coverity UNUSED_VALUE findings in core support level filesKinsey Moore
Most of these were just saving returned values without using them and in some cases the variable being saved to could be removed as well. (issue ASTERISK-19672) ........ Merged revisions 368738 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 368739 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22Track module use count for res_calendarTerry Wilson
If the res_calendar module was followed immediately by one of the calendar tech modules and "core stop gracefully" was run, Asterisk would crash. This patch adds use count tracking for res_calendar so that it is unloaded after the tech modules when shutting down gracefully. It is now not possible to unload all the of the calendar modules via "module unload res_calednar.so", but it is still possible to unload them all via "module unload -h res_calendar.so". Review: https://reviewboard.asterisk.org/r/1752/ ........ Merged revisions 356291 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356297 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-12Backed out core changes from r346391Matthew Jordan
During testing, it was discovered that there were a number of side effects introduced by r346391 and subsequent check-ins related to it (r346429, r346617, and r346655). This included the /main/stdtime/ test 'hanging', as well as the remote console option failing to receive the appropriate output after a period of time. I only backed out the changes to main/ and utils/, as this was adequate to reverse the behavior experienced. (issue ASTERISK-18974) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30Remove the few places where we try to ast_verbose() without a newline.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10Merged revisions 340109 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r340109 | mnicholson | 2011-10-10 09:15:41 -0500 (Mon, 10 Oct 2011) | 18 lines Merged revisions 340108 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r340108 | mnicholson | 2011-10-10 09:14:48 -0500 (Mon, 10 Oct 2011) | 11 lines Load the proper XML documentation when multiple modules document the same application. This patch adds an optional "module" attribute to the XML documentation spec that allows the documentation processor to match apps with identical names from different modules to their documentation. This patch also fixes a number of bugs with the documentation processor and should make it a little more efficient. Support for multiple languages has also been properly implemented. ASTERISK-18130 Review: https://reviewboard.asterisk.org/r/1485/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-27Merged revisions 329670 via svnmerge from Sean Bright
https://origsvn.digium.com/svn/asterisk/branches/10 ........ r329670 | seanbright | 2011-07-27 11:25:53 -0400 (Wed, 27 Jul 2011) | 2 lines Sort the module list so that 'module show' is alphabetical. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-09clarify warning when no loadable module supportTzafrir Cohen
Clarify warning message when LOADABLE_MODULES is disabled but we still try to load a module. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02Merged revisions 284610 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r284610 | tilghman | 2010-09-02 00:20:59 -0500 (Thu, 02 Sep 2010) | 10 lines When optional_api is non-optional, force dependent modules to be loaded. (closes issue #17707) Reported by: ira Patches: 20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14) Tested by: tilghman Review: https://reviewboard.asterisk.org/r/876/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20Add load priority order, such that preload becomes unnecessary in most casesTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14Oops, merge reverted this fix.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14Remove the old stub files, preferring the optional_api method.Tilghman Lesher
(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-14Don't try to call an embedded module's backup_globals() function untilKevin P. Fleming
after confirming it exists. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09Merged revisions 275182 via svnmerge from Matthew Nicholson
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-09Merged revisions 275143 via svnmerge from Matthew Nicholson
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-05-19Fix transcode_via_sln option with SIP calls and improve PLC usage.Mark Michelson
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-12Notify CLI when modules is loaded / unloadedPaul Belanger
(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-02-17RTP documentation states that you can pass NULL as the module, so make sure ↵Tilghman Lesher
that's really the case. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27Add new option to asterisk.conf (lockconfdir) to protect conf dir during reloadsJeff Peeler
(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
2009-11-13Fixing trunk in a way so that it compiles again.Olle Johansson
Thanks, Philippe :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13Add the capability to require a module to be loaded, or else Asterisk exits.Olle Johansson
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-09Fix various problems detected with Valgrind.Tilghman Lesher
* 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-08-21Make LOAD_ORDER actually workTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27Fixing typos. Replaces "recieved" with "received" and "initilize" with ↵David Brooks
"initialize" (closes issue #15571) Reported by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Merge the new Channel Event Logging (CEL) subsystem.Russell Bryant
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-22attempting to load running modulesDavid Vossel
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