]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
11 years agochan_iax2: Block unnecessary control frames to/from the wire. certified/11.2
Richard Mudgett [Fri, 7 Feb 2014 19:20:43 +0000 (19:20 +0000)] 
chan_iax2: Block unnecessary control frames to/from the wire.

Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later)
results in an unexpected call disconnect.  The problem happens because
newer values in the enum ast_control_frame_type are not consistent between
the branch versions of Asterisk.

For example:
1) v1.4 calls v1.8 (or later) using IAX2

2) v1.8 answers and sends a connected line update control frame.  (on v1.8
AST_CONTROL_CONNECTED_LINE = 22)

3) v1.4 receives the control frame as an end-of-q (on v1.4
AST_CONTROL_END_OF_Q = 22)

4) v1.4 disconnects the call once the receive queue becomes empty.

Several things are done by this patch to fix the problem and attempt to
prevent it from happening again in the future:

* Added a warning at the definition of enum ast_control_frame_type about
how to add new control frame values.

* Made block sending and receiving control frames that have no reason to
go over the wire.

* Extended the connectedline iax.conf parameter to also include the
redirecting information updates.

* Updated the connectedline iax.conf parameter documentation to include a
notice that the parameter must be "no" when the peer is an Asterisk v1.4
instance.

(closes issue AST-1302)

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

Merged revisions 407678 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 407727 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@407741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoCEL: Protect data structures during reload and shutdown.
Richard Mudgett [Sat, 25 Jan 2014 00:07:39 +0000 (00:07 +0000)] 
CEL: Protect data structures during reload and shutdown.

The CEL data structures need to be protected during a configuration reload
and shutdown.  Asterisk crashed during a shutdown because CEL events were
still in flight and the CEL data structures were already destroyed.

* Protected the appset and linkedids ao2 containers using the reload_lock.
As a result appset, linkedids, and held objects don't need a lock.

* Added NULL checks before use of the appset and linkedids ao2 containers
in case the CEL module is already shutdown.

* Fixed overloading of the linkedids held objects reference count.  During
shutdown any held objects would be leaked.

* Fixed memory leak of linkedids held objects if the LINKEDID_END is not
being tracked.  The objects in the linkedids container were not removed if
the LINKEDID_END event is not used.

* Added access protection to the appset container during the CLI "cel show
status" command.

* Made CEL config reload not set defaults if the cel.conf file is invalid.

(closes issue AST-1253)
Reported by: Guenther Kelleter

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

Merged revisions 406417 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 406418 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@406468 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agomanager: Protect data structures during shutdown.
Richard Mudgett [Fri, 24 Jan 2014 18:18:58 +0000 (18:18 +0000)] 
manager: Protect data structures during shutdown.

Occasionally, the manager module would get an "INTERNAL_OBJ: bad magic
number" error on a "core restart gracefully" command if an AMI connection
is established.

* Added ao2_global_obj protection to the sessions global container.

* Fixed the order of unreferencing a session object in session_destroy().

* Removed unnecessary container traversals of the white/black filters
during session_destructor().

(closes issue AST-1242)
Reported by: Guenther Kelleter

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

Merged revisions 406341 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@406347 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agopbx.c: put copy of ast_exten.data on stack to prevent memory corruption
Matthew Jordan [Wed, 15 Jan 2014 15:26:19 +0000 (15:26 +0000)] 
pbx.c: put copy of ast_exten.data on stack to prevent memory corruption

During dialplan execution in pbx_extension_helper(), the contexts global
read lock prevents link list corruption, but was released with a pointer
to the ast_exten and data later used in variable substitution.  Instead,
this patch removes pbx_substitute_variables() and locates a copy of the
ast_exten data on the stack before releasing the lock, where ast_exten
could get free'd by another thread performing a module reload.

(issue AST-1179)
Reported by: Thomas Arimont
(issue AST-1246)
Reported by: Alexander Hömig
Review: https://reviewboard.asterisk.org/r/3055/
........

Merged revisions 403862 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 403863 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@405577 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoverbosity: Fix performance of console verbose messages.
Richard Mudgett [Tue, 14 Jan 2014 18:30:15 +0000 (18:30 +0000)] 
verbosity: Fix performance of console verbose messages.

The per console verbose level feature as previously implemented caused a
large performance penalty.  The fix required some minor incompatibilities
if the new rasterisk is used to connect to an earlier version.  If the new
rasterisk connects to an older Asterisk version then the root console
verbose level is always affected by the "core set verbose" command of the
remote console even though it may appear to only affect the current
console.  If an older version of rasterisk connects to the new version
then the "core set verbose" command will have no effect.

* Fixed the verbose performance by not generating a verbose message if
nothing is going to use it and then filtered any generated verbose
messages before actually sending them to the remote consoles.

* Split the "core set debug" and "core set verbose" CLI commands to remove
the per module verbose support that cannot work with the per console
verbose level.

* Added a silent option to the "core set verbose" command.

* Fixed "core set debug off" tab completion.

* Made "core show settings" list the current console verbosity in addition
to the root console verbosity.

* Changed the default verbose level of the 'verbose' setting in the
logger.conf [logfiles] section.  The default is now to once again follow
the current root console level.  As a result, using the AMI Command action
with "core set verbose" could again set the root console verbose level and
affect the verbose level logged.

(closes issue AST-1252)
Reported by: Guenther Kelleter

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

Merged revisions 405431 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@405481 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoastdb: crash in sqlite3 during shutdown
Scott Griepentrog [Thu, 19 Dec 2013 16:37:49 +0000 (16:37 +0000)] 
astdb: crash in sqlite3 during shutdown

When Asterisk is shut down, the astdb_atexit() function releases
(finalize) the previously initiated (prepared) SQL statements in
sqlite3.  Another thread making a subsequent request can cause a
crash in sqlite3.  This patch eliminates that issue by resetting
the statement pointer after it is released/cleared.  The sqlite3
code detects the null pointer, and aborts the operation cleanly.

(closes issue AST-1265)
Reported by: Alexander Hömig
(closes issue ASTERISK-22350)
Reported by: Birger "WIMPy" Harzenetter
Review: https://reviewboard.asterisk.org/r/3078/
........

Merged revisions 404344 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@404347 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agosecurity: Inhibit execution of privilege escalating functions
David M. Lee [Mon, 16 Dec 2013 17:20:38 +0000 (17:20 +0000)] 
security: Inhibit execution of privilege escalating functions

This patch allows individual dialplan functions to be marked as
'dangerous', to inhibit their execution from external sources.

A 'dangerous' function is one which results in a privilege escalation.
For example, if one were to read the channel variable SHELL(rm -rf /)
Bad Things(TM) could happen; even if the external source has only read
permissions.

Execution from external sources may be enabled by setting
'live_dangerously' to 'yes' in the [options] section of asterisk.conf.
Although doing so is not recommended.

(closes issue ASTERISK-22905)
Review: http://reviewboard.digium.internal/r/432/
........

Merged revisions 403913 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 403917 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@403929 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoapp_sms: BufferOverflow when receiving odd length 16 bit message
Scott Griepentrog [Mon, 16 Dec 2013 15:38:11 +0000 (15:38 +0000)] 
app_sms: BufferOverflow when receiving odd length 16 bit message

This patch prevents an infinite loop overwriting memory when
a message is received into the unpacksms16() function, where
the length of the message is an odd number of bytes.

(closes issue ASTERISK-22590)
Reported by: Jan Juergens
Tested by: Jan Juergens

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@403859 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agochan_sip: notify dialog info ignores presentation indicator in callerid
Kevin Harwell [Mon, 4 Nov 2013 21:17:18 +0000 (21:17 +0000)] 
chan_sip: notify dialog info ignores presentation indicator in callerid

The presentation indicator in a callerid (e.g. set by dialplan function
Set(CALLERID(name-pres)= ...)) is not checked when SIP Dialog Info Notifies
are generated during extension monitoring.  Added a check to make sure the
name and/or number presentations on the callee (remote identity) are set to
allow.  If they are restricted then "anonymous" is used instead.

(closes issue AST-1175)
Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/2976/
........

Merged revisions 402450 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@402456 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoAdd test suite events to indicate when a feature is detected or not
John Bigelow [Wed, 30 Oct 2013 21:01:50 +0000 (21:01 +0000)] 
Add test suite events to indicate when a feature is detected or not

These are needed by the bridge test suite tests for them to be able to run
against Asterisk 11.

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

Merged revisions 396884 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@402274 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agopbx.c: fix confused match caller id that deleted exten still in hash
Scott Griepentrog [Fri, 25 Oct 2013 22:32:35 +0000 (22:32 +0000)] 
pbx.c: fix confused match caller id that deleted exten still in hash

This fixes a bug where a zero length callerid match adjacent to a no
match callerid extension entry would be deleted together, which then
resulted in hashtable references to free'd memory.  A third state of
the matchcid value has been added to indicate match to any extension
which allows enforcing comparison of matchcid on/off without errors.

(closes issue AST-1235)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2930/
........

Merged revisions 401959 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401960 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@402040 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agores_rtp_asterisk: Fix crash when RTCP is not available during SSRC change
Matthew Jordan [Tue, 22 Oct 2013 23:01:38 +0000 (23:01 +0000)] 
res_rtp_asterisk: Fix crash when RTCP is not available during SSRC change

In r400089, a patch was put in to correct erroneous RTCP statistic resets.
Unfortunately, ast_rtp_read can be called on an RTP instance that does not
have RTCP information. This patch prevents that crash by only resetting
the statistics if we do actually have an RTCP instance.

(issue AST-1174)

(closes issue ASTERISK-22667)
Reported by: John Bigelow
........

Merged revisions 401445 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401446 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@401449 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agores_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
Matthew Jordan [Sat, 28 Sep 2013 22:41:36 +0000 (22:41 +0000)] 
res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports

RTCP's calculation of the number of lost packets in an RTP stream is based on
that stream's sequence number count, the number of received packets, and how
many packets we expect to receive. When the SSRC for an RTP stream changes,
there can - and almost always will be - a large jump in the next packet's
timestamp and sequence number. If we don't reset the number of received
packets, sequence number count, and other metrics used by RTCP, the next RR/SR
report will use the previous SSRC's values to calculate the lost packet count
for the new SSRC - resulting in a very large number of lost packets.

This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it
will reset the various values used by the RTCP calculations. From the
perspective of RTCP, this appears as a new media stream - which is what it is.

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

(closes issue AST-1174)
Reported by: Thomas Arimont
........

Merged revisions 400089 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 400093 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@400119 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoAdd check for openSUSE when detecting bfd library
Matthew Jordan [Sat, 28 Sep 2013 22:02:37 +0000 (22:02 +0000)] 
Add check for openSUSE when detecting bfd library

In ASTERISK-17842, some additional library checks were added to the configure
script so that the bfd library could be found on CentOS and Fedora systems.

As it turns out, openSUSE requires an additional library. This patch adds
another check to the configure script for openSUSE that will add that library.

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

(closes issue AST-1169)
Reported by: Guenther Kelleter
........

Merged revisions 400073 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 400075 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@400076 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMemory leak in logger.
Kevin Harwell [Fri, 20 Sep 2013 14:31:59 +0000 (14:31 +0000)] 
Memory leak in logger.

Fixed a memory leak discovered in the logger where a temporary string buffer
was not being freed.

Reported by: John Hardin
........

Merged revisions 399513 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@399516 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoRemote console: more output discrepancies
Kevin Harwell [Tue, 17 Sep 2013 18:50:58 +0000 (18:50 +0000)] 
Remote console: more output discrepancies

The remote console continued to have issues with its output.  In this case CLI
command output would either not show up (if verbose level = 0) or would contain
verbose prefixes (if verbose level > 0) once log messages were sent to the
remote console.  The fix now now adds verbose prefix data to all new lines
contained in a verbose log string.

(closes issue ASTERISK-22450)
Reported by: David Brillert
(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2825/
........

Merged revisions 399267 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@399270 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agochan_misdn: Fix misdn debug output printed with arbitrary verbose levels.
Richard Mudgett [Wed, 4 Sep 2013 16:16:55 +0000 (16:16 +0000)] 
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
........

Merged revisions 398235 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 398236 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@398240 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoCheck return value on fwrite
Kevin Harwell [Fri, 30 Aug 2013 15:26:56 +0000 (15:26 +0000)] 
Check return value on fwrite
........

Merged revisions 398000 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@398001 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoVerbose logging discrepancies
Kevin Harwell [Thu, 29 Aug 2013 22:53:18 +0000 (22:53 +0000)] 
Verbose logging discrepancies

Refactored cases where a combination of ast_verbose/options_verbose were
present.  Also in general tried to eliminate, in as many places as possible,
where the options_verbose global variable was being used.  Refactored the way
local and remote consoles handle verbose message logging in an attempt to
solve the various discrepancies that sometimes would show between the two.

(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2798/
........

Merged revisions 397948 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@397961 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoAST-2013-005: Fix crash caused by invalid SDP
Matthew Jordan [Tue, 27 Aug 2013 18:14:30 +0000 (18:14 +0000)] 
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)
........

Merged revisions 397756 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 397757 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 397758 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@397762 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoAST-2013-004: Fix crash when handling ACK on dialog that has no channel
Matthew Jordan [Tue, 27 Aug 2013 17:39:21 +0000 (17:39 +0000)] 
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)
........

Merged revisions 397710 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 397711 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 397712 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@397755 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoFix invalid access to disposed memory in main/data unit test
Matthew Jordan [Tue, 20 Aug 2013 01:25:46 +0000 (01:25 +0000)] 
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.
........

Merged revisions 396958 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 396961 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@396982 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoResolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMREC
Matthew Jordan [Tue, 20 Aug 2013 00:01:10 +0000 (00:01 +0000)] 
Resolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMREC

When r382230 added an option to not denoise the MeetMe conference (if a user
had a channel whose format's sample rate changed frequently, for example),
the value added was the maximum allowed value for the constants that define
the options for MeetMe in 1.8. Not so in 11 - unfortunately, the option
CONFFLAG_DONT_DENOISE conflicts with CONFFLAG_INTROUESR_VMREC. This patch
fixes that, and also tweaks one of the way in which the constants was
declared for consistency.

Thanks to Tony Mountifield for pointing out the problem and solution.

(closes issue ASTERISK-22269)
Reported by: Tony Mountifield
........

Merged revisions 396944 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@396947 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix XML encoding of 'identity display' in NOTIFY messages.
Matthew Jordan [Tue, 9 Jul 2013 11:33:02 +0000 (11:33 +0000)] 
Fix XML encoding of 'identity display' in NOTIFY messages.

XML encoding in chan_sip is accomplished by naively building the XML
directly from strings. While this usually works, it fails to take into
account escaping the reserved characters in XML.

This patch adds an 'ast_xml_escape' function, which works similarly to
'ast_uri_encode'. This is used to properly escape the local_display
attribute in XML formatted NOTIFY messages.

Several things to note:
 * The Right Thing(TM) to do would probably be to replace the
   ast_build_string stuff with building an ast_xml_doc. That's a much
   bigger change, and out of scope for the original ticket, so I
   refrained myself.
 * It is with great sadness that I wrote my own ast_xml_escape
   function. There's one in libxml2, but it's knee-deep in
   libxml2-ness, and not easily used to one-off escape a
   string.
 * I only escaped the string we know is causing problems
   (local_display). At least some of the other strings are
   URI-encoded, which should be XML safe. Rather than figuring out
   what's safe and escaping what's not, it would be much cleaner to
   simply build an ast_xml_doc for the messages and let the XML
   library do the XML escaping. Like I said, that's out of scope.

(closes issue AST-1171)
Reported by: Guenther Kelleter
Tested by: Guenther Kelleter
Review: http://reviewboard.digium.internal/r/365/

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@393879 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix VM snapshot handling for combined INBOX.
Jason Parker [Wed, 15 May 2013 14:55:37 +0000 (14:55 +0000)] 
Fix VM snapshot handling for combined INBOX.

The snapshot API contains an option that allow for combining of new
and old messages within a single snapshot. New messages, however,
include options beyond just 'INBOX' - it also includes the Urgent
folder. A previous patch that combined INBOX and Urgent accidentally
impacted snapshots that attempted to gain messages from just the Old
folder. This patch fixes the snapshot gathering such that the API
returns the appropriate messages for the folder selected, with and
without the combine option.

This should make it more clear about what's happening.

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

Merged revisions 388816 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@388817 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAllow mISDN to send PROGRESS messsage.
Richard Mudgett [Fri, 10 May 2013 22:34:43 +0000 (22:34 +0000)] 
Allow mISDN to send PROGRESS messsage.

* Made isdn_msg_parser.c build a progress message with the mandatory
progress indicator IE.  (The mISDNuser NT state machine rejected sending
the incomplete message.)

Note: The associated mISDN and mISDNuser patches respectively are viewable
here:
http://svnview.digium.com/svn/thirdparty?view=rev&rev=200
http://svnview.digium.com/svn/thirdparty?view=rev&rev=201

(closes issue AST-1153)
Reported by: Guenther Kelleter
Patches:
      progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter
      progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter
      progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter
........

Merged revisions 388425 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 388426 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@388471 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDisable modules with extended and deprecated support levels by default
Matthew Jordan [Thu, 28 Mar 2013 15:50:26 +0000 (15:50 +0000)] 
Disable modules with extended and deprecated support levels by default

These can be re-enabled by a user at any time through menuselect.

(closes issue AST-1138)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@384263 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAST-2013-003: Prevent username disclosure in SIP channel driver
Matthew Jordan [Wed, 27 Mar 2013 15:24:42 +0000 (15:24 +0000)] 
AST-2013-003: Prevent username disclosure in SIP channel driver

When authenticating a SIP request with alwaysauthreject enabled, allowguest
disabled, and autocreatepeer disabled, Asterisk discloses whether a user
exists for INVITE, SUBSCRIBE, and REGISTER transactions in multiple ways. The
information is disclosed when:
 * A "407 Proxy Authentication Required" response is sent instead of a
   "401 Unauthorized" response
 * The presence or absence of additional tags occurs at the end of "403
   Forbidden" (such as "(Bad Auth)")
 * A "401 Unauthorized" response is sent instead of "403 Forbidden" response
   after a retransmission
 * Retransmission are sent when a matching peer did not exist, but not when a
   matching peer did exist.

This patch resolves these various vectors by ensuring that the responses sent
in all scenarios is the same, regardless of the presence of a matching peer.

This issue was reported by Walter Doekes, OSSO B.V. A substantial portion of
the testing and the solution to this problem was done by Walter as well - a
huge thanks to his tireless efforts in finding all the ways in which this
setting didn't work, providing automated tests, and working with Kinsey on
getting this fixed.

(closes issue ASTERISK-21013)
Reported by: wdoekes
Tested by: wdoekes, kmoore
patches:
  AST-2013-003-1.8 uploaded by kmoore, wdoekes (License 6273, 5674)
  AST-2013-003-10 uploaded by kmoore, wdoekes (License 6273, 5674)
  AST-2013-003-11 uploaded by kmoore, wdoekes (License 6273, 5674)
........

Merged revisions 384003 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@384010 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAST-2013-002: Prevent denial of service in HTTP server
Matthew Jordan [Wed, 27 Mar 2013 14:38:49 +0000 (14:38 +0000)] 
AST-2013-002: Prevent denial of service in HTTP server

AST-2012-014, fixed in January of this year, contained a fix for Asterisk's
HTTP server for a remotely-triggered crash. While the fix put in place fixed
the possibility for the crash to be triggered, a denial of service vector still
exists with that solution if an attacker sends one or more HTTP POST requests
with very large Content-Length values. This patch resolves this by capping
the Content-Length at 1024 bytes. Any attempt to send an HTTP POST with
Content-Length greater than this cap will not result in any memory allocation.
The POST will be responded to with an HTTP 413 "Request Entity Too Large"
response.

This issue was reported by Christoph Hebeisen of TELUS Security Labs

(closes issue ASTERISK-20967)
Reported by: Christoph Hebeisen
patches:
  AST-2013-002-1.8.diff uploaded by mmichelson (License 5049)
  AST-2013-002-10.diff uploaded by mmichelson (License 5049)
  AST-2013-002-11.diff uploaded by mmichelson (License 5049)
........

Merged revisions 383978 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@383979 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAST-2013-001: Prevent buffer overflow through H.264 format negotiation
Matthew Jordan [Wed, 27 Mar 2013 14:27:43 +0000 (14:27 +0000)] 
AST-2013-001: Prevent buffer overflow through H.264 format negotiation

The format attribute resource for H.264 video performs an unsafe read against a
media attribute when parsing the SDP. The value passed in with the format
attribute is not checked for its length when parsed into a fixed length buffer.
This patch resolves the vulnerability by only reading as many characters from
the SDP value as will fit into the buffer.

(closes issue ASTERISK-20901)
Reported by: Ulf Harnhammar
patches:
  h264_overflow_security_patch.diff uploaded by jrose (License 6182)
........

Merged revisions 383973 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@383974 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoResolve deadlock between SIP registration and channel based functions
Matthew Jordan [Tue, 26 Mar 2013 02:31:26 +0000 (02:31 +0000)] 
Resolve deadlock between SIP registration and channel based functions

In r373424, several reentrancy problems in chan_sip were addressed. As a
result, the SIP channel driver is now properly locking the channel driver
private information in certain operations that it wasn't previously. This
exposed two latent problems either in register_verify or by functions called
by register_verify. This includes:
 * Holding the private lock while calling sip_send_mwi_to_peer. This can create
   a new sip_pvt via sip_alloc, which will obtain the channel container lock.
   This is a locking inversion, as any channel related lock must be obtained
   prior to obtaining the SIP channel technology private lock.

   Note that this issue was already fixed in Asterisk 11.

 * Holding the private lock while calling sip_poke_peer. In the same vein as
   sip_send_mwi_to_peer, sip_poke_peer can create a new SIP private, causing
   the same locking inversion.

Note that this locking inversion typically occured when CLI commands were run
while a SIP REGISTER request was being processed, as many CLI commands (such
as 'sip show channels', 'core show channels', etc.) have to obtain the channel
container lock.

(issue ASTERISK-21068)
Reported by: Nicolas Bouliane

(issue ASTERISK-20550)
Reported by: David Brillert

(issue ASTERISK-21314)
Reported by: Badalian Vyacheslav

(issue ASTERISK-21296)
Reported by: Gabriel Birke
........

Merged revisions 383863 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 383878 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@383880 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoResolve deadlock between pending CDR and batch CDR locks
Matthew Jordan [Tue, 26 Mar 2013 02:01:45 +0000 (02:01 +0000)] 
Resolve deadlock between pending CDR and batch CDR locks

r375757 attempted to resolve a race condition between multiple submissions of
CDRs while in batch mode from attempting to destroy the scheduled batch
submission by extending the batch CDR lock. Unfortunately, this causes a
deadlock between the pending CDR lock and the batch CDR lock. This patch
resolves the intent of r375757 by simply providing a new lock that protects
the scheduling of the batches. The original batch CDR lock is kept to protect
manipulation of the batch CDR settings, but has been placed such that it
is not held when the pending lock is held.

Thanks to Chase Venters for providing lock analysis on the issue.

(issue ASTERISK-21162)
Reported by: Chase Venters
........

Merged revisions 383839 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 383840 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@383842 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agotcptls: Prevent unsupported options from being set
Kinsey Moore [Fri, 15 Mar 2013 13:37:07 +0000 (13:37 +0000)] 
tcptls: Prevent unsupported options from being set

AMI, HTTP, and chan_sip all support TLS in some way, but none of them
support all the options that Asterisk's TLS core is capable of
interpreting. This prevents consumers of the TLS/SSL layer from setting
TLS/SSL options that they do not support.

This also gets tlsverifyclient closer to a working state by requesting
the client certificate when tlsverifyclient is set. Currently, there is
no consumer of main/tcptls.c in Asterisk that supports this feature and
so it can not be properly tested.

Review: https://reviewboard.asterisk.org/r/2370/
Reported-by: John Bigelow
Patch-by: Kinsey Moore
(closes issue AST-1093)
........

Merged revisions 383165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 383166 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@383208 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoLet vm_mailbox_snapshot combine "Urgent" when no folder is specified
Matthew Jordan [Thu, 7 Mar 2013 17:57:49 +0000 (17:57 +0000)] 
Let vm_mailbox_snapshot combine "Urgent" when no folder is specified

r381835 fixed a bug in vm_mailbox_snapshot where combining INBOX and Old forgot
that Urgent also "counts" as new messages. This fixed the problem when any of
the three folders was specified and the combine option was used.

It missed the case where the folder isn't specified and we build a snapshot of
all folders. This patch corrects that.
........

Merged revisions 382617 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382618 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd a 'secret' probation strictrtp mode to handle delayed changes in RTP source
Matthew Jordan [Thu, 7 Mar 2013 15:13:13 +0000 (15:13 +0000)] 
Add a 'secret' probation strictrtp mode to handle delayed changes in RTP source

Often, Asterisk may realize that a change in the source of an RTP stream is
about to occur and ask that the RTP engine reset it's lock on the current RTP
source. In certain scenarios, it may take awhile for the new remote system to
send RTP packets, while the old remote system may continue providing RTP during
that time period. This causes Asterisk to re-lock onto the old source, thereby
rejecting the new source when the old source stops sending RTP and the new
source begins.

This patch prevents that by having a constant secondary, 'secret' probation
mode enabled when an RTP source has been chosen. RTP packets from other sources
are always considered, but never chosen unless the current RTP source stops
sending RTP.

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

(closes issue AST-1124)
Reported by: John Bigelow
Tested by: John Bigelow

(closes issue AST-1125)
Reported by: John Bigelow
Tested by: John Bigelow
........

Merged revisions 382573 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382576 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoapp_page: Fixup application XML documentation typos and inaccuracies.
Kinsey Moore [Wed, 6 Mar 2013 19:36:33 +0000 (19:36 +0000)] 
app_page: Fixup application XML documentation typos and inaccuracies.

(closes issue AST-1116)
........

Merged revisions 380869 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382536 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix comparison of presence state in event subsystem.
Jason Parker [Mon, 4 Mar 2013 21:15:52 +0000 (21:15 +0000)] 
Fix comparison of presence state in event subsystem.

Several new IEs were not given types (or names), causing the comparison
function to improperly succeed.  This adds those.

(closes issue AST-1128)
........

Merged revisions 382390 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382393 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoConfbridge CLI new record file name check.
Kevin Harwell [Mon, 4 Mar 2013 20:21:28 +0000 (20:21 +0000)] 
Confbridge CLI new record file name check.

This fix checks to make sure that if a confbridge record start command is issued
from the CLI it will always use the file name given on the CLI even if it
changes between start/stop records for a conference.  Previously it had been
reusing the same file between start/stops even if a new filename was given.

(issue AST-1088)
Reported by: John Bigelow
........

Merged revisions 382385 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382387 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoLet channels joining a MeetMe conference opt out of the denoiser
Matthew Jordan [Thu, 28 Feb 2013 16:54:25 +0000 (16:54 +0000)] 
Let channels joining a MeetMe conference opt out of the denoiser

For some channel drivers, specifically those that have a varying rate in the
number of audio samples, the audio quality for a MeetMe conference can be
exceedingly poor. This is due to a unilateral application of the DENOISE
function in func_speex to channels joining the conference.

The denoiser function in the speex library is initialized with the number of
audio samples in each sample that will be provided to it. If the number of
audio samples changes, the denoiser has to be thrown away and re-initialized.

While this could be worked around by removing func_speex, that doesn't help
if you actually use the denoiser with other channels on the system.

This patches does the following:
 * Checks for the presence of func_speex as opposed to codec_speex when
   determining if the DENOISE function is present (which is where the function
   is actually implemented)
 * Adds an option to MeetMe 'n' that causes the denoiser to not be applied
   to a channel when it joins. This keeps the current behavior the default, but
   let's users disable the denoiser if it causes problems on their system.

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

(closes issue AST-1062)
Reported by: Thomas Arimont
........

Merged revisions 382227 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 382230 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382231 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoEnsure that the default bridge/user profiles are always available
Matthew Jordan [Tue, 26 Feb 2013 16:46:52 +0000 (16:46 +0000)] 
Ensure that the default bridge/user profiles are always available

ConfBridge and Page require that there always be a default bridge and user
profile available. While properties of the default profiles can be overriden
in the configuration file, removing them can create situations where neither
application can function properly.

This patch ensures that if an administrator removes the profiles from the
confbridge.conf configuration file, the profiles are added upon load.
Documentation clarifying this has been added to the confbridge.conf.sample file.

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

(closes issue AST-1115)
Reported by: John Bigelow
Tested by: John Bigelow
........

Merged revisions 382066 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382084 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMultiple revisions 379478,382068-382069
Matthew Jordan [Tue, 26 Feb 2013 16:19:03 +0000 (16:19 +0000)] 
Multiple revisions 379478,382068-382069

........
  r379478 | kmoore | 2013-01-18 15:46:58 -0600 (Fri, 18 Jan 2013) | 13 lines

  Fix regression in Confbridge user count

  When the restructuring work got committed to Confbridge in r375470 to
  fix many open issues, it caused a regression in the reported count of
  users when conference information was requested via CLI or manager.
  This corrects the user count and user information displayed when
  listing conference information from the CLI and manager.

  (closes issue ASTERISK-20938)
  Reported By: Timo Teras
  Patches:
    confbridge-list.patch uploaded by Timo Teras (license 5409)
........
  r382068 | mjordan | 2013-02-26 09:35:05 -0600 (Tue, 26 Feb 2013) | 26 lines

  Clean up ConfBridge commands to account for wait_marked users

  When ConfBridge was refactored to better handle the concept of marked,
  wait_marked, and normal users co-existing in a conference (thereby implementing
  a state machine for the conference), the wait_marked users were put into their
  own list of conference participants, separate from the active users. This list
  is used for wait_marked users when they are waiting in a conference but no
  marked user has joined; normal users may have joined at this point however.
  There are several AMI/CLI commands that affect conference users that were not
  checking the wait_marked users list:
  * CLI/AMI commands that mute/unmute a participant. In this case, wait_marked
    users have to remain in their particular state and should not be affected -
    however, the commands would return "Channel not found" as opposed to the
    appropriate error condition.
  * CLI/AMI commands that kick a participant. An admin should always be able to
    kick a participant out of the conference.

  This patch fixes both sets of commands, and cleans up the CLI commands slightly
  by allowing them to complete a participant name (this was supposed to have been
  added, but the function call was commented out and wasn't implemented).

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

  (closes issue AST-1114)
  Reported by: John Bigelow
  Tested by: John Bigelow
........
  r382069 | mjordan | 2013-02-26 09:38:05 -0600 (Tue, 26 Feb 2013) | 3 lines

  Fix typo in r382068

  Well, that was embarrassing. Removed an '-l' that somehow got in there.
........

Merged revisions 379478,382068-382069 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@382073 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoLet vm_mailbox_snapshot_create's combine option apply to "Urgent" as well
Matthew Jordan [Wed, 20 Feb 2013 19:15:50 +0000 (19:15 +0000)] 
Let vm_mailbox_snapshot_create's combine option apply to "Urgent" as well

The vm_mailbox_snapshot_create function has an option that combines the
contents of INBOX and Old into a single snapshot. The intent of this is that
both 'new' messages and 'deleted' messages are given in a single snapshot, as
some applications prefer this view of the voicemail world. Unfortunately, the
initial implementation ignored the "Urgent" folder. The "Urgent" folder is a
pseudo-INBOX, in that new messages left with the 'U' flag will be placed in
that folder as opposed to INBOX. Thus, the option failed the intent with which
it was added.

This patch makes it so that the "Urgent" folder is included in the snapshot
when that option is used.
........

Merged revisions 381835 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381836 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoEnsure Min-SE is included in outbound INVITEs
Matthew Jordan [Wed, 20 Feb 2013 18:33:37 +0000 (18:33 +0000)] 
Ensure Min-SE is included in outbound INVITEs

Asterisk now includes Min-SE in outbound INVITEs when the value is not
90 (the default) and session timers are not disabled. This has the
effect of Asterisk following RFC4028 more closely with regard to 422
responses and preventing situations in which Asterisk would be forced
to temporarily accept a call to tear it down based on a Session-Expires
below the locally configured Min-SE.

(issue SWP-5051)
Review: https://reviewboard.asterisk.org/r/2222/
Reported-by: Kinsey Moore
Patch-by: Kinsey Moore
........

Merged revisions 377946 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377947 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377948 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381833 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoRemove the release summaries from the branch
Matthew Jordan [Wed, 20 Feb 2013 18:10:57 +0000 (18:10 +0000)] 
Remove the release summaries from the branch

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381832 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdated merge properties to reflect correct trace.
Kevin Harwell [Wed, 20 Feb 2013 16:16:40 +0000 (16:16 +0000)] 
Updated merge properties to reflect correct trace.

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381823 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoConfbridge channels staying active when all participants leave.
Kevin Harwell [Tue, 19 Feb 2013 16:26:07 +0000 (16:26 +0000)] 
Confbridge channels staying active when all participants leave.

If you started/stopped recording of a conference multiple times channels
would remain active even when all participants left the conference.  This
was due to the fact that a reference to the confbridge was being added
every time a start record command was issued, but when the recording was
stopped there was no matching de-reference thus keeping the conference alive.
Made sure only a single reference is added for the record thread no matter how
many times recording is started/stopped.  A de-reference is issued upon thread
ending.

Note, this issue is being fixed under AST-1088 since it relates to it and
should have been corrected along with those modifications.

(issue AST-1088)
Reported by: John Bigelow
........

Merged revisions 381737 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381742 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFixed Confbridge file recording deadlock and appending.
Kevin Harwell [Mon, 18 Feb 2013 22:41:15 +0000 (22:41 +0000)] 
Fixed Confbridge file recording deadlock and appending.

A deadlock occurred after starting/stopping and then restarting a confbridge
recording.  Upon starting a recording a record thread is created that holds a
lock until just before exiting.  Stopping the recording does not stop/exit the
thread or release the lock.  The thread waits until recording begins again.
Starting a stopped recording signals the thread to continue and start recording
again.  However restarting the recording also created another record thread
resulting in a deadlock.  The fix was to make sure the record thread was only
created once.

Also it was noted that filenames for the recordings were being concatenated for
each start/stop.  This was fixed by creating a new file for each conference
session and appending the actual recorded data within the file (e.g. passing
the 'a' option to MixMonitor).

(issue AST-1088)
Reported by: John Bigelow
Review: http://reviewboard.digium.internal/r/374/
........

Merged revisions 381702 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381705 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDon't send presencestate information if the state is invalid
Matthew Jordan [Sat, 16 Feb 2013 16:31:30 +0000 (16:31 +0000)] 
Don't send presencestate information if the state is invalid

Previously, presencestate information was sent whenever the state was not
NOT_SET. When r381594 actually returned INVALID presence state in all the
places it was supposed to, it caused chan_sip to start adding presence
state information to NOTIFY requests that it previously would not have
added. chan_sip shouldn't be adding presence state information when the
provider is in an invalid state; users can't set the state to invalid and
an invalid state always implies that the provider is in an error condition.

(issue AST-1084)
........

Merged revisions 381613 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381616 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix crash in PresenceState AMI action when specifying an invalid provider
Matthew Jordan [Fri, 15 Feb 2013 23:36:05 +0000 (23:36 +0000)] 
Fix crash in PresenceState AMI action when specifying an invalid provider

This patch fixes a crash in Asterisk that could be caused by using the
PresenceState AMI action while providing an invalid provider. This patch
also adds some additional warnings when a user attempts to provide the
PresenceState action with invalid data, and removes some NOTICE statements
that were still lurking in the code from testing.

(closes issue AST-1084)
Reported by: John Bigelow
Tested by: John Bigelow
........

Merged revisions 381594 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381596 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMultiple revisions 378121,378459
Matthew Jordan [Thu, 14 Feb 2013 18:46:21 +0000 (18:46 +0000)] 
Multiple revisions 378121,378459

........
  r378121 | kmoore | 2012-12-18 11:41:35 -0600 (Tue, 18 Dec 2012) | 14 lines

  Add test events for time limit-related hangups

  This patch adds hangup-related test events in order to support testing
  of time-limited bridges. This aids in testing the S() and L() bridge
  options.

  (issue SWP-4713)
  ........

  Merged revisions 378119 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........

  Merged revisions 378120 from http://svn.asterisk.org/svn/asterisk/branches/10
........
  r378459 | kmoore | 2013-01-03 12:48:00 -0600 (Thu, 03 Jan 2013) | 10 lines

  Add missing test event

  This test event was missing from channel.c causing the dial_LS_options
  test to fail intermittently because of a race condition where most code
  paths emitted the test event but this one did not. The dial_LS_options
  test should stop bouncing now.
  ........

  Merged revisions 378455 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378121,378459 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381447 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFixed failing test from r380696.
Matthew Jordan [Thu, 14 Feb 2013 18:41:21 +0000 (18:41 +0000)] 
Fixed failing test from r380696.

When I added my extensive suite of session timer unit tests, apparently one of
them was failing and I never noticed. If neither Min-SE nor Session-Expires is
set in the header, it was responding with a Session-Expires of the global
maxmimum instead of the configured max for the endpoint.

(issue ASTERISK-20787)
........

Merged revisions 380973 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 380974 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381446 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoProcess session timers, even if Session-Expires header is missing
Matthew Jordan [Thu, 14 Feb 2013 18:40:54 +0000 (18:40 +0000)] 
Process session timers, even if Session-Expires header is missing

Previously, Asterisk only processed session timer information if both the
'Supported: timer' and 'Session-Expires' headers were present. However, the
Session-Expires header is optional. If we were to receive a request with a
Min-SE greater than our configured session-expires, we would respond with a
'Session-Expires' header that was too small.

This patch cleans the situation up a bit, always processing timer information
if the 'Supported: timer' header is present.

(closes issue ASTERISK-20787)
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/2299/
........

Merged revisions 380696 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 380698 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381445 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoapp_confbridge: Fix error messages on exiting conference.
Matthew Jordan [Thu, 14 Feb 2013 15:21:05 +0000 (15:21 +0000)] 
app_confbridge: Fix error messages on exiting conference.

A marked user ending a conference with only end_marked users generates
error messages:
ERROR[0000][C-00000000]: confbridge/conf_state.c:47 conf_invalid_event_fn: Invalid event for confbridge user ''

* The MULTI_MARKED state was doing too much when it was kicking out the
end_marked users from the conference.  The kicked out users will clean up
after themselves when they exit the conference.

(closes issue ASTERISK-20991)
Reported by: Jeremy Kister
Tested by: rmudgett
........

Merged revisions 380892 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381415 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoapp_page and app_confbridge: Fix custom announcement on entering conference.
Matthew Jordan [Thu, 14 Feb 2013 15:19:12 +0000 (15:19 +0000)] 
app_page and app_confbridge: Fix custom announcement on entering conference.

The Page and ConfBridge custom announcement did not play when users
entered the conference.

* Fix the CONFBRIDGE(user,announcement) file not getting played.  The code
to do this got removed accidentally when the ConfBridge code was
restructured to be more state machine like.

* Fixed play_prompt_to_user() doxygen comments.

* Fixed the Page A(x) and n options for the caller.  The caller never
played the announcement file and totally ignored the n option.  The code
to do this was lost when the application was converted to use ConfBridge.

* Factored out setup_profile_bridge(), setup_profile_paged(), and
setup_profile_caller() routines to setup ConfBridge profiles.  Made each
profile setup routine use the default template if one has not already been
setup by dialplan.

(closes issue ASTERISK-20990)
Reported by: Jeremy Kister
Tested by: rmudgett
........

Merged revisions 380894 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381410 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix astcanary startup problem due to wrong pid value from before daemon call
Matthew Jordan [Thu, 14 Feb 2013 15:14:53 +0000 (15:14 +0000)] 
Fix astcanary startup problem due to wrong pid value from before daemon call

When Asterisk forks itself into the background via a call to daemon, it must
re-set the pid value of the new process. Otherwise, astcanary gets the pid
value of the process before the fork, which prevents it from running. Asterisk
eventually starts lowering its priority, as it can no longer communicate
with the proverbial canary in the coal mine.

This patch ensures that the correct process identifier is used by astcanary.

Note that this is getting committed to 10 as a regression fix.

(closes issue ASTERISK-20947)
Reported by: Jakob Hirsch
Tested by: mjordan
patches:
  asterisk-10.12.0.astcanary_ppid.diff uploaded by Jakob Hirsch (license 6113)
........

Merged revisions 379509 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 379510 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 379513 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381405 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUpdate init.d scripts to handle stderr; readd splash screen for remote consoles
Matthew Jordan [Thu, 14 Feb 2013 15:13:37 +0000 (15:13 +0000)] 
Update init.d scripts to handle stderr; readd splash screen for remote consoles

When r376428 was commited to re-order start up sequences to be more tolerant of
forking with thread primitives, a few items were changed that caused changes
in behavior on some distros. This includes:
 * Not displaying the splash screen on a remote console.
 * Displaying an error message on stderr when a remote console cannot connect
   to a running instance of Asterisk.

In the first case, the splash screen was re-added (thanks to Michael L. Young).
In the second case, the various init.d scripts were modified to pipe stderr
to /dev/null, as the error message is useful - if you execute a remote
console or a remote console command execution and it fail, it should tell
you. Note that the error message was always present, it just failed to be
printed prior to r376428.

Much thanks to the folks who quickly reported this problem, provided solutions,
and promptly tested the various init.d scripts on a variety of distros.

(closes issue ASTERISK-20945)
Reported by: Warren Selby
Tested by: Michael L. Young, Jamuel Starkey, kaldemar, Danny Nicholas, mjordan
patches:
  asterisk-20945-remote-intro-msg.diff uploaded by elguero (license 5026)
  ASTERISK-20945-1.8-mjordan.diff uploaded by mjordan (license 6283)
........

Merged revisions 379760 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 379777 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 379790 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381404 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoReset RTP timestamp; sequence number on SSRC change
Matthew Jordan [Thu, 14 Feb 2013 15:10:46 +0000 (15:10 +0000)] 
Reset RTP timestamp; sequence number on SSRC change

In r370252 for ASTERISK-18404, Asterisk's handling of RTP was modified to
better account for out of order RTP packets. This was accomplished by using the
RTP timestamp and sequence number to check for out of order packets. However,
when a SSRC change occurs, the timestamp and sequence number will no longer
have any relation to the previously received packets. The variables tracking
the timestamp and sequence number therefore have to be reset.

(closes issue ASTERISK-20906)
Reported by: Eelco Brolman
patches:
  dtmf_on_hold.patch uploaded by Eelco Brolman (license #6442)
........

Merged revisions 378967 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378984 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381403 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoPerform case insensitive comparisons for T.38 attributes
Matthew Jordan [Thu, 14 Feb 2013 15:09:36 +0000 (15:09 +0000)] 
Perform case insensitive comparisons for T.38 attributes

RFC5347 section 2.5.2 states the following:
...
The attribute "T38MaxBitRate" was once incorrectly registered with
IANA as "T38maxBitRate" (lower-case "m"). In accordance with T.38
examples and common implementation practice, the form "T38MaxBitRate"
SHOULD be generated by implementations conforming to this package.
In general, it is RECOMMENDED that implementations of this package
accept lowercase, uppercase, and mixed upper/lowercase encodings of
all the T.38 attributes.
...

Asterisk currently does not perform case insensitive matching on the T.38
attributes. This causes the T38MaxBitRate attribute to be negotiated at
2400 baud instead of 14400 (or whatever value you actually wanted).

This patch makes it so that when we compare T.38 attributes, we do so in a case
insensitive fashion.

Note that while the issue reporter did not directly write the patch, they
contributed to it (and would have provided one themselves if the license had
gone through a tad faster), and hence get attribution for it.

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

(closes issue ASTERISK-20897)
Reported by: Eric Hill
Tested by: Eric Hill
patches:
  -- uploaded by Eric Hill
........

Merged revisions 380458 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 380465 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381402 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDo not allow native RTP bridging if packetization of media streams differs.
Matthew Jordan [Thu, 14 Feb 2013 15:08:15 +0000 (15:08 +0000)] 
Do not allow native RTP bridging if packetization of media streams differs.

The RTP engine will no longer allow for local and remote native RTP bridges
if packetization of streams differs. Allowing native bridging in this scenario
has been known to cause FAX failures.

(closes ASTERISK-20650)
Reported by: Maciej Krajewski
Patches:
ASTERISK-20659.patch uploaded by Mark Michelson (License #5049)

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

Merged revisions 381281 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 381306 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381401 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoTrack merged changes using the standard branch nomenclature
Matthew Jordan [Thu, 14 Feb 2013 15:07:10 +0000 (15:07 +0000)] 
Track merged changes using the standard branch nomenclature

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381400 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMerge r379892 into Certified 11.2
Jonathan Rose [Fri, 8 Feb 2013 19:42:50 +0000 (19:42 +0000)] 
Merge r379892 into Certified 11.2
........
  r379892 | jrose | 2013-01-22 13:07:42 -0600 (Tue, 22 Jan 2013) | 16 lines

  app_meetme: Use new prompts for administrator menu

  The old prompts for the administrator menu were inadequate. They didn't mention
  that the menu had additional options through the 8 key and pressing the 8 key
  wouldn't reveal what those options were. This patch fixes all of that while
  also organizing code pertaining to each individual menu type which was
  previously all stored in one gigantic function along with many of the basic
  conference functions.

  (closes issue AST-996)
  Reported by: John Bigelow
  Review: http://reviewboard.digium.internal/r/360/
  ........

  Merged revisions 379885 from http://svn.asterisk.org/svn/asterisk/branches/1.8

------------------------------------------------------------------------

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@381085 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCreate branch for Certified Asterisk 11.2.
Matthew Jordan [Mon, 14 Jan 2013 20:23:19 +0000 (20:23 +0000)] 
Create branch for Certified Asterisk 11.2.

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.2@379063 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoImporting release summary for 11.2.0 release. 11.2.0
Asterisk Autobuilder [Mon, 14 Jan 2013 19:25:56 +0000 (19:25 +0000)] 
Importing release summary for 11.2.0 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0@379059 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMake version, ChangeLog updates for 11.2.0
Asterisk Autobuilder [Mon, 14 Jan 2013 18:29:33 +0000 (18:29 +0000)] 
Make version, ChangeLog updates for 11.2.0

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0@379051 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCreate 11.2.0
Asterisk Autobuilder [Mon, 14 Jan 2013 18:17:37 +0000 (18:17 +0000)] 
Create 11.2.0

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0@379047 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoImporting release summary for 11.2.0-rc2 release. 11.2.0-rc2
Asterisk Autobuilder [Wed, 9 Jan 2013 22:16:05 +0000 (22:16 +0000)] 
Importing release summary for 11.2.0-rc2 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc2@378824 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoImporting release summary for 11.2.0-rc2 release.
Asterisk Autobuilder [Wed, 9 Jan 2013 20:52:47 +0000 (20:52 +0000)] 
Importing release summary for 11.2.0-rc2 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc2@378788 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMerge changes for 11.2.0-rc2
Asterisk Autobuilder [Wed, 9 Jan 2013 20:43:00 +0000 (20:43 +0000)] 
Merge changes for 11.2.0-rc2

* 378687, 378690, 378036 for ASTERISK-20801
* 378287, 378409 for ASTERISK-20658
* 378582 for ASTERISK-20681
* 378321, 378411 for ASTERISK-20175

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc2@378785 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCreate 11.2.0-rc2
Asterisk Autobuilder [Wed, 9 Jan 2013 17:07:48 +0000 (17:07 +0000)] 
Create 11.2.0-rc2

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc2@378722 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoUse autotagged externals 11.2.0-rc1
Asterisk Autobuilder [Mon, 10 Dec 2012 01:59:05 +0000 (01:59 +0000)] 
Use autotagged externals

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc1@377528 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoImporting release summary for 11.2.0-rc1 release.
Asterisk Autobuilder [Mon, 10 Dec 2012 01:58:55 +0000 (01:58 +0000)] 
Importing release summary for 11.2.0-rc1 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc1@377527 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoImporting files for 11.2.0-rc1 release.
Asterisk Autobuilder [Mon, 10 Dec 2012 01:58:49 +0000 (01:58 +0000)] 
Importing files for 11.2.0-rc1 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc1@377526 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCreating tag for the release of asterisk-11.2.0-rc1
Asterisk Autobuilder [Mon, 10 Dec 2012 01:57:52 +0000 (01:57 +0000)] 
Creating tag for the release of asterisk-11.2.0-rc1

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/11.2.0-rc1@377525 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoImprove documentation by making all of the colors used readable,
Tilghman Lesher [Mon, 10 Dec 2012 01:41:02 +0000 (01:41 +0000)] 
Improve documentation by making all of the colors used readable,
no matter what the background color is.

Dark blue on a black background is unreadable, as is yellow on a
light background.  This patch turns on the bright attribute for
colors when on a dark background and turns *off* the bright
attribute when the -W command line option is used (indicating a
_light_ background).  This ensures that text is readable in both
cases.

Patch by: tilghman
Review: https://reviewboard.asterisk.org/r/2224
........

Merged revisions 377509 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377510 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377511 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoRemove some dead code and additionally handle a case that wasn't handled.
Tilghman Lesher [Mon, 10 Dec 2012 01:27:47 +0000 (01:27 +0000)] 
Remove some dead code and additionally handle a case that wasn't handled.
........

Merged revisions 377487 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377504 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377505 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd missing support for "who hung up" to chan_motif.
Joshua Colp [Sun, 9 Dec 2012 01:22:56 +0000 (01:22 +0000)] 
Add missing support for "who hung up" to chan_motif.

(closes issue ASTERISK-20671)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2208/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377462 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix order of SIP allow/disallow in MySQL contrib script.
Richard Mudgett [Sat, 8 Dec 2012 00:29:56 +0000 (00:29 +0000)] 
Fix order of SIP allow/disallow in MySQL contrib script.

Using the contrib sippeers.sql script to create the sippeers MySQL table
would result in being unable to place calls if you set the disallow value
to all.

(closes issue ASTERISK-20756)
Reported by: Andre Luis
Patches:
      sippeers.patch patch uploaded by Andre Luis
........

Merged revisions 377431 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377432 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377433 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMALLOC_DEBUG: Only wait if we want atexit allocation dumps.
Richard Mudgett [Fri, 7 Dec 2012 23:43:36 +0000 (23:43 +0000)] 
MALLOC_DEBUG: Only wait if we want atexit allocation dumps.
........

Merged revisions 377398 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377399 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377401 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agocodec_dahdi: Fix output of "transcoder show" CLI command.
Kinsey Moore [Fri, 7 Dec 2012 22:02:50 +0000 (22:02 +0000)] 
codec_dahdi: Fix output of "transcoder show" CLI command.

In r306010 "Asterisk media architecture conversion - no more format
bitfields", the logic for incrementing encoders and decoders when
opening transcoder channels was changed without making the corresponding
change when decrementing encoder / decoder channels.  The result being
that when a channel was destroyed, codec_dahdi couldn't properly tell if
it was an encoder or decoder, and the default case is to assume it was a
decoder.

This could result in negative numbers for decoders in use like in:
  VOIP6*CLI> transcoder show
  2/-2 encoders/decoders of 92 channels are in use.

(closes issue ASTERISK-19921)
Patch-by: Shaun Ruffell
........

Merged revisions 377382 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377383 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoconfbridge: Fix some resource leaks on conference teardown.
Richard Mudgett [Thu, 6 Dec 2012 23:58:21 +0000 (23:58 +0000)] 
confbridge: Fix some resource leaks on conference teardown.

* Made destroy_conference_bridge() destroy a missed ast_mutex_t and ast_cond_t.

* Made join_conference_bridge() init the ast_mutex_t's and ast_cond_t so
destroy_conference_bridge() can destroy them unconditionally.

* Made join_conference_bridge() abort if the new conference could not be
added to the conferences container.

* Made leave_conference() discard any post-join actions if
join_conference_bridge() had to abort early.

* Made the join_conference_bridge() diagnostic messages better describe
what happened.

* Renamed leave_conference_bridge() to leave_conference() and made it only
take a conference user pointer.  The conference pointer was redundant.

* Made conf_bridge_profile_copy() use struct copy instead of memcpy().

* No need to lock the conference in start_conf_record_thread() since all
of the callers already have it locked.
........

Merged revisions 377354 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377355 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd CLI tab completion to 'acl show'.
Russell Bryant [Thu, 6 Dec 2012 17:28:35 +0000 (17:28 +0000)] 
Add CLI tab completion to 'acl show'.

The 'acl show' CLI command allows you to show the details about a specific
named ACL in acl.conf.  This patch adds tab completion to the command.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377340 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix memory leak in 'manager show event' when command entered incorrectly
Matthew Jordan [Thu, 6 Dec 2012 14:11:21 +0000 (14:11 +0000)] 
Fix memory leak in 'manager show event' when command entered incorrectly

When the CLI command 'manager show event' was run incorrectly and its usage
instructions returned, a reference to the event container was leaked. This
would prevent the container from being reclaimed when Asterisk exits. We now
properly decrement the count on the ao2 object using the nifty RAII_VAR macro.

Thanks to Russell for helping me stumble on this, and Terry for writing that
ridiculously helpful macro.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377319 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agores_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session
Jonathan Rose [Wed, 5 Dec 2012 17:08:12 +0000 (17:08 +0000)] 
res_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session

When srtp_create fails, the session may be dealloced or just not alloced. At
the same time though, the session pointer might not be set to NULL in this
process and attempting to srtp_dealloc it again will cause a segfault. This
patch checks for failure of srtp_create and sets the session pointer to NULL
if it fails.

(closes issue ASTERISK-20499)
Reported by: tootai
Review: https://reviewboard.asterisk.org/r/2228/
........

Merged revisions 377256 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377261 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377262 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix a SIP request memory leak with TLS connections.
Joshua Colp [Wed, 5 Dec 2012 16:50:43 +0000 (16:50 +0000)] 
Fix a SIP request memory leak with TLS connections.

During the TLS re-work in chan_sip some TLS specific code was moved
into a separate function. This function operates on a copy of the
incoming SIP request. This copy was never deinitialized causing a
memory leak for each request processed.

This function is now given a SIP request structure which it can use
to copy the incoming request into. This reduces the amount of memory
allocations done since the internal allocated components are reused
between packets and also ensures the SIP request structure is
deinitialized when the TLS connection is torn down.

(closes issue ASTERISK-20763)
Reported by: deti
........

Merged revisions 377257 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377258 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377259 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix registering core show codecs/codec CLI commands twice.
Richard Mudgett [Wed, 5 Dec 2012 02:19:43 +0000 (02:19 +0000)] 
Fix registering core show codecs/codec CLI commands twice.
........

Merged revisions 377241 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377244 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoconfbridge: Fix several small issues.
Richard Mudgett [Wed, 5 Dec 2012 01:09:39 +0000 (01:09 +0000)] 
confbridge: Fix several small issues.

* Made func_confbridge_helper() allow an empty value when setting options.
You previously could not Set(CONFBRIDGE(user,pin)=) and clear the
configured pin from the dialplan.

* Made func_confbridge_helper() handle its datastore better if multiple
threads attempt to set the first CONFBRIDGE option value on the channel.

* Made the func_confbridge_helper() only output one diagnostic message
concerning the option.

* Made the bridge video_mode able to repeatedly change in the config file
and CONFBRIDGE dialplan function.  The video_mode option values are an
enum and not independent of each other.

* Made handle_cli_confbridge_show_bridge_profile() better handle the
video_mode option.

* Simplified datastore handling code in conf_find_user_profile() and
conf_find_bridge_profile().

(closes issue ASTERISK-20655)
Reported by: Birger "WIMPy" Harzenetter
........

Merged revisions 377227 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377228 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoconfbridge: Update online XML documentation.
Richard Mudgett [Tue, 4 Dec 2012 22:32:17 +0000 (22:32 +0000)] 
confbridge: Update online XML documentation.
........

Merged revisions 377212 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377213 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoAdd libuuid to install_prereq for Fedora.
Russell Bryant [Tue, 4 Dec 2012 12:59:51 +0000 (12:59 +0000)] 
Add libuuid to install_prereq for Fedora.

I ran this script and my build failed.  pjproject requires this.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377195 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCleanup ast_run_atexits() atexits list.
Richard Mudgett [Mon, 3 Dec 2012 22:58:46 +0000 (22:58 +0000)] 
Cleanup ast_run_atexits() atexits list.

* Convert atexits list to a mutex instead of a rd/wr lock.  The lock is
only write locked.

* Move CLI verbose Asterisk ending message to where AMI message is output
in really_quit() to avoid further surprises about using stuff already
shutdown.

(issue ASTERISK-20649)
Reported by: Corey Farrell
........

Merged revisions 377165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377166 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377167 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCleanup core main on exit.
Richard Mudgett [Mon, 3 Dec 2012 20:43:03 +0000 (20:43 +0000)] 
Cleanup core main on exit.

* Cleanup time zones on exit.

* Make exit clean/unclean report consistent for AMI and CLI in
really_quit().

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
      core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377137 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCleanup config cache on exit.
Richard Mudgett [Mon, 3 Dec 2012 19:32:05 +0000 (19:32 +0000)] 
Cleanup config cache on exit.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      config-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
........

Merged revisions 377104 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377105 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377106 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCleanup CLI resources on exit and CLI command registration errors.
Richard Mudgett [Mon, 3 Dec 2012 19:16:20 +0000 (19:16 +0000)] 
Cleanup CLI resources on exit and CLI command registration errors.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      cli-leaks-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
      cli-leaks-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

Merged revisions 377073 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377074 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377075 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoCleanup CDR resources on exit.
Richard Mudgett [Mon, 3 Dec 2012 18:43:48 +0000 (18:43 +0000)] 
Cleanup CDR resources on exit.

* Simplify do_reload() return handling since it never returned anything
other than 0.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      cdr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
      cdr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

Merged revisions 377069 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377070 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377071 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix CCSS CLI commands and logger level not unregistered.
Richard Mudgett [Mon, 3 Dec 2012 17:08:06 +0000 (17:08 +0000)] 
Fix CCSS CLI commands and logger level not unregistered.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      ccss-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
........

Merged revisions 377037 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377038 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377039 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix an RTP instance reference count leak in chan_motif.
Joshua Colp [Mon, 3 Dec 2012 14:54:54 +0000 (14:54 +0000)] 
Fix an RTP instance reference count leak in chan_motif.

When setting up an RTP instance the RTCP portion of the instance
keeps a reference to the instance itself. In order to release this
reference and stop RTCP the stop API call must be called before
destroying the instance.

(closes issue ASTERISK-20751)
Reported by: joshoa

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377021 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoTweak extension used for incoming calls received on Motif.
Joshua Colp [Sat, 1 Dec 2012 00:46:40 +0000 (00:46 +0000)] 
Tweak extension used for incoming calls received on Motif.

Based on feedback from numerous individuals this patch tweaks incoming calls
to first look for an extension with the name of the endpoint. If no such extension
exists the call will silently fall back to the "s" extension as it previously
did.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376983 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_misdn: Fix sending RELEASE_COMPLETE in response to SETUP.
Richard Mudgett [Fri, 30 Nov 2012 21:35:45 +0000 (21:35 +0000)] 
chan_misdn: Fix sending RELEASE_COMPLETE in response to SETUP.

Fix sending a RELEASE_COMPLETE in response to a SETUP if chan_misdn does
not have a B channel available to assign to the call.

(closes issue ABE-2869)
Reported by: Guenther Kelleter
Patches:
      setup-reject_2.diff (license #6372) patch uploaded by Guenther Kelleter
      Modified

........

Merged revision 376949 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

Merged revisions 376950 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376951 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376952 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoMinor spelling fix to the VOLUME documentation.
Sean Bright [Fri, 30 Nov 2012 17:07:46 +0000 (17:07 +0000)] 
Minor spelling fix to the VOLUME documentation.
........

Merged revisions 376919 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376920 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376921 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoFix potential crashes during SIP attended transfers.
Mark Michelson [Fri, 30 Nov 2012 16:36:54 +0000 (16:36 +0000)] 
Fix potential crashes during SIP attended transfers.

The principal behind this patch is simple. During a transfer,
we manipulate channels that are owned by a separate thread than
the one we currently are running in, so it makes sense that we
need to grab a reference to the channels so that they cannot
disappear out from under us.

In the wild, crashes were sometimes seen when the transferring
party would hang up the call before the transfer target answered
the call. The most common place to see the crash occur was when
attempting to send a connected line update to the transferer
channel.

(closes issue ASTERISK-20226)
Reported by Jared Smith
Patches:
ASTERISK-20226.patch uploaded by Mark Michelson (License #5049)
Tested by: Jared Smith
........

Merged revisions 376901 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376916 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376917 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agochan_local: Fix local_pvt ref leak in local_devicestate().
Richard Mudgett [Thu, 29 Nov 2012 22:59:50 +0000 (22:59 +0000)] 
chan_local: Fix local_pvt ref leak in local_devicestate().

Regression introduced by ASTERISK-20390 fix.

(closes issue ASTERISK-20769)
Reported by: rmudgett
Tested by: rmudgett
........

Merged revisions 376868 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376869 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376870 65c4cc65-6c06-0410-ace0-fbb531ad65f3