]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agomain/cli: Do not attempt to show CDR data for internal channels
Matthew Jordan [Mon, 1 Sep 2014 14:16:12 +0000 (14:16 +0000)] 
main/cli: Do not attempt to show CDR data for internal channels

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

10 years agoLICENSE: Clarify language in Asterisk's LICENSE to allow for linking to UniMRCP
Matthew Jordan [Thu, 28 Aug 2014 21:53:51 +0000 (21:53 +0000)] 
LICENSE: Clarify language in Asterisk's LICENSE to allow for linking to UniMRCP

The UniMRCP project distributes Asterisk modules that integrate Asterisk with
UniMRCP, and other Asterisk users use the UniMRCP library as well.
Unfortunately, the UniMRCP license is Apache 2.0, which per the Free Software
Foundation, is not a compatible license with the GPLv2.

"Please note that this license is not compatible with GPL version 2, because it
has some requirements that are not in that GPL version. These include certain
patent termination and indemnification provisions. The patent termination
provision is a good thing, which is why we recommend the Apache 2.0 license for
substantial programs over other lax permissive licenses."

On the other hand, UniMRCP is a great project and we'd like to let people use
it with Asterisk.

This patch updates the LICENSE text to allow users to link Asterisk with
UniMRCP and distribute the resulting binaries.
........

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

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

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

10 years agochan_iax2: Fix Dynamic IAX2 Registrations After Temporary DNS Failure
Michael L. Young [Thu, 28 Aug 2014 20:29:45 +0000 (20:29 +0000)] 
chan_iax2: Fix Dynamic IAX2 Registrations After Temporary DNS Failure

The reporter on the issue found some issues when upgrading from version 10 to 11
on 55 hosts.

Two situations that can occur with dynamic registrations.

1.  With dnsmgr disabled, if the host is not resolvable we are not trying to
    resolve the host again when it is time to attempt to register again.  This
    results in never registering to the host.
2.  With dnsmgr enabled, when the host is temporarily not resolvable the
    address is set to 0.0.0.0:0 and then when the host is resolvable the port
    is not being restored and stays set to 0.

This patch resolves these two issues by:

* Storing the hostname so that it can be used for resolving with DNS.
* Resolve the hostname on the next scheduled attempt to register.
* Storing the port used to reach the host so that when the hostname is
  resolvable again, we can set the port again if the port is still unset after
  looking up the host.

ASTERISK-23767 #close
Reported by: David Herselman
Tested by: David Herselman, Michael L. Young
Patches:
    asterisk-23767-dns_reg_retry_and_set_port_11_v3.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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

10 years agoAdded ConfBridge AMI event note to UPGRADE.txt.
Richard Mudgett [Thu, 28 Aug 2014 17:19:35 +0000 (17:19 +0000)] 
Added ConfBridge AMI event note to UPGRADE.txt.

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

10 years agores/res_pjsip/pjsip_options.c: Eliminate excessive RAII_VAR usage.
Richard Mudgett [Thu, 28 Aug 2014 00:30:14 +0000 (00:30 +0000)] 
res/res_pjsip/pjsip_options.c: Eliminate excessive RAII_VAR usage.

* Fix off nominal ref leak in find_or_create_contact_status().

* Add missing NULL check of status in update_contact_status() and
init_start_time().

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

10 years agoconfbridge: Add 'Admin' param to join, leave, mute, unmute and talking events
George Joseph [Wed, 27 Aug 2014 17:21:57 +0000 (17:21 +0000)] 
confbridge: Add 'Admin' param to join, leave, mute, unmute and talking events

Currently there's no way to tell if a user is an admin or not when receiving
the join, leave, mute, unmute and talking events.  This patch adds that
capability.

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

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

10 years agoCallerID: Fix parsing of malformed callerid
Kinsey Moore [Wed, 27 Aug 2014 15:14:39 +0000 (15:14 +0000)] 
CallerID: Fix parsing of malformed callerid

This allows the callerid parsing function to handle malformed input
strings and strings containing escaped and unescaped double quotes.
This also adds a unittest to cover many of the cases where the parsing
algorithm previously failed.

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

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

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

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

10 years agoconfbridge: Make kick, mute and unmute handle channel targets consistently.
George Joseph [Tue, 26 Aug 2014 23:18:32 +0000 (23:18 +0000)] 
confbridge: Make kick, mute and unmute handle channel targets consistently.

Kick, mute and unmute were a little inconsistent in their handling of channel
targets.  This patch cleans that up by insuring they all handle the 'all'
target consistently and adds the 'participants' target which acts on
non-admins.  Documentation for kick was also cleaned up as it never
supported partial channel names.

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

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

10 years agoFix race condition in the scheduler when deleting a running entry.
Mark Michelson [Tue, 26 Aug 2014 22:08:39 +0000 (22:08 +0000)] 
Fix race condition in the scheduler when deleting a running entry.

When scheduled tasks run, they are removed from the heap (or hashtab).
When a scheduled task is deleted, if the task can't be found in the
heap (or hashtab), an assertion is triggered. If DO_CRASH is enabled,
this assertion causes a crash.

The problem is, sometimes it just so happens that someone attempts
to delete a scheduled task at the time that it is running, leading
to a crash. This change corrects the issue by tracking which task
is currently running. If that task is attempted to be deleted,
then we mark the task, and then wait for the task to complete.
This way, we can be sure to coordinate task deletion and memory
freeing.

ASTERISK-24212
Reported by Matt Jordan

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

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

10 years agores_musiconhold: Fix MOH restarting where it left off from the last hold.
Richard Mudgett [Mon, 25 Aug 2014 16:11:19 +0000 (16:11 +0000)] 
res_musiconhold: Fix MOH restarting where it left off from the last hold.

Restore code removed by https://reviewboard.asterisk.org/r/3536/ that
introduced a regression that prevents MOH from restarting were it left off
the last time.

ASTERISK-24019 #close
Reported by: Jason Richards
Patches:
      jira_asterisk_24019_v1.8.patch (license #5621) patch uploaded by rmudgett

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

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

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

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

10 years agores_pjsip_transport_websocket: Attach the Websocket module on outgoing INVITEs.
Joshua Colp [Sun, 24 Aug 2014 19:34:50 +0000 (19:34 +0000)] 
res_pjsip_transport_websocket: Attach the Websocket module on outgoing INVITEs.

In order to alter the Contact header on in-dialog requests and responses the
Websocket module must be attached on outgoing INVITEs. The Contact header is
modified so that the PJSIP transport layer can find and use the existing
Websocket connection based on the source IP address, port, and transport.

ASTERISK-24143 #close
Reported by: Aleksei Kulakov

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

10 years agores_pjsip_transport_websocket: Fix a progressive memory growth.
Joshua Colp [Sun, 24 Aug 2014 19:18:51 +0000 (19:18 +0000)] 
res_pjsip_transport_websocket: Fix a progressive memory growth.

The packet structure used to receive messages was using the transport
pool. This meant that for each parsing the pool would grow accordingly.
Since memory can not be reclaimed without resetting it this would
cause the memory pool to grow and grow.

This change uses a specific memory pool for the packet structure and
resets it to a fresh state after the message has been received and
handled.

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

10 years agores_pjsip_transport_websocket: Ensure secure Websocket clients can be called.
Joshua Colp [Sun, 24 Aug 2014 18:52:09 +0000 (18:52 +0000)] 
res_pjsip_transport_websocket: Ensure secure Websocket clients can be called.

This change enforces the transport in the Contact header for Websocket clients.
Previously a client may provide a transport of 'ws' when it is actually using
a transport of 'wss'. This would cause outgoing calls to fail as the existing
connection could not be found.

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

10 years agochan_sip: Use the server reflexive ICE candidate RTCP port as provided.
Joshua Colp [Sun, 24 Aug 2014 17:20:29 +0000 (17:20 +0000)] 
chan_sip: Use the server reflexive ICE candidate RTCP port as provided.

This code originally worked around an issue within res_rtp_asterisk itself.
The wrong socket was being used for the STUN check for RTCP, causing the
port to be the same as RTP. This was subsequently fixed and the RTCP port
provided for the ICE candidate is correct and does not need to be incremented.

ASTERISK-23997 #close
Reported by: Badalian Vyacheslav
Patches:
 plus1.diff submitted by Badalian Vyacheslav (license 5249)
........

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

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

10 years agoARI: Fix a crash caused by hanging during playback to a channel in a bridge
Jonathan Rose [Fri, 22 Aug 2014 16:27:42 +0000 (16:27 +0000)] 
ARI: Fix a crash caused by hanging during playback to a channel in a bridge

ASTERISK-24147 #close
Reported by: Edvin Vidmar
Review: https://reviewboard.asterisk.org/r/3908/

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

10 years agomain/message: Add a new-line to a DEBUG message
Matthew Jordan [Fri, 22 Aug 2014 13:50:23 +0000 (13:50 +0000)] 
main/message: Add a new-line to a DEBUG message

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

10 years agores_musiconhold.c: Remove obsolete REF_DEBUG code.
Richard Mudgett [Thu, 21 Aug 2014 22:05:18 +0000 (22:05 +0000)] 
res_musiconhold.c: Remove obsolete REF_DEBUG code.

Remove unneeded code that writes to the wrong file location in an obsolete
format.
........

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

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

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

10 years agoSwitch from hostname to an IP address in the SDP origin line.
Mark Michelson [Thu, 21 Aug 2014 21:42:08 +0000 (21:42 +0000)] 
Switch from hostname to an IP address in the SDP origin line.

Using the hostname in the SDP origin line may not satisfy the requirement
of RFC 4566 that we use a FQDN or IP address. This change has us use the
same information from the SDP connection line if possible. If not possible,
we'll use the configured media address. And if that's not possible, we use
the result of a PJLIB call to get the IP address of ourself.

ASTERISK-23994 #close
Reported by Private Name

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

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

10 years agoEnsure after-bridge behavior is correct when moving from Stasis to a non-Stasis bridge.
Mark Michelson [Thu, 21 Aug 2014 21:35:21 +0000 (21:35 +0000)] 
Ensure after-bridge behavior is correct when moving from Stasis to a non-Stasis bridge.

Because of the departable state of channels that enter Stasis bridges, Stasis has to
take responsibility for directing the channel to its intended after-bridge destination
if the channel moves from a Stasis bridge to a non-Stasis bridge. This change ensures
that when such a move occurs, when the channel leaves the bridging system, any after
bridge gotos are honored.

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

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

10 years agoLet's try checking the name and number, instead of the name twice.
Mark Michelson [Thu, 21 Aug 2014 21:27:19 +0000 (21:27 +0000)] 
Let's try checking the name and number, instead of the name twice.

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

10 years agores_musiconhold: Fix reference leaks caused when reloading with REF_DEBUG set
Jonathan Rose [Thu, 21 Aug 2014 21:15:40 +0000 (21:15 +0000)] 
res_musiconhold: Fix reference leaks caused when reloading with REF_DEBUG set

Due to a faulty function for debugging reference decrementing, it was possible
to reduce the refcount on the wrong object if two moh classes of the same name
were in the moh class container.

(closes issue ASTERISK-22252)
Reported by: Walter Doekes
Patches:
    18_moh_debug_ref_patch.diff Uploaded by Jonathan Rose (license 6182)
........

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

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

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

10 years agoImprove consistency of party ID privacy usage.
Mark Michelson [Thu, 21 Aug 2014 21:14:20 +0000 (21:14 +0000)] 
Improve consistency of party ID privacy usage.

Prior to this change, the Remote-Party-ID header took the position of
"If caller name and number are not explicitly allowed, then they are private"
and P-Asserted-Identity took the position of
"Caller name and number are only private if marked explicitly so"

Now both mechanisms of conveying party identification use the former approach.

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

10 years agochan_sip: Don't use port derived from fromdomain if it isn't set
Matthew Jordan [Thu, 21 Aug 2014 17:33:56 +0000 (17:33 +0000)] 
chan_sip: Don't use port derived from fromdomain if it isn't set

If a user does not provide a port in the fromdomain setting, chan_sip will set
the fromdomainport to STANDARD_SIP_PORT (5060). The fromdomainport value will
then get used unilaterally in certain places. This causes issues with TLS,
where the default port is expected to be 5061.

This patch modifies chan_sip such that fromdomainport is only used if it is
not the standard SIP port; otherwise, the port from the SIP pvt's recorded
self IP address is used.

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

ASTERISK-24178 #close
Reported by: Elazar Broad
patches:
  fromdomainport_fix.diff uploaded by Elazar Broad (License 5835)
........

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

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

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

10 years agoARI: Fix implicit answer when playback is initiated on unanswered channel
Matthew Jordan [Thu, 21 Aug 2014 15:22:53 +0000 (15:22 +0000)] 
ARI: Fix implicit answer when playback is initiated on unanswered channel

When issuing a POST /channels/{channel_id}/play on a channel that is not
yet answered, ARI is supposed to:
* Queue up an AST_CONTROL_PROGRESS on the channel
* Start up the playback of the media

Instead, we sneak an answer on the channel right before starting playing media.

This is due to ARI's usage of control_streamfile. This function implicitly
answers the channel (and doesn't give ARI the option to stop it). The answering
of the channel here is probably unnecessary:
* app_voicemail, by far the biggest consumer of this function, always answers
  the channels anyway
* control stream file (in res_agi) and ControlPlayback probably shouldn't be
  implicitly answering the channel. Answering should not be tied directly to
  playing back media.

As it turns out, the answering of the channel here is pretty old:
356042    twilson       if (ast_channel_state(chan) != AST_STATE_UP) {
  3087      anthm               res = ast_answer(chan);
180259   tilghman       }

(As in, ancient?)

Note that others ran into this problem and commented about it on various
mailing lists.

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

ASTERISK-24229 #close
Reported by: Matt Jordan

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

10 years agoClean up files that do not end with newlines
Matthew Jordan [Thu, 21 Aug 2014 14:51:27 +0000 (14:51 +0000)] 
Clean up files that do not end with newlines

Trivial patch to add new lines to several files missing them. This fixes
warnings when compiling with gcc 4.1.2 on CentOS 5.

ASTERISK-24245 #close
Reported by: Shaun Ruffell
patches:
  0002-Trivial-addition-of-newlines-at-end-of-three-files.patch uploaded by Shaun Ruffell (License 5417)

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

10 years agocli.c: Fix tab completion of "module load" when MALLOC_DEBUG is enabled.
Richard Mudgett [Wed, 20 Aug 2014 22:19:41 +0000 (22:19 +0000)] 
cli.c: Fix tab completion of "module load" when MALLOC_DEBUG is enabled.

filename_completion_function() returns memory that was not allocated by
the MALLOC_DEBUG allocation tracker so the memory must be freed by
ast_std_free().
........

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

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

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

10 years agoMove evaluation of set_var options in pjsip to the end of channel initialization.
Mark Michelson [Wed, 20 Aug 2014 20:02:56 +0000 (20:02 +0000)] 
Move evaluation of set_var options in pjsip to the end of channel initialization.

This allows for set_var to override certain defaults such as caller ID and codec
values. This also fixes a test suite regression. The "set_var" test suite test attempted
to use set_var to override caller ID, but a recent change caused that to no longer work.

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

10 years agoStasis: Add information to blind transfer event
Kinsey Moore [Wed, 20 Aug 2014 12:56:58 +0000 (12:56 +0000)] 
Stasis: Add information to blind transfer event

When a blind transfer occurs that is forced to create a local channel
pair to satisfy the transfer request, information about the local
channel pair is not published. This adds a field to describe that
channel to the blind transfer message struct so that this information
is conveyed properly to consumers of the blind transfer message.

This also fixes a bug in which Stasis() was unable to properly identify
the channel that was replacing an existing Stasis-controlled channel
due to a blind transfer.

Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3921/

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

10 years agoAlter documentation for callerid_privacy to use correct values.
Mark Michelson [Tue, 19 Aug 2014 20:27:47 +0000 (20:27 +0000)] 
Alter documentation for callerid_privacy to use correct values.

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

10 years agoFix compilation error on certain versions of GCC.
Mark Michelson [Tue, 19 Aug 2014 19:54:09 +0000 (19:54 +0000)] 
Fix compilation error on certain versions of GCC.

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

10 years agoAMI Docs: Fix Status channel parameter optionality
Kinsey Moore [Tue, 19 Aug 2014 19:41:53 +0000 (19:41 +0000)] 
AMI Docs: Fix Status channel parameter optionality
........

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

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

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

10 years agoARI: Fix a bug where /channels/{channelID}/continue doesn't execute PBX
Jonathan Rose [Tue, 19 Aug 2014 16:20:59 +0000 (16:20 +0000)] 
ARI: Fix a bug where /channels/{channelID}/continue doesn't execute PBX

If /channels/{channelID}/continue is called on a channel that was originated
without a PBX (such as the ARI command POST channel with a stasis application
argument), the channel will not start dialplan execution. This patch will now
run the PBX out of the stasis execution if the channel doesn't currently have
an active PBX upon continuing.

ASTERISK-24043 #close
Reported by: Krandon Bruse
Review: https://reviewboard.asterisk.org/r/3917/
Patches:
    stasis-continue.diff submitted by Krandon Bruse (license 6631)

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

10 years agochan_pjsip: Fix attended transfer connected line name update.
Richard Mudgett [Tue, 19 Aug 2014 16:06:58 +0000 (16:06 +0000)] 
chan_pjsip: Fix attended transfer connected line name update.

A calls B
B answers
B SIP attended transfers to C
C answers, B and C can see each other's connected line information
B completes the transfer
A has number but no name connected line information about C
  while C has the full information about A

I examined the incoming and outgoing party id information handling of
chan_pjsip and found several issues:

* Fixed ast_sip_session_create_outgoing() not setting up the configured
endpoint id as the new channel's caller id.  This is why party A got
default connected line information.

* Made update_initial_connected_line() use the channel's CALLERID(id)
information.  The core, app_dial, or predial routine may have filled in or
changed the endpoint caller id information.

* Fixed chan_pjsip_new() not setting the full party id information
available on the caller id and ANI party id.  This includes the configured
callerid_tag string and other party id fields.

* Fixed accessing channel party id information without the channel lock
held.

* Fixed using the effective connected line id without doing a deep copy
outside of holding the channel lock.  Shallow copy string pointers can
become stale if the channel lock is not held.

* Made queue_connected_line_update() also update the channel's
CALLERID(id) information.  Moving the channel to another bridge would need
the information there for the new bridge peer.

* Fixed off nominal memory leak in update_incoming_connected_line().

* Added pjsip.conf callerid_tag string to party id information from
enabled trust_inbound endpoint in caller_id_incoming_request().

AFS-98 #close
Reported by: Mark Michelson

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

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

10 years agofunc_config: Change 'Not Found' message from ERROR to DEBUG
George Joseph [Mon, 18 Aug 2014 20:17:09 +0000 (20:17 +0000)] 
func_config: Change 'Not Found' message from ERROR to DEBUG

When you call the CONFIG dialplan function with the name of a variable that
doesn't exist in the target context you get an ERROR.  This does nothing but
clutter up the logs with messages that may be perfectly acceptable.  Just
because a variable wasn't in the context doesn't mean it's an error.  Maybei
t's optional or just needs to be defaulted or ignored.

This patch changes the log level from ERROR to DEBUG.  If a dialplan developer
wants to debug their dialplan they still canby setting the console debug level
as needed.

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

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

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

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

10 years agoapps/app_meetme: Fix crash when publishing MeetMe messages with no channel
Matthew Jordan [Sun, 17 Aug 2014 23:28:27 +0000 (23:28 +0000)] 
apps/app_meetme: Fix crash when publishing MeetMe messages with no channel

The same function, meetme_stasis_generate_msg, handles creating and publishing
Stasis message both when there are channels in the MeetMe conference and when
there are no channels in the conference. When the performance improvement was
made to use cached snapshots, this created a situation where Asterisk would
crash: obtaining a cached snapshot is not NULL tolerant.

This patch restores the previous implementation, which used a NULL safe set
of routines to produce a blob containing the channel snapshot (if available)
and information about the MeetMe conference.

ASTERISK-24234 #close
Reported by: Shaun Ruffell
Tested by: Shaun Ruffell

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

10 years agoapps/app_dial: Fix Dial 'z' option
Matthew Jordan [Sun, 17 Aug 2014 23:08:57 +0000 (23:08 +0000)] 
apps/app_dial: Fix Dial 'z' option

The 'z' option is supposed to disable the dial timeout in the case of a call
forward. Unfortunately, the wrong timeout timer was passed to the do_forward
function, resulting in the option not working.

ASTERISK-24225 #close
Reported by: dimitripietro
Tested by: dimitripietro
patches:
  jira_asterisk_24225_v1.8.patch uploaded by rmudgett (License 5621)
  jira_asterisk_24225_v11.patch uploaded by rmudgett (License 5621)
........

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

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

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

10 years agoconfigure: Undefine FORTIFY_SOURCE prior to defining it for patched gcc
Matthew Jordan [Sun, 17 Aug 2014 22:33:21 +0000 (22:33 +0000)] 
configure: Undefine FORTIFY_SOURCE prior to defining it for patched gcc

Some distributions of Linux patch gcc to define FORTIFY_SOURCE when gcc is
executed with optimization. This "help" unfortunately results in re-definition
warnings when FORTIFY_SOURCE is later defined in Asterisk's build system. This
patch undefines FORTIFY_SOURCE prior to defining it to prevent this warning.

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

ASTERISK-24032 #close
Reported by: Kilburn
Tested by: Kilburn, wdoekes
patches:
  1.8.diff uploaded by cloos (License 5956)
  10.diff uploaded by cloos (License 5956)
  11.diff uploaded by cloos (License 5956)
  12.diff uploaded by cloos (License 5956)
  13.diff uploaded by cloos (License 5956)
........

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

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

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

10 years agoBridging: Fix a behavioral change when checking if a channel is leaving a bridge
Jonathan Rose [Fri, 15 Aug 2014 16:56:33 +0000 (16:56 +0000)] 
Bridging: Fix a behavioral change when checking if a channel is leaving a bridge

r420934 introduced some failures in the test suite.  Upon investigating, it was
discovered that differences in the way we were evaluating whether a channel was in
the process of leaving a bridge were causing some reinvites not to occur (mostly
reinvites back to Asterisk when ending a call). This patch fixes that behavioral
change.

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

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

10 years agoapp_voicemail/app: Remove test events that were duplicated by r421059
Matthew Jordan [Fri, 15 Aug 2014 15:41:35 +0000 (15:41 +0000)] 
app_voicemail/app: Remove test events that were duplicated by r421059

Moving the test event raised when a file is played back (which occurred in
r421059) broke the ever loving snot out of the voicemail tests. This caused
duplicate test events to get raised, as app_voicemail and main/app were raising
events prior to call ast_streamfile. The voicemail tests did not enjoy getting
multiple events.

Since raising the playback event in ast_streamfile is far more useful to the
vast majority of tests, this patch keeps the call there and simply removes the
extraneous calls that duplicated the event.
........

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

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

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

10 years agores/res_hep_rtcp: Remove dependency on PJSIP
Matthew Jordan [Thu, 14 Aug 2014 21:15:44 +0000 (21:15 +0000)] 
res/res_hep_rtcp: Remove dependency on PJSIP

The res_hep_rtcp module was incorrectly including <pjsip.h>. This didn't need
to be included, as the module does not using PJPROJECT any fashion.
Unfortunately, because res_hep_rtcp did not include pjsip in its MODULEINFO as
a dependency, this also meant that res_hep_rtcp will fail to compile on a
system without PJPROJECT.

This patch removes the include.

Thanks to Damien Wedhorn for pointing this out in #asterisk-dev.

ASTERISK-24236 #close
Reported by: Damien Wedhorn, Matt Jordan
Tested by: Damien Wedhorn

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

10 years agomain/file: Move test event to emit PLAYBACK event more consistently
Matthew Jordan [Thu, 14 Aug 2014 20:57:48 +0000 (20:57 +0000)] 
main/file: Move test event to emit PLAYBACK event more consistently

This is being done in advance of the test for ASTERISK-23953
........

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

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

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

10 years agocel: Make sure channels in extra fields include their unique IDs as well
Matthew Jordan [Thu, 14 Aug 2014 19:09:32 +0000 (19:09 +0000)] 
cel: Make sure channels in extra fields include their unique IDs as well

CEL typically tracks a lot of information using the unique ID of the channel.
This is typically needed due to tying events together using the linked ID of
the various channels involved in a "call", which is derived from the channel ID
of the oldest channel involved in a bridge (or in the case of a Dial, the
parent channel).

Previously, we had updated the extra fields to include the involved channel
names, but forgot to put in the unique ID. This patch corrects that error.

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

10 years agoARI: Originate to app local channel subscription code optimization.
Richard Mudgett [Thu, 14 Aug 2014 16:30:21 +0000 (16:30 +0000)] 
ARI: Originate to app local channel subscription code optimization.

Reduce the scope of local_peer and only get it if the ARI originate is
subscribing to the channels.

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

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

10 years agores_pjsip_send_to_voicemail.c: Fix svn file properties.
Richard Mudgett [Wed, 13 Aug 2014 17:03:41 +0000 (17:03 +0000)] 
res_pjsip_send_to_voicemail.c: Fix svn file properties.

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

10 years agoPJSIP: Prevent crash no-URI contacts
Kinsey Moore [Wed, 13 Aug 2014 16:47:10 +0000 (16:47 +0000)] 
PJSIP: Prevent crash no-URI contacts

This prevents a crash from occurring when a contact with no URI is used
for the creation of an outbound out-of-dialog request with no
associated endpoint.

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

10 years agoBridges: Fix feature interruption/unintended kick caused by external actions
Jonathan Rose [Wed, 13 Aug 2014 15:21:07 +0000 (15:21 +0000)] 
Bridges: Fix feature interruption/unintended kick caused by external actions

If a manager or CLI user attached a mixmonitor to a call running a dynamic
bridge feature while in a bridge, the feature would be interrupted and the
channel would be forcibly kicked out of the bridge (usually ending the call
during a simple 1 to 1 call). This would also occur during any similar action
that could set the unbridge soft hangup flag, so the fix for this was to
remove unbridge from the soft hangup flags and make it a separate thing all
together.

ASTERISK-24027 #close
Reported by: mjordan
Review: https://reviewboard.asterisk.org/r/3900/

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

10 years agologger: Don't store verbose-magic in the log files.
Walter Doekes [Wed, 13 Aug 2014 07:50:34 +0000 (07:50 +0000)] 
logger: Don't store verbose-magic in the log files.

In r399267, the verbose2magic stuff was edited. This time it results
in magic characters in the log files for multiline messages.

In trunk (and 13) this was fixed by the "stripping" of those
characters from multiline messages (in r414798).

This is a backport of that fix to 11. That fix is altered to actually
strip the characters and not replace them with blanks.

Review: https://reviewboard.asterisk.org/r/3901/
Review: https://reviewboard.asterisk.org/r/3902/
........

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

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

10 years agores/stasis/command.c: Fix recent commit using spaces instead of tabs.
Richard Mudgett [Mon, 11 Aug 2014 20:42:44 +0000 (20:42 +0000)] 
res/stasis/command.c: Fix recent commit using spaces instead of tabs.

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

10 years agoAMI/ARI: Update version to 2.5.0/1.5.0 respectively
Matthew Jordan [Mon, 11 Aug 2014 18:48:18 +0000 (18:48 +0000)] 
AMI/ARI: Update version to 2.5.0/1.5.0 respectively

This is to support the backwards compatible changes made in the next version
of Asterisk.

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

10 years agoStasis: Use the correct return value
Kinsey Moore [Mon, 11 Aug 2014 18:45:11 +0000 (18:45 +0000)] 
Stasis: Use the correct return value

Return the correct value instead of always returning 0 when setting
internal status on unreal channels.

Reported by: Richard Mudgett

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

10 years agoStasis: Allow internal channels directly into bridges
Kinsey Moore [Mon, 11 Aug 2014 18:35:27 +0000 (18:35 +0000)] 
Stasis: Allow internal channels directly into bridges

The patch to catch channels being shoehorned into Stasis() via external
mechanisms also happens to catch Announcer and Recorder channels
because they aren't known to be stasis-controlled channels in the usual
sense. This marks those channels as Stasis()-internal channels and
allows them directly into bridges.

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

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

10 years agogeneral: Fix memory Corruption in __ast_string_field_ptr_build_va.
Walter Doekes [Mon, 11 Aug 2014 10:37:41 +0000 (10:37 +0000)] 
general: Fix memory Corruption in __ast_string_field_ptr_build_va.

If the space left in a stringfield is between 0 and
(alignof(ast_string_field_allocation)-1) adding new data would cause
memory corruption, because we would assume enough space (unsigned
underrun).

Thanks Arnd Schmitter for reporting and finding out the cause!

ASTERISK-23508 #close
Reported by: Arnd Schmitter
Tested by: Arnd Schmitter, JoshE

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

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

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

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

10 years agotcptls: Avoid compiler warning on non-dev-mode.
Walter Doekes [Mon, 11 Aug 2014 09:53:29 +0000 (09:53 +0000)] 
tcptls: Avoid compiler warning on non-dev-mode.
........

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

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

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

10 years agomain/message: remove debug message
Matthew Jordan [Fri, 8 Aug 2014 12:31:25 +0000 (12:31 +0000)] 
main/message: remove debug message

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

11 years agoCEL: Update unit tests for additional information
Kinsey Moore [Fri, 8 Aug 2014 02:51:15 +0000 (02:51 +0000)] 
CEL: Update unit tests for additional information

This updates the CEL unit tests for the new information contained in
the attended transfer CEL extra field.

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

11 years agochan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.
Richard Mudgett [Thu, 7 Aug 2014 21:48:58 +0000 (21:48 +0000)] 
chan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.

Replace sip_tls_read() and sip_tcp_read() with a single function and
resolve the poll/wait issue with large SDP payloads.

ASTERISK-18345 #close
Reported by: Stephane Chazelas
Patches:
      tcptls_pollv4.diff (license #5835) patch uploaded by Elazar Broad

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

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

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

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

11 years agoStasis: Correct blind transfer message generation
Kinsey Moore [Thu, 7 Aug 2014 21:16:11 +0000 (21:16 +0000)] 
Stasis: Correct blind transfer message generation

This fixes the json object creation format string and key name for the
BridgeBlindTransfer Stasis event allowing it to be published properly.

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

11 years agoStasis: Ensure transfer messages follow validation rules
Kinsey Moore [Thu, 7 Aug 2014 20:23:30 +0000 (20:23 +0000)] 
Stasis: Ensure transfer messages follow validation rules

This makes Stasis() event generation for transfer messages follow
validation rules. Currently, ast_json_null() is being used in place of
omitting a key entirely which falls afoul of these validation rules.

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

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

11 years agoEnsure bridges exist when trying to determine bridged parties when publishing transfe...
Mark Michelson [Thu, 7 Aug 2014 19:43:59 +0000 (19:43 +0000)] 
Ensure bridges exist when trying to determine bridged parties when publishing transfer information.

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

11 years agoRevert previous patch since it had some unreviewed content in it.
Mark Michelson [Thu, 7 Aug 2014 19:42:43 +0000 (19:42 +0000)] 
Revert previous patch since it had some unreviewed content in it.

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

11 years agoEnsure bridges actually exist when trying to determine the bridged peer.
Mark Michelson [Thu, 7 Aug 2014 19:37:00 +0000 (19:37 +0000)] 
Ensure bridges actually exist when trying to determine the bridged peer.

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

11 years agoStasis: Convey transfer information to applications
Kinsey Moore [Thu, 7 Aug 2014 15:19:53 +0000 (15:19 +0000)] 
Stasis: Convey transfer information to applications

This fixes a class of issues where Stasis applications were not made
aware that their channels were being manipulated or replaced by
external entitiessuch as transfers, AMI commands, or dialplan
applications such as Bridge(). Inconsistent information such as
StasisEnd events with unknown channels as a result of masquerades has
also been corrected. To accomplish these fixes, several new fields
were added to blind and attended transfer messages as well as
StasisStart and BridgeAttendedTransfer Stasis events.

ASTERISK-23941 #close
Review: https://reviewboard.asterisk.org/r/3865/
Review: https://reviewboard.asterisk.org/r/3857/
Review: https://reviewboard.asterisk.org/r/3852/
Review: https://reviewboard.asterisk.org/r/3816/
Review: https://reviewboard.asterisk.org/r/3731/
Review: https://reviewboard.asterisk.org/r/3729/
Review: https://reviewboard.asterisk.org/r/3728/

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

11 years agoChange comment.
Richard Mudgett [Wed, 6 Aug 2014 21:47:30 +0000 (21:47 +0000)] 
Change comment.

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

11 years agoalembic: Adjust sippeers, queue_members, and voicemail_messages tables.
Richard Mudgett [Wed, 6 Aug 2014 16:51:49 +0000 (16:51 +0000)] 
alembic: Adjust sippeers, queue_members, and voicemail_messages tables.

* Increased the sippeers useragent max string size to 255.

* Changed the queue_members uniqueid to an auto incremented integer
instead of a string.

* Increased the voicemail_messages BLOB size to LONGBLOB on mysql.

* Fixed the add_tables_for_pjsip config change version downgrade actions
to drop a table it created.

* Adjusted the sample alembic.ini files cdr.ini.sample, config.ini.sample,
and voicemail.ini.sample to give a mysql and postgres sqlalchemy.url
lines.

ASTERISK-23847 #close
Reported by: Stephen More

ASTERISK-23825 #close
Reported by: Stephen More

ASTERISK-23909 #close
Reported by: Stephen More

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

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

11 years agopbx_lua: fix regression with global sym export and context clash by pbx_config.
George Joseph [Wed, 6 Aug 2014 16:10:01 +0000 (16:10 +0000)] 
pbx_lua: fix regression with global sym export and context clash by pbx_config.

ASTERISK-23818 (lua contexts being overwritten by contexts of the same name in
pbx_config) surfaced because pbx_lua, having the AST_MODFLAG_GLOBAL_SYMBOLS
set, was always force loaded before pbx_config.  Since I couldn't find any
reason for pbx_lua to export it's symbols to the rest of Asterisk, I simply
changed the flag to AST_MODFLAG_DEFAULT.  Problem solved.  What I didn't
realize was that the symbols need to be exported not because Asterisk needs
them but because any external Lua modules like luasql.mysql need the base
Lua language APIs exported (ASTERISK-17279).

Back to ASTERISK-23818...  It looks like there's an issue in pbx.c where
context_merge was only merging includes, switches and ignore patterns if
the context was already existing AND has extensions, or if the context was
brand new.  If pbx_lua is loaded before pbx_config, the context will exist
BUT pbx_lua, being implemented as a switch, will never place extensions in
it, just the switch statement.  The result is that when pbx_config loads,
it never merges the switch statement created by pbx_lua into the final
context.

This patch sets pbx_lua's modflag back to AST_MODFLAG_GLOBAL_SYMBOLS and adds
an "else if" in context_merge that catches the case where an existing context
has includes, switchs or ingore patterns but no actual extensions.

ASTERISK-23818 #close
Reported by: Dennis Guse
Reported by: Timo Teräs
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3891/
........

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

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

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

11 years agostasis: Fix compilation issue with ao2 tagged objects
Matthew Jordan [Tue, 5 Aug 2014 21:47:51 +0000 (21:47 +0000)] 
stasis: Fix compilation issue with ao2 tagged objects

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

11 years agotest_message: Fix strict-aliasing compilation issue
Matthew Jordan [Tue, 5 Aug 2014 21:36:25 +0000 (21:36 +0000)] 
test_message: Fix strict-aliasing compilation issue

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

11 years agoRemove automerge properties :-(
Matthew Jordan [Tue, 5 Aug 2014 20:16:37 +0000 (20:16 +0000)] 
Remove automerge properties :-(

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

11 years agoARI: Add channel technology agnostic out of call text messaging
Matthew Jordan [Tue, 5 Aug 2014 20:10:52 +0000 (20:10 +0000)] 
ARI: Add channel technology agnostic out of call text messaging

This patch adds the ability to send and receive text messages from various
technology stacks in Asterisk through ARI. This includes chan_sip (sip),
res_pjsip_messaging (pjsip), and res_xmpp (xmpp). Messages are sent using the
endpoints resource, and can be sent directly through that resource, or to a
particular endpoint.

For example, the following would send the message "Hello there" to PJSIP
endpoint alice with a display URI of sip:asterisk@mycooldomain.org:

ari/endpoints/sendMessage?to=pjsip:alice&from=sip:asterisk@mycooldomain.org&body=Hello+There

This is equivalent to the following as well:

ari/endpoints/PJSIP/alice/sendMessage?from=sip:asterisk@mycooldomain.org&body=Hello+There

Both forms are available for message technologies that allow for arbitrary
destinations, such as chan_sip.

Inbound messages can now be received over ARI as well. An ARI application that
subscribes to endpoints will receive messages from those endpoints:

{
  "type": "TextMessageReceived",
  "timestamp": "2014-07-12T22:53:13.494-0500",
  "endpoint": {
    "technology": "PJSIP",
    "resource": "alice",
    "state": "online",
    "channel_ids": []
  },
  "message": {
    "from": "\"alice\" <sip:alice@127.0.0.1>",
    "to": "pjsip:asterisk@127.0.0.1",
    "body": "Watson, come here.",
    "variables": []
  },
  "application": "testsuite"
}

The above was made possible due to some rather major changes in the message
core. This includes (but is not limited to):
- Users of the message API can now register message handlers. A handler has
  two callbacks: one to determine if the handler has a destination for the
  message, and another to handle it.
- All dialplan functionality of handling a message was moved into a message
  handler provided by the message API.
- Messages can now have the technology/endpoint associated with them.
  Various other properties are also now more easily accessible.
- A number of ao2 containers that weren't really needed were replaced with
  vectors. Iteration over ao2_containers is expensive and pointless when
  the lifetime of things is well defined and the number of things is very
  small.

res_stasis now has a new file that makes up its structure, messaging. The
messaging functionality implements a message handler, and passes received
messages that match an interested endpoint over to the app for processing.

Note that inadvertently while testing this, I reproduced ASTERISK-23969.
res_pjsip_messaging was incorrectly parsing out the 'to' field, such that
arbitrary SIP URIs mangled the endpoint lookup. This patch includes the
fix for that as well.

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

ASTERISK-23692 #close
Reported by: Matt Jordan

ASTERISK-23969 #close
Reported by: Andrew Nagy

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

11 years agoformat.c: Add reason comments for the format_list ordering.
Richard Mudgett [Tue, 5 Aug 2014 19:12:40 +0000 (19:12 +0000)] 
format.c: Add reason comments for the format_list ordering.
........

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

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

11 years agoManager - Improve documentation for manager commands Getvar and Setvar.
Rusty Newton [Mon, 4 Aug 2014 19:45:33 +0000 (19:45 +0000)] 
Manager - Improve documentation for manager commands Getvar and Setvar.

The documentation for these commands did not make it clear that they could
accept expressions and functions. Modified to make this clear, but tried
not to be overly explicit.

ASTERISK-21178 #close
Reported by: Rusty Newton
Tested by: Rusty Newton

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

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

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

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

11 years agoGet rid of automerge properties
Matthew Jordan [Thu, 31 Jul 2014 11:57:11 +0000 (11:57 +0000)] 
Get rid of automerge properties

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

11 years agores_hep_rtcp: Add module that sends RTCP information to a Homer Server
Matthew Jordan [Thu, 31 Jul 2014 11:55:19 +0000 (11:55 +0000)] 
res_hep_rtcp: Add module that sends RTCP information to a Homer Server

This patch adds a new module to Asterisk, res_hep_rtcp. The module subscribes
to the RTCP topics in Stasis and receives RTCP information back from the
message bus. It encodes into HEPv3 packets and sends the information to the
res_hep module for transmission.

Using this, someone with a Homer server can get live call quality monitoring
for all RTP-based channels in their Asterisk 12+ systems.

In addition, there were a few bugs in the RTP engine, res_rtp_asterisk, and
chan_pjsip that were uncovered by the tests written for the Asterisk Test
Suite. This patch fixes the following:
1) chan_pjsip failed to set its channel unique ids on its RTP instance on
   outbound calls. It now does this in the appropriate location, in the
   serialized call callback.
2) The rtp_engine was overflowing some values when packed into JSON.
   Specifically, some longs and unsigned ints can't be be packed into integer
   values, for obvious reasons. Since libjansson only supports integers,
   floats, strings, booleans, and objects, we print these values into strings.
3) res_rtp_asterisk had a few problems:
   (a) it would emit a source IP address of 0.0.0.0 if bound to that IP
       address. We now use ast_find_ourip to get a better IP address, and
       properly marshal the result into an ast_strdupa'd string.
   (b) Reports can be generated with no report bodies. In particular, this
       occurs when a sender is transmitting information to a receiver (who
       will send no RTP back to the sender). As such, the sender has no report
       body for what it received. We now properly handle this case, and the
       sender will emit SR reports with no body. Likewise, if we receive an
       RTCP packet with no report body, we will still generate the appropriate
       events.

ASTERISK-24119 #close

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

11 years agores_pjsip_session: Fix race condition where redirecting information may not be set.
Joshua Colp [Tue, 29 Jul 2014 10:52:25 +0000 (10:52 +0000)] 
res_pjsip_session: Fix race condition where redirecting information may not be set.

Since the PJSIP INVITE session module is invoked before any session supplements it was
possible for it to handle a redirect before the res_pjsip_diversion module interpreted
and set redirecting information on the channel. This would cause the redirecting
information to get lost.

This patch ensures that session supplements are *always* invoked before a redirect occurs
by explicitly calling them in the redirect handler.

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

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

11 years agores_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity...
Joshua Colp [Tue, 29 Jul 2014 09:50:13 +0000 (09:50 +0000)] 
res_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity is unquoted.

The local entity as provided by PJSIP is quoted within '<' and '>'. As a result placing
this value into XML will result in malformed XML being produced. This patch now unquotes
the local entity so it can go safely into the XML.

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

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

11 years agodatastores: Audit ast_channel_datastore_remove usage.
Richard Mudgett [Mon, 28 Jul 2014 18:50:14 +0000 (18:50 +0000)] 
datastores: Audit ast_channel_datastore_remove usage.

Audit of v1.8 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leaks in app_speech_utils and func_frame_trace.

* Fixed app_speech_utils not locking the channel when accessing the
channel datastore list.

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

Audit of v11 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leak in func_jitterbuffer.  (Was not in v12)

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

Audit of v12 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leaks in abstract_jb.

* Fixed leak in ast_channel_unsuppress().  Used by ARI mute control and
res_mutestream.

* Fixed ref leak in ast_channel_suppress().  Used by ARI mute control and
res_mutestream.

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

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

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

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

11 years agoBlocked revisions 419631
Richard Mudgett [Fri, 25 Jul 2014 23:15:30 +0000 (23:15 +0000)] 
Blocked revisions 419631

........
features.c: Allow appliationmap to use Gosub.

Using DYNAMIC_FEATURES with a Gosub application as the mapped application
does not work.  It does not work because Gosub just pushes the current
dialplan context, exten, and priority onto a stack and sets the specified
Gosub location.  Gosub does not have a dialplan execution loop to run
dialplan like Macro.

* Made the DYNAMIC_FEATURES application mapping feature call
ast_app_exec_macro() and ast_app_exec_sub() for the Macro and Gosub
applications respectively.

* Backported ast_app_exec_macro() and ast_app_exec_sub() from v11 to
execute dialplan routines from the DYNAMIC_FEATURES application mapping
feature.

NOTE: This issue does not affect v12+ because it already does what this
patch implements.

AST-1391 #close
Reported by: Guenther Kelleter

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

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

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

11 years agoUpdate CHANGES for r419565
Matthew Jordan [Fri, 25 Jul 2014 14:46:15 +0000 (14:46 +0000)] 
Update CHANGES for r419565

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

11 years agoARI: report duration values in LiveRecording objects
Matthew Jordan [Fri, 25 Jul 2014 14:41:23 +0000 (14:41 +0000)] 
ARI: report duration values in LiveRecording objects

This patch adds three new fields to the LiveRecording model:
 - total_duration: the total length of the live recording
 - talking_duration: optional. The duration of talking energy that was
   detected while the recording was made.
 - silence_duration: optional. The duration of silence that was detected while
   the recording was made.

These values are reported in the RecordingFinished ARI event.

When a DSP is enabled on the channel during the recording - which occurs when
the recording is created with max_silence_seconds (indicating that the user
actually cares about how much silence is in the file), we will report the
talking_duration and silence_duration in addition to the total_duration.

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

ASTERISK-24037 #close
Reported by: Samuel Galarneau

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

11 years agoapp_bridgewait: Remove possibility of race condition between channels leaving/joining.
Joshua Colp [Fri, 25 Jul 2014 10:53:42 +0000 (10:53 +0000)] 
app_bridgewait: Remove possibility of race condition between channels leaving/joining.

Bridges created by app_bridgewait previously had the "dissolve when empty" flag set.
This caused the bridge core to destroy them when the last channel had left. This
introduced a race condition where we may have a reference to the bridge but it is
not actually joinable when we try to join it. This flag has now been removed and the
bridge is guaranteed to be joinable at all times.

ASTERISK-23987 #close
Reported by: Matt Jordan

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

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

11 years agobridge: Make "bridge destroy" only available in developer mode and add "all" to ...
Joshua Colp [Fri, 25 Jul 2014 10:49:06 +0000 (10:49 +0000)] 
bridge: Make "bridge destroy" only available in developer mode and add "all" to "bridge kick".

The "bridge destroy" CLI command is invasive to bridges and can leave them in an unexpected
state for the users of them. Since this command may be useful for developers it is now
only available when developer mode is available. To take its place "all" has been added
as a valid option to the "bridge kick" CLI command. It will kick all of the channels
in the bridge out.

ASTERISK-23987
Reported by: Matt Jordan

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

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

11 years agochan_sip: sip_subscribe_mwi_destroy should not call sip_destroy
Corey Farrell [Thu, 24 Jul 2014 17:57:46 +0000 (17:57 +0000)] 
chan_sip: sip_subscribe_mwi_destroy should not call sip_destroy

sip_subscribe_mwi_destroy calls sip_destroy on the reference counted
mwi->call.  This results in the fields of mwi->call being freed, but
mwi->call itself it leaked.  If other code is still using mwi->call
it can cause problems.  This change uses dialog_unref instead, to
balance the ref provided by sip_alloc().

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

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

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

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

11 years agoDon't cause Asterisk to exit if ooh323.conf not found.
Jason Parker [Thu, 24 Jul 2014 16:50:41 +0000 (16:50 +0000)] 
Don't cause Asterisk to exit if ooh323.conf not found.

(closes issue ASTERISK-23814)
........

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

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

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

11 years agoendpoints: Fix failing unit tests from r419196
Matthew Jordan [Wed, 23 Jul 2014 16:45:15 +0000 (16:45 +0000)] 
endpoints: Fix failing unit tests from r419196

This patch does two things:
(1) It updates the unit tests to expect additional stasis messages. More
    messages are now sent to the endpoint topic, due to forwarding all
    channel messages and the forwarding relationship set up between
    endpoints themselves.
(2) Remove the technology forwarding subscription during
    ast_endpoint_shutdown. This prevents an improper double shutdown of
    an endpoint from occurring.

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

11 years agores_pjsip_refer: remove stray debugging line
Matthew Jordan [Wed, 23 Jul 2014 16:41:27 +0000 (16:41 +0000)] 
res_pjsip_refer: remove stray debugging line

How'd those @ symbols get in there...

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

11 years agoapp_voicemail: use a consistent generator string
Scott Griepentrog [Wed, 23 Jul 2014 13:58:57 +0000 (13:58 +0000)] 
app_voicemail: use a consistent generator string

When updating voicemail.conf when a user changes
their pin, change the generator string to be the
same as the module name when reading so that the
same config_hook will be called.

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

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

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

11 years agoARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech
Matthew Jordan [Tue, 22 Jul 2014 16:12:49 +0000 (16:12 +0000)] 
ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech

This patch serves two purposes:
(1) It fixes some bugs with endpoint subscriptions not reporting all of the
    channel events
(2) It serves as the preliminary work needed for ASTERISK-23692, which allows
    for sending/receiving arbitrary out of call text messages through ARI in a
    technology agnostic fashion.

The messaging functionality described on ASTERISK-23692 requires two things:
(1) The ability to send/receive messages associated with an endpoint. This is
    relatively straight forwards with the endpoint core in Asterisk now.
(2) The ability to send/receive messages associated with a technology and an
    arbitrary technology defined URI. This is less straight forward, as
    endpoints are formed from a tech + resource pair. We don't have a
    mechanism to note that a technology that *may* have endpoints exists.

This patch provides such a mechanism, and fixes a few bugs along the way.

The first major bug this patch fixes is the forwarding of channel messages
to their respective endpoints. Prior to this patch, there were two problems:
(1) Channel caching messages weren't forwarded. Thus, the endpoints missed
    most of the interesting bits (such as channel creation, destruction, state
    changes, etc.)
(2) Channels weren't associated with their endpoint until after creation.
    This resulted in endpoints missing the channel creation message, which
    limited the usefulness of the subscription in the first place (a major use
    case being 'tell me when this endpoint has a channel'). Unfortunately,
    this meant another parameter to ast_channel_alloc. Since not all channel
    technologies support an ast_endpoint, this patch makes such a call
    optional and opts for a new function, ast_channel_alloc_with_endpoint.

When endpoints are created, they will implicitly create a technology endpoint
for their technology (if one does not already exist). A technology endpoint is
special in that it has no state, cannot have channels created for it, cannot
be created explicitly, and cannot be destroyed except on shutdown. It does,
however, have all messages from other endpoints in its technology forwarded to
it.

Combined with the bug fixes, we now have Stasis messages being properly
forwarded. Consider the following scenario: two PJSIP endpoints (foo and bar),
where bar has a single channel associated with it and foo has two channels
associated with it. The messages would be forwarded as follows:

channel PJSIP/foo-1 --
                      \
                       --> endpoint PJSIP/foo --
                      /                         \
channel PJSIP/foo-2 --                           \
                                                  ---- > endpoint PJSIP
                                                /
channel PJSIP/bar-1 -----> endpoint PJSIP/bar --

ARI, through the applications resource, can:
 - subscribe to endpoint:PJSIP/foo and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2 and endpoint PJSIP/foo
 - subscribe to endpoint:PJSIP/bar and get notifications for channels
   PJSIP/bar-1 and endpoint PJSIP/bar
 - subscribe to endpoint:PJSIP and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2,PJSIP/bar-1 and endpoints PJSIP/foo,PJSIP/bar

Note that since endpoint PJSIP never changes, it never has events itself. It
merely provides an aggregation point for all other endpoints in its technology
(which in turn aggregate all channel messages associated with that endpoint).

This patch also adds endpoints to res_xmpp and chan_motif, because the actual
messaging work will need it (messaging without XMPP is just sad).

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

ASTERISK-23692

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

11 years agoFix more dev-mode build issues
Kinsey Moore [Tue, 22 Jul 2014 14:13:14 +0000 (14:13 +0000)] 
Fix more dev-mode build issues
........

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

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

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

11 years agoari: Add a copy operation for stored recordings
Matthew Jordan [Fri, 18 Jul 2014 21:25:59 +0000 (21:25 +0000)] 
ari: Add a copy operation for stored recordings

This patch adds a new operation for stored recordings, copy. It takes an
existing stored recording and makes a copy of it in the same directory
or a relative directory under the stored recording directory.

/ari/recordings/stored/{recordingName}/copy?destinationRecordingName={copy_name}

This is particularly useful for voicemail-esque applications, which may need to
copy or move recordings around a directory structure.

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

ASTERISK-24036 #close
Reported by: Sam Galarneau
Tested by: Sam Galarneau

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

11 years agostasis: fix call to ao2_t_alloc for stasis_message_router_create
Corey Farrell [Fri, 18 Jul 2014 21:24:03 +0000 (21:24 +0000)] 
stasis: fix call to ao2_t_alloc for stasis_message_router_create

This fixes a build failure introduced by r3821.  struct stasis_topic is
opaque, so topic->name is unavailable.  Switch to using stasis_topic_name().

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

11 years agostasis: use ao2_t_alloc for certain object allocators
Corey Farrell [Fri, 18 Jul 2014 19:53:31 +0000 (19:53 +0000)] 
stasis: use ao2_t_alloc for certain object allocators

Add tags to stasis objects using the name.  This makes it
easier to track the source of certain stasis ref leaks.

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

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

11 years agofunc_audiohookinherit.c: Fixup some XML documentation wording.
Richard Mudgett [Fri, 18 Jul 2014 16:46:35 +0000 (16:46 +0000)] 
func_audiohookinherit.c: Fixup some XML documentation wording.

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

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

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

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

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

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

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

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

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

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

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

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