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

11 years agoReplace __ast_answer with ast_raw_answer in app_control_answer
Paul Belanger [Mon, 19 May 2014 19:50:44 +0000 (19:50 +0000)] 
Replace __ast_answer with ast_raw_answer in app_control_answer

While load testing an ARI application, I noticed asterisk was returning HTTP 500
internal server errors on channels/:id/answer.  After talking to #asterisk-dev,
the issue appeared to be a lack of media flowing after __ast_answer() was
called.  So now, we call ast_raw_answer instead and no longer wait for media.

ASTERISK-23758 #close
Review: https://reviewboard.asterisk.org/r/3549/

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

11 years agochan_ooh323: fix h323_log full path name
Alexandr Anikin [Mon, 19 May 2014 13:46:37 +0000 (13:46 +0000)] 
chan_ooh323: fix h323_log full path name

* fix to use astlogdir option for h323_log file instead of hardcoded

ASTERISK-23754 #close

Reported by: Igor Goncharovsky
Patches:
ooh323_logger_patch.diff
........

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

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

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

11 years agoUndo r414122
Matthew Jordan [Mon, 19 May 2014 01:09:39 +0000 (01:09 +0000)] 
Undo r414122

The Test Suite caught a few problems, undoing until those are resolved

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

11 years agobridge_native_rtp/bridge_channel: Fix direct media issues due to frame hook
Matthew Jordan [Sun, 18 May 2014 20:29:12 +0000 (20:29 +0000)] 
bridge_native_rtp/bridge_channel: Fix direct media issues due to frame hook

This patch fixes issues with direct media bridges that occur after a blind
transfer. These issues were caught by the (currently failing)
pjsip/transfers/blind_transfer/caller_direct_media test.

The test currently fails primarily for two reasons:
(1) When Bob and Charlie (the transfer target and the transfer destination)
    enter a bridge together, the framehook remains on the transfer target
    channel until both channels are in the bridge. As it consumes voice frames,
    the initial bridge type is a simple bridge. The framehook is removed when
    both channels are in the bridge; however, this does not currently cause the
    bridging framework to re-evaluate the bridge. This patch adds a
    AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a
    framehook is removed so the bridge can re-evaluate itself.

(2) When a channel leaves a native RTP bridge, it may be leaving due to being
    hung up. Sending a re-INVITE to a channel that is about to be hung up is
    not nice - in fact, there's a good chance we'll send the BYE request before
    the channel has had a chance to send back a 200 OK. To be somewhat nicer,
    this patch adds a function to channel.h that allows the bridging framework
    to query for exactly why a channel is leaving a bridge via the channel's
    soft hangup flags. This allows it to only send the re-INVITE if there's a
    chance the channel will survive the native bridging experience.

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

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

11 years agochan_dahdi: Fix analog dialtone detection.
Richard Mudgett [Fri, 16 May 2014 20:05:24 +0000 (20:05 +0000)] 
chan_dahdi: Fix analog dialtone detection.

* Check if waitingfordt (waitfordialtone) is enabled in dahdi_read() to
allow the DSP to operate early enough to detect dialtone.

* Made use the correct variable in my_check_waitingfordt().

ASTERISK-23709 #close
Reported by: Steve Davies
Patches:
      dialtone_detect_fix (license #5012) patch uploaded by Steve Davies

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

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

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

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

11 years agosig_pri.c: Pull the pri_dchannel() PRI_EVENT_RING case into its own function.
Richard Mudgett [Fri, 16 May 2014 17:30:10 +0000 (17:30 +0000)] 
sig_pri.c: Pull the pri_dchannel() PRI_EVENT_RING case into its own function.

* Populate the CALLERID(ani2) value (and the special CALLINGANI2 channel
variable) with the ANI2 value in addition to the PRI specific ANI2 channel
variable.

* Made complete snapshot staging with the channel lock held.  All channel
snapshots need to be done while the channel lock is held.
........

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

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

11 years agoapp_meetme: Fix overwrite of DAHDI conference data structure.
Richard Mudgett [Thu, 15 May 2014 21:54:06 +0000 (21:54 +0000)] 
app_meetme: Fix overwrite of DAHDI conference data structure.

Starting a conference recording using the admin menu overwrites the DAHDI
conference data structure used to modify the admin user's conference mute
mode.

* Made no longer pass the user's DAHDI conference data structure into the
menu functions.  The menu now uses its own DAHDI conference data
structure to start the recording channel.

* Moved the unlock conf->playlock to before playing the conf-full message.
No sense keeping the lock while that prompt is playing.  The user is never
going to get into the conference at that point.
........

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

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

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

11 years agores_musiconhold: Minor cleanup.
Walter Doekes [Wed, 14 May 2014 15:39:10 +0000 (15:39 +0000)] 
res_musiconhold: Minor cleanup.

Fix a few free()'s that should be ast_free()'s. Reverted an old
workaround that isn't necessary. Reorder a tiny bit of code.
Remove a bit of commented-out code.

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

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

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

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

11 years agochan_sip: Add TLS and SRTP status to CLI command 'sip show channel'
Jonathan Rose [Tue, 13 May 2014 18:01:24 +0000 (18:01 +0000)] 
chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'

ASTERISK-23564 #close
Reported by: Patrick Laimbock
Review: https://reviewboard.asterisk.org/r/3474/
........

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

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

11 years agoh264: Fix H264 SDP payload format.
Walter Doekes [Tue, 13 May 2014 13:52:27 +0000 (13:52 +0000)] 
h264: Fix H264 SDP payload format.

https://tools.ietf.org/html/rfc3984#section-8.1 says profile-level-id
takes 3 bytes in base16 (6 hex digits).

This fixes video setup in certain cases.

ASTERISK-23664 #close
ASTERISK-23664 #comment Patch r3530.patch uploaded by Guillaume Maudoux.
Review: https://reviewboard.asterisk.org/r/3530/
........

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

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

11 years agortp: Fix case typo in H263+ mime.
Walter Doekes [Tue, 13 May 2014 13:36:41 +0000 (13:36 +0000)] 
rtp: Fix case typo in H263+ mime.

http://tools.ietf.org/html/rfc3555#section-4.2.6 says the canonical
mime subtype is "H263-1998", not "h263-1998". Original code was added
in r183101 on 2009-03-19 02:26:50 +0100.

This fixes issues with Polycom phones.

ASTERISK-23665 #close
ASTERISK-23665 #comment Patch r3529.patch uploaded by Guillaume Maudoux, backported by me.
Review: https://reviewboard.asterisk.org/r/3529/
........

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

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

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

11 years agochan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing is enabled.
Richard Mudgett [Tue, 13 May 2014 00:25:17 +0000 (00:25 +0000)] 
chan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing is enabled.

When overlap dialing is enabled, the lack of inband audio available
information in the SETUP_ACKNOWLEDGE events causes an interoperability
problem with SIP.  sig_pri doesn't know if there is dialtone present when
a SETUP_ACKNOWLEDGE is received so it assumes it is there and posts an
AST_CONTROL_PROGRESS frame.  The SIP channel driver then sends out a 183
Session Progress and blocks the desired 180 Ringing message when the
ALERTING message comes in.

* Made the configure script detect if the installed version of libpri
supports the SETUP_ACKNOWLEDGE enhancements.

* Using the new API, made generate an AST_CONTROL_PROGRESS frame on an
incoming SETUP_ACKNOWLEDGE message when the message indicates inband audio
is present instead of assuming that dialtone is present.

* Using the new API, made SETUP_ACKNOWLEDGE send out an inband audio
available indication only if dialtone is expected.  The change also makes
the fallback behaviour of sending the PROGRESS message better by sending
it only if dialtone is expected.

* Changed receiving a PROCEEDING message to not generate an
AST_CONTROL_PROGRESS frame if the progress indication ie indicates
non-end-to-end-ISDN.  This helps interoperability with SIP.

* Changed sending a PROCEEDING message in response to an
AST_CONTROL_PROCEEDING frame to not indicate inband audio available.  It
was silly to do so anyway because the channel driver doesn't know if
inband audio is even available.  This helps interoperability with SIP.

This patch and a corresponding change in libpri work together to allow
Asterisk to control the inband audio available progress indication ie on
the SETUP_ACKNOWLEDGE message when dialtone is present.

AST-1338 #close
Reported by: Tyler Stewart

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

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

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

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

11 years agoFix compiler warning from GCC 4.10 fixup.
Richard Mudgett [Tue, 13 May 2014 00:16:16 +0000 (00:16 +0000)] 
Fix compiler warning from GCC 4.10 fixup.

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

11 years agoapp_chanspy: Fix a test that was failing on account of r413551
Jonathan Rose [Mon, 12 May 2014 22:23:30 +0000 (22:23 +0000)] 
app_chanspy: Fix a test that was failing on account of r413551

ASTERISK-23381 #close
ASTERISK-23381 #comment Reported by: Robert Moss
Review: https://reviewboard.asterisk.org/r/3505/
........

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

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

11 years agoframehooks: Add callback for determining if a hook is consuming frames of a specific...
Joshua Colp [Sun, 11 May 2014 02:05:26 +0000 (02:05 +0000)] 
framehooks: Add callback for determining if a hook is consuming frames of a specific type.

In the past framehooks have had no capability to determine what frame types a hook
is actually interested in consuming. This has meant that code has had to assume they
want all frames, thus preventing native bridging.

This change adds a callback which allows a framehook to be queried for whether it
is consuming a frame of a specific type. The native RTP bridging module has also
been updated to take advantange of this, allowing native bridging to occur when
previously it would not.

ASTERISK-23497 #comment Reported by: Etienne Lessard
ASTERISK-23497 #close

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

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

11 years agoUndoing framehook support. Issues were uncovered by Bamboo.
Joshua Colp [Sun, 11 May 2014 01:07:44 +0000 (01:07 +0000)] 
Undoing framehook support. Issues were uncovered by Bamboo.

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

11 years agoframehooks: Add callback for determining if a hook is consuming frames of a specific...
Joshua Colp [Sat, 10 May 2014 18:45:42 +0000 (18:45 +0000)] 
framehooks: Add callback for determining if a hook is consuming frames of a specific type.

In the past framehooks have had no capability to determine what frame types a hook
is actually interested in consuming. This has meant that code has had to assume they
want all frames, thus preventing native bridging.

This change adds a callback which allows a framehook to be queried for whether it
is consuming a frame of a specific type. The native RTP bridging module has also
been updated to take advantange of this, allowing native bridging to occur when
previously it would not.

ASTERISK-23497 #comment Reported by: Etienne Lessard
ASTERISK-23497 #close

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

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

11 years agoFix 32bit build for func_env
Kinsey Moore [Fri, 9 May 2014 23:13:19 +0000 (23:13 +0000)] 
Fix 32bit build for func_env
........

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

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

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

11 years agoAllow Asterisk to compile under GCC 4.10
Kinsey Moore [Fri, 9 May 2014 22:39:22 +0000 (22:39 +0000)] 
Allow Asterisk to compile under GCC 4.10

This resolves a large number of compiler warnings from GCC 4.10 which
cause the build to fail under dev mode. The vast majority are
signed/unsigned mismatches in printf-style format strings.
........

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

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

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

11 years agoapp_chanspy: Fix a bug where Barge mode could fail
Jonathan Rose [Fri, 9 May 2014 16:35:16 +0000 (16:35 +0000)] 
app_chanspy: Fix a bug where Barge mode could fail

If the barge audiohook was attached prior to the spyee and its peer
actually being bridged, the audiohook would not be applied and the
connected peer would not be able to hear audio from the spy when the
spy is in barge mode.

(closes issue ASTERISK-23381)
Reported by: Robert Moss
Review: https://reviewboard.asterisk.org/r/3505/
........

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

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

11 years agoapp_queue: Extend documentation for various Manager actions and events.
Joshua Colp [Thu, 8 May 2014 00:35:45 +0000 (00:35 +0000)] 
app_queue: Extend documentation for various Manager actions and events.
........

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

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

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

11 years agoapp_confbridge: Fixed "CBAnn" channels not going away.
Richard Mudgett [Wed, 7 May 2014 20:58:03 +0000 (20:58 +0000)] 
app_confbridge: Fixed "CBAnn" channels not going away.

Fixed a ref leak in conf_handle_talker_cb() everytime the conference
bridge was found to report a channel's talker status change.  The
resulting leak caused the "CBAnn" channels and the conference bridge to
never be destroyed.

Thanks to Richard Kenner on the asterisk-user's list for locating the
problem.

Reported by: Richard Kenner

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

11 years agoapp_confbridge: Fix ref leak in CLI "confbridge kick" command.
Richard Mudgett [Wed, 7 May 2014 20:34:58 +0000 (20:34 +0000)] 
app_confbridge: Fix ref leak in CLI "confbridge kick" command.

Fixed ref leak in the CLI "confbridge kick" command when the channel to be
kicked was not in the conference.
........

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

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

11 years agoFix encoding of custom prepare extra data.
Mark Michelson [Wed, 7 May 2014 17:50:52 +0000 (17:50 +0000)] 
Fix encoding of custom prepare extra data.

Patches:
res_config_odbc-take2.patch by John Hardin (License #6512)
........

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

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

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

11 years agoImprove XML sanitization in NOTIFYs, especially for presence subtypes and messages.
Mark Michelson [Tue, 6 May 2014 22:00:31 +0000 (22:00 +0000)] 
Improve XML sanitization in NOTIFYs, especially for presence subtypes and messages.

Embedded carriage return line feed combinations may appear in presence subtypes
and messages since they may be derived from user input in an instant messenger
client. As such, they need to be properly escaped so that XML parsers do not
vomit when the messages are received.

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

11 years agoCheck for an act on failures to update contacts during registration.
Mark Michelson [Tue, 6 May 2014 17:46:44 +0000 (17:46 +0000)] 
Check for an act on failures to update contacts during registration.

There was an underlying issue in a realtime backend where database updates
would fail. Since we were not checking for failure, we would end up in a
strange state where the old database entry was still present but Asterisk
thought that it had been updated. Now when an entry fails to update, we
print a warning and delete the old contact from sorcery so there is no
mismatch between foreground and backend state.

Patches:
res_pjsip_registrar.patch by John Hardin (License #6512)

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

11 years agoEnsure that all parts of SQL UPDATEs and DELETEs are encoded.
Mark Michelson [Tue, 6 May 2014 17:05:19 +0000 (17:05 +0000)] 
Ensure that all parts of SQL UPDATEs and DELETEs are encoded.

Patches:
res_config_odbc.patch by John Hardin (License #6512)
........

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

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

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

11 years agoCorrect variable traversal logic in res_config_odbc's update_odbc function.
Mark Michelson [Fri, 2 May 2014 20:35:16 +0000 (20:35 +0000)] 
Correct variable traversal logic in res_config_odbc's update_odbc function.

Closes issue ASTERISK-23675
Reported by Leando Dardini
Patches:
asterisk-23675-odbc-linkedlist-traversal_12.diff uploaded by Michael L. Young (license #5026)

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

11 years agoPrevent crashes in res_config_odbc due to uninitialized string fields.
Mark Michelson [Fri, 2 May 2014 20:27:05 +0000 (20:27 +0000)] 
Prevent crashes in res_config_odbc due to uninitialized string fields.

Patches:
    odbc-crash.patch by John Hardin (License #6512)
........

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

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

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

11 years agoReturn the number of rows affected by a SQL insert, rather than an object ID.
Mark Michelson [Fri, 2 May 2014 20:02:53 +0000 (20:02 +0000)] 
Return the number of rows affected by a SQL insert, rather than an object ID.

The realtime API specifies that the store callback is supposed to return the number
of rows affected. res_config_pgsql was instead returning an Oid cast as an int, which
during any nominal execution would be cast to 0. Returning 0 when more than 0 rows were
inserted causes problems to the function's callers.

To give an idea of how strange code can be, this is the necessary code change to fix
a device state issue reported against chan_pjsip in Asterisk 12+. The issue was that
the registrar would attempt to insert contacts into the database. Because of the 0
return from res_config_pgsql, the registrar would think that the contact was not successfully
inserted, even though it actually was. As such, even though the contact was query-able
and it was possible to call the endpoint, Asterisk would "think" the endpoint was unregistered,
meaning it would report the device state as UNAVAILABLE instead of NOT_INUSE.

The necessary fix applies to all versions of Asterisk, so even though the bug reported
only applies to Asterisk 12+, the code correction is being inserted into 1.8+.

Closes issue ASTERISK-23707
Reported by Mark Michelson
........

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

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

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

11 years agores_pjsip_refer: Add Referred-By header on INVITE for blind transfers.
Richard Mudgett [Fri, 2 May 2014 16:33:59 +0000 (16:33 +0000)] 
res_pjsip_refer: Add Referred-By header on INVITE for blind transfers.

Per rfc3892, the Referred-By header in a REFER must be copied into the
referenced request (IE.  The outgoing INVITE to the transfer target).

* Automatically put the Referred-By header in the outgoing INVITE message
if the SIPREFERREDBYHDR channel variable is defined with a value.

* Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so
chan_pjsip has a better chance to interoperate.

* Fixed refer_blind_callback() and refer_incoming_refer_request() to not
modify the data in the pointer returned by pjsip_msg_find_hdr_by_name().
It seems wrong to modify that data since the calling routine doesn't own
the buffer.

ASTERISK-23501 #close
Reported by: John Bigelow

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

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

11 years agoParking: Add 'AnnounceChannel' argument to manager action 'Park'
Jonathan Rose [Fri, 2 May 2014 15:58:27 +0000 (15:58 +0000)] 
Parking: Add 'AnnounceChannel' argument to manager action 'Park'

(closes ASTERISK-23397)
Reported by: Denis
Review: https://reviewboard.asterisk.org/r/3446/

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

11 years agoRemove unnecessary repetition checks from res_pjsip_exten_state
Mark Michelson [Thu, 1 May 2014 15:41:43 +0000 (15:41 +0000)] 
Remove unnecessary repetition checks from res_pjsip_exten_state

The PBX core already takes care of ensuring that repeated state changes
are not communicated to exten state consumers. Because the check in res_pjsip_exten_state
was incomplete, it was causing valid presence state changes not to be sent out. For instance,
if the presence state did not change but the message or subtype did, then no presence-related
NOTIFY request would be sent out.

closes issue ASTERISK-23672
Reported by Mark Michelson

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

11 years agores_pjsip: Add the ability to configure ciphers based on name.
Joshua Colp [Thu, 1 May 2014 12:30:43 +0000 (12:30 +0000)] 
res_pjsip: Add the ability to configure ciphers based on name.

Previously this code would only accept the OpenSSL identifier instead
of the documented name.

ASTERISK-23498 #close
ASTERISK-23498 #comment Reported by: Anthony Messina

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

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

11 years agochan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues.
Richard Mudgett [Wed, 30 Apr 2014 20:47:24 +0000 (20:47 +0000)] 
chan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues.

* Fixed early exit in sip_msg_send() not destroying the message iterator.

* Made ast_msg_var_iterator_next() and ast_msg_var_iterator_destroy()
tolerant of a NULL iter parameter in case ast_msg_var_iterator_init()
fails.

* Made ast_msg_var_iterator_destroy() clean up any current message data
ref.

* Made struct ast_msg_var_iterator, ast_msg_var_iterator_init(),
ast_msg_var_iterator_next(), ast_msg_var_unref_current(), and
ast_msg_var_iterator_destroy() use iter instead of i.

* Eliminated RAII_VAR usage in res_pjsip_messaging.c:vars_to_headers().
........

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

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

11 years agochan_pjsip: Fix deadlock when retrieving call-id of channel.
Joshua Colp [Wed, 30 Apr 2014 20:38:35 +0000 (20:38 +0000)] 
chan_pjsip: Fix deadlock when retrieving call-id of channel.

If a task was in-flight which required the channel or bridge lock
it was possible for the synchronous task retrieving the call-id
to deadlock as it holds those locks.

After discussing with Mark Michelson the synchronous task was
removed and the call-id accessed directly. This should be safe as
each object involved is guaranteed to exist and the call-id will
never change.

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

11 years agoWebsocket: Add session locking and delay close
Kinsey Moore [Wed, 30 Apr 2014 13:06:47 +0000 (13:06 +0000)] 
Websocket: Add session locking and delay close

This resolves a race condition where data could be written to a NULL
FILE pointer causing a crash as a websocket connection was in the
process of shutting down by adding locking to websocket session writes
and by deferring session teardown until session destruction.

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

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

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

11 years agores_stasis: Add progress indications to operations which perform media.
Joshua Colp [Wed, 30 Apr 2014 12:41:55 +0000 (12:41 +0000)] 
res_stasis: Add progress indications to operations which perform media.

This change fixes operations which did not account for the fact that they may
be executed on channels which have not been answered. These operations will
now indicate progress when invoked.

ASTERISK-23560 #close
ASTERISk-23560 #comment Reported by: Jan Svoboda

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

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

11 years agores_pjsip_sdp_rtp: Fix issue where sending a hold SDP twice could cause an unhold.
Joshua Colp [Wed, 30 Apr 2014 12:38:07 +0000 (12:38 +0000)] 
res_pjsip_sdp_rtp: Fix issue where sending a hold SDP twice could cause an unhold.

This change fixes a bug where if an SDP with media address and sendonly was
received twice the underlying call would go off hold, instead of remaining on hold.
This occured because the code did not properly take into account that the SDP
may contain both a valid media address and the sendonly attribute.

The code now examines the sendonly attribute and media address first, so if the
SDP is received again no change will occur.

ASTERISK-23558 #comment Reported by: John Bigelow

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

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

11 years agochan_pjsip: Add support for picking up calls in the configured pickup group.
Joshua Colp [Wed, 30 Apr 2014 12:31:07 +0000 (12:31 +0000)] 
chan_pjsip: Add support for picking up calls in the configured pickup group.

AST-1363

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

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

11 years agoAdd "destroy" implementation for spinlock.
George Joseph [Tue, 29 Apr 2014 15:09:11 +0000 (15:09 +0000)] 
Add "destroy" implementation for spinlock.

The original commit for spinlock was missing "destroy" implementations.
Most of them are no-ops but phtread_spin and pthread_mutex do need their
locks destroyed.

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

11 years agochan_pjsip: Implement core ability to get Call-ID of a channel.
Joshua Colp [Tue, 29 Apr 2014 11:19:05 +0000 (11:19 +0000)] 
chan_pjsip: Implement core ability to get Call-ID of a channel.

This changes implement the "get_pvt_uniqueid" which is used to return the
technology specific unique identifier. In the case of SIP this is the Call-ID
of the dialog.

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

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

11 years agoBridging: Don't lock NULL bridges
Kinsey Moore [Mon, 28 Apr 2014 20:01:02 +0000 (20:01 +0000)] 
Bridging: Don't lock NULL bridges

When bridge locking was added for bridge snapshot creation, some
locations where bridge locking was added were not guaranteed to
actually have a bridge and locking NULL AO2 objects tends to cause
segfaults. This ensures that NULL bridges aren't locked.

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

11 years agores_rtp_asterisk: Add support for DTLS handshake retransmissions
Matthew Jordan [Fri, 25 Apr 2014 17:48:19 +0000 (17:48 +0000)] 
res_rtp_asterisk: Add support for DTLS handshake retransmissions

On congested networks, it is possible for the DTLS handshake messages to get
lost. This patch adds a timer to res_rtp_asterisk that will periodically
check to see if the handshake has succeeded. If not, it will retransmit the
DTLS handshake.

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

ASTERISK-23649 #close
Reported by: Nitesh Bansal
patches:
  dtls_retransmission.patch uploaded by Nitesh Bansal (License 6418)
........

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

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