asterisk/asterisk.git
6 years agocel_pgsql: deadlock on unload and core_event_dispatcher
Kevin Harwell [Tue, 31 Dec 2013 21:39:45 +0000 (21:39 +0000)]
cel_pgsql: deadlock on unload and core_event_dispatcher

A deadlock can happen between a thread unloading or reloading the cel_pgsql
module and the core_event_dispatcher taskprocessor thread. Description of
what is happening:

Thread 1 (for example, a netconsole thread):

    a "module reload cel_pgsql" is launched
    the thread enter the "my_unload_module" function (cel_pgsql.c)
    the thread acquire the write lock on psql_columns
    the thread enter the "ast_event_unsubscribe" function (event.c)
    the thread try to acquire the write lock on ast_event_subs[sub->type]

Thread 2 (core_event_dispatcher taskprocessor thread):

    the taskprocessor pop a CEL event
    the thread enter the "handle_event" function (event.c)
    the thread acquire the read lock on ast_event_subs[sub->type]
    the thread callback the "pgsql_log" function (cel_pgsql.c), since it's a subscriber of CEL events
    the thread try to acquire a read lock on psql_columns

(closes issue ASTERISK-22854)
Reported by: Etienne Lessard
Patches:
     cel_pgsql_fix_deadlock_event.patch uploaded by hexanol (license 6394)
........

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

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

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

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

6 years agores_pjsip_outbound_registration: Add validation for 'server_uri' and 'client_uri'.
Joshua Colp [Tue, 31 Dec 2013 20:27:03 +0000 (20:27 +0000)]
res_pjsip_outbound_registration: Add validation for 'server_uri' and 'client_uri'.

When applying configuration for outbound registrations the 'server_uri' and
'client_uri' fields were not validated. The code will now confirm that they
exist and that they contain parseable SIP URIs.

Reported by: Andrew Nagy
........

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

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

6 years agochannels.c: core show channeltypes slicing
Kevin Harwell [Mon, 30 Dec 2013 23:25:53 +0000 (23:25 +0000)]
channels.c: core show channeltypes slicing

'core show channeltypes' type column is being sliced, resulting in incomplete
type names.

(closes issue ASTERISK-22919)
Reported by: outtolunc
Patches:
     svn_channel.c.format_15.diff.txt uploaded by outtolunc (license 5198)
........

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

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

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

6 years agoAdded note to UPGRADE.txt about the default value of live_dangerously changing
David M. Lee [Tue, 24 Dec 2013 17:12:03 +0000 (17:12 +0000)]
Added note to UPGRADE.txt about the default value of live_dangerously changing
........

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

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

6 years agohttp: Properly reject requests with Transfer-Encoding set
David M. Lee [Tue, 24 Dec 2013 16:50:48 +0000 (16:50 +0000)]
http: Properly reject requests with Transfer-Encoding set

Asterisk does not support any of the transfer encodings specified in
HTTP/1.1, other than the default "identity" encoding.

According to RFC 2616:

   A server which receives an entity-body with a transfer-coding it does
   not understand SHOULD return 501 (Unimplemented), and close the
   connection. A server MUST NOT send transfer-codings to an HTTP/1.0
   client.

This patch adds the 501 Unimplemented response, instead of the hard work
of actually implementing other recordings.

This behavior is especially problematic for Node.js clients, which use
chunked encoding by default.

(closes issue ASTERISK-22486)
Review: https://reviewboard.asterisk.org/r/3092/
........

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

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

6 years agores_pjsip_pubsub: Ensure dialog manipulation happens on proper thread.
Joshua Colp [Tue, 24 Dec 2013 02:20:18 +0000 (02:20 +0000)]
res_pjsip_pubsub: Ensure dialog manipulation happens on proper thread.

When destroying a subscription we remove the serializer from its dialog
and decrease its reference count. Depending on which thread dropped the
subscription reference count to 0 it was possible for this to occur in
a thread where it is not possible.

(closes issue ASTERISK-22952)
Reported by: Matt Jordan
........

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

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

6 years agochan_dahdi: enable ignore_failed_channels by default
Tzafrir Cohen [Mon, 23 Dec 2013 16:38:43 +0000 (16:38 +0000)]
chan_dahdi: enable ignore_failed_channels by default

If ignore_failed_channels is set to "true" for a channel, the channel
will continue to be configured even if configuring it has failed.

This allows Asterisk to start before all the DAHDI initialization is
done and thus not force the starting order dahdi -> asterisk.

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

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

6 years agores_pjsip/pjsip_cli: fix compilation error caused by passing ast_free
Matthew Jordan [Sat, 21 Dec 2013 03:35:04 +0000 (03:35 +0000)]
res_pjsip/pjsip_cli: fix compilation error caused by passing ast_free

When wanting to pass *free as a function pointer, ast_free_ptr has to be used
instead of ast_free. This allows it to be compiled with MALLOC_DEBUG enabled.
........

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

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

6 years agoari: Remove support for specifying channel vars during origination.
David M. Lee [Fri, 20 Dec 2013 22:04:15 +0000 (22:04 +0000)]
ari: Remove support for specifying channel vars during origination.

When we added support for specifying channel variables for an
origination, we didn't consider how that would interact with another
feature, namely specifying request parameters in a JSON request body.

The method of specifying channel variables (as a flat JSON object passed
in the JSON body) interferes with parsing parameters out of the request
body.

Unfortunately, fixing this would be a backward incompatible change. In
the interest of keeping the API sane and keeping our release schedule,
we're dropping the feature for specifying channel variables in the
origination request.

We will bring the feature back soon, as a backward compatible addition
to the API.

(closes issue ASTERISK-23051)
Review: https://reviewboard.asterisk.org/r/3088
........

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

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

6 years agoRemove automerge properties
David M. Lee [Fri, 20 Dec 2013 22:03:43 +0000 (22:03 +0000)]
Remove automerge properties
........

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

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

6 years agores_pjsip: Add PJSIP CLI commands
Matthew Jordan [Fri, 20 Dec 2013 21:32:13 +0000 (21:32 +0000)]
res_pjsip: Add PJSIP CLI commands

Implements the following cli commands:
pjsip list aors
pjsip list auths
pjsip list channels
pjsip list contacts
pjsip list endpoints
pjsip show aor(s)
pjsip show auth(s)
pjsip show channels
pjsip show endpoint(s)

Also...
Minor modifications made to the AMI command implementations to facilitate
reuse.

New function ast_variable_list_sort added to config.c and config.h to implement
variable list sorting.

(issue ASTERISK-22610)
patches:
  pjsip_cli_v2.patch uploaded by george.joseph (License 6322)
........

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

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

6 years agosay.c: correct time for polish
Scott Griepentrog [Fri, 20 Dec 2013 21:18:00 +0000 (21:18 +0000)]
say.c: correct time for polish

In ast_say_date_with_format_pl(), change ast_say_number() to
use tm_sec instead of tm_mn.

(closes issue ASTERISK-22856)
Reported by: Robert Mordec
Review: https://reviewboard.asterisk.org/r/3082/
Patches:
     say.c.patch uploaded by veilen (license 6555)
........

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

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

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

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

6 years agoFix issue where PJSIP blind transferer dialog may not complete as planned.
Mark Michelson [Fri, 20 Dec 2013 20:28:19 +0000 (20:28 +0000)]
Fix issue where PJSIP blind transferer dialog may not complete as planned.

When transferring to a dialplan extension that will not place any outbound
calls, the only control frames that the PJSIP REFER framehook will receive
are inconsequential (such as unhold or srcchange). As such, we shouldn't
allow for the reception of those types of frames prevent us from signaling
to the transferring party that the transfer has completed successfully once
voice frames are read.

Thanks to Jonathan Rose for pointing this out.
........

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

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

6 years agores_stasis_device_state: Set resource type for subscriptions to deviceState
Matthew Jordan [Fri, 20 Dec 2013 20:05:40 +0000 (20:05 +0000)]
res_stasis_device_state: Set resource type for subscriptions to deviceState

The documentation for ARI already specifies that the device state resource when
used for subscribing for events is "deviceState", not "device_state". The code,
however, used "device_state"; although this was inconsistent as well in doxygen
comments in resource_applications.

Because the actual resource being subscribed to is /deviceStates/{device}/, it
makes sense for the resource type specifier to be deviceState.

Note that the key value in the events is still "device_state".
........

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

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

6 years agoao2_iterator: Mini-audit of the ao2_iterator loops in the new code files.
Richard Mudgett [Fri, 20 Dec 2013 20:00:50 +0000 (20:00 +0000)]
ao2_iterator: Mini-audit of the ao2_iterator loops in the new code files.

* Fixed several places where ao2_iterator_destroy() was not called.

* Fixed several iterator loop object variable reference problems.

* Fixed res_parking AMI actions returning non-zero.  Only the AMI logoff
action can return non-zero.

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

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

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

6 years agomanager: bump version to 2.0.0
Matthew Jordan [Fri, 20 Dec 2013 19:25:20 +0000 (19:25 +0000)]
manager: bump version to 2.0.0

AMI has received substantial updates over the past year. Not only has the
syntax been vastly improved and made consistent (which entails many event
changes), but the underlying things that those events convey have changed
substantially as well.

After some conversation in #asterisk-dev, it was agreed that this is a good
time to jump to 2.

At the same time, since ARI will most likely use semantic versioning, we
might as well use that for AMI as well. That also affords us greater meaning
for the AMI version.
........

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

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

6 years agoWhitespace fixes.
Richard Mudgett [Fri, 20 Dec 2013 19:06:57 +0000 (19:06 +0000)]
Whitespace fixes.
........

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

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

6 years agoDocumentation: Updates for info about NAT-related settings and fixes for pjsip.conf...
Rusty Newton [Fri, 20 Dec 2013 17:22:27 +0000 (17:22 +0000)]
Documentation: Updates for info about NAT-related settings and fixes for pjsip.conf.sample

Added another NAT example to pjsip.conf.sample. We had a few mentions of NAT configuration throughout the sample, but I added another for a little bit more clarity.

Additionally many pjsip options were affected by the change to snake case, so I fixed any instances of those options in pjsip.conf.

I regenerated the config option list (at the bottom of the file) from a new xml config doc dump, so all the snake case changes should be reflected there, as well as any other changes to those options.

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

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

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

6 years agosecurity_events: log events with descriptive names
Scott Griepentrog [Thu, 19 Dec 2013 20:48:19 +0000 (20:48 +0000)]
security_events: log events with descriptive names

This patch updates the log messages to include descriptive
names for event types.  This is an improvement over having
only cryptic type numbers.

(closes issue ASTERISK-22909)
Reported by: outtolunc
Review: https://reviewboard.asterisk.org/r/3081/
Patches:
     svn_security_events.c.names.diff.txt uploaded by outtolunc (license 5198)

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

6 years agoPut notice in CHANGES as well as UPGRADE.txt.
Richard Mudgett [Thu, 19 Dec 2013 18:16:41 +0000 (18:16 +0000)]
Put notice in CHANGES as well as UPGRADE.txt.
........

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

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

6 years agores_pjsip: Ignore 401/407 responses for transactions and dialogs we don't know about.
Joshua Colp [Thu, 19 Dec 2013 18:00:33 +0000 (18:00 +0000)]
res_pjsip: Ignore 401/407 responses for transactions and dialogs we don't know about.

Under normal conditions it is unlikely we will ever receive a response for a transaction
or dialog we don't know about but if any are received ignore them.
........

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

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

6 years agores_pjsip_session: Fix SDP negotiation when resending an INVITE with authentication.
Joshua Colp [Thu, 19 Dec 2013 17:55:28 +0000 (17:55 +0000)]
res_pjsip_session: Fix SDP negotiation when resending an INVITE with authentication.

The process for resending an INVITE with authentication involves restarting the UAC
session. We were incorrectly passing in that a new offer is being sent, causing the
SDP negotiation to get into a (technically speaking) funky state.
........

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

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

6 years agoFix a deadlock that occurred due to a conflict of masquerades.
Mark Michelson [Thu, 19 Dec 2013 17:45:21 +0000 (17:45 +0000)]
Fix a deadlock that occurred due to a conflict of masquerades.

For the explanation, here is a copy-paste of the review board explanation:

Initially, it was discovered that performing an attended transfer of a
multiparty bridge with a PJSIP channel would cause a deadlock. A PBX thread
started a masquerade and reached the point where it was calling the fixup()
callback on the "original" channel. For chan_pjsip, this involves pushing a
synchronous task to the session's serializer. The problem was that a task ahead
of the fixup task was also attempting to perform a channel masquerade. However,
since masquerades are designed in a way to only allow for one to occur at a
time, the task ahead of the fixup could not continue until the masquerade
already in progress had completed. And of course, the masquerade in progress
could not complete until the task ahead of the fixup task had completed.
Deadlock.

The initial fix was to change the fixup task to be asynchronous. While this
prevented the deadlock from occurring, it had the frightful side effect of
potentially allowing for tasks in the session's serializer to operate on a
zombie channel.

Taking a step back from this particular deadlock, it became clear that the
problem was not really this one particular issue but that masquerades
themselves needed to be addressed. A PJSIP attended transfer operation calls
ast_channel_move(), which attempts to both set up and execute a masquerade. The
problem was that after it had set up the masquerade, the PBX thread had swooped
in and tried to actually perform the masquerade. Looking at changes that had
been made to Asterisk 12, it became clear that there never is any time now that
anyone ever wants to set up a masquerade and allow for the channel thread to
actually perform the masquerade. Everyone always is calling ast_channel_move(),
performs the masquerade itself before returning.

In this patch, I have removed all blocks of code from channel.c that will
attempt to perform a masquerade if ast_channel_masq() returns true. Now, there
is no distinction between setting up a masquerade and performing the
masquerade. It is one operation. The only remaining checks for
ast_channel_masq() and ast_channel_masqr() are in ast_hangup() since we do not
want to interrupt a masquerade by hanging up the channel. Instead, now
ast_hangup() will wait for a masquerade to complete before moving forward with
its operation.

The ast_channel_move() function has been modified to basically in-line the
logic that used to be in ast_channel_masquerade(). ast_channel_masquerade() has
been killed off for real. ast_channel_move() now has a lock associated with it
that is used to prevent any simultaneous moves from occurring at once. This
means there is no need to make sure that ast_channel_masq() or
ast_channel_masqr() are already set on a channel when ast_channel_move() is
called. It also means the channel container lock is not pulling double duty by
both keeping the container locked and preventing multiple masquerades from
occurring simultaneously.

The ast_do_masquerade() function has been renamed to do_channel_masquerade()
and is now internal to channel.c. The function now takes explicit arguments of
which channels are involved in the masquerade instead of a single channel.
While it probably is possible to do some further refactoring of this method, I
feel that I would be treading dangerously. Instead, all I did was change some
comments that no longer are true after this changeset.

The other more minor change introduced in this patch is to res_pjsip.c to make
ast_sip_push_task_synchronous() run the task in-place if we are already a SIP
servant thread. This is related to this patch because even when we isolate the
channel masquerade to only running in the SIP servant thread, we would still
deadlock when the fixup() callback is reached since we would essentially be
waiting forever for ourselves to finish before actually running the fixup. This
makes it so the fixup is run without having to push a task into a serializer at
all.

(closes issue ASTERISK-22936)
Reported by Jonathan Rose

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

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

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

6 years agoudptl: Dead code elimination. ast_udptl_bridge was not used.
Richard Mudgett [Thu, 19 Dec 2013 17:13:53 +0000 (17:13 +0000)]
udptl: Dead code elimination. ast_udptl_bridge was not used.

Removing dead code starting with ast_udptl_bridge() eliminated the code in
this change.

Note: This code has actually been dead since Asterisk v1.4 when it was
first put in.

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

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

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

6 years agores_fax.c: crash on framehook with no dsp in fax detect
Scott Griepentrog [Thu, 19 Dec 2013 17:03:20 +0000 (17:03 +0000)]
res_fax.c: crash on framehook with no dsp in fax detect

In fax_detect_framehook() a null pointer reference can occur where a
voice frame is processed but no dsp is attached to the fax detection
structure.  The code block that rejects frames that detection cannot
be processed on is checking for dsp but falls through when it should
instead return, as this change implements.

(closes issue ASTERISK-22942)
Reported by: adomjan
Review: https://reviewboard.asterisk.org/r/3076/
........

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

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

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

6 years agoVoicemail: Remove mailbox identifier format (box@context) assumptions in the system.
Richard Mudgett [Thu, 19 Dec 2013 16:52:43 +0000 (16:52 +0000)]
Voicemail: Remove mailbox identifier format (box@context) assumptions in the system.

This change is in preparation for external MWI support.

Removed code from the system for normal mailbox handling that appends
@default to the mailbox identifier if it does not have a context.  The
only exception is the legacy hasvoicemail users.conf option.  The legacy
option will only work for app_voicemail mailboxes.  The system cannot make
any assumptions about the format of the mailbox identifer used by
app_voicemail.

chan_sip and chan_dahdi/sig_pri had the most changes because they both
tried to interpret the mailbox identifier.  chan_sip just stored and
compared the two components.  chan_dahdi actually used the box
information.

The ISDN MWI support configuration options had to be reworked because
chan_dahdi was parsing the box@context format to get the box number.  As a
result the mwi_vm_boxes chan_dahdi.conf option was added and is documented
in the chan_dahdi.conf.sample file.

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

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

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

6 years agoastdb: crash in sqlite3 during shutdown
Scott Griepentrog [Thu, 19 Dec 2013 16:33:09 +0000 (16:33 +0000)]
astdb: crash in sqlite3 during shutdown

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

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

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

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

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

6 years agochannel: Add a missing ast_channel_unlock when allocating a Surrogate channel.
Joshua Colp [Thu, 19 Dec 2013 12:18:52 +0000 (12:18 +0000)]
channel: Add a missing ast_channel_unlock when allocating a Surrogate channel.
........

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

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

6 years agoHandle temporary failures on gk registration
Alexandr Anikin [Thu, 19 Dec 2013 08:35:28 +0000 (08:35 +0000)]
Handle temporary failures on gk registration
Introduce new 'stopped' state for gk client and restart gk client
on failures
Remove ooh323 stack command lock as it is not need now.
(closes issue ASTERISK-21960)
Reported by: Dmitry Melekhov
Patches:
ASTERISK-21960.patch
ASTERISK-21960-stacklockup-2.patch
Tested by: Dmitry Melekhov
........

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

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

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

6 years agoFixup some skinny bugs causing Fracks and ao2 cleanup issues.
Damien Wedhorn [Thu, 19 Dec 2013 02:59:52 +0000 (02:59 +0000)]
Fixup some skinny bugs causing Fracks and ao2 cleanup issues.

Moved channel locking into setsubstate so that a process can complete
working on a sub before another starts changing it. The existing code
was causing some Fracks with schedule deletion.

Removed multiple rtp cleanup. Now only cleansup up once, fixing ao2
object cleanup issues.
........

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

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

6 years agoapp_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state
Matthew Jordan [Thu, 19 Dec 2013 00:50:01 +0000 (00:50 +0000)]
app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state

When doing the rework of the CDR engine that pushed all of the logic into cdr.c
and made it respond to changes in channel state over Stasis, we knew that
accessing the CDR engine from the dialplan would be "slightly"
non-deterministic. Dialplan threads would be accessing CDRs while Stasis
threads would be updating the state of said CDRs - whereas in the past,
everything happened on the dialplan threads. Tests have shown that "slightly"
is in reality "very".

This patch synchronizes things by making the dialplan applications/functions
that manipulate CDRs do so over Stasis. ForkCDR, NoCDR, ResetCDR, CDR, and
CDR_PROP now all use Stasis to send their requests over to the CDR engine,
and synchronize on the channel Stasis topic via a subscription so that they
return their values/control to the dialplan at the appropriate time.

While going through this, the following changes were also made:
 * DISA, which can reset the CDR when a user successfully authenticates, now
   just uses the ResetCDR app to do this. This prevents having to duplicate
   the same Stasis synchronization logic in that application.
 * Answer no longer disables CDRs. It actually didn't work anyway - calling
   DISABLE on the channel's CDR doesn't stop the CDR from getting the Answer
   time - it just kills all CDRs on that channel, which isn't what the caller
   would intend.

(closes issue ASTERISK-22884)
(closes issue ASTERISK-22886)

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

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

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

6 years agoFixup skinny registration following network issues.
Damien Wedhorn [Thu, 19 Dec 2013 00:32:00 +0000 (00:32 +0000)]
Fixup skinny registration following network issues.

On session registration, if device is already reporting that it is
connected to a device, an innocuous packet (update time) is sent to
the already connected device. If the tcp connection is down, the
device will be unregistered and the new connection allowed.

Without this patch, network issues can see a situation where a device
can not reregister until after 3*timeout.
........

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

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

6 years agoAdd AMI event for presence state.
Jason Parker [Wed, 18 Dec 2013 23:00:03 +0000 (23:00 +0000)]
Add AMI event for presence state.

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

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

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

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

6 years agoooh323c: Fix gcc 4.6.3 compiler warnings.
Richard Mudgett [Wed, 18 Dec 2013 21:12:58 +0000 (21:12 +0000)]
ooh323c: Fix gcc 4.6.3 compiler warnings.
........

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

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

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

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

6 years agochan_oss.c: channel being locked twice and unlocked once
Kevin Harwell [Wed, 18 Dec 2013 20:48:49 +0000 (20:48 +0000)]
chan_oss.c: channel being locked twice and unlocked once

Removed channel lock as it is now being down in ast_channel_alloc
........

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

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

6 years agochannel locking: Add locking for channel snapshot creation
Kevin Harwell [Wed, 18 Dec 2013 20:33:37 +0000 (20:33 +0000)]
channel locking: Add locking for channel snapshot creation

Original commit message by mmichelson (asterisk 12 r403311):

"This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such."

The above was initially committed and then reverted at r403398.  The problem
was found to be in core_local.c in the publish_local_bridge_message function.
The ast_unreal_lock_all function locks and adds a reference to the returned
channels and while they were being unlocked they were not being unreffed when
no longer needed.  Fixed by unreffing the channels.

Also in bridge.c a lock was obtained on "other->chan", but then an attempt was
made to unlock "other" and not the previously locked channel.  Fixed by
unlocking "other->chan"

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

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

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

6 years agoIntroduce new config option 'aniasdni'. If yes then asterisk set dialed number as...
Alexandr Anikin [Wed, 18 Dec 2013 19:36:39 +0000 (19:36 +0000)]
Introduce new config option 'aniasdni'. If yes then asterisk set dialed number as own id back to the caller
on incoming h.323 calls. Option can be set globally or per user section.

(closes issue ASTERISK-22020)
Reported by: Ross Beer

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

6 years agochannels: Return allocated channels locked.
Joshua Colp [Wed, 18 Dec 2013 19:28:05 +0000 (19:28 +0000)]
channels: Return allocated channels locked.

This change makes ast_channel_alloc return allocated channels
locked. By doing so no other thread can acquire, lock, and manipulate
the channel before it is completely set up.

(closes issue AST-1256)

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

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

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

6 years agoImplement module reload command for chan_ooh323
Alexandr Anikin [Wed, 18 Dec 2013 19:10:42 +0000 (19:10 +0000)]
Implement module reload command for chan_ooh323

(close issue ASTERISK-22817)

Patches:
ooh323_module_reload.patch

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

6 years agoari: Bump the version of ARI to 1.0.0
Matthew Jordan [Wed, 18 Dec 2013 12:46:04 +0000 (12:46 +0000)]
ari: Bump the version of ARI to 1.0.0

(closes issue ASTERISK-23007)
........

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

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

6 years agores_calendar: Protect channel when adding datastore.
Joshua Colp [Wed, 18 Dec 2013 12:01:46 +0000 (12:01 +0000)]
res_calendar: Protect channel when adding datastore.

This change adds a missing channel lock when adding a datastore
to a channel.
........

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

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

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

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

6 years agofunc_strings: Documentation fix for QUOTE()
Rusty Newton [Wed, 18 Dec 2013 00:36:54 +0000 (00:36 +0000)]
func_strings: Documentation fix for QUOTE()

Example output was inaccurate.

(issue ASTERISK-22970)
(closes issue ASTERISK-22970)
Reported by: Gareth Palmer
Patches:
   func_strings.patch uploaded by Gareth Palmer (license 5169)
........

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

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

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

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

6 years agoLICENSE: Update language to include ARI
Matthew Jordan [Wed, 18 Dec 2013 00:17:15 +0000 (00:17 +0000)]
LICENSE: Update language to include ARI
........

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

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

6 years agotests: fix ast_bridge_base_new calls not using the additional arguments
Jonathan Rose [Tue, 17 Dec 2013 23:57:52 +0000 (23:57 +0000)]
tests: fix ast_bridge_base_new calls not using the additional arguments

r404042 gave ast_bridge_base_new two new arguments for setting a bridge creator
and name. Unfortunately since a couple test modules aren't compiled by default,
I missed the fact that this change impacted those tests and caused compilation
failures against them.
........

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

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

6 years agoSeveral components: fixing Typos in comments and code, "avaliable" instead of "available"
Rusty Newton [Tue, 17 Dec 2013 23:38:02 +0000 (23:38 +0000)]
Several components: fixing Typos in comments and code, "avaliable" instead of "available"

(issue ASTERISK-23021)
(closes issue ASTERISK-23021)
Reported by: Jeremy Lainé
Tested by: Rusty Newton
Patches:
   available.patch uploaded by Jeremy Lainé (license 6561)
........

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

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

6 years agobridging: Give bridges a name and a known creator
Jonathan Rose [Tue, 17 Dec 2013 23:25:49 +0000 (23:25 +0000)]
bridging: Give bridges a name and a known creator

Bridges have two new optional properties, a creator and a name.
Certain consumers of bridges will automatically provide bridges that
they create with these properties. Examples include app_bridgewait,
res_parking, app_confbridge, and app_agent_pool. In addition, a name
may now be provided as an argument to the POST function for creating
new bridges via ARI.

(closes issue AFS-47)
Review: https://reviewboard.asterisk.org/r/3070/
........

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

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

6 years agores_sorcery_config: Output an error message when an object can't be created.
Joshua Colp [Tue, 17 Dec 2013 18:35:39 +0000 (18:35 +0000)]
res_sorcery_config: Output an error message when an object can't be created.

If object creation fails an error message will now be output with the id, type,
and configuration file.
........

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

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

6 years agoframehooks: Re-iterate if framehook provides different frame.
Joshua Colp [Tue, 17 Dec 2013 18:26:09 +0000 (18:26 +0000)]
framehooks: Re-iterate if framehook provides different frame.

Framehooks can be used in a reactive manner to execute specific logic
when a frame is received with a certain type and payload. Since it is
possible for framehooks to provide frames it was possible for this
reactive framehook to be unaware of frames it is looking for.

This change makes it so that when framehooks return a modified frame
the code will now re-iterate (from the beginning) and call any
previous framehooks that have not provided a modified frame themselves.

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

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

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

6 years agoChanged the default for live_dangerously to no
David M. Lee [Tue, 17 Dec 2013 14:41:59 +0000 (14:41 +0000)]
Changed the default for live_dangerously to no
........

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

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

6 years agoSetting svn:ignore
David M. Lee [Tue, 17 Dec 2013 14:41:28 +0000 (14:41 +0000)]
Setting svn:ignore
........

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

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

6 years agoBlocked revisions 403779-403780
David M. Lee [Tue, 17 Dec 2013 14:35:35 +0000 (14:35 +0000)]
Blocked revisions 403779-403780

........
Multiple revisions 403779-403780

........
  r403779 | rmudgett | 2013-12-13 13:48:05 -0600 (Fri, 13 Dec 2013) | 12 lines

  app_voicemail: Voicemail callback registration/unregistration function improvements.

  * The voicemail registration/unregistration functions now take a struct of
  callbacks instead of a lengthy parameter list of callbacks.

  * The voicemail registration/unregistration functions now prevent a
  competing module from interfering with an already registered callback
  supplying module.
  ........

  Merged revisions 403643 from http://svn.asterisk.org/svn/asterisk/trunk
........
  r403780 | rmudgett | 2013-12-13 13:55:31 -0600 (Fri, 13 Dec 2013) | 8 lines

  test_voicemail_api: Add check for a registered voicemail provider before tests.

  It is much nicer diagnosing a test failure if app_voicemail is actually
  loaded.
  ........

  Merged revisions 403726 from http://svn.asterisk.org/svn/asterisk/trunk

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

6 years agoari/resource_channels: When creating a channel, specify a default format (SLIN)
Matthew Jordan [Tue, 17 Dec 2013 12:59:49 +0000 (12:59 +0000)]
ari/resource_channels: When creating a channel, specify a default format (SLIN)

When creating channels via ARI, the current code fails to provide any default
format capabilities. For non-virtual channels this isn't really a problem -
the channels typically receive their capabilities as a result of the
underlying channel driver configuration. For virtual channels (such as Local
channels), the lack of any format capabilities causes the Asterisk core to
make some 'odd' choices with respect to the translation paths. The issue
reporter had some paths that had 3 hops on each channel leg, causing multiple
transcodings and some really crappy audio/performance.

By specifying a baseline of SLIN, we prevent that from occurring. Note that
this is what AMI does when it performs an Originate, as does res_clioriginate.

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

(issue ASTERISK-22962)
Reported by: Matt DiMeo
........

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

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

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

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

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

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

Also, the ABI was changed to something more reasonable, since Asterisk
12 does not yet have a public release.

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

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

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

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

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

6 years agotransfers: Fix bug setting both BLINDTRANSFER and ATTENDEDTRANSFER
Jonathan Rose [Mon, 16 Dec 2013 18:31:12 +0000 (18:31 +0000)]
transfers: Fix bug setting both BLINDTRANSFER and ATTENDEDTRANSFER

The ast_bridge_set_transfer_variables function is supposed to wipe whichever
variable isn't being set. Instead it was setting both to the new value.  Oops.

(issue AFS-24)
........

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

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

6 years agopbx.c: put copy of ast_exten.data on stack to prevent memory corruption
Scott Griepentrog [Mon, 16 Dec 2013 16:12:44 +0000 (16:12 +0000)]
pbx.c: put copy of ast_exten.data on stack to prevent memory corruption

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

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

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

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

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

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

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

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

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

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

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

6 years agopjsip/dialplan_functions: Use the right buffer length when printing URIs
Matthew Jordan [Sun, 15 Dec 2013 01:39:20 +0000 (01:39 +0000)]
pjsip/dialplan_functions: Use the right buffer length when printing URIs

While entertaining, sizeof(buflen) is not the same as buflen. Doh.
........

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

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

6 years agores_pjsip: Apply outbound proxy to all SIP requests.
Joshua Colp [Sat, 14 Dec 2013 17:28:21 +0000 (17:28 +0000)]
res_pjsip: Apply outbound proxy to all SIP requests.

Objects which are involved in SIP request creation and sending
now allow an outbound proxy to be specified. For cases where
an endpoint is used the outbound proxy specified there will
be applied.

(closes issue ASTERISK-22673)
Reported by: Antti Yrjola

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

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

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

6 years agores_stasis: Expose event for call forwarding and follow forwarded channel.
Joshua Colp [Sat, 14 Dec 2013 17:19:41 +0000 (17:19 +0000)]
res_stasis: Expose event for call forwarding and follow forwarded channel.

This change adds an event for when an originated call is redirected to
another target. This event contains the original channel and the newly
created channel. If a stasis subscription exists on the original originated
channel for a stasis application then a new subscription will also be
created on the stasis application to the redirected channel. This allows
the application to follow the call path completely.

(closes issue ASTERISK-22719)
Reported by: Joshua Colp

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

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

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

6 years agodocumentation: Add PJSIP technology to messaging documentation
Jonathan Rose [Fri, 13 Dec 2013 21:35:50 +0000 (21:35 +0000)]
documentation: Add PJSIP technology to messaging documentation
........

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

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

6 years agotest.c: Fix too sticky unit test failed status.
Richard Mudgett [Fri, 13 Dec 2013 20:17:22 +0000 (20:17 +0000)]
test.c: Fix too sticky unit test failed status.

Rerunning a failed unit test after loading any required modules should
allow the test to report a pass status if it now passes.
........

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

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

6 years agoTransfers: Make Asterisk set ATTENDEDTRANSFER/BLINDTRANSFER more reliably
Jonathan Rose [Fri, 13 Dec 2013 20:13:22 +0000 (20:13 +0000)]
Transfers: Make Asterisk set ATTENDEDTRANSFER/BLINDTRANSFER more reliably

There were still a few cases in which ATTENDEDTRANSFER and BLINDTRANSFER
wouldn't be set on channels involved with blind and attended transfers.
This would happen with features that were initialized by channel driver
specific mechanisms in multiparty calls. This patch resolves those cases
while attempted to keep the behavior for setting those variables as
consistent as possible.

(closes issue AFS-24)
Review: https://reviewboard.asterisk.org/r/3040/
........

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

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

6 years agobridge_native_rtp: Deadlock during 4-way conference creation
Kevin Harwell [Fri, 13 Dec 2013 18:33:25 +0000 (18:33 +0000)]
bridge_native_rtp: Deadlock during 4-way conference creation

The change contains a slightly adjusted patch that was on the issue
(submitted by kmoore).  A fix was made by adding in a bridge lock
while calling bridge_start/stop from the framehook callback.  Since
the framehook callback is not called from the bridging core the bridge
is not locked, but needs to be before calling bridge_start.

(closes issue ASTERISK-22749)
Reported by: Kinsey Moore
Review: https://reviewboard.asterisk.org/r/3066/
Patches:
     lock_inversion.diff uploaded by kmoore (license 6273)
........

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

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

6 years agoARI: Allow specifying channel variables during a POST /channels
Kevin Harwell [Fri, 13 Dec 2013 17:19:23 +0000 (17:19 +0000)]
ARI: Allow specifying channel variables during a POST /channels

Added the ability to specify channel variables when creating/originating a
channel in ARI.  The variables are sent in the body of the request and should
be formatted as a single level JSON object.  No nested objects allowed.
For example: {"variable1": "foo", "variable2": "bar"}.

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

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

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

6 years agoARI: Adding a channel to a bridge while a live recording is active blocks
Kevin Harwell [Fri, 13 Dec 2013 16:38:57 +0000 (16:38 +0000)]
ARI: Adding a channel to a bridge while a live recording is active blocks

Added the ability to have rules that are checked when adding and/or removing
channels to/from a bridge.  In this case, if a channel is currently recording
and someone attempts to add it to a bridge an "is recording" rule is checked,
fails, and a 409 conflict is returned.

Also command functions now return an integer value that can be descriptive of
what kind of problems, if any, occurred before or during execution.

(closes issue ASTERISK-22624)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2947/
........

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

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

6 years agochannels/Makefile: clean pjsip directory
Matthew Jordan [Fri, 13 Dec 2013 05:00:53 +0000 (05:00 +0000)]
channels/Makefile: clean pjsip directory
........

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

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

6 years agotest_voicemail_api: Add check for a registered voicemail provider before tests.
Richard Mudgett [Fri, 13 Dec 2013 00:40:49 +0000 (00:40 +0000)]
test_voicemail_api: Add check for a registered voicemail provider before tests.

It is much nicer diagnosing a test failure if app_voicemail is actually
loaded.

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

6 years agorealtime: Create extensions in alembic ast-db-manage contribution
Scott Griepentrog [Thu, 12 Dec 2013 19:46:54 +0000 (19:46 +0000)]
realtime: Create extensions in alembic ast-db-manage contribution

When the alembic scripts were written for creating Asterisk
realtime databases the extensions table for dialplan wasn't
included.  This update creates the extensions table.

(closes issue ASTERISK-22815)
Reported by: Zone Conkle
Review: https://reviewboard.asterisk.org/r/3064/
........

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

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

6 years agochan_pjsip: Revert r403587
Jonathan Rose [Thu, 12 Dec 2013 19:18:06 +0000 (19:18 +0000)]
chan_pjsip: Revert r403587

This patch was intended to eliminate a deadlock that occurs when
masquerades occur in pjsip channels, but has some potential side
effects. Mark Michelson is currently working on addressing this
problem from another angle.

(issue ASTERISK-22936)
Reported by: Jonathan Rose
........

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

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

6 years agores_pjsip_messaging: send message to a default outbound endpoint
Kevin Harwell [Wed, 11 Dec 2013 20:24:50 +0000 (20:24 +0000)]
res_pjsip_messaging: send message to a default outbound endpoint

In some cases messages need to be sent to a direct URI (sip:<ip address>). This
patch adds in that support by using a default outbound endpoint.  When sending
messages, if no endpoint can be found then the default one is used.

To facilitate this a new default_outbound_endpoint option was added to the
globals section for pjsip.conf.

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

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

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

6 years agoReset peer outboundproxy on sip.conf reload
Russell Bryant [Wed, 11 Dec 2013 19:22:05 +0000 (19:22 +0000)]
Reset peer outboundproxy on sip.conf reload

If you set a peer's outboundproxy and then removed it from the config,
this would not get picked up in a config reload.  This patch fixes that
by resetting it in set_peer_defaults().

Closes ASTERISK-19454
Review: https://reviewboard.asterisk.org/r/3065/
........

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

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

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

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

6 years agoapp_voicemail: Voicemail callback registration/unregistration function improvements.
Richard Mudgett [Wed, 11 Dec 2013 19:19:24 +0000 (19:19 +0000)]
app_voicemail: Voicemail callback registration/unregistration function improvements.

* The voicemail registration/unregistration functions now take a struct of
callbacks instead of a lengthy parameter list of callbacks.

* The voicemail registration/unregistration functions now prevent a
competing module from interfering with an already registered callback
supplying module.

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

6 years agofunc_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip
Matthew Jordan [Wed, 11 Dec 2013 13:06:30 +0000 (13:06 +0000)]
func_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip

This patch adds CHANNEL read support for chan_pjsip. This allows the dialplan
to use the CHANNEL function on a chan_pjsip channel to obtain run-time
information about the channel from the PJSIP channel driver and the PJSIP
stack. This includes:
 * RTP information, including source/destination media addresses, whether or
   not the media is secure, held, and other properties.
 * RTCP information. This includes sets of parseable information, as well as
   individual statistic attriutes.
 * PJSIP information. This includes URIs, local/remote signalling addresses,
   whether or not the signalling is secure, and other properties.
 * The endpoint name. This can be used in conjunction with the PJSIP_ENDPOINT
   function to obtain more detailed endpoint information.

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

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

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

6 years agofunc_pjsip_endpoint: Add PJSIP_ENDPOINT function for querying endpoint details
Matthew Jordan [Wed, 11 Dec 2013 12:31:57 +0000 (12:31 +0000)]
func_pjsip_endpoint: Add PJSIP_ENDPOINT function for querying endpoint details

This patch adds a new function, PJSIP_ENDPOINT, which lets the dialplan query,
for any endpoint, any property configured on an endpoint. This function is a
companion to the CHANNEL function, which can be used to extract the endpoint
name for a channel.

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

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

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

6 years agoFix correct authentication behavior for artificial endpoint.
Mark Michelson [Tue, 10 Dec 2013 15:15:13 +0000 (15:15 +0000)]
Fix correct authentication behavior for artificial endpoint.

When switching to using a vector for authentication, I initialized
the vector for the artificial endpoint to be of size 1. However, this
does not result in AST_VECTOR_SIZE() returning 1 since there isn't
actually anything in the vector.

Rather than trifle with the vector by putting unnecessary elements in,
I simply changed the callback in res_pjsip_authenticator_digest.c to
explicitly report that the artificial endpoint requires authentication.

Thanks to Joshua Colp for pointing this out.

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

6 years agochan_pjsip: Fix a sticking channel lock caused by channel masquerades
Jonathan Rose [Mon, 9 Dec 2013 22:59:14 +0000 (22:59 +0000)]
chan_pjsip: Fix a sticking channel lock caused by channel masquerades

(closes issue ASTERISK-22936)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/3042/
........

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

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

6 years agoapp_page: Add predial handlers for app_page.
Jonathan Rose [Mon, 9 Dec 2013 22:17:14 +0000 (22:17 +0000)]
app_page: Add predial handlers for app_page.

(closes issue AFS-14)
Review: https://reviewboard.asterisk.org/r/3045/

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

6 years agoReverting regex part of -r403545 at request of file.
Richard Mudgett [Mon, 9 Dec 2013 19:24:58 +0000 (19:24 +0000)]
Reverting regex part of -r403545 at request of file.

res_sorcery_astdb.c: Fix get multiple records by regex.

* Fix sorcery_astdb_retrieve_regex() pattern matching.  Let the regexec()
function match the stored key values instead of having astdb prefilter
them.  Previoiusly you could only use a simple regex pattern when the
pattern began with '^'.
........

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

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

6 years agores_sorcery_astdb.c: Fix get multiple records by regex.
Richard Mudgett [Mon, 9 Dec 2013 18:50:20 +0000 (18:50 +0000)]
res_sorcery_astdb.c: Fix get multiple records by regex.

* Fix sorcery_astdb_retrieve_regex() pattern matching.  Let the regexec()
function match the stored key values instead of having astdb prefilter
them.  Previoiusly you could only use a simple regex pattern when the
pattern began with '^'.

* Fix off nominal memory leak in sorcery_astdb_retrieve_regex().
........

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

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

6 years agosorcery: Eliminate shadowing a varaible that caused confusion.
Richard Mudgett [Mon, 9 Dec 2013 18:32:57 +0000 (18:32 +0000)]
sorcery: Eliminate shadowing a varaible that caused confusion.

* Eliminated shadowing of the __ast_sorcery_apply_config() name parameter
causing confusion.

* Fix potential crash from sorcery.conf user input in
__ast_sorcery_apply_config() if the user supplied a malformed config line
that is missing the sorcery object type name.

* Remove redundant test in __ast_sorcery_apply_config().  !config and
config == CONFIGS_STATUS_FILEMISSING are identical.
........

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

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

6 years agoendpoints: Keep a reference to channel ids when creating snapshot.
Joshua Colp [Mon, 9 Dec 2013 18:32:02 +0000 (18:32 +0000)]
endpoints: Keep a reference to channel ids when creating snapshot.

The snapshot process for endpoints uses the channel ids present
on the endpoint itself. Without keeping a reference it was possible
for the strings to be freed underneath any consumer of an endpoint
snapshot.

A reference is now held by the snapshot to the channel ids and
released when the snapshot is destroyed.

(issue ASTERISK-22801)
Reported by: Matt Jordan
........

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

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

6 years agosorcery: Whitespace
Richard Mudgett [Mon, 9 Dec 2013 18:14:41 +0000 (18:14 +0000)]
sorcery: Whitespace

You would think that a new file would start off without any whitespace
oddities.
........

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

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

6 years agoAdd a CONFBRIDGE_RESULT channel variable to discern why a channel left a ConfBridge.
Mark Michelson [Mon, 9 Dec 2013 17:29:48 +0000 (17:29 +0000)]
Add a CONFBRIDGE_RESULT channel variable to discern why a channel left a ConfBridge.

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

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

6 years agoCreate function for retrieving Mixmonitor instance data.
Mark Michelson [Mon, 9 Dec 2013 16:42:59 +0000 (16:42 +0000)]
Create function for retrieving Mixmonitor instance data.

For the time, this is only useful for retrieving the filename.

The purpose of this function is to better facilitate multiple
mixmonitors per channel. Setting a MIXMONITOR_FILENAME channel
variable is not conducive to such behavior, so allowing finer
grained access to individual mixmonitor properties improves
the situation. The MIXMONITOR_FILENAME channel variable is still
set, though, so there is no worry about backwards compatibility.

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

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

6 years agores_pjsip_nat: Add NAT module to session dialogs.
Joshua Colp [Mon, 9 Dec 2013 16:41:43 +0000 (16:41 +0000)]
res_pjsip_nat: Add NAT module to session dialogs.

Due to the way pjproject internally works it was possible for the
NAT module to not be invoked on messages with-in a session dialog.
This means that the various parts of the message would not get rewritten
with the source IP address and port.

This change uses a session supplement to add the NAT module
to the dialog on the first incoming or outgoing INVITE.

(closes issue ASTERISK-22941)
Reported by: Leif Madsen
........

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

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

6 years agoSwitch PJSIP auth to use a vector.
Mark Michelson [Mon, 9 Dec 2013 16:10:05 +0000 (16:10 +0000)]
Switch PJSIP auth to use a vector.

Since Asterisk has a vector API now, places where arrays are manually
resized don't really make sense any more. Since the auth work in PJSIP
was freshly-written, it was easy to reform it to use a vector.

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

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

6 years agores_fax_spandsp: Always init T.38 session to avoid crashes during state change
Matthew Jordan [Mon, 9 Dec 2013 03:21:56 +0000 (03:21 +0000)]
res_fax_spandsp: Always init T.38 session to avoid crashes during state change

Prior to this patch, res_fax_spandsp was conservative with how it initialized
the spandsp T.38 context. It would only initialize it if the driver thought
the current state was a T.38 fax. While this works fine in nominal situations,
in certain off nominal situations, res_fax_spandsp can believe that a T.38
fax will not occur when in fact one has started. In particular, this was
discovered when res_fax would fall back to audio after timing out on a T.38
upgrade. The SIP channel driver would continue to retry the re-INVITE and -
if the remote end responded after res_fax timed out with a 200 OK - a T.38
frame would be delivered to the res_fax stack when it no longer expected it.

As it turns out, there does not appear to be any downside to always
initializing the T.38 context, other than the actual memory allocation.
Since that avoids this off nominal situation (and others which are equally
likely hard to predict), this is the safest way to avoid this problem.

Much thanks to Torrey as well for providing a scenario that reproduces this
issue.

(closes issue ASTERISK-21242)
Reported by: Ashley Winters
Tested by: Torrey Searle
patches:
  always-init-t38.patch uploaded by awinters (License 6477)
  A_PARTY.xml uploaded by tsearle (License 5334)
........

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

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

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

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

6 years agores_config_sqlite: Check for CDR unregistration failures
Matthew Jordan [Sun, 8 Dec 2013 05:59:46 +0000 (05:59 +0000)]
res_config_sqlite: Check for CDR unregistration failures

If the CDR unregistration fails due to an inflight CDR, the
res_config_sqlite module needs to bail on unloading itself. Otherwise,
the config could be unloaded (including the CDR table name) while the
CDR engine posts a CDR to the still registered backend, resulting in
a crash.
........

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

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

6 years agoapp_record: Add an option that allows DTMF '0' to act as an additional terminator
Jonathan Rose [Thu, 5 Dec 2013 23:40:38 +0000 (23:40 +0000)]
app_record: Add an option that allows DTMF '0' to act as an additional terminator

Using this terminator when active results in ${RECORD_STATUS} being set to
'OPERATOR' instead of 'DTMF'

(closes issue AFS-7)

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

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

6 years agoReverting r403311. It's causing ARI tests to hang.
David M. Lee [Thu, 5 Dec 2013 22:10:20 +0000 (22:10 +0000)]
Reverting r403311. It's causing ARI tests to hang.
........

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

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

6 years agoari: Fix deadlock problem with functions that use autoservice.
David M. Lee [Thu, 5 Dec 2013 22:09:20 +0000 (22:09 +0000)]
ari: Fix deadlock problem with functions that use autoservice.

The code for getting channel variables from ARI assumed that you needed
to lock the channel in order to properly execute functions and read
channel variables. Apparently, this is not the case, since any dialplan
function that puts the channel into autoservice deadlocks when
attempting to remove the channel from autoservice.
........

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

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

6 years agoMultiple revisions 403304,403310
David M. Lee [Thu, 5 Dec 2013 22:08:30 +0000 (22:08 +0000)]
Multiple revisions 403304,403310

........
  r403304 | dlee | 2013-12-02 12:34:50 -0600 (Mon, 02 Dec 2013) | 1 line

  Fixed the filename for the ari.conf docs
........
  r403310 | file | 2013-12-03 10:32:12 -0600 (Tue, 03 Dec 2013) | 5 lines

  Revert revision 403304: Fixed the filename for the ari.conf docs

  The changed value refers to the name of the module. The name of the
  configuration file is specified in the configFile section.
........

Merged revisions 403304,403310 from http://svn.asterisk.org/svn/asterisk/branches/12

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

6 years agoBlocked revisions 403291
David M. Lee [Thu, 5 Dec 2013 22:07:46 +0000 (22:07 +0000)]
Blocked revisions 403291

........
remove unwanted property svn:mergeinfo

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

6 years agores_pjsip_registrar: undefined function pointer symbol
Kevin Harwell [Wed, 4 Dec 2013 21:42:39 +0000 (21:42 +0000)]
res_pjsip_registrar: undefined function pointer symbol

Used a static wrapper around the offending function to alleviate the issue.

Reported by: rmudgett
........

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

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

6 years agores_pjsip_t38: Don't pass T.38 control frames through to other hooks.
Joshua Colp [Wed, 4 Dec 2013 20:54:52 +0000 (20:54 +0000)]
res_pjsip_t38: Don't pass T.38 control frames through to other hooks.

This crept up during gateway testing where the gateway would receive
the request to negotiate and assume it came from the remote side, causing
the gateway state machine to go a little, to a use a technical term,
"wonky".
........

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

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

6 years agoInitialize the hash value argument to pj_hash_get() to 0.
Mark Michelson [Wed, 4 Dec 2013 18:41:01 +0000 (18:41 +0000)]
Initialize the hash value argument to pj_hash_get() to 0.

Passing a non-zero value causes PJLIB to use the given input as the
hash value. Passing zero causes the parameter to become an output parameter
that receives the hash value that was computed based on the given key.

This change essentially makes ast_sip_dict_get() properly retrieve the
desired value.
........

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

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

6 years agores_pjsip_session: Add support for PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE flag.
Joshua Colp [Tue, 3 Dec 2013 18:01:36 +0000 (18:01 +0000)]
res_pjsip_session: Add support for PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE flag.

Newer versions of PJSIP have changed to using a flag for the
PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE instead of a define. This adds a
configure check to detect the presence of the flag and use it if found.
........

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

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

6 years agosorcery, bucket: Change observer remove calls to take const callbacks struct.
Richard Mudgett [Tue, 3 Dec 2013 17:35:54 +0000 (17:35 +0000)]
sorcery, bucket: Change observer remove calls to take const callbacks struct.

* Make ast_sorcery_observer_remove() accept a const callbacks struct.

* Make ast_sorcery_observer_remove() tolerant of the sorcery parameter
being NULL.  Now it can be called within a module unload routine if the
sorcery initialization fails.

* Fix ast_sorcery_observer_add() to fail if the container link fails.
........

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

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

6 years agoAdd channel locking for channel snapshot creation.
Mark Michelson [Tue, 3 Dec 2013 17:07:29 +0000 (17:07 +0000)]
Add channel locking for channel snapshot creation.

This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such.
........

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

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

6 years agomedia_index: Make media indexing tolerable of bad symlinks.
Joshua Colp [Tue, 3 Dec 2013 16:39:13 +0000 (16:39 +0000)]
media_index: Make media indexing tolerable of bad symlinks.

Media indexing will now skip over files and directories that stat
will not return information about. This can occur under normal
conditions when a symbolic link points to a location that no longer
exists.
........

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

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