]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
11 years agores_sorcery_config: Output an error message when an object can't be created.
Joshua Colp [Tue, 17 Dec 2013 18:34:16 +0000 (18:34 +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.

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

11 years agoframehooks: Re-iterate if framehook provides different frame.
Joshua Colp [Tue, 17 Dec 2013 18:25:26 +0000 (18:25 +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/

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

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

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

11 years agoari/resource_channels: When creating a channel, specify a default format (SLIN)
Matthew Jordan [Tue, 17 Dec 2013 12:51:51 +0000 (12:51 +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

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

11 years agosecurity: Inhibit execution of privilege escalating functions
David M. Lee [Mon, 16 Dec 2013 18:31:27 +0000 (18:31 +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

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

11 years agotransfers: Fix bug setting both BLINDTRANSFER and ATTENDEDTRANSFER
Jonathan Rose [Mon, 16 Dec 2013 18:22:14 +0000 (18:22 +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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

11 years agores_pjsip: Apply outbound proxy to all SIP requests.
Joshua Colp [Sat, 14 Dec 2013 17:25:51 +0000 (17:25 +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/

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

11 years agores_stasis: Expose event for call forwarding and follow forwarded channel.
Joshua Colp [Sat, 14 Dec 2013 17:15:54 +0000 (17:15 +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/

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

11 years agodocumentation: Add PJSIP technology to messaging documentation
Jonathan Rose [Fri, 13 Dec 2013 21:24:31 +0000 (21:24 +0000)] 
documentation: Add PJSIP technology to messaging documentation

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

11 years agotest.c: Fix too sticky unit test failed status.
Richard Mudgett [Fri, 13 Dec 2013 20:06:53 +0000 (20:06 +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.

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

11 years agoTransfers: Make Asterisk set ATTENDEDTRANSFER/BLINDTRANSFER more reliably
Jonathan Rose [Fri, 13 Dec 2013 20:04:41 +0000 (20:04 +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/

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

11 years agotest_voicemail_api: Add check for a registered voicemail provider before tests.
Richard Mudgett [Fri, 13 Dec 2013 19:55:31 +0000 (19:55 +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.
........

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

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

11 years agoapp_voicemail: Voicemail callback registration/unregistration function improvements.
Richard Mudgett [Fri, 13 Dec 2013 19:48:05 +0000 (19:48 +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.
........

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

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

11 years agobridge_native_rtp: Deadlock during 4-way conference creation
Kevin Harwell [Fri, 13 Dec 2013 18:24:47 +0000 (18:24 +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)

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

11 years agoARI: Allow specifying channel variables during a POST /channels
Kevin Harwell [Fri, 13 Dec 2013 17:17:48 +0000 (17:17 +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/

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

11 years agoARI: Adding a channel to a bridge while a live recording is active blocks
Kevin Harwell [Fri, 13 Dec 2013 16:32:53 +0000 (16:32 +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/

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

11 years agoSetting svn:ignore
David M. Lee [Fri, 13 Dec 2013 16:27:30 +0000 (16:27 +0000)] 
Setting svn:ignore

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

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

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

11 years agorealtime: Create extensions in alembic ast-db-manage contribution
Scott Griepentrog [Thu, 12 Dec 2013 19:44:23 +0000 (19:44 +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/

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

11 years agochan_pjsip: Revert r403587
Jonathan Rose [Thu, 12 Dec 2013 19:12:00 +0000 (19:12 +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

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

11 years agores_pjsip_messaging: send message to a default outbound endpoint
Kevin Harwell [Wed, 11 Dec 2013 20:11:50 +0000 (20:11 +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/

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

11 years agoReset peer outboundproxy on sip.conf reload
Russell Bryant [Wed, 11 Dec 2013 19:18:31 +0000 (19:18 +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

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

11 years agofunc_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip
Matthew Jordan [Wed, 11 Dec 2013 13:05:12 +0000 (13:05 +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/

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

11 years agofunc_pjsip_endpoint: Add PJSIP_ENDPOINT function for querying endpoint details
Matthew Jordan [Wed, 11 Dec 2013 12:29:49 +0000 (12:29 +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

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

11 years agochan_pjsip: Fix a sticking channel lock caused by channel masquerades
Jonathan Rose [Mon, 9 Dec 2013 22:47:06 +0000 (22:47 +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/

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

11 years agoReverting regex part of -r403545 at request of file.
Richard Mudgett [Mon, 9 Dec 2013 19:23:49 +0000 (19:23 +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 '^'.

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

11 years agores_sorcery_astdb.c: Fix get multiple records by regex.
Richard Mudgett [Mon, 9 Dec 2013 18:49:28 +0000 (18:49 +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().

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

11 years agoendpoints: Keep a reference to channel ids when creating snapshot.
Joshua Colp [Mon, 9 Dec 2013 18:31:13 +0000 (18:31 +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

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

11 years agosorcery: Eliminate shadowing a varaible that caused confusion.
Richard Mudgett [Mon, 9 Dec 2013 18:31:07 +0000 (18:31 +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.

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

11 years agosorcery: Whitespace
Richard Mudgett [Mon, 9 Dec 2013 18:01:25 +0000 (18:01 +0000)] 
sorcery: Whitespace

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

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

11 years agores_pjsip_nat: Add NAT module to session dialogs.
Joshua Colp [Mon, 9 Dec 2013 16:40:59 +0000 (16:40 +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

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

11 years agores_fax_spandsp: Always init T.38 session to avoid crashes during state change
Matthew Jordan [Mon, 9 Dec 2013 03:19:39 +0000 (03:19 +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

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

11 years agores_config_sqlite: Check for CDR unregistration failures
Matthew Jordan [Sun, 8 Dec 2013 05:54:53 +0000 (05:54 +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.

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

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

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

11 years agores_pjsip_registrar: undefined function pointer symbol
Kevin Harwell [Wed, 4 Dec 2013 21:41:24 +0000 (21:41 +0000)] 
res_pjsip_registrar: undefined function pointer symbol

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

Reported by: rmudgett

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

11 years agores_pjsip_t38: Don't pass T.38 control frames through to other hooks.
Joshua Colp [Wed, 4 Dec 2013 20:53:32 +0000 (20:53 +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".

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

11 years agoInitialize the hash value argument to pj_hash_get() to 0.
Mark Michelson [Wed, 4 Dec 2013 18:40:23 +0000 (18:40 +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.

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

11 years agoari: Fix deadlock problem with functions that use autoservice.
David M. Lee [Tue, 3 Dec 2013 20:17:48 +0000 (20:17 +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.

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

11 years agores_pjsip_session: Add support for PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE flag.
Joshua Colp [Tue, 3 Dec 2013 17:59:41 +0000 (17:59 +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.

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

11 years agosorcery, bucket: Change observer remove calls to take const callbacks struct.
Richard Mudgett [Tue, 3 Dec 2013 17:23:50 +0000 (17:23 +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.

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

11 years agomedia_index: Make media indexing tolerable of bad symlinks.
Joshua Colp [Tue, 3 Dec 2013 16:37:26 +0000 (16:37 +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.

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

11 years agoAdd channel locking for channel snapshot creation.
Mark Michelson [Tue, 3 Dec 2013 16:33:49 +0000 (16:33 +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.

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

11 years agoRevert revision 403304: Fixed the filename for the ari.conf docs
Joshua Colp [Tue, 3 Dec 2013 16:32:12 +0000 (16:32 +0000)] 
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.

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

11 years agoFixed the filename for the ari.conf docs
David M. Lee [Mon, 2 Dec 2013 18:34:50 +0000 (18:34 +0000)] 
Fixed the filename for the ari.conf docs

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

11 years agoremove unwanted property svn:mergeinfo
Alexandr Anikin [Mon, 2 Dec 2013 18:03:15 +0000 (18:03 +0000)] 
remove unwanted property svn:mergeinfo

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

11 years agoCheck and reject non-digits e164 values on peers and general sections in ooh323.conf
Alexandr Anikin [Mon, 2 Dec 2013 17:58:33 +0000 (17:58 +0000)] 
Check and reject non-digits e164 values on peers and general sections in ooh323.conf
Regenerate e164 endpoint list on reload ooh323
(issue ASTERISK-22901)
Reported by: Cyril CONSTANTIN
Patches:
ASTERISK-22901.patch
........

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

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

11 years agores_pjsip_session: Apply fromuser and fromdomain to all requests as documented.
Joshua Colp [Sun, 1 Dec 2013 21:12:37 +0000 (21:12 +0000)] 
res_pjsip_session: Apply fromuser and fromdomain to all requests as documented.

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

11 years agores_pjsip_t38: Add the framehook to the channel only on first INVITE.
Joshua Colp [Sun, 1 Dec 2013 20:04:02 +0000 (20:04 +0000)] 
res_pjsip_t38: Add the framehook to the channel only on first INVITE.

The check for determining whether the T.38 framehook should be added to
the channel or not has now been changed to guarantee adding only occurs
on the first incoming or outgoing INVITE.

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

11 years agores_pjsip_transport_websocket: Fix security events and simplify implementation.
Joshua Colp [Sun, 1 Dec 2013 19:56:38 +0000 (19:56 +0000)] 
res_pjsip_transport_websocket: Fix security events and simplify implementation.

Transport type determination for security events has been simplified to use
the type present on the message itself instead of searching through configured
transports to find the transport used.

The actual WebSocket transport has also been simplified. It now leverages the
existing PJSIP transport manager for finding the active WebSocket transport
for outgoing messages. This removes the need for res_pjsip_transport_websocket
to store a mapping itself.

(closes issue ASTERISK-22897)
Reported by: Max E. Reyes Vera J.

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

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

11 years agores_ari: Add Recording events to the validator.
Joshua Colp [Sat, 30 Nov 2013 14:11:55 +0000 (14:11 +0000)] 
res_ari: Add Recording events to the validator.

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

11 years agores_pjsip_sdp_rtp: Don't produce an invalid media stream with no formats.
Joshua Colp [Thu, 28 Nov 2013 02:12:04 +0000 (02:12 +0000)] 
res_pjsip_sdp_rtp: Don't produce an invalid media stream with no formats.

Depending on configuration it was possible for a media stream to be
created without any media formats. The produced SDP would fail internal
validation and cause a crash.

The code will now no longer add media streams with no formats to the SDP,
allowing it to pass validation and work.

(closes issue ASTERISK-22858)
Reported by: Anthony Messina

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

11 years agores_pjsip_header_funcs: Don't add headers to re-INVITEs.
Joshua Colp [Thu, 28 Nov 2013 01:56:02 +0000 (01:56 +0000)] 
res_pjsip_header_funcs: Don't add headers to re-INVITEs.

When sending a re-INVITE to an endpoint it was possible for received
headers to be added as well (since they are stored for retrieval using
the PJSIP_HEADER dialplan function). This caused a broken (and
potentially large) SIP INVITE to be produced and sent.

This changes the module so it will no longer add headers to
re-INVITEs.

(closes issue ASTERISK-22882)
Reported by: David M. Lee

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

11 years agores_stasis_playback: Add 'number', 'digits', and 'characters' URI scheme implementations.
Joshua Colp [Thu, 28 Nov 2013 00:53:43 +0000 (00:53 +0000)] 
res_stasis_playback: Add 'number', 'digits', and 'characters' URI scheme implementations.

This change adds new URI scheme implementations for playing numbers, digits,
and characters. This is done as part of the normal playback mechanism and can
be used with queueing to create a combined sentence.

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

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

11 years agores_pjsip_session: Add configurable behavior for redirects.
Joshua Colp [Thu, 28 Nov 2013 00:36:53 +0000 (00:36 +0000)] 
res_pjsip_session: Add configurable behavior for redirects.

The action taken when a redirect occurs is now configurable on a
per-endpoint basis. The redirect can either be treated as a redirect
to a local extension, to a URI that is dialed through the Asterisk
core, or to a URI that is dialed within PJSIP itself.

(closes issue ASTERISK-21710)
Reported by: Matt Jordan

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

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

11 years agores_pjsip: Fix crash when reloading certain configurations.
Joshua Colp [Wed, 27 Nov 2013 16:09:48 +0000 (16:09 +0000)] 
res_pjsip: Fix crash when reloading certain configurations.

Certain options available that specify a SIP URI perform validation
on the provided URI using the PJSIP URI parser. This operation
requires that the thread executing it be registered with the PJLIB
library. During reloads this was done on a thread which was NOT
registered with it.

This fixes the problem by creating a task which reloads the
configuration on a PJSIP thread.

(closes issue ASTERISK-22923)
Reported by: Anthony Messina

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

11 years agoari:Add application/json parameter support
David M. Lee [Wed, 27 Nov 2013 15:36:16 +0000 (15:36 +0000)] 
ari:Add application/json parameter support

The patch allows ARI to parse request parameters from an incoming JSON
request body, instead of requiring the request to come in as query
parameters (which is just weird for POST and DELETE) or form
parameters (which is okay, but a bit asymmetric given that all of our
responses are JSON).

For any operation that does _not_ have a parameter defined of type
body (i.e. "paramType": "body" in the API declaration), if a request
provides a request body with a Content type of "application/json", the
provided JSON document is parsed and searched for parameters.

The expected fields in the provided JSON document should match the
query parameters defined for the operation. If the parameter has
'allowMultiple' set, then the field in the JSON document may
optionally be an array of values.

(closes issue ASTERISK-22685)
Review: https://reviewboard.asterisk.org/r/2994/

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

11 years agores_pjsip: Update handling of some options to work with new option names.
Joshua Colp [Wed, 27 Nov 2013 15:31:05 +0000 (15:31 +0000)] 
res_pjsip: Update handling of some options to work with new option names.

Some options (such as call_group and pickup_group) share the same configuration
handler and decide what logic to use based on the name of the option. These
handlers were not updated to check for the new option names and were treating
the options as invalid.

This change simply updates the handlers with the proper names of the options.

(closes issue ASTERISK-22922)
Reported by: Anthony Messina

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

11 years agoFix a configure issue with PJSIP transaction group lock detection.
Joshua Colp [Tue, 26 Nov 2013 22:33:19 +0000 (22:33 +0000)] 
Fix a configure issue with PJSIP transaction group lock detection.

The configure check did not use the provided paths for pjproject
if provided when looking for transaction group lock support.

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

11 years agoARI: Implement device state API
Kevin Harwell [Sat, 23 Nov 2013 17:38:29 +0000 (17:38 +0000)] 
ARI: Implement device state API

Created a data model and implemented functionality for an ARI device state
resource.  The following operations have been added that allow a user to
manipulate an ARI controlled device:

Create/Change the state of an ARI controlled device
PUT    /deviceStates/{deviceName}&{deviceState}

Retrieve all ARI controlled devices
GET    /deviceStates

Retrieve the current state of a device
GET    /deviceStates/{deviceName}

Destroy a device-state controlled by ARI
DELETE /deviceStates/{deviceName}

The ARI controlled device must begin with 'Stasis:'.  An example controlled
device name would be Stasis:Example.  A 'DeviceStateChanged' event has also
been added so that an application can subscribe and receive device change
events.  Any device state, ARI controlled or not, can be subscribed to.

While adding the event, the underlying subscription control mechanism was
refactored so that all current and future resource subscriptions would be
the same.  Each event resource must now register itself in order to be able
to properly handle [un]subscribes.

(issue ASTERISK-22838)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3025/

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

11 years agores_pjsip: AMI commands and events.
Kevin Harwell [Sat, 23 Nov 2013 17:14:22 +0000 (17:14 +0000)] 
res_pjsip: AMI commands and events.

Created the following AMI commands and corresponding events for res_pjsip:

PJSIPShowEndpoints - Provides a listing of all pjsip endpoints and a few
                     select attributes on each.
  Events:
    EndpointList - for each endpoint a few attributes.
    EndpointlistComplete - after all endpoints have been listed.

PJSIPShowEndpoint - Provides a detail list of attributes for a specified
                    endpoint.
  Events:
    EndpointDetail - attributes on an endpoint.
    AorDetail - raised for each AOR on an endpoint.
    AuthDetail - raised for each associated inbound and outbound auth
    TransportDetail - transport attributes.
    IdentifyDetail - attributes for the identify object associated with
                     the endpoint.
    EndpointDetailComplete - last event raised after all detail events.

PJSIPShowRegistrationsInbound - Provides a detail listing of all inbound
                                registrations.
  Events:
    InboundRegistrationDetail - inbound registration attributes for each
                                registration.
    InboundRegistrationDetailComplete - raised after all detail records have
                                been listed.

PJSIPShowRegistrationsOutbound  - Provides a detail listing of all outbound
                                  registrations.
  Events:
    OutboundRegistrationDetail - outbound registration attributes for each
                                 registration.
    OutboundRegistrationDetailComplete - raised after all detail records
                                 have been listed.

PJSIPShowSubscriptionsInbound - A detail listing of all inbound subscriptions
                                and their attributes.
  Events:
    SubscriptionDetail - on each subscription detailed attributes
    SubscriptionDetailComplete - raised after all detail records have
                                 been listed.

PJSIPShowSubscriptionsOutbound - A detail listing of all outboundbound
                                subscriptions and their attributes.
  Events:
    SubscriptionDetail - on each subscription detailed attributes
    SubscriptionDetailComplete - raised after all detail records have
                                 been listed.

(issue ASTERISK-22609)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2959/

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

11 years agoari: Add events for playback and recording.
Joshua Colp [Sat, 23 Nov 2013 12:51:31 +0000 (12:51 +0000)] 
ari: Add events for playback and recording.

While there were events defined for playback and recording
these were not actually sent. This change implements the
to_json handlers which produces them.

(closes issue ASTERISK-22710)
Reported by: Jonathan Rose

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

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

11 years agoari: Add Snoop operation for spying/whispering on channels.
Joshua Colp [Sat, 23 Nov 2013 12:38:04 +0000 (12:38 +0000)] 
ari: Add Snoop operation for spying/whispering on channels.

The Snoop operation can be invoked on a channel to spy or
whisper on it. It returns a channel that any channel operations
can then be invoked on (such as record to do monitoring).

(closes issue ASTERISK-22780)
Reported by: Matt Jordan

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

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

11 years agoMake sure unit tests compile
Kinsey Moore [Fri, 22 Nov 2013 23:44:39 +0000 (23:44 +0000)] 
Make sure unit tests compile

This fixes the unit tests that were broken by r403069 and several
functions requiring a new parameter for sanitization of JSON messages
generated from object snapshots.

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

11 years agores_pjsip: convert configuration settings names to snake case some more
Kevin Harwell [Fri, 22 Nov 2013 22:24:43 +0000 (22:24 +0000)] 
res_pjsip: convert configuration settings names to snake case some more

Updated the alembic script for pjsip.  Also, the dtls config parsing stuff was
expecting strings with no underscores, so removed the underscores from the
option name before passing it to the parser.

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

11 years agoARI: Don't leak implementation details
Kinsey Moore [Fri, 22 Nov 2013 20:01:26 +0000 (20:01 +0000)] 
ARI: Don't leak implementation details

This change prevents channels used as implementation details from
leaking out to ARI. It does this by preventing creation of JSON blobs
of channel snapshots created from those channels and sanitizing JSON
blobs of bridge snapshots as they are created. This introduces a
framework for excluding information from output targeted at Stasis
applications on a consumer-by-consumer basis using channel sanitization
callbacks which could be extended to bridges or endpoints if necessary.

This prevents unhelpful error messages from being generated by
ast_json_pack.

This also corrects a bug where BridgeCreated events would not be
created.

(closes issue ASTERISK-22744)
Review: https://reviewboard.asterisk.org/r/2987/
Reported by: David M. Lee

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

11 years agores_pjsip: convert configuration settings names to snake case
Kevin Harwell [Fri, 22 Nov 2013 17:19:18 +0000 (17:19 +0000)] 
res_pjsip: convert configuration settings names to snake case

Renamed, where appropriate, the configuration options for chan/res_pjsip to use
snake case (compound words separated by an underscore).  For example, faxdetect
will become fax_detect, recordofffeature will become record_off_feature, etc...

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

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

11 years agotranslate: Move freeing of frame to after it is used.
Joshua Colp [Fri, 22 Nov 2013 17:11:46 +0000 (17:11 +0000)] 
translate: Move freeing of frame to after it is used.

When translating from one format to another it is possible
to inform the translation function that the source frame should
be freed. This was previously done immediately but shortly
afterwards the frame that was freed was accessed and used again.

This change moves code around a bit so that the frame is now
freed after it has been completely used.

(closes issue ASTERISK-22788)
Reported by: Corey Farrell
Patches:
translate-access-after-free-11up.patch uploaded by coreyfarrell (license 5909)
translate-access-after-free-1.8.patch uploaded by coreyfarrell (license 5909)
........

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

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

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

11 years agoari: Fix #include to match generated headers for snakeCase resource files
David M. Lee [Thu, 21 Nov 2013 22:35:44 +0000 (22:35 +0000)] 
ari: Fix #include to match generated headers for snakeCase resource files

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

11 years agoari: Fix generators for resources with camelCase names.
David M. Lee [Thu, 21 Nov 2013 21:21:43 +0000 (21:21 +0000)] 
ari: Fix generators for resources with camelCase names.

For the new deviceState resource, we need to properly generate
device_state.[ch] files.

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

11 years agores_pjsip_session: Fix memory leak of direct media format capabilities
Matthew Jordan [Thu, 21 Nov 2013 19:21:20 +0000 (19:21 +0000)] 
res_pjsip_session: Fix memory leak of direct media format capabilities

The direct media format capabilities are always allocated in
ast_sip_session_alloc and were not freed in the session destructor. Whoops.

(This being the third whoops caught by Scott and Nitesh's valgrind work for
the Asterisk Test Suite. Nifty!)

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

11 years agovoicemail: Fixup some doxygen comments.
Richard Mudgett [Thu, 21 Nov 2013 19:08:40 +0000 (19:08 +0000)] 
voicemail: Fixup some doxygen comments.

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

11 years agobucket: Fix scheme ref leak in __ast_bucket_scheme_register().
Richard Mudgett [Thu, 21 Nov 2013 18:00:39 +0000 (18:00 +0000)] 
bucket: Fix scheme ref leak in __ast_bucket_scheme_register().

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

11 years agores_pjsip_sdp_rtp: Fix use of uninitialized value in PJSIP
Matthew Jordan [Thu, 21 Nov 2013 17:52:11 +0000 (17:52 +0000)] 
res_pjsip_sdp_rtp: Fix use of uninitialized value in PJSIP

In PJMEDIA, pjmedia_sdp_rtpmap_to_attr will attempt to use the string
rtpmap.param regardless of its length value. Simply setting the length to 0
does not prevent the garbage on the stack in rtpmap.param.ptr from being
formatted in a sprintf call. This patch initializes the string to NULL so that
at the very least, something is provided to the function that is predictable.

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

11 years agores_pjsip_mwi: Fix memory leak of MWI subscriptions container
Matthew Jordan [Thu, 21 Nov 2013 17:49:28 +0000 (17:49 +0000)] 
res_pjsip_mwi: Fix memory leak of MWI subscriptions container

This patch fixes a reference counting memory leak on the ao2_container
created as part of create_mwi_subscriptions. When we create the container
in this routine, the intent is to hand lifetime ownership over to the global
container unsolicited_mwi. When ao2_global_obj_replace_unref is called, the
reference count on mwi_subscriptions (the container) will be bumped by 1;
however, the function does not decrement the reference count on
mwi_subscriptions when this occurs. This will prevent the container from being
fully disposed of when Asterisk exits (or on any subsequent call to this
operation, such as during a reload).

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

11 years agoari: Add silence generator controls
David M. Lee [Thu, 21 Nov 2013 15:55:33 +0000 (15:55 +0000)] 
ari: Add silence generator controls

This patch adds the ability to start a silence generator on a channel
via ARI. This generator will play silence on the channel (avoiding audio
timeouts on the peer) until it is stopped, or some other media operation
is started (like playing media, starting music on hold, etc.).

(closes issue ASTERISK-22514)
Review: https://reviewboard.asterisk.org/r/3019/

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

11 years agores_pjsip_caller_id: Don't overwrite user portion of the From header when fromuser...
Joshua Colp [Tue, 19 Nov 2013 23:17:18 +0000 (23:17 +0000)] 
res_pjsip_caller_id: Don't overwrite user portion of the From header when fromuser is set.

The fromuser option is used to explicitly set the user within the From header. The
res_pjsip_caller_id module did not take this setting into account when determining
if the From header could be modified or not.

(closes issue ASTERISK-22866)
Reported by: Anthony Messina

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

11 years agores_pjsip: Add support for building against pjproject with SIP transaction group...
Joshua Colp [Sat, 16 Nov 2013 13:44:47 +0000 (13:44 +0000)] 
res_pjsip: Add support for building against pjproject with SIP transaction group lock support.

SIP transaction group lock support has been backported into our pjproject. Since the code
now internally uses a group lock the code is now changed to unlock it if present. Note
that the act of finding the transaction is what actually returns it locked.

For further information about group locks check out the wiki page at:
http://trac.pjsip.org/repos/wiki/Group_Lock

(issue ASTERISK-22818)
Reported by: Matt Jordan

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

11 years agoCEL: Fix crash when using CELGenUserEvent
Kinsey Moore [Fri, 15 Nov 2013 14:35:58 +0000 (14:35 +0000)] 
CEL: Fix crash when using CELGenUserEvent

This fixes a crash when CELGenUserEvent is called from the dialplan
while CEL is disabled. Currently, CEL does not create its topics and
forwards if it is not enabled and external entities may depend on
these topics blindly since they should always be available. This patch
breaks up route creation and topic/forward creation such that the CEL
topics and forwards will always exist while the router and its
associated routes will be torn down and recreated as necessary.

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

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

11 years agostasis: Fixed scoping problem with bridge tracking.
David M. Lee [Thu, 14 Nov 2013 15:01:51 +0000 (15:01 +0000)] 
stasis: Fixed scoping problem with bridge tracking.

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

11 years agores_ari_channels: Add the ability to stop locally generated ringing on a channel.
Joshua Colp [Wed, 13 Nov 2013 23:09:38 +0000 (23:09 +0000)] 
res_ari_channels: Add the ability to stop locally generated ringing on a channel.

Using the 'ring' operation it is possible to start locally generated ringback if
the channel is answered. This change adds the ability to stop it by using DELETE.

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

11 years agoari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404
Kevin Harwell [Tue, 12 Nov 2013 23:16:58 +0000 (23:16 +0000)] 
ari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404

Was returning a 404 on a valid technology with an empty list of endpoints.
Now checking against the channel tech to make sure the tech itself is valid
and not just an empty list of endpoints.

(issue ASTERISK-22803)
Reported by: David M. Lee

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

11 years agoari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404
Kevin Harwell [Tue, 12 Nov 2013 22:15:41 +0000 (22:15 +0000)] 
ari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404

Implementation listing endpoints by technology returned an empty array if no
matching endpoints were found.  Fixed so a "404 Not Found" will be returned
instead.

(closes issue ASTERISK-22803)
Reported by: David M. Lee

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

11 years agoSwitch to a scoped lock to avoid missing unlocks in failure returns.
Mark Michelson [Tue, 12 Nov 2013 19:11:28 +0000 (19:11 +0000)] 
Switch to a scoped lock to avoid missing unlocks in failure returns.

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

11 years agoMove a NULL check to a place that makes more sense.
Mark Michelson [Tue, 12 Nov 2013 19:05:44 +0000 (19:05 +0000)] 
Move a NULL check to a place that makes more sense.

Two variables were being checked for NULLity immediately
after being declared NULL. I moved the NULL check until
after the variables are allocated.

This allows for the "channelvars" option in manager.conf
to work as intended again.

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

11 years agopjsip_messaging, pjsip_header_funcs: Crashes due to NULL pointer dereferences
Kevin Harwell [Tue, 12 Nov 2013 16:45:42 +0000 (16:45 +0000)] 
pjsip_messaging, pjsip_header_funcs: Crashes due to NULL pointer dereferences

Both res_pjsip_messaging and res_pjsip_header_funcs were causing asterisk to
crash because they were trying to dereference a NULL pointer.

In the case of res_pjsip_messaging it was attempting to "print" a contact
header that did not exist.  In fact contact headers should not be part of
a SIP MESSAGE, so the offending code was simply removed.

In the case of res_pjsip_header_funcs a null private channel tech was being
passed to the function and then later dereferenced.  Added null checks (and
error logging) to the read/write function handlers to guard against crashing.

(closes issue ASTERISK-22821)
Reported by: Anthony Messina

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

11 years agoCELGenUserEvent: Fix error message from ast_json_pack
Kinsey Moore [Tue, 12 Nov 2013 16:33:24 +0000 (16:33 +0000)] 
CELGenUserEvent: Fix error message from ast_json_pack

This prevents NULL from being passed into an ast_json_pack call when no
extra information is passed to the application which prevents an error
message about NULL arguments from being generated.

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

11 years agoFixed a typ.
David M. Lee [Tue, 12 Nov 2013 15:26:26 +0000 (15:26 +0000)] 
Fixed a typ.

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

11 years agochan_dahdi: Fix crash during caller ID read
Kinsey Moore [Tue, 12 Nov 2013 15:02:18 +0000 (15:02 +0000)] 
chan_dahdi: Fix crash during caller ID read

Asterisk will sometimes core dump during caller id read on analog
channels due to a negative return value from the read() in
my_get_callerid that slips through as a negative length argument to
callerid_feed() if the errno returned by DAHDI is ELAST. This change
ensures that the negative return is treated properly even when it is
ELAST.

(closes issue ASTERISK-22746)
Reported by: Michael Walton
Patches:
    chan_dahdi_cid_crash_fix.r401410.patch uploaded by Michael Walton (License 6502)
........

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

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

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

11 years agoGet rid of some inaccurate comments.
Mark Michelson [Mon, 11 Nov 2013 19:26:48 +0000 (19:26 +0000)] 
Get rid of some inaccurate comments.

I'm doing some unrelated work in app_confbridge and finding
these "invalid pin" comments to be annoying. Get out!
........

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

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

11 years agoapp_queue: Honor penalty limits of 0
Kinsey Moore [Mon, 11 Nov 2013 15:36:23 +0000 (15:36 +0000)] 
app_queue: Honor penalty limits of 0

In the current app_queue code from 1.8 up to trunk the upper and lower
penalties can be set to 0 but the value is interpreted to be disabled
instead of actually setting limits. This is especially evident if min
and max limits are set to 0 and members with penalties of 0 and 1 are
in the queue since the member with penalty 1 will still receive calls.
This patch adjusts the special disabled value to be INT_MAX instead of
0.

(closes issue ASTERISK-20862)
Review: https://reviewboard.asterisk.org/r/2995/
Reported by: Schmooze Com
........

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

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

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

11 years agochan_sip: keep same local (from) tag for outgoing register requests
Scott Griepentrog [Fri, 8 Nov 2013 23:04:03 +0000 (23:04 +0000)] 
chan_sip: keep same local (from) tag for outgoing register requests

For outbound register requests the tag on the From line was
updated every 20 seconds prior to a successful registration
and also once for each registration renewal.  That behavior
can possibly cause the registration to be denied because of
the different tag, and is not aligned with the intention of
RFC 3261 8.1.3.5 "... request constitutes a new transaction
and SHOULD have the same value of the Call-ID, To, and From
of the previous request...".  This updates chan_sip to have
a field to keep the local tag in the registration structure
and use that tag for registration requests where the callid
is also unchanged.

(closes issue ASTERISK-12117)
Reported by: Pawel Pierscionek
Review: https://reviewboard.asterisk.org/r/2988/
........

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

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

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

11 years agores_stasis.c: Fix locking issues with the app_bridge_moh container.
Richard Mudgett [Fri, 8 Nov 2013 20:20:27 +0000 (20:20 +0000)] 
res_stasis.c: Fix locking issues with the app_bridge_moh container.

* Fix unlinking from the app_bridges_moh container in remove_bridge_moh()
without a lock under normal circumstances.

* Made check ast_bridge_set_after_callback() return value in
bridge_moh_create() to handle failure.

* Fixed SCOPED_AO2LOCK() locking over too much scope in
stasis_app_bridge_moh_channel() and stasis_app_bridge_moh_stop().

* Fixed unusual usage of ao2_unlink_flag() in control_unlink().

* Fixed orphaned bridge from off nominal path in
stasis_app_bridge_create().

* Fixed strange construct in stasis_app_unsubscribe().  From a bad merge?

* Made load_module() cleanup on failure.

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

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

11 years agosecurity_events: Push out security events over AMI events
Jonathan Rose [Fri, 8 Nov 2013 19:28:11 +0000 (19:28 +0000)] 
security_events: Push out security events over AMI events

Security Events will now be written to any listener of the new 'security' class

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

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

11 years agoClarify an ambiguous error message.
Mark Michelson [Fri, 8 Nov 2013 19:22:14 +0000 (19:22 +0000)] 
Clarify an ambiguous error message.

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

11 years agores_pjsip: Print a helpful error message if sorcery registration fails
David M. Lee [Fri, 8 Nov 2013 18:48:28 +0000 (18:48 +0000)] 
res_pjsip: Print a helpful error message if sorcery registration fails

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

11 years agoChanges from make ari-stubs after r402560
David M. Lee [Fri, 8 Nov 2013 17:59:10 +0000 (17:59 +0000)] 
Changes from make ari-stubs after r402560

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

11 years agoARI playback: Rename ARI Playback to Playbacks
Kevin Harwell [Fri, 8 Nov 2013 17:39:43 +0000 (17:39 +0000)] 
ARI playback: Rename ARI Playback to Playbacks

Before playback was the only non plural resource.  It has been renamed to
playbacks for consistency.

(closes issue ASTERISK-22737)
Reported by: Paul Belanger

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