summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-14res_pjsip: Add/update ERROR msg if invalid URI.Richard Mudgett
ASTERISK-24499 Change-Id: Ie305153e47e922233b2ff24715e0e326e5fa3a6c
2016-12-14MESSAGE: Flush Message/ast_msg_queue channel alert pipe.Richard Mudgett
ASTERISK-25083 Change-Id: Id54baa57a8dbca84e29f28bcd2ffc0a5ac12d8b2
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-09pjproject_bundled: Retry download if previously saved tarball is badGeorge Joseph
If a tarball is corrupted during download, the makefile will attempt to download it again. If the tarball somehow gets corrupted after it's downloaded however, the makefile was just failing. We now retry the download. ASTERISK-26653 #close Change-Id: I1b24d454852d80186f60c5a65dc4624ea8a1c359
2016-12-09Merge "Fix typo in chan_sip" into 13Joshua Colp
2016-12-09Merge "chan_sip: Delete unneeded check" into 13Joshua Colp
2016-12-09Merge "Small code cleanup in chan_sip" into 13zuul
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-08chan_sip: Delete unneeded checkBadalyan Vyacheslav
P is always true. We check it before Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb
2016-12-08Small code cleanup in chan_sipBadalyan Vyacheslav
The conditional expressions of the 'if' operators situated alongside each other are identical. Change-Id: I2cf7c317b106ec14440c7f1b5dcfbf03639f748a
2016-12-08Fix typo in chan_sipBadalyan Vyacheslav
The conditional expressions of the 'if' operators situated alongside each other are identical. Change-Id: I652b6dcddb3be007e669a6aa8107edb31a1ddafb
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-08Merge "res_format_attr_opus: Fix crash when fmtp contains spaces." into 13Kevin Harwell
2016-12-08chan_sip: Do not allow non-SP/HTAB between header key and colon.Walter Doekes
RFC says SIP headers look like: HCOLON = *( SP / HTAB ) ":" SWS SWS = [LWS] ; sep whitespace LWS = [*WSP CRLF] 1*WSP ; linear whitespace WSP = SP / HTAB ; from rfc2234 chan_sip implemented this: HCOLON = *( LOWCTL / SP ) ":" SWS LOWCTL = %x00-1F ; CTL without DEL This discrepancy meant that SIP proxies in front of Asterisk with chan_sip could pass on unknown headers with \x00-\x1F in them, which would be treated by Asterisk as a different (known) header. For example, the "To\x01:" header would gladly be forwarded by some proxies as irrelevant, but chan_sip would treat it as the relevant "To:" header. Those relying on a SIP proxy to scrub certain headers could mistakenly get unexpected and unvalidated data fed to Asterisk. This change fixes so chan_sip only considers SP/HTAB as valid tokens before the colon, making it agree on the headers with other speakers of SIP. ASTERISK-26433 #close AST-2016-009 Change-Id: I78086fbc524ac733b8f7f78cb423c91075fd489b
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-07Merge "Bundled pjproject: Fix finding SIP transactions." into 13Joshua Colp
2016-12-07Bundled pjproject: Fix finding SIP transactions.Richard Mudgett
Occasionally SIP message transactions are not found when they should be. In the particular case an incoming INVITE transaction is CANCELed but the INVITE transaction cannot be found so a 481 response is returned for the CANCEL. The problematic calls have a '_' character in the Via branch parameter. The problem is in the pjproject PJ_HASH_USE_OWN_TOLOWER feature's code. The problem with the "own tolower" code is that it does not calculate the same hash value as when the pj_tolower() function is used. The "own tolower" code will erroneously modify the ASCII characters '@', '[', '\\', ']', '^', and '_'. Calls to pj_hash_calc_tolower() can use the PJ_HASH_USE_OWN_TOLOWER substitute algorithm when enabled. Calls to pj_hash_get_lower(), pj_hash_set_lower(), and pj_hash_set_np_lower() call find_entry() which never uses the PJ_HASH_USE_OWN_TOLOWER algorithm. As a result you may not be able to find a hash tabled entry because the calculated hash values would differ. * Simply disable PJ_HASH_USE_OWN_TOLOWER. ASTERISK-26490 #close Change-Id: If89bfdb5f301b8b685881a9a2a6e0c3c5af32253
2016-12-06pjproject_bundled: Fix missing inclusion of symbolsGeorge Joseph
Added back in a -g3, and an -O3 when DONT_OPTIMIZE is not set, to the CFLAGS. Not sure how they went missing. Also fixed an uninstall problem where we weren't removing the symlink from libasteriskpj.so.2 to libasteriskpj.so. While I was there, I fixed it for libasteriskssl as well. Change-Id: I9e00873b1e9082d05b5549d974534b48a2142556
2016-12-06Merge "res_pjsip_outbound_registration.c: Filter redundant statsd ↵Joshua Colp
reporting." into 13
2016-12-05Merge "Remove files that got merged in error somehow to the 13 branch." into 13Joshua Colp
2016-12-02Remove files that got merged in error somehow to the 13 branch.Richard Mudgett
Change-Id: Id79e2226c31084f9252d5aede9050d3cf13322c8
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 "tcptls: Use new certificate upon sip reload" into 13Joshua Colp
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-12-01Merge "res_calendar_caldav: Add support reading gmail calendar" into 13Joshua Colp
2016-12-01Merge "Frame deferral: Re-queue deferred frames one-at-a-time." into 13Joshua Colp
2016-12-01Merge "OpenSSL 1.1.0 support" 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-30Frame deferral: Re-queue deferred frames one-at-a-time.Mark Michelson
The recent change that made frame deferral into an API had a behavior change to it. When frame deferral was completed, we would take all of the deferred frames and queue them all onto the channel in one call to ast_queue_frame_head(). Before frame deferral was API-ized, places that performed manual frame deferral would actually take each deferred frame and queue them onto the channel. This change in behavior caused the confbridge_recording test to start failing consistently. Without going too crazily deep into the details, a channel was getting "stuck" in an ast_safe_sleep(). An AMI redirect was attempting to break it out of the sleep, but because there were more frames in the channel read queue than expected, the channel ended up being unable to break from its sleep loop. By restoring the behavior of individual frame queuing after deferral, the test starts passing again. Note, this points to a potential underlying issue pointing to an "unbalance" that can occur when queuing multiple frames at once, and so a follow-up issue is being created to investigate that possibility. Change-Id: Ied5dacacda06d343dea751ed5814a03364fe5a7d
2016-11-30Merge "chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no" ↵zuul
into 13
2016-11-30Merge "chan_sip: Fix segfault during module unload" into 13zuul
2016-11-30OpenSSL 1.1.0 supportTzafrir Cohen
OpenSSL 1.1.0 includes some major changes in the interface. See https://wiki.openssl.org/index.php/1.1_API_Changes . Status: Right now there are still a few deprecation notes with OpenSSL 1.1.0. But it's a start. Changes: * CRYPTO_LOCK is no longer available. Replace it with its value for now. I don't completely understand what it is used for there. * Remove several functions from libasteriskssl that seem to no longer be needed. * Structures have become opaque and are accesses with accessors. * ERR_remove_thread_state() no longer needed. * SSLv2 code now could no longer be used in 1.1. ASTERISK-26109 #close Change-Id: I5e29d477d486ca29b6aae0dc2f5dff960c1cb82b
2016-11-28res/res_pjsip: Fix documentation whitespace issuesMatt Jordan
Tabs > Spaces. Change-Id: If1e43a71822615a898e958e0f8b2e882606f0bd0
2016-11-28Merge "build_tools: Fix download_externals to handle certified branches" ↵Mark Michelson
into 13
2016-11-28Merge "autoconf: more variants for OSARCH linux-gnu" into 13zuul
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-28build_tools: Fix download_externals to handle certified branchesGeorge Joseph
download_externals wasn't handling the "certified/13.x" version correctly. Change-Id: I124d195bb117ca36fd7bf1150c630f3b474a9d9a
2016-11-28autoconf: more variants for OSARCH linux-gnuTzafrir Cohen
There are quite a few odd GNU/Linux platforms. Just call all of them linux-gnu. Specifically this fixes building the Debian platforms mips64el and x32. And maybe also others. ASTERISK-26546 #close Change-Id: I06ec4bd7f0ee1c84b6b24d81538223b07c4174b1
2016-11-28codec_dahdi: Fix poll.h include.Timo Teräs
POSIX defines poll.h. sys/poll.h should not be used as it is c-library internal header which may or may not exist. Notably in musl including sys/poll.h generates warning of being incorrect. Change-Id: Ib318c1c7142a737bcf3caa4d8d72560bebe39252
2016-11-26chan_sip: Fix segfault during module unloadMichael Kuron
If a TCP/TLS connection was pending (not accepted and not timed out) during unload of chan_sip, Asterisk would segfault when trying to send a signal to a thread whose thread ID hadn't been recorded yet. This commit fixes that by recording the thread ID before calling the blocking connect() syscall. This was a regression introduced by 776a14386a55b5425c7e9617eff8af8b45427144. The above wasn't enough to fix the segfault, which was now delayed to the point where connect() timed out. Therefore, it was necessary to also remove the SA_RESTART flag from the SIGURG sigaction so that pthread_kill() could be used to interruput the connect() syscall. This was a regression introduced by 5d313f51b982a18f7321adcf7c7a4e822d8b2714. ASTERISK-26586 #close Change-Id: I76fd9d47d56e4264e2629bce8ec15fecba673e7b
2016-11-23Merge "addons/chan_mobile: do not use strerror_r" into 13zuul
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-22tcptls: Use new certificate upon sip reloadMichael Kuron
Previously, a TLS server socket would only be restarted upon sip reload if the bind address had changed. This commit adds checking for changes to TLS parameters like certificate, ciphers, etc. so they get picked up without requiring a reload of the entire chan_sip module. This does not affect open connections in any way, but new connections will use the new TLS parameters. The changes also apply to HTTP and Manager. ASTERISK-26604 #close Change-Id: I169e86cefc6dcd627c915134015a6a1ab1aadbe6
2016-11-22addons/chan_mobile: do not use strerror_rTimo Teräs
The two reasons why it might be used are that some systems do not implement strerror in thread safe manner, and that strerror_r returns the error code in the string in case there's no error message. However, all of asterisk elsewhere uses strerror() and assumes it to be thread safe. And in chan_mobile the errno is also explicitly printed so neither of the above reasons are valid. The reasoning to remove usage is that there are actually two versions of strerror_r: XSI and GNU. They are incompatible in their return value, and there's no easy way to figure out which one is being used. glibc gives you the GNU version if _GNU_SOURCE is defined, but the same feature test macro is needed for other symbols. On all other systems you assumedly get XSI symbol, and compilation warnings as well as non-working error printing. Thus the easiest solution is to just remove strerror_r and use strerror as rest of the code. Alternative is to introduce ast_strerror in separate translation unit so it can request the XSI symbol in glibc case, and replace all usage of strerror. Change-Id: I84d35225b5642d85d48bc35fdf399afbae28a91d