summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2017-01-20res_pjsip: alloca can never fail.Richard Mudgett
Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1
2017-01-20res_pjsip_outbound_authenticator_digest.c: Fix spacing in warning messages.Richard Mudgett
Change-Id: I573f0343c0c63a785cd4da60d57cc9f8b9ce7f49
2017-01-09Merge "res_pjsip_endpoint_identifier_ip: Add support for SRV lookups." into 13Joshua Colp
2017-01-09Merge "res_pjsip: Fix known compact header issues" into 13Joshua Colp
2017-01-09Merge changes from topic 'ASTERISK-26672' into 13Joshua Colp
* changes: res_rtp_asterisk.c: Fix uninitialized memory crash. chan_rtp.c: Fix uninitialized memory crash.
2017-01-06Merge "res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip()." into 13zuul
2017-01-06res_pjsip_endpoint_identifier_ip: Add support for SRV lookups.Joshua Colp
This change implements SRV support for the IP based endpoint identifier module. All possible addresses through SRV are looked up and added as matches. If no SRV records are available a fallback to normal host resolution is done. If an IP address is provided then no SRV lookup occurs. This is configured using the "srv_lookups" option on the identify section and defaults to "yes". ASTERISK-26693 Change-Id: I6b641e275bf96629320efa8b479737062aed82ac
2017-01-04res_pjsip_session: Access SIPDOMAIN via Dialplan.Alexander Traud
This feature was available in the SIP channel driver chan_sip. For example, Asterisk is the outbound proxy and has to handle all SIP-URIs, even domains not local to Asterisk. In that case, SIPDOMAIN is used in the Dialplan, to detect and dial remote SIP-URIs. This change here sets the SIP destination domain of an inbound call (SIPDOMAIN) in the SIP channel driver res_pjsip as well. ASTERISK-26670 #close Change-Id: I27c880dc404a3c1c6792e1ba3545475339577243
2016-12-31res_pjsip: Fix known compact header issuesJoshua Elson
ASTERISK-26684 #close Change-Id: Ifd7e401c45015119dd5e8421dbfe3afa6381744a
2016-12-30res_pjsip_refer: Handle compact Refer-To header.George Joseph
refer_incoming_refer_request needed to look for the "r" header as well as the "Refer-To" header. ASTERISK-26655 #close patches: refer_compact_fix.diff submitted by JoshE (license 6075) Change-Id: I610410a99b02427ea5db887aeb454d5f12c2259f
2016-12-22res_rtp_asterisk.c: Fix uninitialized memory crash.Richard Mudgett
ast_rtp_remote_address_set() could pass an uninitialized 'us' parameter to ast_ouraddrfor(). If ast_ouraddrfor() returns an error then the 'us' parameter may not get initialized. Thus when the code tries to save the 'us' parameter to the local address we could try to copy a ridiculous sized memory buffer and segfault. * Made pass an initialized 'us' parameter to ast_ouraddrfor(). * Optimized out the 'us' struct variable. ASTERISK-26672 #close Change-Id: I4acea5dcdf0813da2c7d3e11c2d6067d160d17dc
2016-12-22res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip().Richard Mudgett
We access uninitialized memory when the 'ourip' parameter does not have an initial guess to our IP address. ASTERISK-26672 Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15
2016-12-21res_rtp_asterisk.c: Fix off nominal memory leak.Richard Mudgett
Change-Id: I95b1088d11244a2edae6607c12fbf33b38658a75
2016-12-20Merge "res_pjsip: Add/update ERROR msg if invalid URI." into 13Joshua Colp
2016-12-14res_pjsip: Add/update ERROR msg if invalid URI.Richard Mudgett
ASTERISK-24499 Change-Id: Ie305153e47e922233b2ff24715e0e326e5fa3a6c
2016-12-14res_sorcery_memory_cache: Change an error to a debug messageGeorge Joseph
When a sorcery user calls ast_sorcery_delete on an object that may have already expired from the cache, res_sorcery_memory_cache spits out an ERROR. Since this can happen frequently and validly when an inbound registration expires after the cache entry expired, the errors are unnecessary and misleading. Changed to a debug/1. Change-Id: Idf3a67038c16e3da814cf612ff4d6d18ad29ecd7
2016-12-08Merge "res_pjsip: Fix 'A = B != C' kind." into 13zuul
2016-12-08Merge "res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses ↵Joshua Colp
command" into 13
2016-12-08res_pjsip: Fix 'A = B != C' kind.Badalyan Vyacheslav
Consider reviewing the expression of the 'A = B != C' kind. The expression is calculated as following: 'A = (B != C)' Change-Id: Ibaa637dfda47d51a20e26069d3103e05ce80003d
2016-12-08res_format_attr_opus: Fix crash when fmtp contains spaces.Joshua Colp
When an opus offer or answer was received that contained an fmtp line with spaces between the attributes the module would fail to properly parse it and crash due to recursion. This change makes the module handle the space properly and also removes the recursion requirement. ASTERISK-26579 Change-Id: I01f53e5d9fa9f1925a7365f8d25071b5b3ac2dc3
2016-12-07res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses commandGeorge Joseph
The PJSIPShowRegistrationsInbound AMI command was just dumping out all AORs which was pretty useless and resource heavy since it had to get all endpoints, then all aors for each endpoint, then all contacts for each aor. PJSIPShowRegistrationInboundContactStatuses sends ContactStatusDetail events which meets the intended purpose of the other command and has significantly less overhead. Also, some additional fields that were added to Contact since the original creation of the ContactStatusDetail event have been added to the end of the event. For compatibility purposes, PJSIPShowRegistrationsInbound is left intact. ASTERISK-26644 #close Change-Id: I326f12c9ecb52bf37ba03f0748749de4da01490a
2016-12-06Merge "res_pjsip_outbound_registration.c: Filter redundant statsd ↵Joshua Colp
reporting." into 13
2016-12-02res_pjsip_outbound_registration.c: Filter redundant statsd reporting.Richard Mudgett
Increasing the testsuite shutdown timeout before forcibly killing Asterisk allowed more events to be sent out. Some tests failed as a result. The tests/channels/pjsip/statsd/registrations failed because we now get the statsd events that a comment in the test configuration stated couldn't be intercepted. Unfortunately, we get a variable number of events because of internal status state transition races generating redundant statsd events. We were reporting redundant statsd PJSIP.registrations.state changes for internal state changes that equated to the same thing publicly. * Made update_client_state_status() filter out redundant statsd updates. ASTERISK-26527 Change-Id: If851c7d514bb530d9226e4941ba97dcf52000646
2016-12-02Merge "res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport ↵Joshua Colp
parameter" into 13
2016-12-02Merge "PJPROJECT logging: Made easier to get available logging levels." into 13Joshua Colp
2016-12-01Merge "res_rtp: Fix regression when IPv6 is not available." into 13Joshua Colp
2016-11-30res_rtp: Fix regression when IPv6 is not available.Guido Falsi
The latest Release candidate fails to create RTP streams when IPv6 is not available. Due to the changes made in September the ast_sockaddr structure passed around to create these streams is always of AF_INET6 type, causing failure when used for IPv4. This patch adds a utility function to check for availability of IPv6 and applies such check at startup to determine how to create the ast_sockaddr structures. ASTERISK-26617 #close Change-Id: I627a4e91795e821111e1cda523f083a40d0e0c3e
2016-11-30res_calendar_caldav: Add support reading gmail calendarEduardo S. Libardi
The response from gmail calendar includes the string name "caldav:calendar-data". res_calendar_caldav implements the example included in RFC 4791: string "C:calendar-data". When reading the calendar, res_calendar_caldav compare the string and if does not match just discards the event. This commit compares the response to both strings, successfully loading gmail calendar events. Writing to gmail calendar is working prior to this fix. ASTERISK-26624 Reported by: Eduardo S. Libardi Change-Id: Ia1eef10552ae616efb645d390f5ffe81260d7d4a
2016-11-30PJPROJECT logging: Made easier to get available logging levels.Richard Mudgett
Use of the new logging is as simple as issuing the new CLI command or setting the new pjproject.conf option. Other options that can affect the logging are how you have the pjproject log levels mapped to Asterisk log types in pjproject.conf and if you have configured Asterisk to log the DEBUG type messages. Altering the pjproject.conf level mapping shouldn't be necessary for most installations as the default mapping is sensible. Configuring Asterisk to log the DEBUG message type is standard practice for collecting debug information. * Added CLI "pjproject set log level" command to dynamically adjust the maximum pjproject log message level. * Added CLI "pjproject show log level" command to see the currently set maximum pjproject log message level. * Added pjproject.conf startup section "log_level" option to set the initial maximum pjproject log message level so all messages could be captured from initialization. * Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into bundled pjproject. Pjproject will use the currently set run time log level to determine if a log message is generated just like Asterisk verbose and debug logging levels. * In log_forwarder(), made always log enabled and mapped pjproject log messages. DEBUG mapped log messages are no longer gated by the current Asterisk debug logging level. * Removed RAII_VAR() from res_pjproject.c:get_log_level(). ASTERISK-26630 #close Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
2016-11-28res/res_pjsip: Fix documentation whitespace issuesMatt Jordan
Tabs > Spaces. Change-Id: If1e43a71822615a898e958e0f8b2e882606f0bd0
2016-11-28res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameterMatt Jordan
Per RFC 7118 5.2, the SIP URI 'transport' parameter should advertise 'ws' when WebSockets are to be used as the transport. This applies to both secure and insecure WebSockets. There were two bugs in Asterisk with respect to this: (1) The most egregious occurs in res_pjsip. There, we advertise 'ws' for insecure websockets and 'wss' for secure websockets. While this would seem to make sense - since 'WS' and 'WSS' are used for the Via Transport parameter - this is not the case for the SIP URI. This patch corrects that by registering the secure websockets with pjproject using the shorthand 'WS', and by returning 'ws' when asked for the transport parameter. Note that in pjproject, it is perfectly valid to have multiple transports use the same shorthand. (2) In chan_sip, we return an upper-case version of the transport 'WS' instead of 'ws'. Since we should be strict in what we send and liberal in what we accept (within reason), this patch lower-cases the transport before appending it to the parameter. ASTERISK-24330 #close Reported by: cervajs, Inaki Baz Castillo Change-Id: Iff77b645f8cc3b7cd35168a6676c26b147f22f42
2016-11-22res_rtp_asterisk: RTT miscalculation in RTCPgestoip2
When retrieving RTCP stats for PJSIP channels, RTT values are unreliable. RTT calculation is correct, but the data representation isn't. RTT is represented by a 32-bit fixed-point number with the integer part in the first 16 bits and the fractional part in the last 16 bits. In order to get the RTT value, the fractional part is miscalculated, there is an unnecessary 16 bit shift that causes overflow. Besides this there is another mistake, when transforming the integer value to the fixed point fractional part via bitwise operation, that loses precision. * RTT fractional part is no longer shifted, avoiding overflow. * RTT fractional part is transformed to its fixed-point value more precisely. * Fixed timeval2ntp() and ntp2timeval() second fraction conversions. * Fixed NTP timestamp report logging. The usec was inexplicably multiplied by 4096. ASTERISK-26566 #close Reported by Hector Royo Concepcion Change-Id: Ie09bdabfee75afb3f1b8ddfd963e5219ada3b96f
2016-11-18Merge "build: Various OpenBSD issues" into 13Joshua Colp
2016-11-16Merge "res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak." into 13zuul
2016-11-16Merge "res_format_attr_opus: Fix fmtp generation." into 13George Joseph
2016-11-16build: Various OpenBSD issuesGeorge Joseph
OpenBSD's 'find' doesn't take the -delete argument so you have to pipe through 'xargs rm -rf'. 'echo -e' doesn't like \t starting a line. It just prints 't' which causes the libasteriskpj.exports file to be garbage. They were just cosmetic so they were removed. librt doesn't exist so the link of libasteriskpj.so fails. It's not actually needed for linux anyway so -lrt was removed from the link. res_rtp_asterisk was failing to load because of an undefined DTLS_method. '|| defined(LIBRESSL_VERSION_NUMBER)' was added to the #if so DTLSv1_method is used instead. ASTERISK-26608 Change-Id: I926ec95b0b69633231e3ad1d6e803b977272c49c
2016-11-16Merge "res/ari/resource_bridges: Add the ability to manipulate the video ↵zuul
source" into 13
2016-11-16res_format_attr_opus: Fix fmtp generation.Mark Michelson
res_format_attr_opus assumed that the string being passed into it was empty. It tried to determine if the only thing it had written was a=fmtp:<num> And if it had, it would reset the string. Its calculation was off when working with chan_sip, though. chan_sip passes the entire built SDP rather than an empty string. This resulted in always putting an empty fmtp line in the SDP. ASTERISK-26520 #close Reported by scgm11 Change-Id: Ib2e8712d26a47067e5f36d5973577added01dbb5
2016-11-16Merge "Revert "Revert "AGI: Only defer frames when in an interception ↵zuul
routine.""" into 13
2016-11-16res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak.Richard Mudgett
Responding to authentication challenges leaks PJSIP memory pools. The leak was introduced with a pjproject 2.5.5 API change. https://trac.pjsip.org/repos/ticket/1929 changed the API usage of pjsip_auth_clt_init() to require the new API pjsip_auth_clt_deinit() to clean up cached authentication allocations that get allocated with pjsip_auth_clt_reinit_req(). ASTERISK-26516 #close Change-Id: I4473141b8c3961d0dc91c382beb3876b3efb45c8
2016-11-14res/ari/resource_bridges: Add the ability to manipulate the video sourceMatt Jordan
In multi-party bridges, Asterisk currently supports two video modes: * Follow the talker, in which the speaker with the most energy is shown to all participants but the speaker, and the speaker sees the previous video source * Explicitly set video sources, in which all participants see a locked video source Prior to this patch, ARI had no ability to manipulate the video source. This isn't important for two-party bridges, in which Asterisk merely relays the video between the participants. However, in a multi-party bridge, it can be advantageous to allow an external application to manipulate the video source. This patch provides two new routes to accomplish this: (1) setVideoSource: POST /bridges/{bridgeId}/videoSource/{channelId} Sets a video source to an explicit channel (2) clearVideoSource: DELETE /bridges/{bridgeId}/videoSource Removes any explicit video source, and sets the video mode to talk detection ASTERISK-26595 #close Change-Id: I98e455d5bffc08ea5e8d6b84ccaf063c714e6621
2016-11-14Revert "Revert "AGI: Only defer frames when in an interception routine.""George Joseph
This reverts commit 6be5d8de0da7e804544507f70382425af9a07b3f. Change-Id: I4b548137f52ae0686d8f09e21496b778d1c6a797
2016-11-14Merge "res_pjsip.c: Rework endpt_send_request() req_wrapper code." into 13zuul
2016-11-14Merge "res_pjsip: Fix tdata leaks in off nominal paths." into 13Joshua Colp
2016-11-11Merge "res_pjsip_sdp_rtp: Reject offer of required SRTP without res_srtp." ↵Joshua Colp
into 13
2016-11-10res_pjsip.c: Rework endpt_send_request() req_wrapper code.Richard Mudgett
* Don't hold the req_wrapper lock too long in endpt_send_request(). We could block the PJSIP monitor thread if the timeout timer expires. sip_get_tpselector_from_endpoint() does a sorcery access that could take awhile accessing a database. pjsip_endpt_send_request() might take awhile if selecting a transport. * Shorten the time that the req_wrapper lock is held in the callback functions. * Simplify endpt_send_request() req_wrapper->timeout code. * Removed some redundant req_wrapper->timeout_timer->id assignments. Change-Id: I3195e3a8e0207bb8e7f49060ad2742cf21a6e4c9
2016-11-10res_pjsip: Fix tdata leaks in off nominal paths.Richard Mudgett
Change-Id: Ie83e06e88c2d60157775263b07e40b61718ac97b
2016-11-10res_pjsip_registrar_expire.c: Remove extra linefeed in debug message.Richard Mudgett
Change-Id: I1f9adb911f23376503396ec8867e8005b755eb94
2016-11-10res_pjsip_sdp_rtp: Reject offer of required SRTP without res_srtp.Joshua Colp
When optimistic SRTP was on it was possible for us to still set up a call without an audio stream if an offer was received with required SRTP. This change makes it so this scenario will now fail with a 488 response. ASTERISK-26575 Change-Id: I7d14187037681f48879bd20319ac79d0877318f3
2016-11-10Merge "Revert "AGI: Only defer frames when in an interception routine."" into 13George Joseph