Commit Graph

29372 Commits

Author SHA1 Message Date
zuul 1a626ffb89 Merge "res_xmpp: Correctly check return value of SSL_connect" 2017-03-24 09:13:06 -05:00
zuul d3ca0e0bc4 Merge "res_xmpp: Try to provide useful errors messages from OpenSSL" 2017-03-24 09:12:57 -05:00
Joshua Colp 59df60efb9 Merge "audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor." 2017-03-24 07:25:07 -05:00
Kevin Harwell d2f2cdf476 AMI: Updated version
Updated the AMI version for the following reason (see CHANGES for more details):

The 'PJSIPShowEndpoint' command's response event of 'IdentifyDetail' now
contains a new optional parameter, 'MatchHeader'.

Change-Id: Ie206913ef1dcfa6a2ebe3282da2387e52d6f05b9
2017-03-23 13:25:23 -06:00
Kevin Harwell 12dde3b568 pjproject_bundled: raise timeout value used when downloading
After configuring Asterisk with '--with-pjproject-bundled' the configure/build
process attempts to download pjproject from its download site. Currently, a
timeout of 10 seconds is used that will stop the download process if pjproject
has not been fully downloaded in that time. For some systems this was not enough
time and the process was timing out too early.

This patch raises the download timeout value to '60'. Also, this patch fixes
another bug where the DOWNLOAD_TIMEOUT variable was not being properly exported
due to a naming error. DOWNLOAD_MAX_TIMEOUT is now properly renamed to
DOWNLOAD_TIMEOUT.

ASTERISK-26814 #close

Change-Id: Ia56e4e8a3d39db76bc8a1852b2cf07ec10b39842
2017-03-23 12:16:57 -06:00
Sean Bright 98a88e9ffa res_xmpp: Correct implementation of JABBER_STATUS & JabberStatus
The documentation for JABBER_STATUS (and the deprecated JabberStatus
app) indicate that a return value of 7 indicates that the specified
buddy was not in the roster. It also indicates that you can specify a
"bare" JID (one without a resource). Unfortunately the actual behavior
does not match the documented behavior.

Assuming that our roster includes the buddy online and available
"valid@example.org/Valid" and does *not* include the buddy
"invalid@example.org", the JABBER_STATUS() function returns the
following before this patch:

+------------------------------+------------+--------------------------+
| Buddy                        | Status     | Result                   |
+------------------------------+------------+--------------------------+
| valid@example.org            |  Online    |  7 (Not in roster)       |
| valid@example.org/Valid      |  Online    |  1 (Online)              |
| valid@example.org/Invalid    |  N/A       |  7 (Not in roster)       |
| invalid@example.org          |  N/A       |  Error logged, no return |
| invalid@example.org/Valid    |  N/A       |  Error logged, no return |
+------------------------------+------------+--------------------------+

And after this patch:

+------------------------------+------------+--------------------------+
| Buddy                        | Status     | Result                   |
+------------------------------+------------+--------------------------+
| valid@example.org            |  Online    |  1 (Online)              |
| valid@example.org/Valid      |  Online    |  1 (Online)              |
| valid@example.org/Invalid    |  N/A       |  6 (Offline)             |
| invalid@example.org          |  N/A       |  7 (Not in roster)       |
| invalid@example.org/Valid    |  N/A       |  7 (Not in roster)       |
+------------------------------+------------+--------------------------+

This brings the behavior in line with the documentation.

ASTERISK-23510 #close
Reported by: Anthony Critelli

Change-Id: I9c3241035363ef4a6bdc21fabfd8ffcd9ec657bf
2017-03-23 09:45:49 -06:00
Sean Bright be94105d6d res_xmpp: Try to provide useful errors messages from OpenSSL
If any errors occur during the TLS connection setup, we currently dump a
fairly generic error message. So instead we try to pull in something
useful from OpenSSL to report instead.

ASTERISK-24712
Reported by: Matthias Urlichs

Change-Id: I288500991a9681f447d92913b11fedaf426087f4
2017-03-23 08:58:53 -06:00
Sean Bright ee81ee1f14 res_xmpp: Fix ref counting issue
The only remaining reference to the endpoint is in the endpoints
container, and because it is unlinked in ast_endpoint_shutdown, we don't
have to explicitly cleanup the endpoint ourselves.

Change-Id: I912a2692e52d3e2ed445b32d8ae3f9004bc2f2e8
2017-03-23 08:58:29 -06:00
Sean Bright 9493981419 res_xmpp: Correctly check return value of SSL_connect
SSL_connect returns non-zero for both success and some error conditions
so simply negating is inadequate.

Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1
2017-03-23 08:58:05 -06:00
Sean Bright 7657c279b5 res_xmpp: Don't crash when trying to send a message without a connection
If we never establish a connection to our Jabber server, iksemel never sets up
its internal transport pointer, so attempting to send a message dereferences a
NULL pointer and causes a crash.

ASTERISK-21855 #close
Reported by: Jeremy Kister

Change-Id: I204a568894e4a53ab929783ecc594a000f04d79c
2017-03-23 08:57:11 -06:00
Sean Bright 0136ec12a3 res_xmpp: Include client name in connection related error messages
ASTERISK-25622 #close
Reported by: Sean Darcy

Change-Id: I8472cb7bfb58d411a3cfbd482da98cae2d94d1e9
2017-03-23 08:56:47 -06:00
Joshua Colp c1ab8ca74c Merge "res_pjsip_session: Enable RFC3578 overlap dialing support." 2017-03-22 17:08:08 -05:00
Joshua Colp 3a50311c17 Merge "CHANNEL(callid): Give dialplan access to the callid." 2017-03-22 15:49:42 -05:00
Kevin Harwell 9b103e7bea rtp_engine: allocate RTP dynamic payloads per session
Dynamic payload types were statically defined in Asterisk. This unfortunately
limited the number of dynamic payloads that could be registered. With this patch
dynamic payload type numbers are now assigned dynamically and per RTP instance.
However, in order to limit any issues where some clients expect the old
statically defined value this patch makes it so the value Asterisk used to pre-
designate is used for the dynamic assignment if available.

An option, "rtp_use_dynamic", has also been added (can be set in asterisk.conf)
that turns the new dynamic behavior on or off. When off it reverts back to using
statically defined payload values. This option defaults to "yes" in Asterisk 15.

ASTERISK-26515 #close
patches:
  ASTERISK-26515.diff submitted by jcolp (license 5000

Change-Id: I7653465c5ebeaf968f1a1cc8f3f4f5c4321da7fc
2017-03-22 15:43:33 -05:00
zuul 06c9966608 Merge "res_pjsip_messaging: Check URI type before dereferencing" 2017-03-22 12:36:43 -05:00
zuul 58b42297fd Merge "Revert "app_queue: Handle the caller being redirected out of a queue bridge"" 2017-03-22 10:54:56 -05:00
zuul 30f011a460 Merge "app_queue: Member stuck as pending after forwarding previous call from queue" 2017-03-22 09:50:22 -05:00
Sebastian Gutierrez bb2936f3e4 cdr: Allow setting of user field from 'h' extension
The CDR code previously did not allow the user field to be set
from the 'h' extension in the dialplan. This change removes that
limitation and allows it to be set.

ASTERISK-26818

Change-Id: I0fed8a79b5e408bac4e30542b8f33a61c5ed9aa6
2017-03-22 07:49:51 -06:00
zuul f83a334434 Merge "pjsip: prevent memory corruption on creation of xml bodies" 2017-03-22 08:32:06 -05:00
Richard Begg 6b7697ed48 res_pjsip_session: Enable RFC3578 overlap dialing support.
Support for RFC3578 overlap dialling (i.e. 484 Response to partially matched
destinations) as currently provided by chan_sip is missing from res_pjsip.
This patch adds a new endpoint attribute (allow_overlap) [defaults to yes]
which when set to yes enables 484 responses to partial destination
matches rather than the current 404.

ASTERISK-26864

Change-Id: Iea444da3ee7c7d4f1fde1d01d138a3d7b0fe40f6
2017-03-22 11:26:48 +00:00
zuul 9f64980e60 Merge "autochan/mixmonitor/chanspy: Fix unsafe channel locking and references." 2017-03-21 21:51:49 -05:00
zuul bd4a16da04 Merge "res_hep: Capture actual transport type in use" 2017-03-21 19:47:16 -05:00
Sean Bright d4fcf196a2 res_hep: Capture actual transport type in use
Rather than hard-coding UDP, allow consumers of the HEP API to specify
which protocol is in use. Update the PJSIP provider to pass in the
current protocol type.

ASTERISK-26850 #close

Change-Id: I54bbb0a001cfe4c6a87ad4b6f2014af233349978
2017-03-21 13:40:29 -06:00
Sean Bright 1bf839d44b Revert "app_queue: Handle the caller being redirected out of a queue bridge"
This reverts commit 163e9e53dc.

Change-Id: Ief28479c77a298879dfe2c56be7ee92dc465da4b
2017-03-21 09:00:15 -06:00
Sean Bright 6b4b87787c res_pjsip_messaging: Check URI type before dereferencing
We aren't validating that the URI we just parsed is a SIP/SIPS one before
trying to access the user, host, and port members of a possibly uninitialized
structure.

Also update the MessageSend documentation to indicate what 'from' formats are
accepted.

ASTERISK-26484 #close
Reported by: Vinod Dharashive

Change-Id: I476b5cc5f18a7713d0ee945374f2a1c164857d30
2017-03-21 08:45:37 -06:00
Joshua Elson 65ad554c98 pjsip: prevent memory corruption on creation of xml bodies
ASTERISK-26776 #close

Change-Id: I884b6f4e8233a355d0be687ec78d41bc0e4d3fd2
2017-03-21 08:27:15 -06:00
Sean Bright fc794de756 bridge_softmix: Ignore non-voice frames from translator
Some codecs - codec_speex specifically - take voice frames and return
other types of frames, like CNG. If we subsequently treat those as
voice frames, we'll run into trouble when destroying the frame because
of the requirement that each voice frame have an associated format.

ASTERISK-26880 #close
Reported by: Kirsty Tyerman

Change-Id: I43f8450c48fb276ad8b99db8512be82949c1ca7c
2017-03-20 15:31:35 -06:00
Joshua Colp f5603cb1ec Merge "res/res_pjsip_session: Only check localnet if it is defined" 2017-03-20 14:39:20 -05:00
Aaron An 25016a74f8 audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor.
Fixed a bug in function "ast_audiohook_write_frame" that checked the
variable other_factory_samples and only flushed the factories, so they
would be in sync, when other_factory_samples > 0. When there is not any
rtp incoming the variable other_factory_samples will be 0, and although
the result of "our_factory_ms - other_factory_ms" may be very large,
this led to the record file not syncing.

ASTERISK-26875 #close
Reported-by: Aaron An
Tested-by: Aaron An

Change-Id: Ia4d890fb8fc1636a7188502bab35f555685aea22
2017-03-20 13:01:52 -06:00
zuul 24ada76408 Merge "thread safety: Don't use getprotobyname()" 2017-03-20 13:07:51 -05:00
Sean Bright fc71c18a9b thread safety: Don't use getprotobyname()
POSIX does not require getprotobyname() to be thread safe and some
implementations use static memory which causes issues when multiple
threads are used.

Further, our usage of it today is just to ultimately get IPPROTO_TCP
for calls to setsockopt(). So instead we just use IPPROTO_TCP directly.

Change-Id: I2e14e58674808f7ce99b2f5e900d0f90d0d8da48
2017-03-20 08:55:05 -04:00
Sean Bright 516e028b44 res_rtp_asterisk: Pass correct data length to ast_rtcp_interpret
We are currently passing in the capacity of the read buffer instead of the
number of bytes that we actually read off the wire.

Change-Id: I60465049727d955c7f9a5e529e6f2aaff04cda36
2017-03-19 12:29:38 -06:00
Joshua Colp b05d2fda0c Merge "app_queue: Fix locking behavior in stasis message handlers" 2017-03-18 06:53:08 -05:00
Joshua Colp 3996c79328 Merge "chan_sip: Add rtcp-mux support" 2017-03-18 05:38:19 -05:00
Joshua Colp 77582634d7 Merge "res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped." 2017-03-18 05:37:29 -05:00
Joshua Colp 0db211dc64 Merge "res_pjsip_asterisk.c: Fix compile error if libsrtp is not installed." 2017-03-18 05:36:34 -05:00
Joshua Colp 317405ce69 Merge "app_confbridge: Fix ConfbridgeTalking AMI event description." 2017-03-17 19:49:21 -05:00
Joshua Colp 7f87cd7b4e Merge "res_pjsip_sdp_rtp.c: Fix cut-n-paste error" 2017-03-17 14:45:05 -05:00
Joshua Colp 15c72b3239 Merge "res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit transport" 2017-03-17 11:47:36 -05:00
Robert Mordec 79069f8ccb app_queue: Member stuck as pending after forwarding previous call from queue
Queue member will get stuck in pending_members if queue calls a device
that is different from the one observed for state changes.

This patch removes members from pending_members as a result of channel stasis
events such as blind or attended transfers and hangup.

ASTERISK-26862 #close

Change-Id: I8bf6df487b9bb35726c08049ff25cdad5e357727
2017-03-17 09:59:34 -06:00
Richard Mudgett 8cb4f9cea1 CHANNEL(callid): Give dialplan access to the callid.
* Added CHANNEL(callid) to retrieve the call identifier log tag associated
with the channel.  Dialplan now has access to the call log search key
associated with the channel so it can be saved in case there is a problem
with the call.

ASTERISK-26878

Change-Id: I2c97ebd928b6f3c5bc80c5729e4d3c07f453049f
2017-03-17 09:52:00 -06:00
Sean Bright c13ea6080e app_queue: Fix locking behavior in stasis message handlers
The queue_stasis_data structure contains various mutable fields that require
appropriate locking. Specifically, the 'dying,' 'member_uniqueid,' and
'caller_uniqueid' fields need to be locked when read from or written to.

Change-Id: I246b7dbff8447acc957a1299f6ad0ebd0fd39088
2017-03-17 08:22:53 -06:00
Sean Bright 15aa3c0a23 chan_sip: Add rtcp-mux support
ASTERISK-26846 #close

Change-Id: I541a1602ff55ab73684e9f8002edb9e0e745d639
2017-03-17 07:36:06 -06:00
Richard Mudgett 57656e2b5b app_confbridge: Fix ConfbridgeTalking AMI event description.
Thanks to Chris Howard for pointing this out on the wiki.

Change-Id: I18e56de09a70e736b5d04719d45ef29cf0636705
2017-03-16 15:54:10 -06:00
Richard Mudgett 82982a191c res_pjsip_asterisk.c: Fix compile error if libsrtp is not installed.
struct ast_rtcp does not define the dtls member if SRTP is not enabled.

ASTERISK-26732

Change-Id: Id15ea212e04490e012f2cf4a56818b4dd948875e
2017-03-16 15:44:24 -06:00
Joshua Colp 732367e806 Merge "res_pjsip: Symmetric transports" 2017-03-16 16:04:43 -05:00
Richard Mudgett 49b1f1ca16 res_pjsip_sdp_rtp.c: Fix cut-n-paste error
We were inadvertenly referencing the cos_video option to determine if we
should set the tos_audio and cos_audio value on the RTP instance.

Change-Id: Ia7964f486801d39dc6f5dae570baff079e1595b0
2017-03-16 14:49:24 -06:00
Matt Jordan e6dc28b78f res/res_pjsip_session: Only check localnet if it is defined
If local_net is not defined on a transport, transport_state->localnet
will be NULL. ast_apply_ha will, be default, return AST_SENSE_ALLOW in
this case, causing the external_media_address, if set, to be skipped.

This patch causes us to only check if we are sending within a network if
local_net is defined.

ASTERISK-26879 #close

Change-Id: Ib661c31a954cabc9c99f1f25c9c9a5c5b82cbbfb
2017-03-16 14:03:43 -06:00
Joshua Colp 76e64f5589 Merge "RFC sdp: Initial SDP creation" 2017-03-16 14:45:20 -05:00
Richard Begg 44568fc712 res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit transport
Currently a wildcard address is used for the local RTP socket, which
will not always result in the same address as used by the SIP socket
(e.g. if explicit transport addresses are configured).
Use the transport's host address when binding new local RTP sockets if
available.

ASTERISK-26851

Change-Id: I098c29c9d1f79a4f970d72ba894874ac75954f1a
2017-03-16 13:14:58 -06:00