Commit Graph

4801 Commits

Author SHA1 Message Date
Matthew Jordan 79e9b37ad0 localtime: Fix file descriptor leak on kqueue(2) systems
The localtime management in the Asterisk core contains a thread that watches
for changes in the local timezone. On systems where the directory containing
/etc/localtime is modified frequently, the thread monitoring the changes will
be woken up to determine if any changes in timezone have occurred. When using
kqueue(2), this can cause a leak of file descriptors due to some improper
management of resources.

This patch updates the kqueue(2) handling in localtime, such that is no longer
leaks resources.

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

ASTERISK-24739 #close
Reported by: Ed Hynan
patches:
  11.15.0-u.diff uploaded by Ed Hynan (Licnese 6680)
  11.7.0-u.diff uploaded by Ed Hynan (License 6680)
  svn-trunk-Jan-26-2015-u.diff uploaded by Ed Hynan (License 6680)
........

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

Merged revisions 432693 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-10 18:05:37 +00:00
Jonathan Rose b85cb7ea1b app: Add functions to swap voicemail function table for testing purposes
........

Merged revisions 432556 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-06 21:38:36 +00:00
Matthew Jordan 41ba8fd7c0 translate: Prevent invalid memory accesses on fast shutdown
When a 'core restart now' or 'core stop now' is executed and a channel is
currently in a media operation, the translator matrix can be destroyed while a
channel is currently blocked on getting the best translation choice
(see ast_translator_best_choice). When the channel gets the mutex, the
translation matrix now has invalid memory, and Asterisk crashes.

This patch does two things:
(1) We now only clean up the translation matrix on a graceful shutdown. In that
    case, there are no channels, and so there is no risk of this occurring.
(2) We also now set the __matrix and __indextable to NULL. In some initial
    backtraces when this occurred, it looked as if there was a memory corruption
    occurring, and it wasn't until we determined that something had restarted
    Asterisk that the issue became clear. By setting these to NULL on shutdown,
    it becomes a bit easier to determine why a crash is occurring.

Note that we could litter the code with NULL checks on the __matrix, but the
act of making the translation matrix cleaned up on shutdown should preclude
this issue from occurring in the first place, and this part of the code needs
to be as fast as possible.

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

Merged revisions 432453 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-04 18:55:08 +00:00
Richard Mudgett 9e841e4fb6 ARI: Fix crash if integer values used in JSON payload 'variables' object.
Sending the following ARI commands caused Asterisk to crash if the JSON
body 'variables' object passes values of types other than strings.

POST /ari/channels
POST /ari/channels/{channelid}
PUT /ari/endpoints/sendMessage
PUT /ari/endpoints/{tech}/{resource}/sendMessage

* Eliminated RAII_VAR usage in ast_ari_channels_originate_with_id(),
ast_ari_channels_originate(), ast_ari_endpoints_send_message(), and
ast_ari_endpoints_send_message_to_endpoint().

ASTERISK-24751 #close
Reported by:  jeffrey putnam

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

Merged revisions 432404 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-27 18:31:31 +00:00
Scott Griepentrog d79670b269 Dial API: add self destruct option when complete
This patch adds a self-destruction option to the
dial api.  The usefulness of this is mostly when
using async mode to spawn a separate thread used
to handle the new call, while the calling thread
is allowed to go on about other business.

The only alternative to this option would be the
calling thread spawning a new thread, or hanging
around itself waiting to destroy the dial struct
after completion.

Example of use (minus error checking):

  struct ast_dial *dial = ast_dial_create();

  ast_dial_append(dial, "PJSIP", "200", NULL);

  ast_dial_option_global_enable(dial, AST_DIAL_OPTION_ANSWER_EXEC, "Echo");
  ast_dial_option_global_enable(dial, AST_DIAL_OPTION_SELF_DESTROY, NULL);

  ast_dial_run(dial, NULL, 1);

The dial_run call will return almost immediately
after spawning the new thread to run and monitor
the dial.  If the call is answered, it is placed
into the echo app.  When completed, it will call
ast_dial_destroy() on the dial structure.

Note that any allocations made to pass values to
ast_dial_set_user_data() or dial options must be
free'd in a state callback function on any of:
  AST_DIAL_RESULT_UNASWERED,
  AST_DIAL_RESULT_ANSWERED,
  AST_DIAL_RESULT_HANGUP, or 
  AST_DIAL_RESULT_TIMEOUT.

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

Merged revisions 432385 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-26 18:53:36 +00:00
Kevin Harwell d04fbb0f9d app_chanspy, channel: fix frame leaks
Fixed a couple of frame leaks that were found during testing.

ASTERISK-24828 #close
Reported by: John Hardin
Review: https://reviewboard.asterisk.org/r/4445/
........

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

Merged revisions 432363 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-26 17:12:12 +00:00
Matthew Jordan d68012d1a3 channels/sip/sdp_crypto: Handle SRTP keys negotiated with key lifetime/MKI
Prior to this patch, SDP offers negotiating SDES-SRTP crypto attributes would
be rejected if those crypto attributes contained either a key lifetime or a
MKI parameter. While from a theoretical point of view this was defensible -
Asterisk does not support key lifetimes or multiple crypto keys - from a
practical point of view, this is quite a problem. A large number of endpoints
offer lifetimes/MKI, which Asterisk can tolerate so long as it doesn't actually
have to support anything more than a single key or refresh the key.
In reality, this is (so far as we've seen) always the case.

This patch is a forward port of Olle's work in the lingon-srtp-key-lifetime-1.8
branch. To quote Olle from ASTERISK-17721, it handles lifetime/MKI parameters
in the following fashion:

> The Lingon branch now handle lifetime and MKI parameters.
>
> We only accept lifetimes up to max for the crypto and higher than 10 hours
> for packetization of 20 ms (50 pps).
>
> We only handle MKI with index 1.
>
> We do not really bother with counting packets and reinviting at end of
> lifetime, so the min of 10 hours kind of takes care of most calls. If there
> are longer ones, we rely on the other side for re-invites.
>
> It's still not perfect, but I personally think this is an improvement. A
> configuration option for minimum lifetime accepted could be added.

When the patch was ported forward, I decided against adding a configuration
option as Olle's handling was more than sufficient for every case I've seen
come through the issue tracker or through interoperability testing. We can
revisit that decision if it proves to be false.

A few small other tweaks were made to the surrounding code to reduce
indentation and provide better type safety for the 'tag' parameter.

Review: https://reviewboard.asterisk.org/r/4419/
Review: https://reviewboard.asterisk.org/r/4418/

ASTERISK-17721 #close
Reported by: Terry Wilson

ASTERISK-17899 #close
Reported by: Dwayne Hubbard
patches:
  lingon-srtp-key-lifetime-1.8.diff uploaded by oej (License 5267)

ASTERISK-20233
Reported by: tootai

ASTERISK-22748
Reported by: Alejandro Mejia
........

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

Merged revisions 432258 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-25 21:42:39 +00:00
Matthew Jordan a528dfc9a7 ARI/PJSIP: Apply requesting channel's format cap to created channels
This patch addresses the following problems:
* ari/resource_channels: In ARI, we currently create a format capability
  structure of SLIN and apply it to the new channel being created. This was
  originally done when the PBX core was used to create the channel, as there
  was a condition where a newly created channel could be created without any
  formats. Unfortunately, now that the Dial API is being used, this has two
  drawbacks:
  (a) SLIN, while it will ensure audio will flows, can cause a lot of
      needless transcodings to occur, particularly when a Local channel is
      created to the dialplan. When no format capabilities are available, the
      Dial API handles this better by handing all audio formats to the requsted
      channels. As such, we defer to that API to provide the format
      capabilities.
  (b) If a channel (requester) is causing this channel to be created, we
      currently don't use its format capabilities as we are passing in our own.
      However, the Dial API will use the requester channel's formats if none
      are passed into it, and the requester channel exists and has format
      capabilities. This is the "best" scenario, as it is the most likely to
      create a media path that minimizes transcoding.
  Fixing this simply entails removing the providing of the format capabilities
  structure to the Dial API.

* chan_pjsip: Rather than blindly picking the first format in the format
  capability structure - which actually *can* be a video or text format - we
  select an audio format, and only pick the first format if that fails. That
  minimizes the weird scenario where we attempt to transcode between video/audio.

* res_pjsip_sdp_rtp: Applied the joint capapbilites to the format structure.
  Since ast_request already limits us down to one format capability once the
  format capabilities are passed along, there's no reason to squelch it here.

* channel: Fixed a comment. The reason we have to minimize our requested
  format capabilities down to a single format is due to Asterisk's inability
  to convey the format to be used back "up" a channel chain. Consider the
  following:

    PJSIP/A => L;1 <=> L;2 => PJSIP/B
    g,u,a     g,u,a    g,u,a      u

  That is, we have PJSIP/A dialing a Local channel, where the Local;2 dials
  PJSIP/B. PJSIP/A has native format capabilities g722,ulaw,alaw; the Local
  channel has inherited those format capabilities down the line; PJSIP/B
  supports only ulaw. According to these format capabilities, ulaw is
  acceptable and should be selected across all the channels, and no
  transcoding should occur. However, there is no way to convey this: when L;2
  and PJSIP/B are put into a bridge, we will select ulaw, but that is not
  conveyed to PJSIP/A and L;1. Thus, we end up with:

    PJSIP/A <=> L;1 <=> L;2 <=> PJSIP/B
      g          g   X   u        u

  Which causes g722 to be written to PJSIP/B.

  Even if we can convey the 'ulaw' choice back up the chain (which through
  some severe hacking in Local channels was accomplished), such that the chain
  looks like:

    PJSIP/A <=> L;1 <=> L;2 <=> PJSIP/B
      u          u       u         u

  We have no way to tell PJSIP/A's *channel driver* to Answer in the SDP back
  with only 'ulaw'. This results in all the channel structures being set up
  correctly, but PJSIP/A *still* sending g722 and causing the chain to fall
  apart.

  There's a lot of difficulty just in setting this up, as there are numerous
  race conditions in the act of bridging, and no clean mechanism to pass the
  selected format backwards down an established channel chain. As such, the
  best that can be done at this point in time is clarifying the comment.

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

ASTERISK-24812 #close
Reported by: Matt Jordan
........

Merged revisions 432195 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-24 22:00:51 +00:00
Joshua Colp 2ea7ccbf70 http: Add missing html tag to 'httpstatus' functionality.
ASTERISK-24724 #close
Reported by: Ashley Sanders
........

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

Merged revisions 432079 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-21 14:06:20 +00:00
Corey Farrell e66b874f5d Allow shutdown to unload modules that register bucket scheme's or codec's.
* Change __ast_module_shutdown_ref to be NULL safe (11+).
* Allow modules that call ast_bucket_scheme_register or ast_codec_register
  to be unloaded during graceful shutdown only (13+ only).

ASTERISK-24796 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4428/
........

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

Merged revisions 432059 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-21 02:58:19 +00:00
Corey Farrell bb71672a47 main/asterisk.c: Reverse #if statement in listener() to fix code folding.
listener() opens the same code block in two places (#if and #else).  This
confuses some folding editors causing it to think that an extra code block
was opened.  Folding in 'geany' causes all code after listener() to be
folded as if it were part of that procedure.

ASTERISK-24813 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4435/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-21 02:51:35 +00:00
Richard Mudgett 252aee4228 ISDN AOC: Fix crash from an AOC-E message that doesn't have a channel association.
Processing an AOC-E event that does not or no longer has a channel
association causes a crash.

The problem with posting AOC events to the channel topic is that AOC-E
events don't always have a channel association and posting the event to
the all channels topic is just wrong.  AOC-E events do however have their
own charging association method to refer to the agreement with the
charging entity.

* Changed the AOC events to post to the AMI manager topic instead of the
channel topics.  If a channel is associated with the event then channel
snapshot information is supplied with the AMI event.

* Eliminated RAII_VAR() usage in aoc_to_ami() and ast_aoc_manager_event().

This patch supercedes the patch on Review: https://reviewboard.asterisk.org/r/4427/

ASTERISK-22670 #close
Reported by: klaus3000

ASTERISK-24689 #close
Reported by: Marcel Manz

ASTERISK-24740 #close
Reported by: Panos Gkikakis

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

Merged revisions 431974 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-19 18:26:49 +00:00
Matthew Jordan e3fd826cdb tcptls: Handle new OpenSSL compile time option to disable SSLv3
Some distributions are going to disable SSLv3 at compile time. This option can
be checked using the directive OPENSSL_NO_SSL3_METHOD. This patch updates the
TCP/TLS handling in Asterisk to look for that directive before attempting to
use the SSLv3 specific methods.

ASTERISK-24799 #close
Reported by: Alexander Traud
patches:
  no-ssl3-method.patch uploaded by Alexander Traud (License 6520)
........

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

Merged revisions 431937 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-19 15:28:56 +00:00
Corey Farrell a4774ceaa5 Create work around for scheduler leaks during shutdown.
* Added ast_sched_clean_by_callback for cleanup of scheduled events
  that have not yet fired.
* Run all pending peercnt_remove_cb and replace_callno events in chan_iax2.
  Cleanup of replace_callno events is only run 11, since it no longer
  releases any references or allocations in 13+.

ASTERISK-24451 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4425/
........

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

Merged revisions 431917 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-19 02:03:01 +00:00
Joshua Colp 455a98a2f8 sorcery: Output an error message if a wizard is specified for an object type and it isn't found.
ASTERISK-24612 #close
Reported by: Joshua Colp
........

Merged revisions 431771 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-14 19:46:09 +00:00
Richard Mudgett e2d3215b83 HTTP: Stop accepting requests on final system shutdown.
There are three CLI commands to stop and restart Asterisk each.

1) core stop/restart now - Hangup all calls and stop or restart Asterisk.
New channels are prevented while the shutdown request is pending.

2) core stop/restart gracefully - Stop or restart Asterisk when there are
no calls remaining in the system.  New channels are prevented while the
shutdown request is pending.

3) core stop/restart when convenient - Stop or restart Asterisk when there
are no calls in the system.  New calls are not prevented while the
shutdown request is pending.

ARI has made stopping/restarting Asterisk more problematic.  While a
shutdown request is pending it is desirable to continue to process ARI
HTTP requests for current calls.  To handle the current calls while a
shutdown request is pending, a new committed to shutdown phase is needed
so ARI applications can deal with the calls until the system is fully
committed to shutdown.

* Added a new shutdown committed phase so ARI applications can deal with
calls until the final committed to shutdown phase is reached.

* Made refuse new HTTP requests when the system has reached the final
system shutdown phase.  Starting anything while the system is actively
releasing resources and unloading modules is not a good thing.

* Split the bridging framework shutdown to not cleanup the global bridging
containers when shutting down in a hurry.  This is similar to how other
modules prevent crashes on rapid system shutdown.

* Moved ast_begin_shutdown(), ast_cancel_shutdown(), and
ast_shutting_down().  You should not have to include channel.h just to
access these system functions.

ASTERISK-24752 #close
Reported by: Matthew Jordan

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

Merged revisions 431692 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-11 17:39:13 +00:00
Corey Farrell 8cc50b1ebc Enable REF_DEBUG for ast_module_ref / ast_module_unref.
Add ast_module_shutdown_ref for use by modules that can
only be unloaded during graceful shutdown.

When REF_DEBUG is enabled:
* Add an empty ao2 object to struct ast_module.
* Allocate ao2 object when the module is loaded.
* Perform an ao2_ref in each place where mod->usecount is manipulated.
* ao2_cleanup on module unload.

ASTERISK-24479 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4141/
........

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

Merged revisions 431663 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-11 17:03:04 +00:00
Scott Griepentrog 7ca1a0da04 various: cleanup issues found during leak hunt
In this collection of small patches to prevent
Valgrind errors are: fixes for reference leaks
in config hooks, evaluating a parameter beyond
bounds, and accessing a structure after a lock
where it could have been already free'd.

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

Merged revisions 431583 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-06 21:26:46 +00:00
Joshua Colp 03ce56d6c5 sorcery: Don't try to load object types which haven't been defined.
The act of defining wizards for an object type in sorcery.conf will
create a minimal object type. This can cause a problem when a module
has multiple sorcery instances (which all get the wizards from sorcery.conf
applied) but the sorcery instances do not all contain full information
about the object types. Upon loading errors will occur stating that
the objects can not be created. This is confusing and is actually
perfectly fine.

This change makes it so that only object types which have been fully
defined will be loaded.

ASTERISK-24748 #close
Reported by: Joshua Colp
........

Merged revisions 431538 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-02-04 00:59:14 +00:00
Ashley Sanders 6a76740b83 HTTP: For httpd server, need option to define server name for security purposes
Added a new config property [servername] to the http.conf file; updated the http server to use the new property when sending responses, for showing http status through the CLI and when reporting status through the 'httpstatus' webpage. In this version, [servername] is uncommented by default.

ASTERISK-24316 #close
Reported By: Andrew Nagy
Review: https://reviewboard.asterisk.org/r/4374/
........

Merged revisions 431471 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-30 17:21:50 +00:00
Mark Michelson bd0bdf1e41 Fix some memory leaks.
These memory leaks were found and fixed by John Hardin. I'm just
committing them for him.

ASTERISK-24736 #close
Reported by Mark Michelson

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

Merged revisions 431468 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-30 16:49:59 +00:00
Scott Griepentrog 388d691f34 stasis transfer: fix stasis bridge push race part two
When swapping a Local channel in place of one already
in a bridge (to complete a bridge attended transfer),
the channel that was swapped out can actually be hung
up before the stasis bridge push callback executes on
the independant transfer thread.  This results in the
stasis app loop dropping out and removing the control
that has the the app name which the local replacement
channel needs so it can re-enter stasis.

To avoid this race condition a new push_peek callback
has been added, and called from the ast_bridge_impart
thread before it launches the independant thread that
will complete the transfer.  Now the stasis push_peek
callback can copy the stasis app name before the swap
channel can hang up.

ASTERISK-24649
Review: https://reviewboard.asterisk.org/r/4382/
........

Merged revisions 431450 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-29 23:03:14 +00:00
Richard Mudgett 69e107b24e res_pjsip_outbound_registration: Fix reload race condition.
Performing a CLI "module reload" command when there are new pjsip.conf
registration objects defined frequently failed to load them correctly.

What happens is a race condition between res_pjsip pushing its reload into
an asynchronous task processor task and the thread that does the rest of
the reloads when it gets to reloading the res_pjsip_outbound_registration
module.  A similar race condition happens between a reload and the CLI/AMI
show registrations commands.  The reload updates the current_states
container and the CLI/AMI commands call get_registrations() which builds a
new current_states container.

* Made res_pjsip.c reload_module() use ast_sip_push_task_synchronous()
instead of ast_sip_push_task() to eliminate two threads processing config
reloads at the same time.

* Made get_registrations() not replace the global current_states container
so the CLI/AMI show registrations command cannot interfere with reloading.
You could never add/remove objects in the container without the
possibility of the container being replaced out from under you by
get_registrations().

* Added a registration loaded sorcery instance observer to purge any dead
registration objects since get_registrations() cannot do this job anymore.
The struct ast_sorcery_instance_observer callbacks must be used because
the callback happens inline with the load process.  The struct
ast_sorcery_observer callbacks are pushed to a different thread.

* Added some global current_states NULL pointer checks in case the
container disappears because of unload_module().

* Made sorcery's struct ast_sorcery_instance_observer.object_type_loaded
callbacks guaranteed to be called before any struct
ast_sorcery_observer.loaded callbacks will be called.

* Moved the check for non-reloadable objects to before the sorcery
instance loading callbacks happen to short circuit unnecessary work.
Previously with non-reloadable objects, the sorcery instance
loading/loaded callbacks would always happen, the individual wizard
loading/loaded would be prevented, and the non-reloadable type logging
message would be logged for each associated wizard.

ASTERISK-24729 #close
Review: https://reviewboard.asterisk.org/r/4381/
........

Merged revisions 431243 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-28 04:29:23 +00:00
Kevin Harwell c7591ef6bc tcptls: Bad file descriptor error when reloading chan_sip
While running through some scenarios using chan_sip and tcp a problem would
occur that resulted in a flood of bad file descriptor messages on the cli:

tcptls.c:712 ast_tcptls_server_root: Accept failed: Bad file descriptor

The message is received because the underlying socket has been closed, so is
valid. This is probably happening because unloading of chan_sip is not atomic.
That however is outside the scope of this patch. This patch simply stops the
logging of multiple occurrences of that message.

ASTERISK-24728 #close
Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4380/
........

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

Merged revisions 431219 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27 22:58:44 +00:00
Jonathan Rose e826cb8a26 Manager: Fix Manager Action ModuleLoad to give correct response when reloading
Prior to this patch, ModuleLoad would respond with an error indicating that
the requested module wasn't found in spite of finding and reloading the
module.

Review: https://reviewboard.asterisk.org/r/4373/
ASTERISK-24721 #close
........

Merged revisions 431153 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27 19:31:29 +00:00
Kevin Harwell e62bd46511 res_pjsip: make it unloadable (take 2)
Due to the original patch causing memory corruptions it was removed until the
problem could be resolved. This patch is the original patch plus some added
locking around stasis router subcription that was needed to avoid the memory
corruption.

Description of the original problem and patch (still applicable):

The res_pjsip module was previously unloadable. With this patch it can now
be unloaded.

This patch is based off the original patch on the issue (listed below) by Corey
Farrell with a few modifications. Namely, removed a few changes not required to
make the module unloadable and also fixed a bug that would cause asterisk to
crash on unloading.

This patch is the first step (should hopefully be followed by another/others at
some point) in allowing res_pjsip and the modules that depend on it to be
unloadable. At this time, res_pjsip and some of the modules that depend on
res_pjsip cannot be unloaded without causing problems of some sort.

The goal of this patch is to get res_pjsip and only res_pjsip to be able to
unload successfully and/or shutdown without incident (crashes, leaks, etc...).
Other dependent modules may still cause problems on unload.

Basically made sure, with the patch applied, that res_pjsip (with no other
dependent modules loaded) could be succesfully unloaded and Asterisk could
shutdown without any leaks or crashes that pertained directly to res_pjsip.

ASTERISK-24485 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4363/
patches:
  pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
........

Merged revisions 431179 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27 19:12:56 +00:00
Joshua Colp a43d24a9d3 bridge / res_pjsip_sdp_rtp: Fix issues with media not being reinvited during direct media.
This change fixes two issues:

1. During a swap operation bridging added the new channel before having the swap channel
leave. This was not handled in bridge_native_rtp and could result in a channel not getting
reinvited back to Asterisk. After this change the swap channel will leave first and the
new channel will then join.

2. If a re-invite was received after a session had been established any upstream elements
(such as bridge_native_rtp) were not notified that they may want to re-evaluate things.
After this change an UPDATE_RTP_PEER control frame is queued when this situation occurs
and upstream can react.

AST-1524 #close

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

Merged revisions 431157 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-27 17:34:37 +00:00
David M. Lee 965777ccfc Various fixes for OS X
This patch addresses compilation errors on OS X. It's been a while, so
there's quite a few things.

 * Fixed __attribute__ decls in route.h to be portable.
 * Fixed htonll and ntohll to work when they are defined as macros.
 * Replaced sem_t usage with our ast_sem wrapper.
 * Added ast_sem_timedwait to our ast_sem wrapper.
 * Fixed some GCC 4.9 warnings using sig*set() functions.
 * Fixed some format strings for portability.
 * Fixed compilation issues with res_timing_kqueue (although tests still fail
   on OS X).
 * Fixed menuconfig /sbin/launchd detection, which disables res_timing_kqueue
   on OS X).

ASTERISK-24539 #close
Reported by: George Joseph

ASTERISK-24544 #close
Reported by: George Joseph

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

Merged revisions 431092 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-26 14:50:40 +00:00
Matthew Jordan a8ae5a7bcb dynamic realtime: Updates fail to work due to update fields being passed over
When a crash was fixed due to usage of the REALTIME function in r423003, a
regression was introduced into ast_update2_realtime where the update fields
passed to the function would be skipped and the lookup field processed twice.

The use of this function is a bit interesting: A variable argument list is
used with two sentinel values - the first marks the end of the lookup
fields/values; the second marks the end of the update fields/values.
Unfortunately, ast_update2_realtime parses over the lookup fields twice, as
opposed to parsing over the update fields. This causes the lookups to succeed,
but the updates itself to have no effect.

Note that the most common instance of this problem occurred in app_voicemail
during the updating of a mailbox password.

Thanks to the issue reporter, Paddy Grice, for pointing out the problem.

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

ASTERISK-24231

ASTERISK-24626 #close
Reported by: Paddy Grice
........

Merged revisions 431072 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431073 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-25 13:43:07 +00:00
Walter Doekes 49cbfa7de6 Fix typo's (retrieve, specified, address).
........

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

Merged revisions 430998 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-23 15:13:08 +00:00
Richard Mudgett 9bff4eeca3 Bridge core: Pass a ref with the swap channel when joining a bridge.
When code imparts a channel into a bridge to swap with another channel, a
ref needs to be held on the swap channel to ensure that it cannot
dissapear before finding it in the bridge.

* The ast_bridge_join() swap channel parameter now always steals a ref for
the swap channel.  This is the only change to the bridge framework's
public API semantics.

* bridge_channel_internal_join() now requires the bridge_channel->swap
channel to pass in a ref.

ASTERISK-24649
Reported by: John Bigelow

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

Merged revisions 430975 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-22 19:30:12 +00:00
Matthew Jordan 228fdb3f4e main/rtp_engine: Format NTP timestamps as unsigned longs
When the RTCP reports are created, the NTP timestamps are stored as strings,
as JSON does not have an integer type long enough to store the value. However,
on 32-bit systems, a signed long may overflow for some portion of the
timestamp.

This patch corrects the overflow by formatting the timestamps as unsigned
longs.
........

Merged revisions 430840 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-21 13:06:06 +00:00
Mark Michelson 7dc784ffa9 Call extension state callbacks at hint creation.
When a hint gets created, any subsequent device or presence
state changes result in extension status events getting sent
out to interested parties. However, at the time of hint creation,
no such event gets sent out, so watchers of extension state are
potentially left in the dark until the first state change after
hint creation.

Patch contributed by John Hardin (License #6512)
........

Merged revisions 430776 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-19 18:15:03 +00:00
Kevin Harwell 07e2a48ab1 REVERTING res_pjsip: make it unloadable
Due to the original patch causing memory corruptions the patch is
being removed until the problem can be resolved.
........

Merged revisions 430734 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-17 00:35:59 +00:00
Kevin Harwell 49542a794b res_pjsip: make it unloadable
The res_pjsip module was previously unloadable. With this patch it can now
be unloaded.

This patch is based off the original patch on the issue (listed below) by Corey
Farrell with a few modifications. Namely, removed a few changes not required to
make the module unloadable and also fixed a bug that would cause asterisk to
crash on unloading.

This patch is the first step (should hopefully be followed by another/others at
some point) in allowing res_pjsip and the modules that depend on it to be
unloadable. At this time, res_pjsip and some of the modules that depend on
res_pjsip cannot be unloaded without causing problems of some sort.

The goal of this patch is to get res_pjsip and only res_pjsip to be able to
unload successfully and/or shutdown without incident (crashes, leaks, etc...).
Other dependent modules may still cause problems on unload.

Basically made sure, with the patch applied, that res_pjsip (with no other
dependent modules loaded) could be succesfully unloaded and Asterisk could
shutdown without any leaks or crashes that pertained directly to res_pjsip.

ASTERISK-24485 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4311/
patches:
  pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
........

Merged revisions 430628 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-14 23:15:23 +00:00
Richard Mudgett 4dd6b6ff59 AMI: Revert non-backwards compatible changes from earlier commit.
* Reverted the change to astman_send_listack() to not use the listflag
parameter and always set the value to "Start" so the start capitalization
is consistent.  Unfortunately changing the case of a returned value is not
a backward compatible change so for now FAXSessions is going to have to
remain inconsistent with all of the other AMI list actions.

* Reverted the minor protocol error fix in action_getconfig() when no
requested categories are found.  Each line needs to be formatted as
"Header: text".

Caught by the testsuite.

ASTERISK-24049
........

Merged revisions 430528 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 19:13:03 +00:00
Richard Mudgett c7ea108e02 Revert -r430452 It needs to be redone for the next major AMI version change instead.
ASTERISK-24049


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:09:27 +00:00
Matthew Jordan 9065488ddd main/syslog: Allow dynamic logs, such as security events, to log to the syslog
The security event log uses a dynamic log level (SECURITY) that is registered
with the Asterisk logging core. Unfortunately, the syslog would ignore log
statements that had a dynamic log level associated with them. Because the
syslog cannot handle ad hoc dynamic log levels, this patch treats any dynamic
log entries sent to the syslog as logs with a level of NOTICE.

ASTERISK-20744 #close
Reported by: Michael Keuter
Tested by: Michael L. Young, Jacek Konieczny
patches:
  asterisk-20744-syslog-dynamic-logging_trunk.diff uploaded by Michael L. Young (license 5026)
........

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

Merged revisions 430507 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:01:46 +00:00
Scott Griepentrog 5b30938394 app_bridge: return to the next dialplan priority
When app_bridge grabs a channel and puts it into
a bridge, the channel should then continue where
it left off in the dialplan after the bridge has
ended.   Although it stores the current dialplan
location as an after bridge goto on the channel,
it was executing the same priority again instead
of going to the next priority.   By swapping the
"specific" version of bridge_set_after_goto with
bridge_set_after_go_on, the next priority in the
dialplan is executed instead.

ASTERISK-24637 #close
Review: https://reviewboard.asterisk.org/r/4322/
Reported by: John Bigelow
........

Merged revisions 430467 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 21:45:10 +00:00
Richard Mudgett ef34a05f21 AMI: Remove no longer used parameter from astman_send_listack().
Follow-up issue to -r430435 from reviewboard review.

ASTERISK-24049
Review: https://reviewboard.asterisk.org/r/4315/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:53:49 +00:00
Richard Mudgett 52a7cdb101 AMI: Make AMI actions that generate event lists consistent.
* Made the following AMI actions use list API calls for consistency:
Agents
BridgeInfo
BridgeList
BridgeTechnologyList
ConfbridgeLIst
ConfbridgeLIstRooms
CoreShowChannels
DAHDIShowChannels
DBGet
DeviceStateList
ExtensionStateList
FAXSessions
Hangup
IAXpeerlist
IAXpeers
IAXregistry
MeetmeList
MeetmeListRooms
MWIGet
ParkedCalls
Parkinglots
PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowResourceLists
PJSIPShowSubscriptionsInbound
PJSIPShowSubscriptionsOutbound
PresenceStateList
PRIShowSpans
QueueStatus
QueueSummary
ShowDialPlan
SIPpeers
SIPpeerstatus
SIPshowregistry
SKINNYdevices
SKINNYlines
Status
VoicemailUsersList

* Incremented the AMI version to 2.7.0.

* Changed astman_send_listack() to not use the listflag parameter and
always set the value to "Start" so the start capitalization is consistent.
i.e., The FAXSessions used "Start" while the rest of the system used
"start".  The corresponding complete event always used "Complete".

* Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the
AMI ActionID for all of its list events.

* Fixed off-nominal AMI protocol error in manager_bridge_info(),
manager_parking_status_single_lot(), and
manager_parking_status_all_lots().  Use of astman_send_error() after
responding to the original AMI action request violates the action response
pattern by sending two responses.

* Fixed minor protocol error in action_getconfig() when no requested
categories are found.  Each line needs to be formatted as "Header: text".

* Fixed off-nominal memory leak in manager_build_parked_call_string().

* Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail().

ASTERISK-24049 #close
Reported by: Jonathan Rose

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

Merged revisions 430434 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:16:54 +00:00
George Joseph 56de48107f config: Add option to NOT preserve effective context when changing a template
Let's say you have a template T with variable VAR1 = ON and you have a
context C(T) that doesn't specify VAR1.  If you read C, the effective value
of VAR1 is ON.  Now you change T VAR1 to OFF and call
ast_config_text_file_save.  The current behavior is that the file gets
re-written with T/VAR1=OFF but C/VAR1=ON is added.  Personally, I think this
is a bug. It's preserving the effective state of C even though I didn't
specify C/VAR1 in th first place.  I believe the behavior should be that if
I didn't specify C/VAR1 originally, then the effective value of C/VAR1 should
continue to follow the inherited state.  Now, if I DID explicitly specify
C/VAR1, the it should be preserved even if the template changes.

Even though I think the existing behavior is a bug, it's been that way forever
so I'm not changing it.  Instead, I've created ast_config_text_file_save2()
that takes a bitmask of flags, one of which is to preserve the effective context
(the current behavior).  The original ast_config_text_file_save calls *2 with
the preserve flag.  If you want the new behavior, call *2 directly without a
flag.

I've also updated Manager UpdateConfig with a new parameter
'PreserveEffectiveContext' whose default is 'yes'.  If you want the new behavior
with UpdateConfig, set 'PreserveEffectiveContext: no'.

Tested-by: George Joseph

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

Merged revisions 430295 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 16:56:59 +00:00
Kinsey Moore 0c5234f12a Fix dev-mode build on recent gcc
........

Merged revisions 430274 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-07 03:01:39 +00:00
Scott Griepentrog 0b8fbf9238 bridge: avoid leaking channel during blond transfer pt2
A blond transfer to a failed destination, when followed
by a recall attempt, lead to a leak of the reference to
the destination channel.  In addition to correcting the
regression on the previous attempt (r429826) this fixes
the leak and two additional reference leaks on failures
of bridge_import.

ASTERISK-24513 #close
Review: https://reviewboard.asterisk.org/r/4302/
........

Merged revisions 430199 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 430200 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-05 22:50:32 +00:00
Scott Griepentrog 8d059c3808 rtp_engine: keep payload types in correct range
In r428708 additional codecs were added including
a payload type of 128 which is outside of nominal
range of 0-127.  This change moves changes 128 to
96 to avoid causing a pjsip assertion when making
a call to an endpoint configured with allow=all.

ASTERISK-24367 #close
Review: https://reviewboard.asterisk.org/r/4286/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-31 18:54:37 +00:00
Matthew Jordan 3a73c6c90e main/pbx.c: Fix double lock of contexts lock introduced by r429967
We only need to hold the context_merge_lock once. Locking it twice will make
many other parts of Asterisk very sad.

ASTERISK-24641 #close


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-24 16:59:42 +00:00
Richard Mudgett 1c0604e905 DTMF atxfer: Setup recall channels as if the transferee initiated the call.
After the initial DTMF atxfer call attempt to the transfer target fails to
answer during a blonde transfer, the recall callback channels do not get
setup with information from the initial transferrer channel.  As a result,
the recall callback to the transferrer does not have callid, channel
variables, datastores, accountcode, peeraccount, COLP, and CLID setup.  A
similar situation happens with the recall callback to the transfer target
but it is less visible.  The recall callback to the transfer target does
not have callid, channel variables, datastores, accountcode, peeraccount,
and COLP setup.

* Added missing information to the recall callback channels before
initiating the call.  callid, channel variables, datastores, accountcode,
peeraccount, COLP, and CLID

* Set callid of the transferrer channel on the DTMF atxfer controller
thread attended_transfer_monitor_thread().

* Added missing channel unlocks and props unref to off nominal paths in
attended_transfer_properties_alloc().

ASTERISK-23841 #close
Reported by: Richard Mudgett

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

Merged revisions 430034 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 21:20:11 +00:00
Richard Mudgett bbd9ff122e queue_log: Post QUEUESTART entry when Asterisk fully boots.
The QUEUESTART log entry has historically acted like a fully booted event
for the queue_log file.  When the QUEUESTART entry was posted to the log
was broken by the change made by ASTERISK-15863.

* Made post the QUEUESTART queue_log entry when Asterisk fully boots.
This restores the intent of that log entry and happens after realtime has
had a chance to load.

AST-1444 #close
Reported by: Denis Martinez

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

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

Merged revisions 430010 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 20:08:35 +00:00
Matthew Jordan 0c38276d6e presencestate: Allow channel drivers to provide presence state information
This patch adds the ability for channel drivers to supply presence information
in a similar manner to device state. The patch does not provide any channel
driver implementations, but it does provide the core infrastructure necessary
for channel drivers to provide such information.

The core handles multiple providers of presence state information. Ordering
of presence state is as follows:
 INVALID < NOT_SET < AVAILABLE < UNAVAILABLE < CHAT < AWAY < XA < DND

Each provider can trump the previous if it provides a presence state that
supercedes a previous one.

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

ASTERISK-24363 #close
Reported by: Gareth Palmer
patches:
  chan_presencestate-428146.patch uploaded by Gareth Palmer (License 5169)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-22 14:33:24 +00:00
Joshua Colp ba403e83bd acl: Fix reloading of configuration if configuration file does not exist at startup.
The named ACL code incorrectly destroyed the config options information if loading
of the configuration file failed at startup. This would result in reloading
also failing even if a valid configuration file was put in place.

ASTERISK-23733 #close
Reported by: Richard Kenner
........

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

Merged revisions 429894 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-20 20:57:47 +00:00