]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
11 years agofunc_audiohookinherit.c: Fixup some XML documentation wording.
Richard Mudgett [Fri, 18 Jul 2014 16:46:35 +0000 (16:46 +0000)] 
func_audiohookinherit.c: Fixup some XML documentation wording.

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

11 years agoChannels: Masquerades to automatically move frame/audio hooks
Jonathan Rose [Fri, 18 Jul 2014 16:01:57 +0000 (16:01 +0000)] 
Channels: Masquerades to automatically move frame/audio hooks

Whenever possible, audiohooks and framehooks will now be copied over
to the channel that the masquerading channel gets cloned into. This
should occur for all audiohooks and most framehooks. As a result,
in Asterisk 12.5 and up, the AUDIOHOOK_INHERIT function is now
deprecated and its behavior is essentially the new default for all
audiohooks, plus some additional audiohooks/framehooks.

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

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

11 years agofeature_config: insure featuregroups and applicationmaps are initialized
Scott Griepentrog [Thu, 17 Jul 2014 22:17:33 +0000 (22:17 +0000)] 
feature_config: insure featuregroups and applicationmaps are initialized

If the features.conf is missing, the cfg->featurgroups
and cfg->applicationmaps is not initialized, resulting
in assert on ao2_find of a null container.  This patch
changes the initialization call and adds asserts for a
safeguard.

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

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

11 years agoTEST_FRAMEWORK: Fix threewaytransfer reporting
Kinsey Moore [Thu, 17 Jul 2014 14:27:40 +0000 (14:27 +0000)] 
TEST_FRAMEWORK: Fix threewaytransfer reporting

Ensure that three-way transfers can be reported even if featuremap is
non-NULL.

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

11 years agoRemove include of astobj.h from channels/dahdi/bridge_native_dahdi.c.
Corey Farrell [Wed, 16 Jul 2014 23:06:06 +0000 (23:06 +0000)] 
Remove include of astobj.h from channels/dahdi/bridge_native_dahdi.c.

The include was unneeded, this is split off from r3758 as it applies to 12.

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

11 years agores_pjsip: Support setting a default accountcode on endpoints
Matthew Jordan [Wed, 16 Jul 2014 13:58:07 +0000 (13:58 +0000)] 
res_pjsip: Support setting a default accountcode on endpoints

Most channel drivers let you specify a default accountcode to be set on
channels associated with a particular peer/endpoint/object. Prior to this
patch, chan_pjsip/res_pjsip did not support such a setting.

This patch adds a new setting to the res_pjsip endpoint object, 'accountcode'.
When a channel is created that is associated with an endpoint with this value
set, the channel will automatically have its accountcode property set to the
value configured for the endpoint.

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

ASTERISK-24000 #close
Reported by: Matt Jordan

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

11 years agoTEST_FRAMEWORK: Fix ref leak in feature activation
Kinsey Moore [Tue, 15 Jul 2014 23:03:04 +0000 (23:03 +0000)] 
TEST_FRAMEWORK: Fix ref leak in feature activation

This fixes two reference leaks that would occur when TEST_FRAMEWORK was
enabled and features were successfully executed.

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

11 years agomanager: Return ActionID on nominal responses to PresenceState action
Matthew Jordan [Tue, 15 Jul 2014 22:20:54 +0000 (22:20 +0000)] 
manager: Return ActionID on nominal responses to PresenceState action

When the PresenceState action is executed, the nominal path fails to include
the ActionID in the successful response. This patch adds a call to
astman_start_ack, which guarantees that an ActionID (if provided) will be
sent back to the AMI client.

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

ASTERISK-23985 #close
........

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

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

11 years agofunc_uri: URIENCODE/URIDECODE - allow empty strings as argument
Jonathan Rose [Tue, 15 Jul 2014 17:45:49 +0000 (17:45 +0000)] 
func_uri: URIENCODE/URIDECODE - allow empty strings as argument

Previously these two dialplan functions would issue warnings and
return failure when an empty string is used as the argument. Now
they will not issue a warning and will successfully return an
empty string.

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

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

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

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

11 years agomedia formats: fix ref leak of peer for mwi subscription
Scott Griepentrog [Tue, 15 Jul 2014 17:14:57 +0000 (17:14 +0000)] 
media formats: fix ref leak of peer for mwi subscription

Holding a reference to the peer during mwi subscriptions
resulted in a circular reference because the final event
message would not be sent until destruction of the peer.

Instead, pass the name of the peer to the event callback
so that it can fail gracefully after the peer has gone.

ASTERISK-23959
Review: https://reviewboard.asterisk.org/r/3754/

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

11 years agologger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().
Richard Mudgett [Mon, 14 Jul 2014 14:46:11 +0000 (14:46 +0000)] 
logger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().

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

11 years agoastobj2: work around REF_DEBUG race which causes out of order log entries
Corey Farrell [Sun, 13 Jul 2014 21:55:41 +0000 (21:55 +0000)] 
astobj2: work around REF_DEBUG race which causes out of order log entries

* Update refcounter.py to use delta's to track the current reference count.
* Use result from internal_ao2_ref to write old_refcount to refs_log.

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

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

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

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

11 years agoFix minor reference leaks in app_skel and TEST_FRAMEWORK
Corey Farrell [Sun, 13 Jul 2014 16:44:56 +0000 (16:44 +0000)] 
Fix minor reference leaks in app_skel and TEST_FRAMEWORK

* Cleanup games object in app_skel.
* Cleanup stasis subscription to TEST_FRAMEWORK in manager.c (12+).

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

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

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

11 years agoastobj2: tweak ao2_replace to do nothing when it would be a NoOp
Corey Farrell [Fri, 11 Jul 2014 21:09:43 +0000 (21:09 +0000)] 
astobj2: tweak ao2_replace to do nothing when it would be a NoOp

This change causes ao2_replace to do nothing when src == dst. This
avoids REF_DEBUG logging when we're not actually doing anything.

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

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

11 years agoconfig: inform config hook of change when writing file
Scott Griepentrog [Fri, 11 Jul 2014 16:40:54 +0000 (16:40 +0000)] 
config: inform config hook of change when writing file

When updated configuration is written back to the conf
file - for example when a user changes their voicemail
pin, make sure that any config hook that wants to know
of changes is informed.

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

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

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

11 years agoinclude/asterisk/xmpp.h: Convert indentation to tabs
Matthew Jordan [Thu, 10 Jul 2014 15:35:53 +0000 (15:35 +0000)] 
include/asterisk/xmpp.h: Convert indentation to tabs

This is a whitespace only change.
........

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

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

11 years agochan_dahdi/sig_pri: Fix type mismatch in the idledial feature's channel creation.
Richard Mudgett [Thu, 10 Jul 2014 01:52:24 +0000 (01:52 +0000)] 
chan_dahdi/sig_pri: Fix type mismatch in the idledial feature's channel creation.

Square pegs in round holes don't work very well.
........

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

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

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

11 years agoARI: Make mixing bridges propagate linkedids and accountcodes.
Richard Mudgett [Wed, 9 Jul 2014 16:18:57 +0000 (16:18 +0000)] 
ARI: Make mixing bridges propagate linkedids and accountcodes.

* Create a Stasis bridge sub-class to propagate linkedids and
accountcodes.

* Fixed the basic bridge sub-class to update peeraccount codes when the
number of channels in the bridge drops back down to two parties.

* Refactored ast_bridge_channel_update_accountcodes() to handle channels
joining/leaving the bridge.

* Fixed the basic bridge sub-class to not call the base bridge class pull
method twice.

AFS-105 #close
ASTERISK-23852 #close
Reported by: Richard Mudgett

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

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

11 years agomanager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txt
Matthew Jordan [Tue, 8 Jul 2014 14:47:46 +0000 (14:47 +0000)] 
manager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txt

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

11 years agores_rtp_asterisk: Fix undefined function when PJPROJECT is not installed
Matthew Jordan [Tue, 8 Jul 2014 14:37:51 +0000 (14:37 +0000)] 
res_rtp_asterisk: Fix undefined function when PJPROJECT is not installed

The dtls_perform_handshake function was mistakenly placed under the guards for
USE_PJPROJECT. If PJPROJECT was not installed, the function would not be
defined, while other functions would attempt to still use it. This prevented
res_rtp_asterisk from being loaded.

ASTERISK-24001 #close
Reported by: Don Fanning

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

11 years agores_pjsip_dialog_info_body_generator: Add dialog-info+xml support for presence.
Joshua Colp [Mon, 7 Jul 2014 16:05:44 +0000 (16:05 +0000)] 
res_pjsip_dialog_info_body_generator: Add dialog-info+xml support for presence.

This module implements dialog-info+xml for the purposes of presence. This means
that phones such as Grandstreams can now subscribe to receive presence information
for an extension.

ASTERISK-21443 #close
Reported by: Matt Jordan

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

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

11 years agoARI/res_stasis: Subscribe to both Local channel halves when originating to app
Matthew Jordan [Mon, 7 Jul 2014 02:13:13 +0000 (02:13 +0000)] 
ARI/res_stasis: Subscribe to both Local channel halves when originating to app

This patch fixes two bugs:

1. When originating a channel into a Stasis application, we already create a
   subscription for the channel that is going into our Stasis app.
   Unfortunately, when you create a Local channel and pass it off to a Stasis
   app, you really aren't creating just one channel: you're creating two. This
   patch snags the second half of the Local channel pair (assuming it is a
   Local channel pair, but luckily core_local is kind about such assumptions)
   and subscribes to it as well.

2. Subscriptions are a bit sticky right now. If a subscription is made, the
   'interest' count gets bumped on the Stasis subscription - but unless
   something explicitly unsubscribes the channel, said subscription sticks
   around. This is not much of a problem is a user is creating the subscription
   - if they made it, they must want it. However, when we are creating
   implicit subscriptions, we need to make sure something clears them out.
   This patch takes a pessimistic approach: it watches the cache updates
   coming from Stasis and, if we notice that the cache just cleared out an
   object, we delete our subscription object. This keeps our ao2 container of
   Stasis forwards in an application from growing out of hand; it also is a
   bit more forgiving for end users who may not realize they were supposed to
   unsubscribe from that channel that just hung up.

Review: https://reviewboard.asterisk.org/r/3710/
ASTERISK-23939 #close

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

11 years agoCEL: Fix incorrect/missing extra field information
Kinsey Moore [Mon, 7 Jul 2014 01:18:58 +0000 (01:18 +0000)] 
CEL: Fix incorrect/missing extra field information

This corrects two issues with the extra field information in Asterisk
12+ in channel event logs.

It is possible to inject custom values into the dialstatus provided by
ast_channel_dial_type() Stasis messages that fall outside the
enumeration allowed for the DIALSTATUS channel variable. CEL now
filters for the allowed values and ignores other values.

The "hangupsource" extra field key is always blank if the far end
channel is a chan_pjsip channel. This is because the hangupsource is
never set for the pjsip channel driver. This change sets the
hangupsource whenever a hangup is queued for chan_pjsip channels.

This corrects an issue with the pjsip channel driver where the
hangupcause information was not being set properly.

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

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

11 years agoHTTP: Fix build for gcc 4.10
Kinsey Moore [Mon, 7 Jul 2014 01:00:46 +0000 (01:00 +0000)] 
HTTP: Fix build for gcc 4.10

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

11 years agochan_dahdi: Add inband_on_setup_ack compatibility option.
Richard Mudgett [Thu, 3 Jul 2014 22:06:02 +0000 (22:06 +0000)] 
chan_dahdi: Add inband_on_setup_ack compatibility option.

The new inband_on_setup_ack option causes Asterisk to assume inband audio
may be present when a SETUP_ACKNOWLEDGE message is received.

Q.931 Section 5.1.3 says that in scenarios with overlap dialing, when a
dialtone is sent from the network side, progress indicator 8 "Inband info
now available" MAY be sent to the CPE if no digits were received with the
SETUP.  It is thus implied that the ie is mandatory if digits came with
the SETUP and dialtone is needed.  This option should be enabled, when the
network sends dialtone and you want to hear it, but the network doesn't
send the progress indicator when needed.

NOTE: For Q.SIG setups this option should be enabled when outgoing overlap
dialing is also enabled because Q.SIG does not send the progress indicator
with the SETUP ACK.

The commit -r413714 (AST-1338) which causes this issue was dealing with a
SIP-to-ISDN interoperability issue.

This commit is a merge of the two patches indicated below.

ASTERISK-23897 #close
Reported by: Pavel Troller
Patches:
      pri-4.diff (license #6302) patch uploaded by Pavel Troller
      jira_asterisk_23897_v11.patch (license #5621) patch uploaded by rmudgett

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

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

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

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

11 years agores_ari: Fix some off-nominal paths just dropping the HTTP connection.
Richard Mudgett [Thu, 3 Jul 2014 19:00:09 +0000 (19:00 +0000)] 
res_ari: Fix some off-nominal paths just dropping the HTTP connection.

* Removed some incorrect newlines on ast_http_error() messages in
manager.c.

* Removed an incorrect newline in res_ari_channels.c.

Addendum to ASTERISK-23552

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

11 years agoHTTP: Add persistent connection support.
Richard Mudgett [Thu, 3 Jul 2014 16:16:16 +0000 (16:16 +0000)] 
HTTP: Add persistent connection support.

Persistent HTTP connection support is needed due to the increased usage of
the Asterisk core HTTP transport and the frequency at which REST API calls
are going to be issued.

* Add http.conf session_keep_alive option to enable persistent
connections.

* Parse and discard optional chunked body extension information and
trailing request headers.

* Increased the maximum application/json and
application/x-www-form-urlencoded body size allowed to 4k.  The previous
1k was kind of small.

* Removed a couple inlined versions of ast_http_manid_from_vars() by
calling the function.  manager.c:generic_http_callback() and
res_http_post.c:http_post_callback()

* Add missing va_end() in ast_ari_response_error().

* Eliminated unnecessary RAII_VAR() use in http.c:auth_create().

ASTERISK-23552 #close
Reported by: Scott Griepentrog

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

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

11 years agoARI: Improvements to body parameters documentation
Sam Galarneau [Thu, 3 Jul 2014 16:07:43 +0000 (16:07 +0000)] 
ARI: Improvements to body parameters documentation

The variables body parameter under the originate and originate with id
operations of the channel resource showed invalid JSON in its description.

The variables body parameter under the userEvent operation of the event
resource made no mention that the custom key/value pairs should be wrapped
in a variables key in order to be added to the custom user event.

ASTERISK-23975 #close

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

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

11 years agomain/untils: Prevent potential infinite loop in ast_careful_fwrite
Matthew Jordan [Thu, 3 Jul 2014 11:26:26 +0000 (11:26 +0000)] 
main/untils: Prevent potential infinite loop in ast_careful_fwrite

A loop in ast_careful_fwrite exists that will continually attempt to write to
a file stream, even in the presence of EAGAIN/EINTR errors. However, if a
connection that uses ast_careful_fwrite closes suddenly, ast_careful_fwrite's
call to fflush may return EAGAIN/EINTER along with EOF. A subsequent call to
fflush will return EOF but not clear errno, resulting in an infinite loop.

This patch clears errno after it is detected and handled the loop, such that
any subsequent call to fflush will not get erroneously stuck.

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

#ASTERISK-23984 #close
Reported by: Steve Davies
patches:
  fflush_loop_fix uploaded by one47 (License 5012)
........

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

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

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

11 years agores_rtp_asterisk: Don't leak memory or reset state if DTLS configuration is set multi...
Joshua Colp [Tue, 1 Jul 2014 14:40:24 +0000 (14:40 +0000)] 
res_rtp_asterisk: Don't leak memory or reset state if DTLS configuration is set multiple times.

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

11 years agoRecorded merge of revisions 417677 from http://svn.asterisk.org/svn/asterisk/branches/11
Joshua Colp [Mon, 30 Jun 2014 19:46:58 +0000 (19:46 +0000)] 
Recorded merge of revisions 417677 from http://svn.asterisk.org/svn/asterisk/branches/11

........
res_rtp_asterisk: Add SHA-256 support for DTLS and perform DTLS negotiation on RTCP.

This change fixes up DTLS support in res_rtp_asterisk so it can accept and provide
a SHA-256 fingerprint, so it occurs on RTCP, and so it occurs after ICE negotiation
completes. Configuration options to chan_sip and chan_pjsip have also been added to
allow behavior to be tweaked (such as forcing the AVP type media transports in SDP).

ASTERISK-22961 #close
Reported by: Jay Jideliov

Review: https://reviewboard.asterisk.org/r/3679/
Review: https://reviewboard.asterisk.org/r/3686/

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

11 years agochan_sip: be more tolerant of whitespace between attributes in SDP fmtp line
Matthew Jordan [Mon, 30 Jun 2014 03:25:59 +0000 (03:25 +0000)] 
chan_sip: be more tolerant of whitespace between attributes in SDP fmtp line

This patch is essentially a backport of a small portion of r397526 from
ASTERISK-21981. In that patch, pass through support and format attribute
negotiation was added for Opus. Part of that included being more tolerant to
whitespace in the fmtp line of an SDP; that part of the patch is being
applied here.

As the author of the backport pointed out, in SDP, the fmtp line is allowed to
include whitespace between attributes. RFC 3267 chapter 8.3 (from 2001)
includes an example for this. This was not removed in the updated RFC 4867 in
2007.

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

#ASTERISK-23916 #close
Reported by: Alexander Traud
patches:
  sdpFMTPspace_Asterisk11.patch uploaded by Alexander Traud (License 6520)
........

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

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

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

11 years agoevent.c: Fix type mismatch errors in ie_maps[].
Richard Mudgett [Fri, 27 Jun 2014 23:11:26 +0000 (23:11 +0000)] 
event.c: Fix type mismatch errors in ie_maps[].

In v12+ the type values from the table are only used by the CEL unit
tests.  Since the unit tests were only comparing a generated expected
event with a real event to see if the ie contents matched and using the
same table IE_PLTYPE values to read the event contents, the type
mismatches were not detected.

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

11 years agoEnsure REF_DEBUG records entrys for attempts to ao2_ref an invalid object
Corey Farrell [Fri, 27 Jun 2014 19:27:13 +0000 (19:27 +0000)] 
Ensure REF_DEBUG records entrys for attempts to ao2_ref an invalid object

This change ensures that __ao2_ref_debug writes to ref_log when given a
non-NULL pointer to an invalid ao2 object.  This is to ensure that we
record any attempt manipulate references of already freed objects.

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

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

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

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

11 years agorefcounter.py: prevent use of excessive RAM with large refs logs
Corey Farrell [Fri, 27 Jun 2014 19:17:43 +0000 (19:17 +0000)] 
refcounter.py: prevent use of excessive RAM with large refs logs

When processing a 212MB refs file, refcounter.py used over 3GB of RAM.
This change greatly reduces memory usage in two ways:

* Saving object history in whole lines instead of separated values.
* Not saving normal/skewed/leaked object lists unless they are requested.

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

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

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

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

11 years agores_pjsip: Add ActionID to events created as a result of PJSIP AMI actions
Matthew Jordan [Fri, 27 Jun 2014 13:48:12 +0000 (13:48 +0000)] 
res_pjsip: Add ActionID to events created as a result of PJSIP AMI actions

A number of various PJSIP AMI actions were failing to parse out and place the
ActionID into their responses. This patch updates the various PJSIP actions
such that the passed in ActionID is emitted on any event list complete events,
as well as any intermediate events created as a result of the action.

ASTERISK-23947 #close
Reported by: Mark Michelson

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

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

11 years agores_http_websocket: Export symbol for ast_websocket_set_timeout
Matthew Jordan [Thu, 26 Jun 2014 18:27:25 +0000 (18:27 +0000)] 
res_http_websocket: Export symbol for ast_websocket_set_timeout

Thanks to Sean Bright for pointing out that this was missed in #asterisk-dev.
........

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

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

11 years agochan_pjsip: Add a test event for fast picture updates
Matthew Jordan [Thu, 26 Jun 2014 17:16:44 +0000 (17:16 +0000)] 
chan_pjsip: Add a test event for fast picture updates

This will drive the test on review r3419. Note that the patch for this was
done by Ben Ford, although it was slightly modified for this commit.

ASTERISK-23562
Reported by: Matt Jordan

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

11 years agoudptl: Correct FEC to not consider negative sequence numbers as missing
Matthew Jordan [Thu, 26 Jun 2014 12:23:27 +0000 (12:23 +0000)] 
udptl: Correct FEC to not consider negative sequence numbers as missing

When using FEC, with span=3 and entries=4 Asterisk will attempt to repair
the packet with sequence number 5, as it will see that packet -4 is
missing. The result is Asterisk sending garbage packets that can kill a
fax.

This patch adds a check to see if the sequence number is valid before
checking if the packet is missing.

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

#ASTERISK-23908 #close
Reported by: Torrey Searle
patches:
  udptl_fec.patch uploaded by Torrey Searle (License 5334)
........

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

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

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

11 years agores_http_websocket: Close websocket correctly and use careful fwrite
Matthew Jordan [Thu, 26 Jun 2014 12:10:11 +0000 (12:10 +0000)] 
res_http_websocket: Close websocket correctly and use careful fwrite

When a client takes a long time to process information received from Asterisk,
a write operation using fwrite may fail to write all information. This causes
the underlying file stream to be in an unknown state, such that the socket
must be disconnected. Unfortunately, there are two problems with this in
Asterisk's existing websocket code:
1. Periodically, during the read loop, Asterisk must write to the connected
   websocket to respond to pings. As such, Asterisk maintains a reference to
   the session during the loop. When ast_http_websocket_write fails, it may
   cause the session to decrement its ref count, but this in and of itself
   does not break the read loop. The read loop's write, on the other hand,
   does not break the loop if it fails. This causes the socket to get in a
   'stuck' state, preventing the client from reconnecting to the server.
2. More importantly, however, is that the fwrite in ast_http_websocket_write
   fails with a large volume of data when the client takes awhile to process
   the information. When it does fail, it fails writing only a portion of
   the bytes. With some debugging, it was shown that this was failing in a
   similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite
   with a long enough timeout solved the problem.

Note that this version of the patch, unlike r417310 in Asterisk 11, exposes
configuration options beyond just chan_sip's sip.conf. Configuration options
to configure the write timeout have also been added to pjsip.conf and ari.conf.

#ASTERISK-23917 #close
Reported by: Matt Jordan

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

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

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

11 years agochan_sip: Fix handling of "From" headers longer than 256 characters
Corey Farrell [Thu, 26 Jun 2014 10:05:20 +0000 (10:05 +0000)] 
chan_sip: Fix handling of "From" headers longer than 256 characters

From headers were processed using a 256 character buffer on the stack.
This change replaces that with a heap allocation by ast_strdup.

ASTERISK-23790 #close
Reported by: uniken1
Tested by: uniken1
Review: https://reviewboard.asterisk.org/r/3669/
Patches:
    chan_sip-large-from-header-1.8-r3.patch uploaded by wdoekes (license 5674)
........

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

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

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

11 years agoao2_container node object ignores REF_DEBUG in all places except one
Corey Farrell [Wed, 25 Jun 2014 18:56:09 +0000 (18:56 +0000)] 
ao2_container node object ignores REF_DEBUG in all places except one

Almost every reference operation against container node's uses
__ao2_alloc or __ao2_ref, thereby preventing ref logging for
the nodes.  One node reference is released with ao2_t_ref, causing
refcounter.py to falsely report skews and leaks for many nodes.

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

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

11 years agores_rtp_asterisk: Return the length of data written when sending via ICE instead...
Joshua Colp [Mon, 23 Jun 2014 18:49:56 +0000 (18:49 +0000)] 
res_rtp_asterisk: Return the length of data written when sending via ICE instead of 0.

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

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

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

11 years agocore_unreal: Fix off by one buffer overwrite error.
Richard Mudgett [Mon, 23 Jun 2014 15:53:09 +0000 (15:53 +0000)] 
core_unreal: Fix off by one buffer overwrite error.

Appending the ;2 to the user supplied ;1 uniqueid to create the ;2 version
if the user did not also supply an extra uniqueid for the ;2 channel
resulted in allocating a buffer that was one byte too small.

* Fix off by one error in ast_unreal_new_channels() when generating the ;2
uniqueid from the user suppled ;1 version.

* Pulled some long assignment lines from if tests to improve line break
readability in ast_unreal_new_channels().

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

11 years agoastobj2: Add an ao2_replace macro to astobj2.h
George Joseph [Sun, 22 Jun 2014 18:44:23 +0000 (18:44 +0000)] 
astobj2: Add an ao2_replace macro to astobj2.h

This macro replaces one object reference with another cleaning up the original.

param dst Pointer to the object that will be cleaned up.
param src Pointer to the object replacing it.

src's ref count is bumped if it's non-NULL.
dst's ref count is decremented if it's non-NULL.
src is assigned to dst,

This patch was reviewed on IRC by coreyfarrell and mjordan.

Tested by: George Joseph

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

11 years agobuild: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.
George Joseph [Fri, 20 Jun 2014 23:16:43 +0000 (23:16 +0000)] 
build: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.

ast_ext_tool_check.m4 isn't handling cases where a path to a package is
provided (E.G. --with-mysqlclient=/some/sysroot) and the package has a config
tool (E.G. mysql_config) and the package has its own subdirectories in include
or lib.  For example, mysql's libraries are in ${MYSQLCLIENT_DIR}/usr/lib/mysql
but ast_ext_tool_check sets MYSQLCLIENT_LIB to ${MYSQLCLIENT_DIR}/usr/lib.
libxml2 has the same problem with its includes.  They're in
${LIBXML2_DIR}/usr/include/libxml2 not directly in ${LIBXML2_DIR}/usr/include.
Both cause configure to fail and there are others in the same boat.

The problem is caused by logic in ast_ext_tool_check that overrides the result
of the config tool's --cflags and --libs options if package_DIR is set.

This patch prepends package_DIR (if specified) to the -L and -I results from
the package's config tool instead of overriding them.

A regenerated ./configure and include/asterisk/autoconfig.h.in are included
but can be regenerated by running ./bootstrap.sh at any time.

Tested by: George Joseph
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3550/
........

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

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

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

11 years agobuild: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.
George Joseph [Fri, 20 Jun 2014 21:57:57 +0000 (21:57 +0000)] 
build: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.

ast_ext_tool_check.m4 isn't handling cases where a path to a package is
provided (E.G. --with-mysqlclient=/some/sysroot) and the package has a config
tool (E.G. mysql_config) and the package has its own subdirectories in include
or lib.  For example, mysql's libraries are in ${MYSQLCLIENT_DIR}/usr/lib/mysql
but ast_ext_tool_check sets MYSQLCLIENT_LIB to ${MYSQLCLIENT_DIR}/usr/lib.
libxml2 has the same problem with its includes.  They're in
${LIBXML2_DIR}/usr/include/libxml2 not directly in ${LIBXML2_DIR}/usr/include.
Both cause configure to fail and there are others in the same boat.

The problem is caused by logic in ast_ext_tool_check that overrides the result
of the config tool's --cflags and --libs options if package_DIR is set.

This patch prepends package_DIR (if specified) to the -L and -I results from
the package's config tool instead of overriding them.

Tested by: George Joseph
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3550/
........

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

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

11 years agores_parking: Make manager commands register with module information
Jonathan Rose [Fri, 20 Jun 2014 20:46:28 +0000 (20:46 +0000)] 
res_parking: Make manager commands register with module information

Previously module information was not included due to an oversight.

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

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

11 years agoastobj2: Additional refactoring to push impl specific code down into the impls.
George Joseph [Fri, 20 Jun 2014 15:22:44 +0000 (15:22 +0000)] 
astobj2: Additional refactoring to push impl specific code down into the impls.

Move some implementation specific code from astobj2_container.c into
astobj2_hash.c and astobj2_rbtree.c.  This completely removes the need for
astobj2_container to switch on RTTI and it no longer has any knowledge of
the implementation details.

Also adds AO2_DEBUG as a new compile option in menuselect which controls
astobj2 debugging independently of AST_DEVMODE and REF_DEBUG.

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

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

11 years agopjsip cli: Change Identify to show CIDR notation instead of netmasks.
George Joseph [Thu, 19 Jun 2014 20:12:15 +0000 (20:12 +0000)] 
pjsip cli: Change Identify to show CIDR notation instead of netmasks.

* Added ast_sockaddr_cidr_bits() to count the 1 bits in an ast_sockaddr.
* Added ast_ha_join_cidr() which uses ast_sockaddr_cidr_bits() for the netmask
  instead of ast_sockaddr_stringify_addr.
* Changed res_pjsip_endpoint_identifier_ip to call ast_ha_join_cidr() instead
  of ast_ha_join() for the CLI output.

This is a CLI change only.  AMI was not affected.

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

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

11 years agoFix build warnings with TEST_FRAMEWORK enabled
Kinsey Moore [Thu, 19 Jun 2014 19:35:52 +0000 (19:35 +0000)] 
Fix build warnings with TEST_FRAMEWORK enabled
........

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

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

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

11 years agoRemove the problematic and unneeded AST_MODFLAG_GLOBAL_SYMBOLS from pbx_lua.c
George Joseph [Thu, 19 Jun 2014 16:03:17 +0000 (16:03 +0000)] 
Remove the problematic and unneeded AST_MODFLAG_GLOBAL_SYMBOLS from pbx_lua.c

AST_MODFLAG_GLOBAL_SYMBOLS was causing the module to be incorrectly loaded
before pbx_config.  pbx_config was therefore blowing away contexts that were
created by pbx_lua.  With AST_MODFLAG_DEFAULT the load order is now correct
and contexs are being properly merged.  AST_MODFLAG_GLOBAL_SYMBOLS was not
needed anyway since no other modules needed its global symbols that early.

ASTERISK-23818 #close
Reported by: Dennis Guse
Tested by: Dennis Guse
Tested by: George Joseph

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

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

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

11 years agoUpdate extensions.lua.sample with naming conflict guidance.
George Joseph [Wed, 18 Jun 2014 17:09:04 +0000 (17:09 +0000)] 
Update extensions.lua.sample with naming conflict guidance.

The sample extensions.lua was causing pbx_lua to fail to load when parsing
'app.goto("default", "s", 1)' because in Lua 5.2, 'goto' is now a reserved
word.  This patch adds guidance to extensions.lua.sample and changed
'app.goto("default", "s", 1)' to 'app.['goto']("default", "s", 1)'.

ASTERISK-23844 #close
Reported by: rnewton
Tested by: gtjoseph
Review: https://reviewboard.asterisk.org/r/3627/

........

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

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

11 years agostasis_channels: Update the stasis cache if manager variables are needed
Matthew Jordan [Wed, 18 Jun 2014 04:16:55 +0000 (04:16 +0000)] 
stasis_channels: Update the stasis cache if manager variables are needed

In r416211, the publishing of variable changes was modified such that a
cached channel snapshot was used if manager variables were not requested
with each AMI event. This was done to reduce the amount of channel snapshots
created.

However, an assumption was made that generating a channel snapshot and
publishing the snapshot to the channel topic was sufficient to ensure that
the cache would be updated; this is not the case. The channel snapshot type
must be used to force a snapshot update.

This patch updates the publication of channel variables such that the cache
is updated prior to publication of the channel variable message if manager
variables are in use. This ensures that all AMI events receive the variable
update when they are supposed to.

Note that this issue was caught by the Asterisk Test Suite (go go testing)

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

11 years agoAllow the PUSH and UNSHIFT functions to set inheritable channel variables.
Mark Michelson [Tue, 17 Jun 2014 18:43:56 +0000 (18:43 +0000)] 
Allow the PUSH and UNSHIFT functions to set inheritable channel variables.
........

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

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

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

11 years agoFix string growth algorithm for XML presence bodies.
Mark Michelson [Tue, 17 Jun 2014 16:33:13 +0000 (16:33 +0000)] 
Fix string growth algorithm for XML presence bodies.

pjpidf_print() does not return < 0 if there is not enough
room for the document to be printed. Rather, it returns
39, the length of the XML prolog.

The algorithm also had a bug in that it would return if
it attempted to grow the string larger.

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

11 years agoMoH: Don't restart stream on repeated start calls
Kinsey Moore [Tue, 17 Jun 2014 16:26:10 +0000 (16:26 +0000)] 
MoH: Don't restart stream on repeated start calls

Currently, music on hold will stop and then start again from the
beginning if ast_moh_start() is called multiple times. This can happen
if a call is put on hold repeatedly (the channel receives multiple
HOLD control frames) and can be triggered from ARI by starting MoH on a
channel multiple times. This is fairly jarring/annoying to users.

This change prevents MoH from being restarted if the requested music
class is the same as the one currently playing.

This includes an extra check to prevent the errors previously
experienced in the testsuite and has 100+ test runs behind it.

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

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

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

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

11 years agoWe have faced situation when using CDR and CEL by sqlite3 modules. With system having...
Igor Goncharovskiy [Mon, 16 Jun 2014 09:02:25 +0000 (09:02 +0000)] 
We have faced situation when using CDR and CEL by sqlite3 modules. With system having high load (~100 concurrent calls created by sipp) we found many cdr and cel records missed. There is special finction in sqlite3, that make able to fix this situation - sqlite3_wait_timeout, that also can replace awful code cdr_sqlite3 ad cel_sqlite3 modules. Also this function can be used for aastdb and res_config_sqlite3 to avoid missed writes to sqlite db.

#ASTERISK-23766 #close
Reported by: Igor Goncharovsky

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

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

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

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

11 years agochannels/chan_sip: Forbid remote bridging if T.38 is negotiated
Matthew Jordan [Mon, 16 Jun 2014 02:39:29 +0000 (02:39 +0000)] 
channels/chan_sip: Forbid remote bridging if T.38 is negotiated

When a framehook is removed - such as the fax gateway framehook - the bridge
framework will re-evaluate the bridge mixing technologies to see if it can
improve the bridging. When this occurs, get_rtp_info will be called to
determine if local or remote bridging can be used. Using remote bridging
will cause a fax to fail, as direct media negotiation will cause some small
number of packets to not arrive at the remote endpoint.

This patch forces local native bridging if T.38 negotiation is in progress or
has been established.

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

11 years agochannel_internal_api: Publish a snapshot change when linkedids change
Matthew Jordan [Sun, 15 Jun 2014 22:11:49 +0000 (22:11 +0000)] 
channel_internal_api: Publish a snapshot change when linkedids change

Snapshots are now not published *quite* as much as they used to. One instance
where they are not published any longer is during bridge enter and exit - the
state of the channel doesn't change, the bridge does. However, channels are
changed when a linkedid is propagated; previously, the channel's state would
be updated and published during the bridge enter event. Now this must be
explicitly done.

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

11 years agotest_stasis_endpoints: Remove expected channel snapshot
Matthew Jordan [Sun, 15 Jun 2014 21:42:03 +0000 (21:42 +0000)] 
test_stasis_endpoints: Remove expected channel snapshot

We no longer publish a channel snapshot when it is associated with an endpoint;
after all, the channel itself hasn't changed - the endpoint state has changed.
This updates the channel_messages unit test accordingly.

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

11 years agoMoH: Undo commit r416150 (1.8)
Matthew Jordan [Sun, 15 Jun 2014 21:18:51 +0000 (21:18 +0000)] 
MoH: Undo commit r416150 (1.8)

This patch reverts r416150. When the comparison between mohclass->name and
state->class->name is made, you are not guaranteed that (a) state->class is
non-NULL or that state or state->class are in a safe state.

Crashes caught by the bridges/transfer_capabilities test.
........

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

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

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

11 years agostasis: Reduce creation of channel snapshots to improve performance
Matthew Jordan [Fri, 13 Jun 2014 18:16:34 +0000 (18:16 +0000)] 
stasis: Reduce creation of channel snapshots to improve performance

During some performance testing of Asterisk with AGI, ARI, and lots of Local
channels, we noticed that there's quite a hit in performance during channel
creation and releasing to the dialplan (ARI continue). After investigating
the performance spike that occurs during channel creation, we discovered
that we create a lot of channel snapshots that are technically unnecessary.
This includes creating snapshots during:
 * AGI execution
 * Returning objects for ARI commands
 * During some Local channel operations
 * During some dialling operations
 * During variable setting
 * During some bridging operations
And more.

This patch does the following:
 - It removes a number of fields from channel snapshots. These fields were
   rarely used, were expensive to have on the snapshot, and hurt performance.
   This included formats, translation paths, Log Call ID, callgroup, pickup
   group, and all channel variables. As a result, AMI Status,
   "core show channel", "core show channelvar", and "pjsip show channel" were
   modified to either hit the live channel or not show certain pieces of data.
   While this is unfortunate, the performance gain from this patch is worth
   the loss in behaviour.
 - It adds a mechanism to publish a cached snapshot + blob. A large number of
   publications were changed to use this, including:
   - During Dial begin
   - During Variable assignment (if no AMI variables are emitted - if AMI
     variables are set, we have to make snapshots when a variable is changed)
   - During channel pickup
   - When a channel is put on hold/unhold
   - When a DTMF digit is begun/ended
   - When creating a bridge snapshot
   - When an AOC event is raised
   - During Local channel optimization/Local bridging
   - When endpoint snapshots are generated
   - All AGI events
   - All ARI responses that return a channel
   - Events in the AgentPool, MeetMe, and some in Queue
 - Additionally, some extraneous channel snapshots were being made that were
   unnecessary. These were removed.
 - The result of ast_hashtab_hash_string is now cached in stasis_cache. This
   reduces a large number of calls to ast_hashtab_hash_string, which reduced
   the amount of time spent in this function in gprof by around 50%.

ASTERISK-23811 #close
Reported by: Matt Jordan

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

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

11 years agoMoH: Don't restart stream on repeated start calls
Kinsey Moore [Fri, 13 Jun 2014 13:10:15 +0000 (13:10 +0000)] 
MoH: Don't restart stream on repeated start calls

Currently, music on hold will stop and then start again from the
beginning if ast_moh_start() is called multiple times. This can happen
if a call is put on hold repeatedly (the channel receives multiple
HOLD control frames) and can be triggered from ARI by starting MoH on a
channel multiple times. This is fairly jarring/annoying to users.

This change prevents MoH from being restarted if the requested music
class is the same as the one currently playing.

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

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

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

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

11 years agoCEL: Expose parking retreiver in extra field
Kinsey Moore [Fri, 13 Jun 2014 12:52:38 +0000 (12:52 +0000)] 
CEL: Expose parking retreiver in extra field

This exposes the retreiver of a parked call under the "retreiver" key
of the extra field when this information is available.

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

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

11 years agoAST-2014-007: Fix of fix to allow AMI and SIP TCP to send messages.
Richard Mudgett [Fri, 13 Jun 2014 05:13:11 +0000 (05:13 +0000)] 
AST-2014-007: Fix of fix to allow AMI and SIP TCP to send messages.

ASTERISK-23673 #close
Reported by: Richard Mudgett

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

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

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

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

11 years agomain/pbx - documentation - enhance 'core show hints' and 'core show hint' help text
Rusty Newton [Thu, 12 Jun 2014 21:17:25 +0000 (21:17 +0000)] 
main/pbx - documentation - enhance 'core show hints' and 'core show hint' help text

Adds descriptive help text to 'core show hints' and 'core show hint'. The text describes the various columns for the sake of clarity.

ASTERISK-23764
Review: https://reviewboard.asterisk.org/r/3610/
........

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

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

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

11 years agoFix build in devmode for GCC 4.10
Kinsey Moore [Thu, 12 Jun 2014 20:13:26 +0000 (20:13 +0000)] 
Fix build in devmode for GCC 4.10

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

11 years agoBlocked revisions 415915
Corey Farrell [Thu, 12 Jun 2014 17:21:13 +0000 (17:21 +0000)] 
Blocked revisions 415915

........
chan_sip: DEBUG messages in sdp_crypto.c display despite a DEBUG level of zero

Change debug level for messages in sdp_crypto.c from zero to one.  This
ensures the messages are not displayed when debugging is disabled.  Change
does not apply to 12+ as it was already fixed in those versions.

ASTERISK-23246 #close
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/3605/
........

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

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

11 years agoAST-2014-007: Fix DOS by consuming the number of allowed HTTP connections.
Richard Mudgett [Thu, 12 Jun 2014 16:41:56 +0000 (16:41 +0000)] 
AST-2014-007: Fix DOS by consuming the number of allowed HTTP connections.

Simply establishing a TCP connection and never sending anything to the
configured HTTP port in http.conf will tie up a HTTP connection.  Since
there is a maximum number of open HTTP sessions allowed at a time you can
block legitimate connections.

A similar problem exists if a HTTP request is started but never finished.

* Added http.conf session_inactivity timer option to close HTTP
connections that aren't doing anything.  Defaults to 30000 ms.

* Removed the undocumented manager.conf block-sockets option.  It
interferes with TCP/TLS inactivity timeouts.

* AMI and SIP TLS connections now have better authentication timeout
protection.  Though I didn't remove the bizzare TLS timeout polling code
from chan_sip.

* chan_sip can now handle SSL certificate renegotiations in the middle of
a session.  It couldn't do that before because the socket was non-blocking
and the SSL calls were not restarted as documented by the OpenSSL
documentation.

* Fixed an off nominal leak of the ssl struct in
handle_tcptls_connection() if the FILE stream failed to open and the SSL
certificate negotiations failed.

The patch creates a custom FILE stream handler to give the created FILE
streams inactivity timeout and timeout after a specific moment in time
capability.  This approach eliminates the need for code using the FILE
stream to be redesigned to deal with the timeouts.

This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of
the SSL_read/SSL_write operations.

ASTERISK-23673 #close
Reported by: Richard Mudgett
........

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

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

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

11 years agoCorrect UPGRADE.txt notes in r415825
Jonathan Rose [Thu, 12 Jun 2014 15:50:07 +0000 (15:50 +0000)] 
Correct UPGRADE.txt notes in r415825

The change was marked against the wrong version of Asterisk. My apologies.
........

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

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

11 years agoapp_queue: delayed state can cause early leavewhenempty ringing
Scott Griepentrog [Thu, 12 Jun 2014 15:41:51 +0000 (15:41 +0000)] 
app_queue: delayed state can cause early leavewhenempty ringing

In app_queue, device state changes arrive in event messages and
update the queue member status value.  That value is checked in
get_member_status() to decide that the caller should leave when
there are no available members.  Although event messages can be
delayed by other activity, there is no adverse affect by lagged
status except in one specific case: there is only one available
member, it was just rung, and leavewhenempty is enabled set for
ringing members.  This change adds a direct check of the device
state only under this condition where the caller may be dropped
incorrectly, resolving this issue without affecting performance
of app_queue normally.

AST-1248 #close
Review: https://reviewboard.asterisk.org/r/3595/
Reported by: Thomas Arimont
........

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

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

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

11 years agoMixMontior: Add class authorization requirements to MixMonitor AMI commands
Jonathan Rose [Thu, 12 Jun 2014 15:26:23 +0000 (15:26 +0000)] 
MixMontior: Add class authorization requirements to MixMonitor AMI commands

MixMonitor AMI commands StartMixMonitor and StopMixMonitor lacked class
authorization. StopMixMonitor now requires that the manager user either have
the call or system class authorization. StartMixMonitor is a slightly larger
issue since it can execute shell commands if the right arguments are passed
into it, and we consider this a permission escalation. A security release
will be issued for problem this shortly.

ASTERISK-23609 #close
Reported by: Corey Farrell

........

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

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

11 years agores_pjsip_pubsub: unauthenticated remote crash in PJSIP pub/sub framework
Kevin Harwell [Thu, 12 Jun 2014 14:38:34 +0000 (14:38 +0000)] 
res_pjsip_pubsub: unauthenticated remote crash in PJSIP pub/sub framework

A remotely exploitable crash vulnerability exists in the PJSIP channel driver's
pub/sub framework. If an attempt is made to unsubscribe when not currently
subscribed and the endpoint's "sub_min_expiry" is set to zero, Asterisk tries
to create an expiration timer with zero seconds, which is not allowed, so an
assertion raised.

The fix was to reject a subscription that is attempting to unsubscribe when not
being already subscribed.  Asterisk now checks for this situation appropriately
and responds with a 400 instead of crashing.

AST-2014-005

ASTERISK-23489 #close

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

11 years agoFix potential deadlock situation in res_pjsip.
Mark Michelson [Thu, 12 Jun 2014 14:03:52 +0000 (14:03 +0000)] 
Fix potential deadlock situation in res_pjsip.

SIP transaction timeouts are handled in the PJSIP monitor thread. When
this happens on a subscription, and the subscription is destroyed, the
subscription destruction is dispatched synchronously to the threadpool.
The issue is that the PJSIP dialog is locked by the monitor thread,
and then the dispatched task attempts to lock the dialog. This leads
to a deadlock that causes SIP traffic to no longer be accepted on the
Asterisk server.

The fix here is to treat the monitor thread as if it were a threadpool
thread when it attempts to dispatch synchronous tasks. This way, the
dispatched task turns into a simple function call within the same thread,
and the locking issue is averted.

AST-2014-008

ASTERISK-23802 #close

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

11 years agores_pjsip_pubsub: Persist subscriptions in sorcery so they are recreated on startup.
Joshua Colp [Thu, 12 Jun 2014 11:33:13 +0000 (11:33 +0000)] 
res_pjsip_pubsub: Persist subscriptions in sorcery so they are recreated on startup.

This change makes res_pjsip_pubsub persist inbound subscriptions in sorcery. By default
this uses the local astdb but it can also be configured to store within an outside
database. When Asterisk is started these subscriptions are recreated if they have not
expired. Notifications are sent to the devices which have subscribed and they are none
the wiser that the system has restarted.

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

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

11 years agosafe_asterisk: Overwrite old safe_asterisk on make install.
Walter Doekes [Thu, 12 Jun 2014 07:47:45 +0000 (07:47 +0000)] 
safe_asterisk: Overwrite old safe_asterisk on make install.

From now on, make install will overwrite safe_asterisk with the
latest version. You need to move any local modifications to files
inside /etc/asterisk/startup.d, if you have any.

See also commits r394939 and r397938.

ASTERISK-21965 #close
Patches:
  safe_asterisk.patch uploaded by jkister (License 6232, modified by me)

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

11 years agoformat.c: Fix misuse of hash container function.
Richard Mudgett [Wed, 11 Jun 2014 22:54:04 +0000 (22:54 +0000)] 
format.c: Fix misuse of hash container function.

The supplied hash function to a container must be idempotent given the
object's key value to figure out which container bucket the object belongs
in.  Returning a random number or the current container count is not
idempotent.  The "computed hash" value doesn't help find the object later
in those cases.

* Fixed the format_list container to actually be a list since that is how
the container is used.  Conceptually, if more than 283 formats were added
to the format_list then odd things may have happened before the fix.
........

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

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

11 years agoFix build in dev mode due to signed/unsigned mismatch
Kinsey Moore [Tue, 10 Jun 2014 18:31:08 +0000 (18:31 +0000)] 
Fix build in dev mode due to signed/unsigned mismatch

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

11 years agoPJSIP: PJSIPNotify - Strip content-length headers and add documentation
Jonathan Rose [Tue, 10 Jun 2014 15:46:25 +0000 (15:46 +0000)] 
PJSIP: PJSIPNotify - Strip content-length headers and add documentation

Documentation for how to add custom headers/content to notifies created
with the PJSIPNotify manager action was a little sparse and it also
wasn't vetting application of Content-length headers like its chan_sip
equivalent was (so two Content-length headers could be applied... and
PJSIP determines the content length anyway, so it just opens people up
for error). This patch also flips the variable order so that the
variables are interpreted in the same order as they are put in the AMI
action.

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

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

11 years agochan_ooh323: fix loading module failure if there no accessible h323_log or ooh323...
Alexandr Anikin [Tue, 10 Jun 2014 09:18:20 +0000 (09:18 +0000)] 
chan_ooh323: fix loading module failure if there no accessible h323_log or ooh323 config file

change return 1 to return AST_MODULE_LOAD_FAILURE on module load routine
few cosmetic changes

ASTERISK-23814 #close

(closes issue ASTERISK-23814)

Reported by: Igor Goncharovsky
Patches:
ASTERISK-23814-ast11.patch
........

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

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

11 years agochan_pjsip: Fix bug where custom SIP headers could be duplicated on outgoing INVITEs.
Mark Michelson [Mon, 9 Jun 2014 20:20:50 +0000 (20:20 +0000)] 
chan_pjsip: Fix bug where custom SIP headers could be duplicated on outgoing INVITEs.

When using PJSIP_HEADER() to add custom headers to outgoing INVITE requests, certain
situations could result in the headers being duplicated. For instance, if the request
were retransmitted, or if the INVITE were re-sent with authentication credentials,
the custom headers would be re-added to the request.

The fix here is to, after adding the custom headers to the outbound INVITE, remove
the datastore that holds the custom headers to add. This way, there is no risk in
accidentally adding them if the session supplement is called into a second or third
time.

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

11 years agosafe_asterisk: Cleanup additions to r415132.
Walter Doekes [Mon, 9 Jun 2014 12:08:47 +0000 (12:08 +0000)] 
safe_asterisk: Cleanup additions to r415132.

* Replaced a stray echo that should've been a message call in
  safe_asterisk. This replaces a conditional log message by a slightly
  different message. Please update your log parsing scripts.
* Made the $NOTIFY mail Subject more verbose by adding the machine name
  and exitstatus.

(Note that a 'make install' still won't overwrite your old safe_asterisk
if it exists. See ASTERISK-21965.)

ASTERISK-23492 #close
........

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

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

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

11 years agoautoservice: stop thread on graceful shutdown
Corey Farrell [Mon, 9 Jun 2014 03:48:22 +0000 (03:48 +0000)] 
autoservice: stop thread on graceful shutdown

This change adds thread shutdown to autoservice for graceful shutdowns only.
ast_register_cleanup is backported to 1.8 to allow this.  The logger callid
is also released on shutdown in 11+.

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

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

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

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

11 years agobridges/bridge_native_rtp: Reconfigure bridge on removal of framehook
Matthew Jordan [Sun, 8 Jun 2014 18:11:54 +0000 (18:11 +0000)] 
bridges/bridge_native_rtp: Reconfigure bridge on removal of framehook

This patch is a re-do of r414122.

When r414122 was merged, a major problem with it was uncovered. UNBRIDGE soft
hangup flags have a catastrophic effect on the pbx core if they leak out from
the bridge layer: the channel gets hung up. With the number of threads
involved in a blind transfer, and with the initial patch, it was likely that
this would occur. This caused a large number of test failures

This patch is nearly identical with the one proposed in r414122, save for the
following changes:
 - We explicitly clear the UNBRIDGE flag when setting an after goto on a
   channel in a bridge
 - Defensively, if we encounter an UNBRIDGE flag in the pbx core, we handle it

https://reviewboard.asterisk.org/r/3585/

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

11 years agobridge.h: Remove redundant struct ast_bridge_channel forward declaration.
Richard Mudgett [Sat, 7 Jun 2014 00:41:33 +0000 (00:41 +0000)] 
bridge.h: Remove redundant struct ast_bridge_channel forward declaration.

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

11 years agochan_sip: Fix order of variables specified in SIPNotify action
Jonathan Rose [Fri, 6 Jun 2014 21:35:09 +0000 (21:35 +0000)] 
chan_sip: Fix order of variables specified in SIPNotify action

Prior to this patch, sequential variables would be ordered in reverse
from the order specified in the manager action.

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

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

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

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

11 years agoPJSIP: Remove premature write of raw formats
Kinsey Moore [Fri, 6 Jun 2014 19:08:42 +0000 (19:08 +0000)] 
PJSIP: Remove premature write of raw formats

Currently, there are situations that can occur when using chan_pjsip
and certain dialplan applications (notably ChanSpy()) that can cause
the channel to get no audio with scrolling warnings about format
mismatches. This is caused by a failure to update translation paths on
a mid-call native format update since the raw formats have already
been updated by res_pjsip_sdp_rtp.c in set_caps(). Removing the
premature raw format updates allows the translation paths to be setup
correctly and the raw read and write formats with them.

AFS-63 #close

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

11 years agoutils: Update svn:ignore for the new astobj2 split files. v12 only
Richard Mudgett [Fri, 6 Jun 2014 15:19:01 +0000 (15:19 +0000)] 
utils: Update svn:ignore for the new astobj2 split files. v12 only

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

11 years agoUpdate utils/Makefile so refcounter compiles post astobj2 split.
George Joseph [Fri, 6 Jun 2014 14:08:38 +0000 (14:08 +0000)] 
Update utils/Makefile so refcounter compiles post astobj2 split.

utils/refcounter was removed from trunk so this is a 12-only patch
to keep refcounter from failing to build.

https://reviewboard.asterisk.org/r/3576/

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

11 years agoSplit astobj2.c into more maintainable components.
George Joseph [Fri, 6 Jun 2014 14:07:54 +0000 (14:07 +0000)] 
Split astobj2.c into more maintainable components.

Split astobj2.c into the following files to improve maintainability.

astobj2.c - object primitives, object primitive misc and initialization code.
astobj2_private.h - internal object declarations needed by the containers.
astobj2_container.c - generic conainer and container misc code.
astobj2_container_hash.c - hash container specific code.
astobj2_container_rbtree.c - rbtree container specific code.
astobj2_container_private.h - generic container definitions and rtti prototypes.

https://reviewboard.asterisk.org/r/3576/

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

11 years agoconfigs/cli_aliases.conf: Two new aliases, plus enhancements for context names.
Rusty Newton [Fri, 6 Jun 2014 12:48:33 +0000 (12:48 +0000)] 
configs/cli_aliases.conf: Two new aliases, plus enhancements for context names.

Changed naming of included alias templates to avoid confusion between version names. For example, asterisk12 was for asterisk 1.2, so I changed it to asterisk_1dot2, so that later we can use asterisk_12 for Asterisk 12.

Added alias for "features reload" to the template for Asterisk 11 style syntax template, as features reload was removed in 12, but you can still do "module reload features"

Added alias for "pjsip reload" to the friendly template. It is shorter than "module reload res_pjsip.so" and if some are like me; I constantly forget that reloading chan_pjsip doesn't parse config. Remembering "pjsip reload" is just easier.

ASTERISK-23654 #close
ASTERISK-23654 #comment Fixed by adding two new aliases and enhancements for context names.

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

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

11 years agoconfig: Fix config files not reloading when only an included file changes.
Richard Mudgett [Thu, 5 Jun 2014 17:51:28 +0000 (17:51 +0000)] 
config: Fix config files not reloading when only an included file changes.

The twisted logic determining if a config file should be reloaded was
mostly broken and disabled.  The incorrect test that ASTERISK-23383 fixed
actually reenabled the broken logic.  The incorrect test was causing the
timestamp to always be cleared which caused config files with includes to
always be reloaded.

* Made wildcard includes always cause a reload.  Determining if a file was
deleted cannot be determined without restructuring the cache to determine
if any files are missing from the last files actually loaded.  Also
without refactoring config_text_file_load(), the glob loop couldn't check
more than one file for changes anyway.

* Made remove the cache entry if the file no longer exists when trying to
get its timestamp or it is no longer a regular file.  This fixes the
corner case where the file was loaded, then deleted, then the config
reloaded, then the file restored with the same timestamp, and then the
config reloaded again.

* Made remove the cache entry include list when actually loading the file.
This gets rid of any stale includes the file had from the last time the
file was loaded.

ASTERISK-23683 #close
Reported by: tootai

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

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

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

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

11 years agoapp_confbridge: Allow muting of users waiting to enter a ConfBridge
Matthew Jordan [Thu, 5 Jun 2014 14:39:08 +0000 (14:39 +0000)] 
app_confbridge: Allow muting of users waiting to enter a ConfBridge

Prior to this patch, users waiting to enter a ConfBridge were not considered
when muted via the CLI or via AMI. Instead, a confusing message would be
emitted stating that the channel did not exist.

This patch allows a user to be muted when waiting to enter a ConfBridge
conference. This is equivalent to start when muted, only toggled via the CLI
or AMI.

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

#ASTERISK-23824 #close
patches:
  rb3582.patch uploaded by tm1000 (License 6524)
........

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

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

11 years agoPJSIP: Send initial connected line information
Kinsey Moore [Thu, 5 Jun 2014 11:55:32 +0000 (11:55 +0000)] 
PJSIP: Send initial connected line information

This makes chan_pjsip send connected line information when it is called
so that connected line information is available on the connected
channel.

(closes issue DPMA-442)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/3584/

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

11 years agosafe_asterisk: Cleanup and debian compatibility.
Walter Doekes [Wed, 4 Jun 2014 20:14:16 +0000 (20:14 +0000)] 
safe_asterisk: Cleanup and debian compatibility.

Cleans up the safe_asterisk script and adds the ASTSAFE_FOREGROUND
option that allows the debian asterisk init script to capture the
right pid.

* Drop the vim #modeline which wasn't used. Use test consistently
  without the odd configure xno syntax. Double quote all paths.
  General cleanup.
* Don't output message()s to the console but only to TTY if set.
* Allow TTY to be "no" as well as empty (debian compatibility with
  debian/patches/safe_asterisk-config).
* Add option to export ASTSAFE_FOREGROUND=1 from the init script
  that calls this to disable backgrounding. Debian uses a similar
  method in debian/patches/safe_asterisk-nobg).

ASTERISK-23492 #close
Review: https://reviewboard.asterisk.org/r/3574/
........

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

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

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

11 years agochan_pjsip: Add debug in RTP Engine glue callback
Matthew Jordan [Wed, 4 Jun 2014 14:12:41 +0000 (14:12 +0000)] 
chan_pjsip: Add debug in RTP Engine glue callback

This patch adds some debug statements that aid with determining why a direct
media request may or may not be initiated.

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

11 years agores_pjsip_session: Add debug statement for session refreshes
Matthew Jordan [Wed, 4 Jun 2014 14:09:59 +0000 (14:09 +0000)] 
res_pjsip_session: Add debug statement for session refreshes

This small patch adds a debug level 3 statement indicating how a session
refresh is being sent - either as a re-INVITE or as an UPDATE - and where
the session refresh is going.

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

11 years agoapp_confbridge: Correct verification of conference name length
Corey Farrell [Wed, 4 Jun 2014 07:23:58 +0000 (07:23 +0000)] 
app_confbridge: Correct verification of conference name length

Conference names were not checked for maximum length, allowing unexpected
behaviour.  This change adds checking to ensure the maximum length is not
exceeded.  The maximum length is also changed from 32 to AST_MAX_EXTENSION.

ASTERISK-23035 #close
Reported by: Iñaki Cívico
Tested by: Iñaki Cívico
Patches:
    confbridge-enforce_max-1.8.patch uploaded by coreyfarrell (license 5909)
    confbridge-enforce_max-11up.patch uploaded by coreyfarrell (license 5909)
........

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

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

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

11 years agofunc_odbc: Fix fixed size buffers fix (r414968).
Walter Doekes [Tue, 3 Jun 2014 07:34:23 +0000 (07:34 +0000)] 
func_odbc: Fix fixed size buffers fix (r414968).

The change that removed the fixed size buffers in odbc-related code --
removing arbitrary column width limits -- was incomplete. This change
adds: no segfault on writesql without insertsql and return value checks
after strdup.

While I was in the vicinity I cleaned up the linefeeds in the odbc
function descriptions, moved some code for clarity, removed some blobs
and noted (but didn't fix) that the 'odbc write ... exec' CLI command
doesn't behave as the dialplan equivalent when insertsql= is used.

ASTERISK-23582 #close
~ASTERISK-23582 #comment test
-ASTERISK-23582 #comment test2
X-ASTERISK-23582 #comment test3
Review: https://reviewboard.asterisk.org/r/3579/
........

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

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

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