Commit Graph

29094 Commits

Author SHA1 Message Date
zuul
391c412c0e Merge "res_xmpp: Include client name in connection related error messages" into 14 2017-03-24 11:55:44 -05:00
zuul
9830347805 Merge "res_xmpp: Don't crash when trying to send a message without a connection" into 14 2017-03-24 11:49:59 -05:00
Joshua Colp
aa7b60ecc7 Merge "res_xmpp: Correctly check return value of SSL_connect" into 14 2017-03-24 09:54:31 -05:00
zuul
2ca7b2ed76 Merge "res_xmpp: Try to provide useful errors messages from OpenSSL" into 14 2017-03-24 09:13:02 -05:00
zuul
28bb9e7902 Merge "audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor." into 14 2017-03-24 07:17:49 -05:00
Kevin Harwell
74cb069af9 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 14:24:53 -05:00
Sean Bright
a48b489de3 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:45 -06:00
Sean Bright
138f2bfa82 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:57:57 -06:00
Sean Bright
eed582888f 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:02 -06:00
Sean Bright
e771bf9787 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:35 -06:00
zuul
bdc0514b08 Merge "CHANNEL(callid): Give dialplan access to the callid." into 14 2017-03-22 17:09:33 -05:00
zuul
a6761d2d58 Merge "res_pjsip_session: Enable RFC3578 overlap dialing support." into 14 2017-03-22 15:48:56 -05:00
zuul
ab0a05716d Merge "res_pjsip_messaging: Check URI type before dereferencing" into 14 2017-03-22 12:36:47 -05:00
zuul
e528c2fc18 Merge "Revert "app_queue: Handle the caller being redirected out of a queue bridge"" into 14 2017-03-22 11:04:05 -05:00
zuul
db246cd87e Merge "app_queue: Member stuck as pending after forwarding previous call from queue" into 14 2017-03-22 09:50:17 -05:00
Joshua Colp
df0fdf31b8 Merge "pjsip: prevent memory corruption on creation of xml bodies" into 14 2017-03-22 07:16:58 -05:00
Richard Begg
d7f50afb7c 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 05:25:29 -06:00
Joshua Colp
d36a260fcf Merge "autochan/mixmonitor/chanspy: Fix unsafe channel locking and references." into 14 2017-03-22 05:10:33 -05:00
zuul
a0824a20f9 Merge "res_hep: Capture actual transport type in use" into 14 2017-03-21 19:37:43 -05:00
Sean Bright
fa45b11727 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:24 -06:00
Sean Bright
b7a2d271c1 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:03 -06:00
Sean Bright
0a51c52cc0 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:32 -06:00
Joshua Elson
cd80729193 pjsip: prevent memory corruption on creation of xml bodies
ASTERISK-26776 #close

Change-Id: I884b6f4e8233a355d0be687ec78d41bc0e4d3fd2
2017-03-21 08:27:10 -06:00
Sean Bright
aac3c94ca4 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:28 -06:00
zuul
8c529c4f92 Merge "res/res_pjsip_session: Only check localnet if it is defined" into 14 2017-03-20 14:51:28 -05:00
Aaron An
7a18dafe53 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:02:35 -06:00
zuul
74f59af52a Merge "thread safety: Don't use getprotobyname()" into 14 2017-03-20 11:50:50 -05:00
Sean Bright
75c4b1c97d 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 06:52:14 -06:00
Sean Bright
a38a44880a 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:32 -06:00
Joshua Colp
117092efac Merge "app_queue: Fix locking behavior in stasis message handlers" into 14 2017-03-18 05:38:44 -05:00
Joshua Colp
3deed1f80e Merge "chan_sip: Add rtcp-mux support" into 14 2017-03-18 05:38:03 -05:00
Joshua Colp
2295756e82 Merge "res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped." into 14 2017-03-18 05:37:16 -05:00
Joshua Colp
41baa7b4e8 Merge "res_pjsip_asterisk.c: Fix compile error if libsrtp is not installed." into 14 2017-03-18 05:36:49 -05:00
Joshua Colp
0b3f807589 Merge "app_confbridge: Fix ConfbridgeTalking AMI event description." into 14 2017-03-17 17:24:20 -05:00
Joshua Colp
002dffe212 Merge "res_pjsip_sdp_rtp.c: Fix cut-n-paste error" into 14 2017-03-17 14:31:55 -05:00
Robert Mordec
6ae6e16468 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:13 -06:00
Richard Mudgett
e9e176b16b 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 10:51:29 -05:00
Sean Bright
e8764a93cb 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:48 -06:00
Sean Bright
217ba2e5d0 chan_sip: Add rtcp-mux support
ASTERISK-26846 #close

Change-Id: I541a1602ff55ab73684e9f8002edb9e0e745d639
2017-03-17 07:35:54 -06:00
Richard Mudgett
e7ed625d23 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:53:59 -06:00
Richard Mudgett
241f069184 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:13 -06:00
Richard Mudgett
ea6ced0eef 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:13 -06:00
Matt Jordan
486abb4210 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 15:00:53 -05:00
Richard Begg
67204a0a3d 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:46 -06:00
Joshua Colp
11e806abbb res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped.
This change removes an assumption that when DTLS is stopped
an RTCP session will be present on the RTP session. This is not
always the case.

ASTERISK-26732

Change-Id: Ib9f7c09ce0b005efe362dbcc8795202b18f94611
2017-03-16 08:09:08 -06:00
George Joseph
6541a07083 res_pjsip: Symmetric transports
A new transport parameter 'symmetric_transport' has been added.

When a request from a dynamic contact comes in on a transport with
this option set to 'yes', the transport name will be saved and used
for subsequent outgoing requests like OPTIONS, NOTIFY and INVITE.
It's saved as a contact uri parameter named 'x-ast-txp' and will
display with the contact uri in CLI, AMI, and ARI output.  On the
outgoing request, if a transport wasn't explicitly set on the
endpoint AND the request URI is not a hostname, the saved transport
will be used and the 'x-ast-txp' parameter stripped from the
outgoing packet.

* config_transport was modified to accept and store the new parameter.

* config_transport/transport_apply was updated to store the transport
  name in the pjsip_transport->info field using the pjsip_transport->pool
  on UDP transports.

* A 'multihomed_on_rx_message' function was added to
  pjsip_message_ip_updater that, for incoming requests, retrieves the
  transport name from pjsip_transport->info and retrieves the transport.
  If transport->symmetric_transport is set, an 'x-ast-txp' uri parameter
  containing the transport name is added to the incoming Contact header.

* An 'ast_sip_get_transport_name' function was added to res_pjsip.
  It takes an ast_sip_endpoint and a pjsip_sip_uri and returns a
  transport name if endpoint->transport is set or if there's an
  'x-ast-txp' parameter on the uri and the uri host is an ipv4 or
  ipv6 address.  Otherwise it returns NULL.

* An 'ast_sip_dlg_set_transport' function was added to res_pjsip
  which takes an ast_sip_endpoint, a pjsip_dialog, and an optional
  pjsip_tpselector.  It calls ast_sip_get_transport_name() and if
  a non-NULL is returned, sets the selector and sets the transport
  on the dialog.  If a selector was passed in, it's updated.

* res_pjsip/ast_sip_create_dialog_uac and ast_sip_create_dialog_uas
  were modified to call ast_sip_dlg_set_transport() instead of their
  original logic.

* res_pjsip/create_out_of_dialog_request was modified to call
  ast_sip_get_transport_name() and pjsip_tx_data_set_transport()
  instead of its original logic.

* Existing transport logic was removed from endpt_send_request
  since that can only be called after a create_out_of_dialog_request.

* res_pjsip/ast_sip_create_rdata was converted to a wrapper around
  a new 'ast_sip_create_rdata_with_contact' function which allows
  a contact_uri to be specified in addition to the existing
  parameters.  (See below)

* res_pjsip_pubsub/internal_pjsip_evsub_send_request was eliminated
  since all it did was transport selection and that is now done in
  ast_sip_create_dialog_uac and ast_sip_create_dialog_uas.

* 'contact_uri' was added to subscription_persistence.  This was
  necessary because although the parsed rdata contact header has the
  x-ast-txp parameter added (if appropriate),
  subscription_persistence_update stores the raw packet which
  doesn't have it.  subscription_persistence_recreate was then
  updated to call ast_sip_create_rdata_with_contact with the
  persisted contact_uri so the recreated subscription has the
  correct transport info to send the NOTIFYs.

* res_pjsip_session/internal_pjsip_inv_send_msg was eliminated since
  all it did was transport selection and that is now done in
  ast_sip_create_dialog_uac.

* pjsip_message_ip_updater/multihomed_on_tx_message was updated
  to remove all traces of the x-ast-txp parameter from the
  outgoing headers.

NOTE:  This change does NOT modify the behavior of permanent
contacts specified on an aor.  To do so would require that the
permanent contact's contact uri be updated with the x-ast-txp
parameter and the aor sorcery object updated.  If we need to
persue this, we need to think about cloning permanent contacts into
the same store as the dynamic ones on an aor load so they can be
updated without disturbing the originally configured value.

You CAN add the x-ast-txp parameter to a permanent contact's uri
but it would be much simpler to just set endpoint->transport.

Change-Id: I4ee1f51473da32ca54b877cd158523efcef9655f
2017-03-16 08:03:51 -06:00
Joshua Colp
a07015cd4d Merge "Add rtcp-mux support" into 14 2017-03-16 08:57:48 -05:00
Joshua Colp
face057f45 Merge "res/res_pjsip_refer: call xfer w/o extension" into 14 2017-03-16 05:24:35 -05:00
Joshua Colp
d5479a9ad7 Merge "app_queue: Handle the caller being redirected out of a queue bridge" into 14 2017-03-16 05:24:20 -05:00
zuul
04b13666a3 Merge "chan_iax2: Reload of iax peer results in loss of host address/port" into 14 2017-03-15 22:03:35 -05:00