summaryrefslogtreecommitdiff
path: root/channels
AgeCommit message (Collapse)Author
2017-10-24chan_sip: Fix SUBSCRIBE with missing "Expires" header.Corey Farrell
When chan_sip receives a SUBSCRIBE request with no "Expires" header it processes the request as an unsubscribe. This is incorrect, per RFC3264 when the "Expires" header is missing a default expiry should be used. ASTERISK-18140 Change-Id: Ibf6dcd4fdd07a32c2bc38be1dd557981f08188b5
2017-10-21chan_sip: Crypto attribute not last but first on SDP media level.Alexander Traud
This matches the behavior of the other SIP channel driver, chan_pjsip. ASTERISK-27365 Change-Id: I8f23a51290a58b75816da2999ed1965441dfc5d6
2017-10-18chan_sip: Fix output of 'sip set debug off'.Corey Farrell
When sip.conf contains 'sipdebug=yes' it is impossible to disable it using CLI 'sip set debug off'. This corrects the output of that CLI command to instruct the user to turn sipdebug off in the configuration file. ASTERISK-23462 #close Change-Id: I1cceade9caa9578e1b060feb832e3495ef5ad318
2017-10-14chan_dahdi: wrap include file which is not present on BSD systems in #ifdefGuido Falsi
The sys/sysmacros.h include file does not exist in BSD systems and is not required to build this module there. Since an "#if defined(__NetBSD__) || defined(__FreeBSD__)" section already exist I moved that include line inside it's #else branch. ASTERISK-27343 #close Change-Id: Ibfb64f4e9a0ce8b6eda7a7695cfe57916f175dc1
2017-10-11chan_vpb: Fix a gcc 7 out-of-bounds complaintGeorge Joseph
chan_vpb was trying to use sizeof(*p->play_dtmf), where p->play_dtmf is defined as char[16], to get the length of the array but since p->play_dtmf is an actual array, sizeof(*p->play_dtmf) returns the size of the first array element, which is 1. gcc7 validly complains because the context in which it's used could cause an out-of-bounds condition. Change-Id: If9c4bfdb6b02fa72d39e0c09bf88900663c000ba
2017-10-05res_pjsip_caller_id chan_sip: Comply to RFC 3323 values for privacyDaniel Tryba
Currently privacy requests are only granted if the Privacy header value is exactly "id" (defined in RFC 3325). It ignores any other possible value (or a combination there of). This patch reverses the logic from testing for "id" to grant privacy, to testing for "none" and granting privacy for any other value. "none" must not be used in combination with any other value (RFC 3323 section 4.2). ASTERISK-27284 #close Change-Id: If438a21f31a962da32d7a33ff33bdeb1e776fe56
2017-09-25build: A few gcc 7 error fixesGeorge Joseph
Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec
2017-09-21bridge: Change participant SFU streams when source streams change.Joshua Colp
Some endpoints do not like a stream being reused for a new media stream. The frame/jitterbuffer can rely on underlying attributes of the media stream in order to order the packets. When a new stream takes its place without any notice the buffer can get confused and the media ends up getting dropped. This change uses the SSRC change to determine that a new source is reusing an existing stream and then bridge_softmix renegotiates each participant such that they see a new media stream. This causes the frame/jitterbuffer to start fresh and work as expected. ASTERISK-27277 Change-Id: I30ccbdba16ca073d7f31e0e59ab778c153afae07
2017-09-21Merge "chan_sip: Expose read-only access to the full SIP INVITE Request-URI"Jenkins2
2017-09-20chan_pjsip: Ignore AST_CONTROL_STREAM_TOPOLOGY_CHANGED for nowGeorge Joseph
chan_pjsip_indicate was missing a case for the recently added AST_CONTROL_STREAM_TOPOLOGY_CHANGED condition and was returning an error and causing the call to be hung up instead of just ignoring it. ASTERISK-27260 Reported by: Daniel Heckl Change-Id: I4fecbb00a0b8a853da85155065c1a6bddf235e80
2017-09-19chan_sip: Expose read-only access to the full SIP INVITE Request-URIDavid J. Pryke
Provide a way to get the contents of the the Request URI from the initial SIP INVITE in dial plan function call. (In this case "${CHANNEL(ruri)}") ASTERISK-27278 Reported by: David J. Pryke Tested by: David J. Pryke Change-Id: I1dd4d6988eed1b6c98a9701e0e833a15ef0dac3e
2017-09-13chan_rtp: Use μ-law by default instead of signed linearSean Bright
Multicast/Unicast RTP do not use SDP so we need to use a format that cleanly maps to one of the static RTP payload types. Without this change, an Originate to a Multicast or Unicast channel without a format specified would produce no audio on the receiving device. ASTERISK-21399 #close Reported by: Tzafrir Cohen Change-Id: I97e332b566e85da04b0004b9b0daae746cfca0e3
2017-09-08Merge "chan_sip: when getting sip pvt return failure if not found"Jenkins2
2017-09-06chan_sip: when getting sip pvt return failure if not foundScott Griepentrog
In handle_request_invite, when processing a pickup, a call is made to get_sip_pvt_from_replaces to locate the pvt for the subscription. The pvt is assumed to be valid when zero is returned indicating no error, and is dereferenced which can cause a crash if it was not found. This change checks the not found case and returns -1 which allows the calling code to fail appropriately. ASTERISK-27217 #close Reported-by: Bryan Walters Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612
2017-09-06chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITEVitezslav Novy
If directmedia=yes is configured, when call is answered, Asterisk sends reINVITE to both parties to set up media path directly between the endpoints. In this reINVITE msg SDP origin line (o=) contains IP address of endpoint instead of IP of asterisk. This behavior violates RFC3264, sec 8: "When issuing an offer that modifies the session, the "o=" line of the new SDP MUST be identical to that in the previous SDP, except that the version in the origin field MUST increment by one from the previous SDP." This patch assures IP address of Asterisk is always sent in SDP origin line. ASTERISK-17540 Reported by: saghul Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e
2017-09-05chan_pjsip: Suppress frame warnings.Ben Ford
When rtp_keepalive is on for a PJSIP endpoint dialing to another Asterisk instance also using PJSIP, Asterisk will continue to print warning messages about not being able to send frames of a certain type. This suppresses that warning message. Change-Id: I0332a05519d7bda9cacfa26d433909ff1909be67
2017-08-30chan_pjsip: Add tag info in CHANNEL functionAndre Nazario
Create local_tag and remote_tag in CHANNEL info to get tag from From and To headers of a SIP dialog. ASTERISK-27220 Change-Id: I59b16c4b928896fcbde02ad88f0e98922b15d524
2017-08-28Merge "res/res_pjsip_session: allow SDP answer to be regenerated"Joshua Colp
2017-08-25res/res_pjsip_session: allow SDP answer to be regeneratedTorrey Searle
If an SDP answer hasn't been sent yet, it's legal to change it. This is required for PJSIP_DTMF_MODE to work correctly, and can also have use in the future for updating codecs too. ASTERISK-27209 #close Change-Id: Idbbfb7cb3f72fbd96c94d10d93540f69bd51e7a1
2017-08-22chan_pjsip.c: Fix topology refresh response code accuracy.Richard Mudgett
There are other 1xx and 2xx codes than 100 and 200 respectively. Change-Id: I680db0997343256add1478714f5bf5b5569aee17
2017-08-09res_rtp_asterisk: Make P2P bridge Asymmetric codec awareTorrey Searle
Introduce a new property to rtp-engine to make it aware of the desire for assymetric codecs or not. If asymmetric codecs is not allowed, the bridge will compare read/write formats and shut down the p2p bridge if needed ASTERISK-26745 #close Change-Id: I0d9c83e5356df81661e58d40a8db565833501a6f
2017-08-07chan_sip: Access incoming REFER headers in dialplankkm
This adds a way to access information passed along with SIP headers in a REFER message that initiates a transfer. Headers matching a dialplan variable GET_TRANSFERRER_DATA in the transferrer channel are added to a HASH object TRANSFER_DATA to be accessed with functions HASHKEY and HASH. The variable GET_TRANSFERRER_DATA is interpreted to be a prefix for headers that should be put into the hash. If not set, no headers are included. If set to a string (perhaps 'X-' in a typical case), all headers starting this string are added. Empty string matches all headers. If there are multiple of the same header, only the latest occurrence in the REFER message is available in the hash. Obviously, the variable GET_TRANSFERRER_DATA must be inherited by the referrer channel, and should be set with the '_' or '__' prefix. I avoided a specific reference to SIP or REFER, as in my mind the mechanism can be generalized to other channel techs. ASTERISK-27162 Change-Id: I73d7a1e95981693bc59aa0d5093c074b555f708e
2017-08-04Merge "chan_sip: Add dialplan function SIP_HEADERS"Joshua Colp
2017-08-04Merge "Fix compile error for old versions of GCC."Jenkins2
2017-08-03Correct some leaks in unit tests.Corey Farrell
* chan_sip: channel in test_sip_rtpqos_1. * test_config: config hook, config info and global config holder. * test_core_format: format in format_attribute_set_without_interface. * test_stream: unneeded frame duplication. * test_taskprocessor: task_data. Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31
2017-08-02chan_sip: Add dialplan function SIP_HEADERSkkm
Syntax: SIP_HEADERS([prefix]) If the argument is specified, only the headers matching the given prefix are returned. The function returns a comma-separated list of SIP header names from an incoming INVITE message. Multiple headers with the same name are included in the list only once. The returned list can be iterated over using the functions POP() and SIP_HEADER(). For example, '${SIP_HEADERS(Co)}' might return the string 'Contact,Content-Length,Content-Type'. Practical use is rather '${SIP_HEADERS(X-)}' to enumerate optional extended headers sent by a peer. ASTERISK-27163 Change-Id: I2076d3893d03a2f82429f393b5b46db6cf68a267
2017-08-02Fix compile error for old versions of GCC.Corey Farrell
Use -Wno-format-truncation only if supported by compiler. ASTERISK-27171 #close Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
2017-08-01Fix compiler warnings on Fedora 26 / GCC 7.Corey Farrell
GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2017-08-01chan_pjsip: add a new function PJSIP_DTMF_MODETorrey Searle
This function is a replica of SIPDtmfMode, allowing the DTMF mode of a PJSIP call to be modified on a per-call basis ASTERISK-27085 #close Change-Id: I20eef5da3e5d1d3e58b304416bc79683f87e7612
2017-07-24core: Add VP9 passthrough support.Joshua Colp
This change adds VP9 as a known codec and creates a cached "vp9" media format for use. Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc
2017-07-17Merge "res_pjsip: Add "webrtc" configuration option"Jenkins2
2017-07-14chan_iax2: On reload make sure to check for existing MWI subscriptionSergej Kasumovic
On every reload of chan_iax2 module, MWI subscription was added, which results in additional taskprocessors being accumulated over time. This commit fixes it by making sure we check for existing subscription first. This was verified with 'core show taskprocessors' CLI command. ASTERISK-27122 #close Change-Id: Ie2ef528fd5ca01b933eeb88188cc10967899cfb9
2017-07-13res_pjsip: Add "webrtc" configuration optionKevin Harwell
This patch creates a new configuration option called "webrtc". When enabled it defaults and enables the following options that are needed in order for webrtc to work in Asterisk: rtcp-mux, use_avpf, ice_support, and use_received_transport=enabled media_encryption=dtls dtls_verify=fingerprint dtls_setup=actpass When "webrtc" is enabled, this patch also parses the "msid" media level attribute from an SDP. It will also appropriately add it onto the outgoing session when applicable. Lastly, when "webrtc" is enabled h264 RTCP FIR feedback frames are now sent. ASTERISK-27119 #close Change-Id: I5ec02e07c5d5b9ad86a34fdf31bf2f9da9aac6fd
2017-07-13Merge "res_rtp_asterisk / res_pjsip: Add support for BUNDLE."Jenkins2
2017-07-13res_rtp_asterisk / res_pjsip: Add support for BUNDLE.Joshua Colp
BUNDLE is a specification used in WebRTC to allow multiple streams to use the same underlying transport. This reduces the number of ICE and DTLS negotiations that has to occur to 1 normally. This change implements this by adding support for it to the RTP SDP module in PJSIP. BUNDLE can be turned on using the "bundle" option and on an offer we will offer to bundle streams together. On an answer we will accept any bundle groups provided. Once accepted each stream is bundled to another RTP instance for transport. For the res_rtp_asterisk changes the ability to bundle an RTP instance to another based on the SSRC received from the remote side has been added. For outgoing traffic if an RTP instance is bundled to another we will use the other RTP instance for any transport related things. For incoming traffic received from the transport instance we look up the correct instance based on the SSRC and use it for any non-transport related data. ASTERISK-27118 Change-Id: I96c0920b9f9aca7382256484765a239017973c11
2017-07-07Merge "core: Remove 'Data Retrieval API'"Jenkins2
2017-07-05Merge "chan_sip: Fix a typo for tlsbindaddr in autodomain (SIP Domain Support)."Jenkins2
2017-07-05Merge "chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain ↵Jenkins2
Support)."
2017-07-05Merge "chan_pjsip: Fix ability to send UPDATE on COLP"Jenkins2
2017-07-05core: Remove 'Data Retrieval API'Sean Bright
This API was not actively maintained, was not added to new modules (such as res_pjsip), and there exist better alternatives to acquire the same information, such as the ARI. Change-Id: I4b2185a83aeb74798b4ad43ff8f89f971096aa83
2017-07-03chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain Support).Alexander Traud
When sip.conf contained tcpenable=yes and autodomain=yes, the TCP domain was added in any case, because of a local Boolean-negation error of the return value of ast_sockaddr_cmp. After fixing this error for TCP and TLS, the TLS domain was still always added with tlsenable=yes, because the domains were not compared just on the address but also on the port – and TLS is always on a different port than UDP/TCP. ASTERISK-27106 Change-Id: I14fe9e319e238320b094016980445ef3a5b3337c
2017-07-03chan_sip: Fix a typo for tlsbindaddr in autodomain (SIP Domain Support).Alexander Traud
Because of a copy-and-paste error when the struct ast_sockaddr changed, tlsbindaddr was not added, when sip.conf contained autodomain=yes; see "show sip domains" on the command-line interface (CLI) of Asterisk. ASTERISK-27106 Change-Id: I3d0957150017c223136968ef1266f275d0d6695e
2017-06-29chan_pjsip: Fix ability to send UPDATE on COLPGeorge Joseph
When connected_line_method is "invite", we're supposed to determine if the client can support UPDATE and if it can, send UPDATE instead of INVITE to avoid the SDP renegotiation. Not only was pjproject not setting the PJSIP_INV_SUPPORT_UPDATE flag, we were testing that invite_tsx wasn't NULL which isn't always the case. * Updated chan_pjsip/update_connected_line_information to drop the requirement that invite_tsx isn't NULL. * Submitted patch to pjproject sip_inv.c that sets the PJSIP_INV_SUPPORT_UPDATE flag correctly. * Updated pjsip.conf.sample to clarify what happens when "invite" is specified. ASTERISK-27095 Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560
2017-06-29res_pjsip: Add DTMF INFO Failback modeTorrey Searle
The existing auto dtmf mode reverts to inband if 4733 fails to be negotiated. This patch adds a new mode auto_info which will switch to INFO instead of inband if 4733 is not available. ASTERISK-27066 #close Change-Id: Id185b11e84afd9191a2f269e8443019047765e91
2017-06-28chan_pjsip: Add support for multiple streams of the same type.Mark Michelson
The stream topology (list of streams and order) is now stored with the configured PJSIP endpoints and used during the negotiation process. Media negotiation state information has been changed to be stored in a separate object. Two of these objects exist at any one time on a session. The active media state information is what was previously negotiated and the pending media state information is what the media state will become if negotiation succeeds. Streams and other state information is stored in this object using the index (or position) of each individual stream for easy lookup. The ability for a media type handler to specify a callback for writing has been added as well as the ability to add file descriptors with a callback which is invoked when data is available to be read on them. This allows media logic to live outside of the chan_pjsip module. Direct media has been changed so that only the first audio and video stream are directly connected. In the future once the RTP engine glue API has been updated to know about streams each individual stream can be directly connected as appropriate. Media negotiation itself will currently answer all the provided streams on an offer within configured limits and on an offer will use the topology created as a result of the disallow/allow codec lines. If a stream has been removed or declined we will now mark it as such within the resulting SDP. Applications can now also request that the stream topology change. If we are told to do so we will limit any provided formats to the ones configured on the endpoint and send a re-invite with the new topology. Two new configuration options have also been added to PJSIP endpoints: max_audio_streams: determines the maximum number of audio streams to offer/accept from an endpoint. Defaults to 1. max_video_streams: determines the maximum number of video streams to offer/accept from an endpoint. Defaults to 1. ASTERISK-27076 Change-Id: I8afd8dd2eb538806a39b887af0abd046266e14c7
2017-06-15chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read.Richard Mudgett
The construction of the returned string assumed incorrectly that the supplied buffer would always be initialized as an empty string. If it is not an empty string we could overrun the supplied buffer by the length of the non-empty buffer string plus one. It is also theoreticaly possible for the supplied buffer to be overrun by a string terminator during a read operation even if the supplied buffer is an empty string. * Fix the assumption that the supplied buffer would already be an empty string. The buffer is not guaranteed to contain an empty string by all possible callers. * Fix string terminator buffer overrun potential. Change-Id: If6a0806806527678c8554b1dcb34fd7808aa95c9
2017-06-13Merge "pjsip: Extend 'asymmetric_rtp_codec' option to include us changing."Jenkins2
2017-06-07chan_pjsip: Update device state when in early media.Joshua Colp
The chan_pjsip module uses a calculation approach for determining device state. This means that in situations where we would expect device state to change we need to tell the core to query. A scenario that was missed is when early media was signaled. This change adds the notification for the core to query device state when we are told that early media is being provided. ASTERISK-27039 Change-Id: Iafebfd152894966344ff2e950a3cee9f59a3eb6f
2017-06-07pjsip: Extend 'asymmetric_rtp_codec' option to include us changing.Joshua Colp
PJSIP support in Asterisk differs from chan_sip in that it allows media to be sent as-is without transcoding provided the codecs were negotiated in the SDP. This is allowed according to the RFC. Support for this differs quite a lot though and some endpoints do not handle it well. This change extends the 'asymmetric_rtp_codec' option to also cover this case. When set to no (the default) the code behaves as chan_sip does - the best codec is selected and we will only ever send that, unless we change what we are sending if the remote side changes. When set to yes we will send media as-is without transcoding if the codec has been negotiated in the SDP. ASTERISK-26996 Change-Id: Ib1647f6902a0843e8c435946f831c2159e8d1d51
2017-06-06res_pjsip: Add support for returning only reachable contacts and use it.Joshua Colp
This introduces the ability for PJSIP code to specify filtering flags when retrieving PJSIP contacts. The first flag for use causes the query code to only retrieve contacts that are not unreachable. This change has been leveraged by both the Dial() process and the PJSIP_DIAL_CONTACTS dialplan function so they will now only attempt calls to contacts which are not unreachable. ASTERISK-26281 Change-Id: I8233b4faa21ba3db114f5a42e946e4b191446f6c