summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2017-04-06Merge "Unused realtime MOH classes not purged on 'moh reload'" into 13Joshua Colp
2017-04-05Merge "res_pjsip_session: Allow BYE to be sent on disconnected session." into 13Joshua Colp
2017-04-04res_pjsip_sdp_rtp.c: Don't alter global addr variable.Richard Mudgett
* create_rtp(): Fix unexpected alteration of global address_rtp if a transport is bound to an address. * create_rtp(): Fix use of uninitialized memory if the endpoint RTP media address is invalid or the transport has an invalid address. ASTERISK-26851 Change-Id: Icde42e65164a88913cb5c2601b285eebcff397b7
2017-04-03Unused realtime MOH classes not purged on 'moh reload'Daniel Journo
Purge Realtime MOH classes on 'moh reload' even when musiconhold.conf hasn't changed. ASTERISK-25974 #close Change-Id: I42c78ea76528473a656f204595956c9eedcf3246
2017-04-03res_pjsip: Fix transport ref leak.Richard Mudgett
We were leaking a transport ref in multihomed_on_rx_message() which resulted in the FRACK about excessive ref counts. ASTERISK-26916 #close Change-Id: I7a96658a9614a060565bb9ad51cb1c9c11ee145f
2017-04-01res_pjsip_session: Allow BYE to be sent on disconnected session.Joshua Colp
It is perfectly acceptable for a BYE to be sent on a disconnected session. This occurs when we respond to a challenge to the BYE for authentication credentials. ASTERISK-26363 Change-Id: I6ef0ddece812fea6665a1dd2549ef44fb9d90045
2017-03-30Merge "res_pjsip_config_wizard: Add 2 new parameters to help with proxy ↵George Joseph
config" into 13
2017-03-29Merge "Add DTLS sanity check." into 13George Joseph
2017-03-29Merge "core: Remove embedded module support" into 13zuul
2017-03-29Merge "res_musiconhold: Don't chdir() when scanning MoH files" into 13Joshua Colp
2017-03-28res_pjsip_config_wizard: Add 2 new parameters to help with proxy configGeorge Joseph
Two new parameters have been added to the pjsip config wizard. * Setting 'sends_line_with_registrations' to true will cause the wizard to skip the creation of an identify object to match incoming request to the endpoint and instead add the line and endpoint parameters to the outbound registration object. * Setting 'outbound_proxy' is a shortcut for adding individual endpoint/outbound_proxy, aor/outbound_proxy and registration/outbound_proxy parameters. Change-Id: I678e5f80765734c056620528a6d40d82736ceeb0
2017-03-27Add DTLS sanity check.Richard Mudgett
Change-Id: Ib32612cf6c7ce9213a11b9cba82f630f8cd3564b
2017-03-27core: Remove embedded module supportSean Bright
This has not worked for some time and is no longer actively maintained. Change-Id: I5110b0db69c152761b58fa025cb0a53b0e544d99
2017-03-27res_musiconhold: Don't chdir() when scanning MoH filesSean Bright
There doesn't appear to be any reason that we are chdir'ing in moh_scan_files, and in the event of an Asterisk crash, the core files may not get written because we have changed into a read-only directory. ASTERISK-23996 #close Reported by: Walter Doekes Change-Id: Iac806dce01b3335963fbd62d4b4da9a65c614354
2017-03-25res_xmpp: Use incremental backoff when a read error occursSean Bright
If a read error occurs, we immediately attempt a reconnect without any delay. Instead, let's sleep and backoff up to 60 seconds before we try again. ASTERISK-24712 #close Reported by: Matthias Urlichs Change-Id: I6fe10ef4734837727437beab715e336777f13f48
2017-03-25res_xmpp: Try to provide useful errors messages from OpenSSLSean Bright
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-25res_xmpp: Correctly check return value of SSL_connectSean Bright
SSL_connect returns non-zero for both success and some error conditions so simply negating is inadequate. Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1
2017-03-25res_xmpp: Fix ref counting issueSean Bright
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-24Merge "res_pjsip_sdp_rtp: Set hangup cause for RTP timeouts" into 13zuul
2017-03-24res_pjsip_sdp_rtp: Set hangup cause for RTP timeoutsSean Bright
chan_sip sets the hangup cause code to AST_CAUSE_REQUESTED_CHAN_UNAVAIL (44) when a channel is hung up due to an RTP timeout. So do the same when it happens with PJSIP for parity. Change-Id: I3546ebbde6460c22a27c9da1bf321711b5961ab8
2017-03-23res_xmpp: Correct implementation of JABBER_STATUS & JabberStatusSean Bright
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-23res_xmpp: Don't crash when trying to send a message without a connectionSean Bright
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-23res_xmpp: Include client name in connection related error messagesSean Bright
ASTERISK-25622 #close Reported by: Sean Darcy Change-Id: I8472cb7bfb58d411a3cfbd482da98cae2d94d1e9
2017-03-22Merge "res_pjsip_session: Enable RFC3578 overlap dialing support." into 13zuul
2017-03-22Merge "res_pjsip_messaging: Check URI type before dereferencing" into 13zuul
2017-03-22res_pjsip_session: Enable RFC3578 overlap dialing support.Richard Begg
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-21res_hep: Capture actual transport type in useSean Bright
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-21res_pjsip_messaging: Check URI type before dereferencingSean Bright
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-20Merge "res/res_pjsip_session: Only check localnet if it is defined" into 13zuul
2017-03-19res_rtp_asterisk: Pass correct data length to ast_rtcp_interpretSean Bright
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-18Merge "res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is ↵Joshua Colp
stopped." into 13
2017-03-18Merge "res_pjsip_asterisk.c: Fix compile error if libsrtp is not installed." ↵Joshua Colp
into 13
2017-03-17Merge "res_pjsip_sdp_rtp.c: Fix cut-n-paste error" into 13Joshua Colp
2017-03-17Merge "res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit ↵Joshua Colp
transport" into 13
2017-03-16res_pjsip_asterisk.c: Fix compile error if libsrtp is not installed.Richard Mudgett
struct ast_rtcp does not define the dtls member if SRTP is not enabled. ASTERISK-26732 Change-Id: Id15ea212e04490e012f2cf4a56818b4dd948875e
2017-03-16res_pjsip_sdp_rtp.c: Fix cut-n-paste errorRichard Mudgett
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-16res/res_pjsip_session: Only check localnet if it is definedMatt Jordan
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-17res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit transportRichard Begg
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-16res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped.Joshua Colp
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-16res_pjsip: Symmetric transportsGeorge Joseph
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-16Merge "Add rtcp-mux support" into 13Joshua Colp
2017-03-15Merge "res/res_pjsip_refer: call xfer w/o extension" into 13zuul
2017-03-15Add rtcp-mux supportMark Michelson
This commit adds support for RFC 5761: Multiplexing RTP Data and Control Packets on a Single Port. Specifically, it enables the feature when using chan_pjsip. A new option, "rtcp_mux" has been added to endpoint configuration in pjsip.conf. If set, then Asterisk will attempt to use rtcp-mux with whatever it communicates with. Asterisk follows the rules set forth in RFC 5761 with regards to falling back to standard RTCP behavior if the far end does not indicate support for rtcp-mux. The lion's share of the changes in this commit are in res_rtp_asterisk.c. This is because it was pretty much hard wired to have an RTP and an RTCP transport. The strategy used here is that when rtcp-mux is enabled, the current RTCP transport and its trappings (such as DTLS SSL session) are freed, and the RTCP session instead just mooches off the RTP session. This leads to a lot of specialized if statements throughout. ASTERISK-26732 #close Reported by Dan Jenkins Change-Id: If46a93ba1282418d2803e3fd7869374da8b77ab5
2017-03-15res_pjsip_endpoint_identifier_ip: Don't output error if no header_match.Joshua Colp
This change ensures that if no header_match option is set on an identify an error message is not output stating the option is set to an invalid value. ASTERISK-26863 Change-Id: I239bc6d2319dd3da24ba96a38d4d6e9b5526d62a
2017-03-15Merge "res_pjsip_endpoint_identifier_ip: Add an option to match requests by ↵Joshua Colp
header" into 13
2017-03-15res/res_pjsip_refer: call xfer w/o extensionTorrey Searle
When transfering to a URI without an extension, ensure that the s extension of the dialplan is entered ASTERISK-26869 #close Change-Id: I07403df66cf93f09e00a40ab5b41bfc6f72b1525
2017-03-14res_pjsip_endpoint_identifier_ip: Add an option to match requests by headerMatt Jordan
This patch adds a new features to the endpoint identifier module, 'match_header'. When set, inbound requests are matched by a provided SIP header: value pair. This option works in conjunction with the existing 'match' configuration option, such that if any 'match*' attribute matches an inbound request, the request is associated with the specified endpoint. Since this module now identifies by more than just IP address, appropriate renaming of the module and/or variables can be done in a non-release branch. ASTERISK-26863 #close Change-Id: Icfc14835c962f92e35e67bbdb235cf0589de5453 (cherry picked from commit 30f52d79d7fc9ab0b628bef2b61ea515413795a2)
2017-03-08res_pjsip_transport_websocket: Add support for IPv6.Joshua Colp
This change adds a PJSIP patch (which has been contributed upstream) to allow the registration of IPv6 transport types. Using this the res_pjsip_transport_websocket module now registers an IPv6 Websocket transport and uses it for the corresponding traffic. ASTERISK-26685 Change-Id: Id1f9126f995b31dc38db8fdb58afd289b4ad1647
2017-03-01Merge "res_pjsip WebRTC/websockets: Fix usage of WS vs WSS." into 13Joshua Colp
2017-03-01res_pjsip WebRTC/websockets: Fix usage of WS vs WSS.Jørgen H
According to the RFC[1] WSS should only be used in the Via header for secure Websockets. * Use WSS in Via for secure transport. * Only register one transport with the WS name because it would be ambiguous. Outgoing requests may try to find the transport by name and pjproject only finds the first one registered. This may mess up unsecure websockets but the impact should be minimal. Firefox and Chrome do not support anything other than secure websockets anymore. * Added and updated some debug messages concerning websockets. * security_events.c: Relax case restriction when determining security transport type. * The res_pjsip_nat module has been updated to not touch the transport on Websocket originating messages. [1] https://tools.ietf.org/html/rfc7118 ASTERISK-26796 #close Change-Id: Ie3a0fb1a41101a4c1e49d875a8aa87b189e7ab12