Commit Graph

2243 Commits

Author SHA1 Message Date
Kevin Harwell 61b60fab2d pjsip outbound registration: Log message says received a 408 when we didn't
If the server didn't exist that we are trying to register to the log message
would say that a 408 was received from that server when in reality one wasn't.
Added log messages stating no response was received if the response does not
exist.

(closes issue ASTERISK-22554)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2893/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-14 15:54:06 +00:00
Matthew Jordan fd4919e466 Remove duplicate module info block
The module info block was repeated twice. Once is sufficient.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-14 15:01:59 +00:00
Joshua Colp b47851264e Fix a race condition in res_pjsip_session with rapidly terminating the session.
The INVITE session state callback wrongly assumes that a session will always exist, but
when rapidly terminating the session this assumption goes out the window. As all handler
code for the INVITE session state callback requires the session it will now just exit
immediately if no session exists.

(closes issue ASTERISK-22668)
Reported by: John Bigelow
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-13 15:42:20 +00:00
Kinsey Moore 1a0a2b3e4c Fix realm comparison for outbound auth
When generating the list of authentication credentials to pass to
PJSIP, Asterisk was using the raw pointer of a pj_str_t which is not
always NULL-terminated. This sometimes resulted in incorrect text for
the realm and a failure to match the realm for authentication purposes
which was causing the outbound nominal auth pjsip basic call test to
bounce. This now uses the pj_str_t that contains the realm instead of
generating a new one. Thanks to John Bigelow for helping to narrow this
down.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-12 16:53:06 +00:00
David M. Lee 9234804a3b Multiple revisions 400508,400842-400843,400848
........
  r400508 | dlee | 2013-10-03 23:54:51 -0500 (Thu, 03 Oct 2013) | 1 line
  
  Corrected response class for stopPlayback
........
  r400842 | dlee | 2013-10-10 14:23:24 -0500 (Thu, 10 Oct 2013) | 1 line
  
  Correct some ARI wiki rendering errors
........
  r400843 | dlee | 2013-10-10 14:26:19 -0500 (Thu, 10 Oct 2013) | 1 line
  
  Updated /play resource docs. The playback of http: resources isn't implemented... yet
........
  r400848 | dlee | 2013-10-11 11:18:46 -0500 (Fri, 11 Oct 2013) | 5 lines
  
  Fix a stupid copy/paste error in ARI docs.
  
  Patches:
      ari-doc-patch.txt uploaded by jbigelow (license 5091)
........

Merged revisions 400508,400842-400843,400848 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-11 16:36:00 +00:00
Joshua Colp 113c281782 Perform validation of permanent contacts on AORs in res_pjsip.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-10 18:21:55 +00:00
Joshua Colp cbbcf1808c Fix an assertion in res_pjsip when specifying an invalid outbound proxy.
This change fixes two issues when setting an outbound proxy:

1. The outbound proxy URI was not parsed and validated during configuration.
2. If an outgoing dialog was created and the outbound proxy could not be set an assertion would
occur because the usage count on the dialog was not decremented.

The documentation has also been updated to specify that a full URI must be specified for
the outbound proxy.

(closes issue ASTERISK-22672)
Reported by: Antti Yrjola
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-10 12:26:20 +00:00
Matthew Jordan fcf6c84666 Use 'z' as the format specifier for size_t
Using 'lu' will produce a compiler warning for some versions of gcc and on some
architectures. 'z' should be portable as a format specifier for size_t.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-09 11:02:04 +00:00
Matthew Jordan b36ef0b412 Add PJSIP_HEADER function for manipulation of SIP headers in the PJSIP stack
This patch adds support to the PJSIP stack in Asterisk for SIP header
manipulation. Note that this is analagous to SIPAddHeader/SIPRemoveHeader.

For PJSIP_HEADER, an incoming supplemental session callback is registered that
takes the pjsip_hdrs from the incoming session and stores them in a linked
list in the session datastore.  Calls to PJSIP_HEADER traverse over the list
and return the nth matching header where 'n' is the 'number' argument to the
function.

When adding a header, the first call creates a datastore and linked list and
adds the datastore to the session.  The header is then created as a pjsip_hdr
and added to the list.  An outgoing supplemental session callback then
traverses the list and adds the headers to the outgoing pjsip_msg.

When removing a header, the list created with PJSIP_HEADER(add,...) is
traversed and all matching entries are removed.

(closes issue ASTERISK-22498)
Reported by: George Joseph
patch:
  res_pjsip_header_funcs_v1.patch uploaded by george.joseph (License 6322)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 22:59:32 +00:00
Mark Michelson 2904a198d5 Switch from using pjsip_strerror to pj_strerror.
pjsip_strerror is only aware of PJSIP-specific error
codes. pj_strerror() is aware of all PJProject error
codes and OS-specific error codes.

This specifically fixes an oft-seen error in transport
configuration code where EADDRINUSE would result in
"Unknown PJSIP error 120098" instead of a useful
message.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 20:52:04 +00:00
Kinsey Moore 4873c11f64 Fix STUN crash when using IPv6 any address
Ensure that when chan_sip binds to the IPv6 any address ([::]), IPv4
candidates are also added.

(closes issue ASTERISK-21917)
Reported by: Torrey Searle
Patches:
    0023_ipv6_stun_crash.patch uploaded by Torrey Searle (License 5334)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 15:46:16 +00:00
Mark Michelson a4d6f43962 Push CLI qualify into the threadpool.
If you run Asterisk in the background and then connect to
it through a separate console, the thread that runs CLI commands
is not registered with PJLIB. Thus PJLIB does not like it when
you attempt to send OPTIONS requests from that thread. So now
we push the task into the threadpool, which we know to be registered
with PJLIB.

Thanks to Antti Yrjola for reporting this.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 15:44:47 +00:00
Richard Mudgett 8eec8fbf83 Make app_queue and res_agi independent of AMI being enabled.
The https://reviewboard.asterisk.org/r/2888/ review changes manager to not
subscribe to stasis when it is disabled for performance reasons.  When
manager is disabled app_queue and res_agi decline to load and fail to
clean up what they have already allocated.

* Made app_queue and res_agi clean up allocated resources when they
decline to load.

* Made app_queue and res_agi use their own subscriptions to the stasis
topics instead of borrowing manager's message router structure
inappropriately.

(closes issue ASTERISK-22604)
Reported by: rmudgett

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 15:12:46 +00:00
Jonathan Rose f4ebdca52a chan_pjsip: Make logger togglable without loading/unloading
This patch makes the res_pjsip_logger do a few things... First, it
will be built and installed by default now, so end users won't need
to enable it in menuselect. Second, while it is loaded, it no longer
will immediately issue log messages. Upon loading, it is in the
disabled state and must be turned on with the new CLI command. The
CLI command 'pjsip set logger <on/off/host> has been added and can be
used to do the following:
pjsip set logger on:
    Enables logger for all PJSIP traffic
pjsip set logger off:
    Disables logger for all PJSIP traffic
pjsip set logger host <host>:
    Enables logger for the specific host

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 19:11:38 +00:00
Matthew Jordan 8d7873b836 ARI: Add subscription support
This patch adds an /applications API to ARI, allowing explicit management of
Stasis applications.

 * GET /applications - list current applications
 * GET /applications/{applicationName} - get details of a specific application
 * POST /applications/{applicationName}/subscription - explicitly subscribe to
   a channel, bridge or endpoint
 * DELETE /applications/{applicationName}/subscription - explicitly unsubscribe
   from a channel, bridge or endpoint

Subscriptions work by a reference counting mechanism: if you subscript to an
event source X number of times, you must unsubscribe X number of times to stop
receiveing events for that event source.

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

(issue ASTERISK-22451)
Reported by: Matt Jordan
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 16:01:48 +00:00
Joshua Colp b52c972b17 Enclose the To URI and update its user portion if a request user has been specified.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 15:49:39 +00:00
Joshua Colp 47da03e737 Replace the connection address at the SDP level if altering the SDP with the external media address.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 14:55:22 +00:00
Joshua Colp bd8cf10d60 Fix a crash caused by muting and unmuting a channel in ARI without specifying a direction.
(closes issue ASTERISK-22637)
Reported by: Scott Griepentrog

Patch by Matt Jordan, whose office I have taken over in the name of Canada.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:06:48 +00:00
Kinsey Moore c3b1d8f8c1 res_rtp_multicast: Ensure SSRC is set properly
This fixes a bug where the SSRC field on multicast RTP can be stuck at
0 which can cause problems for endpoints trying to make sense of
incoming streams.

(closes issue ASTERISK-22567)
Reported by: Simone Camporeale
Patches:
    22567_res_mulitcast_ssrc.patch uploaded by Simone Camporeale (License 6536)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 18:32:59 +00:00
Mark Michelson ee21eee7e0 Cache string values of formats on ast_format_cap() to save processing.
Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:58:16 +00:00
Joshua Colp c977f73e13 Fix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and external_media_address is set.
The callback function for changing the media address in streams wrongly assumes that a connection line
will always be present. This is false as no line is present if a stream has been rejected.

(closes issue ASTERISK-22645)
Reported by: Rusty Newton
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:52:24 +00:00
Mark Michelson addbf276f5 Multiple revisions 400318-400319
........
  r400318 | mmichelson | 2013-10-02 17:08:49 -0500 (Wed, 02 Oct 2013) | 12 lines
  
  Remove unnecessary waits from stasis.
  
  Since caches are updated on publisher threads, there is no need
  to wait for the cache updates to occur after a stasis message
  is published.
  
  In the case of chan_pjsip device state changes, this set of
  changes caused an improvement to performance.
  
  Review: https://reviewboard.asterisk.org/r/2890
........
  r400319 | mmichelson | 2013-10-02 17:10:54 -0500 (Wed, 02 Oct 2013) | 3 lines
  
  Remove svn:mergeinfo property.
........

Merged revisions 400318-400319 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 22:22:17 +00:00
Joshua Colp 51a9b93a14 Fix a crash in res_pjsip_t38 caused by the wrong assumption that a session will always have a channel.
When starting up or shutting down this assumption is false.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 18:44:48 +00:00
Richard Mudgett 97fcd6366d MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled.
* There were several places in ARI where an external library was mallocing
memory that must always be released with free().  When MALLOC_DEBUG is
enabled, free() is redirected to the MALLOC_DEBUG version.  Since the
external library call still uses the normal malloc(), MALLOC_DEBUG
complains that the freed memory block is not registered and will not free
it.  These cases must use ast_std_free().

* Changed calls to asprintf() and vasprintf() to the equivalent
ast_asprintf() and ast_vasprintf() versions respectively.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 17:12:49 +00:00
Joshua Colp 424c0f2eb7 Fix a random one way audio issue in PJSIP.
Due to the asynchronous design of the PJMEDIA SDP negotiator it was possible for
the SDP to be negotiated *after* a channel was created and after it was being wait
on by an application. It is only after negotiation occurs that the file descriptors
for RTP are placed on the channel. Since the channel was already being waited on
these file descriptors were not monitored, causing incoming media to never be read.

This change wakes up any application waiting on the channel so that added file
descriptors end up being monitored.

(closes issue AST-1227)
Reported by: John Bigelow
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 15:33:56 +00:00
Joshua Colp 83d55f85ec Allow specifying a channel to dial an extension and context in an ARI dial operation.
(issue ASTERISK-22625)
Reported by: Scott Griepentrog
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 15:24:16 +00:00
Joshua Colp c33aac75e4 Retrieve and store the hostname only once so multiple threads do not potentially initialize it at the same time.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 14:13:55 +00:00
David M. Lee 2de42c2a25 Multiple revisions 399887,400138,400178,400180-400181
........
  r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
  
  Minor performance bump by not allocate manager variable struct if we don't need it
........
  r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
  
  Stasis performance improvements
  
  This patch addresses several performance problems that were found in
  the initial performance testing of Asterisk 12.
  
  The Stasis dispatch object was allocated as an AO2 object, even though
  it has a very confined lifecycle. This was replaced with a straight
  ast_malloc().
  
  The Stasis message router was spending an inordinate amount of time
  searching hash tables. In this case, most of our routers had 6 or
  fewer routes in them to begin with. This was replaced with an array
  that's searched linearly for the route.
  
  We more heavily rely on AO2 objects in Asterisk 12, and the memset()
  in ao2_ref() actually became noticeable on the profile. This was
  #ifdef'ed to only run when AO2_DEBUG was enabled.
  
  After being misled by an erroneous comment in taskprocessor.c during
  profiling, the wrong comment was removed.
  
  Review: https://reviewboard.asterisk.org/r/2873/
........
  r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
  
  Taskprocessor optimization; switch Stasis to use taskprocessors
  
  This patch optimizes taskprocessor to use a semaphore for signaling,
  which the OS can do a better job at managing contention and waiting
  that we can with a mutex and condition.
  
  The taskprocessor execution was also slightly optimized to reduce the
  number of locks taken.
  
  The only observable difference in the taskprocessor implementation is
  that when the final reference to the taskprocessor goes away, it will
  execute all tasks to completion instead of discarding the unexecuted
  tasks.
  
  For systems where unnamed semaphores are not supported, a really
  simple semaphore implementation is provided. (Which gives identical
  performance as the original taskprocessor implementation).
  
  The way we ended up implementing Stasis caused the threadpool to be a
  burden instead of a boost to performance. This was switched to just
  use taskprocessors directly for subscriptions.
  
  Review: https://reviewboard.asterisk.org/r/2881/
........
  r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Optimize how Stasis forwards are dispatched
  
  This patch optimizes how forwards are dispatched in Stasis.
  
  Originally, forwards were dispatched as subscriptions that are invoked
  on the publishing thread. This did not account for the vast number of
  forwards we would end up having in the system, and the amount of work it
  would take to walk though the forward subscriptions.
  
  This patch modifies Stasis so that rather than walking the tree of
  forwards on every dispatch, when forwards and subscriptions are changed,
  the subscriber list for every topic in the tree is changed.
  
  This has a couple of benefits. First, this reduces the workload of
  dispatching messages. It also reduces contention when dispatching to
  different topics that happen to forward to the same aggregation topic
  (as happens with all of the channel, bridge and endpoint topics).
  
  Since forwards are no longer subscriptions, the bulk of this patch is
  simply changing stasis_subscription objects to stasis_forward objects
  (which, admittedly, I should have done in the first place.)
  
  Since this required me to yet again put in a growing array, I finally
  abstracted that out into a set of ast_vector macros in
  asterisk/vector.h.
  
  Review: https://reviewboard.asterisk.org/r/2883/
........
  r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Remove dispatch object allocation from Stasis publishing
  
  While looking for areas for performance improvement, I realized that an
  unused feature in Stasis was negatively impacting performance.
  
  When a message is sent to a subscriber, a dispatch object is allocated
  for the dispatch, containing the topic the message was published to, the
  subscriber the message is being sent to, and the message itself.
  
  The topic is actually unused by any subscriber in Asterisk today. And
  the subscriber is associated with the taskprocessor the message is being
  dispatched to.
  
  First, this patch removes the unused topic parameter from Stasis
  subscription callbacks.
  
  Second, this patch introduces the concept of taskprocessor local data,
  data that may be set on a taskprocessor and provided along with the data
  pointer when a task is pushed using the ast_taskprocessor_push_local()
  call. This allows the task to have both data specific to that
  taskprocessor, in addition to data specific to that invocation.
  
  With those two changes, the dispatch object can be removed completely,
  and the message is simply refcounted and sent directly to the
  taskprocessor.
  
  Review: https://reviewboard.asterisk.org/r/2884/
........

Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
Kinsey Moore b44ce141e5 chan_sip: Allow Asterisk to retry after 403 on register
This adds a global option in chan_sip to allow it to continue
attempting registration if a 403 is received, clearing the cached nonce
and treating it as a non-fatal response. Normally, this would cause
registration attempts to that endpoint to stop.

This also adds a similar per-outbound-registration option to chan_pjsip
which allows the retry interval to be altered for 403 responses to
REGISTER requests.

(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874/
Reported by: Rudi
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 15:57:11 +00:00
Matthew Jordan a1d56da32a res_pjsip_notify: Add documentation
We forgot to add documentation for res_pjsip_notify, which would prevent it
from being loaded. Whoops.

This patch also updates res_pjsip_notify to use pjsip_notify.conf, which now
has its own sample file in the configs directory as well.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 22:57:17 +00:00
Matthew Jordan c4b5c549fd res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
RTCP's calculation of the number of lost packets in an RTP stream is based on
that stream's sequence number count, the number of received packets, and how
many packets we expect to receive. When the SSRC for an RTP stream changes,
there can - and almost always will be - a large jump in the next packet's
timestamp and sequence number. If we don't reset the number of received
packets, sequence number count, and other metrics used by RTCP, the next RR/SR
report will use the previous SSRC's values to calculate the lost packet count
for the new SSRC - resulting in a very large number of lost packets.

This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it
will reset the various values used by the RTCP calculations. From the
perspective of RTCP, this appears as a new media stream - which is what it is.

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

(closes issue AST-1174)
Reported by: Thomas Arimont
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 22:32:18 +00:00
Richard Mudgett 2b32732aa8 app_cdr and res_parking: Fix some resource leaks.
* app_cdr left the ResetCDR application registered.

* res_parking leaked a ref to config global.

(closes issue ASTERISK-22566)
Reported by: Corey Farrell
Patches:
      ASTERISK-22566-r2.patch (license #5909) patch uploaded by Corey Farrell
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 21:58:05 +00:00
Kevin Harwell d6bceb0350 res_pjsip: crash when using localnet and external_signaling_address options
There was a collision of mod_data use on the transaction between using a nat
hook and an session response callback.  During state change it was assumed
what was in the mod_data was nothing or the response callback.  However, it
was possible for it to also contain a nat hook thus resulting in a bad cast
and a crash.

Added the ability to store multiple data elements in mod_data via a hash table.
In this instance, mod_data now stores a hash table of the two values that can
be retrieved using an associated string key.

(closes issue ASTERISK-22394)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2843/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 18:28:41 +00:00
Kevin Harwell 103ebcf807 pjsip: race condition in registrar
While handling a registration request a race condition could occur if/when two+
clients registered at the same time.  This happened when one request obtained a
copy of the current contacts for an AOR and another request did the same before
the first request updated.  Thus the second would update and overwrite the first
(or vice-versa depending on which actually updated first).  In the case of it
being the same contact two "add" events would be raised.

pjsip registration handling is now serialized to alleviate this issue.

(closes issue AST-1213)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2860/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-26 18:51:54 +00:00
Rusty Newton 21fb2fca5e Broke the build - Fixing XML DTD violation added in r399782, missing <para> tags inside a <note>
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25 19:43:43 +00:00
Rusty Newton 1b9db0fd99 Fixing documentation for the configOption "external_media_address" of both Endpoints and Transports
Re-using some of Mark Michelson's text from an E-mail discussion for:

* Modifying synopsis for both options
* Adding description to both options
* Changing name of "external_media_address" for Endpoint configuration to "media_address" in anticipation of the option name being changed. (As it is not really specific to external destinations)

(issue ASTERISK-22405)
(closes issue ASTERISK-22405)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2850/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25 18:38:34 +00:00
Joshua Colp 85d6db6cbe Fix crash in res_pjsip on load if error occurs, and prevent unloading of res_pjsip and res_pjsip_session.
During load time in res_pjsip if an error occurred the operation would attempt to rollback all
operations done during load. This is not permitted by PJSIP as it will assert if the operation has
not been done. This fix changes the code so it will only rollback what has been initialized already.

Further changes also prevent res_pjsip and res_pjsip_session from being unloaded. This is due to
limitations within PJSIP itself. The library environment can only be changed to a certain extent
and does not provide the ability, currently, to deinitialize certain required functionality.

(closes issue ASTERISK-22474)
Reported by: Corey Farrell
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-23 12:03:18 +00:00
Richard Mudgett ec5a724714 res_rtp_asterisk: Fix ref leaks in ast_rtcp_read().
Moved rtcp_report RAII_VAR declaration into the loop so it is unref'ed
after every loop.  Moved message_blob to loop and switched it to a regular
variable.  The regular variable was used since message_blob is used in a
very contained way.

(closes issue ASTERISK-22565)
Reported by: Corey Farrell
Patches:
      rtcp_report-leak.patch (license #5909) patch uploaded by Corey Farrell
Tested by: Corey Farrell
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-21 04:49:26 +00:00
Kevin Harwell 0e1d364fbd res_pjsip_messaging: Register message technology as pjsip
pjsip's message technology was being registered as 'sip', which was causing it
to not load due it conflicting with chan_sip's registered 'sip' technology for
messaging.  It now registers as 'pjsip'.  However, due to this change the "to"
field for outgoing pjsip messages need to be prefixed with 'pjsip:' instead of
'sip:'.  Incoming messages to res_pjsip_messaging will automatically have their
"to" fields altered in order to accommodate the change.  Outgoing messages also
handle changing it back to 'sip' before being sent so the pjsip library will
properly handle it.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-18 14:56:22 +00:00
Mark Michelson 391f0003c4 Change the "external_media_address" PJSIP endpoint option to "media_address".
The endpoint option does not apply to communication with external entities. Rather,
the option is applied to all communications with the endpoint. The external_media_address
transport configuration option may override the endpoint option if it turns out that
we are going to be communicating with an external entity.

Two things of note:
1) I have not updated the XML documentation. This is being taken care of by Rusty as part
of his work on issue ASTERISK-22405
2) This commit is likely to cause testsuite failures since there are tests that use the
external_media_address endpoint option, and they will need to be changed over. Well, I'm
planning to get that updated ASAP after this commit.

(closes issue ASTERISK-22528)
reported by Rusty Newton
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17 23:10:49 +00:00
Richard Mudgett 10d4ed93ff app_speech_utils: Fix unresolved symbol ast_speech_get_setting().
Fixes regression introduced by -r374096.

* Made res_speech.export.in export ast_* symbols instead of specific
functions.

* Made app_speech_utils.c declare that it is dependent upon res_speech.

(issue ASTERISK-17136)
Reported by: Richard Kenner
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-16 18:00:32 +00:00
Richard Mudgett 2a371cd80b Restore Dial, Queue, and FollowMe 'I' option support.
The Dial, Queue, and FollowMe applications need to inhibit the bridging
initial connected line exchange in order to support the 'I' option.

* Replaced the pass_reference flag on ast_bridge_join() with a flags
parameter to pass other flags defined by enum ast_bridge_join_flags.

* Replaced the independent flag on ast_bridge_impart() with a flags
parameter to pass other flags defined by enum ast_bridge_impart_flags.

* Since the Dial, Queue, and FollowMe applications are now the only
callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the
calling contract to require the initial COLP exchange to already have been
done by the caller.

* Made all callers of ast_bridge_impart() check the return value.  It is
important.  As a precaution, I also made the compiler complain now if it
is not checked.

* Did some cleanup in parking_tests.c as a result of checking the
ast_bridge_impart() return value.

An independent, but associated change is:
* Reduce stack usage in ast_indicate_data() and add a dropping redundant
connected line verbose message.

(closes issue ASTERISK-22072)
Reported by: Joshua Colp

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 22:19:23 +00:00
Mark Michelson 9deb416397 Create more accurate Contact headers for dialogs when we are the UAS.
(closes issue AST-1207)
reported by John Bigelow

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 14:50:38 +00:00
Mark Michelson bbf5fbbd8c Change how realms are handled for outbound authentication.
With this change, if no realm is specified in an outbound auth
section, then we will simply match the realm that was present
in the 401/407 challenge.

(closes issue ASTERISK-22471)
Reported by George Joseph
(closes issue ASTERISK-22386)
Reported by Rusty Newton

Patches:
	outbound_auth_realm_v4.patch uploaded by George Joseph (License #6322)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 14:44:43 +00:00
Rusty Newton 873969d6c5 Broke the build! Forgot para tags within my description.
https://bamboo.asterisk.org/bamboo/browse/AST-ATRUNKBUILD-304
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 14:27:54 +00:00
David M. Lee 2a57f6ccf7 res_pjsip: Forward PJSIP logging to Asterisk logging
This patch uses PJSIP's pj_log_set_log_func() to forward PJSIP's log
messages to Asterisk's logger. This is done in a new module:
res_pjsip_log_forwarder.so.

This patch sets defaultenabled on the existing res_pjsip_logger.so to
no, since logging every SIP packet seems a bit odd to do by default, and
is (hopefully) less necessary with regular PJSIP logging.

It also removes res_rtp_asterisk's disabling of PJSIP logging.

(closes issue ASTERISK-22360)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2830/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 14:22:07 +00:00
David M. Lee f56796a539 ARI: Fix WebSocket response when subprotocol isn't specified
When I moved the ARI WebSocket from /ws to /ari/events, I added code to
allow a WebSocket to connect without specifying the subprotocol if
there's only one subprotocol handler registered for the WebSocket.

Naively, I coded it to always respond with the subprotocol in use.
Unfortunately, according to RFC 6455, if the server's response includes
a subprotocol header field that "indicates the use of a subprotocol that
was not present in the client's handshake [...], the client MUST _Fail
the WebSocket Connection_.", emphasis theirs.

This patch correctly omits the Sec-WebSocket-Protocol if one is not
specified by the client.

(closes issue ASTERISK-22441)
Review: https://reviewboard.asterisk.org/r/2828/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 14:19:19 +00:00
Rusty Newton fc09e5eb66 'identify' configObject doesn't have a synopsis
Add a straightforward synopsis and description to the identify config object
in XML documentation.

(issue ASTERISK-22311)
(closes issue ASTERISK-22311)
Reported By: Rusty Newton
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13 13:28:26 +00:00
Rusty Newton 1b777d8946 Documentation fix and improvements to XML configuration help res_pjsip_acl
*  One bug fix. Made the synopsis for "type" to accurate.
 *  changing the usage of "IP-domains" to "IP addresses"
 *  clarifying the usage for the options, by adding a relevant description for
    each
 *  modified other areas of the XML help for clarity, such as the module
    description and a few synopsis changes here and there. See the patch.

(issue ASTERISK-22458)
(closes issue ASTERISK-22458)
Reported By: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2823/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 23:23:12 +00:00
David M. Lee 6ad74509f3 Fix symbol collision with pjsua.
We shouldn't be exporting any symbols that start with pjsip_.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12 15:23:54 +00:00