summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
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
2016-11-10Revert "AGI: Only defer frames when in an interception routine."George Joseph
This reverts commit 5c10091f3d1430c6fc04015226f8c3e3aa9d8282. Multiple testsuite failures were detected after the fact. Change-Id: I397a841acc17ae230c512449cd6bed89d2ef3b73
2016-11-09Merge "res_pjsip_session: Do not call session supplements when it's too ↵George Joseph
late." into 13
2016-11-08res_pjsip_session: Do not call session supplements when it's too late.Mark Michelson
res_pjsip_sesssion was hooking into transaction and invite state changes. One of the reasons for doing so was due to the PJSIP_EVENT_TX_MSG event. The idea was that we were hooking into the message sending process, and so we should call session supplements to alter the outgoing message. In reality, this event was meant to indicate that the message either a) had already been sent, or b) required a DNS lookup and would be sent when the DNS query completed. In case (a), this meant we were altering an already-sent request/response for no reason. In case (b), this potentially meant we could be trying to alter a request/response at the same time that the DNS resolution completed. In this case, it meant we might be stomping on memory being used by the thread actually sending the message. This caused potential crashes and memory corruption. This patch removes the calls to session supplements from the case where the PJSIP_EVENT_TX_MSG event occurs. In all of these cases, trying to alter the message at this point is too late, and it can cause nothing but harm to try to do it. Because there were no longer any calls to the handle_outgoing() function, it has been removed. Change-Id: Ibcc223fb1c3a237927f38754e0429e80ee301e92
2016-11-08AGI: Only defer frames when in an interception routine.Mark Michelson
AGI recently was modified to defer important frames. This was because when AGI was used in a connected line interception routine, the resulting connected line frame would end up getting discarded by the AGI. However, this caused bad behavior in other cases. Specifically, during a transfer, if someone attempted to manually set the Caller ID on a channel in an AGI, the deferred connected line frame would end up overwriting what had been manually set in the AGI. Since the initial issue was specific to interception routines, this change removes the manual frame deferral from AGI and instead uses the new frame deferral API in interception routines. ASTERISK-26343 #close Reported by Morton Tryfoss Change-Id: Iab7d39436d0ee99bfe32ad55ef91e9bd88db4208
2016-11-08Merge "stasis_recording/stored: remove calls to deprecated readdir_r ↵Joshua Colp
function." into 13
2016-11-07Merge "res_stasis: Don't unsubscribe from a NULL bridge." into 13Joshua Colp
2016-11-07Merge "res_http_websocket: Increase the buffer size for non-LOW_MEMORY ↵Joshua Colp
systems" into 13
2016-11-04res_http_websocket: Increase the buffer size for non-LOW_MEMORY systemsMatt Jordan
Not surprisingly, using Respoke (and possibly other systems) it is possible to blow past the 16k limit for a WebSocket packet size. This patch bumps it up to 32k, which, at least for Respoke, is sufficient. For now. Because 32k is laughable on a LOW_MEMORY system (as is 16k, for that matter), this patch adds a LOW_MEMORY directive that sets the buffer to 8k for systems who have asked for their reduced memory availability to be considered. Change-Id: Id235902537091b58608196844dc4b045e383cd2e
2016-11-04res_stasis: Set a video source mode on Stasis created bridgesMatt Jordan
When a bridge is created via ARI (through res_stasis), no video source mode is set by default. As a result, any endpoint sending video media won't ever see any video reflected back to it. This patch defaults a bridge to a 'follow the talker' video mode. Further work can be done to add routes that allow for the video mode to be controlled through the /bridges resource. Change-Id: I7e9d530a5d7a97a4524a9ee4e468e1a6b3443866
2016-11-04stasis_recording/stored: remove calls to deprecated readdir_r function.Kevin Harwell
The readdir_r function has been deprecated and should no longer be used. This patch removes the readdir_r dependency (replaced it with readdir) and also moves the directory search code to a more centralized spot (file.c) Also removed a strict dependency on the dirent structure's d_type field as it is not portable. The code now checks to see if the value is available. If so, it tries to use it, but defaults back to using the stats function if necessary. Lastly, for most implementations of readdir it *should* be thread-safe to make concurrent calls to it as long as different directory streams are specified. glibc falls into this category. However, since it is possible that there exist some implementations that are not safe, locking has been added for those other than glibc. ASTERISK-26412 ASTERISK-26509 #close Change-Id: Id8f54689b1e2873e82a09d0d0d2faf41964e80ba
2016-11-03res_stasis: Don't unsubscribe from a NULL bridge.Joshua Colp
A NULL bridge has special meaning in res_stasis for unsubscribing. It means that a subscription to ALL bridges should be removed. This should not be done as part of the normal subscription management in the res_stasis channel loop. ASTERISK-26468 Change-Id: I6d5bea8246dd13a22ef86b736aefbf2a39c15af0
2016-11-02Merge "res_pjsip_sdp_rtp: Limit number of formats to defined maximum." into 13Joshua Colp