summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2012-04-06Fix memory leak in res_calendar_ews when event email address node is emptyMatthew Jordan
If the XML calendar data returned by a Microsoft Exchange Web Service specifies an XML Event E-Mail Address ("EmailAddress"), and no e-mail address is provided, a condition existed where an ast_calendar_attendee struct would be allocated but not appended to the list of attendees. Because of that, the memory associated with the attendee would never be freed. This patch frees the memory if no e-mail address is provided. ........ Merged revisions 361606 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361607 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06Add missing newlines to CLI loggingKinsey Moore
........ Merged revisions 361471 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361472 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04Replace GNU old-style field designator extensions to fix clang warningsJonathan Rose
(issue ASTERISK-19540) Reported by: Makoto Dei Patches: clang-gnu-designator.patch uploaded by Makoto Dei (license 5027) ........ Also add from the patch the portion in res_fax_spandsp that didn't apply to 1.8 Merged revisions 361142 from http://svn.asterisk.org/svn/asterisk/branches/1.8 (closes issue ASTERISK-19540) ........ Merged revisions 361143 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24Multiple revisions 360356-360357Russell Bryant
........ r360356 | russell | 2012-03-23 22:33:36 -0400 (Fri, 23 Mar 2012) | 6 lines expression parser: Fix (theoretical) memory leak. Fix a memory leak that is very unlikely to actually happen. If a malloc() succeeded, but the following strdup() failed, the memory from the original malloc() would be leaked. ........ r360357 | russell | 2012-03-23 22:34:39 -0400 (Fri, 23 Mar 2012) | 6 lines Rebuild parsers. This is needed to include the last fix to main/ast_expr2.y. The changes look much bigger as this regeneration of the code was done with newer versions of flex and bison. ........ Merged revisions 360356-360357 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360358 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-19Convert MuteAudio documentation to XML.Richard Mudgett
* Added missing error exits with cause in manager_mutestream(). * Cleaned up manager_mutestream() and func_mute_write(). * Some whitespace and comment cleanup. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14Fix incorrect usage of sizeof() in res_crypto.Russell Bryant
In this case, just remove the memset(). There was a redundant memset that is done correctly just 2 lines later. ........ Merged revisions 359110 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359114 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14Fix broken usage of sizeof() in res_adsi.Russell Bryant
........ Merged revisions 359088 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359091 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13Finalize ast_channel opaquificationTerry Wilson
Review: https://reviewboard.asterisk.org/r/1786/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13Enable macros in 1.8 to find the next highest "h" extension in a context, ↵Tilghman Lesher
like in 1.4. This change restores functionality that was present in 1.4, when AEL macros were implemented with the Macro dialplan application. Macros are fraught with functionality issues, because they consume a large portion of the underlying application stack. This limits the ability of AEL users to call many layers of subroutines, an issue which Gosub does not have (originally tested to 100,000 levels deep). Therefore, starting in 1.6.0, AEL macros were implemented with Gosub. However, there were some implicit behaviors of Macro, which were not replicated at the same time as with the transition to Gosub, one of which is documented in the related issue. In particular, the "h" extension is designed to execute not in the Macro context, but in the topmost calling context. Due to legacy issues with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks in all calling contexts, bubbling up from the deepest level until it finds an "h" extension. Since AEL hides the complexity of the underlying dialplan logic from the AEL programmer, it's reasonable to assume that this behavior should not change in the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break working AEL configurations in the transition to Asterisk 1.8 LTS. This fix is the result, which implements a search for the "h" extension in all calling Gosub contexts. Fixes ASTERISK-19336 Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher (with slight modifications for 1.8) Tested by: Johan Wilfer Review: https://reviewboard.asterisk.org/r/1776/ ........ Merged revisions 358810 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358811 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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-29Add IPv6 support to FastAGI.Sean Bright
Review: https://reviewboard.asterisk.org/r/1774/ Reviewed by: Simon Perreault, Mark Michelson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357610 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-28Fix REF_DEBUG compile errors.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357404 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-27Remove possible segfaults from res_odbc by adding locks around usage of odbc ↵Jonathan Rose
handle (closes issue ASTERISK-19011) Reported by: Walter Doekes Patches: issueA19011_combine_read_and_write_locks_WORK_IN_PROGRESS.patch uploaded by Walter Doekes (license 5674) review: https://reviewboard.asterisk.org/r/1719/ review: https://reviewboard.asterisk.org/r/1622/ ........ Merged revisions 356917 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356961 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Remove srtp_shutdown from res_srtpMatthew Jordan
The patch for ASTERISK-19253 included properly shutting down the libsrtp library in the case of module unload. Unfortunately, not all distributions have the srtp_shutdown call. As such, this patch removes calling srtp_shutdown. ........ Merged revisions 356650 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356651 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356652 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-21Fix some opaquification-related compiler warningsTerry Wilson
(closes issue ASTERISK-19419) PseudoReview - seanbright on IRC git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356152 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 AMI Monitor action without File header converting channel name into ↵Richard Mudgett
filename. * Fix potential Solaris crash if Monitor application has a urlbase and no fname_base option. ........ Merged revisions 355574 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 355575 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14res_agi: Add AGIEXITONHANGUP variable.Russell Bryant
This patch adds a variable AGIEXITONHANGUP for res_agi. If this variable is set to "yes" on a channel, AGI() will exit immediately once a channel hangup has been detected. This was the behavior of AGI() in Asterisk 1.4 and earlier and is still desired by some people. Review: https://reviewboard.asterisk.org/r/1734/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355102 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-13Fix reconnecting to pgsql database after connection loss.Richard Mudgett
There can only be one database connection in res_config_pgsql just like res_config_sqlite. If the connection is lost, the connection may not get reestablished to the same database if the res_pgsql.conf and extconfig.conf files are inconsistent. * Made only use the configured database from res_pgsql.conf. * Fixed potential buffer overwrite of last[] in config_pgsql(). (closes issue ASTERISK-16982) Reported by: german aracil boned Review: https://reviewboard.asterisk.org/r/1731/ ........ Merged revisions 354953 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354959 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09Adding reload support to res_fax.soMark Michelson
(closes issue ASTERISK-16712) reported by Frank DiGennaro Review: https://reviewboard.asterisk.org/r/1713 ........ Merged revisions 354545 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354546 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08Revision 354046 added res_corosync as a replacement for res_ais, but didn'tKevin P. Fleming
actually remove res_ais. This commit removes it. In addition, the 'install_prereq' script has been updated to no longer install AIS dependency packages, and instead install Corosync packages instead. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354459 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-03Fixes a segfault occuring when performing attended transfer with ↵Jonathan Rose
FAXOPT(gateway)=yes (closes issue ASTERISK-19184) Reported by: Alexandr ........ Merged revisions 353962 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Allow res_calendar to be unloadedTerry Wilson
The calendaring tech modules depend on res_calendar and initially res_calendar just bumped the use count so that it couldn't be unloaded. res_calendar can potentially create many threads and I've seen issues where the Asterisk shutdown has failed where it looked like these threads could be the culprit. This patch adds unload support for res_calendar. Unloading res_calendar will also unload the dependant tech modules as well. (closes issue ASTERISK-16744) Review: https://reviewboard.asterisk.org/r/1657/ ........ Merged revisions 353502 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353503 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27Make failed PauseMonitor and UnpauseMonitor with no valid channel not close ↵Jonathan Rose
AMI session. I also went ahead and took a little time to make sure that the manager value AMI_SUCCESS was used instead of just return 0 being thrown around everywhere since that's how we handle this stuff these days. (closes issue ASTERISK-19249) Reporter: Jamuel Starkey Patches: res_monitor.c-ASTERISK-19249.diff uploaded by Jamuel Starkey (license 5766) ........ Merged revisions 352959 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352965 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352981 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-27Add aresult variable for CALENDAR_WRITETerry Wilson
This patch adds a CALENDAR_SUCCESS=1/0 variable that is set to show whether or not CALENDAR_WRITE has passed. This patch also adds some debugging for caldav PUT responses and no longer treats responses with no body as an error (as a PUT gets a 201 Created with no body). (closes issue ASTERISK-16903) Reported by: Clod Patry Tested by: Terry Wilson Patches: calendarstatus.diff uploaded by Clod Patry (License #5138), slightly modified by Terry Wilson Review: https://reviewboard.asterisk.org/r/1692/ - This line, and those below, will be ignored-- M res/res_calendar.c M res/res_calendar_exchange.c M res/res_calendar_caldav.c git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352916 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-23Correctly apply FAXOPT settings (V17, V27, V29) before starting spandsp layerMatthew Jordan
While the FAXOPT function could be used to set the modem capabilities, the input to that function was not being applied correctly to the spandsp layer. This patch applies the current model capabilities before starting the spandsp layer. (closes issue: ASTERISK-16409) Reported by: Kristijan Vrban Tested by: Matt Jordan, Matthew Nicholson Patches: spandsp-modems-1.8.diff uploaded by mnicholson (license 5081) spandsp-modems-10.diff uploaded by mnicholson (license 5081) ........ Merged revisions 352144 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352149 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-23Add an announcement option to music-on-hold - plays sound when put on ↵Jonathan Rose
hold/between songs This is a feature patch which allows an 'announcement' option to be specified in musiconhold.conf which should be set to the name of a sound. If a valid sound is specified for this option, then it will be played on that music on hold class whenever a channel bound to that class is put on hold as well as when Asterisk is able to detect that a song has ended before starting the next song (excludes external players). (closes ASTERISK-18977) Reported by: Timo Teräs Patches: asterisk-moh-announcement.diff uploaded by Timo Teräs (license 5409) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19Correct output of RTCP jitter statistics in SR and RR reportsKinsey Moore
Change the RTCP RR and SR generation code to convert Asterisk's internal jitter statistics to be represented in RTP timestamp units based on the rate of the codec in use instead of in seconds. (closes issue ASTERISK-14530) ........ Merged revisions 351611 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 351612 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17Eliminate odd initialization of probation variable.Mark Michelson
........ Merged revisions 351306 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 351308 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-17Adds pjmedia probation concepts to res_rtp_asterisk's learning mode.Jonathan Rose
In order to better handle RTP sources with strictrtp enabled (which is now default in 10) using the learning mode to figure out new sources when they change is handled by checking for a number of consecutive (by sequence number) packets received to an rtp struct based on a new configurable value called 'probation'. Also, during learning mode instead of liberally accepting all packets received, we now reject packets until a clear source has been determined. Review: https://reviewboard.asterisk.org/r/1663/ ........ Merged revisions 351287 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 351289 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-14Multiple revisions 350788-350789Kevin P. Fleming
........ r350788 | kpfleming | 2012-01-14 09:22:33 -0600 (Sat, 14 Jan 2012) | 8 lines Ensure that two prerequisites are properly installed on Debian-style distributions. * Don't specify a specific version of libgmime; newer versions are available now and acceptable. * Install libsrtp so that res_srtp can be built. ........ r350789 | kpfleming | 2012-01-14 09:23:32 -0600 (Sat, 14 Jan 2012) | 3 lines Correct some 'set-but-not-used' variable warnings. ........ Merged revisions 350788-350789 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 350790 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350791 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
2012-01-05Fix premature free'ing of the frame committed in r349608Matthew Jordan
Even though we set the frame to the ast_null_frame and return that, the caller of the frame hook may still need the frame. This now is a bit more careful about when it frees the frame, i.e., only under the same conditions that applied when we duplicated it in the first place. ........ Merged revisions 349822 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04Free successfully translated frame in fax_gateway_framehookMatthew Jordan
A frame that is translated via ast_translate is also duplicated via ast_frdup. This will allocate a new frame on the heap, which needs to be free'd at the appropriate time. This issue reporter used valgrind to find that this occurred in res_fax's fax_gateway_framehook; a quick search through the code showed that only place this was currently not handling the translatted frame properly. (closes issue ASTERISK-19133) Reported by: Sylvain Rochet ........ Merged revisions 349608 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349609 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-19Add a separate buffer for SRTCP packetsTerry Wilson
The function ast_srtp_protect used a common buffer for both SRTP and SRTCP packets. Since this function can be called from multiple threads for the same SRTP session (scheduler for SRTCP and channel for SRTP) it was possible for the packets to become corrupted as the buffer was used by both threads simultaneously. This patch adds a separate buffer for SRTCP packets to avoid the problem. (closes issue ASTERISK-18889, Reported/patch by Daniel Collins) ........ Merged revisions 347995 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 347996 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348567 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-14Don't clear LOCALSTATIONID before sending or receiving. The user may set thatMatthew Nicholson
variable. ASTERISK-18921 ........ Merged revisions 348212 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348213 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-05Fix chan_jingle/gtalk load regression introduced in r346087Kinsey Moore
Add missing symbol exports for ast_aji_client_destroy and ast_aji_buddy_destroy for usage outside res_jabber. Testing of these changes focused on res_jabber itself, so this problem was missed. Reported-by: Michael Spiceland ........ Merged revisions 346951 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 346952 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-01Re-resolve the STUN address if a STUN poll fails for res_stun_monitor.Richard Mudgett
The STUN socket must remain open between polls or the external address seen by the STUN server is likely to change. However, if the STUN request poll fails then the STUN server address needs to be re-resolved and the STUN socket needs to be closed and reopened. * Re-resolve the STUN server address and create a new socket if the STUN request poll fails. * Fix ast_stun_request() return value consistency. * Fix ast_stun_request() to check the received packet for expected message type and transaction ID. * Fix ast_stun_request() to read packets until timeout or an associated response packet is found. The stun_purge_socket() hack is no longer required. * Reduce ast_stun_request() error messages to debug output. * No longer pass in the destination address to ast_stun_request() if the socket is already bound or connected to the destination. (closes issue ASTERISK-18327) Reported by: Wolfram Joost Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/1595/ ........ Merged revisions 346700 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 346701 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346709 65c4cc65-6c06-0410-ace0-fbb531ad65f3