asterisk/asterisk.git
6 years agoFix potential double free when unloading a module.
Richard Mudgett [Mon, 17 Dec 2012 23:10:42 +0000 (23:10 +0000)]
Fix potential double free when unloading a module.
........

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

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

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

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

6 years agoMake chan_local module references tied to local_pvt lifetime.
Richard Mudgett [Mon, 17 Dec 2012 23:02:54 +0000 (23:02 +0000)]
Make chan_local module references tied to local_pvt lifetime.

The chan_local module references were manually tied to the existence of
the ;1 and ;2 channel links.

* Made chan_local module references tied to the existence of the local_pvt
structure as well as automatically take care of the module references.

* Tweaked the wording of the local_fixup() failure warning message to make
sense.

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

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

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

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

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

6 years agochan_local: Parse dial string consistently.
Richard Mudgett [Mon, 17 Dec 2012 21:22:21 +0000 (21:22 +0000)]
chan_local: Parse dial string consistently.

* Fix local_alloc() unexpected limitation of exten and context length from
a combined length of 80 characters to a normal 80 characters each.

* Made local_alloc() and local_devicestate() parse the same way.

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

6 years agoMake libasteriskssl.so symlink use a relative path.
Jason Parker [Mon, 17 Dec 2012 20:59:51 +0000 (20:59 +0000)]
Make libasteriskssl.so symlink use a relative path.

This was causing issues when using DESTDIR, since the path to which the link
pointed is not likely to exist (and not useful to exist) on the target system.

(issue ASTNOW-284)
........

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

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

6 years agochan_local: Misc lock and ref tweaks.
Richard Mudgett [Mon, 17 Dec 2012 20:34:25 +0000 (20:34 +0000)]
chan_local: Misc lock and ref tweaks.

* awesome_locking() does not need to thrash the pvt lock as much.

* local_setoption() does not need to check for NULL pvt on cleanup since
it will never be NULL.

* Made ref the pvt before locking for consistency.

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

6 years agochan_agent: Remove some duplicated code.
Richard Mudgett [Fri, 14 Dec 2012 22:45:03 +0000 (22:45 +0000)]
chan_agent: Remove some duplicated code.

No need to check for an agent twice.  Santa does that.

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

6 years agoFeatures: BRIDGE_FEATURES variable automixmonitor support and use proper party
Jonathan Rose [Fri, 14 Dec 2012 22:34:18 +0000 (22:34 +0000)]
Features: BRIDGE_FEATURES variable automixmonitor support and use proper party

BRIDGE_FEATURES did not previously support the automixmonitor feature. Now it
does. In addition, the BRIDGE_FEATURES variable would not apply features to
the proper party based on whether the feature option letter was in caps or
in lowercase (both ways would apply it to the caller). Now uppercase applies
to the caller while lowercase applies to the callee (like with the dial option)

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

6 years agoapp_queue: Revert bad ringinuse=no patch.
Richard Mudgett [Fri, 14 Dec 2012 21:35:44 +0000 (21:35 +0000)]
app_queue: Revert bad ringinuse=no patch.

With the option ringinuse=no set, the patch committed for ASTERISK-16115
causes non-SIP queue members to never be called because the device state
is checked after a channel is created to determine if the member is busy.
These queue members always get the "Member %s is busy, cannot dial"
message.

Most channel drivers other than chan_sip use the default device state
handling.  The default device-state state is considered in use or unknown
if the channel exists or not respectively.

(closes issue ASTERISK-20801)
Reported by: rmudgett
Patches:
      jira_asterisk_16115_revert_r370418_v1.8.patch (license #5621) patch uploaded by rmudgett
........

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

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

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

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

6 years agoapp_queue: Make update_status() not return anything.
Richard Mudgett [Fri, 14 Dec 2012 20:22:36 +0000 (20:22 +0000)]
app_queue: Make update_status() not return anything.

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

6 years agoFix skinny to recognise vmexten in general section of conf
Damien Wedhorn [Fri, 14 Dec 2012 01:55:43 +0000 (01:55 +0000)]
Fix skinny to recognise vmexten in general section of conf

Fixup the vmexten so if globally set in general section will be honored by
chan_skinny. Also get rid of the 'global_' part of variable name to match
regexten.

(closes issue ASTERISK-20790)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    skinny-vm.diff uploaded by snuffy (license 5024)
........

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

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

6 years agoAdd g722 codec support to skinny
Damien Wedhorn [Fri, 14 Dec 2012 01:02:15 +0000 (01:02 +0000)]
Add g722 codec support to skinny

(closes issue ASTERISK-20788)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    skinny-g722.diff uploaded by snuffy (license 5024)

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

6 years agoconfbridge: Fix MOH on simultaneous user entry to a new conference.
Richard Mudgett [Thu, 13 Dec 2012 21:28:15 +0000 (21:28 +0000)]
confbridge: Fix MOH on simultaneous user entry to a new conference.

When two users entered a new conference simultaneously, one of the callers
hears MOH.  This happened if two unmarked users entered simultaneously and
also if a waitmarked and a marked user entered simultaneously.

* Created a confbridge internal MOH API to eliminate the inlined MOH
handling code.  Note that the conference mixing bridge needs to be locked
when actually starting/stopping MOH because there is a small window
between the conference join unsuspend MOH and actually joining the mixing
bridge.

* Created the concept of suspended MOH so it can be interrupted while
conference join announcements to the user and DTMF features can operate.

* Suspend any MOH until the user is about to actually join the mixing
bridge of the conference.  This way any pre-join file playback does not
need to worry about MOH.

* Made post-join actions only play deferred entry announcement files.
Changing the user/conference state during that time is not protected or
controlled by the state machine.

(closes issue ASTERISK-20606)
Reported by: Eugenia Belova
Tested by: rmudgett

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

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

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

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

6 years agoMinor fixes for chan_skinny
Damien Wedhorn [Thu, 13 Dec 2012 21:25:31 +0000 (21:25 +0000)]
Minor fixes for chan_skinny

Whitespace, change SUBSTATE_ONHOOK to correct SKINNY_ONHOOK and
correct len of 2 strcmp in skinny_setdebug(). (see opticron's review
on https://reviewboard.asterisk.org/r/2240/)
........

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

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

6 years agoMake generate_exchange_uuid() always return the passed ast_str pointer.
Sean Bright [Thu, 13 Dec 2012 21:20:32 +0000 (21:20 +0000)]
Make generate_exchange_uuid() always return the passed ast_str pointer.

I changed this code earlier to return NULL if it wasn't able to generate a UUID,
whereas the earlier code would always return the ast_str that was passed in.
Switch back to returning the ast_str, only set it to the empty string instead if
UUID generation fails.  We still do a validity check later which will catch this
and blow up if necessary.

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

6 years agoFixed svn merge property breakage from r377986
David M. Lee [Thu, 13 Dec 2012 21:15:44 +0000 (21:15 +0000)]
Fixed svn merge property breakage from r377986

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

6 years agoFix skinny debug tab completion
Damien Wedhorn [Thu, 13 Dec 2012 18:28:41 +0000 (18:28 +0000)]
Fix skinny debug tab completion

Review the syntax of the 'skinny debug' command to show more than
just 'show' for options to 'skinny debug' command.

(closes issue ASTERISK-20789)
Reported by: snuffy
Tested by: snuffy, myself
Patches:
    skinny-debug.diff uploaded by snuffy (license 5024)
........

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

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

6 years agoBail configure if it can't find libuuid.
David M. Lee [Thu, 13 Dec 2012 16:43:40 +0000 (16:43 +0000)]
Bail configure if it can't find libuuid.

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

6 years agoRemove compile time check HAVE_DEV_URANDOM.
Russell Bryant [Thu, 13 Dec 2012 16:18:52 +0000 (16:18 +0000)]
Remove compile time check HAVE_DEV_URANDOM.

The code was doing a runtime check, anyway.  The compile time check isn't
always valid (cross-compiling, packages).

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

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

6 years agoRe-add taskprocessor cleanup code that was removed by the UUID merge.
Mark Michelson [Thu, 13 Dec 2012 15:40:03 +0000 (15:40 +0000)]
Re-add taskprocessor cleanup code that was removed by the UUID merge.

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

6 years agoUse the UUID API to generate and validate UUIDs for res_calendar_exchange.
Sean Bright [Thu, 13 Dec 2012 15:37:55 +0000 (15:37 +0000)]
Use the UUID API to generate and validate UUIDs for res_calendar_exchange.

Currently the res_calendar_exchange module uses its own method of generating
UUIDs using ast_random().  Now that we have a UUID API we should use that
instead.

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

6 years agoThe UUID commit removed changes made in res_clialiases.c
Mark Michelson [Thu, 13 Dec 2012 15:37:45 +0000 (15:37 +0000)]
The UUID commit removed changes made in res_clialiases.c

This puts back in the changes that are designed to work
around a memory leak fix in the CLI code.

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

6 years agoFixed configure.ac to look for proper uuid.h file
David M. Lee [Thu, 13 Dec 2012 15:24:22 +0000 (15:24 +0000)]
Fixed configure.ac to look for proper uuid.h file

Introduced in r377846, the configure script was looking for uuid.h instead
of uuid/uuid.h.

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

6 years agoThis change adds a SIP peer configuration feature to allow the peer's
Brent Eagles [Thu, 13 Dec 2012 15:22:27 +0000 (15:22 +0000)]
This change adds a SIP peer configuration feature to allow the peer's
configured codecs to take precedence on an outgoing call.

This change introduces a new peer configuration property named
'ignore_requested_pref' that causes the requested codec to be ignored when
determining the preferred codec for an outgoing call leg. The consequence is
that Asterisk's usual efforts to prefer avoiding transcoding can be overridden
on a peer-by-peer basis where appropriate.

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

6 years agoEnsure Min-SE is included in outbound INVITEs
Kinsey Moore [Thu, 13 Dec 2012 14:28:57 +0000 (14:28 +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/trunk@377966 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoIncremented EXTRA_SOUNDS_VERSION in sounds/Makefile to 1.4.12 for new Extra Sounds...
Rusty Newton [Wed, 12 Dec 2012 22:43:40 +0000 (22:43 +0000)]
Incremented EXTRA_SOUNDS_VERSION in sounds/Makefile to 1.4.12 for new Extra Sounds releases

See CHANGES-* files in English extra 1.4.12 tarballs for new sound prompts added.

(closes ASTERISK-20328)
Reported by: Matt Jordan
(closes AST-755)
Reported by: John Bigelow
........

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

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

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

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

6 years agoConvert Dynamic Features Buffer To Use ast_str
Michael L. Young [Wed, 12 Dec 2012 04:43:18 +0000 (04:43 +0000)]
Convert Dynamic Features Buffer To Use ast_str

Currently, the buffer for the dynamic features list is set to a fixed size of
128.  If the list is bigger than that, it results in the dynamic feature(s) not
being recognized.

This patch changes the buffer from a fixed size to a dynamic one.

(closes issue ASTERISK-20680)
Reported by: Clod Patry
Tested by: Michael L. Young
Patches:
    asterisk-20680-dynamic-features-v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

6 years agoFix a potential deadlock in chan_sip during transfers.
Mark Michelson [Wed, 12 Dec 2012 00:02:31 +0000 (00:02 +0000)]
Fix a potential deadlock in chan_sip during transfers.

The issue comes from the fact that transfers may perform
a redirecting update on a channel. The issue is that lock
inversion between the channel and its tech_pvt occurs since
the channel lock is released during the transfer process.

The fix is to move when the redirecting update occurs to a
place where neither the tech_pvt or the channel is locked so
that the two can be locked in the proper order.

(closes issue ASTERISK-20708)
reported by Mark Michelson
patches:
ASTERISK-20708-3.patch uploaded by Mark Michelson (License #5049)

Tested by:
Tim Ringenbach at Asteria Solutions Group
........

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

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

6 years agoAdd test events necessary for bridging tests to be able to properly run.
Mark Michelson [Tue, 11 Dec 2012 22:42:11 +0000 (22:42 +0000)]
Add test events necessary for bridging tests to be able to properly run.

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

6 years agoCleanup CLI commands on exit for several files.
Richard Mudgett [Tue, 11 Dec 2012 22:03:23 +0000 (22:03 +0000)]
Cleanup CLI commands on exit for several files.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      unregister-cli-multiple-all.patch (license #5909) patch uploaded by Corey Farrell
........

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

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

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

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

6 years agoAnd remove svnmerge-integrated property.
Mark Michelson [Tue, 11 Dec 2012 21:53:06 +0000 (21:53 +0000)]
And remove svnmerge-integrated property.

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

6 years agoRemove automerge properties.
Mark Michelson [Tue, 11 Dec 2012 21:47:53 +0000 (21:47 +0000)]
Remove automerge properties.

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

6 years agoCleanup udptl on exit.
Richard Mudgett [Tue, 11 Dec 2012 21:22:45 +0000 (21:22 +0000)]
Cleanup udptl on exit.

* Cleanup CLI commands on exit.

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

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

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

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

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

6 years agoAdd UUID support to Asterisk.
Mark Michelson [Tue, 11 Dec 2012 21:04:45 +0000 (21:04 +0000)]
Add UUID support to Asterisk.

This provides a common API for dealing with unique identifiers.
The API provides methods to create, parse, copy, and stringify UUIDs.

An accompanying unit test is provided that tests all operations.

(closes issue ASTERISK-20726)
reported by Matt Jordan

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

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

6 years agoFix crash that can occur if CLI registration fails for an aliased command.
Mark Michelson [Tue, 11 Dec 2012 20:53:34 +0000 (20:53 +0000)]
Fix crash that can occur if CLI registration fails for an aliased command.

A recent memory leak fix in main/cli.c causes an ast_cli_entry's command
field to be freed and NULLed if ast_cli_register() fails. res_clialiases
was ignoring the return value of ast_cli_register() and was then passing
the NULL command off to a a hash function. This resulted in a crash.

The fix is not to ignore the erroneous return value. If ast_cli_register()
fails, then we do not continue trying to process the current alias.
........

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

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

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

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

6 years agoCleanup taskprocessor on exit.
Richard Mudgett [Tue, 11 Dec 2012 20:46:23 +0000 (20:46 +0000)]
Cleanup taskprocessor on exit.

* Cleanup CLI commands on exit.

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

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

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

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

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

6 years agoCleanup pbx on exit.
Richard Mudgett [Tue, 11 Dec 2012 20:05:32 +0000 (20:05 +0000)]
Cleanup pbx on exit.

* Cleanup CLI commands on exit.

* Unreference hints and statecbs containers on exit.

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

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

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

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

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

6 years agoCleanup logger on exit.
Richard Mudgett [Tue, 11 Dec 2012 02:44:53 +0000 (02:44 +0000)]
Cleanup logger on exit.

* Cleanup CLI commands, destroy verbosers and logchannels lists on exit.

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

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

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

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

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

6 years agoCleanup indications on exit.
Richard Mudgett [Tue, 11 Dec 2012 02:13:37 +0000 (02:13 +0000)]
Cleanup indications on exit.

* Made ast_unregister_indication_country() unlink the found tone zone
before selecting a new default_tone_zone to make it impossible to select
the tone zone being unregistered again.

* Ringcadence is no longer parsed twice in store_config_tone_zone().

* Cleanup CLI commands and destroy default_tone_zone on exit.

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

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

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

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

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

6 years agoCleanup event on exit.
Richard Mudgett [Tue, 11 Dec 2012 01:04:50 +0000 (01:04 +0000)]
Cleanup event on exit.

* Cleanup CLI commands on exit.

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

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

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

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

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

6 years agoCleanup dnsmgr on exit.
Richard Mudgett [Tue, 11 Dec 2012 00:37:01 +0000 (00:37 +0000)]
Cleanup dnsmgr on exit.

* Cleanup dnsmgr thread and CLI commands on exit.

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

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

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

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

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

6 years agoEnsure ReceiveFax provides a CED tone via T.38
Kinsey Moore [Mon, 10 Dec 2012 16:56:37 +0000 (16:56 +0000)]
Ensure ReceiveFax provides a CED tone via T.38

When using res_fax_digium, the T.38 CED tone was not being provided
properly which would cause some incoming faxes to fail. This was not an
issue with res_fax_spandsp since it does not strictly honor the
send_ced flag and sends the CED tone whenever receiving a T.38 fax.

(closes issue FAX-343)
Reported-by: Benjamin Tietz
Patch-by: Kinsey Moore
........

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

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

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

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

6 years agoHandle Session-Expires less than local Min-SE in 200 OK
Kinsey Moore [Mon, 10 Dec 2012 14:45:52 +0000 (14:45 +0000)]
Handle Session-Expires less than local Min-SE in 200 OK

Ensure that a call is immediately torn down if a Session-Expires value
received in a 200 OK is less than the local Min-SE. This also prevents
Asterisk from allowing calls with Session-Expires below the
RFC4028-mandated minimum (90s).

(closes issue ASTERISK-20653)
Review: https://reviewboard.asterisk.org/r/2237/
Patch-by: Kinsey Moore
........

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

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

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

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

6 years agoAdd firmware information to CLI devices listing
Igor Goncharovskiy [Mon, 10 Dec 2012 07:03:48 +0000 (07:03 +0000)]
Add firmware information to CLI devices listing

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

6 years agoFix codec mismatch
Igor Goncharovskiy [Mon, 10 Dec 2012 06:56:04 +0000 (06:56 +0000)]
Fix codec mismatch

Fix code to send in both rx and tx open stream messages correct codecs. Found that on phase 0/1 phones wrong codecs cause to no audio in some situations.

(issue ASTERISK-20183)
........

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

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

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

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

6 years agoRemove trailing whitespaces in number from incoming redial list.
Igor Goncharovskiy [Mon, 10 Dec 2012 05:29:04 +0000 (05:29 +0000)]
Remove trailing whitespaces in number from incoming redial list.

Reported by: Igor Olhovskiy
........

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

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

6 years agoImprove documentation by making all of the colors used readable,
Tilghman Lesher [Mon, 10 Dec 2012 01:41:50 +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
........

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

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

6 years agoRemove some dead code and additionally handle a case that wasn't handled.
Tilghman Lesher [Mon, 10 Dec 2012 01:29:32 +0000 (01:29 +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
........

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

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

6 years agoAdd missing support for "who hung up" to chan_motif.
Joshua Colp [Sun, 9 Dec 2012 01:23:44 +0000 (01:23 +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/
........

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

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

6 years agoFix order of SIP allow/disallow in MySQL contrib script.
Richard Mudgett [Sat, 8 Dec 2012 00:30:40 +0000 (00:30 +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
........

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

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

6 years agoMALLOC_DEBUG: Only wait if we want atexit allocation dumps.
Richard Mudgett [Fri, 7 Dec 2012 23:45:15 +0000 (23:45 +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
........

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

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

6 years agocodec_dahdi: Fix output of "transcoder show" CLI command.
Kinsey Moore [Fri, 7 Dec 2012 22:08:48 +0000 (22:08 +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
........

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

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

6 years agoconfbridge: Fix some resource leaks on conference teardown.
Richard Mudgett [Fri, 7 Dec 2012 00:00:39 +0000 (00:00 +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
........

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

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

6 years agoRecorded merge of revisions 377340 from http://svn.asterisk.org/svn/asterisk/branches/11
Russell Bryant [Thu, 6 Dec 2012 17:29:13 +0000 (17:29 +0000)]
Recorded merge of revisions 377340 from svn.asterisk.org/svn/asterisk/branches/11

........
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/trunk@377341 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMinor code cleanup in named_acl.c.
Russell Bryant [Thu, 6 Dec 2012 15:13:37 +0000 (15:13 +0000)]
Minor code cleanup in named_acl.c.

This patch makes a few little cleanups to named_acl.c.  A couple non-public
functions were made static and an opening brace for a function was moved to
its own line, per the coding guidelines.

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

6 years agoAdd CLI tab completion to 'acl show'.
Russell Bryant [Thu, 6 Dec 2012 15:06:47 +0000 (15:06 +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/trunk@377329 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix memory leak in 'manager show event' when command entered incorrectly
Matthew Jordan [Thu, 6 Dec 2012 14:26:13 +0000 (14:26 +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.
........

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

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

6 years agores_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session
Jonathan Rose [Wed, 5 Dec 2012 17:17:06 +0000 (17:17 +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
........

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

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

6 years agoFix a SIP request memory leak with TLS connections.
Joshua Colp [Wed, 5 Dec 2012 16:51:58 +0000 (16:51 +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
........

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

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

6 years agoRemove init_framer(). It no longer does anything.
Richard Mudgett [Wed, 5 Dec 2012 02:23:10 +0000 (02:23 +0000)]
Remove init_framer(). It no longer does anything.

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

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

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

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

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

6 years agoconfbridge: Fix several small issues.
Richard Mudgett [Wed, 5 Dec 2012 01:11:26 +0000 (01:11 +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
........

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

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

6 years agoconfbridge: Update online XML documentation.
Richard Mudgett [Tue, 4 Dec 2012 22:34:05 +0000 (22:34 +0000)]
confbridge: Update online XML documentation.
........

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

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

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

6 years agoAdd libuuid to install_prereq for Fedora.
Russell Bryant [Tue, 4 Dec 2012 13:01:23 +0000 (13:01 +0000)]
Add libuuid to install_prereq for Fedora.

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

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

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

6 years agoCleanup ast_run_atexits() atexits list.
Richard Mudgett [Mon, 3 Dec 2012 23:00:08 +0000 (23:00 +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
........

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

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

6 years agoCleanup core main on exit.
Richard Mudgett [Mon, 3 Dec 2012 20:46:11 +0000 (20:46 +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
........

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

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

6 years agoCleanup config cache on exit.
Richard Mudgett [Mon, 3 Dec 2012 19:33:06 +0000 (19:33 +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
........

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

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

6 years agoCleanup CLI resources on exit and CLI command registration errors.
Richard Mudgett [Mon, 3 Dec 2012 19:17:24 +0000 (19:17 +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
........

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

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

6 years agoCleanup CDR resources on exit.
Richard Mudgett [Mon, 3 Dec 2012 18:45:18 +0000 (18:45 +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
........

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

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

6 years agoFix CCSS CLI commands and logger level not unregistered.
Richard Mudgett [Mon, 3 Dec 2012 17:10:40 +0000 (17:10 +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
........

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

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

6 years agoFormatting fixes
Olle Johansson [Mon, 3 Dec 2012 16:45:49 +0000 (16:45 +0000)]
Formatting fixes

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

6 years agoFix an RTP instance reference count leak in chan_motif.
Joshua Colp [Mon, 3 Dec 2012 14:56:36 +0000 (14:56 +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
........

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

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

6 years agoMove functions to AFTER the block of forward declarations of functions.
Olle Johansson [Mon, 3 Dec 2012 14:46:02 +0000 (14:46 +0000)]
Move functions to AFTER the block of forward declarations of functions.

It was a mess. The first part of chan_sip.c is constants, declarations, structures and stuff,
then forward declarations and then actual code. It's still a mess, but a bit less messy ;-)

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

6 years agoFormatting changes
Olle Johansson [Mon, 3 Dec 2012 09:35:55 +0000 (09:35 +0000)]
Formatting changes

Found a large amount of missing {} in the code before patching in another branch

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

6 years agoTweak extension used for incoming calls received on Motif.
Joshua Colp [Sat, 1 Dec 2012 00:47:42 +0000 (00:47 +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.
........

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

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

6 years agochan_misdn: Fix sending RELEASE_COMPLETE in response to SETUP.
Richard Mudgett [Fri, 30 Nov 2012 21:38:01 +0000 (21:38 +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
........

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

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

6 years agoMinor spelling fix to the VOLUME documentation.
Sean Bright [Fri, 30 Nov 2012 17:08:41 +0000 (17:08 +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
........

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

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

6 years agoFix potential crashes during SIP attended transfers.
Mark Michelson [Fri, 30 Nov 2012 16:56:53 +0000 (16:56 +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
........

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

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

6 years agochan_local: Fix local_pvt ref leak in local_devicestate().
Richard Mudgett [Thu, 29 Nov 2012 23:01:16 +0000 (23:01 +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
........

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

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

6 years agoFix compile error.
Richard Mudgett [Thu, 29 Nov 2012 22:34:24 +0000 (22:34 +0000)]
Fix compile error.

(issue ASTERISK-20724)
........

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

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

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

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

6 years agoImprove Code Readability And Fix Setting natdetected Flag
Michael L. Young [Thu, 29 Nov 2012 21:58:41 +0000 (21:58 +0000)]
Improve Code Readability And Fix Setting natdetected Flag

For 1.8, 10, 11 and trunk we are are improving the code readability.

For 11 and trunk, auto nat detection was added.  The natdetected flag was being
set to 1 when the host address in the VIA header did not specifiy a port.  This
patch fixes this by setting the port on the temporary sock address used to
SIP_STANDARD_PORT in order for the sock address comparison to work properly.

(closes issue ASTERISK-20724)
Reported by: Michael L. Young
Patches:
    asterisk-20724-set-port-v2.diff uploaded by Michael L. Young (license 5026)

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

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

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

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

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

6 years agoFixed ast_random's comment about locking.
David M. Lee [Thu, 29 Nov 2012 17:16:50 +0000 (17:16 +0000)]
Fixed ast_random's comment about locking.

The original comment was separated from the code at some point, and didn't
reflect the use of libc's other than glibc for Linux.

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

6 years agoFix chan_sip websocket payload handling
Pedro Kiefer [Thu, 29 Nov 2012 16:44:42 +0000 (16:44 +0000)]
Fix chan_sip websocket payload handling

Websocket by default doesn't return an ast_str for the payload received. When
converting it to an ast_str on chan_sip the last character was being omitted,
because ast_str functions expects that the given length includes the trailing
0x00. payload_len only has the actual string length without counting the
trailing zero.

For most cases this passed unnoticed as most of SIP messages ends with \r\n.

(closes issue ASTERISK-20745)
Reported by: IƱaki Baz Castillo
Review: https://reviewboard.asterisk.org/r/2219/

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

6 years agoAdd MALLOC_DEBUG atexit unreleased malloc memory summary.
Richard Mudgett [Thu, 29 Nov 2012 00:48:12 +0000 (00:48 +0000)]
Add MALLOC_DEBUG atexit unreleased malloc memory summary.

* Adds the following CLI commands to control MALLOC_DEBUG reporting of
unreleased malloc memory when Asterisk is shut down.
memory atexit list on
memory atexit list off
memory atexit summary byline
memory atexit summary byfunc
memory atexit summary byfile
memory atexit summary off

* Made check all remaining allocated region blocks atexit for fence
violations.

* Increased the allocated region hash table size by about three times.  It
still isn't large enough considering the number of malloced blocks
Asterisk uses.

* Made CLI "memory show allocations anomalies" use
regions_check_all_fences().

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

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

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

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

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

6 years agoEnhance MALLOC_DEBUG CLI commands.
Richard Mudgett [Thu, 29 Nov 2012 00:07:55 +0000 (00:07 +0000)]
Enhance MALLOC_DEBUG CLI commands.

* Fixed CLI "memory show allocations" misspelling of anomalies option.
The command will still accept the original misspelling.

* Miscellaneous tweaks to CLI "memory show allocations" command output
format.

* Made CLI "memory show summary" summarize by line number instead of by
function if a filename is given.

* Made CLI "memory show summary" sort its output by filename or
function-name/line-number depending upon request.

* Miscellaneous tweaks to CLI "memory show summary" command output format.
........

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

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

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

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

6 years agomanager: Make challenge work with allowmultiplelogin=no
Jonathan Rose [Wed, 28 Nov 2012 16:47:44 +0000 (16:47 +0000)]
manager: Make challenge work with allowmultiplelogin=no

Prior to this patch, challenge would yield a multiple logins error if used
without providing the username (which isn't really supposed to be an argument
to challenge) if allowmultiplelogin was set to no because allowmultiplelogin
finds a user with a zero length login name. This check is simply disabled for
the challenge action when the username is empty by this patch.

(closes issue ASTERISK-20677)
Reported by: Vladimir
Patches:
    challenge_action_nomultiplelogin.diff uploaded by Jonathan Rose (license 6182)
........

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

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

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

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

6 years agoFix extension matching with the '-' char.
Richard Mudgett [Wed, 28 Nov 2012 00:13:10 +0000 (00:13 +0000)]
Fix extension matching with the '-' char.

The '-' char is supposed to be ignored by the dialplan extension matching.
Unfortunately, it's treatment is not handled consistently throughout the
extension matching code.

* Made the old exten matching code consistently ignore '-' chars.

* Made the old exten matching code consistently handle case in the
matching.

* Made ignore empty character sets.

* Fixed ast_extension_cmp() to return -1, 0, or 1 as documented.  The only
user of it in pbx_lua.c was testing for -1.  It was originally returning
the strcmp() value for less than which is not usually going to be -1.

* Fix character set sorting if the sets have the same number of characters
and start with the same character.  Character set [0-9] now sorts before
[02-9a] as originally intended.

* Updated some extension label and priority already in use warnings to
also indicate if the extension is aliased.

(closes issue ASTERISK-19205)
Reported by: Philippe Lindheimer, Birger "WIMPy" Harzenetter
Tested by: rmudgett

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

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

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

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

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

6 years agoRemove unnecessary channel module references.
Richard Mudgett [Tue, 27 Nov 2012 20:39:51 +0000 (20:39 +0000)]
Remove unnecessary channel module references.

* Removed call to ast_module_user_hangup_all() in res_config_mysql.c since
it is effectively a noop.  No channels can attach a reference to that
module.

* Removed call to ast_module_user_hangup_all() in app_celgenuserevent.c.
The caller of unload_module() has already called it.

* Removed redundant channel module references in pbx_dundi.c.  The
registered dialplan function callback dispatchers for the read/read2/write
callbacks already reference the module before calling.

* pbx_dundi: Moved unregistering CLI commands, DUNDi switch, and dialplan
functions to the first thing the unload_module() does.  This will reduce
the chance of new channels using DUNDi services while the module is being
torn down.
........

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

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

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

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

6 years agoMade AST_LIST_REMOVE() simpler and use better names.
Richard Mudgett [Tue, 27 Nov 2012 17:54:25 +0000 (17:54 +0000)]
Made AST_LIST_REMOVE() simpler and use better names.

* Update doxygen of AST_LIST_REMOVE().
........

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

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

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

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

6 years agoRe-initialize logmsgs mutex upon logger initialization to prevent lock errors
Matthew Jordan [Fri, 23 Nov 2012 00:02:23 +0000 (00:02 +0000)]
Re-initialize logmsgs mutex upon logger initialization to prevent lock errors

Similar to the patch that moved the fork earlier in the startup sequence to
prevent mutex errors in the recursive mutex surrounding the read/write thread
registration lock, this patch re-initializes the logmsgs mutex.  Part of the
start up sequence before forking the process into the background includes
reading asterisk.conf; this has to occur prior to the call to daemon in order
to read startup parameters.  When reading in a conf file, log statements can
be generated.  Since this can't be avoided, the mutex instead is
re-initialized to ensure a reset of any thread tracking information.

This patch also includes some additional debugging to catch errors when
locking or unlocking the recursive mutex that surrounds locks when the
DEBUG_THREADS build option is enabled.  DO_CRASH or THREAD_CRASH will
cause an abort() if a mutex error is detected.

(issue ASTERISK-19463)
Reported by: mjordan
Tesetd by: mjordan
........

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

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

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

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

6 years agoAdd red-black tree container type to astobj2.
Richard Mudgett [Wed, 21 Nov 2012 18:33:16 +0000 (18:33 +0000)]
Add red-black tree container type to astobj2.

* Add red-black tree container type.

* Add CLI command "astobj2 container dump <name>"

* Added ao2_container_dump() so the container could be dumped by other
modules for debugging purposes.

* Changed ao2_container_stats() so it can be used by other modules like
ao2_container_check() for debugging purposes.

* Updated the unit tests to check red-black tree containers.

(closes issue ASTERISK-19970)
Reported by: rmudgett
Tested by: rmudgett

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

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

6 years agoAdded missing newlines to websocket ast_logs.
David M. Lee [Tue, 20 Nov 2012 22:06:05 +0000 (22:06 +0000)]
Added missing newlines to websocket ast_logs.

Without these newlines, log messages just continue tacking onto the same
line, and do not flush immediately.
........

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

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

6 years agoAdd "Require: timer" to 200 OK responses when appropriate.
Mark Michelson [Tue, 20 Nov 2012 19:09:37 +0000 (19:09 +0000)]
Add "Require: timer" to 200 OK responses when appropriate.

The method by which the Require header is added to 200 responses is
inspired by the method that Olle Johansson uses in his darjeeling-prack
branch.

(closes issue ASTERISK-20570)
Reported by Matt Jordan, at the behest of Olle Johansson

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

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

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

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

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

6 years agoReduce CLI spam of "Extension Changed" device state messages.
Alec L Davis [Tue, 20 Nov 2012 17:39:11 +0000 (17:39 +0000)]
Reduce CLI spam of "Extension Changed" device state messages.

Asterisk 11 follows RFC3265 that states that after every subscribe or resubscribe a notify should be sent.
Thus the console if filled continuously with the following after every subscribe;
  == Extension Changed 8512[phones] new state IDLE for Notify User cisco1

In Asterisk 1.8 only changes would be sent. Thus only when a device state changed was anything emitted to the console.

fix:
Only print to console when device state isn't forced.

(closes issue ASTERISK-20706)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

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

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

6 years agoFix most leftover non-opaque ast_str uses.
Walter Doekes [Mon, 19 Nov 2012 20:03:56 +0000 (20:03 +0000)]
Fix most leftover non-opaque ast_str uses.

Instead of calling str->str, one should use ast_str_buffer(str). Same
goes for str->used as ast_str_strlen(str) and str->len as
ast_str_size(str).

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

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

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

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

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

6 years agoFix uninitialized in this function error
Matthew Jordan [Mon, 19 Nov 2012 02:14:54 +0000 (02:14 +0000)]
Fix uninitialized in this function error

With some versions of gcc, n_buckets will be flagged as being uninitialized
before use.  While its technically impossible (since the switch statement,
even without a default, accounts for all possibilities), we'll initialize the
variable to 0 anyway.

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

6 years agoReorder startup sequence to prevent lockups when process is sent to background
Matthew Jordan [Sun, 18 Nov 2012 20:27:45 +0000 (20:27 +0000)]
Reorder startup sequence to prevent lockups when process is sent to background

Although it is very rare and timing dependent, the potential exists for the
call to 'daemon' to cause what appears to be a deadlock in Asterisk during
startup.  This can occur when a recursive mutex is obtained prior to the
daemon call executing.  Since daemon uses fork to send the process into the
background, any threading primitives are unsafe to re-use after the call.
Implementations of pthread recursive mutexes are highly likely to store the
thread identifier of the thread that previously obtained the mutex.  If
the mutex was locked prior to the fork, a subsequent unlock operation will
potentially fail as the thread identifier is no longer valid.  Since the
mutex is still locked, all subsequent attempts to grab the mutex by other
threads will block.

This behavior exhibited itself most often when DEBUG_THREADS was enabled, as
this compile time option surrounds the mutexes in Asterisk with another
recursive mutex that protects the storage of thread related information.  This
made it much more likely that a recursive mutex would be obtained prior to
daemon and unlocked after the call.

This patch does the following:
a) It backports a patch from Asterisk 11 that prevents the spawning of the
   localtime monitoring thread.  This thread is now spawned after Asterisk has
   fully booted.
b) It re-orders the startup sequence to call daemon earlier during Asterisk
   startup.  This limits the potential of threading primitives being accessed
   by initialization calls before daemon is called.
c) It removes calls to ast_verbose/ast_log/etc. prior to daemon being called.
   Developers should send error messages directly to stderr prior to daemon,
   as calls to ast_log may access recursive mutexes that store thread related
   information.
d) It reorganizes when thread local storage is created for storing lock
   information during the creation of threads.  Prior to this patch, the
   read/write lock protecting the list of threads in ast_register_thread would
   utilize the lock in the thread local storage prior to it being initialized;
   this patch prevents that.

On a very related note, this patch will *greatly* improve the stability of the
Asterisk Test Suite.

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

(closes issue ASTERISK-19463)
Reported by: mjordan
Tested by: mjordan
........

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

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

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

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

6 years agoAdd a test event that reports changes in ConfBridge state
Matthew Jordan [Sun, 18 Nov 2012 14:31:32 +0000 (14:31 +0000)]
Add a test event that reports changes in ConfBridge state

This patch adds a test event to ConfBridge that reports transitions between
states in ConfBridge.  This is used by tests in the Asterisk Test Suite
that verify state changes based on the entering/leaving of conference
participants.
........

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

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

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

6 years agoFixed extconf.c breakage introduced in r376306.
David M. Lee [Fri, 16 Nov 2012 00:15:30 +0000 (00:15 +0000)]
Fixed extconf.c breakage introduced in r376306.

To quote wdoekes:
> Note that I'm not confirming legitimacy of having that file in tree at
> all. Is anyone using aelparse/conf2ael?
........

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

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

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

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

6 years agoSomehow I put in svn-1.6 merge information. Oops.
David M. Lee [Fri, 16 Nov 2012 00:14:00 +0000 (00:14 +0000)]
Somehow I put in svn-1.6 merge information. Oops.

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

6 years agoMigrate hashtest/hashtest2 to be unit tests.
David M. Lee [Fri, 16 Nov 2012 00:08:00 +0000 (00:08 +0000)]
Migrate hashtest/hashtest2 to be unit tests.

Both hashtest and hashtest2 are manual testing apps that thrash hash
tables (hashtab and ao2 containers, respectively), by spinning up
several threads that randomly insert, delete, lookup and iterate over
the hash table. If the app doesn't crash, the hash table probably passes
the test. Those utils are not a part of the typical Asterisk build, so
they do not usually get compiled. This all makes them less that useful.

This patch removes those manual test programs and replaces them with
Asterisk unit test modules (test_{hashtab,astobj2}_thrash.so). It also
attempts to make the tests more deterministic.

* Rather than spinning up some number of threads that operate on the
  hash table randomly, spin up four threads that concurrenly add,
  remove, lookup and iterate over the hash table.
* Each thread checks the state of the hash table both during and after
  execution, and indicates a test failure if things are not as expected.
* Each thread times out after 60 seconds to prevent deadlocking the unit
  test run.

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

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

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

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

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