summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2012-03-01Opaquify ast_channel typedefs, fd arrays, and softhangup flagTerry Wilson
Review: https://reviewboard.asterisk.org/r/1784/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Update stringfield documentation for removed second va_list in favor of va_copy.Walter Doekes
In r320946, the second va_list that was passed to ast_string_field_build_va and friends, was removed. This patch updates the documentation to reflect that. ........ Merged revisions 357620 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Opaquify ast_channel structs and listsTerry Wilson
Review: https://reviewboard.asterisk.org/r/1773/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Documentation update. There is no AST_SOCKADDR_UNSPEC.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Convert struct ast_tcptls_session_instance to finally use the ao2 object lock.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Astobj2 locking enhancement.Richard Mudgett
Add the ability to specify what kind of locking an ao2 object has when it is allocated. The locking could be one of: MUTEX, RWLOCK, or none. New API: ao2_t_alloc_options() ao2_alloc_options() ao2_t_container_alloc_options() ao2_container_alloc_options() ao2_rdlock() ao2_wrlock() ao2_tryrdlock() ao2_trywrlock() The OBJ_NOLOCK and AO2_ITERATOR_DONTLOCK flags have a slight meaning change. They no longer mean that the object is protected by an external mechanism. They mean the lock associated with the object has already been manually obtained by one of the ao2_lock calls. This change is necessary for RWLOCK support since they are not reentrant. Also an operation on an ao2 container may require promoting a read lock to a write lock by releasing the already held read lock to re-acquire as a write lock. Replaced API calls: ao2_t_link_nolock() ao2_link_nolock() ao2_t_unlink_nolock() ao2_unlink_nolock() with the respective ao2_t_link_flags() ao2_link_flags() ao2_t_unlink_flags() ao2_unlink_flags() API calls to be more flexible and to allow an anticipated enhancement to control linking duplicate objects into a container. The changes to format.c and format_cap.c are taking advantange of the new ao2 locking options to simplify the use of the format capabilities containers. Review: https://reviewboard.asterisk.org/r/1554/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Add ability to clone ao2 containers.Richard Mudgett
Occasionally there is a need to put all objects in one container also into another container. Some reasons you might need to do this: 1) You need to reconfigure a container. You would do this by creating a new container with the new configuration and ao2_container_dup the old container into it. Then replace the old container with the new. Then destroy the old container. 2) You need the contents of a container to remain stable while operating on all of the objects. You would do this by creating a cloned container of the original with ao2_container_clone. The cloned container is a snapshot of the objects at the time of the cloning. When done, just destroy the cloned container. Review: https://reviewboard.asterisk.org/r/1746/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Converts locking for odbc containers from ast_mutex_lock to ao2_locks.Jonathan Rose
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Deprecated macro usage for connected line, redirecting, and CCSSKinsey Moore
This commit adds GoSub alternatives to connected line, redirecting, and CCSS macro hooks so that macro can finally be deprecated. This also adds deprecation warnings for those features when used and in documentation. Review: https://reviewboard.asterisk.org/r/1760/ (closes issue SWP-4256) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Convert netsock.h over to use ast_sockaddrs rather than sockaddr_in and updateSean Bright
chan_iax2 to pass in the correct types. chan_iax2 is the only consumer for the various ast_netsock_* functions in trunk at this point, so this feels like a safe change to make. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Make ast_netsock_set_qos() delegate to ast_set_qos().Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Correct typo in deprecation comment.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Prefer ast_set_qos() over ast_netsock_set_qos()Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24astobj2.h comment tweaks.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24astobj2.h documentation updates.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Fix worker thread resource leak in SIP TCP/TLS.Richard Mudgett
The SIP TCP/TLS worker threads were created joinable but noone could join them if they died on their own. * Fix the SIP TCP/TLS worker threads to not be created joinable. * _sip_tcp_helper_thread() only needs one parameter since the pvt parameter is only passed in as NULL and never used. (closes issue ASTERISK-19203) Reported by: Steve Davies Review: https://reviewboard.asterisk.org/r/1714/ ........ Merged revisions 356677 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356690 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Allow SRTP policies to be reloadedMatthew Jordan
Currently, when using res_srtp, once the SRTP policy has been added to the current session the policy is locked into place. Any attempt to replace an existing policy, which would be needed if the remote endpoint negotiated a new cryptographic key, is instead rejected in res_srtp. This happens in particular in transfer scenarios, where the endpoint that Asterisk is communicating with changes but uses the same RTP session. This patch modifies res_srtp to allow remote and local policies to be reloaded in the underlying SRTP library. From the perspective of users of the SRTP API, the only change is that the adding of remote and local policies are now added in a single method call, whereas they previously were added separately. This was changed to account for the differences in handling remote and local policies in libsrtp. Review: https://reviewboard.asterisk.org/r/1741/ (closes issue ASTERISK-19253) Reported by: Thomas Arimont Tested by: Thomas Arimont Patches: srtp_renew_keys_2012_02_22.diff uploaded by Matt Jordan (license 6283) (with some small modifications for this check-in) ........ Merged revisions 356604 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356605 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Opaquification for ast_format structs in struct ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1770/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 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-22Rename ast_channel_emulate_dtmf_digit* funcsTerry Wilson
The accessors names for the "emulate_dtmf_digit" field on the ast_channel are misleading. Change them to ast_channel_dtmf_digit_to_emulate*. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-16Fix compile problem when old version of libvorbisfile v1.1.2 is used.Richard Mudgett
The principle difference between libvorbisfile v1.1.2 and newer (at least v1.2.0) is the addition of the predefined callbacks OV_CALLBACKS_xxx in vorbis/vorbisfile.h used for ov_open_callbacks(). * Updated the configure script to detect if libvorbisfile.h declares OV_CALLBACKS_NOCLOSE. * Copied the declaration of OV_CALLBACKS_NOCLOSE from v1.2.0 to allow v1.1.2 to compile. (closes issue ASTERISK-19370) Reported by: Jonn Taylor ........ Merged revisions 355608 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 355620 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355621 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
2012-02-14Fix voicemail problems when using ogg/vorbis.Richard Mudgett
Ogg/vorbis was fairly useless as a voicemail file format because it did not implement the seek and tell format callbacks among other problems. Since we were already using the libvorbis and libvorbisenc libraries we can use libvorbisfile as it is also part of the vorbis library package. * Made use the libvorbisfile to handle the ogg/vorbis file stream. The format_ogg_vorbis.c is now mostly a wrapper around libvorbisfile. (closes issue ASTERISK-16926) Reported by: sque Patches: ogg_vorbis_use_libvorbisfile.patch (license #6108) patch uploaded by sque ........ Merged revisions 355365 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 355375 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13Opaquify char * and char[] in ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-05Replace res_ais with a new module, res_corosync.Russell Bryant
This patch removes res_ais and introduces a new module, res_corosync. The OpenAIS project is deprecated and is now just a wrapper around Corosync. This module provides the same functionality using the same core infrastructure, but without the use of the deprecated components. Technically res_ais could have been used with an AIS implementation other than OpenAIS, but that is the only one I know of that was ever used. Review: https://reviewboard.asterisk.org/r/1700/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02Fix TLS port binding behavior as well as reload behavior:Mark Michelson
* Removes references to tlsbindport from http.conf.sample and manager.conf.sample * Properly bind to port specified in tlsbindaddr, using the default port if specified. * On a reload, properly close socket if the service has been disabled. A note has been added to UPGRADE.txt to indicate how ports must be set for TLS. (closes issue ASTERISK-16959) reported by Olaf Holthausen (closes issue ASTERISK-19201) reported by Chris Mylonas (closes issue ASTERISK-19204) reported by Chris Mylonas Review: https://reviewboard.asterisk.org/r/1709 ........ Merged revisions 353770 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353820 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Constify some more channel driver technology callback parameters.Richard Mudgett
Review: https://reviewboard.asterisk.org/r/1707/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Fix ExtenSpy and simplify the channel search functions.Richard Mudgett
When ast_channel name was opaquified, the channel search functions did not get converted correctly. As a result ExtenSpy which uses a channel iterator search by exten@context could never find anything. * Updated the doxygen documentation for the search functions in channel.h. Review: https://reviewboard.asterisk.org/r/1702/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Resolve an overlap in the ast_audiohook_flags values.Sean Bright
AST_AUDIOHOOK_TRIGGER_WRITE and AST_AUDIOHOOK_WANTS_DTMF were overlapping which may have caused unintended side effects. This patch moves AST_AUDIOHOOK_TRIGGER_WRITE, and updates AST_AUDIOHOOK_TRIGGER_MODE to reflect the original intention. This will affect existing modules that use these flags, so be sure to recompile as necessary. (closes issue ASTERISK-19246) Reported by: feyfre ........ Merged revisions 353598 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353599 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-31Fix memory leak in error paths for action_originate().Richard Mudgett
* Fix memory leak of vars in error paths for action_originate(). * Moved struct fast_originate_helper tech and data members to stringfields. * Simplified ActionID header handling for fast_originate(). * Added doxygen note to ast_request() and ast_call() and the associated channel callbacks that the data/addr parameters should be treated as const char *. Review: https://reviewboard.asterisk.org/r/1690/ ........ Merged revisions 353454 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353463 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30Re-link peers by IP when dnsmgr changes the IPTerry Wilson
Asterisk's dnsmgr currently takes a pointer to an ast_sockaddr and updates it anytime an address resolves to something different. There are a couple of issues with this. First, the ast_sockaddr is usually the address of an ast_sockaddr inside a refcounted struct and we never bump the refcount of those structs when using dnsmgr. This makes it possible that a refresh could happen after the destructor for that object is called (despite ast_dnsmgr_release being called in that destructor). Second, the module using dnsmgr cannot be aware of an address changing without polling for it in the code. If an action needs to be taken on address update (like re-linking a SIP peer in the peers_by_ip table), then polling for this change negates many of the benefits of having dnsmgr in the first place. This patch adds a function to the dnsmgr API that calls an update callback instead of blindly updating the address itself. It also moves calls to ast_dnsmgr_release outside of the destructor functions and into cleanup functions that are called when we no longer need the objects and increments the refcount of the objects using dnsmgr since those objects are stored on the ast_dnsmgr_entry struct. A helper function for returning the proper default SIP port (non-tls vs tls) is also added and used. This patch also incorporates changes from a patch posted by Timo Teräs to ASTERISK-19106 for related dnsmgr issues. (closes issue ASTERISK-19106) Review: https://reviewboard.asterisk.org/r/1691/ ........ Merged revisions 353371 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353397 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30Address OpenSSL initialization issues when using third-party libraries.Kevin P. Fleming
When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27Audit of ao2_iterator_init() usage for v1.8.Richard Mudgett
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as a result. Review: https://reviewboard.asterisk.org/r/1697/ ........ Merged revisions 352955 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352956 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25Remove "asterisk/version.h" in favor of "asterisk/ast_version.h".Kevin P. Fleming
A long time ago, in a land far far away, we added "asterisk/ast_version.h", which provides the ast_get_version() and ast_get_version_num() functions. These were added so that modules that needed the version information for the Asterisk instance they were loaded in could actually get it (as opposed the version that they were compiled against). We changed everything in the tree to use the new mechanism (although later main/test.c was added using the old method). However, the old mechanism was never removed, and as a result, new code is still trying to use it. This commit removes asterisk/version.h and replaces it with a header that will generate a compile-time error if you try to use it (the error message tells you which header you should use instead). It also removes the Makefile and build_tools bits that generated the file, and it updates main/test.c to use the 'proper' method of getting the Asterisk version information. This is an API change and thus is being committed for trunk only, but it's a fairly minor one and definitely improves the situation for out-of-tree modules. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24Opaquify channel stringfieldsTerry Wilson
Continue channel opaque-ification by wrapping all of the stringfields. Eventually, we will restrict what can actually set these variables, but the purpose for now is to hide the implementation and keep people from adding code that directly accesses the channel structure. Semantic changes will follow afterward. Review: https://reviewboard.asterisk.org/r/1661/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19Eliminates doubling the :port part of SIP Notify Message-Account headers.Jonathan Rose
This patch prevents the domain string from getting mangled during the initreqprep step by moving the initialization to before its immediate use. It also documents this pitfall for the ast_sockaddr_stringify functions. (issue ASTERISK-19057) Reported by: Yuri Review: https://reviewboard.asterisk.org/r/1678/ ........ Merged revisions 351559 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 351560 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13Run bootstrap.sh for the for the ASTERISK-18929 fixKinsey Moore
configure and autoconfig.h.in were not regenerated when the fix was committed. ........ Merged revisions 350736 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 350737 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13Fix crash from bridge channel hangup race condition in ConfBridgeMatthew Jordan
This patch addresses two issues in ConfBridge and the channel bridge layer: 1. It fixes a race condition wherein the bridge channel could be hung up 2. It removes the deadlock avoidance from the bridging layer and makes the bridge_pvt an ao2 ref counted object Patch by David Vossel (mjordan was merely the commit monkey) (issue ASTERISK-18988) (closes issue ASTERISK-18885) Reported by: Dmitry Melekhov Tested by: Matt Jordan Patches: chan_bridge_cleanup_v.diff uploaded by David Vossel (license 5628) (closes issue ASTERISK-19100) Reported by: Matt Jordan Tested by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1654/ ........ Merged revisions 350550 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-31Constify tag argument in REF_DEBUG related code.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-28Improve T.38 gateway V.21 preamble detection.Kevin P. Fleming
This commit removes the V.21 preamble detection code previously added to the generic DSP implementation in Asterisk, and instead enhances the res_fax module to be able to utilize V.21 preamble detection functionality made available by FAX technology modules. This commit also adds such support to res_fax_spandsp, which uses the Spandsp modem tone detection code to do the V.21 preamble detection. There should be no functional change here, other than much more reliable V.21 preamble detection (and thus T.38 gateway initiation). ........ Merged revisions 349248 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-27Fix timing source dependency issues with MOHMatthew Jordan
Prior to this patch, res_musiconhold existed at the same module priority level as the timing sources that it depends on. This would cause a problem when music on hold was reloaded, as the timing source could be changed after res_musiconhold was processed. This patch adds a new module priority level, AST_MODPRI_TIMING, that the various timing modules are now loaded at. This now occurs before loading other resource modules, such that the timing source is guaranteed to be set prior to resolving the timing source dependencies. (closes issue ASTERISK-17474) Reporter: Luke H Tested by: Luke H, Vladimir Mikhelson, zzsurf, Wes Van Tlghem, elguero, Thomas Arimont Patches: asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-1.8.diff uploaded by elguero (License #5026) asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-10.diff uploaded by elguero (License #5026) asterisk-17474-dahdi_timing-infinite-wait-fix_v3.diff uploaded by elguero (License #5026) Review: https://reviewboard.asterisk.org/r/1578/ ........ Merged revisions 349194 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 349195 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23Fix extension state callback references in chan_sip.Richard Mudgett
Chan_sip gives a dialog reference to the extension state callback and assumes that when ast_extension_state_del() returns, the callback cannot happen anymore. Chan_sip then reduces the dialog reference count associated with the callback. Recent changes (ASTERISK-17760) have resulted in the potential for the callback to happen after ast_extension_state_del() has returned. For chan_sip, this could be very bad because the dialog pointer could have already been destroyed. * Added ast_extension_state_add_destroy() so chan_sip can account for the sip_pvt reference given to the extension state callback when the extension state callback is deleted. * Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy() and handle_statechange() now that the struct ast_state_cb has a destructor to call. * Ensure that ast_extension_state_add_destroy() will never return -1 or 0 for a successful registration. * Fixed pbx.c statecbs_cmp() to compare the correct information. The passed in value to compare is a change_cb function pointer not an object pointer. * Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with AST_EXTENSION_REMOVED with locks held. Chan_sip is notorious for deadlocking when those locks are held during the callback. * Removed unused lock declaration for the pbx.c store_hints list. (closes issue ASTERISK-18844) Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/1635/ ........ Merged revisions 348940 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348952 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22Allow packetization vaules > 127Terry Wilson
According to the RTP packetization documentation, and the maximum values listed in AST_FORMAT_LIST, we should support values > that the signed char array that ast_codec_pref makes available to store the value. All places in the code treat the framing field as though it were an int array instaead of a char array anyway, so this just fixes the type of the array. (closes issue ASTERISK-18876) Review: https://reviewboard.asterisk.org/r/1639/ ........ Merged revisions 348833 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348845 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16Fix crash during CDR update.Richard Mudgett
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to be called by different threads for the same channel. The channel driver thread and the PBX thread running dialplan. * Add lock protection around CDR API calls that access an ast_channel pointer. (closes issue ASTERISK-18836) Reported by: gpluser Review: https://reviewboard.asterisk.org/r/1628/ ........ Merged revisions 348362 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348363 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348364 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-12-09Remove autojump extensions from SayUnixTime, make an option to perform ↵Jonathan Rose
automatic jumps. When a caller sends DTMF while the SayUnixTime application is saying the time, The call would jump to the next extension much like it does during Background(). This patch adds option 'j' to SayUnixTime which when used employs the old behavior. Also, this patch allows arguments to sayunixtime to not be used as empty strings in the case of something like 'sayunixtime(,,,j)' or 'sayunixtime(,,pattern). (closes issue ASTERISK-16675) Reported by: jlpedrosa Patches: patch_SayUnixTime_noJump.patch uploaded by jlpedrosa (license 5959) Review: https://reviewboard.asterisk.org/r/956/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-07Add ASTSBINDIR to the list of configurable pathsTerry Wilson
This patch also makes astdb2sqlite3 and astcanary use the configured directory instead of relying on $PATH. (closes issue ASTERISK-18959) Review: https://reviewboard.asterisk.org/r/1613/ ........ Merged revisions 347344 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06Doubly linked lists unit test and update to implementation.Richard Mudgett
Update the doubly linked list implementation. Now safe traversing can insert before and after the current node when traversing in either direction. Updated the linked lists unit test test_linkedlist to also test doubly linked lists. The old test_dlinkedlist requires a manual check of results and probably should be removed. Review: https://reviewboard.asterisk.org/r/1569/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347110 65c4cc65-6c06-0410-ace0-fbb531ad65f3