Commit Graph

2658 Commits

Author SHA1 Message Date
Kinsey Moore 7f2623a26f PJSIP: Prevent T38 framehook being put on wrong channel
This change gives framehooks a reverse-direction masquerade callback in
addition to chan_fixup_cb similar to the callback added to datastores
to handle the same situation. The new callback provides the same
parameters as the fixup callback, but is called on the new channel's
framehooks before moving framehooks from the old channel to the new
channel. This gives the framehooks an oppurtunity to decide whether
they should remain on the new channel or be removed.

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

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

Merged revisions 423503 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423504 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-19 12:50:08 +00:00
Sean Bright 40e033a6b6 res_pjsip: Don't require a password when doing userpass authentication.
An empty password is valid for username/password authentication so we should
allow password to be empty/not supplied.

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

Merged revisions 423481 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423482 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 19:31:03 +00:00
Mark Michelson de72f3edbc Add subscription state test events.
These are needed for a set of batched notification RLS tests that are
about to be committed to the testsuite.

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

Merged revisions 423462 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 18:56:54 +00:00
Jonathan Rose ac46240b62 res_pjsip_endpoint_identifier_ip: Fix parsing of match value with CIDR
Also fixes comma separates match lists

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

Merged revisions 423417 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423425 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 17:22:03 +00:00
Mark Michelson 389db2b720 res_fax_spandsp: Properly handle cleanup before starting FAXes.
If faxing fails at a very early stage, then it is possible for
us to pass a NULL t30 state pointer to spandsp, which spandsp
is none too pleased with.

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

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

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

Merged revisions 423365 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423372 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 16:24:48 +00:00
Mark Michelson 79eac1ffca res_pjsip_pubsub: Add some type safety when generating NOTIFY bodies.
res_pjsip_pubsub has two separate checks that it makes when a SUBSCRIBE
arrives.
* It checks that there is a subscription handler for the Event
* It checks that there are body generators for the types in the Accept header

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

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

ASTERISK-24136 #close
Reported by Mark Michelson

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

Merged revisions 423344 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423348 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 16:09:25 +00:00
George Joseph 126334a7aa res_pjsip: ami: Fix error in AMI output when an endpoint has no transport
When no transport is associated to an endpoint, the AMI output for
PJSIPShowEndpoint indicates an error instead of silently ignoring the
missing transport.

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

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

Merged revisions 423282 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423284 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 15:14:38 +00:00
Joshua Colp 8839ba3727 res_rtp_asterisk: Ensure that the thread terminating pj stuff is registered.
........

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

Merged revisions 423254 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423255 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-17 18:06:06 +00:00
Joshua Colp 618b46d8f0 Multiple revisions 423209,423212
........
  r423209 | file | 2014-09-16 17:35:34 -0300 (Tue, 16 Sep 2014) | 8 lines
  
  res_rtp_asterisk: Fix building when pjproject is not used.
  ........
  
  Merged revisions 423207 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 423208 from http://svn.asterisk.org/svn/asterisk/branches/12
........
  r423212 | file | 2014-09-16 18:03:59 -0300 (Tue, 16 Sep 2014) | 10 lines
  
  res_rtp_asterisk: Fix 100% CPU usage due to timer heap thread spinning.
  
  Side note: I need a vacation.
  ........
  
  Merged revisions 423210 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 423211 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423209,423212 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-16 21:06:22 +00:00
Joshua Colp ceedf44edd res_pjsip_session: Fix usage of wrong memory pool when creating local SDP.
........

Merged revisions 423172 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423173 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-16 12:12:36 +00:00
Joshua Colp e977425bc8 res_rtp_asterisk: Fix a myriad of TURN client issues.
1. The number of file descriptors an ioqueue instance can handle is fixed, so we
now spawn the required number to handle the load.
2. Our transport identifiers were exceeding the range supported by pjnath.
3. The TURN client did not set up client binding causing needless bandwidth usage.
4. The code no longer updates address information on each packet.
5. STUN traffic was getting looped back to Asterisk instead of going through the
TURN server.
6. Synchronization now ensures things are completely setup or destroyed.
7. Logging now reflects the target the TURN server is sending to/receiving from
on our behalf.

ASTERISK-23577 #close
Reported by: Jay Jideliov

ASTERISK-23634 #close
Reported by: Roman Skvirsky

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

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

Merged revisions 423151 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 423152 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-16 11:12:30 +00:00
Walter Doekes 9c1f34c7e9 musiconhold: Add sort=randstart, and deprecate old stuff.
- adds sort=randstart (next to sort=, sort=random, sort=alpha)
- combines duplicate moh option parsing code into a single function
- adds deprecationwarnings for application=r to sort randomly
- adds deprecationwarnings for random=yes to sort randomly
- removes invisible code that was supposed to stay until 1.8 

The sort=randstart works like sort=alpha, except we start at a random
position.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-14 15:41:58 +00:00
Sean Bright 7bd3287a11 pjsip/config_auth.c: Add missing whitespace to log messages.
The errors generated when validating 'auth' settings are missing a space which
makes the messages a little confusing.
........

Merged revisions 422899 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422901 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-10 16:00:36 +00:00
Mark Michelson c6bc44f700 Pre-allocate transmission data buffer for RLS NOTIFY requests.
PJSIP, unless a constant is modified at compilation time, limits
SIP requests to 4000 bytes. Full-state RLS notifications can easily
exceed this limit with moderately small lists.

This changeset allows for Asterisk to work around this size limit by
performing its own allocation of the transmission data buffer. This
way, Asterisk can allocate a buffer that exceeds the built-in maximum.

We still impose our own limit of 64000 bytes, mainly because making
allocations larger than that is a bit absurd.

ASTERISK-24181 #close
Reported by Mark Michelson

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

Merged revisions 422851 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-08 17:35:02 +00:00
Jonathan Rose ef5f7a0e32 res_pjsip_pubsub: Check supported headers for eventlist when subscribing to
resource list

https://wiki.asterisk.org/wiki/display/AST/Resource+List+Subscription+Test+Plan
According to the off-nominal plan, if evenlist support is not specified in a
SUBSCRIBE's supported header(s), that subscription should be rejected with an
error.

ASTERISK-23871
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/3960/diff/#index_header
........

Merged revisions 422836 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-08 15:58:24 +00:00
Joshua Colp fd8010de2b res_pjsip_sdp_rtp: Fix retrieval of "ice-pwd" attribute if in session and not media stream.
........

Merged revisions 422746 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422747 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-06 19:13:10 +00:00
Joshua Colp 3cd36d0e10 res_pjsip_transport_websocket: Fix crash when the Contact header is not a URI.
The code for changing the Contact header wrongly assumed that the Contact
would always contain a URI. This is incorrect.

ASTERISK-24271
Reported by: Dafi Ni
........

Merged revisions 422557 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422558 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-03 14:05:58 +00:00
Mark Michelson 1b64f353f1 Resolve race condition where channels enter dialplan application before media has been negotiated.
Testsuite tests will occasionally fail because on reception of a 200 OK SIP response,
an AST_CONTROL_ANSWER frame is queued prior to when media has finished being
negotiated. This is because session supplements are called into before PJSIP's
inv_session code has told us that media has been updated. Sometimes the queued answer
frame is handled by the PBX thread before the ensuing media negotiations occur, causing
a test failure.

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

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

ASTERISK-24212 #close
Reported by Matt Jordan

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

Merged revisions 422536 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422542 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-02 20:29:58 +00:00
Matthew Jordan df5dbbd878 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 
........

Merged revisions 422503 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422504 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-01 14:15:32 +00:00
Mark Michelson 327d67270f Fix bug that did not allow for multiple batched RLS notifications to be sent.
A misunderstanding of how the scheduler worked caused further batched notifications
beyond the first not to get scheduled. Now we reset our scheduler ID to -1 after
the batched notification is sent. This way, further notifications can be scheduled
when they arise.
........

Merged revisions 422239 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28 15:50:41 +00:00
Richard Mudgett 94e1b4a8a4 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().
........

Merged revisions 422214 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422215 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28 00:44:59 +00:00
Kinsey Moore bf85018107 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/
Review: https://reviewboard.asterisk.org/r/3933/
........

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
........

Merged revisions 422114 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422154 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-27 15:39:35 +00:00
Richard Mudgett fefa6fba82 res_musiconhold.c: Release any format refs before memset().
* Clear the channel music_state pointer before destroying the music_state
object for safety.
........

Merged revisions 422037 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-25 16:45:40 +00:00
Richard Mudgett 2b19d94a71 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
........

Merged revisions 421978 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421979 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-25 16:16:52 +00:00
Joshua Colp 497a92d079 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
........

Merged revisions 421955 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421956 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-24 19:37:00 +00:00
Joshua Colp 477e2e6edb 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.
........

Merged revisions 421939 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421945 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-24 19:21:33 +00:00
Joshua Colp 2c0cbf8e64 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.
........

Merged revisions 421931 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421932 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-24 18:54:00 +00:00
Jonathan Rose 33835e17a0 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/
........

Merged revisions 421879 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421880 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-22 16:52:51 +00:00
Richard Mudgett f8c4fc1121 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
........

Merged revisions 421801 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421802 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 22:09:24 +00:00
Mark Michelson 644e693645 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
........

Merged revisions 421796 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421797 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 21:43:45 +00:00
Mark Michelson 56a1d4930a 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
........

Merged revisions 421792 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421794 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 21:37:03 +00:00
Jonathan Rose 4946981646 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
........

Merged revisions 421779 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421788 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 21:35:58 +00:00
Mark Michelson 12d34bb12f Let's try checking the name and number, instead of the name twice.
........

Merged revisions 421789 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421790 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 21:28:16 +00:00
Mark Michelson 2150daf748 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.
........

Merged revisions 421778 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421783 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 21:19:06 +00:00
Matthew Jordan 085d5a2629 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)
........

Merged revisions 421677 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421678 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 14:52:28 +00:00
Richard Mudgett b7f98c3da4 chan_pjsip: Update media translation paths when new SDP negotiated.
On a SIP reinvite that changes media strams, the PJSIP channel driver was
flooding the log with "Asked to transmit frame type %s, while native
formats is %s" warnings.

* Fixes PJSIP not setting up translation paths when the formats change on
a reinvite.  AFS-63 was effectively reintroduced because of the media
formats work.  res_pjsip_sdp_rtp.c:set_caps()

* Improved the unexpected frame format WARNING message to include more
information.

* Added protective locking while altering formats on a channel.  Reworked
set_format() to simplify and protect the formats under manipulation.

* Restored some code that got lost in the media_formats work.
(channel.c:set_format() and res_pjsip_sdp_rtp.c:set_caps())

AFS-137 #close
Reported by: Mark Michelson

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

Merged revisions 421645 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-20 22:52:44 +00:00
Mark Michelson 49f8bd4ad4 Set the role for inbound subscriptions correctly.
This was causing the AMI show_subscriptions test in
the testsuite to fail since all subscriptions were being
seen as subscribers instead of notifiers.
........

Merged revisions 421585 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-20 20:41:04 +00:00
Kinsey Moore 36f4bff943 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/
........

Merged revisions 421537 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421538 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-20 13:06:33 +00:00
Mark Michelson 76290adf50 Alter documentation for callerid_privacy to use correct values.
........

Merged revisions 421485 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421488 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-19 20:28:56 +00:00
Mark Michelson 28a89e7685 Fix compilation error on certain versions of GCC.
........

Merged revisions 421447 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421448 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-19 19:55:56 +00:00
Jonathan Rose 222b5cd036 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)
........

Merged revisions 421416 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421423 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-19 16:36:30 +00:00
Richard Mudgett 83a9b91da9 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/
........

Merged revisions 421400 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421403 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-19 16:16:03 +00:00
Matthew Jordan bb494067a5 Multiple revisions 421311-421312
........
  r421311 | mjordan | 2014-08-17 20:11:28 -0500 (Sun, 17 Aug 2014) | 9 lines
  
  res/ari/resource_channels: Don't return allocation failure on failed function
  
  If a function fails to execute, it is most likely due to one of two reasons:
  (1) The function doesn't exist or can't be read from
  (2) The function is dangerous and is restricted based on the user's permissions
  
  Currently we return allocation failure, which is incorrect. This updates the
  reason code to more accurately reflect why the request failed.

  ASTERISK-24215
........
  r421312 | mjordan | 2014-08-17 20:13:41 -0500 (Sun, 17 Aug 2014) | 4 lines
  
  res/ari/resource_channels: Fix compilation issue
  
  Forgot a parameter. Whoops.
........

Merged revisions 421311-421312 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-18 01:14:51 +00:00
Matthew Jordan ba5d5da60b Improve call forwarding reporting, especially with regards to ARI.
This patch addresses a few issues:

1) The order of Dial events have been changed when performing a call forward.
   The order has now been altered to
    1) Dial begins dialing channel A.
    2) When A forwards the call to B, we issue the dial end event to channel
       A, indicating the dial is being canceled due to a forward to B.
    3) When the call to channel B occurs, we then issue a new dial begin to
       channel B.

2) Call forwards are now reported on the calling channel, not the peer channel.

3) AMI DialEnd events have been altered to display the extension the call is
   being forwarded to when relevant.

4) You can now get the values of channel variables for channels that are not
   currently in the Stasis application. This brings the retrieval of channel
   variables more in line with the rest of channel read operations since they
   may be performed on channels not in Stasis.

ASTERISK-24134 #close
Reported by Matt Jordan

ASTERISK-24138 #close
Reported by Matt Jordan

Patches:
	forward-shenanigans.diff uploaded by Matt Jordan (License #6283)

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

Merged revisions 420794 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-18 00:57:01 +00:00
Joshua Colp 952da298ce res_http_websocket: Include query parameters in client connection requests.
Review: https://reviewboard.asterisk.org/r/3914/
........

Merged revisions 421210 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-17 16:11:27 +00:00
Matthew Jordan 980e49614c 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
........

Merged revisions 421064 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421065 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-14 21:16:32 +00:00
Richard Mudgett 79c5c08db9 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/
........

Merged revisions 421009 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421010 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-14 16:33:27 +00:00
Kinsey Moore 6aa510b41f 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.
........

Merged revisions 420949 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420950 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-13 16:56:14 +00:00
Richard Mudgett 8526d967c9 res_stasis_snoop.c: Fix off nominial exit path leaving Snoop channel locked and not hungup.
* Made use ast_copy_string() instead of strcpy() for snoop uniqueid for
safety.  There is no guarantee that the max channel uniqueid length will
remain the same as the snoop uniqueid space.
........

Merged revisions 420879 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-12 23:36:37 +00:00
Richard Mudgett aba07a0f6e res/stasis/command.c: Fix recent commit using spaces instead of tabs.
........

Merged revisions 420836 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420837 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-11 21:04:21 +00:00