]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agochan_sip: Fix so asterisk won't send reINVITE after a BYE.
Walter Doekes [Sun, 12 Oct 2014 08:14:04 +0000 (08:14 +0000)] 
chan_sip: Fix so asterisk won't send reINVITE after a BYE.

After a reINVITE glare situation, Asterisk would re-send the reINVITE
even though the call had been hung up in the mean time.  This patch
unschedules the reinvite when handling the BYE.

ASTERISK-22791 #close
Reported by: Paolo Compagnini
Tested by: Paolo Compagnini

Review: https://reviewboard.asterisk.org/r/4056/
(testcase is in review r4055)
........

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

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

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

10 years agobuild: Relax badshell tilde test to allow for ~ in middle of DESTDIR.
Walter Doekes [Sun, 12 Oct 2014 07:52:58 +0000 (07:52 +0000)] 
build: Relax badshell tilde test to allow for ~ in middle of DESTDIR.

The main Makefile has a target test called 'badshell' that tests if
DESTDIR does not happen to have an an-expanded tilde (~).  This might
be the case if you run: make install DESTDIR=~/somewhere/

That test also disallowed valid tildes in directory names. The test is
now changed to only trigger on a tilde at the start of the path.

ASTERISK-13797 #close
Reported by: Tzafrir Cohen

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

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

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

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

10 years agores_calendar_ews: Relax neon version check to work with 0.30 too.
Walter Doekes [Sun, 12 Oct 2014 07:43:12 +0000 (07:43 +0000)] 
res_calendar_ews: Relax neon version check to work with 0.30 too.

Allow res_calendar_ews to work not only with libneon-0.29 but also
with 0.30.

ASTERISK-24325 #close
Reported by: Tzafrir Cohen

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

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

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

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

10 years agores_phoneprov: Cleanup module load error handling
George Joseph [Sat, 11 Oct 2014 21:07:36 +0000 (21:07 +0000)] 
res_phoneprov: Cleanup module load error handling

Tested module load/reload interaction between res_phoneprov and
res_pjsip_phoneprov_provider in cases where res_phoneprov didn't
load correctly (usually misconfiguration or missing phoneprov.conf)

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4069/

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

10 years agobridge: During a smart bridge operation provide a more complete bridge to the old...
Joshua Colp [Fri, 10 Oct 2014 20:47:21 +0000 (20:47 +0000)] 
bridge: During a smart bridge operation provide a more complete bridge to the old technology.

When a smart bridge operation occurs and a bridge transitions from one
technology to another the old technology is provided the channels formerly
in it and told that they are leaving. Unfortunately the bridge provided
along with them is incomplete. The bridge, despite there being channels in it,
contains none. This forces technology implementations to have additional
logic when channels are leaving or to store their own duplicated
state.

This change makes the bridge more complete so it contains the expected
channels. Now that the bridge is complete special logic within
bridge_native_rtp is no longer needed and has been removed.

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

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

10 years agores/res_phoneprov: Bail on registration if res_phoneprov didn't load
Matthew Jordan [Fri, 10 Oct 2014 14:30:43 +0000 (14:30 +0000)] 
res/res_phoneprov: Bail on registration if res_phoneprov didn't load

If res_phoneprov failed to fully load (due to not being configured), the
providers container will be NULL. If a module attempts to register a phone
provisioning provider, it should check for the presence of the container.
If there is no providers container, it should return an error.

This patch makes the ast_phoneprov_provider_register function do that...
otherwise this would be a silly commit message.

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

10 years agores_pjsip_phoneprov_provider: Add missing dependency on pjproject.
Joshua Colp [Fri, 10 Oct 2014 14:22:54 +0000 (14:22 +0000)] 
res_pjsip_phoneprov_provider: Add missing dependency on pjproject.

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

10 years agoCallerID: Fix parsing regression
Kinsey Moore [Fri, 10 Oct 2014 12:58:52 +0000 (12:58 +0000)] 
CallerID: Fix parsing regression

This fixes a regression in callerid parsing introduced when another bug
was fixed. This bug occurred when the name was composed entirely of
DTMF keys and quoted without a number section (<>).

ASTERISK-24406 #close
Reported by: Etienne Lessard
Tested by: Etienne Lessard
Patches:
    callerid_fix.diff uploaded by Kinsey Moore
Review: https://reviewboard.asterisk.org/r/4067/
........

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

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

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

10 years agores_pjsip_nat: Place source port into rport of responses if 'force_rport' is on.
Joshua Colp [Fri, 10 Oct 2014 12:09:39 +0000 (12:09 +0000)] 
res_pjsip_nat: Place source port into rport of responses if 'force_rport' is on.

When the 'force_rport' option is enabled the behavior should be the same
as if the remote side placed rport into the message themselves. Therefore
any responses we send should include the source port of the request in the
rport of the Via header.

#SIPit31

ASTERISK-24387 #close
Reported by: Matt Jordan

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

10 years agochan_sip: Fix dialog leak resulting from missing ACK to re-INVITE.
Walter Doekes [Fri, 10 Oct 2014 07:27:46 +0000 (07:27 +0000)] 
chan_sip: Fix dialog leak resulting from missing ACK to re-INVITE.

If a device re-INVITEs at the same time as the dialog is hung up, and
if then the ACK to the re-INVITE never reaches Asterisk, chan_sip would
fail to destroy the dialog after a while.  This resulted in (most
prominently) file handle leaks.

(Patch reindented by me.)

ASTERISK-20784 #close
ASTERISK-15879 #close
Reported by: Torrey Searle, Nitesh Bansal
Patches:
  reinvite_ack_timeout.patch uploaded by Torrey Searle (License #5334)
  patch_asterisk_20784.txt uploaded by Nitesh Bansal (License #6418)

Reviewboard: https://reviewboard.asterisk.org/r/4052/
(testcase can be found at r4051)
........

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

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

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

10 years agores_rtp_asterisk: Crash if no candidates received for component
Kevin Harwell [Thu, 9 Oct 2014 21:28:15 +0000 (21:28 +0000)] 
res_rtp_asterisk: Crash if no candidates received for component

When starting ice if there is not at least one remote ice candidate with an RTP
component asterisk will crash. This is due to an assertion in pjnath as it
expects at least one candidate with an RTP component. Added a check to make
sure at least one candidate contains an RTP component and at least one candidate
has an RTCP component.

ASTERISK-24383 #close
Review: https://reviewboard.asterisk.org/r/4039/
........

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

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

10 years agores_pjsip_phoneprov_provider: Provides pjsip integration with res_phoneprov
George Joseph [Thu, 9 Oct 2014 20:34:52 +0000 (20:34 +0000)] 
res_pjsip_phoneprov_provider: Provides pjsip integration with res_phoneprov

This module allows res_pjsip to integrate with res_phoneprov.  It handles
the pjsip 'phoneprov' object type.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/3976/

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

10 years agores/res_phoneprov: Don't cancel Asterisk load on module load failure
Matthew Jordan [Thu, 9 Oct 2014 18:33:59 +0000 (18:33 +0000)] 
res/res_phoneprov: Don't cancel Asterisk load on module load failure

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

10 years agores_phoneprov: Refactor phoneprov to allow pluggable config providers
George Joseph [Thu, 9 Oct 2014 17:41:12 +0000 (17:41 +0000)] 
res_phoneprov: Refactor phoneprov to allow pluggable config providers

This patch makes res_phoneprov more modular so other modules (like pjsip)
can provide configuration information instead of res_phoneprov relying solely
on users.conf and sip.conf.  To accomplish this a new ast_phoneprov public API
is now exposed which allows config providers to register themselves, set
defaults (server profile, etc) and add user extensions.

* ast_phoneprov_provider_register registers the provider and provides callbacks
  for loading default settings and loading users.
* ast_phoneprov_provider_unregister clears the defaults and users.
* ast_phoneprov_add_extension should be called once for each user/extension
  by the provider's load_users callback to add them.
* ast_phoneprov_delete_extension deletes one extension.
* ast_phoneprov_delete_extensions deletes all extensions for the provider.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/3970/

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

10 years agocdr.c: Make turning on CDR debug a one step process instead of two.
Richard Mudgett [Thu, 9 Oct 2014 16:34:55 +0000 (16:34 +0000)] 
cdr.c: Make turning on CDR debug a one step process instead of two.

Now "cdr set debug on" doesn't also require "core set verbose 1" to see
CDR debug output.

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

10 years agosafe_asterisk: Don't automatically exceed MAXFILES value of 2^20.
Walter Doekes [Thu, 9 Oct 2014 08:07:27 +0000 (08:07 +0000)] 
safe_asterisk: Don't automatically exceed MAXFILES value of 2^20.

On systems with lots of RAM (e.g. 24GB) /proc/sys/fs/file-max divided
by two can exceed the per-process file limit of 2^20. This patch
ensures the value is capped.

(Patch cleaned up by me.)

ASTERISK-24011 #close
Reported by: Michael Myles
Patches:
  safe_asterisk-ulimit.diff uploaded by Michael Myles (License #6626)
........

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

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

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

10 years agores_rtp_asterisk: Allow only UDP ICE candidates.
Joshua Colp [Wed, 8 Oct 2014 18:45:19 +0000 (18:45 +0000)] 
res_rtp_asterisk: Allow only UDP ICE candidates.

The underlying library, pjnath, that res_rtp_asterisk uses for ICE
support does not have support for ICE-TCP. As candidates are
passed through directly to it this can cause error messages to occur
when it receives something unexpected (such as a TCP candidate).
This change merely ignores all non-UDP candidates so they never
reach pjnath.

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

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

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

10 years agoBlocked revisions 424787
Corey Farrell [Tue, 7 Oct 2014 21:31:59 +0000 (21:31 +0000)] 
Blocked revisions 424787

........
astobj2: Correct REF_DEBUG false leak report

When ao2_callback is run with OBJ_MULTIPLE and not OBJ_NODATA
it allocates a temporary container in a way that does not
record REF_DEBUG log entries.  This changes that container
to correctly record unref's when the container is freed.

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

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

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

10 years agores/res_pjsip_outbound_registration: Initialize auth_reject_permanent parameter
Matthew Jordan [Tue, 7 Oct 2014 17:40:58 +0000 (17:40 +0000)] 
res/res_pjsip_outbound_registration: Initialize auth_reject_permanent parameter

Prior to this patch, the auth_reject_permanent parameter was not initialized on
the registration client state, leading to the parameter being disabled
regardless of the value specified in pjsip.conf.

This patch initialized the setting on the registration client state to the
provided configuration value.

ASTERISK-24398 #close

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

10 years agomessage: Don't close an AMI connection on SendMessage action error
Matthew Jordan [Mon, 6 Oct 2014 18:37:13 +0000 (18:37 +0000)] 
message: Don't close an AMI connection on SendMessage action error

If SendMessage encounters an error (such as incorrect input provided to the
action), it will currently return -1. Actions should only return -1 if the
connection to the AMI client should be closed. In this case, SendMessage
causing the client to disconnect is inappropriate.

This patch causes the action to return 0, which simply causes the action to
fail.

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

ASTERISK-24354 #close
Reported by: Peter Katzmann
patches:
  sendMessage.patch uploaded by Peter Katzmann (License 5968)
........

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

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

10 years agofeatures.c: Fix lingering channel ref while Bridge() application is active.
Richard Mudgett [Mon, 6 Oct 2014 15:36:32 +0000 (15:36 +0000)] 
features.c: Fix lingering channel ref while Bridge() application is active.

Using the Bridge application to bridge a channel that is executing an
applicaiton such as Wait results in a lingering Surrogate channel in the
CLI "core show channels" output even though it has already hungup.

* Fix bridge_exec() to not hold onto the current_dest_chan ref once it has
been put into the bridge.

* Eliminated bridge_exec()'s use of RAII_VAR().

ASTERISK-24224 #close
Reported by: Mark Michelson

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

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

10 years agosdp_srtp: Add new lines to some WARNING messages
Matthew Jordan [Mon, 6 Oct 2014 12:37:56 +0000 (12:37 +0000)] 
sdp_srtp: Add new lines to some WARNING messages

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

10 years agores_pjsip/pjsip_options: Do not 404 an OPTIONS request not sent to an endpoint
Matthew Jordan [Mon, 6 Oct 2014 00:59:12 +0000 (00:59 +0000)] 
res_pjsip/pjsip_options: Do not 404 an OPTIONS request not sent to an endpoint

An OPTIONS request that is sent to Asterisk but not to a specific endpoint is
currently sent a 404 in response. This is because, not surprisingly, an empty
extension is never going to be found in the dialplan.

This patch makes it so that we only attempt to look up the endpoint in the
dialplan if it is specified in the OPTIONS request URI.

#SIPit31

ASTERISK-24370 #close
Reported by: Matt Jordan

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

10 years agopjsip/dialplan_functions: Handle PJSIP_MEDIA_OFFER called on non-PJSIP channels
Matthew Jordan [Mon, 6 Oct 2014 00:51:43 +0000 (00:51 +0000)] 
pjsip/dialplan_functions: Handle PJSIP_MEDIA_OFFER called on non-PJSIP channels

Calling PJSIP_MEDIA_OFFER on a non-PJSIP channel is hazardous to your health.
It will treat the channels as a PJSIP channel, eventually hitting an ao2 error,
FRACKing on assertion error, and quite likely crashing.

This patch adds checks to the read/write callbacks that ensure that the channel
technology is of type 'PJSIP' before attempting to operate on the channel.

#SIPit31

ASTERISK-24382 #close
Reported by: Matt Jordan

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

10 years agores_pjsip: Prevent crashes when PJPROJECT presents an rdata with no message
Matthew Jordan [Mon, 6 Oct 2014 00:30:34 +0000 (00:30 +0000)] 
res_pjsip: Prevent crashes when PJPROJECT presents an rdata with no message

When a message that exceeds the PJ_MAX_PKT_SIZE is sent over a reliable
transport, it is possible (although it shouldn't occur) for pjproject to pass
up an rdata object with a NULL msg in the msg_info. Needless to say, things
that attempt to dereference this are in for a rough ride.

In particular, this caused crashes in three different locations, all of which
are 'low level' enough to intercept an rdata object early in processing:

(1) res_pjsip_logger
(2) res_hep_pjsip
(3) res_pjsip/distributor

Anything that can intercept an rdata object before res_pjsip/distributor should
be defensive when looking at the received packet.

#SIPit31

ASTERISK-24369 #close
Reported by: Matt Jordan

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

10 years agoRelease AMI connections on shutdown.
Corey Farrell [Sun, 5 Oct 2014 00:45:30 +0000 (00:45 +0000)] 
Release AMI connections on shutdown.

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

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

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

10 years agochan_sip: Clean leak on error path of process_sdp
Corey Farrell [Sun, 5 Oct 2014 00:25:01 +0000 (00:25 +0000)] 
chan_sip: Clean leak on error path of process_sdp

Resolve leak in process_sdp that occurs in 2 error path's where
crypto lines are expected but not provided.

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

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

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

10 years agochan_motif: Release format capabilities and config on module load error
Corey Farrell [Sun, 5 Oct 2014 00:01:03 +0000 (00:01 +0000)] 
chan_motif: Release format capabilities and config on module load error

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

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

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

10 years agores_pjsip: Fix XML typo and update UPGRADE.txt.
Richard Mudgett [Fri, 3 Oct 2014 21:51:17 +0000 (21:51 +0000)] 
res_pjsip: Fix XML typo and update UPGRADE.txt.

ASTERISK-24199

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

10 years agoaudiohooks: Reevaluate the bridge technology when an audiohook is added or removed.
Richard Mudgett [Fri, 3 Oct 2014 19:36:09 +0000 (19:36 +0000)] 
audiohooks: Reevaluate the bridge technology when an audiohook is added or removed.

Adding a mixmonitor to a channel causes the bridge to change technologies
from native to simple_bridge so the call can be recorded.  However, when
the mixmonitor is stopped the bridge does not switch back to the native
technology.

* Added unbridge requests to reevaluate the bridge when a channel
audiohook is removed.

* Moved the unbridge request into ast_audiohook_attach() ensure that the
bridge reevaluates whenever an audiohook is attached.  This simplified the
mixmonitor and chan_spy start code as well.

* Added defensive code to stop_mixmonitor_full() in case additional
arguments are ever added to the StopMixMonitor application.

* Made ast_framehook_detach() not do an unbridge request if the framehook
does not exist.

* Made ast_framehook_list_fixup() do an unbridge request if there are any
framehooks.  Also simplified the loop.

ASTERISK-24195 #close
Reported by: Jonathan Rose

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

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

10 years agochan_pjsip: Fix deadlock when masquerading PJSIP channels.
Richard Mudgett [Fri, 3 Oct 2014 17:30:07 +0000 (17:30 +0000)] 
chan_pjsip: Fix deadlock when masquerading PJSIP channels.

Performing a directed call pickup resulted in a deadlock when PJSIP
channels were involved.

A masquerade needs to hold onto the channel locks while it swaps channel
information between the two channels involved in the masquerade.  With
PJSIP channels, the fixup routine needed to push a fixup task onto the
PJSIP channel's serializer.  Unfortunately, if the serializer was also
processing a task that needed to lock the channel, you get deadlock.

* Added a new control frame that is used to notify the channels that a
masquerade is about to start and when it has completed.

* Added the ability to query taskprocessors if the current thread is the
taskprocessor thread.

* Added the ability to suspend/unsuspend the PJSIP serializer thread so a
masquerade could fixup the PJSIP channel without using the serializer.

ASTERISK-24356 #close
Reported by: rmudgett

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

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

10 years agosorcery: Prevent SEGV in sorcery_wizard_create when there's no create function
George Joseph [Fri, 3 Oct 2014 15:53:59 +0000 (15:53 +0000)] 
sorcery: Prevent SEGV in sorcery_wizard_create when there's no create function

When you call ast_sorcery_create() you don't necessarily know which wizard is
going to be invoked.  If it happens to be a wizard like 'config' that doesn't
have a 'create' virtual function you get a segfault in the
sorcery_wizard_create callback.  This patch catches the null function pointer,
does an ast_assert, and logs an error.

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

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

10 years agoPJSIP: Restore functional default for callerid_privacy
Kinsey Moore [Fri, 3 Oct 2014 13:57:24 +0000 (13:57 +0000)] 
PJSIP: Restore functional default for callerid_privacy

The pjsip config option default fixups from r424263 altered the
functional default from "allowed_not_screened" to "allowed". This
change restores the functional default value when none is provided.

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

10 years agoManager: Add missing fields and documentation for CoreShowChannels
Kinsey Moore [Fri, 3 Oct 2014 13:24:21 +0000 (13:24 +0000)] 
Manager: Add missing fields and documentation for CoreShowChannels

This corrects some issues introduced in the responses to the
CoreShowChannels AMI command as well as adding documentation for the
responses. The command in Asterisk 12 was missing the following fields:
Duration, Application, ApplicationData, and BridgedChannel and
BridgedUniqueID (replaced with BridgeId).

ASTERISK-24262 #close
Reported by: Mitch Claborn
Review: https://reviewboard.asterisk.org/r/4040/

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

10 years agores_pjsip_session: Reduce SDP size by removing duplicate connection lines.
Joshua Colp [Fri, 3 Oct 2014 07:52:54 +0000 (07:52 +0000)] 
res_pjsip_session: Reduce SDP size by removing duplicate connection lines.

Due to the architecture of how media streams are handled each individual
handler adds connection details (IP address) for it. The first media stream
is then used as the top level SDP connection line. In practice each
line ends up being the same so to reduce the SDP size stream-level connection
information is also added to the SDP if it differs from the top level SDP
connection line.

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

10 years agores_pjsip: Make transport cipher option accept a comma separated list of cipher names.
Richard Mudgett [Thu, 2 Oct 2014 21:45:58 +0000 (21:45 +0000)] 
res_pjsip: Make transport cipher option accept a comma separated list of cipher names.

Improvements to the res_pjsip transport cipher option.

* Made the cipher option accept a comma separated list of OpenSSL cipher
names.  Users of realtime will be glad if they have more than one name to
list.

* Added the CLI command 'pjsip list ciphers' so a user can know what
OpenSSL names are available for the cipher option.

* Updated the cipher option online XML documentation to specify what is
expected for the value.

* Updated pjsip.conf.sample to not indicate that ALL is acceptable since
ALL does not imply a preference order for the ciphers and PJSIP does not
simply pass the string to OpenSSL for interpretation.

ASTERISK-24199 #close
Reported by: Joshua Colp

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

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

10 years agoAlembic: Add enumerator value to sippeers -> directmedia - 'outgoing'
Jonathan Rose [Thu, 2 Oct 2014 19:58:08 +0000 (19:58 +0000)] 
Alembic: Add enumerator value to sippeers -> directmedia - 'outgoing'

The 'outgoing' value was left off of the enumerator when first creating the
column. This patch adds it, and should gracefully upgrade keeping the existing
data in tact.

ASTERISK-23781 #close
Reported by: Stephen More
Review: https://reviewboard.asterisk.org/r/4013/

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

10 years agores_pjsip: document use of rewrite_contact in sample conf
Scott Griepentrog [Thu, 2 Oct 2014 13:30:00 +0000 (13:30 +0000)] 
res_pjsip: document use of rewrite_contact in sample conf

Without setting rewrite_contact, an invite to an endpoint
behind NAT will not reach it - unless the endpoint itself
uses STUN or TURN to discover it's public URI.  Thus, the
use of this should be in the sample documentation.

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

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

10 years agores_hep: Release allocation reference to configuration.
Corey Farrell [Wed, 1 Oct 2014 20:30:23 +0000 (20:30 +0000)] 
res_hep: Release allocation reference to configuration.

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

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

10 years agores_pjsip: Add 'dtls_fingerprint' option to configure DTLS fingerprint hash.
Joshua Colp [Wed, 1 Oct 2014 16:35:02 +0000 (16:35 +0000)] 
res_pjsip: Add 'dtls_fingerprint' option to configure DTLS fingerprint hash.

During the latest update to DTLS-SRTP support the ability to configure
the hash used for fingerprints was added. This gave us two supported ones:
SHA-1 and SHA-256. The default was accordingly updated to SHA-256.
Unfortunately this configuration ability was not exposed within res_pjsip.
This change adds a dtls_fingerprint option that controls it.

#SIPit31

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

10 years agores_pjsip_sdp_rtp: Accept DTLS attributes in top level, not just media session.
Joshua Colp [Wed, 1 Oct 2014 16:18:09 +0000 (16:18 +0000)] 
res_pjsip_sdp_rtp: Accept DTLS attributes in top level, not just media session.

#SIPit31

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

10 years agoPJSIP: Handle defaults properly
Kinsey Moore [Wed, 1 Oct 2014 12:24:12 +0000 (12:24 +0000)] 
PJSIP: Handle defaults properly

This updates the code behind PJSIP configuration options with custom
handlers to deal with the assigned default values properly where it
makes sense and adjusting the default value where it doesn't. Before
applying this patch, there were several cases where the default value
for an option would prevent that config section from loading properly.

Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4019/

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

10 years agoPJSIP: Force transport on contact rewrite
Kinsey Moore [Wed, 1 Oct 2014 12:13:20 +0000 (12:13 +0000)] 
PJSIP: Force transport on contact rewrite

If contact rewriting is enabled but the contact differs in transport
from what is actually being used, messages after the initial INVITE
transaction can be sent to an incorrect transport/port combination. In
the case where this bug occurred the remote party never received a BYE
since it was sent to the remote party's TCP port over UDP.

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

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

10 years agochan_sip: Simplify some unref code by removing unlink_peer_from_tables.
Walter Doekes [Wed, 1 Oct 2014 10:09:05 +0000 (10:09 +0000)] 
chan_sip: Simplify some unref code by removing unlink_peer_from_tables.

ASTERISK-22945 #related
Reported by: ibercom
Patches:
  asterisk11-chan_sip-simplifies.patch uploaded by ibercom (License #6599)
........

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

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

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

10 years agochan_sip: Remove excess ref of realtime peer before sip_poke_peer.
Walter Doekes [Wed, 1 Oct 2014 09:53:00 +0000 (09:53 +0000)] 
chan_sip: Remove excess ref of realtime peer before sip_poke_peer.

The peer is referenced at the end of sip_poke_peer, it should not get
an extra ref before the call to sip_poke_peer. This fixes a memory
leak.

ASTERISK-22945 #close
Reported by: ibercom
Tested by: Yuriy Gorlichenko
Patches:
  asterisk11.patch uploaded by ibercom (License #6599)

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

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

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

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

10 years agores_pjsip_sdp_rtp: Don't place an extra whitespace before 'rport' and don't put IPv6...
Joshua Colp [Tue, 30 Sep 2014 11:39:13 +0000 (11:39 +0000)] 
res_pjsip_sdp_rtp: Don't place an extra whitespace before 'rport' and don't put IPv6 addresses in brackets.

#SIPit31

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

10 years agores_rtp_asterisk: Ensure that the base and mapped address for candidates is present...
Joshua Colp [Tue, 30 Sep 2014 11:34:08 +0000 (11:34 +0000)] 
res_rtp_asterisk: Ensure that the base and mapped address for candidates is present in SDP.

This change fixes an issue where ICE candidates put into the SDP did not contain
the 'raddr' and 'rport' information for server reflexive and relay candidates.

#SIPit31
........

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

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

10 years agopjsip_cli: Suppress header print on error or no objects
George Joseph [Mon, 29 Sep 2014 21:58:40 +0000 (21:58 +0000)] 
pjsip_cli: Suppress header print on error or no objects

If there's an error on the pjsip command line or there are no objects, don't
print the column headers.

ASTERISK-24350 #close
Reported-by: Brad Latus
Tested-by: George Joseph
Tested-by: Brad Latus
Review: https://reviewboard.asterisk.org/r/4025/

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

10 years agoautosupport: Fix bashism.
Walter Doekes [Mon, 29 Sep 2014 21:25:32 +0000 (21:25 +0000)] 
autosupport: Fix bashism.

'==' is bashism (bashspecific, fails when dash is /bin/sh). Anyway, a
'case' works better there.

Originally committed in r375059 and r375060 on 2012-10-16 21:13:08.

ASTERISK-20567 #close
Reported by: Tzafrir Cohen
........

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

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

10 years agoSimplify UUID generation in several places.
Richard Mudgett [Mon, 29 Sep 2014 21:16:22 +0000 (21:16 +0000)] 
Simplify UUID generation in several places.

Replace code using ast_uuid_generate() with simpler and faster code using
ast_uuid_generate_str().  The new code avoids a malloc(), free(), and
copy.

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

10 years agothreadpool.c: Minor cleanup fixes.
Richard Mudgett [Mon, 29 Sep 2014 20:24:53 +0000 (20:24 +0000)] 
threadpool.c: Minor cleanup fixes.

* Fix threadpool_alloc() prototype.

* Add missing off-nominal NULL check of pool in threadpool_alloc().

* searializer_create() does not need to create the object with a lock as
the lock is not used.

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

10 years agores_pjsip_session: Add additional checks for delaying session refreshes.
Joshua Colp [Sat, 27 Sep 2014 12:42:30 +0000 (12:42 +0000)] 
res_pjsip_session: Add additional checks for delaying session refreshes.

There are certain situations which no checks existed for which need to prevent
session refreshes. This includes sending a session refresh with SDP before SDP
negotiation has completed and sending a session refresh before the dialog itself
has been established. Checks for these have been added.

Additionally COLP related UPDATEs were including SDP when it is not needed.

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

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

10 years agores_fax: Fix out of bounds error in update_modem_bits().
Richard Mudgett [Fri, 26 Sep 2014 15:19:39 +0000 (15:19 +0000)] 
res_fax: Fix out of bounds error in update_modem_bits().

ASTERISK-24357 #close
Reported by: Jeremy Laine
Patches:
      res_fax_bounds.patch (license #6561) patch uploaded by Jeremy Laine
  Modified patch to not use magic numbers.
........

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

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

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

10 years agodocs: Escape unescaped minus sign in asterisk.8 manpage.
Walter Doekes [Fri, 26 Sep 2014 08:24:26 +0000 (08:24 +0000)] 
docs: Escape unescaped minus sign in asterisk.8 manpage.

ASTERISK-23768 #close
Reported by: Jeremy Lainé
Patches:
  escape_manpage_hyphen.patch uploaded by Jeremy Lainé (License #6561)
........

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

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

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

10 years agores_pjsip.c: Add missing off nominal cleanup in ast_sip_push_task_synchronous().
Richard Mudgett [Thu, 25 Sep 2014 21:00:08 +0000 (21:00 +0000)] 
res_pjsip.c: Add missing off nominal cleanup in ast_sip_push_task_synchronous().

* Made memset the std struct in ast_sip_push_task_synchronous() because if
DEBUG_THREADS is enabled then uninitialized lock tracking data is used.

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

10 years agopjsip_options.c: Fix race condition stopping periodic out of dialog OPTIONS request.
Richard Mudgett [Wed, 24 Sep 2014 18:28:18 +0000 (18:28 +0000)] 
pjsip_options.c: Fix race condition stopping periodic out of dialog OPTIONS request.

The crash on the issues is a result of an invalid transport configuration
change when asterisk is restarted.  The attempt to send the qualify
request fails and we cleaned up.  However, the callback is also called
which results in a double unref of the objects involved.

* Put a wrapper around pjsip_endpt_send_request() to detect when the
passed in callback is called because of an error so callers can know to
not cleanup.

* Made send_request_cb() able to handle repeated challenges (Up to 10).

* Fix periodic endpoint qualify OPTIONS sched deletion race by avoiding
it.  The sched entry will no longer self stop and must be externally
stopped.

* Added REF_DEBUG description tags to struct sched_data in
pjsip_options.c.

* Fix some off-nominal ref leaks in schedule_qualify(),
qualify_and_schedule().

* Reordered pjsip_options.c module start/stop code to cleanup better on
error.

ASTERISK-24295 #close
Reported by: Rogger Padilla

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

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

10 years agochan_sip: Unref outbound proxy structure on dialog/pvt destruction.
Walter Doekes [Wed, 24 Sep 2014 08:52:24 +0000 (08:52 +0000)] 
chan_sip: Unref outbound proxy structure on dialog/pvt destruction.

Make sure outbound proxy refs are always unreffed on dialog destruction.

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

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

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

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

10 years agochan_sip: On INVITE retransmission, don't add an extra 503 response.
Walter Doekes [Mon, 22 Sep 2014 19:47:41 +0000 (19:47 +0000)] 
chan_sip: On INVITE retransmission, don't add an extra 503 response.

INVITE arrives to asterisk, asterisk responds Busy(). If the INVITE is
retransmitted, asterisk would generate a 503 in addition to the 486.

Thanks Torrey Searle for providing a working regression test.

ASTERISK-24335 #close

Review: https://reviewboard.asterisk.org/r/4003/
Patches:
  retrans_486_invite.patch uploaded by Torrey Searle (License #5334)
........

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

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

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

10 years agocli.c: Fix tab completion "module load" when MALLOC_DEBUG is enabled.
Walter Doekes [Mon, 22 Sep 2014 17:41:03 +0000 (17:41 +0000)] 
cli.c: Fix tab completion "module load" when MALLOC_DEBUG is enabled.

r421600 conflicted with r155763.

ASTERISK-24348 #close
........

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

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

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

10 years agorest-api/api-docs/events.json: Remove non-compliant 'extends' attribute
Matthew Jordan [Sat, 20 Sep 2014 23:54:58 +0000 (23:54 +0000)] 
rest-api/api-docs/events.json: Remove non-compliant 'extends' attribute

Prior to the release of Swagger 1.2, the attribute 'extends' was being
promoted as a possible way to show that a particular object extends an existing
object. Instead, the Swagger specification went with the 'subTypes' attribute
in the base object. This patch removes the unsupported attribute; the object
that the offending objects proposed to extend already lists them in its
'subTypes' attribute.

ASTERISK-24300 #close
Reported by: Bradley Watkins

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

10 years agorest-api/api-docs: Correct basePath in resources to match top resources file
Matthew Jordan [Sat, 20 Sep 2014 23:40:31 +0000 (23:40 +0000)] 
rest-api/api-docs: Correct basePath in resources to match top resources file

The resources.json file that defines the resource JSON files used with ARI
references a basePath of 'http://localhost:8088/ari'. This does not match what
is defined in the resource files themselves, 'http://localhost:8088/stasis'.
The correct base path is the one that includes 'ari' in the URL; this patch
updates the various resource JSON files to have the correct basePath.

ASTERISK-24339 #close
Reported by: Bradley Watkins

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

10 years agores_pjsip_notify: Fix crash on unload/load and don't say the module doesn't exist...
Joshua Colp [Fri, 19 Sep 2014 19:50:29 +0000 (19:50 +0000)] 
res_pjsip_notify: Fix crash on unload/load and don't say the module doesn't exist on reload.

When unloading the module did not unregister the CLI commands causing a crash upon
load when they were registered again.

When reloading the module the return value from the config options framework was not
checked to determine if an error occurred or not. This caused a message to be output
saying the module did not exist when reloading if no changes were present.

AST-1433 #close
AST-1434 #close

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

10 years agoStasis_channels: Resolve unfinished Dials when doing masquerades
Jonathan Rose [Fri, 19 Sep 2014 15:10:50 +0000 (15:10 +0000)] 
Stasis_channels: Resolve unfinished Dials when doing masquerades

Masquerades into channels that are in the dialing state don't end their dial
and this goes against the model for things like CDRs and generating Dial end
manager actions and such.

ASTERISK-24237 #close
Reported by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/3990/

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

10 years agoPJSIP: Prevent T38 framehook being put on wrong channel
Kinsey Moore [Fri, 19 Sep 2014 12:30:39 +0000 (12:30 +0000)] 
PJSIP: Prevent T38 framehook being put on wrong channel

This change gives framehooks a reverse-direction masquerade callback in
addition to chan_fixup_cb similar to the callback added to datastores
to handle the same situation. The new callback provides the same
parameters as the fixup callback, but is called on the new channel's
framehooks before moving framehooks from the old channel to the new
channel. This gives the framehooks an oppurtunity to decide whether
they should remain on the new channel or be removed.

This new callback is used to prevent the PJSIP T.38 framehook from
remaining on a masqueraded channel if the new channel is not also a
PJSIP channel. This was causing a crash when a local channel was
masqueraded into a PJSIP channel and the framehook was executed on the
local channel since the channel's tech private data was not structured
as expected.

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

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

10 years agores_pjsip: Don't require a password when doing userpass authentication.
Sean Bright [Thu, 18 Sep 2014 19:29:30 +0000 (19:29 +0000)] 
res_pjsip: Don't require a password when doing userpass authentication.

An empty password is valid for username/password authentication so we should
allow password to be empty/not supplied.

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

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

10 years agoutils: Create ast_strsep function that ignores separators inside quotes
George Joseph [Thu, 18 Sep 2014 19:21:56 +0000 (19:21 +0000)] 
utils: Create ast_strsep function that ignores separators inside quotes

This function acts like strsep with three exceptions...
* The separator is a single character instead of a string.
* Separators inside quotes are treated literally instead of like separators.
* You can elect to have leading and trailing whitespace and quotes
stripped from the result and have '\' sequences unescaped.

Like strsep, ast_strsep maintains no internal state and you can call it
recursively using different separators on the same storage.

Also like strsep, for consistent results, consecutive separators are not
collapsed so you may get an empty string as a valid result.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3989/

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

10 years agores_pjsip_endpoint_identifier_ip: Fix parsing of match value with CIDR
Jonathan Rose [Thu, 18 Sep 2014 16:44:26 +0000 (16:44 +0000)] 
res_pjsip_endpoint_identifier_ip: Fix parsing of match value with CIDR

Also fixes comma separates match lists

ASTERISK-24290 #close
Reported by: Ray Crumrine
Review: https://reviewboard.asterisk.org/r/3995/

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

10 years agoastobj2.c/refcounter.py: Fix to deal with invalid object refs.
Richard Mudgett [Thu, 18 Sep 2014 16:39:06 +0000 (16:39 +0000)] 
astobj2.c/refcounter.py: Fix to deal with invalid object refs.

* Make astob2 REF_DEBUG output an invalid object line when an invalid ao2
object ref/unref is attempted.  This is similar to the
constructor/destructor lines.

* Fixed refcounter.py to handle skewed objects that have
constructor/destructor states.

* Made refcounter.py highlight the invalid ao2 object refs by putting them
in their own section of the processed output file.

* Made refcounter.py highlight unreffing an object by more than one that
results in a negative ref count and the object being destroyed.  The
abnormally destroyed object is reported in the invalid and finalized
object sections of the output.

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

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

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

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

10 years agores_fax_spandsp: Properly handle cleanup before starting FAXes.
Mark Michelson [Thu, 18 Sep 2014 16:20:51 +0000 (16:20 +0000)] 
res_fax_spandsp: Properly handle cleanup before starting FAXes.

If faxing fails at a very early stage, then it is possible for
us to pass a NULL t30 state pointer to spandsp, which spandsp
is none too pleased with.

This patch ensures that we pass the correct pointer to spandsp
in the situation where we have not yet set our local t30 state
pointer.

ASTERISK-24301 #close
Reported by Matt Jordan
Patches:
ASTERISK-24301-fax.diff Uploaded by Mark Michelson (License #5049)
........

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

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

10 years agores_pjsip_pubsub: Add some type safety when generating NOTIFY bodies.
Mark Michelson [Thu, 18 Sep 2014 15:40:47 +0000 (15:40 +0000)] 
res_pjsip_pubsub: Add some type safety when generating NOTIFY bodies.

res_pjsip_pubsub has two separate checks that it makes when a SUBSCRIBE
arrives.
* It checks that there is a subscription handler for the Event
* It checks that there are body generators for the types in the Accept header

The problem is, there's nothing that ensures that these two things will
actually mesh with each other. For instance, Asterisk will accept a subscription
to MWI that accepts pidf+xml bodies. That doesn't make sense.

With this commit, we add some type information to the mix. Subscription
handlers state they generate data of type X, and body generators state
that they consume data of type X. This way, Asterisk doesn't end up in
some hilariously mismatched situation like the one in the previous paragraph.

ASTERISK-24136 #close
Reported by Mark Michelson

Review: https://reviewboard.asterisk.org/r/3877
Review: https://reviewboard.asterisk.org/r/3878

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

10 years agores_pjsip: ami: Fix error in AMI output when an endpoint has no transport
George Joseph [Thu, 18 Sep 2014 15:01:11 +0000 (15:01 +0000)] 
res_pjsip: ami: Fix error in AMI output when an endpoint has no transport

When no transport is associated to an endpoint, the AMI output for
PJSIPShowEndpoint indicates an error instead of silently ignoring the
missing transport.

This patch causes the error to appear only if a transport was specified
on the endpoint and the transport doesn't exist.  It also fixes an issue
with counting the objects that were actually found.

ASTERISK-24161 #close
ASTERISK-24331 #close
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3998/

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

10 years agoconfig: bug: Fix SEGV in ast_category_insert when matching category isn't found
George Joseph [Thu, 18 Sep 2014 14:43:41 +0000 (14:43 +0000)] 
config: bug: Fix SEGV in ast_category_insert when matching category isn't found

If you call ast_category_insert with a match category that doesn't exist, the
list traverse runs out of 'next' categories and you get a SEGV.  This patch
adds check for the end-of-list condition and changes the signature to return
an int for success/failure indication instead of a void.

The only consumer of this function is manager and it was also changed to use
the return value.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3993/
........

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

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

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

10 years agores_rtp_asterisk: Ensure that the thread terminating pj stuff is registered.
Joshua Colp [Wed, 17 Sep 2014 18:04:25 +0000 (18:04 +0000)] 
res_rtp_asterisk: Ensure that the thread terminating pj stuff is registered.
........

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

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

10 years agores_rtp_asterisk: Fix 100% CPU usage due to timer heap thread spinning.
Joshua Colp [Tue, 16 Sep 2014 21:02:53 +0000 (21:02 +0000)] 
res_rtp_asterisk: Fix 100% CPU usage due to timer heap thread spinning.

Side note: I need a vacation.
........

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

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

10 years agores_rtp_asterisk: Fix building when pjproject is not used.
Joshua Colp [Tue, 16 Sep 2014 20:31:31 +0000 (20:31 +0000)] 
res_rtp_asterisk: Fix building when pjproject is not used.
........

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

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

10 years agores_pjsip_session: Fix usage of wrong memory pool when creating local SDP.
Joshua Colp [Tue, 16 Sep 2014 12:11:09 +0000 (12:11 +0000)] 
res_pjsip_session: Fix usage of wrong memory pool when creating local SDP.

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

10 years agores_rtp_asterisk: Fix a myriad of TURN client issues.
Joshua Colp [Tue, 16 Sep 2014 11:09:25 +0000 (11:09 +0000)] 
res_rtp_asterisk: Fix a myriad of TURN client issues.

1. The number of file descriptors an ioqueue instance can handle is fixed, so we
now spawn the required number to handle the load.
2. Our transport identifiers were exceeding the range supported by pjnath.
3. The TURN client did not set up client binding causing needless bandwidth usage.
4. The code no longer updates address information on each packet.
5. STUN traffic was getting looped back to Asterisk instead of going through the
TURN server.
6. Synchronization now ensures things are completely setup or destroyed.
7. Logging now reflects the target the TURN server is sending to/receiving from
on our behalf.

ASTERISK-23577 #close
Reported by: Jay Jideliov

ASTERISK-23634 #close
Reported by: Roman Skvirsky

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

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

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

10 years agocontrib: Fix verifyi typo in alembic DB script ps_transport table.
Walter Doekes [Mon, 15 Sep 2014 10:45:23 +0000 (10:45 +0000)] 
contrib: Fix verifyi typo in alembic DB script ps_transport table.

Reported by: Zogot (on IRC)
Patches:
  tmp.diff uploaded by Zogot, cleaned up by me.

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

10 years agochan_sip: Clarify that sipdebug=yes cannot be undone by the CLI.
Walter Doekes [Sun, 14 Sep 2014 15:51:28 +0000 (15:51 +0000)] 
chan_sip: Clarify that sipdebug=yes cannot be undone by the CLI.

Document it in sip.conf.

ASTERISK-24249 #close
Reported by: Avinash Mohod

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

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

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

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

10 years agoBlocked revisions 423010
Kinsey Moore [Fri, 12 Sep 2014 18:19:48 +0000 (18:19 +0000)] 
Blocked revisions 423010

........
Bridging: Fix bouncing native bridge

This fixes a situation in Asterisk 1.8 and 11 where ast_channel_bridge
could cause a bouncing native bridge. In the case of the
dial_LS_options test, this was a remote RTP bridge which caused the
audio path to continually cycle between Asterisk and the remote
endpoints generating a large number of SIP messages and delaying the
test long enough to cause it to fail (checking timing was part of the
test). The root cause was that the code to decide whether to use native
bridging was expecting a time-remaining value of 0 to be the default
instead of the actual default value of -1. A value of 0 or negative
numbers could also be generated by preceding code in some
circumstances. Both issues are addressed in this patch.

ASTERISK-24211 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3987/
........

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

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

10 years agoRealtime: Fix a bug that caused realtime destroy command to crash
Jonathan Rose [Fri, 12 Sep 2014 16:01:36 +0000 (16:01 +0000)] 
Realtime: Fix a bug that caused realtime destroy command to crash

Also has could affect with anything that goes through ast_destroy_realtime.
If a CLI user used the command 'realtime destroy <family>' with only a single
column/value pair, Asterisk would crash when trying to create a variable list
from a NULL value.

ASTERISK-24231 #close
Reported by: Niklas Larsson
Review: https://reviewboard.asterisk.org/r/3985/

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

10 years agoRemove undocumented default behavior of ast_play_and_record_full acceptdtmf.
Mark Michelson [Thu, 11 Sep 2014 22:16:03 +0000 (22:16 +0000)] 
Remove undocumented default behavior of ast_play_and_record_full acceptdtmf.

ast_play_and_record_full() has a parameter called "acceptdtmf" that is a
string of acceptable DTMF digits that may be pressed by a caller to end
and accept the recording.

ARI uses this function in order to perform recording, and it provides
options for what is passed as acceptdtmf to ast_play_and_record_full().
By default, ARI passes an empty string, with the intention that no DTMF
can be used to end the recording.

The problem is that ast_play_and_record_full() attempts to be "helpful"
by setting "#" as the acceptdtmf if an empty string or NULL pointer
has been passed in. With ARI, this results in unexpected behavior
occurring if you have attempted to intercept "#" yourself in order
to perform some other manipulation of the live recording.

This change removes the "helpful" behavior by no longer accepting
"#" as a default acceptdtmf if none is specified by the caller of
ast_play_and_record_full(). This makes the ARI scenario work as
expected.

The other callers of ast_play_and_record_full() are app_voicemail
and app_minivm, and in both cases, they pass an explicit "#" to
ast_play_and_record_full() as acceptdtmf, so they are unaffected
by this change.

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

10 years agoconfig: bug: fix truncation of included config files on permissions error
George Joseph [Wed, 10 Sep 2014 16:02:54 +0000 (16:02 +0000)] 
config: bug: fix truncation of included config files on permissions error

ast_config_text_file_save() currently truncates include files as they
are processed.  If a subsequent include file or the main config file has
a permissions error that prevents writing, earlier include files are left
truncated resulting in a frantic search for backups.

This patch causes ast_config_text_file_save to check for write access
on all files before it truncates any of them.

Will be applied 1.8 > trunk.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3986/
........

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

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

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

10 years agopjsip/config_auth.c: Add missing whitespace to log messages.
Sean Bright [Wed, 10 Sep 2014 15:58:45 +0000 (15:58 +0000)] 
pjsip/config_auth.c: Add missing whitespace to log messages.

The errors generated when validating 'auth' settings are missing a space which
makes the messages a little confusing.

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

10 years agoSounds/BuildSystem: Modifications to include new releases and Japanese language.
Rusty Newton [Sun, 7 Sep 2014 00:09:54 +0000 (00:09 +0000)] 
Sounds/BuildSystem: Modifications to include new releases and Japanese language.

Modifying Makefile and sounds.xml to include new core 1.4.26 and extra 1.4.15
sound prompt releases, plus the new Japanese core sound prompts contributed
by QLOOG.

ASTERISK-23324
Reported by: Kevin McCoy
Tested by: Rusty Newton
........

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

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

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

10 years agomain/cdr: Copy over location information during a fork
Matthew Jordan [Sat, 6 Sep 2014 22:48:24 +0000 (22:48 +0000)] 
main/cdr: Copy over location information during a fork

When a CDR is forked, a new CDR is created and appended to the CDR chain for
the Party A. The forked CDR starts life off as a clone of the last
non-finalized for the particular Party A. In the past, merely copying over
the snapshots for Party A/Party B would be sufficient. However, as the CDRs
now contain cached information from Party A - specifically application/data,
context, and extension - we need to copy that over during a fork as well.

Huzzah for unit tests catching this when the context/extension were derived
from a cached value on the CDR instead of on Party A.

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

10 years agomain/rtp_engine: Format NTP timestamps as unsigned ints
Matthew Jordan [Sat, 6 Sep 2014 22:20:27 +0000 (22:20 +0000)] 
main/rtp_engine: Format NTP timestamps as unsigned ints

On some systems, a timeval's tv_sec/tv_usec will be unsigned lont ints, as
opposed to long ints. When the RTP engine formats these as strings, it was
previously formatting them as signed integers, which can result in some
odd negative timestamp values (particularly on 32-bit systems). This patch
formats the values as unsigned long integers.

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

10 years agores_pjsip_sdp_rtp: Fix retrieval of "ice-pwd" attribute if in session and not media...
Joshua Colp [Sat, 6 Sep 2014 19:11:25 +0000 (19:11 +0000)] 
res_pjsip_sdp_rtp: Fix retrieval of "ice-pwd" attribute if in session and not media stream.

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

10 years agomain/cdrs: Preserve context/extension when executing a Macro or GoSub
Matthew Jordan [Fri, 5 Sep 2014 22:02:23 +0000 (22:02 +0000)] 
main/cdrs: Preserve context/extension when executing a Macro or GoSub

The context/extension in a CDR is generally considered the destination of a
call. When looking at a 2-party call CDR, users will typically be presented
with the following:

context    exten      channel     dest_channel app  data
default    1000       SIP/8675309 SIP/1000     Dial SIP/1000,,20

However, if the Dial actually takes place in a Macro, the current behaviour
in 12 will result in the following CDR:

context    exten      channel     dest_channel app  data
macro-dial s          SIP/8675309 SIP/1000     Dial SIP/1000,,20

The same is true of a GoSub:

context    exten      channel     dest_channel app  data
subs       dial_stuff SIP/8675309 SIP/1000     Dial SIP/1000,,20

This generally makes the context/exten fields less than useful.

It isn't hard to preserve these values in the CDR state machine; however, we
need to have something that informs us when a channel is executing a
subroutine. Prior to this patch, there isn't anything that does this.

This patch solves this problem by adding a new channel flag,
AST_FLAG_SUBROUTINE_EXEC. This flag is set on a channel when it executes a
Macro or a GoSub. The CDR engine looks for this value when updating a Party A
snapshot; if the flag is present, we don't override the context/exten on the
main CDR object. In a funny quirk, executing a hangup handler must *not* abide
by this logic, as the endbeforehexten logic assumes that the user wants to see
data that occurs in hangup logic, which includes those subroutines. Since
those execute outside of a typical Dial operation (and will typically have
their own dedicated CDR anyway), this is unlikely to cause any heartburn.

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

ASTERISK-24254 #close
Reported by: tm1000, Tony Lewis
Tested by: Tony Lewis

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

10 years agomain/cdr: Fix crash/memory consumption in CDRs in multi-party bridge scenarios
Matthew Jordan [Fri, 5 Sep 2014 21:53:35 +0000 (21:53 +0000)] 
main/cdr: Fix crash/memory consumption in CDRs in multi-party bridge scenarios

This patch fixes an issue where CDRs would get stuck generating an infinite
number of CDRs, eventually crashing Asterisk (and consuming a lot of memory
along the way).

When a channel enters into a multi-party bridge, the CDR engine creates
mappings of each participant to each other participant, picking the 'A' party
as it goes. So, if we have four channels in a multi-party bridge (Alice, Bob,
Charlie, Denise), we would have something like:

Alice => Bob
Alice => Charlie
Alice => Denise
Bob => Charlie
Bob => Denise
Charlie => Denise

This works fine when participants enter the bridge a single time.

When a participant leaves a bridge, the CDRs for that channel are transitioned
to a finalized state.

The bug occurs if Bob rejoins. When the CDR engine creates mappings between the
channels, it walks through all the participants currently in the bridge, and
realizes that no one in the bridge can create a CDR with the channel (Bob).
As such it creates a new CDR for the candidate and appends it to that
candidate's chain. Unfortunately, on this particular code path, it doesn't
stop traversing the candidate's chain. Since we just added ourselves to the
chain, this causes the loop to keep going, constantly adding new CDRs.

This patch makes it so the engine bails when it creates a CDR match in this
case.

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

ASTERISK-24241 #close
Reported by: Deepak Singh Rawat
Tested by: Deepak Singh Rawat

ASTERISK-24208
Reported by: Frankie Chin

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

10 years agoCall IDs: Fix appearance of call ID in core show channels when NULL
Jonathan Rose [Fri, 5 Sep 2014 17:46:14 +0000 (17:46 +0000)] 
Call IDs: Fix appearance of call ID in core show channels when NULL

NULL call IDs were meant to appear as '(none)' but instead were showing
the contents of an uninitialized character buffer.

ASTERISK-24223
Review: https://reviewboard.asterisk.org/r/3979/

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

10 years agoManager: Require read permission for SYSTEM in order to send FullyBooted
Jonathan Rose [Thu, 4 Sep 2014 20:46:46 +0000 (20:46 +0000)] 
Manager: Require read permission for SYSTEM in order to send FullyBooted

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

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

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

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

10 years agores_pjsip_transport_websocket: Fix crash when the Contact header is not a URI.
Joshua Colp [Wed, 3 Sep 2014 14:03:27 +0000 (14:03 +0000)] 
res_pjsip_transport_websocket: Fix crash when the Contact header is not a URI.

The code for changing the Contact header wrongly assumed that the Contact
would always contain a URI. This is incorrect.

ASTERISK-24271
Reported by: Dafi Ni

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

10 years agoResolve race condition where channels enter dialplan application before media has...
Mark Michelson [Tue, 2 Sep 2014 18:16:55 +0000 (18:16 +0000)] 
Resolve race condition where channels enter dialplan application before media has been negotiated.

Testsuite tests will occasionally fail because on reception of a 200 OK SIP response,
an AST_CONTROL_ANSWER frame is queued prior to when media has finished being
negotiated. This is because session supplements are called into before PJSIP's
inv_session code has told us that media has been updated. Sometimes the queued answer
frame is handled by the PBX thread before the ensuing media negotiations occur, causing
a test failure.

As it turns out, there is another place that session supplements could be called into, which is
after media has finished getting negotiated. What this commit introduces is a means for session
supplements to indicate when they wish to be called into when handling an incoming SIP response.
By default, all session supplements will be run at the same point that they were prior to this
commit. However, session supplements may indicate that they wish to be handled earlier than
normal on redirects, or they may indicate they wish to be handled after media has been negotiated.

In this changeset, two session supplements have been updated to indicate a preference for when
they should be run: res_pjsip_diversion executes before handling redirection in order to get
information from the Diversion header, and chan_pjsip now handles responses to INVITEs after
media negotiation to fix the race condition mentioned previously.

ASTERISK-24212 #close
Reported by Matt Jordan

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

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

10 years agomain/cli: Do not attempt to show CDR data for internal channels
Matthew Jordan [Mon, 1 Sep 2014 14:16:12 +0000 (14:16 +0000)] 
main/cli: Do not attempt to show CDR data for internal channels

Internal channels don't have CDRs. Querying the CDR engine for their variables
will make it cranky.

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

10 years agores_stasis: Don't play MoH to channels by default when added to holding bridges
Matthew Jordan [Mon, 1 Sep 2014 14:07:04 +0000 (14:07 +0000)] 
res_stasis: Don't play MoH to channels by default when added to holding bridges

When ARI manipulates a bridge, it generally doesn't care what the mixing
technology is. Operations on a bridge initiated through ARI should perform
their action in generally the same way, regardless of the bridge's mixing
technology. While the mixing technology may determine how media flows to
channels, the actual operations on a bridge themselves should be the same.

Currently, this isn't the case with holding bridges. When a channel joins
without a role, MoH is started on that channel automatically. Subsequent bridge
operations that would stop MoH would fail (as there is no Announcer channel
playing MoH to the bridge). Starting MoH on the bridge will also create two
MoH streams: one from the MoH being played on the participant channel, and one
from the announcer channel. From the perspective of ARI users, this is
counter-intuitive - I would not expect MoH to be started for me. The mixing
technology determines how media is shared between participants, not the
application experience.

This patch does the following:
 * The Stasis bridge class now inspects channels as they are going into a
   bridge. If the bridge has a holding capability, and the channel has no
   roles, we give it a participant role and mark the default behaviour to have
   no entertainment. This allows addChannel operations to continue to set a
   participant role with an entertainment option if it felt like it (or could
   do it).
 * The music on hold channel is now Stasis approved (tm)

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

ASTERISK-24264 #close
Reported by: Samuel Galarneau
Tested by: Samuel Galarneau

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

10 years agoconfbridge: Add Duration to ConfbridgeList event
George Joseph [Sat, 30 Aug 2014 17:28:04 +0000 (17:28 +0000)] 
confbridge: Add Duration to ConfbridgeList event

The ConfbridgeList event doesn't include how long the user has been a
member of the conference.  This patch adds Duration (seconds) which
is based on user->chan->answertime.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3955/

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

10 years agomanager: Make WaitEvent action respect eventfilters
George Joseph [Sat, 30 Aug 2014 17:22:55 +0000 (17:22 +0000)] 
manager: Make WaitEvent action respect eventfilters

A WaitEvent issued via an http session isn't respecting eventfilters defined
for the user. I just added a match_filter to the predicate that controls
astman_append.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3958/
........

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

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

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

10 years agodoc: Add a manpage for the smsq utility
Matthew Jordan [Fri, 29 Aug 2014 19:39:42 +0000 (19:39 +0000)] 
doc: Add a manpage for the smsq utility

This patch adds a manpage for the smsq utility. Note that this is one of
the patches the Debian distro applies for the Asterisk project, as per
ASTERISK-24191.

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

ASTERISK-24171 #close
Reported by: Jeremy Laine
patches:
  smsq.8 uploaded by Jeremy Laine (License 6561)
........

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

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

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

10 years agodoc: Add a manpage for the aelparse utility
Matthew Jordan [Fri, 29 Aug 2014 19:32:49 +0000 (19:32 +0000)] 
doc: Add a manpage for the aelparse utility

This patch adds a manpage for the aelparse utility. Note that this is one of
the patches the Debian distro applies for the Asterisk project, as per
ASTERISK-24191.

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

ASTERISK-24171 #close
Reported by: Jeremy Laine
patches:
  aelparse.8 uploaded by Jeremy Laine (License 6561)
........

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

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

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