[-]
[+]
|
Changed |
asterisk.changes
|
|
[-]
[+]
|
Changed |
asterisk.spec
^
|
|
[-]
[+]
|
Deleted |
asterisk-1.8.23.1.tar.xz/asterisk-1.8.23.1-summary.html
^
|
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.8.23.1</title></head>
-<body>
-<h1 align="center"><a name="top">Release Summary</a></h1>
-<h3 align="center">asterisk-1.8.23.1</h3>
-<h3 align="center">Date: 2013-08-27</h3>
-<h3 align="center"><asteriskteam@digium.com></h3>
-<hr/>
-<h2 align="center">Table of Contents</h2>
-<ol>
- <li><a href="#summary">Summary</a></li>
- <li><a href="#contributors">Contributors</a></li>
- <li><a href="#commits">Other Changes</a></li>
- <li><a href="#diffstat">Diffstat</a></li>
-</ol>
-<hr/>
-<a name="summary"><h2 align="center">Summary</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This release has been made to address one or more security vulnerabilities that have been identified. A security advisory document has been published for each vulnerability that includes additional information. Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.</p>
-<p>Security Advisories: <a href="http://downloads.asterisk.org/pub/security/AST-2013-004.html">AST-2013-004</a>, <a href="http://downloads.asterisk.org/pub/security/AST-2013-005.html">AST-2013-005</a></p>
-<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.8.23.0.</p>
-<hr/>
-<a name="contributors"><h2 align="center">Contributors</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
-<table width="100%" border="0">
-<tr>
-<td width="33%"><h3>Coders</h3></td>
-<td width="33%"><h3>Testers</h3></td>
-<td width="33%"><h3>Reporters</h3></td>
-</tr>
-<tr valign="top">
-<td>
-4 bebuild<br/>
-</td>
-<td>
-</td>
-<td>
-</td>
-</tr>
-</table>
-<hr/>
-<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
-<table width="100%" border="1">
-<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.23.1?view=revision&revision=397764">397764</a></td><td>bebuild</td><td>Create 1.8.23.1</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.23.1?view=revision&revision=397825">397825</a></td><td>bebuild</td><td>Merge changes for 1.8.23.1</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.23.1?view=revision&revision=397829">397829</a></td><td>bebuild</td><td>Importing release summary for 1.8.23.1 release.</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.8.23.1?view=revision&revision=397840">397840</a></td><td>bebuild</td><td>Correct type in ChangeLog (thanks Jamuel in #asterisk-bugs!)</td>
-<td></td></tr></table>
-<hr/>
-<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
-<pre>
-.version | 2
-ChangeLog | 33 ++
-asterisk-1.8.23.0-summary.html | 522 ----------------------------------
-asterisk-1.8.23.0-summary.txt | 618 -----------------------------------------
-asterisk-1.8.23.1-summary.html | 61 ++++
-asterisk-1.8.23.1-summary.txt | 89 +++++
-channels/chan_sip.c | 10
-7 files changed, 189 insertions(+), 1146 deletions(-)
-</pre><br/>
-<hr/>
-</body>
-</html>
|
[-]
[+]
|
Deleted |
asterisk-1.8.23.1.tar.xz/asterisk-1.8.23.1-summary.txt
^
|
@@ -1,98 +0,0 @@
- Release Summary
-
- asterisk-1.8.23.1
-
- Date: 2013-08-27
-
- <asteriskteam@digium.com>
-
- ----------------------------------------------------------------------
-
- Table of Contents
-
- 1. Summary
- 2. Contributors
- 3. Other Changes
- 4. Diffstat
-
- ----------------------------------------------------------------------
-
- Summary
-
- [Back to Top]
-
- This release has been made to address one or more security vulnerabilities
- that have been identified. A security advisory document has been published
- for each vulnerability that includes additional information. Users of
- versions of Asterisk that are affected are strongly encouraged to review
- the advisories and determine what action they should take to protect their
- systems from these issues.
-
- Security Advisories: AST-2013-004, AST-2013-005
-
- The data in this summary reflects changes that have been made since the
- previous release, asterisk-1.8.23.0.
-
- ----------------------------------------------------------------------
-
- Contributors
-
- [Back to Top]
-
- This table lists the people who have submitted code, those that have
- tested patches, as well as those that reported issues on the issue tracker
- that were resolved in this release. For coders, the number is how many of
- their patches (of any size) were committed into this release. For testers,
- the number is the number of times their name was listed as assisting with
- testing a patch. Finally, for reporters, the number is the number of
- issues that they reported that were closed by commits that went into this
- release.
-
- Coders Testers Reporters
- 4 bebuild
-
- ----------------------------------------------------------------------
-
- Commits Not Associated with an Issue
-
- [Back to Top]
-
- This is a list of all changes that went into this release that did not
- directly close an issue from the issue tracker. The commits may have been
- marked as being related to an issue. If that is the case, the issue
- numbers are listed here, as well.
-
- +------------------------------------------------------------------------+
- | Revision | Author | Summary | Issues |
- | | | | Referenced |
- |----------+---------+--------------------------------------+------------|
- | 397764 | bebuild | Create 1.8.23.1 | |
- |----------+---------+--------------------------------------+------------|
- | 397825 | bebuild | Merge changes for 1.8.23.1 | |
- |----------+---------+--------------------------------------+------------|
- | 397829 | bebuild | Importing release summary for | |
- | | | 1.8.23.1 release. | |
- |----------+---------+--------------------------------------+------------|
- | 397840 | bebuild | Correct type in ChangeLog (thanks | |
- | | | Jamuel in #asterisk-bugs!) | |
- +------------------------------------------------------------------------+
-
- ----------------------------------------------------------------------
-
- Diffstat Results
-
- [Back to Top]
-
- This is a summary of the changes to the source code that went into this
- release that was generated using the diffstat utility.
-
- .version | 2
- ChangeLog | 33 ++
- asterisk-1.8.23.0-summary.html | 522 ----------------------------------
- asterisk-1.8.23.0-summary.txt | 618 -----------------------------------------
- asterisk-1.8.23.1-summary.html | 61 ++++
- asterisk-1.8.23.1-summary.txt | 89 +++++
- channels/chan_sip.c | 10
- 7 files changed, 189 insertions(+), 1146 deletions(-)
-
- ----------------------------------------------------------------------
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/.version
^
|
@@ -1 +1 @@
-1.8.23.1
+1.8.24.0
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/ChangeLog
^
|
@@ -1,35 +1,668 @@
-2013-08-27 Asterisk Development Team <asteriskteam@digium.com>
+2013-10-21 Asterisk Development Team <asteriskteam@digium.com>
- * Asterisk 1.8.23.1 Released.
+ * Asterisk 1.8.24.0 Released.
- * AST-2013-005: Remote crash from invalid SDP
+2013-10-18 Asterisk Development Team <asteriskteam@digium.com>
- If the SIP channel driver processes an invalid SDP that defines media
- descriptions before connection information, it may attempt to
- reference the socket address information even though that information
- has not yet been set. This will cause a crash.
+ * Asterisk 1.8.24.0-rc2 Released.
- This patch adds checks when handling the various media descriptions
- that ensures the media descriptions are handled only if we have
- connection information suitable for that media.
-
- Thanks to Walter Doekes, OSSO B.V., for reporting, testing, and
- providng the solution to this problem.
-
- * AST-2013-004: Fix crash when handling ACK on dialog that has no
- channel
-
- A remotely exploitable crash vulnerability exists in the SIP channel
- driver if an ACK with SDP is received after the channel has been
- terminated. The handling code incorrectly assumed that the channel
- would always be present.
-
- This patch adds a check such that the SDP will only be parsed and
- applied if Asterisk has a channel present that is associated with the
- dialog.
-
- Note that the patch being applied was modified only slightly from the
- patch provided by Walter Doekes of OSSO B.V.
+ * Properly copy/remove the device state cache flag over a masquerade.
+
+ In r378303 the AST_FLAG_DISABLE_DEVSTATE_CACHE flag was added that
+ tells the devstate system to not cache states for non-real devices.
+ However, when optimizing away channels (ast_do_masquerade), that flag
+ wasn't copied.
+
+ In my case, using Local devices as queue members created a situation
+ where the endpoint was considered in use, but the state change of the
+ device being available again was ignored (not cached). The endpoint
+ channel was optimized into the (previously) Local channel, but kept
+ the do-not-cache flag. The end result being that the queue member
+ apparently stayed in use forever.
+
+2013-09-19 Asterisk Development Team <asteriskteam@digium.com>
+
+ * Asterisk 1.8.24.0-rc1 Released.
+
+2013-09-18 19:54 +0000 [r399402] Kinsey Moore <kmoore@digium.com>
+
+ * main/abstract_jb.c: Fix jitter buffer log file creation This
+ adjusts '/'-to-'#' replacement to replace all instances of '/'
+ instead of just the first to ensure that the jitter buffer log
+ file gets the correct name as per Richard Kenner's suggestion.
+ (closes issue ASTERISK-21036) Reported by: Richard Kenner
+
+2013-09-18 17:15 +0000 [r399351] Matthew Jordan <mjordan@digium.com>
+
+ * build_tools/prep_tarball: Update prep_tarball with new
+ documentation files on the Asterisk wiki This will now pull both
+ a command reference for the version being prepared, as well as an
+ Admin Guide that applies to all versions of Asterisk. (issue
+ ASTERISK-22439) Reported by: Olle Johansson
+
+2013-09-18 01:32 +0000 [r399304] Michael L. Young <elgueromexicano@gmail.com>
+
+ * main/features.c: Fix Segfault When Syntax Of A Line Under
+ [applicationmap] Is Invalid When processing the lines under the
+ [applicationmap] context in features.conf, a segfault occurs from
+ attempting to process a line with an invalid syntax (basically
+ missing most of the arguments). Example: [applicationmap]
+ automon=*6 * This patch moves the checking for empty arguments to
+ before they are accessed. * Also, checked the "todo" comment and
+ removed it. Some applications do not require arguments. (closes
+ issue ASTERISK-22416) Reported by: CGI.NET Tested by: CGI.NET
+ Patches: asterisk-22416-check-syntax-first_v2.diff by Michael L.
+ Young (license 5026) Review:
+ https://reviewboard.asterisk.org/r/2803
+
+2013-09-16 16:37 +0000 [r399158] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_iax2.c: chan_iax2: Fix saving the wrong expiry time
+ in astdb. When a new IAX2 client registers, the astdb database is
+ updated with the value of minregexpire defined in iax.conf
+ instead of using the expiry time that is provided by the client.
+ The provided expiry time of the client is updated after inserting
+ the astdb entry. As a consequence, restarting or reloading
+ asterisk creates clients whose registration may expire before
+ they reregister. The clients are therefore unavailable after
+ minregexpire seconds until they reregister. * Move updating of
+ the expiry time to before inserting into the astdb. (closes issue
+ ASTERISK-22504) Reported by: Stefan Wachtler Patches:
+ chan_iax2.c.patch (license #6533) patch uploaded by Stefan
+ Wachtler
+
+2013-09-13 20:47 +0000 [r399098] David M. Lee <dlee@digium.com>
+
+ * main/astobj2.c: Don't write to /tmp/refs when REF_DEBUG is not
+ defined. If MALLOC_DEBUG is enabled, then the debug destructor
+ for the container is used, which would erroneously write to
+ /tmp/refs. This patch only uses the debug destructor if ref_debug
+ is used. (closes issue ASTERISK-22536)
+
+2013-09-13 13:31 +0000 [r399033] Kinsey Moore <kmoore@digium.com>
+
+ * apps/app_meetme.c: Fix several crashes in MeetMeAdmin This change
+ ensures that MeetMeAdmin commands requiring a user actually get a
+ user and fixes another issue where an extra dereference could
+ occur for a last-entered user being ejected if a user identifier
+ was also provided. (closes issue ASTERISK-21907) Reported by:
+ Alex Epshteyn Review: https://reviewboard.asterisk.org/r/2844/
+
+2013-09-12 20:09 +0000 [r398937-398977] Jonathan Rose <jrose@digium.com>
+
+ * channels/sip/include/sip.h, channels/chan_sip.c: chan_sip: Revert
+ r398835 due to failing tests involving originate (issue
+ ASTERISK-22424) Reported by: Jonathan Rose
+
+ * res/res_musiconhold.c: res_musiconhold: Fix reference leaks
+ caused when reloading with REF_DEBUG set Due to a faulty function
+ for debugging reference decrementing, it was possible to reduce
+ the refcount on the wrong object if two moh classes of the same
+ name were in the moh class container. (closes issue
+ ASTERISK-22252) Reported by: Walter Doekes Patches:
+ 18_moh_debug_ref_patch.diff Uploaded by Jonathan Rose (license
+ 6182)
+
+2013-09-12 00:00 +0000 [r398880-398884] Rusty Newton <rnewton@digium.com>
+
+ * apps/app_queue.c: 'queue add member' help text correction You are
+ adding dial strings to the queue, not channels. An aribitrary
+ string could be used, but you are typically referencing a
+ channel. Correcting the command help text. (issue ASTERISK-22263)
+ (closes issue ASTERISK-22263) Reported By: Rusty Newton
+
+ * configs/chan_dahdi.conf.sample: Documentation fix -
+ waitfordialtone is not boolean, it's time in milliseconds
+ Changing text in chan_dahdi.conf sample to be accurate. (issue
+ ASTERISK-22308) (closes issue ASTERISK-22308) Reported By:
+ Malcolm Davenport
+
+2013-09-11 19:39 +0000 [r398835] Jonathan Rose <jrose@digium.com>
+
+ * channels/sip/include/sip.h, channels/chan_sip.c: chan_sip: Reject
+ calls without prior SDP on 200 OK If we receive a 200 OK without
+ SDP, we will now check to see if the remote address has been
+ established for that channel's RTP session and if the to tag for
+ that channel has changed from the most recent to tag in a
+ response less than 200. If either a change has been made since
+ the last to-tag was received or the remote address is unset, then
+ we will drop the call. (closes issue ASTERISK-22424) Reported by:
+ Jonathan Rose Review:
+ https://reviewboard.asterisk.org/r/2827/diff/#index_header
+
+2013-09-10 17:53 +0000 [r398757] Richard Mudgett <rmudgett@digium.com>
+
+ * main/xmldoc.c, main/cli.c, funcs/func_dialgroup.c, main/heap.c,
+ main/event.c, res/res_musiconhold.c, main/indications.c,
+ main/asterisk.c: Fix incorrect usages of ast_realloc(). There are
+ several locations in the code base where this is done: buf =
+ ast_realloc(buf, new_size); This is going to leak the original
+ buf contents if the realloc fails. Review:
+ https://reviewboard.asterisk.org/r/2832/
+
+2013-09-10 17:47 +0000 [r398748-398752] David M. Lee <dlee@digium.com>
+
+ * utils/check_expr.c: Fixed utils directory breakage from r398748,
+ this time with extra hate.
+
+ * utils/check_expr.c, utils/ael_main.c, utils/conf2ael.c: Fixed
+ utils directory breakage from r398648
+
+2013-09-09 23:15 +0000 [r398703] Richard Mudgett <rmudgett@digium.com>
+
+ * main/astmm.c: MALLOC_DEBUG: Change fence magic number to be
+ completely different from the freed magic number. Race conditions
+ between freeing a nul terminated string and ast_strdup()'ing it
+ are more likely to be detected if the fence and freed magic
+ numbers are completely different.
+
+2013-09-09 19:56 +0000 [r398648] David M. Lee <dlee@digium.com>
+
+ * main/utils.c, include/asterisk/lock.h, main/lock.c: Fix
+ DEBUG_THREADS when lock is acquired in __constructor__ This patch
+ fixes some long-standing bugs in debug threads that were
+ exacerbated with recent Optional API work in Asterisk 12. With
+ debug threads enabled, on some systems, there's a lock ordering
+ problem between our mutex and glibc's mutex protecting its module
+ list (Ubuntu Lucid, glibc 2.11.1 in this instance). In one
+ thread, the module list will be locked before acquiring our
+ mutex. In another thread, our mutex will be locked before locking
+ the module list (which happens in the depths of calling
+ backtrace()). This patch fixes this issue by moving backtrace()
+ calls outside of critical sections that have the mutex acquired.
+ The bigger change was to reentrancy tracking for
+ ast_cond_{timed,}wait, which wrongly assumed that waiting on the
+ mutex was equivalent to a single unlock (it actually suspends all
+ recursive locks on the mutex). (closes issue ASTERISK-22455)
+ Review: https://reviewboard.asterisk.org/r/2824/
+
+2013-09-06 20:56 +0000 [r398523-398576] Kinsey Moore <kmoore@digium.com>
+
+ * res/res_jabber.c: Commit the remainder of r398523 This is a
+ missing part of the commit in revision 398523 that corrects the
+ name of a variable. (issue ASTERISK-22435)
+
+ * res/res_jabber.c: Fix Jabber/XMPP distributed MWI The mailbox and
+ context are swapped on the receiving end for all users of Jabber
+ and XMPP distributed MWI in Asterisk 1.8 and all more recent
+ versions. This swaps those values to be correct when publishing
+ to the internal event system from Jabber/XMPP distributed MWI
+ state. (closes issue ASTERISK-22435) Reported by: abelbeck Tested
+ by: Michael Keuter Patches:
+ asterisk-1.8-res_jabber-aji_handle_pubsub_event.patch uploaded by
+ abelbeck asterisk-11-res_xmpp-xmpp_pubsub_handle_event.patch
+ uploaded by abelbeck
+
+2013-09-05 19:00 +0000 [r398235-398456] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_iax2.c: chan_iax2: Reduce indentation in
+ __attempt_transmit(). * Reduce indentation in
+ __attempt_transmit(). * Don't update the static last error time
+ variable every time in __schedule_action() and socket_read().
+
+ * channels/chan_iax2.c: chan_iax2: Fix stray reference to worker
+ thread idle_list. * Fix stray reference to idle_list in
+ cleanup_thread_list(). This may be the reason for the note in
+ iax2_process_thread() about threads not being removed from the
+ task lists. * Move cleanup_thread_list(&idle_list) to after the
+ other lists are cleaned up.
+
+ * channels/chan_iax2.c: chan_iax2: Fix bridgecallno deadlock
+ avoidance. * Fix bridgecallno deadlock avoidance. When doing
+ deadlock avoidance, you need to retest the status of values for
+ each loop to see if you still need the lock for bridgecallno. *
+ As a safety check, after acquiring the bridgecallno lock you
+ should check if iaxs[bridgecallno] is NULL just like the current
+ callno checks. * Move setting thread->iostate to IAX_IOSTATE_IDLE
+ to after processing any deferred frames to ensure that the
+ iostate is IDLE when it is placed back into the idle list.
+ defer_full_frame() tries to ensure iax2_process_thread() wakes up
+ to process the frame.
+
+ * channels/iax2-parser.c: chan_iax2: Add missing control frame
+ names to debug frame decode output. (Part 2)
+
+ * channels/iax2-parser.c: chan_iax2: Add missing control frame
+ names to debug frame decode output.
+
+ * channels/chan_misdn.c: chan_misdn: Fix misdn debug output printed
+ with arbitrary verbose levels. Fix the misdn debug output to
+ remote consoles. chan_misdn uses ast_console_puts() which doesn't
+ know about verbose levels. Better to use ast_verbose() instead.
+ Without this patch the misdn debug messages are appended to the
+ verbose level which ever was set by the message sent to the
+ console before, i.e. any undefined level. (closes issue AST-1218)
+ Reported by: Guenther Kelleter Patches: misdnlog.patch (license
+ #6372) patch uploaded by Guenther Kelleter
+
+2013-09-02 07:24 +0000 [r398167] Walter Doekes <walter+asterisk@wjd.nu>
+
+ * cel/cel_custom.c: Be a little more verbose when loading
+ cel_custom.conf. Review: https://reviewboard.asterisk.org/r/2805/
+
+2013-08-30 18:55 +0000 [r398021-398102] Kevin Harwell <kharwell@digium.com>
+
+ * channels/chan_sip.c, main/config.c, res/res_security_log.c: Fix
+ various memory leaks main/config.c - cleanup cache fie includes
+ res/res_security_log.c - unregister logger level
+ channesl/chan_sip.c - cleanup io context and notify_types (closes
+ issues ASTERISK-22378) Reported by: Corey Farrell Patches:
+ config_shutdown.patch uploaded by coreyfarrell (license 5909)
+ res_security_log.patch uploaded by coreyfarrell (license 5909)
+ chan_sip-1.8.patch uploaded by coreyfarrell (license 5909)
+
+ * main/manager.c, res/res_agi.c: Memory leak fix
+ ast_xmldoc_printable returns an allocated block that must be
+ freed by the caller. Fixed manager.c and res_agi.c to stop
+ leaking these results. (closes issue ASTERISK-22395) Reported by:
+ Corey Farrell Patches: manager-leaks-1.8.patch uploaded by
+ coreyfarrell (license 5909) res_agi-xmldoc-leaks.patch uploaded
+ by coreyfarrell (license 5909)
+
+ * main/features.c: Fix memory leak Fixed a features.c test that
+ leaked a reference to a parked call. This caused chancount to
+ never reach 0, so graceful shutdown stops. Also added an
+ unregister test. (closes issue ASTERISK-22413) Reported by: Corey
+ Farrell Patches: features-TEST_FRAMEWORK.patch uploaded by
+ coreyfarrell (license 5909)
+
+2013-08-30 16:46 +0000 [r398018] Richard Mudgett <rmudgett@digium.com>
+
+ * tests/test_substitution.c: test_substituition: Fix failed test
+ reporting to actually report failure. You cannot put the "Testing
+ <blah> pass/fail" on a single line before actually performing the
+ test. Now any additional failure information is logged before the
+ test pass/fail announcement. * Added an additional CDR(answer,u)
+ test.
+
+2013-08-27 17:55 +0000 [r397710-397756] Matthew Jordan <mjordan@digium.com>
+
+ * channels/chan_sip.c: AST-2013-005: Fix crash caused by invalid
+ SDP If the SIP channel driver processes an invalid SDP that
+ defines media descriptions before connection information, it may
+ attempt to reference the socket address information even though
+ that information has not yet been set. This will cause a crash.
+ This patch adds checks when handling the various media
+ descriptions that ensures the media descriptions are handled only
+ if we have connection information suitable for that media. Thanks
+ to Walter Doekes, OSSO B.V., for reporting, testing, and
+ providing the solution to this problem. (closes issue
+ ASTERISK-22007) Reported by: wdoekes Tested by: wdoekes patches:
+ issueA22007_sdp_without_c_death.patch uploaded by wdoekes
+ (License 5674)
+
+ * channels/chan_sip.c: AST-2013-004: Fix crash when handling ACK on
+ dialog that has no channel A remote exploitable crash
+ vulnerability exists in the SIP channel driver if an ACK with SDP
+ is received after the channel has been terminated. The handling
+ code incorrectly assumed that the channel would always be
+ present. This patch adds a check such that the SDP will only be
+ parsed and applied if Asterisk has a channel present that is
+ associated with the dialog. Note that the patch being applied was
+ modified only slightly from the patch provided by Walter Doekes
+ of OSSO B.V. (closes issue ASTERISK-21064) Reported by: Colin
+ Cuthbertson Tested by: wdoekes, Colin Cutherbertson patches:
+ issueA21064_fix.patch uploaded by wdoekes (License 5674)
+
+2013-08-23 15:34 +0000 [r397525] Richard Mudgett <rmudgett@digium.com>
+
+ * include/asterisk/astmm.h, main/logger.c, main/utils.c,
+ include/asterisk/lock.h, main/astmm.c, channels/sig_pri.c,
+ main/astobj2.c, include/asterisk/logger.h, main/lock.c,
+ include/asterisk/utils.h: Fix memory corruption when trying to
+ get "core show locks". Review
+ https://reviewboard.asterisk.org/r/2580/ tried to fix the
+ mismatch in memory pools but had a math error determining the
+ buffer size and didn't address other similar memory pool
+ mismatches. * Effectively reverted the previous patch to go in
+ the same direction as trunk for the returned memory pool of
+ ast_bt_get_symbols(). * Fixed memory leak in ast_bt_get_symbols()
+ when BETTER_BACKTRACES is defined. * Fixed some formatting in
+ ast_bt_get_symbols(). * Fixed sig_pri.c freeing memory allocated
+ by libpri when MALLOC_DEBUG is enabled. * Fixed
+ __dump_backtrace() freeing memory from ast_bt_get_symbols() when
+ MALLOC_DEBUG is enabled. * Moved __dump_backtrace() because of
+ compile issues with the utils directory. (closes issue
+ ASTERISK-22221) Reported by: Matt Jordan Review:
+ https://reviewboard.asterisk.org/r/2778/
+
+2013-08-22 08:19 +0000 [r397377] Walter Doekes <walter+asterisk@wjd.nu>
+
+ * default.exports, main/asterisk.exports.in: Add _IO_stdin_used in
+ version-script to fix SIGBUSes on Sparc. The
+ --version-script,asterisk.exports linker flag (and the module
+ exports) didn't provide _IO_stdin_used in the list of exported
+ symbols. That causes some kind of libc compatibility mode to kick
+ in, where stdio file structures (stdout/stderr) land somewhere
+ else. In the case of the Sparc, they landed on misaligned memory.
+ This became apparent first after r376428 (Reorder startup
+ sequence) when a lot of ast_log's were replaced with fprintf's.
+ Writing to stderr triggered a SIGBUS. (Compared to x86 and amd64
+ architectures, the Sparc is very picky about memory alignment.)
+ (issue ASTERISK-21763) (issue ASTERISK-21665) Reported by: Jeremy
+ Kister Review: https://reviewboard.asterisk.org/r/2760/
+
+2013-08-21 17:00 +0000 [r397308] David M. Lee <dlee@digium.com>
+
+ * main/http.c: Complete http_shutdown. This patch frees up some
+ resources allocated in http.c. * tcp listeners stopped * tls
+ settings freed * uri redirects freed * unregister internal http.c
+ uri's (closes issue ASTERISK-22237) Reported by: Corey Farrell
+ Patches: http.patch uploaded by Corey Farrell (license 5909)
+
+2013-08-21 14:56 +0000 [r397256] Matthew Jordan <mjordan@digium.com>
+
+ * include/asterisk/frame.h: Set 14400 as the default max bit rate
+ if T38MaxBitRate is not specified If an endpoint fails to include
+ the T38MaxBitRate attribute during negotiation, Asterisk will
+ negotiate a bit rate of 2400 instead of the ITU recommended bit
+ rate of 14400. This patch fixes this by making AST_T38_RATE_14400
+ the 'default' value of the enum by assigning it a value of 0,
+ such that if an endpoint fails to include the attribute, the
+ default will be 14400. Note that Walter Doekes included the nice
+ comment in frame.h about why we are purposefully assigning
+ AST_T38_RATE_14400 a value of 0. (closes issue ASTERISK-22275)
+ Reported by: Andreas Steinmetz patches: fax-fix.patch uploaded by
+ anstein (License 6523)
+
+2013-08-21 02:09 +0000 [r397204] Michael L. Young <elgueromexicano@gmail.com>
+
+ * channels/chan_sip.c: Fix Not Storing Current Incoming Recv
+ Address In 1.8, r384779 introduced a regression by retrieving an
+ old dialog and keeping the old recv address since recv was
+ already set. This has caused a problem when a proxy is involved
+ since responses to incoming requests from the proxy server, after
+ an outbound call is established, are never sent to the correct
+ recv address. In 11, r382322 introduced this regression. The fix
+ is to revert that change and always store the recv address on
+ incoming requests. Thank you Walter Doekes for helping to point
+ out this error and Mark Michelson for your input/review of the
+ fix. (closes issue ASTERISK-22071) Reported by: Alex Zarubin
+ Tested by: Alex Zarubin, Karsten Wemheuer Patches:
+ asterisk-22071-store-recvd-address.diff by Michael L. Young
+ (license 5026)
+
+2013-08-20 17:40 +0000 [r397112-397156] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Remove REF_DEBUG definition.
+
+ * channels/sip/dialplan_functions.c, channels/chan_sip.c: Fix
+ refcounting of sip_pvt in test_sip_rtpqos test and unlink it from
+ the list of pvts. (closes issue ASTERISK-22248) reported by Corey
+ Farrell patches: test_sip_rtpqos.patch uploaded by Corey Farrell
+ (license #5909)
+
+2013-08-20 15:26 +0000 [r397033-397106] Kinsey Moore <kmoore@digium.com>
+
+ * main/threadstorage.c, main/astfd.c: Unregister CLI commands on
+ exit This patch ensures that CLI commands enabled by
+ DEBUG_FD_LEAKS and DEBUG_THREADLOCALS are cleaned up properly on
+ exit. (closes issue ASTERISK-22238) Reported by: Corey Farrell
+ Tested by: Corey Farrell Patches: debug_cli_unregister.patch
+ uploaded by Corey Farrell
+
+ * main/xmldoc.c: Fix xmldoc memory leak This fixes a
+ single-attribute memory leak that was occurring when the
+ "required" attribute was not true. (closes issue ASTERISK-22249)
+ Reported by: Corey Farrell Tested by: Corey Farrell Patches:
+ xmldoc-free_attr_required.patch uploaded by Corey Farrell
+
+ * main/cel.c: Protect CEL from an invalid config on reload This
+ patch fixes CEL to properly handle an invalid config on reload.
+ (closes issue ASTERISK-22259) Reported by: Corey Farrell Tested
+ by: Corey Farrell Patches: cel-config.patch uploaded by Corey
+ Farrell
+
+2013-08-20 11:46 +0000 [r396994] Walter Doekes <walter+asterisk@wjd.nu>
+
+ * configs/h323.conf.sample, configs/sip.conf.sample: Add
+ "autoframing" option to sip.conf.sample and h323.conf.sample. The
+ autoframing option was added to chan_sip.c in r43243 (mogorman,
+ 2006-09-19 01:32:57), but never made its way into the sample
+ configs. Review: https://reviewboard.asterisk.org/r/2768/
+
+2013-08-20 01:17 +0000 [r396958] Matthew Jordan <mjordan@digium.com>
+
+ * main/data.c: Fix invalid access to disposed memory in main/data
+ unit test It is not safe to iterate over a macro'd list of ao2
+ objects, deref them such that the item's destructor is called,
+ and leave them in the list. The list macro to iterate over items
+ requires the item to be a valid allocated object in order to
+ proceed to the next item; with MALLOC_DEBUG on the corruption of
+ the linked list is caught in the crash. This patch fixes the
+ invalid access to free'd memory by removing the ao2 item from the
+ list before de-refing it. Note that this is a backport of r396915
+ from Asterisk trunk.
+
+2013-08-15 16:21 +0000 [r396745] Kinsey Moore <kmoore@digium.com>
+
+ * main/cli.c, main/asterisk.c: Remove leading spaces from the CLI
+ command before parsing If you've mistakenly put a space before
+ typing in a command, the leading space will be included as part
+ of the command, and the command parser will not find the
+ corresponding command. This patch rectifies that situation by
+ stripping the leading spaces on commands. Review:
+ https://reviewboard.asterisk.org/r/2709/ Patch-by: Tilghman
+ Lesher
+
+2013-08-14 19:05 +0000 [r396619-396656] Joshua Colp <jcolp@digium.com>
+
+ * tests/test_hashtab_thrash.c: Tweak comment for why usleep is
+ used.
+
+ * tests/test_hashtab_thrash.c: Tweak test_hashtab_thrash test to
+ allow the critical threads to execute. Depending on certain
+ conditions it was possible for the hashtab counting thread to
+ starve other threads, preventing them from executing in the
+ expected fashion. This change adds a sleep to allow the others to
+ do what they need to do. While this doesn't thrash the hashtab as
+ much as previously, it at least works. (closes issue
+ ASTERISK-22276) Reported by: Matt Jordan
+
+2013-08-13 18:44 +0000 [r396579-396582] Walter Doekes <walter+asterisk@wjd.nu>
+
+ * channels/chan_sip.c: chan_sip: Convert 'just did sched_add
+ waitid...' from warning to debug message. Patches:
+ reviewboard-2377.patch uploaded by Paul Belanger Review:
+ https://reviewboard.asterisk.org/r/2377/
+
+ * channels/chan_sip.c: chan_sip: Fix IP-addr in warning when
+ rejecting a contact ACL. Patches: reviewboard-2155.patch uploaded
+ by Paul Belanger Review: https://reviewboard.asterisk.org/r/2155/
+
+2013-08-08 20:14 +0000 [r396427] Walter Doekes <walter+asterisk@wjd.nu>
+
+ * main/logger.c, main/utils.c, main/astobj2.c,
+ include/asterisk/logger.h: Consistent memory allocation by
+ ast_bt_get_symbols. Always use ast_alloc/ast_free. This is
+ handled differently in trunk (r391012). Review:
+ https://reviewboard.asterisk.org/r/2580/
+
+2013-08-06 08:14 +0000 [r396279] Walter Doekes <walter+asterisk@wjd.nu>
+
+ * pbx/pbx_dundi.c, utils/extconf.c, apps/app_stack.c,
+ apps/app_playback.c, funcs/func_global.c, main/cdr.c,
+ pbx/pbx_loopback.c, main/pbx.c, funcs/func_strings.c: Check
+ result of ast_var_assign() calls for memory allocation failure.
+ We try to keep the system running even when all available memory
+ is spent. Review: https://reviewboard.asterisk.org/r/2734/
+
+2013-08-05 20:17 +0000 [r396196-396240] Michael L. Young <elgueromexicano@gmail.com>
+
+ * channels/chan_sip.c: Fix Registration Failure When A Peer And TLS
+ Are Used If a peer is used in a register line and TLS is defined
+ as the transport, the registration fails since the transport on
+ the dialog is never set properly resulting in UDP being used
+ instead of TLS. This patch sets the dialog's transport based on
+ the transport that was defined in the register line. If the
+ register line does not specify a transport, the parsing function
+ for the register line always defaults back to UDP. (closes issue
+ ASTERISK-21964) Reported by: Doug Bailey Tested by: Doug Bailey
+ Patches: asterisk-21964-set-reg-dialog-transport.diff by Michael
+ L. Young (license 5026)
+
+ * channels/chan_sip.c: Restore Extra Line Break Between Peers When
+ Running AMI Action SIPPeers The commit (r387133) for fixing
+ ASTERISK-21466 accidentally removed an extra line break between
+ the peers returned by the AMI action SIPPeers. This results in
+ some parsers breaking because they expect this extra line break.
+ This patch restores that extra line break. (closes issue
+ ASTERISK-22239) Reported by: Jacek Konieczny Tested by: Jacek
+ Konieczny, Michael L. Young Patches:
+ asterisk-ami_sippeers_separator.patch by Jacek Konieczny (license
+ 6298)
+
+ * UPGRADE.txt: Adding a note to UPGRADE.txt about a change made to
+ res_agi in order to indicate when streaming an audio file fails
+ like it is done in other parts of the code to indicate an error.
+ Note was requested by Paul Belanger:
+ http://lists.digium.com/pipermail/asterisk-dev/2013-July/061420.html
+ (related to issue ASTERISK-21903)
+
+2013-07-22 13:49 +0000 [r394886-395032] Matthew Jordan <mjordan@digium.com>
+
+ * main/asterisk.c: Update copyright year to 2013 in asterisk.c;
+ some whitespace fixes (closes issue ASTERISK-22179) Reported by:
+ Malcolm Davenport
+
+ * funcs/func_channel.c: Clean up documentation This patch cleans up
+ documentation in func_channel for the following items: *
+ rtpsource * secure_signaling * secure_media (closes issue
+ ASTERISK-20969) Reported by: snuffy patches:
+ func_chan-update.diff uploaded by snuffy (License 5024)
+
+ * configs/indications.conf.sample: Provide proper ring tone in
+ indications.conf for Malaysia The ring tone provided in the
+ sample indications.conf was incorrect. This patch modifies the
+ sample ring tone to be what it should: ring =
+ 425/400,0/200,425/400,0/2000 This brings it in line with the tone
+ definition in DAHDI 2.7.0. (zonedata.c) (closes issue
+ ASTERISK-21997) Reported by: Filip Jenicek patches:
+ malaysia_ring.patch uploaded by phill (License 6277)
+
+ * main/http.c: Tolerate presence of RFC2965 Cookie2 header by
+ ignoring it This patch modifies parsing of cookies in Asterisk's
+ http server by doing an explicit comparison of the "Cookie"
+ header instead of looking at the first 6 characters to determine
+ if the header is a cookie header. This avoids parsing "Cookie2"
+ headers and overwriting the previously parsed "Cookie" header.
+ Note that we probably should be appending the cookies in each
+ "Cookie" header to the parsed results; however, while clients can
+ send multiple cookie headers they never really do. While this
+ patch doesn't improve Asterisk's behavior in that regard, it
+ shouldn't make it any worse either. Note that the solution in
+ this patch was pointed out on the issue by the issue reporter,
+ Stuart Henderson. (closes issue ASTERISK-21789) Reported by:
+ Stuart Henderson Tested by: mjordan, Stuart Henderson
+
+ * contrib/realtime/postgresql/realtime.sql: Update PostgreSQL
+ realtime scripts with schema for queue_log table This patch
+ updates the realtime SQL scripts with an entry that will create
+ the queue_log table. This brings the PostgreSQL scripts inline
+ with the MySQL scripts, with respect to what tables they will
+ create. (closes issue ASTERISK-21021) Reported by: Eugene
+ patches: queue_log.sql uploaded by varnav (license 6360)
+
+ * configs/iax.conf.sample: Document connectedline parameter for
+ chan_iax2 The connectedline parameter for a chan_iax2 peer was
+ undocumented. This patch documents the options in the sample
+ configuration file. (closes issue ASTERISK-21953) Reported by:
+ Birger "WIMPy" Harzenetter
+
+2013-07-18 12:51 +0000 [r394640] Michael L. Young <elgueromexicano@gmail.com>
+
+ * res/res_agi.c: Properly indicate failure to open an audio stream
+ in res_agi If there is an error streaming an audio file, the
+ current return status makes it difficult for an AGI script to
+ determine that there was an error with the audio file. This
+ patches changes the result to return -1 and the function returns
+ RESULT_FAILURE instead of RESULT_SUCCESS. From looking at other
+ parts of res_agi, this would appear to be the proper way to
+ handle an error. (closes issue ASTERISK-21903) Reported by: Ariel
+ Wainer Tested by: Ariel Wainer Patches:
+ asterisk-21903-return-stream-res_1.8.diff by Michael L. Young
+ (license 5026) Review: https://reviewboard.asterisk.org/r/2625/
+
+2013-07-14 01:53 +0000 [r394302] Matthew Jordan <mjordan@digium.com>
+
+ * funcs/func_strings.c: Clarify documentation for function PASSTHRU
+ It is not apparent to the average user that the PASSTHRU function
+ should not be passed as ${PASSTHRU(string)} but just as
+ PASSTHRU(string) to functions which take a variable name and not
+ its contents. This patch clarifies the behavior in the
+ documentation and provides an example. (closes issue
+ ASTERISK-21717) Reported by: Richard Miller patches:
+ func_strings.diff uploaded by Richard Miller (license 5685)
+
+2013-07-11 16:25 +0000 [r394106] Moises Silva <moises.silva@gmail.com>
+
+ * channels/chan_dahdi.c: Fix a longstanding issue with MFC-R2
+ configuration that prevented users from mixing different variants
+ or general MFC-R2 settings within the same E1 line. Most users do
+ not have a problem with this since MFC-R2 lines are usually
+ fractional E1s, or the whole E1 has the same country variant and
+ R2 settings. In Venezuela however is common to have inbound
+ MFC-R2 and outbound DTMF-R2 within the same E1. This fix now
+ properly parses the chan_dahdi.conf file to generate a new openr2
+ context every time a new channel => section is found and the
+ configuration was changed. (closes issue ASTERISK-21117) Reported
+ by: Rafael Angulo Related Elastix issue:
+ http://bugs.elastix.org/view.php?id=1612
+
+2013-07-10 01:41 +0000 [r393928] Russell Bryant <russell@russellbryant.com>
+
+ * configs/sla.conf.sample, include/asterisk/utils.h,
+ apps/app_meetme.c: astobj2-ify the SLA code The SLA code within
+ app_meetme was written before asotbj2 had been merged into
+ Asterisk. Worse, support for reloads did not exist at first and
+ was added later as a bolt-on feature. I knew at the time that
+ reloading was not safe at all while SLA was in use, so the reload
+ would be queued up to execute when the system was idle.
+ Unfortunately, this approach was still prone to errors beyond the
+ fact that this was the only place in Asterisk where configuration
+ was not reloaded instantly when requested. This patch converts
+ various SLA objects to be reference counted objects using
+ astobj2. This allows reloads to be processed while the system is
+ in use. The code ensures that the objects will not disappear
+ while one of the other threads is using them. However, they will
+ be immediately removed from the global trunk and station
+ containers so no new calls will use them if removed from
+ configuration. Review: https://reviewboard.asterisk.org/r/2581/
+
+2013-07-03 23:27 +0000 [r393627] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c: chan_dahdi: Fix segfault reloading
+ chan_dahdi when round robin is used. * Clear round_robin[] in
+ dahdi_restart(). (closes issue ASTERISK-21847) Reported by: Ivo
+ Andonov Patches: jira_asterisk_21847_v1.8.patch (license #5621)
+ patch uploaded by rmudgett
+
+2013-06-14 16:14 +0000 [r391778] Jonathan Rose <jrose@digium.com>
+
+ * apps/app_mixmonitor.c: app_mixmonitor: Fix crashes caused by
+ unloading app_mixmonitor Unloading app_mixmonitor while active
+ mixmonitors were running would cause a segfault. This patch fixes
+ that by making it impossible to unload app_mixmonitor while
+ mixmonitors are active. Review:
+ https://reviewboard.asterisk.org/r/2624/
+
+2013-06-12 02:19 +0000 [r391489] Matthew Jordan <mjordan@digium.com>
+
+ * main/loader.c: Fix memory leak while loading priority modules
+ 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.
+
+2013-06-11 08:03 +0000 [r391333] Alec L Davis <sivad.a@paradise.net.nz>
+
+ * channels/chan_iax2.c: IAX2: Transfer Reject: Lock bridgecallno
+ before touching it, refactor 1). When touching the bridgecallno,
+ we need to lock it. 2). Remove magic number '0' and replace with
+ TRANSFER_NONE. 3). Exit early if no bridgecallno. 4). Reduce
+ indentation. Reported by: alecdavis Tested by: alecdavis
+ alecdavis (license 585) Review
+ https://reviewboard.asterisk.org/r/2613/
2013-07-15 Asterisk Development Team <asteriskteam@digium.com>
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/UPGRADE.txt
^
|
@@ -17,6 +17,11 @@
=== UPGRADE-1.6.txt -- Upgrade info for 1.4 to 1.6
===
===========================================================
+from 1.8.23.0 to 1.8.24.0:
+* res_agi will now properly indicate if there was an error in streaming an
+ audio file. The result code will be -1 and the result returned from the
+ the function will be RESULT_FAILURE instead of the prior behavior of always
+ returning RESULT_SUCCESS even if there was an error.
from 1.8.22.0 to 1.8.23.0:
* The default settings for chan_sip are now overriden properly by the general
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/apps/app_meetme.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 387688 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399033 $")
#include <dahdi/user.h>
@@ -832,17 +832,26 @@
/*! This option uses the values in the sla_hold_access enum and sets the
* access control type for hold on this station. */
unsigned int hold_access:1;
- /*! Use count for inside sla_station_exec */
- unsigned int ref_count;
+ /*! Mark used during reload processing */
+ unsigned int mark:1;
};
+/*!
+ * \brief A reference to a station
+ *
+ * This struct looks near useless at first glance. However, its existence
+ * in the list of stations in sla_trunk means that this station references
+ * that trunk. We use the mark to keep track of whether it needs to be
+ * removed from the sla_trunk's list of stations during a reload.
+ */
struct sla_station_ref {
AST_LIST_ENTRY(sla_station_ref) entry;
struct sla_station *station;
+ /*! Mark used during reload processing */
+ unsigned int mark:1;
};
struct sla_trunk {
- AST_RWLIST_ENTRY(sla_trunk) entry;
AST_DECLARE_STRING_FIELDS(
AST_STRING_FIELD(name);
AST_STRING_FIELD(device);
@@ -866,10 +875,16 @@
/*! Whether this trunk is currently on hold, meaning that once a station
* connects to it, the trunk channel needs to have UNHOLD indicated to it. */
unsigned int on_hold:1;
- /*! Use count for inside sla_trunk_exec */
- unsigned int ref_count;
+ /*! Mark used during reload processing */
+ unsigned int mark:1;
};
+/*!
+ * \brief A station's reference to a trunk
+ *
+ * An sla_station keeps a list of trunk_refs. This holds metadata about the
+ * stations usage of the trunk.
+ */
struct sla_trunk_ref {
AST_LIST_ENTRY(sla_trunk_ref) entry;
struct sla_trunk *trunk;
@@ -883,10 +898,12 @@
* station. This takes higher priority than a ring delay set at
* the station level. */
unsigned int ring_delay;
+ /*! Mark used during reload processing */
+ unsigned int mark:1;
};
-static AST_RWLIST_HEAD_STATIC(sla_stations, sla_station);
-static AST_RWLIST_HEAD_STATIC(sla_trunks, sla_trunk);
+static struct ao2_container *sla_stations;
+static struct ao2_container *sla_trunks;
static const char sla_registrar[] = "SLA";
@@ -898,10 +915,6 @@
SLA_EVENT_DIAL_STATE,
/*! The state of a ringing trunk has changed */
SLA_EVENT_RINGING_TRUNK,
- /*! A reload of configuration has been requested */
- SLA_EVENT_RELOAD,
- /*! Poke the SLA thread so it can check if it can perform a reload */
- SLA_EVENT_CHECK_RELOAD,
};
struct sla_event {
@@ -957,8 +970,6 @@
/*! Attempt to handle CallerID, even though it is known not to work
* properly in some situations. */
unsigned int attempt_callerid:1;
- /*! A reload has been requested */
- unsigned int reload:1;
} sla = {
.thread = AST_PTHREADT_NULL,
};
@@ -1719,7 +1730,8 @@
static char *sla_show_trunks(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- const struct sla_trunk *trunk;
+ struct ao2_iterator i;
+ struct sla_trunk *trunk;
switch (cmd) {
case CLI_INIT:
@@ -1737,12 +1749,17 @@
"=== Configured SLA Trunks ===================================\n"
"=============================================================\n"
"===\n");
- AST_RWLIST_RDLOCK(&sla_trunks);
- AST_RWLIST_TRAVERSE(&sla_trunks, trunk, entry) {
+ i = ao2_iterator_init(sla_trunks, 0);
+ for (; (trunk = ao2_iterator_next(&i)); ao2_ref(trunk, -1)) {
struct sla_station_ref *station_ref;
char ring_timeout[16] = "(none)";
- if (trunk->ring_timeout)
+
+ ao2_lock(trunk);
+
+ if (trunk->ring_timeout) {
snprintf(ring_timeout, sizeof(ring_timeout), "%u Seconds", trunk->ring_timeout);
+ }
+
ast_cli(a->fd, "=== ---------------------------------------------------------\n"
"=== Trunk Name: %s\n"
"=== ==> Device: %s\n"
@@ -1756,13 +1773,16 @@
ring_timeout,
trunk->barge_disabled ? "No" : "Yes",
sla_hold_str(trunk->hold_access));
- AST_RWLIST_RDLOCK(&sla_stations);
- AST_LIST_TRAVERSE(&trunk->stations, station_ref, entry)
+
+ AST_LIST_TRAVERSE(&trunk->stations, station_ref, entry) {
ast_cli(a->fd, "=== ==> Station name: %s\n", station_ref->station->name);
- AST_RWLIST_UNLOCK(&sla_stations);
+ }
+
ast_cli(a->fd, "=== ---------------------------------------------------------\n===\n");
+
+ ao2_unlock(trunk);
}
- AST_RWLIST_UNLOCK(&sla_trunks);
+ ao2_iterator_destroy(&i);
ast_cli(a->fd, "=============================================================\n\n");
return CLI_SUCCESS;
@@ -1784,7 +1804,8 @@
static char *sla_show_stations(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- const struct sla_station *station;
+ struct ao2_iterator i;
+ struct sla_station *station;
switch (cmd) {
case CLI_INIT:
@@ -1802,11 +1823,14 @@
"=== Configured SLA Stations =================================\n"
"=============================================================\n"
"===\n");
- AST_RWLIST_RDLOCK(&sla_stations);
- AST_RWLIST_TRAVERSE(&sla_stations, station, entry) {
+ i = ao2_iterator_init(sla_stations, 0);
+ for (; (station = ao2_iterator_next(&i)); ao2_ref(station, -1)) {
struct sla_trunk_ref *trunk_ref;
char ring_timeout[16] = "(none)";
char ring_delay[16] = "(none)";
+
+ ao2_lock(station);
+
if (station->ring_timeout) {
snprintf(ring_timeout, sizeof(ring_timeout),
"%u", station->ring_timeout);
@@ -1827,7 +1851,6 @@
S_OR(station->autocontext, "(none)"),
ring_timeout, ring_delay,
sla_hold_str(station->hold_access));
- AST_RWLIST_RDLOCK(&sla_trunks);
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
if (trunk_ref->ring_timeout) {
snprintf(ring_timeout, sizeof(ring_timeout),
@@ -1847,11 +1870,12 @@
trunkstate2str(trunk_ref->state),
ring_timeout, ring_delay);
}
- AST_RWLIST_UNLOCK(&sla_trunks);
ast_cli(a->fd, "=== ---------------------------------------------------------\n"
"===\n");
+
+ ao2_unlock(station);
}
- AST_RWLIST_UNLOCK(&sla_stations);
+ ao2_iterator_destroy(&i);
ast_cli(a->fd, "============================================================\n"
"\n");
@@ -1991,11 +2015,16 @@
struct sla_event *event;
if (sla.thread == AST_PTHREADT_NULL) {
+ ao2_ref(station, -1);
+ ao2_ref(trunk_ref, -1);
return;
}
- if (!(event = ast_calloc(1, sizeof(*event))))
+ if (!(event = ast_calloc(1, sizeof(*event)))) {
+ ao2_ref(station, -1);
+ ao2_ref(trunk_ref, -1);
return;
+ }
event->type = type;
event->trunk_ref = trunk_ref;
@@ -2029,6 +2058,7 @@
struct sla_station *station;
struct sla_trunk_ref *trunk_ref = NULL;
char *trunk_name;
+ struct ao2_iterator i;
trunk_name = ast_strdupa(conf->confno);
strsep(&trunk_name, "_");
@@ -2037,16 +2067,23 @@
return;
}
- AST_RWLIST_RDLOCK(&sla_stations);
- AST_RWLIST_TRAVERSE(&sla_stations, station, entry) {
+ i = ao2_iterator_init(sla_stations, 0);
+ while ((station = ao2_iterator_next(&i))) {
+ ao2_lock(station);
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
- if (trunk_ref->chan == chan && !strcmp(trunk_ref->trunk->name, trunk_name))
+ if (trunk_ref->chan == chan && !strcmp(trunk_ref->trunk->name, trunk_name)) {
+ ao2_ref(trunk_ref, 1);
break;
+ }
}
- if (trunk_ref)
+ ao2_unlock(station);
+ if (trunk_ref) {
+ /* station reference given to sla_queue_event_full() */
break;
+ }
+ ao2_ref(station, -1);
}
- AST_RWLIST_UNLOCK(&sla_stations);
+ ao2_iterator_destroy(&i);
if (!trunk_ref) {
ast_debug(1, "Trunk not found for event!\n");
@@ -4801,6 +4838,23 @@
res = -2;
goto usernotfound;
}
+ } else {
+ /* fail for commands that require a user */
+ switch (*args.command) {
+ case 'm': /* Unmute */
+ case 'M': /* Mute */
+ case 't': /* Lower user's talk volume */
+ case 'T': /* Raise user's talk volume */
+ case 'u': /* Lower user's listen volume */
+ case 'U': /* Raise user's listen volume */
+ case 'r': /* Reset user's volume level */
+ case 'k': /* Kick user */
+ res = -2;
+ ast_log(LOG_NOTICE, "No user specified!\n");
+ goto usernotfound;
+ default:
+ break;
+ }
}
switch (*args.command) {
@@ -4816,21 +4870,24 @@
case 101: /* e: Eject last user*/
{
int max_no = 0;
+ struct ast_conf_user *eject_user;
- /* If they passed in a user, disregard it */
- if (user) {
- ao2_ref(user, -1);
+ ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
+ eject_user = ao2_find(cnf->usercontainer, &max_no, 0);
+ if (!eject_user) {
+ res = -1;
+ ast_log(LOG_NOTICE, "No last user to kick!\n");
+ break;
}
- ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
- user = ao2_find(cnf->usercontainer, &max_no, 0);
- if (!ast_test_flag64(&user->userflags, CONFFLAG_ADMIN))
- user->adminflags |= ADMINFLAG_KICKME;
- else {
+ if (!ast_test_flag64(&eject_user->userflags, CONFFLAG_ADMIN)) {
+ eject_user->adminflags |= ADMINFLAG_KICKME;
+ } else {
res = -1;
ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
}
- ao2_ref(user, -1);
+
+ ao2_ref(eject_user, -1);
break;
}
case 77: /* M: Mute */
@@ -5292,34 +5349,41 @@
ast_config_destroy(cfg);
}
-/*! \brief Find an SLA trunk by name
- * \note This must be called with the sla_trunks container locked
+/*!
+ * \private
+ * \brief helper for RAII_VAR
*/
-static struct sla_trunk *sla_find_trunk(const char *name)
+static void unref_obj(void *obj)
{
- struct sla_trunk *trunk = NULL;
-
- AST_RWLIST_TRAVERSE(&sla_trunks, trunk, entry) {
- if (!strcasecmp(trunk->name, name))
- break;
+ if (obj) {
+ ao2_ref(obj, -1);
}
+}
+
+/*!
+ * \internal
+ * \brief Find an SLA trunk by name
+ */
+static struct sla_trunk *sla_find_trunk(const char *name)
+{
+ struct sla_trunk tmp_trunk = {
+ .name = name,
+ };
- return trunk;
+ return ao2_find(sla_trunks, &tmp_trunk, OBJ_POINTER);
}
-/*! \brief Find an SLA station by name
- * \note This must be called with the sla_stations container locked
+/*!
+ * \internal
+ * \brief Find an SLA station by name
*/
static struct sla_station *sla_find_station(const char *name)
{
- struct sla_station *station = NULL;
-
- AST_RWLIST_TRAVERSE(&sla_stations, station, entry) {
- if (!strcasecmp(station->name, name))
- break;
- }
+ struct sla_station tmp_station = {
+ .name = name,
+ };
- return station;
+ return ao2_find(sla_stations, &tmp_station, OBJ_POINTER);
}
static int sla_check_station_hold_access(const struct sla_trunk *trunk,
@@ -5343,9 +5407,11 @@
return 0;
}
-/*! \brief Find a trunk reference on a station by name
+/*!
+ * \brief Find a trunk reference on a station by name
* \param station the station
* \param name the trunk's name
+ * \pre sla_station is locked
* \return a pointer to the station's trunk reference. If the trunk
* is not found, it is not idle and barge is disabled, or if
* it is on hold and private hold is set, then NULL will be returned.
@@ -5372,16 +5438,32 @@
break;
}
+ if (trunk_ref) {
+ ao2_ref(trunk_ref, 1);
+ }
+
return trunk_ref;
}
+static void sla_station_ref_destructor(void *obj)
+{
+ struct sla_station_ref *station_ref = obj;
+
+ if (station_ref->station) {
+ ao2_ref(station_ref->station, -1);
+ station_ref->station = NULL;
+ }
+}
+
static struct sla_station_ref *sla_create_station_ref(struct sla_station *station)
{
struct sla_station_ref *station_ref;
- if (!(station_ref = ast_calloc(1, sizeof(*station_ref))))
+ if (!(station_ref = ao2_alloc(sizeof(*station_ref), sla_station_ref_destructor))) {
return NULL;
+ }
+ ao2_ref(station, 1);
station_ref->station = station;
return station_ref;
@@ -5394,12 +5476,48 @@
if (!(ringing_station = ast_calloc(1, sizeof(*ringing_station))))
return NULL;
+ ao2_ref(station, 1);
ringing_station->station = station;
ringing_station->ring_begin = ast_tvnow();
return ringing_station;
}
+static void sla_ringing_station_destroy(struct sla_ringing_station *ringing_station)
+{
+ if (ringing_station->station) {
+ ao2_ref(ringing_station->station, -1);
+ ringing_station->station = NULL;
+ }
+
+ ast_free(ringing_station);
+}
+
+static struct sla_failed_station *sla_create_failed_station(struct sla_station *station)
+{
+ struct sla_failed_station *failed_station;
+
+ if (!(failed_station = ast_calloc(1, sizeof(*failed_station)))) {
+ return NULL;
+ }
+
+ ao2_ref(station, 1);
+ failed_station->station = station;
+ failed_station->last_try = ast_tvnow();
+
+ return failed_station;
+}
+
+static void sla_failed_station_destroy(struct sla_failed_station *failed_station)
+{
+ if (failed_station->station) {
+ ao2_ref(failed_station->station, -1);
+ failed_station->station = NULL;
+ }
+
+ ast_free(failed_station);
+}
+
static enum ast_device_state sla_state_to_devstate(enum sla_trunk_state state)
{
switch (state) {
@@ -5422,18 +5540,25 @@
{
struct sla_station *station;
struct sla_trunk_ref *trunk_ref;
+ struct ao2_iterator i;
- AST_LIST_TRAVERSE(&sla_stations, station, entry) {
+ i = ao2_iterator_init(sla_stations, 0);
+ while ((station = ao2_iterator_next(&i))) {
+ ao2_lock(station);
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
if (trunk_ref->trunk != trunk || (inactive_only ? trunk_ref->chan : 0)
- || trunk_ref == exclude)
+ || trunk_ref == exclude) {
continue;
+ }
trunk_ref->state = state;
ast_devstate_changed(sla_state_to_devstate(state), AST_DEVSTATE_CACHABLE,
"SLA:%s_%s", station->name, trunk->name);
break;
}
+ ao2_unlock(station);
+ ao2_ref(station, -1);
}
+ ao2_iterator_destroy(&i);
}
struct run_station_args {
@@ -5451,8 +5576,8 @@
static void *run_station(void *data)
{
- struct sla_station *station;
- struct sla_trunk_ref *trunk_ref;
+ RAII_VAR(struct sla_station *, station, NULL, unref_obj);
+ RAII_VAR(struct sla_trunk_ref *, trunk_ref, NULL, unref_obj);
struct ast_str *conf_name = ast_str_create(16);
struct ast_flags64 conf_flags = { 0 };
struct ast_conference *conf;
@@ -5495,6 +5620,8 @@
return NULL;
}
+static void sla_ringing_trunk_destroy(struct sla_ringing_trunk *ringing_trunk);
+
static void sla_stop_ringing_trunk(struct sla_ringing_trunk *ringing_trunk)
{
char buf[80];
@@ -5504,10 +5631,11 @@
admin_exec(NULL, buf);
sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL);
- while ((station_ref = AST_LIST_REMOVE_HEAD(&ringing_trunk->timed_out_stations, entry)))
- ast_free(station_ref);
+ while ((station_ref = AST_LIST_REMOVE_HEAD(&ringing_trunk->timed_out_stations, entry))) {
+ ao2_ref(station_ref, -1);
+ }
- ast_free(ringing_trunk);
+ sla_ringing_trunk_destroy(ringing_trunk);
}
static void sla_stop_ringing_station(struct sla_ringing_station *ringing_station,
@@ -5542,7 +5670,7 @@
}
done:
- ast_free(ringing_station);
+ sla_ringing_station_destroy(ringing_station);
}
static void sla_dial_state_callback(struct ast_dial *dial)
@@ -5594,8 +5722,10 @@
if (rm)
AST_LIST_REMOVE_CURRENT(entry);
- if (trunk_ref)
+ if (trunk_ref) {
+ ao2_ref(s_trunk_ref, 1);
*trunk_ref = s_trunk_ref;
+ }
break;
}
@@ -5613,7 +5743,7 @@
struct sla_ringing_station *ringing_station;
AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_stations, ringing_station, entry) {
- struct sla_trunk_ref *s_trunk_ref = NULL;
+ RAII_VAR(struct sla_trunk_ref *, s_trunk_ref, NULL, unref_obj);
struct sla_ringing_trunk *ringing_trunk = NULL;
struct run_station_args args;
enum ast_dial_result dial_res;
@@ -5646,7 +5776,7 @@
ast_dial_join(ringing_station->station->dial);
ast_dial_destroy(ringing_station->station->dial);
ringing_station->station->dial = NULL;
- ast_free(ringing_station);
+ sla_ringing_station_destroy(ringing_station);
break;
}
/* Track the channel that answered this trunk */
@@ -5657,12 +5787,14 @@
/* Now, start a thread that will connect this station to the trunk. The rest of
* the code here sets up the thread and ensures that it is able to save the arguments
* before they are no longer valid since they are allocated on the stack. */
+ ao2_ref(s_trunk_ref, 1);
args.trunk_ref = s_trunk_ref;
+ ao2_ref(ringing_station->station, 1);
args.station = ringing_station->station;
args.cond = &cond;
args.cond_lock = &cond_lock;
- ast_free(ringing_trunk);
- ast_free(ringing_station);
+ sla_ringing_trunk_destroy(ringing_trunk);
+ sla_ringing_station_destroy(ringing_station);
ast_mutex_init(&cond_lock);
ast_cond_init(&cond, NULL);
ast_mutex_lock(&cond_lock);
@@ -5716,7 +5848,7 @@
continue;
if (ast_tvdiff_ms(ast_tvnow(), failed_station->last_try) > 1000) {
AST_LIST_REMOVE_CURRENT(entry);
- ast_free(failed_station);
+ sla_failed_station_destroy(failed_station);
break;
}
res = 1;
@@ -5769,11 +5901,9 @@
if (res != AST_DIAL_RESULT_TRYING) {
struct sla_failed_station *failed_station;
ast_dial_destroy(dial);
- if (!(failed_station = ast_calloc(1, sizeof(*failed_station))))
- return -1;
- failed_station->station = station;
- failed_station->last_try = ast_tvnow();
- AST_LIST_INSERT_HEAD(&sla.failed_stations, failed_station, entry);
+ if ((failed_station = sla_create_failed_station(station))) {
+ AST_LIST_INSERT_HEAD(&sla.failed_stations, failed_station, entry);
+ }
return -1;
}
if (!(ringing_station = sla_create_ringing_station(station))) {
@@ -5813,6 +5943,8 @@
break;
}
+ ao2_ref(trunk_ref, 1);
+
return trunk_ref;
}
@@ -5824,7 +5956,7 @@
static int sla_check_station_delay(struct sla_station *station,
struct sla_ringing_trunk *ringing_trunk)
{
- struct sla_trunk_ref *trunk_ref;
+ RAII_VAR(struct sla_trunk_ref *, trunk_ref, NULL, unref_obj);
unsigned int delay = UINT_MAX;
int time_left, time_elapsed;
@@ -5917,7 +6049,7 @@
ast_dial_join(ringing_station->station->dial);
ast_dial_destroy(ringing_station->station->dial);
ringing_station->station->dial = NULL;
- ast_free(ringing_station);
+ sla_ringing_station_destroy(ringing_station);
}
}
AST_LIST_TRAVERSE_SAFE_END
@@ -6074,8 +6206,10 @@
{
struct sla_station *station;
int res = 0;
+ struct ao2_iterator i;
- AST_LIST_TRAVERSE(&sla_stations, station, entry) {
+ i = ao2_iterator_init(sla_stations, 0);
+ for (; (station = ao2_iterator_next(&i)); ao2_ref(station, -1)) {
struct sla_ringing_trunk *ringing_trunk;
int time_left;
@@ -6105,6 +6239,7 @@
if (time_left < *timeout)
*timeout = time_left;
}
+ ao2_iterator_destroy(&i);
return res;
}
@@ -6146,50 +6281,19 @@
return 1;
}
-static int sla_load_config(int reload);
-
-/*! \brief Check if we can do a reload of SLA, and do it if we can */
-static void sla_check_reload(void)
+static void sla_event_destroy(struct sla_event *event)
{
- struct sla_station *station;
- struct sla_trunk *trunk;
-
- ast_mutex_lock(&sla.lock);
-
- if (!AST_LIST_EMPTY(&sla.event_q) || !AST_LIST_EMPTY(&sla.ringing_trunks)
- || !AST_LIST_EMPTY(&sla.ringing_stations) || !AST_LIST_EMPTY(&sla.failed_stations)) {
- ast_mutex_unlock(&sla.lock);
- return;
- }
-
- AST_RWLIST_RDLOCK(&sla_stations);
- AST_RWLIST_TRAVERSE(&sla_stations, station, entry) {
- if (station->ref_count)
- break;
- }
- AST_RWLIST_UNLOCK(&sla_stations);
- if (station) {
- ast_mutex_unlock(&sla.lock);
- return;
+ if (event->trunk_ref) {
+ ao2_ref(event->trunk_ref, -1);
+ event->trunk_ref = NULL;
}
- AST_RWLIST_RDLOCK(&sla_trunks);
- AST_RWLIST_TRAVERSE(&sla_trunks, trunk, entry) {
- if (trunk->ref_count || trunk->chan || trunk->active_stations || trunk->hold_stations) {
- break;
- }
- }
- AST_RWLIST_UNLOCK(&sla_trunks);
- if (trunk) {
- ast_mutex_unlock(&sla.lock);
- return;
+ if (event->station) {
+ ao2_ref(event->station, -1);
+ event->station = NULL;
}
- /* yay */
- sla_load_config(1);
- sla.reload = 0;
-
- ast_mutex_unlock(&sla.lock);
+ ast_free(event);
}
static void *sla_thread(void *data)
@@ -6228,27 +6332,21 @@
case SLA_EVENT_RINGING_TRUNK:
sla_handle_ringing_trunk_event();
break;
- case SLA_EVENT_RELOAD:
- sla.reload = 1;
- case SLA_EVENT_CHECK_RELOAD:
- break;
}
- ast_free(event);
+ sla_event_destroy(event);
ast_mutex_lock(&sla.lock);
}
-
- if (sla.reload) {
- sla_check_reload();
- }
}
ast_mutex_unlock(&sla.lock);
- while ((ringing_station = AST_LIST_REMOVE_HEAD(&sla.ringing_stations, entry)))
- ast_free(ringing_station);
+ while ((ringing_station = AST_LIST_REMOVE_HEAD(&sla.ringing_stations, entry))) {
+ sla_ringing_station_destroy(ringing_station);
+ }
- while ((failed_station = AST_LIST_REMOVE_HEAD(&sla.failed_stations, entry)))
- ast_free(failed_station);
+ while ((failed_station = AST_LIST_REMOVE_HEAD(&sla.failed_stations, entry))) {
+ sla_failed_station_destroy(failed_station);
+ }
return NULL;
}
@@ -6269,7 +6367,8 @@
char conf_name[MAX_CONFNUM];
struct ast_conference *conf;
struct ast_flags64 conf_flags = { 0 };
- struct sla_trunk_ref *trunk_ref = args->trunk_ref;
+ RAII_VAR(struct sla_trunk_ref *, trunk_ref, args->trunk_ref, unref_obj);
+ RAII_VAR(struct sla_station *, station, args->station, unref_obj);
int caller_is_saved;
struct ast_party_caller caller;
int last_state = 0;
@@ -6341,8 +6440,8 @@
break;
/* check that SLA station that originated trunk call is still alive */
- if (args->station && ast_device_state(args->station->device) == AST_DEVICE_NOT_INUSE) {
- ast_debug(3, "Originating station device %s no longer active\n", args->station->device);
+ if (station && ast_device_state(station->device) == AST_DEVICE_NOT_INUSE) {
+ ast_debug(3, "Originating station device %s no longer active\n", station->device);
trunk_ref->trunk->chan = NULL;
break;
}
@@ -6395,15 +6494,19 @@
return NULL;
}
-/*! \brief For a given station, choose the highest priority idle trunk
+/*!
+ * \brief For a given station, choose the highest priority idle trunk
+ * \pre sla_station is locked
*/
static struct sla_trunk_ref *sla_choose_idle_trunk(const struct sla_station *station)
{
struct sla_trunk_ref *trunk_ref = NULL;
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
- if (trunk_ref->state == SLA_TRUNK_STATE_IDLE)
+ if (trunk_ref->state == SLA_TRUNK_STATE_IDLE) {
+ ao2_ref(trunk_ref, 1);
break;
+ }
}
return trunk_ref;
@@ -6412,8 +6515,8 @@
static int sla_station_exec(struct ast_channel *chan, const char *data)
{
char *station_name, *trunk_name;
- struct sla_station *station;
- struct sla_trunk_ref *trunk_ref = NULL;
+ RAII_VAR(struct sla_station *, station, NULL, unref_obj);
+ RAII_VAR(struct sla_trunk_ref *, trunk_ref, NULL, unref_obj);
char conf_name[MAX_CONFNUM];
struct ast_flags64 conf_flags = { 0 };
struct ast_conference *conf;
@@ -6433,25 +6536,21 @@
return 0;
}
- AST_RWLIST_WRLOCK(&sla_stations);
station = sla_find_station(station_name);
- if (station)
- ast_atomic_fetchadd_int((int *) &station->ref_count, 1);
- AST_RWLIST_UNLOCK(&sla_stations);
if (!station) {
ast_log(LOG_WARNING, "Station '%s' not found!\n", station_name);
pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "FAILURE");
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
- AST_RWLIST_RDLOCK(&sla_trunks);
+ ao2_lock(station);
if (!ast_strlen_zero(trunk_name)) {
trunk_ref = sla_find_trunk_ref_byname(station, trunk_name);
- } else
+ } else {
trunk_ref = sla_choose_idle_trunk(station);
- AST_RWLIST_UNLOCK(&sla_trunks);
+ }
+ ao2_unlock(station);
if (!trunk_ref) {
if (ast_strlen_zero(trunk_name))
@@ -6461,8 +6560,6 @@
"'%s' due to access controls.\n", trunk_name);
}
pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "CONGESTION");
- ast_atomic_fetchadd_int((int *) &station->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
@@ -6491,7 +6588,7 @@
answer_trunk_chan(ringing_trunk->trunk->chan);
sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_UP, ALL_TRUNK_REFS, NULL);
- free(ringing_trunk);
+ sla_ringing_trunk_destroy(ringing_trunk);
/* Queue up reprocessing ringing trunks, and then ringing stations again */
sla_queue_event(SLA_EVENT_RINGING_TRUNK);
@@ -6511,6 +6608,8 @@
.cond_lock = &cond_lock,
.cond = &cond,
};
+ ao2_ref(trunk_ref, 1);
+ ao2_ref(station, 1);
sla_change_trunk_state(trunk_ref->trunk, SLA_TRUNK_STATE_UP, ALL_TRUNK_REFS, NULL);
/* Create a thread to dial the trunk and dump it into the conference.
* However, we want to wait until the trunk has been dialed and the
@@ -6530,8 +6629,6 @@
pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "CONGESTION");
sla_change_trunk_state(trunk_ref->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL);
trunk_ref->chan = NULL;
- ast_atomic_fetchadd_int((int *) &station->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
}
@@ -6564,19 +6661,28 @@
pbx_builtin_setvar_helper(chan, "SLASTATION_STATUS", "SUCCESS");
- ast_atomic_fetchadd_int((int *) &station->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
-
return 0;
}
+static void sla_trunk_ref_destructor(void *obj)
+{
+ struct sla_trunk_ref *trunk_ref = obj;
+
+ if (trunk_ref->trunk) {
+ ao2_ref(trunk_ref->trunk, -1);
+ trunk_ref->trunk = NULL;
+ }
+}
+
static struct sla_trunk_ref *create_trunk_ref(struct sla_trunk *trunk)
{
struct sla_trunk_ref *trunk_ref;
- if (!(trunk_ref = ast_calloc(1, sizeof(*trunk_ref))))
+ if (!(trunk_ref = ao2_alloc(sizeof(*trunk_ref), sla_trunk_ref_destructor))) {
return NULL;
+ }
+ ao2_ref(trunk, 1);
trunk_ref->trunk = trunk;
return trunk_ref;
@@ -6586,9 +6692,11 @@
{
struct sla_ringing_trunk *ringing_trunk;
- if (!(ringing_trunk = ast_calloc(1, sizeof(*ringing_trunk))))
+ if (!(ringing_trunk = ast_calloc(1, sizeof(*ringing_trunk)))) {
return NULL;
-
+ }
+
+ ao2_ref(trunk, 1);
ringing_trunk->trunk = trunk;
ringing_trunk->ring_begin = ast_tvnow();
@@ -6603,6 +6711,16 @@
return ringing_trunk;
}
+static void sla_ringing_trunk_destroy(struct sla_ringing_trunk *ringing_trunk)
+{
+ if (ringing_trunk->trunk) {
+ ao2_ref(ringing_trunk->trunk, -1);
+ ringing_trunk->trunk = NULL;
+ }
+
+ ast_free(ringing_trunk);
+}
+
enum {
SLA_TRUNK_OPT_MOH = (1 << 0),
};
@@ -6621,7 +6739,7 @@
char conf_name[MAX_CONFNUM];
struct ast_conference *conf;
struct ast_flags64 conf_flags = { 0 };
- struct sla_trunk *trunk;
+ RAII_VAR(struct sla_trunk *, trunk, NULL, unref_obj);
struct sla_ringing_trunk *ringing_trunk;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(trunk_name);
@@ -6645,16 +6763,11 @@
}
}
- AST_RWLIST_WRLOCK(&sla_trunks);
trunk = sla_find_trunk(args.trunk_name);
- if (trunk)
- ast_atomic_fetchadd_int((int *) &trunk->ref_count, 1);
- AST_RWLIST_UNLOCK(&sla_trunks);
if (!trunk) {
ast_log(LOG_ERROR, "SLA Trunk '%s' not found!\n", args.trunk_name);
pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "FAILURE");
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
@@ -6662,8 +6775,6 @@
ast_log(LOG_ERROR, "Call came in on %s, but the trunk is already in use!\n",
args.trunk_name);
pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "FAILURE");
- ast_atomic_fetchadd_int((int *) &trunk->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
@@ -6671,8 +6782,6 @@
if (!(ringing_trunk = queue_ringing_trunk(trunk))) {
pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "FAILURE");
- ast_atomic_fetchadd_int((int *) &trunk->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
@@ -6680,8 +6789,6 @@
conf = build_conf(conf_name, "", "", 1, 1, 1, chan, NULL);
if (!conf) {
pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "FAILURE");
- ast_atomic_fetchadd_int((int *) &trunk->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
return 0;
}
ast_set_flag64(&conf_flags,
@@ -6715,46 +6822,37 @@
AST_LIST_TRAVERSE_SAFE_END;
ast_mutex_unlock(&sla.lock);
if (ringing_trunk) {
- ast_free(ringing_trunk);
+ sla_ringing_trunk_destroy(ringing_trunk);
pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "UNANSWERED");
/* Queue reprocessing of ringing trunks to make stations stop ringing
* that shouldn't be ringing after this trunk stopped. */
sla_queue_event(SLA_EVENT_RINGING_TRUNK);
}
- ast_atomic_fetchadd_int((int *) &trunk->ref_count, -1);
- sla_queue_event(SLA_EVENT_CHECK_RELOAD);
-
return 0;
}
static enum ast_device_state sla_state(const char *data)
{
char *buf, *station_name, *trunk_name;
- struct sla_station *station;
+ RAII_VAR(struct sla_station *, station, NULL, unref_obj);
struct sla_trunk_ref *trunk_ref;
enum ast_device_state res = AST_DEVICE_INVALID;
trunk_name = buf = ast_strdupa(data);
station_name = strsep(&trunk_name, "_");
- AST_RWLIST_RDLOCK(&sla_stations);
- AST_LIST_TRAVERSE(&sla_stations, station, entry) {
- if (strcasecmp(station_name, station->name))
- continue;
- AST_RWLIST_RDLOCK(&sla_trunks);
+ station = sla_find_station(station_name);
+ if (station) {
+ ao2_lock(station);
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
- if (!strcasecmp(trunk_name, trunk_ref->trunk->name))
+ if (!strcasecmp(trunk_name, trunk_ref->trunk->name)) {
+ res = sla_state_to_devstate(trunk_ref->state);
break;
+ }
}
- if (!trunk_ref) {
- AST_RWLIST_UNLOCK(&sla_trunks);
- break;
- }
- res = sla_state_to_devstate(trunk_ref->state);
- AST_RWLIST_UNLOCK(&sla_trunks);
+ ao2_unlock(station);
}
- AST_RWLIST_UNLOCK(&sla_stations);
if (res == AST_DEVICE_INVALID) {
ast_log(LOG_ERROR, "Could not determine state for trunk %s on station %s!\n",
@@ -6764,26 +6862,39 @@
return res;
}
-static void destroy_trunk(struct sla_trunk *trunk)
+static int sla_trunk_release_refs(void *obj, void *arg, int flags)
{
+ struct sla_trunk *trunk = obj;
struct sla_station_ref *station_ref;
- if (!ast_strlen_zero(trunk->autocontext))
- ast_context_remove_extension(trunk->autocontext, "s", 1, sla_registrar);
-
- while ((station_ref = AST_LIST_REMOVE_HEAD(&trunk->stations, entry)))
- ast_free(station_ref);
+ while ((station_ref = AST_LIST_REMOVE_HEAD(&trunk->stations, entry))) {
+ ao2_ref(station_ref, -1);
+ }
- ast_string_field_free_memory(trunk);
- ast_free(trunk);
+ return 0;
}
-static void destroy_station(struct sla_station *station)
+static int sla_station_release_refs(void *obj, void *arg, int flags)
{
+ struct sla_station *station = obj;
struct sla_trunk_ref *trunk_ref;
+ while ((trunk_ref = AST_LIST_REMOVE_HEAD(&station->trunks, entry))) {
+ ao2_ref(trunk_ref, -1);
+ }
+
+ return 0;
+}
+
+static void sla_station_destructor(void *obj)
+{
+ struct sla_station *station = obj;
+
+ ast_debug(1, "sla_station destructor for '%s'\n", station->name);
+
if (!ast_strlen_zero(station->autocontext)) {
- AST_RWLIST_RDLOCK(&sla_trunks);
+ struct sla_trunk_ref *trunk_ref;
+
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
char exten[AST_MAX_EXTENSION];
char hint[AST_MAX_APP];
@@ -6794,31 +6905,43 @@
ast_context_remove_extension(station->autocontext, hint,
PRIORITY_HINT, sla_registrar);
}
- AST_RWLIST_UNLOCK(&sla_trunks);
}
- while ((trunk_ref = AST_LIST_REMOVE_HEAD(&station->trunks, entry)))
- ast_free(trunk_ref);
+ sla_station_release_refs(station, NULL, 0);
ast_string_field_free_memory(station);
- ast_free(station);
}
-static void sla_destroy(void)
+static int sla_trunk_hash(const void *obj, const int flags)
{
- struct sla_trunk *trunk;
- struct sla_station *station;
+ const struct sla_trunk *trunk = obj;
+
+ return ast_str_case_hash(trunk->name);
+}
+
+static int sla_trunk_cmp(void *obj, void *arg, int flags)
+{
+ struct sla_trunk *trunk = obj, *trunk2 = arg;
+
+ return !strcasecmp(trunk->name, trunk2->name) ? CMP_MATCH | CMP_STOP : 0;
+}
+
+static int sla_station_hash(const void *obj, const int flags)
+{
+ const struct sla_station *station = obj;
+
+ return ast_str_case_hash(station->name);
+}
- AST_RWLIST_WRLOCK(&sla_trunks);
- while ((trunk = AST_RWLIST_REMOVE_HEAD(&sla_trunks, entry)))
- destroy_trunk(trunk);
- AST_RWLIST_UNLOCK(&sla_trunks);
-
- AST_RWLIST_WRLOCK(&sla_stations);
- while ((station = AST_RWLIST_REMOVE_HEAD(&sla_stations, entry)))
- destroy_station(station);
- AST_RWLIST_UNLOCK(&sla_stations);
+static int sla_station_cmp(void *obj, void *arg, int flags)
+{
+ struct sla_station *station = obj, *station2 = arg;
+
+ return !strcasecmp(station->name, station2->name) ? CMP_MATCH | CMP_STOP : 0;
+}
+static void sla_destroy(void)
+{
if (sla.thread != AST_PTHREADT_NULL) {
ast_mutex_lock(&sla.lock);
sla.stop = 1;
@@ -6832,6 +6955,15 @@
ast_mutex_destroy(&sla.lock);
ast_cond_destroy(&sla.cond);
+
+ ao2_callback(sla_trunks, 0, sla_trunk_release_refs, NULL);
+ ao2_callback(sla_stations, 0, sla_station_release_refs, NULL);
+
+ ao2_ref(sla_trunks, -1);
+ sla_trunks = NULL;
+
+ ao2_ref(sla_stations, -1);
+ sla_stations = NULL;
}
static int sla_check_device(const char *device)
@@ -6847,11 +6979,27 @@
return 0;
}
+static void sla_trunk_destructor(void *obj)
+{
+ struct sla_trunk *trunk = obj;
+
+ ast_debug(1, "sla_trunk destructor for '%s'\n", trunk->name);
+
+ if (!ast_strlen_zero(trunk->autocontext)) {
+ ast_context_remove_extension(trunk->autocontext, "s", 1, sla_registrar);
+ }
+
+ sla_trunk_release_refs(trunk, NULL, 0);
+
+ ast_string_field_free_memory(trunk);
+}
+
static int sla_build_trunk(struct ast_config *cfg, const char *cat)
{
- struct sla_trunk *trunk;
+ RAII_VAR(struct sla_trunk *, trunk, NULL, unref_obj);
struct ast_variable *var;
const char *dev;
+ int existing_trunk = 0;
if (!(dev = ast_variable_retrieve(cfg, cat, "device"))) {
ast_log(LOG_ERROR, "SLA Trunk '%s' defined with no device!\n", cat);
@@ -6859,16 +7007,25 @@
}
if (sla_check_device(dev)) {
- ast_log(LOG_ERROR, "SLA Trunk '%s' define with invalid device '%s'!\n",
+ ast_log(LOG_ERROR, "SLA Trunk '%s' defined with invalid device '%s'!\n",
cat, dev);
return -1;
}
- if (!(trunk = ast_calloc_with_stringfields(1, struct sla_trunk, 32))) {
+ if ((trunk = sla_find_trunk(cat))) {
+ trunk->mark = 0;
+ existing_trunk = 1;
+ } else if ((trunk = ao2_alloc(sizeof(*trunk), sla_trunk_destructor))) {
+ if (ast_string_field_init(trunk, 32)) {
+ return -1;
+ }
+ ast_string_field_set(trunk, name, cat);
+ } else {
return -1;
}
- ast_string_field_set(trunk, name, cat);
+ ao2_lock(trunk);
+
ast_string_field_set(trunk, device, dev);
for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
@@ -6897,54 +7054,65 @@
}
}
+ ao2_unlock(trunk);
+
if (!ast_strlen_zero(trunk->autocontext)) {
struct ast_context *context;
context = ast_context_find_or_create(NULL, NULL, trunk->autocontext, sla_registrar);
if (!context) {
ast_log(LOG_ERROR, "Failed to automatically find or create "
"context '%s' for SLA!\n", trunk->autocontext);
- destroy_trunk(trunk);
return -1;
}
if (ast_add_extension2(context, 0 /* don't replace */, "s", 1,
NULL, NULL, slatrunk_app, ast_strdup(trunk->name), ast_free_ptr, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create extension "
"for trunk '%s'!\n", trunk->name);
- destroy_trunk(trunk);
return -1;
}
}
- AST_RWLIST_WRLOCK(&sla_trunks);
- AST_RWLIST_INSERT_TAIL(&sla_trunks, trunk, entry);
- AST_RWLIST_UNLOCK(&sla_trunks);
+ if (!existing_trunk) {
+ ao2_link(sla_trunks, trunk);
+ }
return 0;
}
+/*!
+ * \internal
+ * \pre station is not locked
+ */
static void sla_add_trunk_to_station(struct sla_station *station, struct ast_variable *var)
{
- struct sla_trunk *trunk;
- struct sla_trunk_ref *trunk_ref;
+ RAII_VAR(struct sla_trunk *, trunk, NULL, unref_obj);
+ struct sla_trunk_ref *trunk_ref = NULL;
struct sla_station_ref *station_ref;
char *trunk_name, *options, *cur;
+ int existing_trunk_ref = 0;
+ int existing_station_ref = 0;
options = ast_strdupa(var->value);
trunk_name = strsep(&options, ",");
-
- AST_RWLIST_RDLOCK(&sla_trunks);
- AST_RWLIST_TRAVERSE(&sla_trunks, trunk, entry) {
- if (!strcasecmp(trunk->name, trunk_name))
- break;
- }
- AST_RWLIST_UNLOCK(&sla_trunks);
+ trunk = sla_find_trunk(trunk_name);
if (!trunk) {
ast_log(LOG_ERROR, "Trunk '%s' not found!\n", var->value);
return;
}
- if (!(trunk_ref = create_trunk_ref(trunk)))
+
+ AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
+ if (trunk_ref->trunk == trunk) {
+ trunk_ref->mark = 0;
+ existing_trunk_ref = 1;
+ break;
+ }
+ }
+
+ if (!trunk_ref && !(trunk_ref = create_trunk_ref(trunk))) {
return;
+ }
+
trunk_ref->state = SLA_TRUNK_STATE_IDLE;
while ((cur = strsep(&options, ","))) {
@@ -6968,41 +7136,73 @@
}
}
- if (!(station_ref = sla_create_station_ref(station))) {
- ast_free(trunk_ref);
+ AST_LIST_TRAVERSE(&trunk->stations, station_ref, entry) {
+ if (station_ref->station == station) {
+ station_ref->mark = 0;
+ existing_station_ref = 1;
+ break;
+ }
+ }
+
+ if (!station_ref && !(station_ref = sla_create_station_ref(station))) {
+ if (!existing_trunk_ref) {
+ ao2_ref(trunk_ref, -1);
+ } else {
+ trunk_ref->mark = 1;
+ }
return;
}
- ast_atomic_fetchadd_int((int *) &trunk->num_stations, 1);
- AST_RWLIST_WRLOCK(&sla_trunks);
- AST_LIST_INSERT_TAIL(&trunk->stations, station_ref, entry);
- AST_RWLIST_UNLOCK(&sla_trunks);
- AST_LIST_INSERT_TAIL(&station->trunks, trunk_ref, entry);
+
+ if (!existing_station_ref) {
+ ao2_lock(trunk);
+ AST_LIST_INSERT_TAIL(&trunk->stations, station_ref, entry);
+ ast_atomic_fetchadd_int((int *) &trunk->num_stations, 1);
+ ao2_unlock(trunk);
+ }
+
+ if (!existing_trunk_ref) {
+ ao2_lock(station);
+ AST_LIST_INSERT_TAIL(&station->trunks, trunk_ref, entry);
+ ao2_unlock(station);
+ }
}
static int sla_build_station(struct ast_config *cfg, const char *cat)
{
- struct sla_station *station;
+ RAII_VAR(struct sla_station *, station, NULL, unref_obj);
struct ast_variable *var;
const char *dev;
+ int existing_station = 0;
if (!(dev = ast_variable_retrieve(cfg, cat, "device"))) {
ast_log(LOG_ERROR, "SLA Station '%s' defined with no device!\n", cat);
return -1;
}
- if (!(station = ast_calloc_with_stringfields(1, struct sla_station, 32))) {
+ if ((station = sla_find_station(cat))) {
+ station->mark = 0;
+ existing_station = 1;
+ } else if ((station = ao2_alloc(sizeof(*station), sla_station_destructor))) {
+ if (ast_string_field_init(station, 32)) {
+ return -1;
+ }
+ ast_string_field_set(station, name, cat);
+ } else {
return -1;
}
- ast_string_field_set(station, name, cat);
+ ao2_lock(station);
+
ast_string_field_set(station, device, dev);
for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
- if (!strcasecmp(var->name, "trunk"))
+ if (!strcasecmp(var->name, "trunk")) {
+ ao2_unlock(station);
sla_add_trunk_to_station(station, var);
- else if (!strcasecmp(var->name, "autocontext"))
+ ao2_lock(station);
+ } else if (!strcasecmp(var->name, "autocontext")) {
ast_string_field_set(station, autocontext, var->value);
- else if (!strcasecmp(var->name, "ringtimeout")) {
+ } else if (!strcasecmp(var->name, "ringtimeout")) {
if (sscanf(var->value, "%30u", &station->ring_timeout) != 1) {
ast_log(LOG_WARNING, "Invalid ringtimeout '%s' specified for station '%s'\n",
var->value, station->name);
@@ -7030,6 +7230,8 @@
}
}
+ ao2_unlock(station);
+
if (!ast_strlen_zero(station->autocontext)) {
struct ast_context *context;
struct sla_trunk_ref *trunk_ref;
@@ -7037,7 +7239,6 @@
if (!context) {
ast_log(LOG_ERROR, "Failed to automatically find or create "
"context '%s' for SLA!\n", station->autocontext);
- destroy_station(station);
return -1;
}
/* The extension for when the handset goes off-hook.
@@ -7046,10 +7247,8 @@
NULL, NULL, slastation_app, ast_strdup(station->name), ast_free_ptr, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create extension "
"for trunk '%s'!\n", station->name);
- destroy_station(station);
return -1;
}
- AST_RWLIST_RDLOCK(&sla_trunks);
AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
char exten[AST_MAX_EXTENSION];
char hint[AST_MAX_APP];
@@ -7061,7 +7260,6 @@
NULL, NULL, slastation_app, ast_strdup(exten), ast_free_ptr, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create extension "
"for trunk '%s'!\n", station->name);
- destroy_station(station);
return -1;
}
/* Hint for this line button
@@ -7070,20 +7268,115 @@
NULL, NULL, hint, NULL, NULL, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create hint "
"for trunk '%s'!\n", station->name);
- destroy_station(station);
return -1;
}
}
- AST_RWLIST_UNLOCK(&sla_trunks);
}
- AST_RWLIST_WRLOCK(&sla_stations);
- AST_RWLIST_INSERT_TAIL(&sla_stations, station, entry);
- AST_RWLIST_UNLOCK(&sla_stations);
+ if (!existing_station) {
+ ao2_link(sla_stations, station);
+ }
+
+ return 0;
+}
+
+static int sla_trunk_mark(void *obj, void *arg, int flags)
+{
+ struct sla_trunk *trunk = obj;
+ struct sla_station_ref *station_ref;
+
+ ao2_lock(trunk);
+
+ trunk->mark = 1;
+
+ AST_LIST_TRAVERSE(&trunk->stations, station_ref, entry) {
+ station_ref->mark = 1;
+ }
+
+ ao2_unlock(trunk);
+
+ return 0;
+}
+
+static int sla_station_mark(void *obj, void *arg, int flags)
+{
+ struct sla_station *station = obj;
+ struct sla_trunk_ref *trunk_ref;
+
+ ao2_lock(station);
+
+ station->mark = 1;
+
+ AST_LIST_TRAVERSE(&station->trunks, trunk_ref, entry) {
+ trunk_ref->mark = 1;
+ }
+
+ ao2_unlock(station);
return 0;
}
+static int sla_trunk_is_marked(void *obj, void *arg, int flags)
+{
+ struct sla_trunk *trunk = obj;
+
+ ao2_lock(trunk);
+
+ if (trunk->mark) {
+ /* Only remove all of the station references if the trunk itself is going away */
+ sla_trunk_release_refs(trunk, NULL, 0);
+ } else {
+ struct sla_station_ref *station_ref;
+
+ /* Otherwise only remove references to stations no longer in the config */
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&trunk->stations, station_ref, entry) {
+ if (!station_ref->mark) {
+ continue;
+ }
+ AST_LIST_REMOVE_CURRENT(entry);
+ ao2_ref(station_ref, -1);
+ }
+ AST_LIST_TRAVERSE_SAFE_END
+ }
+
+ ao2_unlock(trunk);
+
+ return trunk->mark ? CMP_MATCH : 0;
+}
+
+static int sla_station_is_marked(void *obj, void *arg, int flags)
+{
+ struct sla_station *station = obj;
+
+ ao2_lock(station);
+
+ if (station->mark) {
+ /* Only remove all of the trunk references if the station itself is going away */
+ sla_station_release_refs(station, NULL, 0);
+ } else {
+ struct sla_trunk_ref *trunk_ref;
+
+ /* Otherwise only remove references to trunks no longer in the config */
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&station->trunks, trunk_ref, entry) {
+ if (!trunk_ref->mark) {
+ continue;
+ }
+ AST_LIST_REMOVE_CURRENT(entry);
+ ao2_ref(trunk_ref, -1);
+ }
+ AST_LIST_TRAVERSE_SAFE_END
+ }
+
+ ao2_unlock(station);
+
+ return station->mark ? CMP_MATCH : 0;
+}
+
+static int sla_in_use(void)
+{
+ return ao2_container_count(sla_trunks) || ao2_container_count(sla_stations);
+}
+
static int sla_load_config(int reload)
{
struct ast_config *cfg;
@@ -7095,6 +7388,8 @@
if (!reload) {
ast_mutex_init(&sla.lock);
ast_cond_init(&sla.cond, NULL);
+ sla_trunks = ao2_container_alloc(1, sla_trunk_hash, sla_trunk_cmp);
+ sla_stations = ao2_container_alloc(1, sla_station_hash, sla_station_cmp);
}
if (!(cfg = ast_config_load(SLA_CONFIG_FILE, config_flags))) {
@@ -7107,21 +7402,8 @@
}
if (reload) {
- struct sla_station *station;
- struct sla_trunk *trunk;
-
- /* We need to actually delete the previous versions of trunks and stations now */
- AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_stations, station, entry) {
- AST_RWLIST_REMOVE_CURRENT(entry);
- ast_free(station);
- }
- AST_RWLIST_TRAVERSE_SAFE_END;
-
- AST_RWLIST_TRAVERSE_SAFE_BEGIN(&sla_trunks, trunk, entry) {
- AST_RWLIST_REMOVE_CURRENT(entry);
- ast_free(trunk);
- }
- AST_RWLIST_TRAVERSE_SAFE_END;
+ ao2_callback(sla_trunks, 0, sla_trunk_mark, NULL);
+ ao2_callback(sla_stations, 0, sla_station_mark, NULL);
}
if ((val = ast_variable_retrieve(cfg, "general", "attemptcallerid")))
@@ -7148,9 +7430,13 @@
ast_config_destroy(cfg);
- /* Even if we don't have any stations, we may after a reload and we need to
- * be able to process the SLA_EVENT_RELOAD event in that case */
- if (sla.thread == AST_PTHREADT_NULL && (!AST_LIST_EMPTY(&sla_stations) || !AST_LIST_EMPTY(&sla_trunks))) {
+ if (reload) {
+ ao2_callback(sla_trunks, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, sla_trunk_is_marked, NULL);
+ ao2_callback(sla_stations, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, sla_station_is_marked, NULL);
+ }
+
+ /* Start SLA event processing thread once SLA has been configured. */
+ if (sla.thread == AST_PTHREADT_NULL && sla_in_use()) {
ast_pthread_create(&sla.thread, NULL, sla_thread, NULL);
}
@@ -7235,15 +7521,7 @@
static int load_config(int reload)
{
load_config_meetme();
-
- if (reload && sla.thread != AST_PTHREADT_NULL) {
- sla_queue_event(SLA_EVENT_RELOAD);
- ast_log(LOG_NOTICE, "A reload of the SLA configuration has been requested "
- "and will be completed when the system is idle.\n");
- return 0;
- }
-
- return sla_load_config(0);
+ return sla_load_config(reload);
}
#define MEETME_DATA_EXPORT(MEMBER) \
@@ -7455,8 +7733,6 @@
return res;
}
-
-
static int load_module(void)
{
int res = 0;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/apps/app_mixmonitor.c
^
|
@@ -39,7 +39,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 375484 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 391778 $")
#include "asterisk/paths.h" /* use ast_config_AST_MONITOR_DIR */
#include "asterisk/file.h"
@@ -381,6 +381,8 @@
ast_verb(2, "End MixMonitor Recording %s\n", mixmonitor->name);
mixmonitor_free(mixmonitor);
+
+ ast_module_unref(ast_module_info->self);
return NULL;
}
@@ -414,7 +416,7 @@
return 0;
}
-static void launch_monitor_thread(struct ast_channel *chan, const char *filename, unsigned int flags,
+static int launch_monitor_thread(struct ast_channel *chan, const char *filename, unsigned int flags,
int readvol, int writevol, const char *post_process)
{
pthread_t thread;
@@ -442,26 +444,26 @@
/* Pre-allocate mixmonitor structure and spy */
if (!(mixmonitor = ast_calloc(1, len))) {
- return;
+ return -1;
}
/* Setup the actual spy before creating our thread */
if (ast_audiohook_init(&mixmonitor->audiohook, AST_AUDIOHOOK_TYPE_SPY, mixmonitor_spy_type)) {
mixmonitor_free(mixmonitor);
- return;
+ return -1;
}
/* Copy over flags and channel name */
mixmonitor->flags = flags;
if (!(mixmonitor->autochan = ast_autochan_setup(chan))) {
mixmonitor_free(mixmonitor);
- return;
+ return -1;
}
if (setup_mixmonitor_ds(mixmonitor, chan)) {
ast_autochan_destroy(mixmonitor->autochan);
mixmonitor_free(mixmonitor);
- return;
+ return -1;
}
mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
strcpy(mixmonitor->name, chan->name);
@@ -485,10 +487,10 @@
mixmonitor_spy_type, chan->name);
ast_audiohook_destroy(&mixmonitor->audiohook);
mixmonitor_free(mixmonitor);
- return;
+ return -1;
}
- ast_pthread_create_detached_background(&thread, NULL, mixmonitor_thread, mixmonitor);
+ return ast_pthread_create_detached_background(&thread, NULL, mixmonitor_thread, mixmonitor);
}
static int mixmonitor_exec(struct ast_channel *chan, const char *data)
@@ -567,7 +569,12 @@
ast_mkdir(tmp, 0777);
pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename);
- launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process);
+
+ /* If launch_monitor_thread works, the module reference must not be released until it is finished. */
+ ast_module_ref(ast_module_info->self);
+ if (launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process)) {
+ ast_module_unref(ast_module_info->self);
+ }
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/apps/app_playback.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 381216 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include "asterisk/file.h"
#include "asterisk/pbx.h"
@@ -211,6 +211,10 @@
s = x + 1;
ast_debug(2, "value is <%s>\n", s);
n = ast_var_assign("SAY", s);
+ if (!n) {
+ ast_log(LOG_ERROR, "Memory allocation error in do_say\n");
+ return -1;
+ }
AST_LIST_INSERT_HEAD(&head, n, entries);
/* scan the body, one piece at a time */
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/apps/app_queue.c
^
|
@@ -63,7 +63,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 391215 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398884 $")
#include <sys/time.h>
#include <sys/signal.h>
@@ -7950,8 +7950,8 @@
case CLI_INIT:
e->command = "queue add member";
e->usage =
- "Usage: queue add member <channel> to <queue> [[[penalty <penalty>] as <membername>] state_interface <interface>]\n"
- " Add a channel to a queue with optionally: a penalty, membername and a state_interface\n";
+ "Usage: queue add member <dial string> to <queue> [[[penalty <penalty>] as <membername>] state_interface <interface>]\n"
+ " Add a dial string (Such as a channel,e.g. SIP/6001) to a queue with optionally: a penalty, membername and a state_interface\n";
return NULL;
case CLI_GENERATE:
return complete_queue_add_member(a->line, a->word, a->pos, a->n);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/apps/app_stack.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 371590 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include "asterisk/pbx.h"
#include "asterisk/module.h"
@@ -242,8 +242,9 @@
}
if (!found) {
- variables = ast_var_assign(var, "");
- AST_LIST_INSERT_HEAD(&frame->varshead, variables, entries);
+ if ((variables = ast_var_assign(var, ""))) {
+ AST_LIST_INSERT_HEAD(&frame->varshead, variables, entries);
+ }
pbx_builtin_pushvar_helper(chan, var, value);
} else {
pbx_builtin_setvar_helper(chan, var, value);
|
[-]
[+]
|
Added |
asterisk-1.8.24.0.tar.xz/asterisk-1.8.24.0-summary.html
^
|
@@ -0,0 +1,476 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.8.24.0</title></head>
+<body>
+<h1 align="center"><a name="top">Release Summary</a></h1>
+<h3 align="center">asterisk-1.8.24.0</h3>
+<h3 align="center">Date: 2013-10-21</h3>
+<h3 align="center"><asteriskteam@digium.com></h3>
+<hr/>
+<h2 align="center">Table of Contents</h2>
+<ol>
+ <li><a href="#summary">Summary</a></li>
+ <li><a href="#contributors">Contributors</a></li>
+ <li><a href="#issues">Closed Issues</a></li>
+ <li><a href="#commits">Other Changes</a></li>
+ <li><a href="#diffstat">Diffstat</a></li>
+</ol>
+<hr/>
+<a name="summary"><h2 align="center">Summary</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This release includes only bug fixes. The changes included were made only to address problems that have been identified in this release series. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous release series are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.</p>
+<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.8.23.0.</p>
+<hr/>
+<a name="contributors"><h2 align="center">Contributors</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
+<table width="100%" border="0">
+<tr>
+<td width="33%"><h3>Coders</h3></td>
+<td width="33%"><h3>Testers</h3></td>
+<td width="33%"><h3>Reporters</h3></td>
+</tr>
+<tr valign="top">
+<td>
+10 rmudgett<br/>
+9 wdoekes<br/>
+6 elguero<br/>
+6 mjordan<br/>
+5 Corey Farrell<br/>
+4 dlee<br/>
+4 jrose<br/>
+4 kmoore<br/>
+3 bebuild<br/>
+2 coreyfarrell<br/>
+2 newtonr<br/>
+1 abelbeck<br/>
+1 alecdavis<br/>
+1 anstein<br/>
+1 file<br/>
+1 Guenther Kelleter<br/>
+1 jcolp<br/>
+1 kharwell<br/>
+1 mmichelson<br/>
+1 moy<br/>
+1 phill<br/>
+1 Richard Miller<br/>
+1 russell<br/>
+1 snuffy<br/>
+1 Stefan Wachtler<br/>
+1 varnav<br/>
+</td>
+<td>
+3 Corey Farrell<br/>
+2 wdoekes<br/>
+1 Alex Zarubin<br/>
+1 Ariel Wainer<br/>
+1 CGI.NET<br/>
+1 Colin Cutherbertson<br/>
+1 Doug Bailey<br/>
+1 elguero<br/>
+1 Jacek Konieczny<br/>
+1 Karsten Wemheuer<br/>
+1 Michael Keuter<br/>
+1 mjordan<br/>
+1 Stuart Henderson<br/>
+</td>
+<td>
+7 coreyfarrell<br/>
+2 dlee<br/>
+2 mdavenport<br/>
+2 mjordan<br/>
+2 wdoekes<br/>
+1 abelbeck<br/>
+1 aepshteyn<br/>
+1 anstein<br/>
+1 ariw<br/>
+1 az_tth<br/>
+1 brietz<br/>
+1 colinc<br/>
+1 dbailey<br/>
+1 gkelleter<br/>
+1 ivo.andonov<br/>
+1 jkonieczny<br/>
+1 jrose<br/>
+1 kenner<br/>
+1 nsnake<br/>
+1 phill<br/>
+1 rafuchoucv<br/>
+1 rnewton<br/>
+1 snuffy<br/>
+1 sthen<br/>
+1 ulogic<br/>
+1 varnav<br/>
+1 wimpy<br/>
+</td>
+</tr>
+</table>
+<hr/>
+<a name="issues"><h2 align="center">Closed Issues</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
+<h3>Category: Applications/app_meetme</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21907">ASTERISK-21907</a>: Crash - segfault - When executing a MeetMeAdmin command that requires a member, without specifying a member<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=399033">399033</a><br/>
+Reporter: aepshteyn<br/>
+Coders: kmoore<br/>
+<br/>
+<h3>Category: Applications/app_queue</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22263">ASTERISK-22263</a>: [patch] 'queue add member ...' help text update<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398884">398884</a><br/>
+Reporter: rnewton<br/>
+Coders: newtonr<br/>
+<br/>
+<h3>Category: Bridges/bridge_native_rtp</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22424">ASTERISK-22424</a>: bridge_native_rtp: Asterisk 12 attempts to remotely bridge on 200OK response to invite when the 200 lacks SDP<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398835">398835</a><br/>
+Reporter: jrose<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: CEL/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22259">ASTERISK-22259</a>: [patch] cel segfault on invalid cel.conf<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397033">397033</a><br/>
+Reporter: coreyfarrell<br/>
+Testers: Corey Farrell<br/>
+Coders: Corey Farrell<br/>
+<br/>
+<h3>Category: Channels/chan_dahdi</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21117">ASTERISK-21117</a>: Bad interpretation of the file chan_dahdi.conf when using open r2 parameters<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394106">394106</a><br/>
+Reporter: rafuchoucv<br/>
+Coders: moy<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21847">ASTERISK-21847</a>: Segfault due to dahdi_restart and round robin<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=393627">393627</a><br/>
+Reporter: ivo.andonov<br/>
+Coders: rmudgett<br/>
+<br/>
+<h3>Category: Channels/chan_iax2</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21953">ASTERISK-21953</a>: connectedline parameter not documented<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394886">394886</a><br/>
+Reporter: wimpy<br/>
+Coders: mjordan<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22504">ASTERISK-22504</a>: [patch] chan_iax2: wrong expiry time in astdb<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=399158">399158</a><br/>
+Reporter: brietz<br/>
+Coders: Stefan Wachtler<br/>
+<br/>
+<h3>Category: Channels/chan_local</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22221">ASTERISK-22221</a>: The masquerade super-test fails on all Asterisk versions<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397525">397525</a><br/>
+Reporter: mjordan<br/>
+Coders: rmudgett<br/>
+<br/>
+<h3>Category: Channels/chan_sip/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21064">ASTERISK-21064</a>: Crash when handling ACK on dialog that has no channel<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397710">397710</a><br/>
+Reporter: colinc<br/>
+Testers: wdoekes, Colin Cutherbertson<br/>
+Coders: wdoekes<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22007">ASTERISK-22007</a>: chan_sip: segfault with invalid sdp<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397756">397756</a><br/>
+Reporter: wdoekes<br/>
+Testers: wdoekes<br/>
+Coders: wdoekes<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22071">ASTERISK-22071</a>: chan_sip doesn't respect Via ..completely<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397204">397204</a><br/>
+Reporter: az_tth<br/>
+Testers: Alex Zarubin, Karsten Wemheuer<br/>
+Coders: elguero<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22239">ASTERISK-22239</a>: [patch] Missing extra line break between peers when running AMI action SIPPeers<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396236">396236</a><br/>
+Reporter: jkonieczny<br/>
+Testers: Jacek Konieczny, elguero<br/>
+Coders: elguero<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22248">ASTERISK-22248</a>: [patch] test_sip_rtpqos corrupts dialogs container<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397112">397112</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: Corey Farrell<br/>
+<br/>
+<h3>Category: Channels/chan_sip/Registration</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21964">ASTERISK-21964</a>: SIP TLS Register statement fails if sip.conf register directive uses peer name. <br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396240">396240</a><br/>
+Reporter: dbailey<br/>
+Testers: Doug Bailey<br/>
+Coders: elguero<br/>
+<br/>
+<h3>Category: Channels/chan_sip/T.38</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22275">ASTERISK-22275</a>: [patch] T.38 Passthrough broken if peer doen't report T38MaxBitRate<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397256">397256</a><br/>
+Reporter: anstein<br/>
+Coders: anstein<br/>
+<br/>
+<h3>Category: Contrib/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21021">ASTERISK-21021</a>: SQL script to create queue_log table in PostgreSQL<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394896">394896</a><br/>
+Reporter: varnav<br/>
+Coders: varnav<br/>
+<br/>
+<h3>Category: Core/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22179">ASTERISK-22179</a>: Update copyright headers - they're so last year<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=395032">395032</a><br/>
+Reporter: mdavenport<br/>
+Coders: mjordan<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22238">ASTERISK-22238</a>: [patch] astfd and threadstorage debug cli commands are not unregistered<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397106">397106</a><br/>
+Reporter: coreyfarrell<br/>
+Testers: Corey Farrell<br/>
+Coders: Corey Farrell<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22249">ASTERISK-22249</a>: [patch] xmldoc.c leaks an attribute<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397064">397064</a><br/>
+Reporter: coreyfarrell<br/>
+Testers: Corey Farrell<br/>
+Coders: Corey Farrell<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22536">ASTERISK-22536</a>: MALLOC_DEBUG causes /tmp/refs to be written, even if REF_DEBUG is not defined<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=399098">399098</a><br/>
+Reporter: dlee<br/>
+Coders: dlee<br/>
+<br/>
+<h3>Category: Core/HTTP</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21789">ASTERISK-21789</a>: ast_http_get_cookies() fails in the presence of RFC2965 Cookie2 header<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394899">394899</a><br/>
+Reporter: sthen<br/>
+Testers: mjordan, Stuart Henderson<br/>
+Coders: mjordan<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22237">ASTERISK-22237</a>: [patch] http_shutdown incomplete<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397308">397308</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: Corey Farrell<br/>
+<br/>
+<h3>Category: Core/Jitterbuffer</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21036">ASTERISK-21036</a>: Jitter Buffer log file creation doesn't account for multiple slashes in DAHDI channel names<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=399402">399402</a><br/>
+Reporter: kenner<br/>
+Coders: kmoore<br/>
+<br/>
+<h3>Category: Core/ManagerInterface</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21789">ASTERISK-21789</a>: ast_http_get_cookies() fails in the presence of RFC2965 Cookie2 header<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394899">394899</a><br/>
+Reporter: sthen<br/>
+Testers: mjordan, Stuart Henderson<br/>
+Coders: mjordan<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22395">ASTERISK-22395</a>: [patch] manager.c and res_agi.c leak results from ast_xmldoc_printable<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398060">398060</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Core/RTP</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22424">ASTERISK-22424</a>: bridge_native_rtp: Asterisk 12 attempts to remotely bridge on 200OK response to invite when the 200 lacks SDP<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398835">398835</a><br/>
+Reporter: jrose<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: Documentation</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22308">ASTERISK-22308</a>: Documentation - chan_dahdi, waitfordialtone is not boolean, it's time in milliseconds<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398880">398880</a><br/>
+Reporter: mdavenport<br/>
+Coders: newtonr<br/>
+<br/>
+<h3>Category: Features/Parking</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22413">ASTERISK-22413</a>: [patch] features.c TEST_FRAMEWORK leaks channel reference, preventing graceful shutdown<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398021">398021</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Functions/func_channel</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-20969">ASTERISK-20969</a>: Fix func_channel documentation for sip/iax2/dadhi<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394980">394980</a><br/>
+Reporter: snuffy<br/>
+Coders: snuffy<br/>
+<br/>
+<h3>Category: Functions/func_strings</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21717">ASTERISK-21717</a>: [patch] - Documentation for PASSTHRU function is unclear<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394302">394302</a><br/>
+Reporter: ulogic<br/>
+Coders: Richard Miller<br/>
+<br/>
+<h3>Category: Resources/res_agi</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21903">ASTERISK-21903</a>: [patch] Return proper result upon error when running some AGI commands<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394640">394640</a><br/>
+Reporter: ariw<br/>
+Testers: Ariel Wainer<br/>
+Coders: elguero<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22395">ASTERISK-22395</a>: [patch] manager.c and res_agi.c leak results from ast_xmldoc_printable<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398060">398060</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Resources/res_features</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22416">ASTERISK-22416</a>: [patch] Segmentation fault (in process_applicationmap_line, at features.c) when using improper feature mapping syntax<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=399304">399304</a><br/>
+Reporter: nsnake<br/>
+Testers: CGI.NET<br/>
+Coders: elguero<br/>
+<br/>
+<h3>Category: Resources/res_indications</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21997">ASTERISK-21997</a>: [patch] - Incorrect Ring tone for Malaysia<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=394940">394940</a><br/>
+Reporter: phill<br/>
+Coders: phill<br/>
+<br/>
+<h3>Category: Resources/res_jabber</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22435">ASTERISK-22435</a>: [patch] jabber/xmpp MWI distributed pubsub issue where the mailbox and context get swapped at the remote end<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398523">398523</a><br/>
+Reporter: abelbeck<br/>
+Testers: Michael Keuter<br/>
+Coders: abelbeck<br/>
+<br/>
+<h3>Category: Resources/res_musiconhold</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22252">ASTERISK-22252</a>: res_musiconhold cleanup - REF_DEBUG reload warnings and ref leaks<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398937">398937</a><br/>
+Reporter: wdoekes<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: Resources/res_xmpp</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22435">ASTERISK-22435</a>: [patch] jabber/xmpp MWI distributed pubsub issue where the mailbox and context get swapped at the remote end<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398523">398523</a><br/>
+Reporter: abelbeck<br/>
+Testers: Michael Keuter<br/>
+Coders: abelbeck<br/>
+<br/>
+<h3>Category: Tests/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22276">ASTERISK-22276</a>: Test test_hashtab_thrash fails on 32-bit machines when compiled without DEBUG_THREADS<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396619">396619</a><br/>
+Reporter: mjordan<br/>
+Coders: jcolp<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22413">ASTERISK-22413</a>: [patch] features.c TEST_FRAMEWORK leaks channel reference, preventing graceful shutdown<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398021">398021</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Tests/testsuite</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22221">ASTERISK-22221</a>: The masquerade super-test fails on all Asterisk versions<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397525">397525</a><br/>
+Reporter: mjordan<br/>
+Coders: rmudgett<br/>
+<br/>
+<hr/>
+<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
+<table width="100%" border="1">
+<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=391333">391333</a></td><td>alecdavis</td><td>IAX2: Transfer Reject: Lock bridgecallno before touching it, refactor</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=391489">391489</a></td><td>mjordan</td><td>Fix memory leak while loading priority modules</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=391778">391778</a></td><td>jrose</td><td>app_mixmonitor: Fix crashes caused by unloading app_mixmonitor</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=393928">393928</a></td><td>russell</td><td>astobj2-ify the SLA code</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396196">396196</a></td><td>elguero</td><td>Adding a note to UPGRADE.txt about a change made to res_agi in order to</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-21903">ASTERISK-21903</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396279">396279</a></td><td>wdoekes</td><td>Check result of ast_var_assign() calls for memory allocation failure.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396427">396427</a></td><td>wdoekes</td><td>Consistent memory allocation by ast_bt_get_symbols.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396579">396579</a></td><td>wdoekes</td><td>chan_sip: Fix IP-addr in warning when rejecting a contact ACL.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396582">396582</a></td><td>wdoekes</td><td>chan_sip: Convert 'just did sched_add waitid...' from warning to debug message.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396656">396656</a></td><td>file</td><td>Tweak comment for why usleep is used.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396745">396745</a></td><td>kmoore</td><td>Remove leading spaces from the CLI command before parsing</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396958">396958</a></td><td>mjordan</td><td>Fix invalid access to disposed memory in main/data unit test</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=396994">396994</a></td><td>wdoekes</td><td>Add "autoframing" option to sip.conf.sample and h323.conf.sample.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397156">397156</a></td><td>mmichelson</td><td>Remove REF_DEBUG definition.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=397377">397377</a></td><td>wdoekes</td><td>Add _IO_stdin_used in version-script to fix SIGBUSes on Sparc.</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-21763">ASTERISK-21763</a>, <a href="https://issues.asterisk.org/jira/browse/ASTERISK-21665">ASTERISK-21665</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398018">398018</a></td><td>rmudgett</td><td>test_substituition: Fix failed test reporting to actually report failure.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398102">398102</a></td><td>kharwell</td><td>Fix various memory leaks</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398167">398167</a></td><td>wdoekes</td><td>Be a little more verbose when loading cel_custom.conf.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398301">398301</a></td><td>rmudgett</td><td>chan_iax2: Add missing control frame names to debug frame decode output.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398339">398339</a></td><td>rmudgett</td><td>chan_iax2: Add missing control frame names to debug frame decode output. (Part 2)</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398379">398379</a></td><td>rmudgett</td><td>chan_iax2: Fix bridgecallno deadlock avoidance.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398416">398416</a></td><td>rmudgett</td><td>chan_iax2: Fix stray reference to worker thread idle_list.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398456">398456</a></td><td>rmudgett</td><td>chan_iax2: Reduce indentation in __attempt_transmit().</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398576">398576</a></td><td>kmoore</td><td>Commit the remainder of r398523</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22435">ASTERISK-22435</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398703">398703</a></td><td>rmudgett</td><td>MALLOC_DEBUG: Change fence magic number to be completely different from the freed magic number.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398748">398748</a></td><td>dlee</td><td>Fixed utils directory breakage from r398648</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398752">398752</a></td><td>dlee</td><td>Fixed utils directory breakage from r398748, this time with extra hate.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398757">398757</a></td><td>rmudgett</td><td>Fix incorrect usages of ast_realloc().</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=398977">398977</a></td><td>jrose</td><td>chan_sip: Revert r398835 due to failing tests involving originate</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22424">ASTERISK-22424</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=399351">399351</a></td><td>mjordan</td><td>Update prep_tarball with new documentation files on the Asterisk wiki</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22439">ASTERISK-22439</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=401222">401222</a></td><td>bebuild</td><td>Create 1.8.24.0-rc2</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=401234">401234</a></td><td>bebuild</td><td>Make updates for Asterisk 1.8.24.0-rc2</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.8?view=revision&revision=401237">401237</a></td><td>bebuild</td><td>Importing release summary for 1.8.24.0-rc2 release.</td>
+<td></td></tr></table>
+<hr/>
+<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
+<pre>
+.version | 2
+ChangeLog | 18
+UPGRADE.txt | 5
+apps/app_meetme.c | 850 ++++++++++++++++++++-----------
+apps/app_mixmonitor.c | 23
+apps/app_playback.c | 4
+apps/app_queue.c | 4
+apps/app_stack.c | 5
+asterisk-1.8.24.0-rc1-summary.html | 466 ----------------
+asterisk-1.8.24.0-rc2-summary.html | 59 ++
+asterisk-1.8.24.0-rc2-summary.txt | 88 +++
+build_tools/prep_tarball | 4
+cel/cel_custom.c | 10
+channels/chan_dahdi.c | 40 -
+channels/chan_iax2.c | 209 ++++---
+channels/chan_misdn.c | 10
+channels/chan_sip.c | 34 -
+channels/iax2-parser.c | 14
+channels/sig_pri.c | 2
+channels/sip/dialplan_functions.c | 5
+configs/chan_dahdi.conf.sample | 3
+configs/h323.conf.sample | 2
+configs/iax.conf.sample | 17
+configs/indications.conf.sample | 2
+configs/sip.conf.sample | 3
+configs/sla.conf.sample | 11
+contrib/realtime/postgresql/realtime.sql | 17
+default.exports | 4
+funcs/func_channel.c | 25
+funcs/func_dialgroup.c | 8
+funcs/func_global.c | 19
+funcs/func_strings.c | 10
+include/asterisk/astmm.h | 6
+include/asterisk/frame.h | 8
+include/asterisk/lock.h | 20
+include/asterisk/logger.h | 2
+include/asterisk/utils.h | 68 ++
+main/abstract_jb.c | 4
+main/asterisk.c | 208 ++++---
+main/asterisk.exports.in | 19
+main/astfd.c | 6
+main/astmm.c | 27
+main/astobj2.c | 4
+main/cdr.c | 7
+main/cel.c | 2
+main/channel.c | 16
+main/cli.c | 40 +
+main/config.c | 4
+main/data.c | 2
+main/event.c | 6
+main/features.c | 24
+main/heap.c | 13
+main/http.c | 22
+main/indications.c | 7
+main/loader.c | 2
+main/lock.c | 220 ++++----
+main/logger.c | 60 +-
+main/manager.c | 25
+main/pbx.c | 6
+main/threadstorage.c | 6
+main/utils.c | 99 +++
+main/xmldoc.c | 14
+pbx/pbx_dundi.c | 20
+pbx/pbx_loopback.c | 15
+res/res_agi.c | 17
+res/res_jabber.c | 17
+res/res_musiconhold.c | 23
+res/res_security_log.c | 2
+tests/test_hashtab_thrash.c | 6
+tests/test_substitution.c | 41 -
+utils/ael_main.c | 6
+utils/check_expr.c | 9
+utils/conf2ael.c | 6
+utils/extconf.c | 3
+74 files changed, 1784 insertions(+), 1301 deletions(-)
+</pre><br/>
+<hr/>
+</body>
+</html>
|
[-]
[+]
|
Added |
asterisk-1.8.24.0.tar.xz/asterisk-1.8.24.0-summary.txt
^
|
@@ -0,0 +1,610 @@
+ Release Summary
+
+ asterisk-1.8.24.0
+
+ Date: 2013-10-21
+
+ <asteriskteam@digium.com>
+
+ ----------------------------------------------------------------------
+
+ Table of Contents
+
+ 1. Summary
+ 2. Contributors
+ 3. Closed Issues
+ 4. Other Changes
+ 5. Diffstat
+
+ ----------------------------------------------------------------------
+
+ Summary
+
+ [Back to Top]
+
+ This release includes only bug fixes. The changes included were made only
+ to address problems that have been identified in this release series.
+ Users should be able to safely upgrade to this version if this release
+ series is already in use. Users considering upgrading from a previous
+ release series are strongly encouraged to review the UPGRADE.txt document
+ as well as the CHANGES document for information about upgrading to this
+ release series.
+
+ The data in this summary reflects changes that have been made since the
+ previous release, asterisk-1.8.23.0.
+
+ ----------------------------------------------------------------------
+
+ Contributors
+
+ [Back to Top]
+
+ This table lists the people who have submitted code, those that have
+ tested patches, as well as those that reported issues on the issue tracker
+ that were resolved in this release. For coders, the number is how many of
+ their patches (of any size) were committed into this release. For testers,
+ the number is the number of times their name was listed as assisting with
+ testing a patch. Finally, for reporters, the number is the number of
+ issues that they reported that were closed by commits that went into this
+ release.
+
+ Coders Testers Reporters
+ 10 rmudgett 3 Corey Farrell 7 coreyfarrell
+ 9 wdoekes 2 wdoekes 2 dlee
+ 6 elguero 1 Alex Zarubin 2 mdavenport
+ 6 mjordan 1 Ariel Wainer 2 mjordan
+ 5 Corey Farrell 1 CGI.NET 2 wdoekes
+ 4 dlee 1 Colin Cutherbertson 1 abelbeck
+ 4 jrose 1 Doug Bailey 1 aepshteyn
+ 4 kmoore 1 elguero 1 anstein
+ 3 bebuild 1 Jacek Konieczny 1 ariw
+ 2 coreyfarrell 1 Karsten Wemheuer 1 az_tth
+ 2 newtonr 1 Michael Keuter 1 brietz
+ 1 abelbeck 1 mjordan 1 colinc
+ 1 alecdavis 1 Stuart Henderson 1 dbailey
+ 1 anstein 1 gkelleter
+ 1 file 1 ivo.andonov
+ 1 Guenther Kelleter 1 jkonieczny
+ 1 jcolp 1 jrose
+ 1 kharwell 1 kenner
+ 1 mmichelson 1 nsnake
+ 1 moy 1 phill
+ 1 phill 1 rafuchoucv
+ 1 Richard Miller 1 rnewton
+ 1 russell 1 snuffy
+ 1 snuffy 1 sthen
+ 1 Stefan Wachtler 1 ulogic
+ 1 varnav 1 varnav
+ 1 wimpy
+
+ ----------------------------------------------------------------------
+
+ Closed Issues
+
+ [Back to Top]
+
+ This is a list of all issues from the issue tracker that were closed by
+ changes that went into this release.
+
+ Category: Applications/app_meetme
+
+ ASTERISK-21907: Crash - segfault - When executing a MeetMeAdmin command
+ that requires a member, without specifying a member
+ Revision: 399033
+ Reporter: aepshteyn
+ Coders: kmoore
+
+ Category: Applications/app_queue
+
+ ASTERISK-22263: [patch] 'queue add member ...' help text update
+ Revision: 398884
+ Reporter: rnewton
+ Coders: newtonr
+
+ Category: Bridges/bridge_native_rtp
+
+ ASTERISK-22424: bridge_native_rtp: Asterisk 12 attempts to remotely bridge
+ on 200OK response to invite when the 200 lacks SDP
+ Revision: 398835
+ Reporter: jrose
+ Coders: jrose
+
+ Category: CEL/General
+
+ ASTERISK-22259: [patch] cel segfault on invalid cel.conf
+ Revision: 397033
+ Reporter: coreyfarrell
+ Testers: Corey Farrell
+ Coders: Corey Farrell
+
+ Category: Channels/chan_dahdi
+
+ ASTERISK-21117: Bad interpretation of the file chan_dahdi.conf when using
+ open r2 parameters
+ Revision: 394106
+ Reporter: rafuchoucv
+ Coders: moy
+
+ ASTERISK-21847: Segfault due to dahdi_restart and round robin
+ Revision: 393627
+ Reporter: ivo.andonov
+ Coders: rmudgett
+
+ Category: Channels/chan_iax2
+
+ ASTERISK-21953: connectedline parameter not documented
+ Revision: 394886
+ Reporter: wimpy
+ Coders: mjordan
+
+ ASTERISK-22504: [patch] chan_iax2: wrong expiry time in astdb
+ Revision: 399158
+ Reporter: brietz
+ Coders: Stefan Wachtler
+
+ Category: Channels/chan_local
+
+ ASTERISK-22221: The masquerade super-test fails on all Asterisk versions
+ Revision: 397525
+ Reporter: mjordan
+ Coders: rmudgett
+
+ Category: Channels/chan_sip/General
+
+ ASTERISK-21064: Crash when handling ACK on dialog that has no channel
+ Revision: 397710
+ Reporter: colinc
+ Testers: wdoekes, Colin Cutherbertson
+ Coders: wdoekes
+
+ ASTERISK-22007: chan_sip: segfault with invalid sdp
+ Revision: 397756
+ Reporter: wdoekes
+ Testers: wdoekes
+ Coders: wdoekes
+
+ ASTERISK-22071: chan_sip doesn't respect Via ..completely
+ Revision: 397204
+ Reporter: az_tth
+ Testers: Alex Zarubin, Karsten Wemheuer
+ Coders: elguero
+
+ ASTERISK-22239: [patch] Missing extra line break between peers when
+ running AMI action SIPPeers
+ Revision: 396236
+ Reporter: jkonieczny
+ Testers: Jacek Konieczny, elguero
+ Coders: elguero
+
+ ASTERISK-22248: [patch] test_sip_rtpqos corrupts dialogs container
+ Revision: 397112
+ Reporter: coreyfarrell
+ Coders: Corey Farrell
+
+ Category: Channels/chan_sip/Registration
+
+ ASTERISK-21964: SIP TLS Register statement fails if sip.conf register
+ directive uses peer name.
+ Revision: 396240
+ Reporter: dbailey
+ Testers: Doug Bailey
+ Coders: elguero
+
+ Category: Channels/chan_sip/T.38
+
+ ASTERISK-22275: [patch] T.38 Passthrough broken if peer doen't report
+ T38MaxBitRate
+ Revision: 397256
+ Reporter: anstein
+ Coders: anstein
+
+ Category: Contrib/General
+
+ ASTERISK-21021: SQL script to create queue_log table in PostgreSQL
+ Revision: 394896
+ Reporter: varnav
+ Coders: varnav
+
+ Category: Core/General
+
+ ASTERISK-22179: Update copyright headers - they're so last year
+ Revision: 395032
+ Reporter: mdavenport
+ Coders: mjordan
+
+ ASTERISK-22238: [patch] astfd and threadstorage debug cli commands are not
+ unregistered
+ Revision: 397106
+ Reporter: coreyfarrell
+ Testers: Corey Farrell
+ Coders: Corey Farrell
+
+ ASTERISK-22249: [patch] xmldoc.c leaks an attribute
+ Revision: 397064
+ Reporter: coreyfarrell
+ Testers: Corey Farrell
+ Coders: Corey Farrell
+
+ ASTERISK-22536: MALLOC_DEBUG causes /tmp/refs to be written, even if
+ REF_DEBUG is not defined
+ Revision: 399098
+ Reporter: dlee
+ Coders: dlee
+
+ Category: Core/HTTP
+
+ ASTERISK-21789: ast_http_get_cookies() fails in the presence of RFC2965
+ Cookie2 header
+ Revision: 394899
+ Reporter: sthen
+ Testers: mjordan, Stuart Henderson
+ Coders: mjordan
+
+ ASTERISK-22237: [patch] http_shutdown incomplete
+ Revision: 397308
+ Reporter: coreyfarrell
+ Coders: Corey Farrell
+
+ Category: Core/Jitterbuffer
+
+ ASTERISK-21036: Jitter Buffer log file creation doesn't account for
+ multiple slashes in DAHDI channel names
+ Revision: 399402
+ Reporter: kenner
+ Coders: kmoore
+
+ Category: Core/ManagerInterface
+
+ ASTERISK-21789: ast_http_get_cookies() fails in the presence of RFC2965
+ Cookie2 header
+ Revision: 394899
+ Reporter: sthen
+ Testers: mjordan, Stuart Henderson
+ Coders: mjordan
+
+ ASTERISK-22395: [patch] manager.c and res_agi.c leak results from
+ ast_xmldoc_printable
+ Revision: 398060
+ Reporter: coreyfarrell
+ Coders: coreyfarrell
+
+ Category: Core/RTP
+
+ ASTERISK-22424: bridge_native_rtp: Asterisk 12 attempts to remotely bridge
+ on 200OK response to invite when the 200 lacks SDP
+ Revision: 398835
+ Reporter: jrose
+ Coders: jrose
+
+ Category: Documentation
+
+ ASTERISK-22308: Documentation - chan_dahdi, waitfordialtone is not
+ boolean, it's time in milliseconds
+ Revision: 398880
+ Reporter: mdavenport
+ Coders: newtonr
+
+ Category: Features/Parking
+
+ ASTERISK-22413: [patch] features.c TEST_FRAMEWORK leaks channel reference,
+ preventing graceful shutdown
+ Revision: 398021
+ Reporter: coreyfarrell
+ Coders: coreyfarrell
+
+ Category: Functions/func_channel
+
+ ASTERISK-20969: Fix func_channel documentation for sip/iax2/dadhi
+ Revision: 394980
+ Reporter: snuffy
+ Coders: snuffy
+
+ Category: Functions/func_strings
+
+ ASTERISK-21717: [patch] - Documentation for PASSTHRU function is unclear
+ Revision: 394302
+ Reporter: ulogic
+ Coders: Richard Miller
+
+ Category: Resources/res_agi
+
+ ASTERISK-21903: [patch] Return proper result upon error when running some
+ AGI commands
+ Revision: 394640
+ Reporter: ariw
+ Testers: Ariel Wainer
+ Coders: elguero
+
+ ASTERISK-22395: [patch] manager.c and res_agi.c leak results from
+ ast_xmldoc_printable
+ Revision: 398060
+ Reporter: coreyfarrell
+ Coders: coreyfarrell
+
+ Category: Resources/res_features
+
+ ASTERISK-22416: [patch] Segmentation fault (in
+ process_applicationmap_line, at features.c) when using improper feature
+ mapping syntax
+ Revision: 399304
+ Reporter: nsnake
+ Testers: CGI.NET
+ Coders: elguero
+
+ Category: Resources/res_indications
+
+ ASTERISK-21997: [patch] - Incorrect Ring tone for Malaysia
+ Revision: 394940
+ Reporter: phill
+ Coders: phill
+
+ Category: Resources/res_jabber
+
+ ASTERISK-22435: [patch] jabber/xmpp MWI distributed pubsub issue where the
+ mailbox and context get swapped at the remote end
+ Revision: 398523
+ Reporter: abelbeck
+ Testers: Michael Keuter
+ Coders: abelbeck
+
+ Category: Resources/res_musiconhold
+
+ ASTERISK-22252: res_musiconhold cleanup - REF_DEBUG reload warnings and
+ ref leaks
+ Revision: 398937
+ Reporter: wdoekes
+ Coders: jrose
+
+ Category: Resources/res_xmpp
+
+ ASTERISK-22435: [patch] jabber/xmpp MWI distributed pubsub issue where the
+ mailbox and context get swapped at the remote end
+ Revision: 398523
+ Reporter: abelbeck
+ Testers: Michael Keuter
+ Coders: abelbeck
+
+ Category: Tests/General
+
+ ASTERISK-22276: Test test_hashtab_thrash fails on 32-bit machines when
+ compiled without DEBUG_THREADS
+ Revision: 396619
+ Reporter: mjordan
+ Coders: jcolp
+
+ ASTERISK-22413: [patch] features.c TEST_FRAMEWORK leaks channel reference,
+ preventing graceful shutdown
+ Revision: 398021
+ Reporter: coreyfarrell
+ Coders: coreyfarrell
+
+ Category: Tests/testsuite
+
+ ASTERISK-22221: The masquerade super-test fails on all Asterisk versions
+ Revision: 397525
+ Reporter: mjordan
+ Coders: rmudgett
+
+ ----------------------------------------------------------------------
+
+ Commits Not Associated with an Issue
+
+ [Back to Top]
+
+ This is a list of all changes that went into this release that did not
+ directly close an issue from the issue tracker. The commits may have been
+ marked as being related to an issue. If that is the case, the issue
+ numbers are listed here, as well.
+
+ +------------------------------------------------------------------------+
+ | Revision | Author | Summary | Issues Referenced |
+ |----------+------------+----------------------------+-------------------|
+ | | | IAX2: Transfer Reject: | |
+ | 391333 | alecdavis | Lock bridgecallno before | |
+ | | | touching it, refactor | |
+ |----------+------------+----------------------------+-------------------|
+ | 391489 | mjordan | Fix memory leak while | |
+ | | | loading priority modules | |
+ |----------+------------+----------------------------+-------------------|
+ | | | app_mixmonitor: Fix | |
+ | 391778 | jrose | crashes caused by | |
+ | | | unloading app_mixmonitor | |
+ |----------+------------+----------------------------+-------------------|
+ | 393928 | russell | astobj2-ify the SLA code | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Adding a note to | |
+ | 396196 | elguero | UPGRADE.txt about a change | ASTERISK-21903 |
+ | | | made to res_agi in order | |
+ | | | to | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Check result of | |
+ | 396279 | wdoekes | ast_var_assign() calls for | |
+ | | | memory allocation failure. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Consistent memory | |
+ | 396427 | wdoekes | allocation by | |
+ | | | ast_bt_get_symbols. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_sip: Fix IP-addr in | |
+ | 396579 | wdoekes | warning when rejecting a | |
+ | | | contact ACL. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_sip: Convert 'just | |
+ | 396582 | wdoekes | did sched_add waitid...' | |
+ | | | from warning to debug | |
+ | | | message. | |
+ |----------+------------+----------------------------+-------------------|
+ | 396656 | file | Tweak comment for why | |
+ | | | usleep is used. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Remove leading spaces from | |
+ | 396745 | kmoore | the CLI command before | |
+ | | | parsing | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Fix invalid access to | |
+ | 396958 | mjordan | disposed memory in | |
+ | | | main/data unit test | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Add "autoframing" option | |
+ | 396994 | wdoekes | to sip.conf.sample and | |
+ | | | h323.conf.sample. | |
+ |----------+------------+----------------------------+-------------------|
+ | 397156 | mmichelson | Remove REF_DEBUG | |
+ | | | definition. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Add _IO_stdin_used in | ASTERISK-21763, |
+ | 397377 | wdoekes | version-script to fix | ASTERISK-21665 |
+ | | | SIGBUSes on Sparc. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | test_substituition: Fix | |
+ | 398018 | rmudgett | failed test reporting to | |
+ | | | actually report failure. | |
+ |----------+------------+----------------------------+-------------------|
+ | 398102 | kharwell | Fix various memory leaks | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Be a little more verbose | |
+ | 398167 | wdoekes | when loading | |
+ | | | cel_custom.conf. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_iax2: Add missing | |
+ | 398301 | rmudgett | control frame names to | |
+ | | | debug frame decode output. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_iax2: Add missing | |
+ | 398339 | rmudgett | control frame names to | |
+ | | | debug frame decode output. | |
+ | | | (Part 2) | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_iax2: Fix | |
+ | 398379 | rmudgett | bridgecallno deadlock | |
+ | | | avoidance. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_iax2: Fix stray | |
+ | 398416 | rmudgett | reference to worker thread | |
+ | | | idle_list. | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_iax2: Reduce | |
+ | 398456 | rmudgett | indentation in | |
+ | | | __attempt_transmit(). | |
+ |----------+------------+----------------------------+-------------------|
+ | 398576 | kmoore | Commit the remainder of | ASTERISK-22435 |
+ | | | r398523 | |
+ |----------+------------+----------------------------+-------------------|
+ | | | MALLOC_DEBUG: Change fence | |
+ | 398703 | rmudgett | magic number to be | |
+ | | | completely different from | |
+ | | | the freed magic number. | |
+ |----------+------------+----------------------------+-------------------|
+ | 398748 | dlee | Fixed utils directory | |
+ | | | breakage from r398648 | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Fixed utils directory | |
+ | 398752 | dlee | breakage from r398748, | |
+ | | | this time with extra hate. | |
+ |----------+------------+----------------------------+-------------------|
+ | 398757 | rmudgett | Fix incorrect usages of | |
+ | | | ast_realloc(). | |
+ |----------+------------+----------------------------+-------------------|
+ | | | chan_sip: Revert r398835 | |
+ | 398977 | jrose | due to failing tests | ASTERISK-22424 |
+ | | | involving originate | |
+ |----------+------------+----------------------------+-------------------|
+ | | | Update prep_tarball with | |
+ | 399351 | mjordan | new documentation files on | ASTERISK-22439 |
+ | | | the Asterisk wiki | |
+ |----------+------------+----------------------------+-------------------|
+ | 401222 | bebuild | Create 1.8.24.0-rc2 | |
+ |----------+------------+----------------------------+-------------------|
+ | 401234 | bebuild | Make updates for Asterisk | |
+ | | | 1.8.24.0-rc2 | |
+ |----------+------------+----------------------------+-------------------|
+ | 401237 | bebuild | Importing release summary | |
+ | | | for 1.8.24.0-rc2 release. | |
+ +------------------------------------------------------------------------+
+
+ ----------------------------------------------------------------------
+
+ Diffstat Results
+
+ [Back to Top]
+
+ This is a summary of the changes to the source code that went into this
+ release that was generated using the diffstat utility.
+
+ .version | 2
+ ChangeLog | 18
+ UPGRADE.txt | 5
+ apps/app_meetme.c | 850 ++++++++++++++++++++-----------
+ apps/app_mixmonitor.c | 23
+ apps/app_playback.c | 4
+ apps/app_queue.c | 4
+ apps/app_stack.c | 5
+ asterisk-1.8.24.0-rc1-summary.html | 466 ----------------
+ asterisk-1.8.24.0-rc2-summary.html | 59 ++
+ asterisk-1.8.24.0-rc2-summary.txt | 88 +++
+ build_tools/prep_tarball | 4
+ cel/cel_custom.c | 10
+ channels/chan_dahdi.c | 40 -
+ channels/chan_iax2.c | 209 ++++---
+ channels/chan_misdn.c | 10
+ channels/chan_sip.c | 34 -
+ channels/iax2-parser.c | 14
+ channels/sig_pri.c | 2
+ channels/sip/dialplan_functions.c | 5
+ configs/chan_dahdi.conf.sample | 3
+ configs/h323.conf.sample | 2
+ configs/iax.conf.sample | 17
+ configs/indications.conf.sample | 2
+ configs/sip.conf.sample | 3
+ configs/sla.conf.sample | 11
+ contrib/realtime/postgresql/realtime.sql | 17
+ default.exports | 4
+ funcs/func_channel.c | 25
+ funcs/func_dialgroup.c | 8
+ funcs/func_global.c | 19
+ funcs/func_strings.c | 10
+ include/asterisk/astmm.h | 6
+ include/asterisk/frame.h | 8
+ include/asterisk/lock.h | 20
+ include/asterisk/logger.h | 2
+ include/asterisk/utils.h | 68 ++
+ main/abstract_jb.c | 4
+ main/asterisk.c | 208 ++++---
+ main/asterisk.exports.in | 19
+ main/astfd.c | 6
+ main/astmm.c | 27
+ main/astobj2.c | 4
+ main/cdr.c | 7
+ main/cel.c | 2
+ main/channel.c | 16
+ main/cli.c | 40 +
+ main/config.c | 4
+ main/data.c | 2
+ main/event.c | 6
+ main/features.c | 24
+ main/heap.c | 13
+ main/http.c | 22
+ main/indications.c | 7
+ main/loader.c | 2
+ main/lock.c | 220 ++++----
+ main/logger.c | 60 +-
+ main/manager.c | 25
+ main/pbx.c | 6
+ main/threadstorage.c | 6
+ main/utils.c | 99 +++
+ main/xmldoc.c | 14
+ pbx/pbx_dundi.c | 20
+ pbx/pbx_loopback.c | 15
+ res/res_agi.c | 17
+ res/res_jabber.c | 17
+ res/res_musiconhold.c | 23
+ res/res_security_log.c | 2
+ tests/test_hashtab_thrash.c | 6
+ tests/test_substitution.c | 41 -
+ utils/ael_main.c | 6
+ utils/check_expr.c | 9
+ utils/conf2ael.c | 6
+ utils/extconf.c | 3
+ 74 files changed, 1784 insertions(+), 1301 deletions(-)
+
+ ----------------------------------------------------------------------
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/build_tools/prep_tarball
^
|
@@ -19,11 +19,11 @@
cd doc
echo "Downloading the PDF and HTML documentation from the Asterisk wiki (this will take a minute) ..."
-wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-Admin-Guide-$branch.pdf
+wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-$branch-Reference.pdf
+wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-Admin-Guide.pdf
wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-Admin-Guide-$branch.html.zip
echo "Extracting HTML Admin Guide"
unzip Asterisk-Admin-Guide-$branch.html.zip
mv AST/ Asterisk-Admin-Guide/
-mv Asterisk-Admin-Guide-$branch.pdf Asterisk-Admin-Guide.pdf
rm -f Asterisk-Admin-Guide-$branch.html.zip
echo "Documentation downloaded. Goodbye!"
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/cel/cel_custom.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 337973 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398167 $")
#include "asterisk/paths.h"
#include "asterisk/channel.h"
@@ -82,6 +82,7 @@
struct ast_config *cfg;
struct ast_variable *var;
struct ast_flags config_flags = { 0 };
+ int mappings = 0;
int res = 0;
cfg = ast_config_load(CONFIG, config_flags);
@@ -90,7 +91,10 @@
return -1;
}
- var = ast_variable_browse(cfg, "mappings");
+ if (!(var = ast_variable_browse(cfg, "mappings"))) {
+ ast_log(LOG_NOTICE, "No mappings found in " CONFIG ". Not logging CEL to custom CSVs.\n");
+ }
+
while (var) {
if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) {
struct cel_config *sink = ast_calloc_with_stringfields(1, struct cel_config, 1024);
@@ -105,6 +109,8 @@
ast_string_field_build(sink, filename, "%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
ast_mutex_init(&sink->lock);
+ ast_verb(3, "Added CEL CSV mapping for '%s'.\n", sink->filename);
+ mappings += 1;
AST_RWLIST_INSERT_TAIL(&sinks, sink, list);
} else {
ast_log(LOG_NOTICE, "Mapping must have both a filename and a format at line %d\n", var->lineno);
@@ -113,6 +119,8 @@
}
ast_config_destroy(cfg);
+ ast_verb(1, "Added CEL CSV mapping for %d files.\n", mappings);
+
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/chan_dahdi.c
^
|
@@ -49,7 +49,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 387297 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 394106 $")
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <pthread.h>
@@ -551,14 +551,6 @@
#endif /* defined(HAVE_SS7) */
#ifdef HAVE_OPENR2
-struct dahdi_mfcr2 {
- pthread_t r2master; /*!< Thread of master */
- openr2_context_t *protocol_context; /*!< OpenR2 context handle */
- struct dahdi_pvt *pvts[SIG_MFCR2_MAX_CHANNELS]; /*!< Member channel pvt structs */
- int numchans; /*!< Number of channels in this R2 block */
- int monitored_count; /*!< Number of channels being monitored */
-};
-
struct dahdi_mfcr2_conf {
openr2_variant_t variant;
int mfback_timeout;
@@ -582,6 +574,15 @@
openr2_calling_party_category_t category;
};
+/* MFC-R2 pseudo-link structure */
+struct dahdi_mfcr2 {
+ pthread_t r2master; /*!< Thread of master */
+ openr2_context_t *protocol_context; /*!< OpenR2 context handle */
+ struct dahdi_pvt *pvts[SIG_MFCR2_MAX_CHANNELS]; /*!< Member channel pvt structs */
+ int numchans; /*!< Number of channels in this R2 block */
+ struct dahdi_mfcr2_conf conf; /*!< Configuration used to setup this pseudo-link */
+};
+
/* malloc'd array of malloc'd r2links */
static struct dahdi_mfcr2 **r2links;
/* how many r2links have been malloc'd */
@@ -12185,14 +12186,20 @@
r2links_count = 0;
}
-#define R2_LINK_CAPACITY 10
-static struct dahdi_mfcr2 *dahdi_r2_get_link(void)
+/* This is an artificial convenient capacity, to keep at most a full E1 of channels in a single thread */
+#define R2_LINK_CAPACITY 30
+static struct dahdi_mfcr2 *dahdi_r2_get_link(const struct dahdi_chan_conf *conf)
{
struct dahdi_mfcr2 *new_r2link = NULL;
struct dahdi_mfcr2 **new_r2links = NULL;
- /* this function is called just when starting up and no monitor threads have been launched,
- no need to lock monitored_count member */
- if (!r2links_count || (r2links[r2links_count - 1]->monitored_count == R2_LINK_CAPACITY)) {
+
+ /* Only create a new R2 link if
+ 1. This is the first link requested
+ 2. Configuration changed
+ 3. We got more channels than supported per link */
+ if (!r2links_count ||
+ memcmp(&conf->mfcr2, &r2links[r2links_count - 1]->conf, sizeof(conf->mfcr2)) ||
+ (r2links[r2links_count - 1]->numchans == R2_LINK_CAPACITY)) {
new_r2link = ast_calloc(1, sizeof(**r2links));
if (!new_r2link) {
ast_log(LOG_ERROR, "Cannot allocate R2 link!\n");
@@ -12257,7 +12264,8 @@
ast_log(LOG_ERROR, "Failed to configure r2context from advanced configuration file %s\n", conf->mfcr2.r2proto_file);
}
}
- r2_link->monitored_count = 0;
+ /* Save the configuration used to setup this link */
+ memcpy(&r2_link->conf, conf, sizeof(r2_link->conf));
return 0;
}
#endif
@@ -12489,7 +12497,7 @@
#ifdef HAVE_OPENR2
if (chan_sig == SIG_MFCR2) {
struct dahdi_mfcr2 *r2_link;
- r2_link = dahdi_r2_get_link();
+ r2_link = dahdi_r2_get_link(conf);
if (!r2_link) {
ast_log(LOG_WARNING, "Cannot get another R2 DAHDI context!\n");
destroy_dahdi_pvt(tmp);
@@ -12531,7 +12539,6 @@
tmp->mfcr2call = 0;
tmp->mfcr2_dnis_index = 0;
tmp->mfcr2_ani_index = 0;
- r2_link->monitored_count++;
}
#endif
#ifdef HAVE_PRI
@@ -15173,6 +15180,7 @@
dahdi_softhangup_all();
ast_verb(4, "Final softhangup of all DAHDI channels complete.\n");
destroy_all_channels();
+ memset(round_robin, 0, sizeof(round_robin));
ast_debug(1, "Channels destroyed. Now re-reading config. %d active channels remaining.\n", ast_active_channels());
ast_mutex_unlock(&monlock);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/chan_iax2.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 394182 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399158 $")
#include <sys/mman.h>
#include <dirent.h>
@@ -806,7 +806,7 @@
/*! Status of knowledge of peer ADSI capability */
int peeradsicpe;
- /*! Who we are bridged to */
+ /*! Callno of native bridge peer. (Valid if nonzero) */
unsigned short bridgecallno;
int pingid; /*!< Transmit PING request */
@@ -1460,12 +1460,11 @@
#ifdef SCHED_MULTITHREADED
static int __schedule_action(void (*func)(const void *data), const void *data, const char *funcname)
{
- struct iax2_thread *thread = NULL;
+ struct iax2_thread *thread;
static time_t lasterror;
- static time_t t;
+ time_t t;
thread = find_idle_thread();
-
if (thread != NULL) {
thread->schedfunc = func;
thread->scheddata = data;
@@ -1477,9 +1476,10 @@
return 0;
}
time(&t);
- if (t != lasterror)
- ast_debug(1, "Out of idle IAX2 threads for scheduling!\n");
- lasterror = t;
+ if (t != lasterror) {
+ lasterror = t;
+ ast_debug(1, "Out of idle IAX2 threads for scheduling! (%s)\n", funcname);
+ }
return -1;
}
@@ -3489,42 +3489,49 @@
struct iax_frame *f = (struct iax_frame *)data;
int freeme = 0;
int callno = f->callno;
+
/* Make sure this call is still active */
if (callno)
ast_mutex_lock(&iaxsl[callno]);
if (callno && iaxs[callno]) {
- if ((f->retries < 0) /* Already ACK'd */ ||
- (f->retries >= max_retries) /* Too many attempts */) {
- /* Record an error if we've transmitted too many times */
- if (f->retries >= max_retries) {
- if (f->transfer) {
- /* Transfer timeout */
- send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
- } else if (f->final) {
- iax2_destroy(callno);
- } else {
- if (iaxs[callno]->owner)
- ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %u, ts=%d, seqno=%d)\n", ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),iaxs[f->callno]->owner->name , f->af.frametype, f->af.subclass.integer, f->ts, f->oseqno);
- iaxs[callno]->error = ETIMEDOUT;
- if (iaxs[callno]->owner) {
- struct ast_frame fr = { AST_FRAME_CONTROL, { AST_CONTROL_HANGUP }, .data.uint32 = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
- /* Hangup the fd */
- iax2_queue_frame(callno, &fr); /* XXX */
- /* Remember, owner could disappear */
- if (iaxs[callno] && iaxs[callno]->owner)
- iaxs[callno]->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
- } else {
- if (iaxs[callno]->reg) {
- memset(&iaxs[callno]->reg->us, 0, sizeof(iaxs[callno]->reg->us));
- iaxs[callno]->reg->regstate = REG_STATE_TIMEOUT;
- iaxs[callno]->reg->refresh = IAX_DEFAULT_REG_EXPIRE;
- }
- iax2_destroy(callno);
- }
+ if (f->retries < 0) {
+ /* Already ACK'd */
+ freeme = 1;
+ } else if (f->retries >= max_retries) {
+ /* Too many attempts. Record an error. */
+ if (f->transfer) {
+ /* Transfer timeout */
+ send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
+ } else if (f->final) {
+ iax2_destroy(callno);
+ } else {
+ if (iaxs[callno]->owner) {
+ ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %u, ts=%d, seqno=%d)\n",
+ ast_inet_ntoa(iaxs[f->callno]->addr.sin_addr),
+ iaxs[f->callno]->owner->name,
+ f->af.frametype,
+ f->af.subclass.integer,
+ f->ts,
+ f->oseqno);
+ }
+ iaxs[callno]->error = ETIMEDOUT;
+ if (iaxs[callno]->owner) {
+ struct ast_frame fr = { AST_FRAME_CONTROL, { AST_CONTROL_HANGUP }, .data.uint32 = AST_CAUSE_DESTINATION_OUT_OF_ORDER };
+ /* Hangup the fd */
+ iax2_queue_frame(callno, &fr); /* XXX */
+ /* Remember, owner could disappear */
+ if (iaxs[callno] && iaxs[callno]->owner)
+ iaxs[callno]->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
+ } else {
+ if (iaxs[callno]->reg) {
+ memset(&iaxs[callno]->reg->us, 0, sizeof(iaxs[callno]->reg->us));
+ iaxs[callno]->reg->regstate = REG_STATE_TIMEOUT;
+ iaxs[callno]->reg->refresh = IAX_DEFAULT_REG_EXPIRE;
}
-
+ iax2_destroy(callno);
}
- freeme = 1;
+ }
+ freeme = 1;
} else {
/* Update it if it needs it */
update_packet(f);
@@ -8661,8 +8668,6 @@
return 0;
}
-static int iax2_poke_peer(struct iax2_peer *peer, int heldcall);
-
static void reg_source_db(struct iax2_peer *p)
{
char data[80];
@@ -8756,6 +8761,22 @@
}
}
+ /* treat an unspecified refresh interval as the minimum */
+ if (!refresh) {
+ refresh = min_reg_expire;
+ }
+ if (refresh > max_reg_expire) {
+ ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
+ p->name, max_reg_expire, refresh);
+ p->expiry = max_reg_expire;
+ } else if (refresh < min_reg_expire) {
+ ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
+ p->name, min_reg_expire, refresh);
+ p->expiry = min_reg_expire;
+ } else {
+ p->expiry = refresh;
+ }
+
if (ast_sockaddr_cmp(&p->addr, &sockaddr)) {
if (iax2_regfunk) {
iax2_regfunk(p->name, 1);
@@ -8808,20 +8829,7 @@
peer_unref(p);
}
}
- /* treat an unspecified refresh interval as the minimum */
- if (!refresh)
- refresh = min_reg_expire;
- if (refresh > max_reg_expire) {
- ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
- p->name, max_reg_expire, refresh);
- p->expiry = max_reg_expire;
- } else if (refresh < min_reg_expire) {
- ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
- p->name, min_reg_expire, refresh);
- p->expiry = min_reg_expire;
- } else {
- p->expiry = refresh;
- }
+
if (p->expiry && sin->sin_addr.s_addr) {
p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, peer_ref(p));
if (p->expire == -1)
@@ -9625,9 +9633,10 @@
if (!(thread = find_idle_thread())) {
time(&t);
- if (t != last_errtime)
+ if (t != last_errtime) {
+ last_errtime = t;
ast_debug(1, "Out of idle IAX2 threads for I/O, pausing!\n");
- last_errtime = t;
+ }
usleep(1);
return 1;
}
@@ -11369,13 +11378,13 @@
}
break;
case IAX_COMMAND_TXREJ:
- if (iaxs[fr->callno]->bridgecallno) {
- while (ast_mutex_trylock(&iaxsl[iaxs[fr->callno]->bridgecallno])) {
- DEADLOCK_AVOIDANCE(&iaxsl[fr->callno]);
- }
- if (!iaxs[fr->callno]) {
- break;
- }
+ while (iaxs[fr->callno]
+ && iaxs[fr->callno]->bridgecallno
+ && ast_mutex_trylock(&iaxsl[iaxs[fr->callno]->bridgecallno])) {
+ DEADLOCK_AVOIDANCE(&iaxsl[fr->callno]);
+ }
+ if (!iaxs[fr->callno]) {
+ break;
}
iaxs[fr->callno]->transferring = TRANSFER_NONE;
@@ -11386,20 +11395,21 @@
break;
}
- if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
+ if (iaxs[iaxs[fr->callno]->bridgecallno]
+ && iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_NONE;
send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
}
ast_mutex_unlock(&iaxsl[iaxs[fr->callno]->bridgecallno]);
break;
case IAX_COMMAND_TXREADY:
- if (iaxs[fr->callno]->bridgecallno) {
- while (ast_mutex_trylock(&iaxsl[iaxs[fr->callno]->bridgecallno])) {
- DEADLOCK_AVOIDANCE(&iaxsl[fr->callno]);
- }
- if (!iaxs[fr->callno]) {
- break;
- }
+ while (iaxs[fr->callno]
+ && iaxs[fr->callno]->bridgecallno
+ && ast_mutex_trylock(&iaxsl[iaxs[fr->callno]->bridgecallno])) {
+ DEADLOCK_AVOIDANCE(&iaxsl[fr->callno]);
+ }
+ if (!iaxs[fr->callno]) {
+ break;
}
if (iaxs[fr->callno]->transferring == TRANSFER_BEGIN) {
@@ -11418,8 +11428,9 @@
break;
}
- if (!(iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) &&
- !(iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_MREADY)) {
+ if (!iaxs[iaxs[fr->callno]->bridgecallno]
+ || (iaxs[iaxs[fr->callno]->bridgecallno]->transferring != TRANSFER_READY
+ && iaxs[iaxs[fr->callno]->bridgecallno]->transferring != TRANSFER_MREADY)) {
ast_mutex_unlock(&iaxsl[iaxs[fr->callno]->bridgecallno]);
break;
}
@@ -11545,13 +11556,14 @@
}
/* Don't actually pass these frames along */
- if ((f.subclass.integer != IAX_COMMAND_ACK) &&
- (f.subclass.integer != IAX_COMMAND_TXCNT) &&
- (f.subclass.integer != IAX_COMMAND_TXACC) &&
- (f.subclass.integer != IAX_COMMAND_INVAL) &&
- (f.subclass.integer != IAX_COMMAND_VNAK)) {
- if (iaxs[fr->callno] && iaxs[fr->callno]->aseqno != iaxs[fr->callno]->iseqno)
+ if ((f.subclass.integer != IAX_COMMAND_ACK) &&
+ (f.subclass.integer != IAX_COMMAND_TXCNT) &&
+ (f.subclass.integer != IAX_COMMAND_TXACC) &&
+ (f.subclass.integer != IAX_COMMAND_INVAL) &&
+ (f.subclass.integer != IAX_COMMAND_VNAK)) {
+ if (iaxs[fr->callno] && iaxs[fr->callno]->aseqno != iaxs[fr->callno]->iseqno) {
send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ }
}
ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
@@ -11670,8 +11682,9 @@
/*iaxs[fr->callno]->last = fr->ts; (do it afterwards cos schedule/forward_delivery needs the last ts too)*/
fr->outoforder = 0;
} else {
- if (iaxdebug && iaxs[fr->callno])
+ if (iaxdebug && iaxs[fr->callno]) {
ast_debug(1, "Received out of order packet... (type=%d, subclass %d, ts = %d, last = %d)\n", f.frametype, f.subclass.integer, fr->ts, iaxs[fr->callno]->last);
+ }
fr->outoforder = -1;
}
fr->cacheable = ((f.frametype == AST_FRAME_VOICE) || (f.frametype == AST_FRAME_VIDEO));
@@ -11789,11 +11802,10 @@
break;
}
- if (thread->iostate == IAX_IOSTATE_IDLE)
- continue;
-
/* See what we need to do */
switch (thread->iostate) {
+ case IAX_IOSTATE_IDLE:
+ continue;
case IAX_IOSTATE_READY:
thread->actions++;
thread->iostate = IAX_IOSTATE_PROCESSING;
@@ -11806,14 +11818,10 @@
#ifdef SCHED_MULTITHREADED
thread->schedfunc(thread->scheddata);
#endif
+ break;
default:
break;
}
- time(&thread->checktime);
- thread->iostate = IAX_IOSTATE_IDLE;
-#ifdef DEBUG_SCHED_MULTITHREAD
- thread->curfunc[0]='\0';
-#endif
/* The network thread added us to the active_thread list when we were given
* frames to process, Now that we are done, we must remove ourselves from
@@ -11824,12 +11832,18 @@
/* Make sure another frame didn't sneak in there after we thought we were done. */
handle_deferred_full_frames(thread);
+
+ time(&thread->checktime);
+ thread->iostate = IAX_IOSTATE_IDLE;
+#ifdef DEBUG_SCHED_MULTITHREAD
+ thread->curfunc[0]='\0';
+#endif
}
/*!
- * \note For some reason, idle threads are exiting without being removed
- * from an idle list, which is causing memory corruption. Forcibly remove
- * it from the list, if it's there.
+ * \note For some reason, idle threads are exiting without being
+ * removed from an idle list, which is causing memory
+ * corruption. Forcibly remove it from the list, if it's there.
*/
AST_LIST_LOCK(&idle_list);
AST_LIST_REMOVE(&idle_list, thread, list);
@@ -14098,7 +14112,7 @@
return res;
res = AST_DEVICE_UNAVAILABLE;
- ast_debug(3, "iax2_devicestate: Found peer. What's device state of %s? addr=%d, defaddr=%d maxms=%d, lastms=%d\n",
+ ast_debug(3, "Found peer. What's device state of %s? addr=%d, defaddr=%d maxms=%d, lastms=%d\n",
pds.peer, ast_sockaddr_ipv4(&p->addr), p->defaddr.sin_addr.s_addr, p->maxms, p->lastms);
if ((ast_sockaddr_ipv4(&p->addr) || p->defaddr.sin_addr.s_addr) &&
@@ -14387,7 +14401,7 @@
struct iax2_thread *thread;
AST_LIST_LOCK(list_head);
- while ((thread = AST_LIST_REMOVE_HEAD(&idle_list, list))) {
+ while ((thread = AST_LIST_REMOVE_HEAD(list_head, list))) {
pthread_t thread_id = thread->threadid;
thread->stop = 1;
@@ -14429,9 +14443,9 @@
}
/* Call for all threads to halt */
- cleanup_thread_list(&idle_list);
cleanup_thread_list(&active_list);
cleanup_thread_list(&dynamic_list);
+ cleanup_thread_list(&idle_list);
ast_netsock_release(netsock);
ast_netsock_release(outsock);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/chan_misdn.c
^
|
@@ -58,7 +58,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 379226 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398235 $")
#include <pthread.h>
#include <sys/socket.h>
@@ -12655,8 +12655,7 @@
} else if (misdn_debug_only[port]
? (level == 1 && misdn_debug[port]) || level == misdn_debug[port]
: level <= misdn_debug[port]) {
- ast_console_puts(port_buf);
- ast_console_puts(buf);
+ ast_verbose("%s%s", port_buf, buf);
}
if (level <= misdn_debug[0] && !ast_strlen_zero(global_tracefile)) {
@@ -12668,12 +12667,7 @@
fp = fopen(global_tracefile, "a+");
if (!fp) {
- ast_console_puts("Error opening Tracefile: [ ");
- ast_console_puts(global_tracefile);
- ast_console_puts(" ] ");
-
- ast_console_puts(strerror(errno));
- ast_console_puts("\n");
+ ast_verbose("Error opening Tracefile: [ %s ] %s\n", global_tracefile, strerror(errno));
return;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/chan_sip.c
^
|
@@ -209,7 +209,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397825 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398977 $")
#include <signal.h>
#include <sys/signal.h>
@@ -13816,6 +13816,8 @@
append_history(p, "RegistryInit", "Account: %s@%s", r->username, r->hostname);
}
+ p->socket.type = r->transport;
+
/* Use port number specified if no SRV record was found */
if (!ast_sockaddr_isnull(&r->us)) {
if (!ast_sockaddr_port(&r->us) && r->portno) {
@@ -14660,7 +14662,7 @@
if (ast_apply_ha(sip_cfg.contact_ha, &peer->addr) != AST_SENSE_ALLOW ||
ast_apply_ha(peer->contactha, &peer->addr) != AST_SENSE_ALLOW) {
ast_log(LOG_WARNING, "Domain '%s' disallowed by contact ACL (violating IP %s)\n", hostport,
- ast_sockaddr_stringify_addr(&testsa));
+ ast_sockaddr_stringify_addr(&peer->addr));
ast_string_field_set(peer, fullcontact, "");
ast_string_field_set(pvt, our_contact, "");
return PARSE_REGISTER_DENIED;
@@ -17528,7 +17530,7 @@
"TextSupport: %s\r\n"
"ACL: %s\r\n"
"Status: %s\r\n"
- "RealtimeDevice: %s\r\n",
+ "RealtimeDevice: %s\r\n\r\n",
cont->idtext,
peer->name,
ast_sockaddr_isnull(&peer->addr) ? "-none-" : tmp_host,
@@ -21139,8 +21141,8 @@
wait = ast_random() % 2000;
}
p->waitid = ast_sched_add(sched, wait, sip_reinvite_retry, dialog_ref(p, "passing dialog ptr into sched structure based on waitid for sip_reinvite_retry."));
- ast_log(LOG_WARNING, "just did sched_add waitid(%d) for sip_reinvite_retry for dialog %s in handle_response_invite\n", p->waitid, p->callid);
- ast_debug(2, "Reinvite race. Waiting %d secs before retry\n", wait);
+ ast_debug(2, "Reinvite race. Scheduled sip_reinvite_retry in %d secs in handle_response_invite (waitid %d, dialog '%s')\n",
+ wait, p->waitid, p->callid);
}
}
break;
@@ -26135,9 +26137,7 @@
copy_socket_data(&p->socket, &req->socket);
- if (ast_sockaddr_isnull(&p->recv)) { /* This may already be set before getting here */
- ast_sockaddr_copy(&p->recv, addr);
- }
+ ast_sockaddr_copy(&p->recv, addr);
/* if we have an owner, then this request has been authenticated */
if (p->owner) {
@@ -32041,7 +32041,12 @@
clear_sip_domains();
ast_free_ha(sip_cfg.contact_ha);
+ if (sipsock_read_id) {
+ ast_io_remove(io, sipsock_read_id);
+ sipsock_read_id = NULL;
+ }
close(sipsock);
+ io_context_destroy(io);
sched_context_destroy(sched);
con = ast_context_find(used_context);
if (con) {
@@ -32055,6 +32060,11 @@
sip_reqresp_parser_exit();
sip_unregister_tests();
+ if (notify_types) {
+ ast_config_destroy(notify_types);
+ notify_types = NULL;
+ }
+
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/iax2-parser.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398339 $")
#include <sys/socket.h>
#include <netinet/in.h>
@@ -239,11 +239,12 @@
dump_prov_ies(output, maxlen, value, len);
}
-static struct iax2_ie {
+struct iax2_ie {
int ie;
char *name;
void (*dump)(char *output, int maxlen, void *value, int len);
-} infoelts[] = {
+};
+static struct iax2_ie infoelts[] = {
{ IAX_IE_CALLED_NUMBER, "CALLED NUMBER", dump_string },
{ IAX_IE_CALLING_NUMBER, "CALLING NUMBER", dump_string },
{ IAX_IE_CALLING_ANI, "ANI", dump_string },
@@ -392,6 +393,7 @@
int found;
char interp[1024];
char tmp[1024];
+
if (len < 2)
return;
while(len > 2) {
@@ -604,6 +606,14 @@
"TXFER ",
"CNLINE ",
"REDIR ",
+ "T38PARM",
+ "CC ERR!",/* This must never go across an IAX link. */
+ "SRCCHG ",
+ "READACT",
+ "AOC ",
+ "ENDOFQ ",
+ "INCOMPL",
+ "UPDRTPP",
};
struct ast_iax2_full_hdr *fh;
char retries[20];
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/sig_pri.c
^
|
@@ -7989,7 +7989,7 @@
info_str = pri_dump_info_str(pri->pri);
if (info_str) {
ast_cli(fd, "%s", info_str);
- free(info_str);
+ ast_std_free(info_str);
}
#else
pri_dump_info(pri->pri);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/channels/sip/dialplan_functions.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397112 $")
#include <math.h>
@@ -353,7 +353,7 @@
goto done;
}
chan->tech = &sip_tech;
- chan->tech_pvt = p;
+ chan->tech_pvt = dialog_ref(p, "Give the owner channel a reference to the dialog");
p->owner = chan;
varstr = ast_str_create(16);
@@ -397,8 +397,9 @@
ast_free(varstr);
ast_free(buffer);
- /* This unref will take care of destroying the channel, RTP instance, and SIP pvt */
+ /* This unlink and unref will take care of destroying the channel, RTP instance, and SIP pvt */
if (p) {
+ dialog_unlink_all(p);
dialog_unref(p, "Destroy test object");
}
ast_rtp_engine_unregister(&test_engine);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/configs/chan_dahdi.conf.sample
^
|
@@ -503,7 +503,8 @@
; easily be re-attaching to a prior incoming call that was not yet hung up).
; This option changes the hangup to wait for a dialtone on the line, before
; marking the line as once again available for use with outgoing calls.
-;waitfordialtone=yes
+; Specified in milliseconds, not set by default.
+;waitfordialtone=1000
;
; The following option enables receiving MWI on FXO lines. The default
; value is no.
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/configs/h323.conf.sample
^
|
@@ -29,6 +29,8 @@
;allow=gsm ; Always allow GSM, it's cool :)
;allow=ulaw ; see https://wiki.asterisk.org/wiki/display/AST/RTP+Packetization
; for framing options
+;autoframing=yes ; Set packetization based on the remote endpoint's (ptime)
+ ; preferences. Defaults to no.
;
; User-Input Mode (DTMF)
;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/configs/iax.conf.sample
^
|
@@ -345,12 +345,12 @@
;
; Call token validation can be set as optional for a single IP address or IP
; address range by using the 'calltokenoptional' option. 'calltokenoptional' is
-; only a global option.
+; only a global option.
;
;calltokenoptional=209.16.236.73/255.255.255.0
;
; By setting 'requirecalltoken=no', call token validation becomes optional for
-; that peer/user. By setting 'requirecalltoken=auto', call token validation
+; that peer/user. By setting 'requirecalltoken=auto', call token validation
; is optional until a call token supporting peer registers successfully using
; call token validation. This is used as an indication that from now on, we
; can require it from this peer. So, requirecalltoken is internally set to yes.
@@ -380,7 +380,7 @@
; has been disabled. Unlike the 'maxcallnumbers' option, this limit is not
; separate for each individual IP address. Any connection resulting in a
; non-call token validated call number being allocated contributes to this
-; limit. For use cases, see the call token user guide. This option's
+; limit. For use cases, see the call token user guide. This option's
; default value of 8192 should be sufficient in most cases.
;
;maxcallnumbers_nonvalidated=1024
@@ -389,7 +389,7 @@
; for specific IP addresses and IP address ranges. These limits take precedence
; over the global 'maxcallnumbers' option, but may still be overridden by a
; peer defined 'maxcallnumbers' entry. Note that these limits take effect
-; for every individual address within the range, not the range as a whole.
+; for every individual address within the range, not the range as a whole.
;
;[callnumberlimits]
;10.1.1.0/255.255.255.0 = 24
@@ -530,6 +530,15 @@
; suggested to the other side as well if it is for example a phone instead of
; another PBX.
;
+;connectedline=yes ; Set how connected line information is handled for this
+; ; peer. If set to "yes", both sending and receiving
+; ; connected line information will be enabled. If set to
+; ; "send", this peer will send connected line information
+; ; but will not process connected line updates. If set to
+; ; "receive", connected line updates will be processed
+; ; but not sent. If set to "no", connected line updates
+; ; will be disabled. Default is "no".
+
;[dynamichost]
;host=dynamic
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/configs/indications.conf.sample
^
|
@@ -434,7 +434,7 @@
ringcadence = 2000,4000
dial = 425
busy = 425/500,0/500
-ring = 425/400,0/200
+ring = 425/400,0/200,425/400,0/2000
congestion = 425/500,0/500
[nl]
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/configs/sip.conf.sample
^
|
@@ -300,6 +300,8 @@
;allow=ulaw ; Allow codecs in order of preference
;allow=ilbc ; see https://wiki.asterisk.org/wiki/display/AST/RTP+Packetization
; for framing options
+;autoframing=yes ; Set packetization based on the remote endpoint's (ptime)
+ ; preferences. Defaults to no.
;
; This option specifies a preference for which music on hold class this channel
; should listen to when put on hold if the music class has not been set on the
@@ -1121,6 +1123,7 @@
; language
; allow
; disallow
+; autoframing
; insecure
; trustrpid
; progressinband
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/configs/sla.conf.sample
^
|
@@ -15,6 +15,17 @@
; -------------------------------------
+; ********************************
+; **** Configuration Ordering ****
+; ********************************
+
+; Note that SLA configuration processing assumes that *all* trunk declarations are
+; listed in the configuration file before any stations.
+
+; ********************************
+; ********************************
+
+
; ---- Trunk Declarations -------------
;
;[line1] ; Provide a name for this trunk.
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/contrib/realtime/postgresql/realtime.sql
^
|
@@ -136,6 +136,23 @@
PRIMARY KEY (queue_name, interface)
) WITHOUT OIDS;
+drop table queue_log;
+CREATE TABLE "queue_log" (
+"id" SERIAL,
+"time" TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL,
+"callid" character varying(50) NOT NULL,
+"queuename" character varying(50) NOT NULL,
+"agent" character varying(50) NOT NULL,
+"event" character varying(20) NOT NULL,
+"data1" character varying(50) NOT NULL,
+"data2" character varying(50) NOT NULL,
+"data3" character varying(50) NOT NULL,
+"data4" character varying(50) NOT NULL,
+"data5" character varying(50) NOT NULL,
+CONSTRAINT queue_log_pkey PRIMARY KEY (id)
+) WITHOUT OIDS;
+
+GRANT ALL ON TABLE queue_log TO asterisk;
GRANT ALL ON TABLE cdr TO asterisk;
GRANT ALL ON TABLE extensions_conf TO asterisk;
GRANT ALL ON TABLE sip_conf TO asterisk;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/default.exports
^
|
@@ -1,4 +1,8 @@
{
+ global:
+ /* See main/asterisk.exports.in for an explanation why this is
+ * needed. */
+ _IO_stdin_used;
local:
*;
};
|
|
Added |
asterisk-1.8.24.0.tar.xz/doc/Asterisk-1.8-Reference.pdf
^
|
|
Changed |
asterisk-1.8.24.0.tar.xz/doc/Asterisk-Admin-Guide.pdf
^
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/funcs/func_channel.c
^
|
@@ -20,7 +20,7 @@
*
* \author Kevin P. Fleming <kpfleming@digium.com>
* \author Ben Winslow
- *
+ *
* \ingroup functions
*/
@@ -30,7 +30,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 384640 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 394980 $")
#include <regex.h>
#include <ctype.h>
@@ -221,16 +221,35 @@
<para> <literal>audio</literal> Get audio destination</para>
<para> <literal>video</literal> Get video destination</para>
<para> <literal>text</literal> Get text destination</para>
+ <para> Defaults to <literal>audio</literal> if unspecified.</para>
+ </enum>
+ <enum name="rtpsource">
+ <para>R/O Get source RTP destination information.</para>
+ <para> This option takes one additional argument:</para>
+ <para> Argument 1:</para>
+ <para> <literal>audio</literal> Get audio destination</para>
+ <para> <literal>video</literal> Get video destination</para>
+ <para> <literal>text</literal> Get text destination</para>
+ <para> Defaults to <literal>audio</literal> if unspecified.</para>
</enum>
</enumlist>
<para><emphasis>chan_iax2</emphasis> provides the following additional options:</para>
<enumlist>
+ <enum name="osptoken">
+ <para>R/O Get the peer's osptoken.</para>
+ </enum>
<enum name="peerip">
<para>R/O Get the peer's ip address.</para>
</enum>
<enum name="peername">
<para>R/O Get the peer's username.</para>
</enum>
+ <enum name="secure_signaling">
+ <para>R/O Get the if the IAX channel is secured.</para>
+ </enum>
+ <enum name="secure_media">
+ <para>R/O Get the if the IAX channel is secured.</para>
+ </enum>
</enumlist>
<para><emphasis>chan_dahdi</emphasis> provides the following additional options:</para>
<enumlist>
@@ -467,7 +486,7 @@
#ifdef CHANNEL_TRACE
else if (!strcasecmp(data, "trace")) {
ast_channel_lock(chan);
- if (ast_true(value))
+ if (ast_true(value))
ret = ast_channel_trace_enable(chan);
else if (ast_false(value))
ret = ast_channel_trace_disable(chan);
@@ -482,7 +501,7 @@
struct ast_tone_zone *new_zone;
if (!(new_zone = ast_get_indication_zone(value))) {
ast_log(LOG_ERROR, "Unknown country code '%s' for tonezone. Check indications.conf for available country codes.\n", value);
- ret = -1;
+ ret = -1;
} else {
ast_channel_lock(chan);
if (chan->zone) {
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/funcs/func_dialgroup.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366880 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include <sys/stat.h>
@@ -174,11 +174,17 @@
{
int len = 500, res = 0;
char *buf = NULL;
+ char *new_buf;
char *dialgroup = ast_strdupa(cdialgroup);
do {
len *= 2;
- buf = ast_realloc(buf, len);
+ new_buf = ast_realloc(buf, len);
+ if (!new_buf) {
+ ast_free(buf);
+ return -1;
+ }
+ buf = new_buf;
if ((res = dialgroup_read(chan, "", dialgroup, buf, len)) < 0) {
ast_free(buf);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/funcs/func_global.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 370642 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include <sys/stat.h>
@@ -253,15 +253,16 @@
}
AST_LIST_TRAVERSE_SAFE_END;
- var = ast_var_assign(args.var, S_OR(value, ""));
- AST_LIST_INSERT_HEAD(varshead, var, entries);
- manager_event(EVENT_FLAG_DIALPLAN, "VarSet",
- "Channel: %s\r\n"
- "Variable: SHARED(%s)\r\n"
- "Value: %s\r\n"
- "Uniqueid: %s\r\n",
- chan ? chan->name : "none", args.var, value,
- chan ? chan->uniqueid : "none");
+ if ((var = ast_var_assign(args.var, S_OR(value, "")))) {
+ AST_LIST_INSERT_HEAD(varshead, var, entries);
+ manager_event(EVENT_FLAG_DIALPLAN, "VarSet",
+ "Channel: %s\r\n"
+ "Variable: SHARED(%s)\r\n"
+ "Value: %s\r\n"
+ "Uniqueid: %s\r\n",
+ chan ? chan->name : "none", args.var, value,
+ chan ? chan->uniqueid : "none");
+ }
ast_channel_unlock(chan);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/funcs/func_strings.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 370642 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include <regex.h>
#include <ctype.h>
@@ -147,6 +147,10 @@
<para>Literally returns the given <replaceable>string</replaceable>. The intent is to permit
other dialplan functions which take a variable name as an argument to be able to take a literal
string, instead.</para>
+ <note><para>The functions which take a variable name need to be passed var and not
+ ${var}. Similarly, use PASSTHRU() and not ${PASSTHRU()}.</para></note>
+ <para>Example: ${CHANNEL} contains SIP/321-1</para>
+ <para> ${CUT(PASSTHRU(${CUT(CHANNEL,-,1)}),/,2)}) will return 321</para>
</description>
</function>
<function name="REGEX" language="en_US">
@@ -1587,6 +1591,12 @@
for (i = 0; i < ARRAY_LEN(test_args); i++) {
struct ast_var_t *var = ast_var_assign("FIELDS", test_args[i].fields);
+ if (!var) {
+ ast_test_status_update(test, "Out of memory\n");
+ res = AST_TEST_FAIL;
+ break;
+ }
+
AST_LIST_INSERT_HEAD(&chan->varshead, var, entries);
snprintf(expression, sizeof(expression), "${FIELDNUM(%s,%s,%s)}", var->name, test_args[i].delim, test_args[i].field);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/include/asterisk/astmm.h
^
|
@@ -54,6 +54,12 @@
#undef vasprintf
#undef free
+void *ast_std_malloc(size_t size);
+void *ast_std_calloc(size_t nmemb, size_t size);
+void *ast_std_realloc(void *ptr, size_t size);
+void ast_std_free(void *ptr);
+void ast_free_ptr(void *ptr);
+
void *__ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
void *__ast_calloc_cache(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
void *__ast_malloc(size_t size, const char *file, int lineno, const char *func);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/include/asterisk/frame.h
^
|
@@ -365,12 +365,16 @@
};
enum ast_control_t38_rate {
- AST_T38_RATE_2400 = 0,
+ AST_T38_RATE_2400 = 1,
AST_T38_RATE_4800,
AST_T38_RATE_7200,
AST_T38_RATE_9600,
AST_T38_RATE_12000,
- AST_T38_RATE_14400,
+ /* Set to 0 so it's taken as default when unspecified.
+ * See ITU-T T.38 Implementors' Guide (11 May 2012),
+ * Table H.2: if the T38MaxBitRate attribute is omitted
+ * it should use a default of 14400. */
+ AST_T38_RATE_14400 = 0,
};
enum ast_control_t38_rate_management {
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/include/asterisk/lock.h
^
|
@@ -281,30 +281,18 @@
#else
void ast_remove_lock_info(void *lock_addr);
#endif /* HAVE_BKTR */
+void ast_suspend_lock_info(void *lock_addr);
+void ast_restore_lock_info(void *lock_addr);
#else
#ifdef HAVE_BKTR
#define ast_remove_lock_info(ignore,me)
#else
#define ast_remove_lock_info(ignore)
#endif /* HAVE_BKTR */
+#define ast_suspend_lock_info(ignore);
+#define ast_restore_lock_info(ignore);
#endif /* !defined(LOW_MEMORY) */
-#ifdef HAVE_BKTR
-static inline void __dump_backtrace(struct ast_bt *bt, int canlog)
-{
- char **strings;
-
- ssize_t i;
-
- strings = backtrace_symbols(bt->addresses, bt->num_frames);
-
- for (i = 0; i < bt->num_frames; i++)
- __ast_mutex_logger("%s\n", strings[i]);
-
- free(strings);
-}
-#endif
-
/*!
* \brief log info for the current lock with ast_log().
*
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/include/asterisk/logger.h
^
|
@@ -304,7 +304,7 @@
* \param addresses A list of addresses, such as the ->addresses structure element of struct ast_bt.
* \param num_frames Number of addresses in the addresses list
* \retval NULL Unable to allocate memory
- * \return List of strings
+ * \return List of strings. Free the entire list with a single ast_std_free call.
* \since 1.6.2.16
*/
char **ast_bt_get_symbols(void **addresses, size_t num_frames);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/include/asterisk/utils.h
^
|
@@ -436,24 +436,20 @@
long int ast_random(void);
+#ifndef __AST_DEBUG_MALLOC
+#define ast_std_malloc malloc
+#define ast_std_calloc calloc
+#define ast_std_realloc realloc
+#define ast_std_free free
+
/*!
* \brief free() wrapper
*
* ast_free_ptr should be used when a function pointer for free() needs to be passed
* as the argument to a function. Otherwise, astmm will cause seg faults.
*/
-#ifdef __AST_DEBUG_MALLOC
-static void ast_free_ptr(void *ptr) attribute_unused;
-static void ast_free_ptr(void *ptr)
-{
- ast_free(ptr);
-}
-#else
#define ast_free free
#define ast_free_ptr ast_free
-#endif
-
-#ifndef __AST_DEBUG_MALLOC
#define MALLOC_FAILURE_MSG \
ast_log(LOG_ERROR, "Memory Allocation Failure in function %s at line %d of %s\n", func, lineno, file);
@@ -851,4 +847,56 @@
*/
char *ast_utils_which(const char *binary, char *fullpath, size_t fullpath_size);
+/*!
+ * \brief Declare a variable that will call a destructor function when it goes out of scope.
+ *
+ * Resource Allocation Is Initialization (RAII) variable declaration.
+ *
+ * \since 1.8.24.0
+ * \param vartype The type of the variable
+ * \param varname The name of the variable
+ * \param initval The initial value of the variable
+ * \param dtor The destructor function of type' void func(vartype *)'
+ *
+ * \code
+ * void mything_cleanup(struct mything *t)
+ * {
+ * if (t) {
+ * ast_free(t->stuff);
+ * }
+ * }
+ *
+ * void do_stuff(const char *name)
+ * {
+ * RAII_VAR(struct mything *, thing, mything_alloc(name), mything_cleanup);
+ * ...
+ * }
+ * \endcode
+ *
+ * \note This macro is especially useful for working with ao2 objects. A common idiom
+ * would be a function that needed to look up an ao2 object and might have several error
+ * conditions after the allocation that would normally need to unref the ao2 object.
+ * With RAII_VAR, it is possible to just return and leave the cleanup to the destructor
+ * function. For example:
+ *
+ * \code
+ * void do_stuff(const char *name)
+ * {
+ * RAII_VAR(struct mything *, thing, find_mything(name), ao2_cleanup);
+ * if (!thing) {
+ * return;
+ * }
+ * if (error) {
+ * return;
+ * }
+ * do_stuff_with_thing(thing);
+ * }
+ * \endcode
+ */
+#define RAII_VAR(vartype, varname, initval, dtor) \
+ /* Prototype needed due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36774 */ \
+ auto void _dtor_ ## varname (vartype * v); \
+ void _dtor_ ## varname (vartype * v) { dtor(*v); } \
+ vartype varname __attribute__((cleanup(_dtor_ ## varname))) = (initval)
+
#endif /* _ASTERISK_UTILS_H */
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/abstract_jb.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399402 $")
#include "asterisk/frame.h"
#include "asterisk/channel.h"
@@ -488,7 +488,7 @@
char safe_logfile[30] = "/tmp/logfile-XXXXXX";
int safe_fd;
snprintf(name2, sizeof(name2), "%s", chan->name);
- if ((tmp = strchr(name2, '/'))) {
+ while ((tmp = strchr(name2, '/'))) {
*tmp = '#';
}
@@ -497,7 +497,7 @@
ast_assert(bridged != NULL);
snprintf(name1, sizeof(name1), "%s", bridged->name);
- if ((tmp = strchr(name1, '/'))) {
+ while ((tmp = strchr(name1, '/'))) {
*tmp = '#';
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/asterisk.c
^
|
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2012, Digium, Inc.
+ * Copyright (C) 1999 - 2013, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -23,23 +23,23 @@
*
* \par Developer Documentation for Asterisk
*
- * This is the main developer documentation for Asterisk. It is
- * generated by running "make progdocs" from the Asterisk source tree.
+ * This is the main developer documentation for Asterisk. It is
+ * generated by running "make progdocs" from the Asterisk source tree.
*
- * In addition to the information available on the Asterisk source code,
- * please see the appendices for information on coding guidelines,
+ * In addition to the information available on the Asterisk source code,
+ * please see the appendices for information on coding guidelines,
* release management, commit policies, and more.
*
* \arg \ref AsteriskArchitecture
*
* \par Additional documentation
* \arg \ref Licensing
- * \arg \ref DevDoc
+ * \arg \ref DevDoc
* \arg \ref ConfigFiles
*
* \section copyright Copyright and Author
*
- * Copyright (C) 1999 - 2012, Digium, Inc.
+ * Copyright (C) 1999 - 2013, Digium, Inc.
* Asterisk is a <a href="http://www.digium.com/en/company/view-policy.php?id=Trademark-Policy">registered trademark</a>
* of <a href="http://www.digium.com">Digium, Inc</a>.
*
@@ -56,7 +56,7 @@
/*! \file
\brief Top level source file for Asterisk - the Open Source PBX. Implementation
of PBX core functions and CLI interface.
-
+
*/
/*** MODULEINFO
@@ -65,7 +65,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 379760 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include "asterisk/_private.h"
@@ -160,7 +160,7 @@
/*! \brief Welcome message when starting a CLI interface */
#define WELCOME_MESSAGE \
- ast_verbose("Asterisk %s, Copyright (C) 1999 - 2012 Digium, Inc. and others.\n" \
+ ast_verbose("Asterisk %s, Copyright (C) 1999 - 2013 Digium, Inc. and others.\n" \
"Created by Mark Spencer <markster@digium.com>\n" \
"Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.\n" \
"This is free software, with components licensed under the GNU General Public\n" \
@@ -171,7 +171,7 @@
/*! \defgroup main_options Main Configuration Options
* \brief Main configuration options from asterisk.conf or OS command line on starting Asterisk.
* \arg \ref Config_ast "asterisk.conf"
- * \note Some of them can be changed in the CLI
+ * \note Some of them can be changed in the CLI
*/
/*! @{ */
@@ -323,7 +323,7 @@
work = ast_strdupa(version);
work = ast_strip(ast_strip_quoted(work, "$", "$"));
version_length = strlen(work) + 1;
-
+
if (!(new = ast_calloc(1, sizeof(*new) + version_length)))
return;
@@ -385,8 +385,8 @@
if (iterator)
return iterator->version;
return NULL;
-}
-
+}
+
struct thread_list_t {
@@ -398,7 +398,7 @@
static AST_RWLIST_HEAD_STATIC(thread_list, thread_list_t);
void ast_register_thread(char *name)
-{
+{
struct thread_list_t *new = ast_calloc(1, sizeof(*new));
if (!new)
@@ -459,7 +459,7 @@
else
ast_cli(a->fd, " Maximum calls: Not set\n");
if (option_maxfiles)
- ast_cli(a->fd, " Maximum open file handles: %d\n", option_maxfiles);
+ ast_cli(a->fd, " Maximum open file handles: %d\n", option_maxfiles);
else
ast_cli(a->fd, " Maximum open file handles: Not set\n");
ast_cli(a->fd, " Verbosity: %d\n", option_verbose);
@@ -522,7 +522,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core show threads";
- e->usage =
+ e->usage =
"Usage: core show threads\n"
" List threads currently active in the system.\n";
return NULL;
@@ -754,7 +754,7 @@
#elif defined(linux)
static __inline uint64_t
rdtsc(void)
-{
+{
uint64_t rv;
__asm __volatile(".byte 0x0f, 0x31" : "=A" (rv));
@@ -877,7 +877,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core show file version [like]";
- e->usage =
+ e->usage =
"Usage: core show file version [like <pattern>]\n"
" Lists the revision numbers of the files used to build this copy of Asterisk.\n"
" Optional regular expression pattern is used to filter the file list.\n";
@@ -1074,7 +1074,7 @@
pid = fork();
#else
pid = vfork();
-#endif
+#endif
if (pid == 0) {
#ifdef HAVE_CAP
@@ -1100,7 +1100,7 @@
if (res > -1) {
res = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
break;
- } else if (errno != EINTR)
+ } else if (errno != EINTR)
break;
}
} else {
@@ -1172,7 +1172,7 @@
if (consoles[x].mute)
continue;
if (consoles[x].fd > -1) {
- if (!consoles[x].levels[level])
+ if (!consoles[x].levels[level])
fdprint(consoles[x].p[1], string);
}
}
@@ -1196,7 +1196,7 @@
{
int x;
for (x = 0; x < AST_MAX_CONNECTS; x++) {
- if (consoles[x].fd > -1)
+ if (consoles[x].fd > -1)
fdprint(consoles[x].p[1], string);
}
}
@@ -1362,7 +1362,7 @@
close(con->p[0]);
close(con->p[1]);
con->fd = -1;
-
+
return NULL;
}
@@ -1451,14 +1451,14 @@
uid_t uid = -1;
gid_t gid = -1;
- for (x = 0; x < AST_MAX_CONNECTS; x++)
+ for (x = 0; x < AST_MAX_CONNECTS; x++)
consoles[x].fd = -1;
unlink(ast_config_AST_SOCKET);
ast_socket = socket(PF_LOCAL, SOCK_STREAM, 0);
if (ast_socket < 0) {
ast_log(LOG_WARNING, "Unable to create control socket: %s\n", strerror(errno));
return -1;
- }
+ }
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_LOCAL;
ast_copy_string(sunaddr.sun_path, ast_config_AST_SOCKET, sizeof(sunaddr.sun_path));
@@ -1493,7 +1493,7 @@
else
uid = pw->pw_uid;
}
-
+
if (!ast_strlen_zero(ast_config_AST_CTL_GROUP)) {
struct group *grp;
if ((grp = getgrnam(ast_config_AST_CTL_GROUP)) == NULL)
@@ -1541,8 +1541,8 @@
/*! \brief Urgent handler
Called by soft_hangup to interrupt the poll, read, or other
- system call. We don't actually need to do anything though.
- Remember: Cannot EVER ast_log from within a signal handler
+ system call. We don't actually need to do anything though.
+ Remember: Cannot EVER ast_log from within a signal handler
*/
static void _urg_handler(int num)
{
@@ -1557,7 +1557,7 @@
static void _hup_handler(int num)
{
int a = 0, save_errno = errno;
- if (option_verbose > 1)
+ if (option_verbose > 1)
printf("Received HUP signal -- Reloading configs\n");
if (restartnow)
execvp(_argv[0], _argv);
@@ -1585,7 +1585,7 @@
*/
for (n = 0; wait4(-1, &status, WNOHANG, NULL) > 0; n++)
;
- if (n == 0 && option_debug)
+ if (n == 0 && option_debug)
printf("Huh? Child handler, but nobody there?\n");
errno = save_errno;
}
@@ -1599,22 +1599,22 @@
static void set_ulimit(int value)
{
struct rlimit l = {0, 0};
-
+
if (value <= 0) {
ast_log(LOG_WARNING, "Unable to change max files open to invalid value %i\n",value);
return;
}
-
+
l.rlim_cur = value;
l.rlim_max = value;
-
+
if (setrlimit(RLIMIT_NOFILE, &l)) {
ast_log(LOG_WARNING, "Unable to disable core size resource limit: %s\n",strerror(errno));
return;
}
-
+
ast_log(LOG_NOTICE, "Setting max files open to %d\n",value);
-
+
return;
}
@@ -1638,7 +1638,7 @@
struct sched_param sched;
memset(&sched, 0, sizeof(sched));
#ifdef __linux__
- if (pri) {
+ if (pri) {
sched.sched_priority = 10;
if (sched_setscheduler(0, SCHED_RR, &sched)) {
ast_log(LOG_WARNING, "Unable to set high priority\n");
@@ -1822,7 +1822,7 @@
close_logger();
clean_time_zones();
- /* If there is a consolethread running send it a SIGHUP
+ /* If there is a consolethread running send it a SIGHUP
so it can execvp, otherwise we can do it ourselves */
if ((consolethread != AST_PTHREADT_NULL) && (consolethread != pthread_self())) {
pthread_kill(consolethread, SIGHUP);
@@ -1830,7 +1830,7 @@
sleep(2);
} else
execvp(_argv[0], _argv);
-
+
} else {
/* close logger */
close_logger();
@@ -1894,7 +1894,7 @@
}
fflush(stdout);
-
+
/* Wake up a poll()ing console */
if (ast_opt_console && consolethread != AST_PTHREADT_NULL)
pthread_kill(consolethread, SIGURG);
@@ -1905,7 +1905,7 @@
while (*s) {
if (*s > 32)
return 0;
- s++;
+ s++;
}
return 1;
}
@@ -1924,7 +1924,7 @@
ast_safe_system(s+1);
else
ast_safe_system(getenv("SHELL") ? getenv("SHELL") : "/bin/sh");
- } else
+ } else
ast_cli_command(STDOUT_FILENO, s);
}
@@ -1943,6 +1943,10 @@
ast_safe_system(getenv("SHELL") ? getenv("SHELL") : "/bin/sh");
ret = 1;
}
+ while (isspace(*s)) {
+ s++;
+ }
+
if ((strncasecmp(s, "quit", 4) == 0 || strncasecmp(s, "exit", 4) == 0) &&
(s[4] == '\0' || isspace(s[4]))) {
quit_handler(0, SHUTDOWN_FAST, 0);
@@ -1957,7 +1961,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core show version";
- e->usage =
+ e->usage =
"Usage: core show version\n"
" Shows Asterisk version information.\n";
return NULL;
@@ -1988,7 +1992,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core stop now";
- e->usage =
+ e->usage =
"Usage: core stop now\n"
" Shuts down a running Asterisk immediately, hanging up all active calls .\n";
return NULL;
@@ -2007,7 +2011,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core stop gracefully";
- e->usage =
+ e->usage =
"Usage: core stop gracefully\n"
" Causes Asterisk to not accept new calls, and exit when all\n"
" active calls have terminated normally.\n";
@@ -2027,7 +2031,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core stop when convenient";
- e->usage =
+ e->usage =
"Usage: core stop when convenient\n"
" Causes Asterisk to perform a shutdown when all active calls have ended.\n";
return NULL;
@@ -2047,7 +2051,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core restart now";
- e->usage =
+ e->usage =
"Usage: core restart now\n"
" Causes Asterisk to hangup all calls and exec() itself performing a cold\n"
" restart.\n";
@@ -2067,7 +2071,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core restart gracefully";
- e->usage =
+ e->usage =
"Usage: core restart gracefully\n"
" Causes Asterisk to stop accepting new calls and exec() itself performing a cold\n"
" restart when all active calls have ended.\n";
@@ -2087,7 +2091,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core restart when convenient";
- e->usage =
+ e->usage =
"Usage: core restart when convenient\n"
" Causes Asterisk to perform a cold restart when all active calls have ended.\n";
return NULL;
@@ -2109,7 +2113,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core abort shutdown";
- e->usage =
+ e->usage =
"Usage: core abort shutdown\n"
" Causes Asterisk to abort an executing shutdown or restart, and resume normal\n"
" call operations.\n";
@@ -2139,7 +2143,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "!";
- e->usage =
+ e->usage =
"Usage: !<command>\n"
" Executes a given shell command\n";
return NULL;
@@ -2179,7 +2183,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core show warranty";
- e->usage =
+ e->usage =
"Usage: core show warranty\n"
" Shows the warranty (if any) for this copy of Asterisk.\n";
return NULL;
@@ -2216,7 +2220,7 @@
switch (cmd) {
case CLI_INIT:
e->command = "core show license";
- e->usage =
+ e->usage =
"Usage: core show license\n"
" Shows the license(s) for this copy of Asterisk.\n";
return NULL;
@@ -2245,7 +2249,7 @@
AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately"),
AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk"),
AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
- AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"),
+ AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"),
AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully"),
AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
};
@@ -2301,7 +2305,7 @@
num_read = read(STDIN_FILENO, cp, 1);
if (num_read < 1) {
break;
- } else
+ } else
return (num_read);
}
if (fds[0].revents) {
@@ -2323,7 +2327,7 @@
WELCOME_MESSAGE;
if (!ast_opt_mute)
fdsend(ast_consock, "logger mute silent");
- else
+ else
printf("log and verbose output currently muted ('logger mute' to unmute)\n");
break;
} else
@@ -2493,48 +2497,65 @@
ast_str_set(&prompt, 0, "%s", ASTERISK_PROMPT);
}
- return ast_str_buffer(prompt);
+ return ast_str_buffer(prompt);
+}
+
+static void destroy_match_list(char **match_list, int matches)
+{
+ if (match_list) {
+ int idx;
+
+ for (idx = 0; idx < matches; ++idx) {
+ ast_free(match_list[idx]);
+ }
+ ast_free(match_list);
+ }
}
static char **ast_el_strtoarr(char *buf)
{
- char **match_list = NULL, **match_list_tmp, *retstr;
- size_t match_list_len;
+ char *retstr;
+ char **match_list = NULL;
+ char **new_list;
+ size_t match_list_len = 1;
int matches = 0;
- match_list_len = 1;
- while ( (retstr = strsep(&buf, " ")) != NULL) {
-
- if (!strcmp(retstr, AST_CLI_COMPLETE_EOF))
+ while ((retstr = strsep(&buf, " "))) {
+ if (!strcmp(retstr, AST_CLI_COMPLETE_EOF)) {
break;
+ }
if (matches + 1 >= match_list_len) {
match_list_len <<= 1;
- if ((match_list_tmp = ast_realloc(match_list, match_list_len * sizeof(char *)))) {
- match_list = match_list_tmp;
- } else {
- if (match_list)
- ast_free(match_list);
- return (char **) NULL;
+ new_list = ast_realloc(match_list, match_list_len * sizeof(char *));
+ if (!new_list) {
+ destroy_match_list(match_list, matches);
+ return NULL;
}
+ match_list = new_list;
}
- match_list[matches++] = ast_strdup(retstr);
+ retstr = ast_strdup(retstr);
+ if (!retstr) {
+ destroy_match_list(match_list, matches);
+ return NULL;
+ }
+ match_list[matches++] = retstr;
}
- if (!match_list)
- return (char **) NULL;
+ if (!match_list) {
+ return NULL;
+ }
if (matches >= match_list_len) {
- if ((match_list_tmp = ast_realloc(match_list, (match_list_len + 1) * sizeof(char *)))) {
- match_list = match_list_tmp;
- } else {
- if (match_list)
- ast_free(match_list);
- return (char **) NULL;
+ new_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(char *));
+ if (!new_list) {
+ destroy_match_list(match_list, matches);
+ return NULL;
}
+ match_list = new_list;
}
- match_list[matches] = (char *) NULL;
+ match_list[matches] = NULL;
return match_list;
}
@@ -2625,7 +2646,7 @@
len = lf->cursor - ptr;
if (ast_opt_remote) {
- snprintf(buf, sizeof(buf), "_COMMAND NUMMATCHES \"%s\" \"%s\"", lf->buffer, ptr);
+ snprintf(buf, sizeof(buf), "_COMMAND NUMMATCHES \"%s\" \"%s\"", lf->buffer, ptr);
fdsend(ast_consock, buf);
if ((res = read(ast_consock, buf, sizeof(buf) - 1)) < 0) {
return (char*)(CC_ERROR);
@@ -2635,24 +2656,29 @@
if (nummatches > 0) {
char *mbuf;
+ char *new_mbuf;
int mlen = 0, maxmbuf = 2048;
- /* Start with a 2048 byte buffer */
+
+ /* Start with a 2048 byte buffer */
if (!(mbuf = ast_malloc(maxmbuf))) {
lf->cursor[0] = savechr;
return (char *)(CC_ERROR);
}
- snprintf(buf, sizeof(buf), "_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr);
+ snprintf(buf, sizeof(buf), "_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr);
fdsend(ast_consock, buf);
res = 0;
mbuf[0] = '\0';
while (!strstr(mbuf, AST_CLI_COMPLETE_EOF) && res != -1) {
if (mlen + 1024 > maxmbuf) {
/* Every step increment buffer 1024 bytes */
- maxmbuf += 1024;
- if (!(mbuf = ast_realloc(mbuf, maxmbuf))) {
+ maxmbuf += 1024;
+ new_mbuf = ast_realloc(mbuf, maxmbuf);
+ if (!new_mbuf) {
+ ast_free(mbuf);
lf->cursor[0] = savechr;
return (char *)(CC_ERROR);
}
+ mbuf = new_mbuf;
}
/* Only read 1024 bytes at a time */
res = read(ast_consock, mbuf + mlen, 1024);
@@ -2702,7 +2728,7 @@
fprintf(stdout, "\n");
ast_cli_display_match_list(matches, nummatches, maxlen);
retval = CC_REDISPLAY;
- } else {
+ } else {
el_insertstr(editline," ");
retval = CC_REFRESH;
}
@@ -2730,8 +2756,8 @@
el = el_init("asterisk", stdin, stdout, stderr);
el_set(el, EL_PROMPT, cli_prompt);
- el_set(el, EL_EDITMODE, 1);
- el_set(el, EL_EDITOR, editor ? editor : "emacs");
+ el_set(el, EL_EDITMODE, 1);
+ el_set(el, EL_EDITOR, editor ? editor : "emacs");
el_hist = history_init();
if (!el || !el_hist)
return -1;
@@ -2856,7 +2882,7 @@
fdsend(ast_consock, tmp);
if (!ast_opt_mute)
fdsend(ast_consock, "logger mute silent");
- else
+ else
printf("log and verbose output currently muted ('logger mute' to unmute)\n");
}
@@ -2904,7 +2930,7 @@
ast_verbose("Connected to Asterisk %s currently running on %s (pid = %d)\n", version, hostname, pid);
remotehostname = hostname;
- if (getenv("HOME"))
+ if (getenv("HOME"))
snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
if (el_hist == NULL || el == NULL)
ast_el_initialize();
@@ -2955,7 +2981,7 @@
static int show_cli_help(void)
{
- printf("Asterisk %s, Copyright (C) 1999 - 2012, Digium, Inc. and others.\n", ast_get_version());
+ printf("Asterisk %s, Copyright (C) 1999 - 2013, Digium, Inc. and others.\n", ast_get_version());
printf("Usage: asterisk [OPTIONS]\n");
printf("Valid Options:\n");
printf(" -V Display version number and exit\n");
@@ -2993,7 +3019,7 @@
return 0;
}
-static void ast_readconfig(void)
+static void ast_readconfig(void)
{
struct ast_config *cfg;
struct ast_variable *v;
@@ -3393,7 +3419,7 @@
ast_copy_string(hostname, "<Unknown>", sizeof(hostname));
ast_mainpid = getpid();
- if (getenv("HOME"))
+ if (getenv("HOME"))
snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
/* Check for options */
while ((c = getopt(argc, argv, "BC:cde:FfG:ghIiL:M:mnpqRrs:TtU:VvWXx:")) != -1) {
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/asterisk.exports.in
^
|
@@ -44,6 +44,25 @@
LINKER_SYMBOL_PREFIXres_srtp;
LINKER_SYMBOL_PREFIXres_srtp_policy;
LINKER_SYMBOL_PREFIXsecure_call_info;
+ /*
+
+ If _IO_stdin_used is not exported, stdout/stderr may not get
+ properly aligned. That causes breakage on some architectures.
+
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#51
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#94
+ http://lists.gnu.org/archive/html/bug-glibc/2001-12/msg00203.html
+
+ We export the symbol to get proper behaviour. Now printf
+ doesn't SIGBUS anymore on the SPARC.
+
+ Michael Karcher wrote on Jan 13, 2013:
+ > A build process that mangles the export of _IO_stdin_used is
+ > (as defined by the libc ABI, even if not explicitly written
+ > down) broken. [...]
+
+ */
+ LINKER_SYMBOL_PREFIX_IO_stdin_used;
local:
*;
};
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/astfd.c
^
|
@@ -31,7 +31,7 @@
#ifdef DEBUG_FD_LEAKS
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397106 $")
#include <stdio.h>
#include <string.h>
@@ -274,8 +274,14 @@
static struct ast_cli_entry cli_show_fd = AST_CLI_DEFINE(handle_show_fd, "Show open file descriptors");
+static void fd_shutdown(void)
+{
+ ast_cli_unregister(&cli_show_fd);
+}
+
int ast_fd_init(void)
{
+ ast_register_atexit(fd_shutdown);
return ast_cli_register(&cli_show_fd);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/astmm.c
^
|
@@ -32,7 +32,7 @@
#if defined(__AST_DEBUG_MALLOC)
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 377398 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398703 $")
#include "asterisk/paths.h" /* use ast_config_AST_LOG_DIR */
#include <stddef.h>
@@ -70,7 +70,7 @@
#undef vasprintf
#undef asprintf
-#define FENCE_MAGIC 0xdeadbeef /*!< Allocated memory high/low fence overwrite check. */
+#define FENCE_MAGIC 0xfeedbabe /*!< Allocated memory high/low fence overwrite check. */
#define FREED_MAGIC 0xdeaddead /*!< Freed memory wipe filler. */
#define MALLOC_FILLER 0x55 /*!< Malloced memory filler. Must not be zero. */
@@ -157,6 +157,31 @@
} \
} while (0)
+void *ast_std_malloc(size_t size)
+{
+ return malloc(size);
+}
+
+void *ast_std_calloc(size_t nmemb, size_t size)
+{
+ return calloc(nmemb, size);
+}
+
+void *ast_std_realloc(void *ptr, size_t size)
+{
+ return realloc(ptr, size);
+}
+
+void ast_std_free(void *ptr)
+{
+ free(ptr);
+}
+
+void ast_free_ptr(void *ptr)
+{
+ ast_free(ptr);
+}
+
/*!
* \internal
*
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/astobj2.c
^
|
@@ -24,7 +24,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 379963 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399098 $")
#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
@@ -98,7 +98,7 @@
for(i = 0; i < c; i++) {
ast_verbose("%d: %p %s\n", i, addresses[i], strings[i]);
}
- free(strings);
+ ast_std_free(strings);
}
#endif
@@ -441,7 +441,7 @@
/* compute the container size */
const unsigned int num_buckets = hash_fn ? n_buckets : 1;
size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
- struct ao2_container *c = __ao2_alloc_debug(container_size, container_destruct_debug, tag, file, line, funcname, ref_debug);
+ struct ao2_container *c = __ao2_alloc_debug(container_size, ref_debug ? container_destruct_debug : container_destruct, tag, file, line, funcname, ref_debug);
return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/cdr.c
^
|
@@ -37,7 +37,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 383839 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include <signal.h>
@@ -372,8 +372,7 @@
}
AST_LIST_TRAVERSE_SAFE_END;
- if (value) {
- newvariable = ast_var_assign(name, value);
+ if (value && (newvariable = ast_var_assign(name, value))) {
AST_LIST_INSERT_HEAD(headp, newvariable, entries);
}
}
@@ -397,8 +396,8 @@
AST_LIST_TRAVERSE(headpa,variables,entries) {
if (variables &&
(var = ast_var_name(variables)) && (val = ast_var_value(variables)) &&
- !ast_strlen_zero(var) && !ast_strlen_zero(val)) {
- newvariable = ast_var_assign(var, val);
+ !ast_strlen_zero(var) && !ast_strlen_zero(val) &&
+ (newvariable = ast_var_assign(var, val))) {
AST_LIST_INSERT_HEAD(headpb, newvariable, entries);
x++;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/cel.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 377881 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397033 $")
#include "asterisk/_private.h"
@@ -310,7 +310,7 @@
config = ast_config_load2("cel.conf", "cel", config_flags);
- if (config == CONFIG_STATUS_FILEMISSING) {
+ if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEUNCHANGED || config == CONFIG_STATUS_FILEINVALID) {
config = NULL;
goto return_cleanup;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/channel.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 390044 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401234 $")
#include "asterisk/_private.h"
@@ -6504,6 +6504,8 @@
int x;
int i;
int origstate;
+ unsigned int orig_disablestatecache;
+ unsigned int clone_disablestatecache;
int visible_indication;
int clone_was_zombie = 0;/*!< TRUE if the clonechan was a zombie before the masquerade. */
struct ast_frame *current;
@@ -6728,6 +6730,20 @@
original->_state = clonechan->_state;
clonechan->_state = origstate;
+ /* And the swap the cachable state too. Otherwise we'd start caching
+ * Local channels and ignoring real ones. */
+ orig_disablestatecache = ast_test_flag(original, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ clone_disablestatecache = ast_test_flag(clonechan, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ if (orig_disablestatecache != clone_disablestatecache) {
+ if (orig_disablestatecache) {
+ ast_clear_flag(original, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ ast_set_flag(clonechan, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ } else {
+ ast_set_flag(original, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ ast_clear_flag(clonechan, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ }
+ }
+
/* Mangle the name of the clone channel */
snprintf(zombn, sizeof(zombn), "%s<ZOMBIE>", orig); /* quick, hide the brains! */
__ast_change_name_nolink(clonechan, zombn);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/cli.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 386049 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use ast_config_AST_MODULE_DIR */
@@ -2282,6 +2282,13 @@
return NULL;
cur = duplicate;
+
+ /* Remove leading spaces from the command */
+ while (isspace(*s)) {
+ cur++;
+ s++;
+ }
+
/* scan the original string copying into cur when needed */
for (; *s ; s++) {
if (x >= max - 1) {
@@ -2346,9 +2353,22 @@
return matches;
}
+static void destroy_match_list(char **match_list, int matches)
+{
+ if (match_list) {
+ int idx;
+
+ for (idx = 1; idx < matches; ++idx) {
+ ast_free(match_list[idx]);
+ }
+ ast_free(match_list);
+ }
+}
+
char **ast_cli_completion_matches(const char *text, const char *word)
{
char **match_list = NULL, *retstr, *prevstr;
+ char **new_list;
size_t match_list_len, max_equal, which, i;
int matches = 0;
@@ -2357,14 +2377,19 @@
while ((retstr = ast_cli_generator(text, word, matches)) != NULL) {
if (matches + 1 >= match_list_len) {
match_list_len <<= 1;
- if (!(match_list = ast_realloc(match_list, match_list_len * sizeof(*match_list))))
+ new_list = ast_realloc(match_list, match_list_len * sizeof(*match_list));
+ if (!new_list) {
+ destroy_match_list(match_list, matches);
return NULL;
+ }
+ match_list = new_list;
}
match_list[++matches] = retstr;
}
- if (!match_list)
+ if (!match_list) {
return match_list; /* NULL */
+ }
/* Find the longest substring that is common to all results
* (it is a candidate for completion), and store a copy in entry 0.
@@ -2377,20 +2402,23 @@
max_equal = i;
}
- if (!(retstr = ast_malloc(max_equal + 1))) {
- ast_free(match_list);
+ retstr = ast_malloc(max_equal + 1);
+ if (!retstr) {
+ destroy_match_list(match_list, matches);
return NULL;
}
-
ast_copy_string(retstr, match_list[1], max_equal + 1);
match_list[0] = retstr;
/* ensure that the array is NULL terminated */
if (matches + 1 >= match_list_len) {
- if (!(match_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list)))) {
+ new_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list));
+ if (!new_list) {
ast_free(retstr);
+ destroy_match_list(match_list, matches);
return NULL;
}
+ match_list = new_list;
}
match_list[matches + 1] = NULL;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/config.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 386672 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398102 $")
#include "asterisk/paths.h" /* use ast_config_AST_CONFIG_DIR */
#include "asterisk/network.h" /* we do some sockaddr manipulation here */
@@ -2975,6 +2975,10 @@
AST_LIST_LOCK(&cfmtime_head);
while ((cfmtime = AST_LIST_REMOVE_HEAD(&cfmtime_head, list))) {
+ struct cache_file_include *cfinclude;
+ while ((cfinclude = AST_LIST_REMOVE_HEAD(&cfmtime->includes, list))) {
+ ast_free(cfinclude);
+ }
ast_free(cfmtime);
}
AST_LIST_UNLOCK(&cfmtime_head);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/data.c
^
|
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 377881 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396958 $")
#include "asterisk/_private.h"
@@ -1631,7 +1631,7 @@
{
struct data_filter *filter = obj, *globres;
- AST_LIST_TRAVERSE(&(filter->glob_list), globres, list) {
+ while ((globres = AST_LIST_REMOVE_HEAD(&(filter->glob_list), list))) {
ao2_ref(globres, -1);
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/event.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 378303 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include "asterisk/_private.h"
@@ -1175,13 +1175,17 @@
const void *data, size_t data_len)
{
struct ast_event_ie *ie;
+ struct ast_event *old_event;
unsigned int extra_len;
uint16_t event_len;
event_len = ntohs((*event)->event_len);
extra_len = sizeof(*ie) + data_len;
- if (!(*event = ast_realloc(*event, event_len + extra_len))) {
+ old_event = *event;
+ *event = ast_realloc(*event, event_len + extra_len);
+ if (!*event) {
+ ast_free(old_event);
return -1;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/features.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 387036 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399304 $")
#include "asterisk/_private.h"
@@ -5733,19 +5733,9 @@
);
AST_STANDARD_APP_ARGS(args, tmp_val);
- if ((new_syn = strchr(args.app, '('))) {
- /* New syntax */
- args.moh_class = args.app_args;
- args.app_args = new_syn;
- *args.app_args++ = '\0';
- if (args.app_args[strlen(args.app_args) - 1] == ')') {
- args.app_args[strlen(args.app_args) - 1] = '\0';
- }
- }
activateon = strsep(&args.activatedby, "/");
- /*! \todo XXX var_name or app_args ? */
if (ast_strlen_zero(args.app)
|| ast_strlen_zero(args.exten)
|| ast_strlen_zero(activateon)
@@ -5756,6 +5746,16 @@
return;
}
+ if ((new_syn = strchr(args.app, '('))) {
+ /* New syntax */
+ args.moh_class = args.app_args;
+ args.app_args = new_syn;
+ *args.app_args++ = '\0';
+ if (args.app_args[strlen(args.app_args) - 1] == ')') {
+ args.app_args[strlen(args.app_args) - 1] = '\0';
+ }
+ }
+
AST_RWLIST_RDLOCK(&feature_list);
if (find_dynamic_feature(var->name)) {
AST_RWLIST_UNLOCK(&feature_list);
@@ -8249,6 +8249,7 @@
}
res = -1;
}
+ parked_chan = ast_channel_unref(parked_chan);
exit_features_test:
@@ -8275,6 +8276,9 @@
ast_unregister_application(parkcall);
ast_unregister_application(parkedcall);
ast_unregister_application(app_bridge);
+#if defined(TEST_FRAMEWORK)
+ AST_TEST_UNREGISTER(features_test);
+#endif /* defined(TEST_FRAMEWORK) */
pthread_cancel(parking_thread);
pthread_kill(parking_thread, SIGURG);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/heap.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include "asterisk/heap.h"
#include "asterisk/utils.h"
@@ -181,18 +181,19 @@
#endif
)
{
- h->avail_len = h->avail_len * 2 + 1;
+ void **new_heap;
+ size_t new_len = h->avail_len * 2 + 1;
- if (!(h->heap =
#ifdef MALLOC_DEBUG
- __ast_realloc(h->heap, h->avail_len * sizeof(void *), file, lineno, func)
+ new_heap = __ast_realloc(h->heap, new_len * sizeof(void *), file, lineno, func);
#else
- ast_realloc(h->heap, h->avail_len * sizeof(void *))
+ new_heap = ast_realloc(h->heap, new_len * sizeof(void *));
#endif
- )) {
- h->cur_len = h->avail_len = 0;
+ if (!new_heap) {
return -1;
}
+ h->heap = new_heap;
+ h->avail_len = new_len;
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/http.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 384118 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397308 $")
#include <time.h>
#include <sys/time.h>
@@ -685,7 +685,7 @@
prev = v;
}
}
-
+
done:
ast_free(buf);
return post_vars;
@@ -862,7 +862,7 @@
struct ast_variable *v, *cookies=NULL;
for (v = headers; v; v = v->next) {
- if (!strncasecmp(v->name, "Cookie", 6)) {
+ if (!strcasecmp(v->name, "Cookie")) {
char *tmp = ast_strdupa(v->value);
if (cookies) {
ast_variables_destroy(cookies);
@@ -1238,7 +1238,25 @@
static void http_shutdown(void)
{
+ struct http_uri_redirect *redirect;
ast_cli_unregister_multiple(cli_http, ARRAY_LEN(cli_http));
+
+ ast_tcptls_server_stop(&http_desc);
+ if (http_tls_cfg.enabled) {
+ ast_tcptls_server_stop(&https_desc);
+ }
+ ast_free(http_tls_cfg.certfile);
+ ast_free(http_tls_cfg.pvtfile);
+ ast_free(http_tls_cfg.cipher);
+
+ ast_http_uri_unlink(&statusuri);
+ ast_http_uri_unlink(&staticuri);
+
+ AST_RWLIST_WRLOCK(&uri_redirects);
+ while ((redirect = AST_RWLIST_REMOVE_HEAD(&uri_redirects, entry))) {
+ ast_free(redirect);
+ }
+ AST_RWLIST_UNLOCK(&uri_redirects);
}
int ast_http_init(void)
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/indications.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 377740 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include <math.h>
@@ -341,12 +341,12 @@
}
while ((s = strsep(&stringp, separator)) && !ast_strlen_zero(s)) {
+ struct playtones_item *new_items;
struct ast_tone_zone_part tone_data = {
.time = 0,
};
s = ast_strip(s);
-
if (s[0]=='!') {
s++;
} else if (d.reppos == -1) {
@@ -374,9 +374,12 @@
}
}
- if (!(d.items = ast_realloc(d.items, (d.nitems + 1) * sizeof(*d.items)))) {
+ new_items = ast_realloc(d.items, (d.nitems + 1) * sizeof(*d.items));
+ if (!new_items) {
+ ast_free(d.items);
return -1;
}
+ d.items = new_items;
d.items[d.nitems].fac1 = 2.0 * cos(2.0 * M_PI * (tone_data.freq1 / sample_rate)) * max_sample_val;
d.items[d.nitems].init_v2_1 = sin(-4.0 * M_PI * (tone_data.freq1 / sample_rate)) * d.vol;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/loader.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 378092 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 391489 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use ast_config_AST_MODULE_DIR */
@@ -1021,6 +1021,8 @@
break;
case AST_MODULE_LOAD_PRIORITY:
AST_LIST_REMOVE_CURRENT(entry);
+ ast_free(order->resource);
+ ast_free(order);
break;
}
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/lock.c
^
|
@@ -27,8 +27,9 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 388838 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398648 $")
+#include "asterisk/utils.h"
#include "asterisk/lock.h"
/* Allow direct use of pthread_mutex_* / pthread_cond_* */
@@ -45,6 +46,22 @@
#undef pthread_cond_wait
#undef pthread_cond_timedwait
+#if defined(DEBUG_THREADS) && defined(HAVE_BKTR)
+static void __dump_backtrace(struct ast_bt *bt, int canlog)
+{
+ char **strings;
+ ssize_t i;
+
+ strings = backtrace_symbols(bt->addresses, bt->num_frames);
+
+ for (i = 0; i < bt->num_frames; i++) {
+ __ast_mutex_logger("%s\n", strings[i]);
+ }
+
+ ast_std_free(strings);
+}
+#endif /* defined(DEBUG_THREADS) && defined(HAVE_BKTR) */
+
int __ast_pthread_mutex_init(int tracking, const char *filename, int lineno, const char *func,
const char *mutex_name, ast_mutex_t *t)
{
@@ -191,12 +208,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
#else
ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t);
@@ -323,12 +348,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
#else
ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t);
@@ -480,10 +513,8 @@
#ifdef DEBUG_THREADS
struct ast_lock_track *lt;
+ struct ast_lock_track lt_orig;
int canlog = strcmp(filename, "logger.c") & t->tracking;
-#ifdef HAVE_BKTR
- struct ast_bt *bt = NULL;
-#endif
#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
@@ -514,33 +545,20 @@
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
DO_THREAD_CRASH;
+ } else if (lt->reentrancy <= 0) {
+ __ast_mutex_logger("%s line %d (%s): attempted to wait on an unlocked mutex '%s'\n",
+ filename, lineno, func, mutex_name);
+ DO_THREAD_CRASH;
}
- if (--lt->reentrancy < 0) {
- __ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
- filename, lineno, func, mutex_name);
- lt->reentrancy = 0;
- }
-
- if (lt->reentrancy < AST_MAX_REENTRANCY) {
- lt->file[lt->reentrancy] = NULL;
- lt->lineno[lt->reentrancy] = 0;
- lt->func[lt->reentrancy] = NULL;
- lt->thread[lt->reentrancy] = 0;
- }
-
-#ifdef HAVE_BKTR
- if (lt->reentrancy) {
- bt = <->backtrace[lt->reentrancy - 1];
- }
-#endif
+ /* Waiting on a condition completely suspends a recursive mutex,
+ * even if it's been recursively locked multiple times. Make a
+ * copy of the lock tracking, and reset reentrancy to zero */
+ lt_orig = *lt;
+ lt->reentrancy = 0;
ast_reentrancy_unlock(lt);
-#ifdef HAVE_BKTR
- ast_remove_lock_info(t, bt);
-#else
- ast_remove_lock_info(t);
-#endif
+ ast_suspend_lock_info(t);
}
#endif /* DEBUG_THREADS */
@@ -552,28 +570,16 @@
filename, lineno, func, strerror(res));
DO_THREAD_CRASH;
} else if (t->tracking) {
+ pthread_mutex_t reentr_mutex_orig;
ast_reentrancy_lock(lt);
- if (lt->reentrancy < AST_MAX_REENTRANCY) {
- lt->file[lt->reentrancy] = filename;
- lt->lineno[lt->reentrancy] = lineno;
- lt->func[lt->reentrancy] = func;
- lt->thread[lt->reentrancy] = pthread_self();
-#ifdef HAVE_BKTR
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
- bt = <->backtrace[lt->reentrancy];
-#endif
- lt->reentrancy++;
- } else {
- __ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
- filename, lineno, func, mutex_name);
- }
+ /* Restore lock tracking to what it was prior to the wait */
+ reentr_mutex_orig = lt->reentr_mutex;
+ *lt = lt_orig;
+ /* un-trash the mutex we just copied over */
+ lt->reentr_mutex = reentr_mutex_orig;
ast_reentrancy_unlock(lt);
-#ifdef HAVE_BKTR
- ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
-#else
- ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t);
-#endif
+ ast_restore_lock_info(t);
}
#endif /* DEBUG_THREADS */
@@ -588,10 +594,8 @@
#ifdef DEBUG_THREADS
struct ast_lock_track *lt;
+ struct ast_lock_track lt_orig;
int canlog = strcmp(filename, "logger.c") & t->tracking;
-#ifdef HAVE_BKTR
- struct ast_bt *bt = NULL;
-#endif
#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
@@ -622,32 +626,20 @@
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
DO_THREAD_CRASH;
- }
-
- if (--lt->reentrancy < 0) {
- __ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
+ } else if (lt->reentrancy <= 0) {
+ __ast_mutex_logger("%s line %d (%s): attempted to wait on an unlocked mutex '%s'\n",
filename, lineno, func, mutex_name);
- lt->reentrancy = 0;
+ DO_THREAD_CRASH;
}
- if (lt->reentrancy < AST_MAX_REENTRANCY) {
- lt->file[lt->reentrancy] = NULL;
- lt->lineno[lt->reentrancy] = 0;
- lt->func[lt->reentrancy] = NULL;
- lt->thread[lt->reentrancy] = 0;
- }
-#ifdef HAVE_BKTR
- if (lt->reentrancy) {
- bt = <->backtrace[lt->reentrancy - 1];
- }
-#endif
+ /* Waiting on a condition completely suspends a recursive mutex,
+ * even if it's been recursively locked multiple times. Make a
+ * copy of the lock tracking, and reset reentrancy to zero */
+ lt_orig = *lt;
+ lt->reentrancy = 0;
ast_reentrancy_unlock(lt);
-#ifdef HAVE_BKTR
- ast_remove_lock_info(t, bt);
-#else
- ast_remove_lock_info(t);
-#endif
+ ast_suspend_lock_info(t);
}
#endif /* DEBUG_THREADS */
@@ -659,28 +651,16 @@
filename, lineno, func, strerror(res));
DO_THREAD_CRASH;
} else if (t->tracking) {
+ pthread_mutex_t reentr_mutex_orig;
ast_reentrancy_lock(lt);
- if (lt->reentrancy < AST_MAX_REENTRANCY) {
- lt->file[lt->reentrancy] = filename;
- lt->lineno[lt->reentrancy] = lineno;
- lt->func[lt->reentrancy] = func;
- lt->thread[lt->reentrancy] = pthread_self();
-#ifdef HAVE_BKTR
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
- bt = <->backtrace[lt->reentrancy];
-#endif
- lt->reentrancy++;
- } else {
- __ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
- filename, lineno, func, mutex_name);
- }
+ /* Restore lock tracking to what it was prior to the wait */
+ reentr_mutex_orig = lt->reentr_mutex;
+ *lt = lt_orig;
+ /* un-trash the mutex we just copied over */
+ lt->reentr_mutex = reentr_mutex_orig;
ast_reentrancy_unlock(lt);
-#ifdef HAVE_BKTR
- ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
-#else
- ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t);
-#endif
+ ast_suspend_lock_info(t);
}
#endif /* DEBUG_THREADS */
@@ -882,12 +862,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t, bt);
#else
ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t);
@@ -1001,12 +989,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t);
@@ -1124,12 +1120,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t);
@@ -1227,12 +1231,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t);
@@ -1333,12 +1345,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t, bt);
#else
ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t);
@@ -1403,12 +1423,20 @@
if (t->tracking) {
#ifdef HAVE_BKTR
+ struct ast_bt tmp;
+
+ /* The implementation of backtrace() may have its own locks.
+ * Capture the backtrace outside of the reentrancy lock to
+ * avoid deadlocks. See ASTERISK-22455. */
+ ast_bt_get_addresses(&tmp);
+
ast_reentrancy_lock(lt);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
- ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
+ lt->backtrace[lt->reentrancy] = tmp;
bt = <->backtrace[lt->reentrancy];
}
ast_reentrancy_unlock(lt);
+
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/logger.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 389676 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397525 $")
/* When we include logger.h again it will trample on some stuff in syslog.h, but
* nothing we care about in here. */
@@ -1334,7 +1334,7 @@
char **ast_bt_get_symbols(void **addresses, size_t num_frames)
{
- char **strings = NULL;
+ char **strings;
#if defined(BETTER_BACKTRACES)
int stackfr;
bfd *bfdobj; /* bfd.h */
@@ -1354,9 +1354,12 @@
#if defined(BETTER_BACKTRACES)
strings_size = num_frames * sizeof(*strings);
- eachlen = ast_calloc(num_frames, sizeof(*eachlen));
- if (!(strings = ast_calloc(num_frames, sizeof(*strings)))) {
+ eachlen = ast_calloc(num_frames, sizeof(*eachlen));
+ strings = ast_std_calloc(num_frames, sizeof(*strings));
+ if (!eachlen || !strings) {
+ ast_free(eachlen);
+ ast_std_free(strings);
return NULL;
}
@@ -1371,6 +1374,7 @@
if (strcmp(dli.dli_fname, "asterisk") == 0) {
char asteriskpath[256];
+
if (!(dli.dli_fname = ast_utils_which("asterisk", asteriskpath, sizeof(asteriskpath)))) {
/* This will fail to find symbols */
ast_log(LOG_DEBUG, "Failed to find asterisk binary for debug symbols.\n");
@@ -1379,11 +1383,11 @@
}
lastslash = strrchr(dli.dli_fname, '/');
- if ( (bfdobj = bfd_openr(dli.dli_fname, NULL)) &&
- bfd_check_format(bfdobj, bfd_object) &&
- (allocsize = bfd_get_symtab_upper_bound(bfdobj)) > 0 &&
- (syms = ast_malloc(allocsize)) &&
- (symbolcount = bfd_canonicalize_symtab(bfdobj, syms))) {
+ if ((bfdobj = bfd_openr(dli.dli_fname, NULL)) &&
+ bfd_check_format(bfdobj, bfd_object) &&
+ (allocsize = bfd_get_symtab_upper_bound(bfdobj)) > 0 &&
+ (syms = ast_malloc(allocsize)) &&
+ (symbolcount = bfd_canonicalize_symtab(bfdobj, syms))) {
if (bfdobj->flags & DYNAMIC) {
offset = addresses[stackfr] - dli.dli_fbase;
@@ -1392,9 +1396,9 @@
}
for (section = bfdobj->sections; section; section = section->next) {
- if ( !bfd_get_section_flags(bfdobj, section) & SEC_ALLOC ||
- section->vma > offset ||
- section->size + section->vma < offset) {
+ if (!bfd_get_section_flags(bfdobj, section) & SEC_ALLOC ||
+ section->vma > offset ||
+ section->size + section->vma < offset) {
continue;
}
@@ -1402,14 +1406,16 @@
continue;
}
- /* file can possibly be null even with a success result from bfd_find_nearest_line */
- file = file ? file : "";
+ /* file can possibly be null even with a success result from bfd_find_nearest_line */
+ file = file ? file : "";
/* Stack trace output */
found++;
if ((lastslash = strrchr(file, '/'))) {
const char *prevslash;
- for (prevslash = lastslash - 1; *prevslash != '/' && prevslash >= file; prevslash--);
+
+ for (prevslash = lastslash - 1; *prevslash != '/' && prevslash >= file; prevslash--) {
+ }
if (prevslash >= file) {
lastslash = prevslash;
}
@@ -1431,9 +1437,7 @@
}
if (bfdobj) {
bfd_close(bfdobj);
- if (syms) {
- ast_free(syms);
- }
+ ast_free(syms);
}
/* Default output, if we cannot find the information within BFD */
@@ -1453,27 +1457,31 @@
if (!ast_strlen_zero(msg)) {
char **tmp;
- eachlen[stackfr] = strlen(msg);
- if (!(tmp = ast_realloc(strings, strings_size + eachlen[stackfr] + 1))) {
- ast_free(strings);
+
+ eachlen[stackfr] = strlen(msg) + 1;
+ if (!(tmp = ast_std_realloc(strings, strings_size + eachlen[stackfr]))) {
+ ast_std_free(strings);
strings = NULL;
break; /* out of stack frame iteration */
}
strings = tmp;
strings[stackfr] = (char *) strings + strings_size;
- ast_copy_string(strings[stackfr], msg, eachlen[stackfr] + 1);
- strings_size += eachlen[stackfr] + 1;
+ strcpy(strings[stackfr], msg);/* Safe since we just allocated the room. */
+ strings_size += eachlen[stackfr];
}
}
if (strings) {
- /* Recalculate the offset pointers */
+ /* Recalculate the offset pointers because of the reallocs. */
strings[0] = (char *) strings + num_frames * sizeof(*strings);
for (stackfr = 1; stackfr < num_frames; stackfr++) {
- strings[stackfr] = strings[stackfr - 1] + eachlen[stackfr - 1] + 1;
+ strings[stackfr] = strings[stackfr - 1] + eachlen[stackfr - 1];
}
}
+ ast_free(eachlen);
+
#else /* !defined(BETTER_BACKTRACES) */
+
strings = backtrace_symbols(addresses, num_frames);
#endif /* defined(BETTER_BACKTRACES) */
return strings;
@@ -1499,9 +1507,7 @@
ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i - 3, bt->addresses[i], strings[i]);
}
- /* MALLOC_DEBUG will erroneously report an error here, unless we undef the macro. */
-#undef free
- free(strings);
+ ast_std_free(strings);
} else {
ast_debug(1, "Could not allocate memory for backtrace\n");
}
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/manager.c
^
|
@@ -47,7 +47,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 388477 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398060 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use various ast_config_AST_* */
@@ -1512,17 +1512,22 @@
if (!strcasecmp(cur->action, a->argv[num])) {
#ifdef AST_XML_DOCS
if (cur->docsrc == AST_XML_DOC) {
+ char *syntax = ast_xmldoc_printable(S_OR(cur->syntax, "Not available"), 1);
+ char *synopsis = ast_xmldoc_printable(S_OR(cur->synopsis, "Not available"), 1);
+ char *description = ast_xmldoc_printable(S_OR(cur->description, "Not available"), 1);
+ char *arguments = ast_xmldoc_printable(S_OR(cur->arguments, "Not available"), 1);
+ char *seealso = ast_xmldoc_printable(S_OR(cur->seealso, "Not available"), 1);
ast_cli(a->fd, "%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n",
- syntax_title,
- ast_xmldoc_printable(S_OR(cur->syntax, "Not available"), 1),
- synopsis_title,
- ast_xmldoc_printable(S_OR(cur->synopsis, "Not available"), 1),
- description_title,
- ast_xmldoc_printable(S_OR(cur->description, "Not available"), 1),
- arguments_title,
- ast_xmldoc_printable(S_OR(cur->arguments, "Not available"), 1),
- seealso_title,
- ast_xmldoc_printable(S_OR(cur->seealso, "Not available"), 1));
+ syntax_title, syntax,
+ synopsis_title, synopsis,
+ description_title, description,
+ arguments_title, arguments,
+ seealso_title, seealso);
+ ast_free(syntax);
+ ast_free(synopsis);
+ ast_free(description);
+ ast_free(arguments);
+ ast_free(seealso);
} else
#endif
{
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/pbx.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 388532 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h" /* use ast_config_AST_SYSTEM_NAME */
@@ -10205,10 +10205,9 @@
headp = &globals;
}
- if (value) {
+ if (value && (newvariable = ast_var_assign(name, value))) {
if (headp == &globals)
ast_verb(2, "Setting global variable '%s' to '%s'\n", name, value);
- newvariable = ast_var_assign(name, value);
AST_LIST_INSERT_HEAD(headp, newvariable, entries);
}
@@ -10255,10 +10254,9 @@
}
AST_LIST_TRAVERSE_SAFE_END;
- if (value) {
+ if (value && (newvariable = ast_var_assign(name, value))) {
if (headp == &globals)
ast_verb(2, "Setting global variable '%s' to '%s'\n", name, value);
- newvariable = ast_var_assign(name, value);
AST_LIST_INSERT_HEAD(headp, newvariable, entries);
manager_event(EVENT_FLAG_DIALPLAN, "VarSet",
"Channel: %s\r\n"
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/threadstorage.c
^
|
@@ -38,7 +38,7 @@
#else /* !defined(DEBUG_THREADLOCALS) */
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 370642 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397106 $")
#include "asterisk/strings.h"
#include "asterisk/utils.h"
@@ -249,10 +249,16 @@
AST_CLI_DEFINE(handle_cli_threadstorage_show_summary, "Summarize outstanding memory allocations")
};
+static void threadstorage_shutdown(void)
+{
+ ast_cli_unregister_multiple(cli, ARRAY_LEN(cli));
+}
+
void threadstorage_init(void)
{
pthread_mutex_init(&threadstoragelock, NULL);
ast_cli_register_multiple(cli, ARRAY_LEN(cli));
+ ast_register_atexit(threadstorage_shutdown);
}
#endif /* !defined(DEBUG_THREADLOCALS) */
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/utils.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 387294 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398648 $")
#include <ctype.h>
#include <sys/stat.h>
@@ -585,6 +585,8 @@
enum ast_lock_type type;
/*! This thread is waiting on this lock */
int pending:2;
+ /*! A condition has suspended this lock */
+ int suspended:1;
#ifdef HAVE_BKTR
struct ast_bt *backtrace;
#endif
@@ -771,6 +773,60 @@
return 0;
}
+void ast_suspend_lock_info(void *lock_addr)
+{
+ struct thr_lock_info *lock_info;
+ int i = 0;
+
+ if (!(lock_info = ast_threadstorage_get(&thread_lock_info, sizeof(*lock_info)))) {
+ return;
+ }
+
+ pthread_mutex_lock(&lock_info->lock);
+
+ for (i = lock_info->num_locks - 1; i >= 0; i--) {
+ if (lock_info->locks[i].lock_addr == lock_addr)
+ break;
+ }
+
+ if (i == -1) {
+ /* Lock not found :( */
+ pthread_mutex_unlock(&lock_info->lock);
+ return;
+ }
+
+ lock_info->locks[i].suspended = 1;
+
+ pthread_mutex_unlock(&lock_info->lock);
+}
+
+void ast_restore_lock_info(void *lock_addr)
+{
+ struct thr_lock_info *lock_info;
+ int i = 0;
+
+ if (!(lock_info = ast_threadstorage_get(&thread_lock_info, sizeof(*lock_info))))
+ return;
+
+ pthread_mutex_lock(&lock_info->lock);
+
+ for (i = lock_info->num_locks - 1; i >= 0; i--) {
+ if (lock_info->locks[i].lock_addr == lock_addr)
+ break;
+ }
+
+ if (i == -1) {
+ /* Lock not found :( */
+ pthread_mutex_unlock(&lock_info->lock);
+ return;
+ }
+
+ lock_info->locks[i].suspended = 0;
+
+ pthread_mutex_unlock(&lock_info->lock);
+}
+
+
#ifdef HAVE_BKTR
void ast_remove_lock_info(void *lock_addr, struct ast_bt *bt)
#else
@@ -851,7 +907,7 @@
ast_str_append(str, 0, "\t%s\n", symbols[frame_iterator]);
}
- free(symbols);
+ ast_std_free(symbols);
} else {
ast_str_append(str, 0, "\tCouldn't retrieve backtrace symbols\n");
}
@@ -864,7 +920,7 @@
ast_mutex_t *lock;
struct ast_lock_track *lt;
- ast_str_append(str, 0, "=== ---> %sLock #%d (%s): %s %d %s %s %p (%d)\n",
+ ast_str_append(str, 0, "=== ---> %sLock #%d (%s): %s %d %s %s %p (%d%s)\n",
lock_info->locks[i].pending > 0 ? "Waiting for " :
lock_info->locks[i].pending < 0 ? "Tried and failed to get " : "", i,
lock_info->locks[i].file,
@@ -872,7 +928,8 @@
lock_info->locks[i].line_num,
lock_info->locks[i].func, lock_info->locks[i].lock_name,
lock_info->locks[i].lock_addr,
- lock_info->locks[i].times_locked);
+ lock_info->locks[i].times_locked,
+ lock_info->locks[i].suspended ? " - suspended" : "");
#ifdef HAVE_BKTR
append_backtrace_information(str, lock_info->locks[i].backtrace);
#endif
@@ -981,20 +1038,32 @@
pthread_mutex_lock(&lock_infos_lock.mutex);
AST_LIST_TRAVERSE(&lock_infos, lock_info, entry) {
int i;
- if (lock_info->num_locks) {
- ast_str_append(&str, 0, "=== Thread ID: 0x%lx (%s)\n", (long) lock_info->thread_id,
- lock_info->thread_name);
- pthread_mutex_lock(&lock_info->lock);
- for (i = 0; str && i < lock_info->num_locks; i++) {
- append_lock_information(&str, lock_info, i);
+ int header_printed = 0;
+ pthread_mutex_lock(&lock_info->lock);
+ for (i = 0; str && i < lock_info->num_locks; i++) {
+ /* Don't show suspended locks */
+ if (lock_info->locks[i].suspended) {
+ continue;
}
- pthread_mutex_unlock(&lock_info->lock);
- if (!str)
- break;
+
+ if (!header_printed) {
+ ast_str_append(&str, 0, "=== Thread ID: 0x%lx (%s)\n", (long) lock_info->thread_id,
+ lock_info->thread_name);
+ header_printed = 1;
+ }
+
+ append_lock_information(&str, lock_info, i);
+ }
+ pthread_mutex_unlock(&lock_info->lock);
+ if (!str) {
+ break;
+ }
+ if (header_printed) {
ast_str_append(&str, 0, "=== -------------------------------------------------------------------\n"
- "===\n");
- if (!str)
- break;
+ "===\n");
+ }
+ if (!str) {
+ break;
}
}
pthread_mutex_unlock(&lock_infos_lock.mutex);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/main/xmldoc.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 377509 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398757 $")
#include "asterisk/_private.h"
#include "asterisk/paths.h"
@@ -574,8 +574,11 @@
*/
static void __attribute__((format(printf, 4, 5))) xmldoc_reverse_helper(int reverse, int *len, char **syntax, const char *fmt, ...)
{
- int totlen, tmpfmtlen;
- char *tmpfmt, tmp;
+ int totlen;
+ int tmpfmtlen;
+ char *tmpfmt;
+ char *new_syntax;
+ char tmp;
va_list ap;
va_start(ap, fmt);
@@ -588,12 +591,12 @@
tmpfmtlen = strlen(tmpfmt);
totlen = *len + tmpfmtlen + 1;
- *syntax = ast_realloc(*syntax, totlen);
-
- if (!*syntax) {
+ new_syntax = ast_realloc(*syntax, totlen);
+ if (!new_syntax) {
ast_free(tmpfmt);
return;
}
+ *syntax = new_syntax;
if (reverse) {
memmove(*syntax + tmpfmtlen, *syntax, *len);
@@ -755,6 +758,7 @@
if ((paramtype = ast_xml_get_attribute(node, "required"))) {
if (!ast_true(paramtype)) {
optmidnode = 1;
+ ast_xml_free_attr(paramtype);
break;
}
ast_xml_free_attr(paramtype);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/pbx/pbx_dundi.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 388376 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include "asterisk/network.h"
#include <sys/ioctl.h>
@@ -594,14 +594,18 @@
ast_eid_to_str(dr[anscnt].eid_str, sizeof(dr[anscnt].eid_str), &dr[anscnt].eid);
if (ast_test_flag(&flags, DUNDI_FLAG_EXISTS)) {
AST_LIST_HEAD_INIT_NOLOCK(&headp);
- newvariable = ast_var_assign("NUMBER", called_number);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
- newvariable = ast_var_assign("EID", dr[anscnt].eid_str);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
- newvariable = ast_var_assign("SECRET", cursecret);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
- newvariable = ast_var_assign("IPADDR", ipaddr);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ if ((newvariable = ast_var_assign("NUMBER", called_number))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
+ if ((newvariable = ast_var_assign("EID", dr[anscnt].eid_str))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
+ if ((newvariable = ast_var_assign("SECRET", cursecret))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
+ if ((newvariable = ast_var_assign("IPADDR", ipaddr))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
pbx_substitute_variables_varshead(&headp, map->dest, dr[anscnt].dest, sizeof(dr[anscnt].dest));
while ((newvariable = AST_LIST_REMOVE_HEAD(&headp, entries)))
ast_var_delete(newvariable);
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/pbx/pbx_loopback.c
^
|
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 361142 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396279 $")
#include "asterisk/file.h"
#include "asterisk/logger.h"
@@ -91,12 +91,15 @@
snprintf(tmp, sizeof(tmp), "%d", priority);
AST_LIST_HEAD_INIT_NOLOCK(&headp);
- newvariable = ast_var_assign("EXTEN", exten);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
- newvariable = ast_var_assign("CONTEXT", context);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
- newvariable = ast_var_assign("PRIORITY", tmp);
- AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ if ((newvariable = ast_var_assign("EXTEN", exten))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
+ if ((newvariable = ast_var_assign("CONTEXT", context))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
+ if ((newvariable = ast_var_assign("PRIORITY", tmp))) {
+ AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
+ }
/* Substitute variables */
pbx_substitute_variables_varshead(&headp, data, buf, buflen);
/* free the list */
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/res/res_agi.c
^
|
@@ -31,7 +31,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 374426 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398060 $")
#include <math.h>
#include <signal.h>
@@ -1947,8 +1947,8 @@
return RESULT_SHOWUSAGE;
if (!(fs = ast_openstream(chan, argv[2], chan->language))) {
- ast_agi_send(agi->fd, chan, "200 result=%d endpos=%ld\n", 0, sample_offset);
- return RESULT_SUCCESS;
+ ast_agi_send(agi->fd, chan, "200 result=-1 endpos=%ld\n", sample_offset);
+ return RESULT_FAILURE;
}
if ((vfs = ast_openvstream(chan, argv[2], chan->language)))
@@ -2002,9 +2002,9 @@
}
if (!(fs = ast_openstream(chan, argv[2], chan->language))) {
- ast_agi_send(agi->fd, chan, "200 result=%d endpos=%ld\n", 0, sample_offset);
+ ast_agi_send(agi->fd, chan, "200 result=-1 endpos=%ld\n", sample_offset);
ast_log(LOG_WARNING, "Unable to open %s\n", argv[2]);
- return RESULT_SUCCESS;
+ return RESULT_FAILURE;
}
if ((vfs = ast_openvstream(chan, argv[2], chan->language)))
@@ -3760,9 +3760,6 @@
AST_RWLIST_RDLOCK(&agi_commands);
AST_RWLIST_TRAVERSE(&agi_commands, command, list) {
-#ifdef AST_XML_DOCS
- char *stringptmp;
-#endif
char *tempstr, *stringp;
if (!command->cmda[0]) /* end ? */
@@ -3775,8 +3772,7 @@
fprintf(htmlfile, "<TR><TD><TABLE BORDER=\"1\" CELLPADDING=\"5\" WIDTH=\"100%%\">\n");
fprintf(htmlfile, "<TR><TH ALIGN=\"CENTER\"><B>%s - %s</B></TH></TR>\n", fullcmd, command->summary);
#ifdef AST_XML_DOCS
- stringptmp = ast_xmldoc_printable(command->usage, 0);
- stringp = ast_strdup(stringptmp);
+ stringp = ast_xmldoc_printable(command->usage, 0);
#else
stringp = ast_strdup(command->usage);
#endif
@@ -3794,9 +3790,6 @@
fprintf(htmlfile, "</TD></TR>\n");
fprintf(htmlfile, "</TABLE></TD></TR>\n\n");
ast_free(stringp);
-#ifdef AST_XML_DOCS
- ast_free(stringptmp);
-#endif
}
AST_RWLIST_UNLOCK(&agi_commands);
fprintf(htmlfile, "</TABLE>\n</BODY>\n</HTML>\n");
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/res/res_jabber.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 385916 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398576 $")
#include <ctype.h>
#include <iksemel.h>
@@ -3260,7 +3260,7 @@
*/
static int aji_handle_pubsub_event(void *data, ikspak *pak)
{
- char *item_id, *device_state, *context, *cachable_str;
+ char *item_id, *device_state, *mailbox, *cachable_str;
int oldmsgs, newmsgs;
iks *item, *item_content;
struct ast_eid pubsub_eid;
@@ -3293,15 +3293,16 @@
return IKS_FILTER_EAT;
}
} else if (!strcasecmp(iks_name(item_content), "mailbox")) {
- context = strsep(&item_id, "@");
+ mailbox = strsep(&item_id, "@");
sscanf(iks_find_cdata(item_content, "OLDMSGS"), "%10d", &oldmsgs);
sscanf(iks_find_cdata(item_content, "NEWMSGS"), "%10d", &newmsgs);
- if (!(event = ast_event_new(AST_EVENT_MWI, AST_EVENT_IE_MAILBOX,
- AST_EVENT_IE_PLTYPE_STR, item_id, AST_EVENT_IE_CONTEXT,
- AST_EVENT_IE_PLTYPE_STR, context, AST_EVENT_IE_OLDMSGS,
- AST_EVENT_IE_PLTYPE_UINT, oldmsgs, AST_EVENT_IE_NEWMSGS,
- AST_EVENT_IE_PLTYPE_UINT, newmsgs, AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW,
- &pubsub_eid, sizeof(pubsub_eid), AST_EVENT_IE_END))) {
+ if (!(event = ast_event_new(AST_EVENT_MWI,
+ AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
+ AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, item_id,
+ AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, oldmsgs,
+ AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, newmsgs,
+ AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW, &pubsub_eid, sizeof(pubsub_eid),
+ AST_EVENT_IE_END))) {
return IKS_FILTER_EAT;
}
} else {
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/res/res_musiconhold.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 375893 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398937 $")
#include <ctype.h>
#include <signal.h>
@@ -232,8 +232,9 @@
#define mohclass_unref(class,string) _mohclass_unref(class, string, __FILE__,__LINE__,__PRETTY_FUNCTION__)
static struct mohclass *_mohclass_unref(struct mohclass *class, const char *tag, const char *file, int line, const char *funcname)
{
- struct mohclass *dup;
- if ((dup = ao2_find(mohclasses, class, OBJ_POINTER))) {
+ struct mohclass *dup = ao2_callback(mohclasses, OBJ_POINTER, ao2_match_by_addr, class);
+
+ if (dup) {
if (__ao2_ref_debug(dup, -1, (char *) tag, (char *) file, line, funcname) == 2) {
FILE *ref = fopen("/tmp/refs", "a");
if (ref) {
@@ -246,7 +247,7 @@
ao2_ref(class, -1);
}
} else {
- ao2_t_ref(class, -1, (char *) tag);
+ __ao2_ref_debug(class, -1, (char *) tag, (char *) file, line, funcname);
}
return NULL;
}
@@ -1007,20 +1008,26 @@
static int moh_add_file(struct mohclass *class, const char *filepath)
{
if (!class->allowed_files) {
- if (!(class->filearray = ast_calloc(1, INITIAL_NUM_FILES * sizeof(*class->filearray))))
+ class->filearray = ast_calloc(1, INITIAL_NUM_FILES * sizeof(*class->filearray));
+ if (!class->filearray) {
return -1;
+ }
class->allowed_files = INITIAL_NUM_FILES;
} else if (class->total_files == class->allowed_files) {
- if (!(class->filearray = ast_realloc(class->filearray, class->allowed_files * sizeof(*class->filearray) * 2))) {
- class->allowed_files = 0;
- class->total_files = 0;
+ char **new_array;
+
+ new_array = ast_realloc(class->filearray, class->allowed_files * sizeof(*class->filearray) * 2);
+ if (!new_array) {
return -1;
}
+ class->filearray = new_array;
class->allowed_files *= 2;
}
- if (!(class->filearray[class->total_files] = ast_strdup(filepath)))
+ class->filearray[class->total_files] = ast_strdup(filepath);
+ if (!class->filearray[class->total_files]) {
return -1;
+ }
class->total_files++;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/res/res_security_log.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $");
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398102 $");
#include "asterisk/module.h"
#include "asterisk/logger.h"
@@ -159,6 +159,8 @@
security_event_sub = ast_event_unsubscribe(security_event_sub);
}
+ ast_logger_unregister_level(LOG_SECURITY_NAME);
+
ast_verb(3, "Security Logging Disabled\n");
return 0;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/tests/test_hashtab_thrash.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 376306 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396656 $")
#include <pthread.h>
#include "asterisk/hashtab.h"
#include "asterisk/lock.h"
@@ -197,8 +197,10 @@
ast_hashtab_end_traversal(it);
if (last_count == count) {
- /* Allow other threads to run. */
- sched_yield();
+ /* Give other threads ample chance to run, note that using sched_yield here does not
+ * provide enough of a chance and can cause this thread to starve others.
+ */
+ usleep(1);
} else if (last_count > count) {
/* Make sure the hashtable never shrinks */
return "hashtab unexpectedly shrank";
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/tests/test_substitution.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 332176 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398018 $")
#include "asterisk/file.h"
#include "asterisk/channel.h"
@@ -53,7 +53,6 @@
char workspace[4096];
struct ast_str *str = ast_str_create(16);
- ast_test_status_update(test, "Testing '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
for (i = 0; i < 256; i++) {
*ifield = i;
ast_str_substitute_variables(&str, 0, c, expression);
@@ -63,6 +62,7 @@
okay = 0;
}
}
+ ast_test_status_update(test, "Tested '%s' . . . . . %s\n", expression, okay ? "passed" : "FAILED");
ast_free(str);
@@ -82,13 +82,14 @@
ast_copy_string(cfield, values[i], cfieldsize);
ast_str_substitute_variables(&str, 0, c, expression);
pbx_substitute_variables_helper(c, expression, workspace, sizeof(workspace));
- ast_test_status_update(test, "Testing '%s' . . . . . %s\n",
- expression, okay ? "passed" : "FAILED");
+
if (strcmp(cfield, ast_str_buffer(str)) != 0 || strcmp(cfield, workspace) != 0) {
ast_test_status_update(test, "%s != %s != %s\n", cfield, ast_str_buffer(str), workspace);
okay = 0;
}
}
+ ast_test_status_update(test, "Tested '%s' . . . . . %s\n",
+ expression, okay ? "passed" : "FAILED");
ast_free(str);
@@ -109,14 +110,15 @@
pbx_builtin_setvar_helper(c, varname, values[i]);
ast_str_substitute_variables(&str, 0, c, ast_str_buffer(var));
pbx_substitute_variables_helper(c, ast_str_buffer(var), workspace, sizeof(workspace));
- ast_test_status_update(test, "Testing '%s' . . . . . %s\n",
- ast_str_buffer(var), okay ? "passed" : "FAILED");
+
if (strcmp(values[i], ast_str_buffer(str)) != 0 || strcmp(values[i], workspace) != 0) {
ast_test_status_update(test, "%s != %s != %s\n",
values[i], ast_str_buffer(str), workspace);
okay = 0;
}
}
+ ast_test_status_update(test, "Tested '%s' . . . . . %s\n",
+ ast_str_buffer(var), okay ? "passed" : "FAILED");
ast_free(str);
ast_free(var);
@@ -133,13 +135,14 @@
ast_str_substitute_variables(&str, 0, c, expression);
pbx_substitute_variables_helper(c, expression, workspace, sizeof(workspace));
- ast_test_status_update(test, "Testing '%s' . . . . . %s\n",
- expression, okay ? "passed" : "FAILED");
+
if (strcmp(workspace, ast_str_buffer(str)) != 0) {
- ast_test_status_update(test, "test_chan_function, expr: '%s' ... %s != %s\n",
+ ast_test_status_update(test, "expr: '%s' ... %s != %s\n",
expression, ast_str_buffer(str), workspace);
okay = 0;
}
+ ast_test_status_update(test, "Tested '%s' . . . . . %s\n",
+ expression, okay ? "passed" : "FAILED");
ast_free(str);
@@ -159,15 +162,13 @@
ast_str_substitute_variables(&str, 0, c, ast_str_buffer(expression));
okay = !strcmp(ast_str_buffer(str), "foobarbaz");
-
- ast_test_status_update(test, "Testing '%s%s' and '%s%s' . . . . . %s\n",
- encode1, encode2, decode1, decode2,
- okay ? "passed" : "FAILED");
-
if (!okay) {
- ast_test_status_update(test, " '%s' != 'foobarbaz'\n",
+ ast_test_status_update(test, "'%s' != 'foobarbaz'\n",
ast_str_buffer(str));
}
+ ast_test_status_update(test, "Tested '%s%s' and '%s%s' . . . . . %s\n",
+ encode1, encode2, decode1, decode2,
+ okay ? "passed" : "FAILED");
ast_free(str);
@@ -181,16 +182,15 @@
int okay;
ast_str_substitute_variables(&str, 0, c, expression);
- okay = !strcmp(ast_str_buffer(str), result);
-
- ast_test_status_update(test, "Testing '%s' ('%s') == '%s' . . . . . %s\n",
- ast_str_buffer(str), expression, result,
- okay ? "passed" : "FAILED");
+ okay = !strcmp(ast_str_buffer(str), result);
if (!okay) {
- ast_test_status_update(test, "test_expected_result: '%s' != '%s'\n",
+ ast_test_status_update(test, "'%s' != '%s'\n",
ast_str_buffer(str), result);
}
+ ast_test_status_update(test, "Tested '%s' ('%s') == '%s' . . . . . %s\n",
+ ast_str_buffer(str), expression, result,
+ okay ? "passed" : "FAILED");
ast_free(str);
@@ -264,6 +264,7 @@
TEST(test_expected_result(test, c, "${LISTFILTER(list1,&,cd)}", "ab&ef"));
TEST(test_expected_result(test, c, "${SHELL(printf '%d' 123)},${SHELL(printf '%d' 456)}", "123,456"));
TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(printf '%d' 456)}", "123,,456"));
+ TEST(test_expected_result(test, c, "${foo},${CDR(answer,u)},${SHELL(printf '%d' 456)}", "123,0.000000,456"));
TEST(test_expected_result(test, c, "${foo},${this_does_not_exist},${THIS_DOES_NOT_EXIST(either)}", "123,,"));
#undef TEST
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/utils/ael_main.c
^
|
@@ -18,7 +18,7 @@
#include <regex.h>
#include <limits.h>
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 358810 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398748 $")
#include "asterisk/channel.h"
#include "asterisk/ast_expr.h"
@@ -647,5 +647,11 @@
{
}
#endif /* HAVE_BKTR */
+void ast_suspend_lock_info(void *lock_addr)
+{
+}
+void ast_restore_lock_info(void *lock_addr)
+{
+}
#endif /* !defined(LOW_MEMORY) */
#endif /* DEBUG_THREADS */
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/utils/check_expr.c
^
|
@@ -21,7 +21,7 @@
***/
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328209 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398752 $")
#include "asterisk/ast_expr.h"
@@ -55,6 +55,7 @@
}
#endif
+#ifdef DEBUG_THREADS
#if !defined(LOW_MEMORY)
#ifdef HAVE_BKTR
void ast_store_lock_info(enum ast_lock_type type, const char *filename,
@@ -105,12 +106,20 @@
}
#endif /* HAVE_BKTR */
+void ast_suspend_lock_info(void *lock_addr)
+{
+}
+void ast_restore_lock_info(void *lock_addr)
+{
+}
void ast_mark_lock_acquired(void *);
void ast_mark_lock_acquired(void *foo)
{
/* not a lot to do in a standalone w/o threading! */
}
#endif
+#endif /* DEBUG_THREADS */
+
static int global_lineno = 1;
static int global_expr_count=0;
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/utils/conf2ael.c
^
|
@@ -28,7 +28,7 @@
***/
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 358810 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398748 $")
#include "asterisk/paths.h" /* CONFIG_DIR */
#include <locale.h>
@@ -777,5 +777,11 @@
{
}
#endif /* HAVE_BKTR */
+void ast_suspend_lock_info(void *lock_addr)
+{
+}
+void ast_restore_lock_info(void *lock_addr)
+{
+}
#endif /* !defined(LOW_MEMORY) */
#endif /* DEBUG_THREADS */
|
[-]
[+]
|
Changed |
asterisk-1.8.24.0.tar.xz/utils/extconf.c
^
|
@@ -3149,10 +3149,9 @@
}
}
- if (value) {
+ if (value && (newvariable = ast_var_assign(name, value))) {
if ((option_verbose > 1) && (headp == &globals))
ast_verbose(VERBOSE_PREFIX_2 "Setting global variable '%s' to '%s'\n", name, value);
- newvariable = ast_var_assign(name, value);
AST_LIST_INSERT_HEAD(headp, newvariable, entries);
}
|