]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
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

11 years agobridge_native_rtp: Take the bridge type choice of both channels into account.
Joshua Colp [Sun, 1 Jun 2014 15:31:22 +0000 (15:31 +0000)] 
bridge_native_rtp: Take the bridge type choice of both channels into account.

The bridge_native_rtp module currently uses the bridge result of the first
channel that joins a bridge as the ultimate result. This means that if the
first channel has direct media enabled but the second does not a direct
media bridge will still occur.

This change makes it so that both sides are taken into account. If either
side forbids the bridge or responds with a local bridge result then
either a generic or local bridge occurs.

ASTERISK-23541 #close
Reported by: Justin E

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

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

11 years agoPJSIP: Prevent crash on blind transfer
Kinsey Moore [Fri, 30 May 2014 14:46:32 +0000 (14:46 +0000)] 
PJSIP: Prevent crash on blind transfer

Blind transfers don't go too well with NULL channels which can occur if
the channel has already been transferred away.

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

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

11 years agoTALK_DETECT: A channel function that raises events when talking is detected
Matthew Jordan [Fri, 30 May 2014 12:39:36 +0000 (12:39 +0000)] 
TALK_DETECT: A channel function that raises events when talking is detected

This patch adds a new channel function TALK_DETECT that, when set on a
channel, causes events indicating the start/stop of talking on a channel to be
emitted to both AMI and ARI clients.

The function allows setting both the silence threshold (the length of silence
after which we decide no one is talking) as well as the talking threshold (the
amount of energy that counts as talking). Parameters can be updated on a channel
after talk detection has been enabled, and talk detection can be removed at
any time.

The events raised by the function use a nomenclature similar to existing AMI/ARI
events.
For AMI: ChannelTalkingStart/ChannelTalkingStop
For ARI: ChannelTalkingStarted/ChannelTalkingFinished

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

ASTERISK-23786 #close
Reported by: Matt Jordan

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

11 years agomain/config.c: AMI action UpdateConfig EmptyCat clears all categories
Matthew Jordan [Fri, 30 May 2014 12:03:06 +0000 (12:03 +0000)] 
main/config.c: AMI action UpdateConfig EmptyCat clears all categories

When invoking UpdateConfig AMI action with Action set to EmptyCat, Asterisk
will make all categories empty in the config but the one requested with a
Cat variable. This is due to a bug in ast_category_empty (main/config.c)
that makes an incorrect comparison for a category name.

This patch corrects the comparison such that only the requested category
is cleared.

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

#ASTERISK-23803 #close
Reported by: zvision
patches:
  manager.c.diff uploaded by zvision (License 5755)
........

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

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

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

11 years agoPBX: Prevent incorrect hint parsing
Kinsey Moore [Thu, 29 May 2014 18:44:52 +0000 (18:44 +0000)] 
PBX: Prevent incorrect hint parsing

Dynamic and pattern matching hints should not be checked for their last
known state until they are instantiated by subscribers.

(closes issue AFS-56)
Reported by: John Hardin
Patch AFS-56-pbx.diff submitted by Matt Jordan (license 6283)
........

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

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

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

11 years agopjsip.conf: privkey_file should be priv_key_file, mediaencryption=yes should be media...
Rusty Newton [Wed, 28 May 2014 20:52:13 +0000 (20:52 +0000)] 
pjsip.conf: privkey_file should be priv_key_file, mediaencryption=yes should be mediaencryption=sdes

privkey_file was missed in the snake case update. An example included an invalid value for the mediaencryption option.

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

11 years agoAMI/ARI: Update version numbers
Matthew Jordan [Wed, 28 May 2014 17:45:49 +0000 (17:45 +0000)] 
AMI/ARI: Update version numbers

Update the semantic versioning of ARI to 1.3.0 and AMI to 2.3.0 to account for
backwards compatible changes going from 12.2.0 to 12.3.0.

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

11 years agoast-db-manage/cdr/env.py: Don't fail if a config file can't be loaded
Matthew Jordan [Wed, 28 May 2014 17:43:36 +0000 (17:43 +0000)] 
ast-db-manage/cdr/env.py: Don't fail if a config file can't be loaded

When generating SQL files via the repotools alembic_creator.py script, a
configuration object is used programatically with SQLAlechemy, as opposed to
a configuration file. This patch ignores failures to interpret a config file,
as ... there isn't one in this case.

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

11 years agores_pjsip_session: Fix leaked video RTP ports.
Richard Mudgett [Wed, 28 May 2014 16:54:31 +0000 (16:54 +0000)] 
res_pjsip_session: Fix leaked video RTP ports.

Simply enabling PJSIP to negotiage a video codec (e.g., h264) would leak
video RTP ports if the codec were not negotiated by an incoming call.

* Made add_sdp_streams() associate the handler with the media stream if
the handler handled the media stream.  Otherwise, when the
ast_sip_session_media object was destroyed it didn't know how to clean up
the RTP resources.

* Fixed sdp_requires_deferral() associating the handler with the media
stream when deciding if the SDP processing needs to be deferred for T.38.
Like the leaked video RTP ports, the T.38 handler needs to clean up
allocated resources from deciding if SDP processing needs to be deffered.

* Cleaned up some dead code in handle_incoming_sdp() and
sdp_requires_deferral().

ASTERISK-23721 #close
Reported by: cervajs

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

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

11 years agoapp_agent_pool: Return to dialplan if the agent fails to ack the call.
Richard Mudgett [Wed, 28 May 2014 16:24:54 +0000 (16:24 +0000)] 
app_agent_pool: Return to dialplan if the agent fails to ack the call.

Improvements to the agent pool functionality.

* AgentRequest no longer hangs up the caller if the agent fails to connect
with the caller.  It now continues in the dialplan.

* AgentRequest returns AGENT_STATUS set to NOT_CONNECTED if the agent
failed to connect with the call.  Most likely because the agent did not
acknowledge the call in time or got disconnected.

* The agent alerting play file configured by the agent.conf custom_beep
option can now be disabled by setting the option to an empty string.  The
agent is effectively alerted to a call presence when MOH stops.

* Fixed bridge reference leak when the agent connects with a caller.

ASTERISK-23499 #close
Reported by: Matt Jordan

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

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

11 years agores_config_odbc: Use dynamically sized buffers to store row data so values do not...
Joshua Colp [Wed, 28 May 2014 11:37:00 +0000 (11:37 +0000)] 
res_config_odbc: Use dynamically sized buffers to store row data so values do not get truncated.

ASTERISK-23582 #close
ASTERISk-23582 #comment Reported by: Walter Doekes

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

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

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

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

11 years agochan_unistim: Unlock mutex in rare OOM condition.
Walter Doekes [Wed, 28 May 2014 09:43:03 +0000 (09:43 +0000)] 
chan_unistim: Unlock mutex in rare OOM condition.

#ASTERISK-23792 #close
Reported by: Peter Whisker

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

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

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

11 years agochan_sip: Start session timer at 200, not at INVITE.
Walter Doekes [Tue, 27 May 2014 21:21:29 +0000 (21:21 +0000)] 
chan_sip: Start session timer at 200, not at INVITE.

Asterisk started counting the session timer at INVITE while the other
end correctly started at 200. This meant that for short session-expiries
(90 seconds) combined with long ringing times (e.g. 30 seconds), asterisk
would wrongly assume that the timer was hit before the other end thought
it was time to send a session refresh. This resulted in prematurely
ended calls.

This changes the session timer to start counting first at 200 like RFC
says it should.

(Also removed a few excess NULL checks that would never hit, because if
they did, asterisk would have crashed already.)

ASTERISK-22551 #close
Reported by: i2045

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

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

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

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

11 years agores_config_odbc: Fix old and new ast_string_field memory leaks.
Walter Doekes [Tue, 27 May 2014 20:02:06 +0000 (20:02 +0000)] 
res_config_odbc: Fix old and new ast_string_field memory leaks.

The ODBC realtime driver uses ^NN parameter encoding to cope with the
special meaning of the semi-colon. A semi-colon in a field is
interpreted as if the key was supplied twice, something which isn't
otherwise possible with fixed database columns. E.g. allow=alaw;ulaw
is parsed as allow=alaw and allow=ulaw. A literal semi-colon is
rewritten to ^3B when stored in the database.

The module uses a stringfield to efficiently store the encoded
parameters. However, this stringfield wasn't always freed in some
off-nominal cases.

Commit r413241 fixed initialization so the encoding for INSERT and
DELETE queries wouldn't crash. (Only SELECTs and UPDATEs worked
apparently.) But that commit forgot the frees. This change cleans
that up.

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

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

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

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

11 years agocore_unreal: Prevent double free of core_unreal pvt
Matthew Jordan [Sun, 25 May 2014 02:30:51 +0000 (02:30 +0000)] 
core_unreal: Prevent double free of core_unreal pvt

When a channel is destroyed (such as via ast_channel_release in off nominal
paths in core_unreal), it will attempt to free (via ast_free) the channel tech
pvt. This is problematic for a few reasons:
1. The channel tech pvt is an ao2 object in core_unreal. Free'ing the pvt
   directly is no good.
2. The channel tech pvt's reference count is dropped just prior to calling
   ast_channel_release, resulting in the pvt's destruction. Hence, the
   channel destructor is free'ing an invalid pointer.

This patch keeps the dropping of the reference count, but sets the pvt to
NULL on the channel prior to releasing it. This models what would occur if the
channel was hung up directly.

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

11 years agotest_cel: Fix unit tests broken due to event def changes from res_corosync
Matthew Jordan [Fri, 23 May 2014 17:35:52 +0000 (17:35 +0000)] 
test_cel: Fix unit tests broken due to event def changes from res_corosync

This patch instructs test_cel to skip any IE types it doesn't care about. The
addition of the raw and bitfield types caused the tests to fail.

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

11 years agoFix signed/unsigned build warnings
Kinsey Moore [Fri, 23 May 2014 14:35:00 +0000 (14:35 +0000)] 
Fix signed/unsigned build warnings

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

11 years agoARI: Add ability to raise arbitrary User Events
Scott Griepentrog [Thu, 22 May 2014 16:08:55 +0000 (16:08 +0000)] 
ARI: Add ability to raise arbitrary User Events

User events can now be generated from ARI.  Events can be signalled with
arbitrary json variables, and include one or more of channel, bridge, or
endpoint snapshots.  An application must be specified which will receive
the event message (other applications can subscribe to it).  The message
will also be delivered via AMI provided a channel is attached.  Dialplan
generated user event messages are still transmitted via the channel, and
will only be received by a stasis application they are attached to or if
the channel is subscribed to.

This change also introduces the multi object blob mechanism used to send
multiple snapshot types in a single message.  The dialplan app UserEvent
was also changed to use multi object blob, and a new stasis message type
created to handle them.

ASTERISK-22697 #close
Review: https://reviewboard.asterisk.org/r/3494/

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

11 years agoapp_meetme: Don't interrupt MOH for waitmarked users.
Richard Mudgett [Thu, 22 May 2014 16:00:42 +0000 (16:00 +0000)] 
app_meetme: Don't interrupt MOH for waitmarked users.

Occasionally, when the last marked user leaves the conference, waitmarked
users don't get MOH if MOH is supposed to be played while a waitmarked
user is waiting for another marked user.

* Made not interrupt MOH when the user is a waitmarked user.  The
waitmarked user doesn't need to hear any leave announcements from the
conference as the user would have already heard different leave
announcements if they were enabled.  Apparently DAHDI occasionally sends
unending non-silent streams to these users or a normal user still in the
conference has continuous high background noise.  These non-silent streams
cause MOH to be suspended while the never ending "announcement" is played.

Issue caused by ASTERISK-13680.

AST-1349 #close
Reported by: Tyler Stewart

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

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

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

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

11 years agores_pjsip_refer: Fix bugs involving Parking/PJSIP/transfers
Jonathan Rose [Thu, 22 May 2014 15:44:11 +0000 (15:44 +0000)] 
res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfers

PJSIP would never send the final 200 Notify for a blind transfer
when transferring to parking. This patch fixes that. In addition,
it fixes a reference leak when performing blind transfers to
non-bridging extensions.

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

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

11 years agoUPGRADE: Add note for REF_DEBUG flag
Matthew Jordan [Thu, 22 May 2014 14:01:05 +0000 (14:01 +0000)] 
UPGRADE: Add note for REF_DEBUG flag
........

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

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

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

11 years agores_corosync: Update module to work with Stasis (and compile)
Matthew Jordan [Thu, 22 May 2014 11:51:56 +0000 (11:51 +0000)] 
res_corosync: Update module to work with Stasis (and compile)

This patch fixes res_corosync such that it works with Asterisk 12. This
restores the functionality that was present in previous versions of
Asterisk, and ensures compatibility with those versions by restoring the
binary message format needed to pass information from/to them.

The following changes were made in the core to support this:
 * The event system has been partially restored. All event definition and
   event types in this patch were pulled from Asterisk 11. Previously, we had
   hoped that this information would live in res_corosync; however, the
   approach in this patch seems to be better for a few reasons:
   (1) Theoretically, ast_events can be used by any module as a binary
       representation of a Stasis message. Given the structure of an ast_event
       object, that information has to live in the core to be used universally.
       For example, defining the payload of a device state ast_event in
       res_corosync could result in an incompatible device state representation
       in another module.
   (2) Much of this representation already lived in the core, and was not
       easily extensible.
   (3) The code already existed. :-)
 * Stasis message types now have a message formatter that converts their
   payload to an ast_event object.
 * Stasis message forwarders now handle forwarding to themselves. Previously
   this would result in an infinite recursive call. Now, this simply creates a
   new forwarding object with no forwards set up (as it is the thing it is
   forwarding to). This is advantageous for res_corosync, as returning NULL
   would also imply an unrecoverable error. Returning a subscription in this
   case allows for easier handling of message types that are published directly
   to an aggregate topic that has forwarders.

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

ASTERISK-22912 #close
ASTERISK-22372 #close

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

11 years agocore_unreal: Only block media frames when a generator is on both ends of an unreal...
Richard Mudgett [Wed, 21 May 2014 22:17:37 +0000 (22:17 +0000)] 
core_unreal: Only block media frames when a generator is on both ends of an unreal channel.

The fix for ASTERISK-12292 was a bit too aggressive.  You could have
generators pointed at each other on local channels but need to get other
kinds of frames such as DTMF or CONNECTED_LINE frames accross.
........

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

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

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

11 years agopbx.c: prevent potential crash from recursive replace()
Scott Griepentrog [Wed, 21 May 2014 19:07:35 +0000 (19:07 +0000)] 
pbx.c: prevent potential crash from recursive replace()

Recurisve usage of replace() resulted in corruption of the
temporary string storage and potential crash.  By changing
the string to be allocated separtely per instance, this is
eliminated.

ASTERISK-23650 #comment Reported by: Roel van Meer
ASTEIRSK-23650 #close

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

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

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

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