- Oct 19, 2018
-
-
Corey Farrell authored
__ast_mutex_logger used the variable `canlog` without accepting it as a argument. Replace with internal macro `log_mutex_error` which takes canlog as the first arguement. This will prevent confusion when working with lock.c code, many of the function declare the canlog variable and in some cases it previously appeared to be unused. Change-Id: I83b372cb0654c5c18eadc512f65a57fa6c2e9853
-
- Oct 17, 2018
-
-
Corey Farrell authored
Add attribute_warn_unused_result to ast_taskprocessor_push, ast_taskprocessor_push_local and ast_threadpool_push. This will help ensure we perform the necessary cleanup upon failure. Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
-
- Oct 04, 2018
-
-
Corey Farrell authored
This has no effect on startup since AST_MODULE_LOAD_FAILURE aborts startup, but it's possible for this code to be returned on manual load of a module after startup. It is an error for a module to not have a load callback but this is not a fatal system error. In this case flag the module as declined, return AST_MODULE_LOAD_FAILURE only if a required module is broken. Expand doxygen documentation for AST_MODULE_LOAD_*. Change-Id: I3c030bb917f6e5a0dfd9d91491a4661b348cabf8
-
- Oct 02, 2018
-
-
Corey Farrell authored
* Display list of unavailable dependencies when they cause another module to fail loading. * When a module declines to load find all modules which depend on it so they can be declined and listed together. * Prevent retry of declined modules during startup. * When a module fails to dlopen try loading it with RTLD_LAZY so we can attempt to display the list of missing dependencies. These changes are meant to reduce logger spam that is caused when a module has many dependencies and declines to load. This also fixes some error paths which failed to recognize required modules. Module load/start errors are delayed until the end of loader startup. Change-Id: I046052c71331c556c09d39f47a3b92975f3e1758
-
- Sep 28, 2018
-
-
Corey Farrell authored
Add a volatile flag to lock tracking structures so we only need to use the global lock when first initializing tracking. Additionally add support for DEBUG_THREADS_LOOSE_ABI. This is used by astobj2.c to eliminate storage for tracking fields when DEBUG_THREADS is not defined. Change-Id: Iabd650908901843e9fff47ef1c539f0e1b8cb13b
-
- Sep 25, 2018
-
-
George Joseph authored
In order to do this and provide good feedback, a new macro was created (AST_EXT_LIB_EXTRA_CHECK) which does the normal check and path setups for the library then compiles, links and runs a supplied code fragment to do the final determination. In this case, the final code fragment compares UNBOUND_VERSION_MAJOR and UNBOUND_VERSION_MINOR to determine if they're greater than or equal to 1.5. Since we require version 1.5, some code in res_resolver_unbound was also simplified. ASTERISK-28045 Reported by: Samuel Galarneau Change-Id: Iee94ad543cd6f8b118df8c4c7afd9c4e2ca1fa72
-
- Sep 24, 2018
-
-
Corey Farrell authored
Use json_vsprintf from versions which contain fix for va_copy leak. Apply fixes from jansson master: * va_copy leak fix. * Avoid potential invalid memory read in json_pack. * Rename variable that shadowed another. Change-Id: I7522e462d2a52f53010ffa1e7d705c666ec35539
-
- Sep 21, 2018
-
-
Kevin Harwell authored
When writing an RTCP report to json the code attempts to pack the "ssrc" and "source_ssrc" unsigned integer values as a signed int value type. This of course means if the ssrc's unsigned value is greater than that which can fit into a signed integer value it gets converted to a negative number. Subsequently, the negative value goes out in the json report. This patch now packs the value as a json_int_t, which is the widest integer type available on a given system. This should make it so the value no longer overflows. Note, this was caught by two failing tests hep/rtcp-receiver/ and hep/rtcp-sender. Change-Id: I2af275286ee5e795b79f0c3d450d9e4b28e958b0
-
- Sep 20, 2018
-
-
George Joseph authored
There's been a long standing leak when using topic pools. The topics in the pool get cleaned up when the last pool reference is released but you can't remove a topic specifically. If you reloaded app_voicemail for instance, and mailboxes went away, their topics were left in the pool. * Added stasis_topic_pool_delete_topic() so modules can clean up topics from pools. * Registered the topic pool containers so it can be examined from the CLI when AO2_DEBUG is enabled. They'll be named "<topic_pool_name>-pool". Change-Id: Ib7957951ee5c9b9b4482af7b9b4349112d62bc25
-
- Sep 18, 2018
-
-
Joshua Colp authored
This change brings in PJSIP 2.8, removes all the patches that were merged upstream, and makes a minor change to support a breaking change that was done. ASTERISK-28059 Change-Id: I5097772b11b0f95c3c1f52df6400158666f0a189
-
- Sep 17, 2018
-
-
Sean Bright authored
Change-Id: Id2a916ff9448706090e72ff2c7fb3f5ba24a05df
-
- Sep 14, 2018
-
-
Sean Bright authored
Both pjsip_tx_data.tp_info.dst_name and pjsip_rx_data.pkt_info.src_name store IPv6 addresses without enclosing brackets. This causes some log output to be confusing because it is difficult to separate the IPv6 address from a port specification. * Use pj_sockaddr_print() along with pjsip_tx_data.tp_info.dst_addr and pjsip_rx_data.pkt_info.src_addr where possible for consistent IPv6 output. * When a pj_sockaddr is not available, explicitly wrap IPv6 addresses in brackets. * When assigning pjsip_rx_data.pkt_info.src_name ourselves, make sure to also set pjsip_rx_data.pkt_info.src_addr. Change-Id: I5cfe997ced7883862a12b9c7d8551d76ae02fcf8
-
- Sep 06, 2018
-
-
Sean Bright authored
Currently, to convert from a pj_sockaddr to an ast_sockaddr, the address needs to be rendered to a string and then parsed into the correct structure. This also involves a call to getaddrinfo(3). The same is true for the inverse operation. Instead, because we know the internal structure of both ast_sockaddr and pj_sockaddr, we can translate directly between the two without the need for an intermediate string. Change-Id: If0fc4bba9643f755604c6ffbb0d7cc46020bc761
-
- Aug 07, 2018
-
-
Richard Mudgett authored
Change-Id: I9cf97bdc756012d1f552ab007f4aa85e0ddb4e62
-
- Aug 06, 2018
-
-
Joshua Colp authored
When the stasis cache is used a hash is calculated for retrieving or inserting messages. This change calculates a hash when the message type is initialized that is then used each time needed. This ensures that the hash is calculated only once for the message type. Change-Id: I4fe6bfdafb55bf5c322dd313fbd8c32cce73ef37
-
- Aug 03, 2018
-
-
Richard Mudgett authored
* Don't include pjlib.h twice in res_pjsip.h * Consistently use #include <> form for pjproject includes. (pjsip.h and pjlib.h) Change-Id: I3f7b42044840de64edf7e9d7695cb60c45990dc7
-
- Aug 01, 2018
-
-
Corey Farrell authored
Changing any Menuselect option in the `Compiler Flags` section causes a full rebuild of the Asterisk source tree. Every enabled option causes a #define to be added to buildopts.h, thus breaking ccache caching for every source file that includes "asterisk.h". In most cases each option only applies to one or two files. Now we only define those options for the specific sources which use them, this causes much better cache matching when working with multiple builds. For example testing code with an without MALLOC_DEBUG will now use just over half the ccache size, only main/astmm.o will have two builds cached instead of every file. Reorder main/Makefile so _ASTCFLAGS set on specific object files are all together, sorted by filename. Stop adding -DMALLOC_DEBUG to CFLAGS of bundled pjproject, this define is no longer used by any header so only serves to break cache. The only code change is a slight adjustment to how main/astmm.c is initialized. Initialization functions always exist so main/asterisk.c can call them unconditionally. Additionally rename the astmm initialization functions so they are not exported. Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
-
- Jul 28, 2018
-
-
Alexander Traud authored
In Solaris, the header <jansson.h> is in /usr/include/jansson. To find Jansson even in such a subdirectory, the tool pkg-config is queried via AST_PKG_CONFIG_CHECK. For those platforms, which do not list Jansson via pkg-config, the previous check remains and is executed thereafter. Because the check for the NetBSD Editline library uses the tool pkg-config the code of PKG_PROG_PKG_CONFIG must be used. Because that check happens earlier than Jansson, it must be placed in front of that. ASTERISK-27991 Change-Id: I69ea0f379f87a50049654b2487c76ee1c04fa53a
-
- Jul 25, 2018
-
-
Joshua Colp authored
When publishing a device state the change can be marked as being cachable or not. If it is not cached the change is just published to all interested and not stored away for later query. This was not fully taken into account when publishing in stasis. The act of publishing would create a topic for the device even if it may be ephemeral. This change makes it so messages which are not cached won't create a topic for the device. If a topic does already exist it will be published to but otherwise the change will only be published to the device state all topic. ASTERISK-27591 Change-Id: I18da0e8cbb18e79602e731020c46ba4101e59f0a
-
- Jul 23, 2018
-
-
George Joseph authored
The "xmldoc dump" cli command was simply concatenating xml documents into the output file. The resulting file had multiple "xml" processing instructions and multiple root elements which is illegal. Normally this isn't an issue because Asterisk has only 1 main xml documentation file but codec_opus has its own file so if it's downloaded and you do "xmldoc dump", the result is invalid. * Added 2 new functions to xml.c: ast_xml_copy_node_list creates a copy of a list of children. ast_xml_add_child_list adds a list to an existing list. * Modified handle_dump_docs to create a new output document and add to it the children from each input file. It then dumps the new document to the output file. Change-Id: I3f182d38c75776aee76413dadd2d489d54a85c07
-
- Jul 22, 2018
-
-
Joshua Colp authored
In the past there was an assertion in the ast_sched_del function and in order to ensure it was useful the calling function name, line number, and filename had to be passed in. This cause the ABI to be different between dev mode and non-dev mode. This assertion is no longer present so the special logic can be removed to make it the same between them both. Change-Id: Icbc69c801e357d7004efc5cf2ab936d9b83b6ab8
-
- Jul 20, 2018
-
-
Corey Farrell authored
Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd
-
- Jul 18, 2018
-
-
Ben Ford authored
Support has been added for receiving a NACK request and handling it. Now, Asterisk can detect when a NACK request should be sent and knows how to construct one based on the packets we've received from the remote end. A buffer has been added that will store out of order packets until we receive the packet we are expecting. Then, these packets are handled like normal and frames are queued to the core like normal. Asterisk knows which packets to request in the NACK request using a vector which stores the sequence numbers of the packets we are currently missing. If a missing packet is received, cycle through the buffer until we reach another packet we have not received yet. If the buffer reaches a certain size, send a NACK request. If the buffer reaches its max size, queue all frames to the core and wipe the buffer and vector. According to RFC3711, the NACK request must be sent out in a compound packet. All compound packets must start with a sender or receiver report, so some work was done to refactor the current sender / receiver code to allow it to be used without having to also include sdes information and automatically send the report. Also added additional functionality to ast_data_buffer, along with some testing. For more information, refer to the wiki page: https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements ASTERISK-27810 #close Change-Id: Idab644b08a1593659c92cda64132ccc203fe991d
-
- Jul 16, 2018
-
-
Corey Farrell authored
* Merge the preload and load stages, use load ordering to try preload's first. This fixes an issue where `preload=res_config_curl` would fail unless res_curl and func_curl were also preloaded. Now it is only required that those modules be loaded during startup: autoload or regular load is good enough. * The configuration option `require` and `preload-require` were only effective if the modules failed to load. These options will now abort Asterisk startup if required modules fail to reach the 'Running' state. * Missing or invalid 'module.conf' did not prevent startup. Asterisk doesn't do anything without modules so this a fatal error. Change-Id: Ie4176699133f0e3a823b43f90c3348677e43a5f3
-
- Jul 13, 2018
-
-
Torrey Searle authored
Keep track if ICE candidates were in the SDP offer & only put them in the corresponding SDP answer if the offer condaind ICE candidates ASTERISK-27957 #close Change-Id: Idf2597ee48e9a287e07aa4030bfa705430a13a92
-
- Jul 06, 2018
-
-
George Joseph authored
A new option 'suppress_q850_reason_headers' has been added to the endpoint object. Some devices can't accept multiple Reason headers and get confused when both 'SIP' and 'Q.850' Reason headers are received. This option allows the 'Q.850' Reason header to be suppressed. The default value is 'no'. ASTERISK-27949 Reported-by: Ross Beer Change-Id: I54cf37a827d77de2079256bb3de7e90fa5e1deb1
-
- Jun 28, 2018
-
-
Richard Mudgett authored
The AMI action was directly sending the text to the channel driver. However, this makes two threads attempt to handle media and runs afowl of CHECK_BLOCKING. * Queue a read action to make the channel's media handling thread actually send the text message. This changes the AMI actions success/fail response to just mean the text was queued to be sent not that the text actually got sent. The channel driver may not even support sending text messages. ASTERISK-27943 Change-Id: I9dce343d8fa634ba5a416a1326d8a6340f98c379
-
- Jun 26, 2018
-
-
George Joseph authored
pjproject by default currently will follow media forked during an INVITE on outbound calls if the To tag is different on a subsequent response as that on an earlier response. We handle this correctly. There have been reported cases where the To tag is the same but we still need to follow the media. The pjproject patch in this commit adds the capability to sip_inv and also adds the capability to control it at runtime. The original "different tag" behavior was always controllable at runtime but we never did anything with it and left it to default to TRUE. So, along with the pjproject patch, this commit adds options to both the system and endpoint objects to control the two behaviors, and a small logic change to session_inv_on_media_update in res_pjsip_session to control the behavior at the endpoint level. The default behavior for "different tags" remains the same at TRUE and the default for "same tag" is FALSE. Change-Id: I64d071942b79adb2f0a4e13137389b19404fe3d6 ASTERISK-27936 Reported-by: Ross Beer
-
- Jun 23, 2018
-
-
Alexander Traud authored
ASTERISK-27933 Reported by: bautsche Change-Id: I9b8362824efbfb2a16981e46e85f7c8322908c49
-
- Jun 19, 2018
-
-
Richard Mudgett authored
* Removed an unnecessary call to ast_channel_blocker_set() in __ast_read(). ASTERISK-27625 Change-Id: I342168b999984666fb869cd519fe779583a73834
-
Richard Mudgett authored
There can be one and only one thread handling a channel's media at a time. Otherwise, we don't know which thread is going to handle the media frames. ASTERISK-27625 Change-Id: I4d6a2fe7386ea447ee199003bf8ad681cb30454e
-
Richard Mudgett authored
There can be one and only one thread handling a channel's media at a time. Otherwise, we don't know which thread is going to handle the media frames. ASTERISK-27625 Change-Id: Ia341f1a6f4d54f2022261abec9021fe5b2eb4905
-
Richard Mudgett authored
The CHECK_BLOCKING() macro is used to indicate if a channel's handling thread is about to do a blocking operation (poll, read, or write) of media. A few operations such as ast_queue_frame(), soft hangup, and masquerades use the indication to wake up the blocked thread to reevaluate what is going on. ASTERISK-27625 Change-Id: I4dfc33e01e60627d962efa29d0a4244cf151a84d
-
Richard Mudgett authored
Executing dialplan functions from either AMI or ARI by getting a variable could place the channel into autoservice. However, these user interface threads do not handle the channel's media so we wind up with two threads attempting to handle the media. There can be one and only one thread handling a channel's media at a time. Otherwise, we don't know which thread is going to handle the media frames. ASTERISK-27625 Change-Id: If2dc94ce15ddabf923ed1e2a65ea0ef56e013e49
-
Richard Mudgett authored
Change-Id: I9a784a7c804120a8fa826c2a4cb9957e4b0b2fc8
-
- Jun 18, 2018
-
-
Richard Mudgett authored
It is invalid to typedef something more than once. Though not all gcc compilers on different OS's complain about it. Change-Id: I5a7d4565990c985822d61ce75bde0b45f9870540
-
- Jun 08, 2018
-
-
Alexander Traud authored
Furthermore, allow OpenSSL configured with no-dh. Additionally, this change allows auto-negotiation of the elliptic curve/group for servers, not only with OpenSSL 1.0.2 but also with OpenSSL 1.1.0 and newer. This enables X25519 (since OpenSSL 1.1.0) and X448 (since OpenSSL 1.1.1) as a side-effect. ASTERISK-27910 Change-Id: I5b0dd47c5194ee17f830f869d629d7ef212cf537
-
- May 28, 2018
-
-
Alexander Traud authored
asterisk/tcptls.h was included (explicitly, implicitly, or transitively). Those inclusions got replaced by forward declarations. As side effect, the inclusions got completed. ASTERISK-27878 Change-Id: I9d102728e30336d6522e5e4ae9e964013a0835f7
-
- May 23, 2018
-
-
Joshua Colp authored
When RTP was originally created it had the ability to place a single extension in an RTP packet. In practice people wanted to potentially put multiple extensions in one and so RFC 5285 (obsoleted by RFC 8285) came into existence. This allows RTP extensions to be negotiated with a unique identifier to be used in the RTP packet, allowing multiple extensions to be present in the packet. This change extends the RTP engine API to add support for this. A user of it can enable extensions and the API provides the ability to retrieve the information (to construct SDP for example) and to provide negotiated information (from SDP). The end result is that the RTP engine can then query to see if the extension has been negotiated and what unique identifier is to be used. It is then up to the RTP engine implementation to construct the packet appropriately. The first extension to use this support is abs-send-time which is defined in the REMB draft[1] and is a second timestamp placed in an RTP packet which is for when the packet has left the sending system. It is used to more accurately determine the available bandwidth. ASTERISK-27831 [1] https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03 Change-Id: I508deac557867b1e27fc7339be890c8018171588
-
- May 21, 2018
-
-
Matthew Fredrickson authored
This function originally was used in chan_sip to enable some simplifying assumptions and eventually was copy and pasted into res_pjsip_logger and res_hep. Since it's replicated in three places, it's probably best to move it into the public netsock2 API for these modules to use. Change-Id: Id52e23be885601c51d70259f62de1a5e59d38d04
-