2022-04-26 16:32 +0000 Asterisk Development Team * asterisk 18.11.3 Released. 2022-04-21 10:26 +0000 [3911ab9038] Ben Ford * res_pjsip_stir_shaken.c: Fix enabled when not configured. There was an issue with the conditional where STIR/SHAKEN would be enabled even when not configured. It has been changed to ensure that if a profile does not exist and stir_shaken is not set in pjsip.conf, then the conditional will return from the function without performing STIR/SHAKEN operations. ASTERISK-30024 Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6 2022-04-14 21:53 +0000 Asterisk Development Team * asterisk 18.11.2 Released. 2022-04-14 16:37 +0000 [94eac3c13c] Asterisk Development Team * Doing a fresh summary 2022-04-14 16:00 +0000 [3ca29c9554] Asterisk Development Team * Update for 18.11.2 2022-04-14 15:47 +0000 [1422d098e7] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.11.2 2022-02-28 11:19 +0000 [353142a2b4] Ben Ford * AST-2022-002 - res_stir_shaken/curl: Add ACL checks for Identity header. Adds a new configuration option, stir_shaken_profile, in pjsip.conf that can be specified on a per endpoint basis. This option will reference a stir_shaken_profile that can be configured in stir_shaken.conf. The type of this option must be 'profile'. The stir_shaken option can be specified on this object with the same values as before (attest, verify, on), but it cannot be off since having the profile itself implies wanting STIR/SHAKEN support. You can also specify an ACL from acl.conf (along with permit and deny lines in the object itself) that will be used to limit what interfaces Asterisk will attempt to retrieve information from when reading the Identity header. ASTERISK-29476 Change-Id: I87fa61f78a9ea0cd42530691a30da3c781842406 2022-01-07 08:50 +0000 [1fdb1a6edf] Ben Ford * AST-2022-001 - res_stir_shaken/curl: Limit file size and check start. Put checks in place to limit how much we will actually download, as well as a check for the data we receive at the start to ensure it begins with what we would expect a certificate to begin with. ASTERISK-29872 Change-Id: Ifd3c6b8bd52b8b6192a04166ccce4fc8a8000b46 2022-02-10 06:02 +0000 [88522c22aa] Joshua C. Colp * func_odbc: Add SQL_ESC_BACKSLASHES dialplan function. Some databases depending on their configuration using backslashes for escaping. When combined with the use of ' this can result in a broken func_odbc query. This change adds a SQL_ESC_BACKSLASHES dialplan function which can be used to escape the backslashes. This is done as a dialplan function instead of being always done as some databases do not require this, and always doing it would result in incorrect data being put into the database. ASTERISK-29838 Change-Id: I152bf34899b96ddb09cca3e767254d8d78f0c83d 2022-03-29 21:46 +0000 Asterisk Development Team * asterisk 18.11.1 Released. 2022-03-25 09:33 +0000 [663b565647] George Joseph * make_xml_documentation: Remove usage of get_sourceable_makeopts get_sourceable_makeopts wasn't handling variables with embedded double quotes in them very well. One example was the DOWNLOAD variable when curl was being used instead of wget. Rather than trying to fix get_sourceable_makeopts, it's just been removed. ASTERISK-29986 Reported by: Stefan Ruijsenaars Change-Id: Idf2a90902228c2558daa5be7a4f8327556099cd2 2022-03-25 14:00 +0000 [99fa792482] George Joseph * Makefile: Disable XML doc validation make_xml_documentation was being called with the --validate flag set when it shouldn't have been. This was causing build failures if neither xmllint nor xmlstarlet were installed. The correct behavior is to simply print a message that either one of those tools should be installed for validation and continue with the build. ASTERISK-29988 Change-Id: Idc6c44114e7dd3fadae183a4e22f4fdba0b8a645 2022-03-24 13:12 +0000 Asterisk Development Team * asterisk 18.11.0 Released. 2022-03-17 15:40 +0000 Asterisk Development Team * asterisk 18.11.0-rc1 Released. 2022-03-17 10:23 +0000 [5dd61a6e16] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.11.0 2022-03-17 09:19 +0000 [81de525c6e] Ben Ford * AMI: Bump version for 18.11.0. Change-Id: Ic15cfca9e68efd06a1b12ab2335d52a5890e7170 2022-02-18 03:19 +0000 [5b653b8a7b] Boris P. Korzun * res_config_pgsql: Add text-type column check in require_pgsql() Omit "unsupported column type 'text'" warning in logs while using text-type column in the PgSQL backend. ASTERISK-29924 #close Change-Id: I48061a7d469426859670db07f1ed8af1eb814712 2022-02-09 04:28 +0000 [3959d20ba5] Kfir Itzhak * app_queue: Add QueueWithdrawCaller AMI action This adds a new AMI action called QueueWithdrawCaller. This AMI action makes it possible to withdraw a caller from a queue, in a safe and a generic manner. This can be useful for retrieving a specific call and dispatching it to a specific extension. It works by signaling the caller to exit the queue application whenever it can. Therefore, it is not guaranteed that the call will leave the queue. ASTERISK-29909 #close Change-Id: Ic15aa238e23b2884abdcaadff2fda7679e29b7ec 2022-02-08 16:58 +0000 [8666455bd8] Alexei Gradinari * res_pjsip_pubsub: update RLS to reflect the changes to the lists This patch makes the Resource List Subscriptions (RLS) dynamic. The asterisk updates the current subscriptions to reflect the changes to the list on the subscriptions refresh. If list items are added, removed, updated or do not exist anymore, the asterisk regenerates the resource list. ASTERISK-29906 #close Change-Id: Icee8c00459a7aaa43c643d77ce6f16fb7ab037d3 2022-03-03 16:44 +0000 [9e74563a50] Kevin Harwell * AST-2022-006: pjproject - unconstrained malformed multipart SIP message ASTERISK-29945 #close Change-Id: Ic58957afc453195d53c2bd25c905df3d91d1abe6 2022-03-03 16:42 +0000 [742d265ff5] Kevin Harwell * AST-2022-005: pjproject - undefined behavior after freeing a dialog set ASTERISK-29945 #close Change-Id: Ia8ce6d82b115c82c1138747c72a0adcaa42b718c 2022-03-03 16:41 +0000 [fc160abb67] Kevin Harwell * AST-2022-004: pjproject - possible integer underflow on STUN message ASTERISK-29945 #close Change-Id: I721cd254e4f8aa6d3a97a37529cca53519694c54 2022-03-02 08:57 +0000 [b6e482becd] George Joseph * xml.c, config,c: Add stylesheets and variable list string parsing Added functions to open, close, and apply XML Stylesheets to XML documents. Although the presence of libxslt was already being checked by configure, it was only happening if xmldoc was enabled. Now it's checked regardless. Added ability to parse a string consisting of comma separated name/value pairs into an ast_variable list. The reverse of ast_variable_list_join(). Change-Id: I1e1d149be22165a1fb8e88e2903a36bba1a6cf2e 2022-03-01 10:58 +0000 [468441121d] George Joseph * xmldoc: Fix issue with xmlstarlet validation Added the missing xml-stylesheet and Xinclude namespace declarations in pjsip_config.xml and pjsip_manager.xml. Updated make_xml_documentation to show detailed errors when xmlstarlet is the validator. It's now run once with the '-q' option to suppress harmless/expected messages and if it actually fails, it's run again without '-q' but with '-e' to show the actual errors. Change-Id: I4bdc9d2ea6741e8d2e5eb82df60c68ccc59e1f5e 2022-02-20 14:16 +0000 [777326fa9e] George Joseph * core: Config and XML tweaks needed for geolocation Added: Replace a variable in a list: int ast_variable_list_replace_variable(struct ast_variable **head, struct ast_variable *old, struct ast_variable *new); Added test as well. Create a "name=value" string from a variable list: 'name1="val1",name2="val2"', etc. struct ast_str *ast_variable_list_join( const struct ast_variable *head, const char *item_separator, const char *name_value_separator, const char *quote_char, struct ast_str **str); Added test as well. Allow the name of an XML element to be changed. void ast_xml_set_name(struct ast_xml_node *node, const char *name); Change-Id: I330a5f63dc0c218e0d8dfc0745948d2812141ccb 2022-02-14 07:31 +0000 [a81e14d2da] George Joseph * Makefile: Allow XML documentation to exist outside source files Moved the xmldoc build logic from the top-level Makefile into its own script "make_xml_documentation" in the build_tools directory. Created a new utility script "get_sourceable_makeopts", also in the build_tools directory, that dumps the top-level "makeopts" file in a format that can be "sourced" from shell sscripts. This allows scripts to easily get the values of common make build variables such as the location of the GREP, SED, AWK, etc. utilities as well as the AST* and library *_LIB and *_INCLUDE variables. Besides moving logic out of the Makefile, some optimizations were done like removing "third-party" from the list of subdirectories to be searched for documentation and changing some assignments from "=" to ":=" so they're only evaluated once. The speed increase is noticeable. The makeopts.in file was updated to include the paths to REALPATH and DIRNAME. The ./conifgure script was setting them but makeopts.in wasn't including them. So... With this change, you can now place documentation in any"c" source file AND you can now place it in a separate XML file altogether. The following are examples of valid locations: res/res_pjsip.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_configuration.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_doc.xml A fully-formed XML file. The "configInfo", "manager", "managerEvent", etc. elements that would be in the "c" file DOCUMENTATION fragment should be wrapped in proper XML. Example for "somemodule.xml": ... It's the "appdocsxml.dtd" that tells make_xml_documentation that this is a documentation XML file and not some other XML file. It also allows many XML-capable editors to do formatting and validation. Other than the ".xml" suffix, the name of the file is not significant. As a start... This change also moves the documentation that was in res_pjsip.c to 2 new XML files in res/res_pjsip: pjsip_config.xml and pjsip_manager.xml. This cut the number of lines in res_pjsip.c in half. :) Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade 2022-02-17 10:26 +0000 [47106a09b0] George Joseph * build: Refactor the earlier "basebranch" commit Recap from earlier commit: If you have a development branch for a major project that will receive gerrit reviews it'll probably be named something like "development/16/newproject" or a work branch based on that "development" branch. That will necessitate setting "defaultbranch=development/16/newproject" in .gitreview. The make_version script uses that variable to construct the asterisk version however, which results in versions like "GIT-development/16/newproject-ee582a8c7b" which is probably not what you want. It also constructs the URLs for downloading external modules with that version, which will fail. Fast-forward: The earlier attempt at adding a "basebranch" variable to .gitreview didn't work out too well in practice because changes were made to .gitreview, which is a checked-in file. So, if you wanted to rebase your work branch on the base branch, rebase would attempt to overwrite your .gitreview with the one from the base branch and complain about a conflict. This is a slighltly different approach that adds three methods to determine the mainline branch: 1. --- MAINLINE_BRANCH from the environment If MAINLINE_BRANCH is already set in the environment, that will be used. This is primarily for the Jenkins jobs. 2. --- .develvars Instead of storing the basebranch in .gitreview, it can now be stored in a non-checked-in ".develvars" file and keyed by the current branch. So, if you were working on a branch named "new-feature-work" based on "development/16/new-feature" and wanted to push to that branch in Gerrit but wanted to pull the external modules for 16, you'd create the following .develvars file: [branch "new-feature-work"] mainline-branch = 16 The .gitreview file would still look like: [gerrit] defaultbranch=development/16/new-feature ...which would cause any reviews pushed from "new-feature-work" to go to the "development/16/new-feature" branch in Gerrit. The key is that the .develvars file is NEVER checked in (it's been added to .gitignore). 3. --- Well Known Development Branch If you're actually working in a branch named like "development//some-feature", the mainline branch will be parsed from it. 4. --- .gitreview If none of the earlier conditions exist, the .gitreview "defaultbranch" variable will be used just as before. Change-Id: I1cdeeaa0944bba3f2e01d7a2039559d0c266f8c9 2022-02-23 07:58 +0000 [3771074a45] Joshua C. Colp * jansson: Update bundled to 2.14 version. ASTERISK-29353 Change-Id: I4ea43eda1691565563a4c03ef37166952d211b2b 2022-01-09 07:32 +0000 [59b25e9d59] Naveen Albert * ami: Allow events to be globally disabled. The disabledevents setting has been added to the general section in manager.conf, which allows users to specify events that should be globally disabled and not sent to any AMI listeners. This allows for processing of these AMI events to end sooner and, for frequent AMI events such as Newexten which users may not have any need for, allows them to not be processed. Additionally, it also cleans up core debug as previously when debug was 3 or higher, the debug was constantly spammed by "Analyzing AMI event" messages along with a complete dump of the event contents (often for Newexten). ASTERISK-29853 #close Change-Id: Id42b9a3722a1f460d745cad1ebc47c537fd4f205 2022-01-06 07:57 +0000 [42525b0fe2] Naveen Albert * func_channel: Add lastcontext and lastexten. Adds the lastcontext and lastexten channel fields to allow users to access previous dialplan execution locations. ASTERISK-29840 #close Change-Id: Ib455fe300cc8e9a127686896ee2d0bd11e900307 2022-02-04 19:27 +0000 [7f123b3143] Naveen Albert * channel.c: Clean up debug level 1. Although there are 10 debugs levels, over time, many current debug calls have come to use inappropriately low debug levels. In particular, a select few debug calls (currently all debug 1) can result in thousands of debug messages per minute for a single call. This can adds a lot of noise to core debug which dilutes the value in having different debug levels in the first place, as these log messages are from the core internals are are better suited for higher debug levels. Some debugs levels are thus adjusted so that debug level 1 is not inappropriately overloaded with these extremely high-volume and general debug messages. ASTERISK-29897 #close Change-Id: I55a71598993552d3d64a401a35ee99474770d4b4 2022-02-17 13:47 +0000 [8631e00a41] Naveen Albert * configs, LICENSE: remove pbx.digium.com. pbx.digium.com no longer accepts IAX2 calls and there are no plans for it to come back. Accordingly, nonworking IAX2 URIs are removed from both the LICENSE file and the sample config. ASTERISK-29923 #close Change-Id: I257c54d4d812ed6b4bd4cbec2cd7ebe2b87b5bad 2022-02-04 19:11 +0000 [3499aea882] Naveen Albert * documentation: Add since tag to xmldocs DTD Adds the since tag to the documentation DTD so that individual applications, functions, etc. can now specify when they were added to Asterisk. This tag is added at the individual application, function, etc. level as opposed to at the module level because modules can expand over time as new functionality is added, and granularity only to the module level would generally not be useful. This enables the ability to more easily determine when new functionality was added to Asterisk, down to minor version as opposed to just by major version. This makes it easier for users to write more portable dialplan if desired to not use functionality that may not be widely available yet. ASTERISK-29896 #close Change-Id: Ibbb35c702d8038bdc3fd0a944fbfa69384cc15d5 2022-01-13 08:37 +0000 [63db7505f2] Naveen Albert * asterisk: Add macro for curl user agent. Currently, each module that uses libcurl duplicates the standard Asterisk curl user agent. This adds a global macro for the Asterisk user agent used for curl requests to eliminate this duplication. ASTERISK-29861 #close Change-Id: I9fc37935980384b4daf96ae54fa3c9adb962ed2d 2021-12-16 13:41 +0000 [74742cdb5e] Naveen Albert * res_stir_shaken: refactor utility function Refactors temp file utility function into file.c. ASTERISK-29809 #close Change-Id: Ife478708c8f2b127239cb73c1755ef18c0bf431b 2022-02-16 05:34 +0000 [2016b33139] Naveen Albert * app_voicemail: Emit warning if asking for nonexistent mailbox. Currently, if VoiceMailMain is called with a mailbox, if that mailbox doesn't exist, then the application silently falls back to prompting the user for the mailbox, as if no arguments were provided. However, if a specific mailbox is requested and it doesn't exist, then no warning at all is emitted. This fixes this behavior to now warn if a specifically requested mailbox could not be accessed, before falling back to prompting the user for the correct mailbox. ASTERISK-29920 #close Change-Id: Ib4093b88cd661a2cabc5d685777d4e2f0ebd20a4 2022-02-07 16:31 +0000 [1cc1fb54e7] Alexei Gradinari * res_pjsip_pubsub: fix Batched Notifications stop working If Subscription refresh occurred between when the batched notification was scheduled and the serialized notification was to be sent, then new schedule notification task would never be added. There are 2 threads: thread #1. ast_sip_subscription_notify is called, if notification_batch_interval then call schedule_notification. 1.1. The schedule_notification checks notify_sched_id > -1 not true, then send_scheduled_notify = 1 notify_sched_id = ast_sched_add(sched, sub_tree->notification_batch_interval, sched_cb.... 1.2. The sched_cb pushes task serialized_send_notify to serializer and returns 0 which means no reschedule. 1.3. The serialized_send_notify checks send_scheduled_notify if it's false the just returns. BUT notify_sched_id is still set, so no more ast_sched_add. thread #2. pubsub_on_rx_refresh is called 2.1 it pushes serialized_pubsub_on_refresh_timeout to serializer 2.2. The serialized_pubsub_on_refresh_timeout calls pubsub_on_refresh_timeout which calls send_notify 2.3. The send_notify set send_scheduled_notify = 0; The serialized_send_notify should always unset notify_sched_id. ASTERISK-29904 #close Change-Id: Ifc50c00b213c396509e10326a1ed89d8cf8c7875 2022-02-18 06:09 +0000 [26141981c5] Naveen Albert * func_db: Add validity check for key names when writing. Adds a simple sanity check for key names when users are writing data to AstDB. This captures four cases indicating malformed keynames that generally result in bad data going into the DB that the user didn't intend: an empty key name, a key name beginning or ending with a slash, and a key name containing two slashes in a row. Generally, this is the result of a variable being used in the key name being empty. If a malformed key name is detected, a warning is emitted to indicate the bug in the dialplan. ASTERISK-29925 #close Change-Id: Ifc08a9fe532a519b1b80caca1aafed7611d573bf 2022-02-01 09:59 +0000 [e2423c6f49] Alexei Gradinari * res_pjsip_pubsub: provide a display name for RLS subscriptions Whereas BLFs allow to show a display name for each RLS entry, the asterisk provides only the extension now. This is not end user friendly. This commit adds a new resource_list option, resource_display_name, to indicate whether display name of resource or the resource name being provided for RLS entries. If this option is enabled, the Display Name will be provided. This option is disabled by default to remain the previous behavior. If the 'event' set to 'presence' or 'dialog' the non-empty HINT name will be set as the Display Name. The 'message-summary' is not supported yet. ASTERISK-29891 #close Change-Id: Ic5306bd5a7c73d03f5477fe235e9b0f41c69c681 2022-01-13 19:37 +0000 [4358c776b8] Naveen Albert * cli: Add core dump info to core show settings. Adds two pieces of information to the core show settings command which are useful in the context of getting backtraces. The first is to display whether or not Asterisk would generate a core dump if it were to crash. The second is to show the current running directory of Asterisk. ASTERISK-29866 #close Change-Id: Ic42c0a9ecc233381aad274d86c62808d1ebb4d83 2022-02-04 19:46 +0000 [74e9b60bd0] Naveen Albert * documentation: Adds missing default attributes. The configObject tag contains a default attribute which allows the default value to be specified, if applicable. This allows for the default value to show up specially on the wiki in a way that is clear to users. There are a couple places in the tree where default values are included in the description as opposed to as attributes, which means these can't be parsed specially for the wiki. These are changed to use the attribute instead of being included in the text description. ASTERISK-29898 #close Change-Id: I9d7ea08f50075f41459ea7b76654906b674ec755 2022-02-05 06:39 +0000 [da801e2438] Naveen Albert * app_mp3: Document and warn about HTTPS incompatibility. mpg123 doesn't support HTTPS, but the MP3Player application doesn't document this or warn the user about this. HTTPS streams have become more common nowadays and users could reasonably try to play them without being aware they should use the HTTP stream instead. This adds documentation to note this limitation. It also throws a warning if users try to use the HTTPS stream to tell them to use the HTTP stream instead. ASTERISK-29900 #close Change-Id: Ie3b029be5258c5a701f71ed3b1a7a80d1e03b827 2022-01-22 16:52 +0000 [332eed3aa7] Naveen Albert * app_mf: Add max digits option to ReceiveMF. Adds an option to the ReceiveMF application to allow specifying a maximum number of digits. Originally, this capability was not added to ReceiveMF as it was with ReceiveSF because typically a ST digit is used to denote that sending of digits is complete. However, there are certain signaling protocols which simply transmit a digit (such as Expanded In-Band Signaling) and for these, it's necessary to be able to read a certain number of digits, as opposed to until receiving a ST digit. This capability is added as an option, as opposed to as a parameter, to remain compatible with existing usage (and not shift the parameters). ASTERISK-29877 #close Change-Id: I4229167c9aa69b87402c3c2a9065bd8dfa973a0b 2022-02-02 19:18 +0000 [9e71f7fe37] Mike Bradeen * taskprocessor.c: Prevent crash on graceful shutdown When tps_shutdown is called as part of the cleanup process there is a chance that one of the taskprocessors that references the tps_singletons object is still running. The change is to allow for tps_shutdown to check tps_singleton's container count and give the running taskprocessors a chance to finish. If after AST_TASKPROCESSOR_SHUTDOWN_MAX_WAIT (10) seconds there are still container references we shutdown anyway as this is most likely a bug due to a taskprocessor not being unreferenced. ASTERISK-29365 Change-Id: Ia932fc003d316389b9c4fd15ad6594458c9727f1 2022-01-21 13:00 +0000 [fcdeb3e5b7] Alexei Gradinari * app_queue: load queues and members from Realtime when needed There are a lot of Queue AMI actions and Queue applications which do not load queue and queue members from Realtime. AMI actions QueuePause - if queue not in memory - response "Interface not found". QueueStatus/QueueSummary - if queue not in memory - empty response. Applications: PauseQueueMember - if queue not in memory Attempt to pause interface %s, not found UnpauseQueueMember - if queue not in memory Attempt to unpause interface xxxxx, not found This patch adds a new function load_realtime_queues which loads queue and queue members for desired queue or all queues and all members if param 'queuename' is NULL or empty. Calls the function load_realtime_queues when needed. Also this patch fixes leak of ast_config in function set_member_value. Also this patch fixes incorrect LOG_WARNING when pausing/unpausing already paused/unpaused member. The function ast_update_realtime returns 0 when no record modified. So 0 is not an error to warn about. ASTERISK-29873 #close ASTERISK-18416 #close ASTERISK-27597 #close Change-Id: I554ee0eebde93bd8f49df7f84b74acb21edcb99c 2022-01-21 07:52 +0000 [6659e502a4] Mark Petersen * res_prometheus.c: missing module dependency added res_pjsip_outbound_registration to .requires in AST_MODULE_INFO which fixes issue with module crashes on load "FRACK!, Failed assertion" ASTERISK-29871 Change-Id: Ia0f49d048427a40e1b763296b834a52a03610096 2022-02-07 10:55 +0000 [acd6f30cc5] Sean Bright * manager.c: Simplify AMI ModuleCheck handling This code was needlessly complex and would fail to properly delimit the response message if LOW_MEMORY was defined. Change-Id: Iae50bf09ef4bc34f9dc4b49435daa76f8b2c5b6e 2022-02-03 15:48 +0000 [de0c29de55] Sean Bright * res_pjsip.c: Correct minor typos in 'realm' documentation. Change-Id: I886936b808def5540d40071321e72f6bfa19063a 2022-01-31 12:52 +0000 [118e034287] Sean Bright * manager.c: Generate valid XML if attribute names have leading digits. The XML Manager Event Interface (amxml) now generates attribute names that are compliant with the XML 1.1 specification. Previously, an attribute name that started with a digit would be rendered as-is, even though attribute names must not begin with a digit. We now prefix attribute names that start with a digit with an underscore ('_') to prevent XML validation failures. This is not backwards compatible but my assumption is that compliant XML parsers would already have been complaining about this. ASTERISK-29886 #close Change-Id: Icfaa56a131a082d803e9b7db5093806d455a0523 2022-02-03 12:25 +0000 Asterisk Development Team * asterisk 18.10.0-rc1 Released. 2022-02-03 06:12 +0000 [aa6a50630f] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.10.0 2022-02-01 10:09 +0000 [c51353e4db] Sean Bright * build_tools/make_version: Fix bashism in comparison. In POSIX sh (which we indicate in the shebang), there is no == operator. Change-Id: Ic03d38214d14cdf329b0ba272279a815bb532965 2022-01-21 14:08 +0000 [0d53ce35f9] George Joseph * bundled_pjproject: Add additional multipart search utils Added the following APIs: pjsip_multipart_find_part_by_header() pjsip_multipart_find_part_by_header_str() pjsip_multipart_find_part_by_cid_str() pjsip_multipart_find_part_by_cid_uri() Change-Id: I6aee3dcf59eb171f93aae0f0564ff907262ef40d 2022-01-07 04:01 +0000 [95ee1d06d6] Mark Petersen * chan_sip.c Fix pickup on channel that are in AST_STATE_DOWN resolve issue with pickup on device that uses "183" and not "180" ASTERISK-29832 Change-Id: I4c7d223870f8ce9a7354e0f73d4e4cb2e8b58841 2022-01-31 07:09 +0000 [2a34bb1e11] George Joseph * res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup In dev mode, if you call pjsip_auth_clt_deinit() with an auth_sess that hasn't been initialized, it'll assert and abort. If digest_create_request_with_auth() fails to find the proper auth object however, it jumps to its cleanup which does exactly that. So now we no longer attempt to call pjsip_auth_clt_deinit() if we never actually initialized it. ASTERISK-29888 Change-Id: Ib6171c25c9fe8e61cc8d11129e324c021bc30b62 2022-01-26 07:56 +0000 [135e48deba] George Joseph * build: Add "basebranch" to .gitreview If you have a development branch for a major project that will receive gerrit reviews it'll probably be named something like "development/16/newproject". That will necessitate setting "defaultbranch=development/16/newproject" in .gitreview. The make_version script uses that variable to construct the asterisk version however, which results in versions like "GIT-development/16/newproject-ee582a8c7b" which is probably not what you want. Worse, since the download_externals script uses make_version to construct the URL to download the binary codecs or DPMA. Since it's expecting a simple numeric version, the downloads will fail. To get this to work, a new variable "basebranch" has been added to .gitreview and make_version has been updated to use that instead of defaultversion: .gitreview: defaultbranch=development/16/myproject basebranch=16 Now git-review will send the reviews to the proper branch (development/16/myproject) but the version will still be constructed using the simple branch number (16). If "basebranch" is missing from .gitreview, make_version will fall back to using "defaultbranch". Change-Id: I2941a3b21e668febeb6cfbc1a7bb51a67726fcc4 2021-12-15 12:36 +0000 [6fc8453e96] Naveen Albert * cdr: allow disabling CDR by default on new channels Adds a new option, defaultenabled, to the CDR core to control whether or not CDR is enabled on a newly created channel. This allows CDR to be disabled by default on new channels and require the user to explicitly enable CDR if desired. Existing behavior remains unchanged. ASTERISK-29808 #close Change-Id: Ibb78c11974bda229bbb7004b64761980e0b2c6d1 2022-01-11 13:19 +0000 [a4b01ececb] Naveen Albert * res_tonedetect: Fixes some logic issues and typos Fixes some minor logic issues with the module: Previously, the OPT_END_FILTER flag was getting tested before options were parsed, so it could never evaluate to true (wrong ordering). Additionally, the initially parsed timeout (float) needs to be compared with 0, not the result int which is set afterwards (wrong variable). ASTERISK-29857 #close Change-Id: I0062bce3b391c15e5df7a714780eeaa96dd93d4c 2022-01-11 12:33 +0000 [5df5a70d37] Naveen Albert * func_frame_drop: Fix typo referencing wrong buffer In order to get around the issue of certain frames having names that could overlap, func_frame_drop surrounds names with commas for the purposes of comparison. The buffer is allocated and printed to properly, but the original buffer is used for comparison. In most cases, this wouldn't have had any effect, but that was not the intention behind the buffer. This updates the code to reference the modified buffer instead. ASTERISK-29854 #close Change-Id: I430b52e14e712d0e62a23aa3b5644fe958b684a7 2022-01-20 06:56 +0000 [9c9083b45a] Torrey Searle * res/res_rtp_asterisk: fix skip in rtp sequence numbers after dtmf When generating dtmfs, asterisk can incorrectly think packet loss occured during the dtmf generation, resulting in a jump in sequence numbers when forwarding voice frames resumes. This patch forces asterisk to re-learn the expected sequence number after each DTMF to avoid this ASTERISK-29869 #close Change-Id: Icc7de3d947b207b82c99d3c327af8095884df853 2022-01-13 16:31 +0000 [98f86697cc] Kevin Harwell * res_http_websocket: Add a client connection timeout Previously there was no way to specify a connection timeout when attempting to connect a websocket client to a server. This patch makes it possible to now do such. Change-Id: I5812f6f28d3d13adbc246517f87af177fa20ee9d 2022-01-21 10:34 +0000 [5b47b7a37e] Sean Bright * build: Rebuild configure and autoconfig.h.in autoconfigh.h.in was missed in the original review for this issue. Additionally it looks like I have newer pkg-config autoconf macros on my development machine. ASTERISK-29817 Change-Id: I3c85a4de82c5d7d6e0e23dad4c33bb650a86a57b 2021-12-08 15:14 +0000 [ac8988c9a3] Mike Bradeen * sched: fix and test a double deref on delete of an executing call back sched: Avoid a double deref when AST_SCHED_DEL_UNREF is called on an executing call-back. This is done by adding a new variable 'rescheduled' to the struct sched which is set in ast_sched_runq and checked in ast_sched_del_nonrunning. ast_sched_del_nonrunning is a replacement for now deprecated ast_sched_del which returns a new possible value -2 if called on an executing call-back with rescheduled set. ast_sched_del is modified to call ast_sched_del_nonrunning to maintain existing code. AST_SCHED_DEL_UNREF is also updated to look for the -2 in which case it will not throw a warning or invoke refcall. test_sched: Add a new unit test sched_test_freebird that will check the reference count in the resolved scenario. ASTERISK-29698 Change-Id: Icfb16b3acbc29cf5b4cef74183f7531caaefe21d 2022-01-19 16:33 +0000 [6e8bbe4b3a] Luke Escude * res_pjsip_sdp_rtp.c: Support keepalive for video streams. ASTERISK-28890 #close Change-Id: Iad269a8dc36f892ede90fe8ceb3010560c0f70d1 2022-01-04 03:11 +0000 [c8d89e7e1b] Mark Petersen * app_queue.c: Queue don't play "thank-you" when here is no hold time announcements if holdtime is (0 min, 0 sec) there is no hold time announcements we should then also not playing queue-thankyou ASTERISK-29831 Change-Id: Ic7e51dcde526b23f1cd8d24e1d1e2d81e10f9d2c 2021-11-10 22:24 +0000 [d68d90c5be] Michał Górny * main: Enable rdtsc support on NetBSD Enable the Linux rdtsc implementation on NetBSD as well. The assembly works correctly there. ASTERISK-29851 Change-Id: I460ad9b4d971913420ecb84186f5ba5ab03f6f37 2021-11-10 21:40 +0000 [90d02cf0a3] Michał Górny * build_tools/make_version: Fix sed(1) syntax compatibility with NetBSD Fix the sed(1) invocation used to process git-svn-id not to use "\s" that is a GNU-ism and is not supported by NetBSD sed. As a result, this call did not work properly and make_version did output the full git-svn-id line rather than the revision. ASTERISK-29852 Change-Id: Ie4b406e2748920643446851a0a252a4ca7245772 2021-11-10 22:29 +0000 [c8ef232d76] Michał Górny * main/utils: Implement ast_get_tid() for NetBSD Implement the ast_get_tid() function for NetBSD system. NetBSD supports getting the TID via _lwp_self(). ASTERISK-29850 Change-Id: If57fd3f9ea15ef5d010bfbdcbbbae9b379f72f8c 2021-11-10 20:05 +0000 [7b1e5fa34a] Michał Górny * BuildSystem: Fix misdetection of gethostbyname_r() on NetBSD Fix the configure script not to detect the presence of gethostbyname_r() on NetBSD incorrectly. NetBSD includes it as an internal libc symbol that is not exposed in system headers and that is incompatible with other implementations. In order to avoid misdetecting it, perform the symbol check only if the declaration is found in the public header first. ASTERISK-29817 Change-Id: Iafa359b09908251bcd299ff54be003ea129b9eda 2021-11-10 22:06 +0000 [eef29d24e1] Michał Górny * include: Remove unimplemented HMAC declarations Remove the HMAC declarations from the includes. They are not implemented nor used anywhere, and their presence breaks the build on NetBSD that delivers an incompatible hmac() function in . ASTERISK-29818 Change-Id: I0c4b88645e30174b1b63846a6b328625b69c2ea7 2022-01-11 12:41 +0000 [18c257b44d] Naveen Albert * frame.h: Fix spelling typo Fixes CNG description from "noice" to "noise". ASTERISK-29855 #close Change-Id: Ie7cbbd7d72b426693df7447384ff8700318cd36d 2022-01-11 12:46 +0000 [a9e9e15c3a] Naveen Albert * res_rtp_asterisk: Fix typo in flag test/set The code currently checks to see if an RFC3389 warning flag is set, except if it is, it merely sets the flag again, the logic of which doesn't make any sense. This adjusts the if comparison to check if the flag has NOT been set, and if so, emit a notice log event and set the flag so that future frames do not cause an event to be logged. ASTERISK-29856 #close Change-Id: Ib7098c947c63537d087a03b4646199fbb963f8e1 2022-01-18 08:04 +0000 [cc38ed9c21] George Joseph * bundled_pjproject: Fix srtp detection Reverted recent change that set '--with-external-srtp' instead of '--without-external-srtp'. Since Asterisk handles all SRTP, we don't need it enabled in pjproject at all. ASTERISK-29867 Change-Id: I2ce1bdd30abd21c062eac8f8fefe9b898787b801 2022-01-10 07:44 +0000 [f55886a72c] George Joseph * res_pjsip: Make message_filter and session multipart aware Neither pjsip_message_filter's filter_on_tx_message() nor res_pjsip_session's session_outgoing_nat_hook() were multipart aware and just assumed that an SDP would be the only thing in a message body. Both were changed to use the new pjsip_get_sdp_info() function which searches for an sdp in both single- and multi- part message bodies. ASTERISK-29813 Change-Id: I8f5b8cfdc27f1d4bd3e7491ea9090951a4525c56 2022-01-06 13:05 +0000 [59cf9f0047] George Joseph * res_pjsip: Add utils for checking media types Added two new functions to assist checking media types... * ast_sip_are_media_types_equal compares two pjsip_media_types. * ast_sip_is_media_type_in tests if one media type is in a list of others. Added static definitions for commonly used media types to res_pjsip.h. Changed several modules to use the new functions and static definitions. ASTERISK_29813 (not ready to close) Change-Id: Ief77675235bd3bf00a6b095d4673fd878d0801b9 2022-01-12 11:12 +0000 [b59bd3d3e4] George Joseph * build: Fix issues building pjproject The change to allow easier hacking on bundled pjproject created a few issues: * The new Makefile was trying to run the bundled make even if PJPROJECT_BUNDLED=no. third-party/Makefile now checks for PJPROJECT_BUNDLED and JANSSON_BUNDLED and skips them if they are "no". * When building with bundled, config_site.h was being copied only if a full make or a "make main" was done. A "make res" would fail all the pjsip modules because they couldn't find config_site.h. The Makefile now copies config_site.h and asterisk_malloc_debug.h into the pjproject source tree when it's "configure" is performed. This is how it used to be before the big change. ASTERISK-29858 Change-Id: I9427264fa3cb8b3f59a95e5f9693eac236a6f76d 2022-01-12 07:16 +0000 [f10947ecc2] George Joseph * bundled_pjproject: Create generic pjsip_hdr_find functions pjsip_msg_find_hdr(), pjsip_msg_find_hdr_by_name(), and pjsip_msg_find_hdr_by_names() require a pjsip_msg to be passed in so if you need to search a header list that's not in a pjsip_msg, you have to do it yourself. This commit adds generic versions of those 3 functions that take in the actual header list head instead of a pjsip_msg so if you need to search a list of headers in something like a pjsip_multipart_part, you can do so easily. Change-Id: I6f2c127170eafda48e5e0d5d4d187bcd52b4df07 2022-01-12 13:20 +0000 [3fd47840c9] Sean Bright * say.c: Prevent erroneous failures with 'say' family of functions. A regression was introduced in ASTERISK~29531 that caused 'say' functions to fail with file lists that would previously have succeeded. This caused affected channels to hang up where previously they would have continued. We now explicitly check for the empty string to restore the previous behavior. ASTERISK-29859 #close Change-Id: Ia2e5769868e2792313c2d7c07996efe009c6f8d5 2022-01-08 09:09 +0000 [e006d2d2a6] Naveen Albert * pbx_variables: add missing ASTSBINDIR variable Every config variable in the directories section of asterisk.conf currently has a counterpart built-in variable containing the value of the config option, except for the last one, astsbindir, which should have an ASTSBINDIR variable. However, the actual corresponding ASTSBINDIR variable is missing in pbx_variables.c. This adds the missing variable so that all the config options have their corresponding variable. ASTERISK-29847 #close Change-Id: I36006faf471825b36ebc8aa5e87a3bcb38d446fc 2022-01-08 14:35 +0000 [707f32170c] Naveen Albert * documentation: Document built-in system and channel vars Documentation for built-in special system and channel vars is currently outdated, and updating is a manual process since there is no XML documentation for these anywhere. This adds documentation for system vars to func_env and for channel vars to func_channel so that they appear along with the corresponding fields that would be accessed using a function. ASTERISK-29848 #close Change-Id: I6997f925c4a45fffe71321861f5898a8b7182fa9 2021-11-30 16:35 +0000 [3f093b8dda] George Joseph * bundled_pjproject: Make it easier to hack There are times when you need to troubleshoot issues with bundled pjproject or add new features that need to be pushed upstream but... * The source directory created by extracting the pjproject tarball is not scanned for code changes so you have to keep forcing rebuilds. * The source directory isn't a git repo so you can't easily create patches, do git bisects, etc. * Accidentally doing a make distclean will ruin your day by wiping out the source directory, and your changes. * etc. This commit makes that easier. See third-party/pjproject/README-hacking.md for the details. ASTERISK-29824 Change-Id: Idb1251040affdab31d27cd272dda68676da9b268 2021-12-24 10:26 +0000 [0bbef4d8c5] Sean Bright * utils.c: Remove all usages of ast_gethostbyname() gethostbyname() and gethostbyname_r() are deprecated in favor of getaddrinfo() which we use in the ast_sockaddr family of functions. ASTERISK-29819 #close Change-Id: Ie277c0ef768d753b169c121ef570a71665692ab7 2021-12-13 09:53 +0000 [54f2f1e027] Naveen Albert * say.conf: fix 12pm noon logic Fixes 12pm noon incorrectly returning 0/a.m. Also fixes a misspelling typo in the config. ASTERISK-29695 #close Change-Id: Ie40f9618636eb4c483b449bd707a5dcffca5c406 2022-01-04 08:08 +0000 [ee69441fbd] Sean Bright * pjproject: Fix incorrect unescaping of tokens during parsing ASTERISK-29664 #close Change-Id: I29dcde52e9faeaf2609c604eada61c6a9e49d8f5 2021-12-30 07:02 +0000 [dea71ddbbf] Mark Petersen * app_queue.c: Support for Nordic syntax in announcements adding support for playing the correct en/et for nordic languages by adding 'n' for neuter gender in the relevant ast_say_number ASTERISK-29827 Change-Id: I03ebc827d2f0dc95132ab2f42799893c70edc5b1 2021-12-23 08:50 +0000 [6d7161820e] Naveen Albert * dsp: Add define macro for DTMF_MATRIX_SIZE Adds the macro DTMF_MATRIX_SIZE to replace the magic number 4 sprinkled throughout dsp.c. ASTERISK-29815 #close Change-Id: Ie3bddb92c6b16204ece0f758009e9490eb33b9ba 2022-01-03 11:10 +0000 [f133ae6ca2] Naveen Albert * ami: Add AMI event for Wink Adds an AMI event for a wink frame. ASTERISK-29830 #close Change-Id: I83e426de5e37baed79a4dbcc91e9e8d030ef1b56 2021-12-15 08:23 +0000 [1c2f311ba3] Naveen Albert * cli: Add module refresh command Adds a command to the CLI to unload and then load a module. This makes it easier to perform these operations which are often done subsequently to load a new version of a module. "module reload" already refers to reloading of configuration, so the name "refresh" is chosen instead. ASTERISK-29807 #close Change-Id: I595f6f11774a0de2565a1fba38da22309ce93a2c 2022-01-02 19:13 +0000 [775c371d09] Naveen Albert * app_mp3: Throw warning on nonexistent stream Currently, the MP3Player application doesn't emit a warning if attempting to play a stream which no longer exists. This can be a common scenario as many mp3 streams are valid at some point but can disappear at any time. Now a warning is thrown if attempting to play a nonexistent MP3 stream, instead of silently exiting. ASTERISK-29829 #close Change-Id: I53a0bf1ed1740166655eb66fe7675f6f808bf535 2021-12-13 08:29 +0000 [b37feb42ae] Naveen Albert * documentation: Add missing AMI documentation Adds missing documentation for some channel, bridge, and queue events. ASTERISK-24427 ASTERISK-29515 Change-Id: I92b06b88c8cadc0155f95ebe3e870b3e795a8c64 2021-11-15 16:13 +0000 [06f9227ac5] Kevin Harwell * tcptls.c: refactor client connection to be more robust The current TCP client connect code, blocks and does not handle EINTR error case. This patch makes the client socket non-blocking while connecting, ensures a connect does not immediately fail due to EINTR "errors", and adds a connect timeout option. The original client start call sets the new timeout option to "infinite", thus making sure old, orginal behavior is retained. ASTERISK-29746 #close Change-Id: I907571843a83e43c0742b95a64785f4411f02671 2021-12-13 10:59 +0000 [dd6df42534] Naveen Albert * app_sf: Add full tech-agnostic SF support Adds tech-agnostic support for SF signaling by adding SF sender and receiver applications as well as Dial integration. ASTERISK-29802 #close Change-Id: I7ec50752e9a661af639425e5d1e339f17411bcad 2021-12-15 06:23 +0000 [16a63027c0] Steve Davies * app_queue: Fix hint updates, allow dup. hints A previous patch for ASTERISK_29578 caused a 'leak' of extension state information across queues, causing the state of the first member of unrelated queues to be updated in addition to the correct member. Which queues and members depended on the order of queues in the iterator. Additionally, it is possible to use the same 'hint:' on multiple queue members, so the update cannot break out of the update loop early when a match is found. ASTERISK-29806 #close Change-Id: If2c1d1cc2a752afd9286d79710fc818596e7a7ad 2021-12-23 15:57 +0000 [4fe94bab09] Sean Bright * say.c: Honor requests for DTMF interruption. SayAlpha, SayAlphaCase, SayDigits, SayMoney, SayNumber, SayOrdinal, and SayPhonetic all claim to allow DTMF interruption if the SAY_DTMF_INTERRUPT channel variable is set to a truthy value, but we are failing to break out of a given 'say' application if DTMF actually occurs. ASTERISK-29816 #close Change-Id: I6a96e0130560831d2cb45164919862b9bcb6287e 2021-11-16 06:32 +0000 [4e204db2bf] Florentin Mayer * res_pjsip_sdp_rtp: Preserve order of RTP codecs The ast_rtp_codecs_payloads functions do not preserve the order in which the payloads were specified on an incoming SDP media line. This leads to a problem with the codec negotiation functionality, as the format capabilities of the stream are extracted from the ast_rtp_codecs. This commit moves the ast_rtp_codec to ast_format conversion to the place where the order is still known. ASTERISK-28863 ASTERISK-29320 Change-Id: I3aabcfed3f379c36654f59c1872c313d0cb57e25 2021-12-27 07:28 +0000 [d83a46869e] Joshua C. Colp * bridge: Unlock channel during Local peer check. It's not safe to keep the channel locked while locking the peer Local channel, as it can result in a deadlock. This change unlocks it during this time but keeps the bridge locked to ensure nothing changes about the bridge. ASTERISK-29821 Change-Id: Ib68eb7037e5a479bcc2aceee77337cdde1fbdde6 2021-11-07 09:32 +0000 [a5cdee36a7] Josh Soref * test_time.c: Tolerate DST transitions When test_timezone_watch runs very near a DST transition, two time zones that would otherwise be expected to report the same time can differ because of the DST transition. Instead of having the test fail when this happens, report the times, time zones, and dst flags. ASTERISK-29722 Change-Id: Id59bdac8b277e14343ccdf0c99b89e92f79f316a 2021-12-14 11:39 +0000 [0cf4e325aa] George Joseph * bundled_pjproject: Add more support for multipart bodies Adding upstream patch for pull request... https://github.com/pjsip/pjproject/pull/2920 --------------------------------------------------------------- sip_inv: Additional multipart support (#2919) sip_inv.c:inv_check_sdp_in_incoming_msg() deals with multipart message bodies in rdata correctly. In the case where early media is involved though, the existing sdp has to be retrieved from the last tdata sent in this transaction. This, however, always assumes that the sdp sent is in a non-multipart body. While there's a function to retrieve the sdp from multipart and non-multpart rdata bodies, no similar function for tdata exists. So... * The existing pjsip_rdata_get_sdp_info2 was refactored to find the sdp in any body, multipart or non-multipart, and from either an rdata or tdata. The new function is pjsip_get_sdp_info. This new function detects whether the pjsip_msg->body->data is the text representation of the sdp from an rdata or an existing pjmedia_sdp_session object from a tdata, or whether pjsip_msg->body is a multipart body containing either of the two sdp formats. * The exsting pjsip_rdata_get_sdp_info and pjsip_rdata_get_sdp_info2 functions are now wrappers that get the body and Content-Type header from the rdata and call pjsip_get_sdp_info. * Two new wrappers named pjsip_tdata_get_sdp_info and pjsip_tdata_get_sdp_info2 have been created that get the body from the tdata and call pjsip_get_sdp_info. * inv_offer_answer_test.c was updated to test multipart scenarios. ASTERISK-29804 Change-Id: I483c7c3d413280c9e247a96ad581278347f9c71b 2021-12-09 02:55 +0000 [965f4abd9a] Frederic Van Espen * ast_coredumper: Fix deleting results when output dir is set When OUTPUTDIR is set to another directory and the --delete-results-after is set, the resulting txt files are not deleted. ASTERISK-29794 #close Change-Id: I1c0071f6809a1e3f5cfc455d6eb08378bc0d7286 2021-12-13 16:49 +0000 [bb27d5e1fe] Naveen Albert * pbx_variables: initialize uninitialized variable The variable cp4 in a variable substitution function can potentially be used without being initialized currently. This causes Asterisk to no longer compile. This initializes cp4 to NULL to make the compiler happy. ASTERISK-29803 #close Change-Id: I392579cbb76db2795d5820c9427cf55fbcee9e72 2021-12-08 05:24 +0000 [3d71bcd2f4] Mark Petersen * app_queue.c: added DIALEDPEERNUMBER on outgoing channel added that we set DIALEDPEERNUMBER on the outgoing channels so it is avalible in b(content^extension^line) this add the same behaviour as Dial ASTERISK-29795 Change-Id: Icbc589ea2066f0c401a892bf478f6b2fd44e62f6 2021-11-15 15:35 +0000 [05afa061f5] Kevin Harwell * http.c: Add ability to create multiple HTTP servers Previously, it was only possible to have one HTTP server in Asterisk. With this patch it is now possible to have multiple HTTP servers listening on different addresses. Note, this behavior has only been made available through an API call from within the TEST_FRAMEWORK. Specifically, this feature has been added in order to allow unit test to create/start and stop servers, if one has not been enabled through configuration. Change-Id: Ic5fb5f11e62c019a1c51310f4667b32a4dae52f5 2021-12-12 18:08 +0000 [030f7d4131] Naveen Albert * app.c: Throw warnings for nonexistent options Currently, Asterisk doesn't throw warnings if options are passed into applications that don't accept them. This can confuse users if they're unaware that they are doing something wrong. This adds an additional check to parse_options so that a warning is thrown anytime an option is parsed that doesn't exist in the parsing application, so that users are notified of the invalid usage. ASTERISK-29801 #close Change-Id: Id029274a57135caca193c913307a63fd75e24679 2021-12-08 12:07 +0000 [a4c42e70c1] Mark Petersen * app_voicemail.c: Support for Danish syntax in VM added support for playing the correct plural sound file dependen on where you have 1 or multipe messages based on the existing SE/NO code ASTERISK-29797 Change-Id: I88aa814d02f3772bb80b474204b1ffb26fe438c2 2021-12-11 20:11 +0000 [86bc3eef99] Naveen Albert * strings: Fix enum names in comment examples The enum values for ast_strsep_flags includes AST_STRSEP_STRIP. However, some comments reference AST_SEP_STRIP, which doesn't exist. This fixes these comments to use the correct value. ASTERISK-29800 #close Change-Id: If7bbd0c0e6226a211d25ddf9d1629347e2674943 2021-11-17 15:16 +0000 [c6410dc4ed] Naveen Albert * configs: Updates to sample configs Includes some minor updates to extensions.conf and iax.conf. In particular, the demonstration of macros in extensions.conf is removed, as Macro is deprecated and will be removed soon. These examples have been replaced with examples demonstrating the usage of Gosub instead. The older exten => ...,n syntax is also mostly replaced with the same keyword to demonstrate the newer, more concise way of defining extensions. IAXTEL no longer exists, so this example is replaced with something more generic. Some documentation is also added to extensions.conf and iax.conf to clarify some of the new expanded encryption capabilities with IAX2. ASTERISK-29758 #close Change-Id: I04fba9671aa1ee9ba1bd5027061f80bbe38e7b46 2021-11-17 15:39 +0000 [2f1eb56116] Naveen Albert * app_sendtext: Add ReceiveText application Adds a ReceiveText application that can be used in conjunction with SendText. Currently, there is no way in Asterisk to receive text in the dialplan (or anywhere else, really). This allows for Asterisk to be the recipient of text instead of just the sender. ASTERISK-29759 #close Change-Id: Ica2c354a42bff69f323a0493d3a7cd0fb129d52d 2021-11-20 14:37 +0000 [c6309af560] Naveen Albert * pbx_variables: Increase parsing capabilities of MSet Currently MSet can only parse a maximum of 24 variables. If more variables are provided to MSet, the 24th variable will simply contain the remainder of the string and the remaining variables thereafter will never get set. This increases the number of variables that can be parsed in one go from 24 to 99. Additionally, documentation is added since this limitation is currently undocumented and is confusing to users who encounter this limitation. ASTERISK-29766 #close Change-Id: I3fe35b462dedec0a452fd9ea7f92c920a3939f16 2021-11-23 20:21 +0000 [3108457d8f] Naveen Albert * chan_sip: Fix crash when accessing RURI before initiating outgoing call Attempting to access ${CHANNEL(ruri)} in a pre-dial handler before initiating an outgoing call will cause Asterisk to crash. This is because a null field is accessed, resulting in an offset from null and subsequent memory access violation. Since RURI is not guaranteed to exist, we now check if the base pointer is non-null before calculating an offset. ASTERISK-29772 Change-Id: Icd3b02f07256bbe6615854af5717074087b95a83 2021-10-25 16:19 +0000 [c0cdaf0246] Naveen Albert * func_json: Adds JSON_DECODE function Adds the JSON_DECODE function for parsing JSON in the dialplan. JSON parsing already exists in the Asterisk core and is used for many different things. This function exposes the basic parsing capability to the user in the dialplan, for instance, in conjunction with CURL for using API responses. ASTERISK-29706 #close Change-Id: Iea60c49a7358dfdc2db60803cdc9a742f808ba2c 2021-12-11 18:45 +0000 [087f25d3fd] Sean Bright * CHANGES: Correct reference to configuration file. Change-Id: I22a788ebf11168fff7fbf9ea956ebcd705ab63dd 2021-11-15 15:08 +0000 [cc1418ef47] Naveen Albert * pbx: Add variable substitution API for extensions Currently, variable substitution involving dialplan extensions is quite clunky since it entails obtaining the current dialplan location, backing it up, storing the desired variables for substitution on the channel, performing substitution, then restoring the original location. In addition to being clunky, things could also go wrong if an async goto were to occur and change the dialplan location during a substitution. Fundamentally, there's no reason it needs to be done this way, so new API is added to allow for directly passing in the dialplan location for the purposes of variable substitution so we don't need to mess with the channel information anymore. Existing API is not changed. ASTERISK-29745 #close Change-Id: I23273bf27fa0efb64a606eebf9aa8e2f41a065e4 2021-09-21 19:18 +0000 [2b2b708d43] Naveen Albert * app_mf: Add full tech-agnostic MF support Adds tech-agnostic support for MF signaling by adding MF sender and receiver applications as well as Dial integration. ASTERISK-29496-mf #do-not-close Change-Id: I61962b359b8ec4cfd05df877ddf9f5b8f71927a4 2021-12-06 04:25 +0000 [55dd77b921] Alexander Traud * xmldoc: Avoid whitespace around value for parameter/required. Otherwise, the value 'false' was not found in the enumerated set of the XML DTD for the XML attribute 'required' in the XML element 'parameter'. Therefore, DTD validation of the runtime XML failed. ASTERISK-29790 Change-Id: Id13f230ad65a70dd8c2e3ae9ac85d1e841aed03e 2021-12-04 02:36 +0000 [4b6c72572c] Alexander Traud * progdocs: Fix Doxygen left-overs. Change-Id: I5b5cf9c9cbbe00ba8b379a8d162ac67445d39016 2021-12-06 05:17 +0000 [5b24edeb7c] Alexander Traud * xmldoc: Correct definition for XML element 'matchInfo'. ASTERISK-29791 Change-Id: I7c656498427fcadd0a5d61a54ff67e6036609725 2021-11-23 08:05 +0000 [d914e14420] Alexander Traud * progdocs: Update Makefile. In developer mode, use internal documentation as well. This should produce no warnings. Fix yours! In noisy mode, output all possible warnings of Doxygen. This creates zillion of warnings. Double-check your current module! Any warnings are in the file './doxygen.log'. Beside that, this change avoids deprecated parameters because the configuration file for Doxygen contains only those parameters which differ from the default. This avoids the need to update the file on each run. Furthermore, it adds AST_VECTOR to be expanded. Finally, the default name for that file is Doxyfile. Therefore, let us use that! ASTERISK-26991 ASTERISK-20259 Change-Id: I4129092a199d5e24c319a09cd088614b121015af 2021-12-03 07:38 +0000 [a103956fc9] Alexander Traud * res_pjsip_sdp_rtp: Do not warn on unknown sRTP crypto suites. res_sdp_crypto_parse_offer(.) emits many log messages already. ASTERISK-29785 Change-Id: I1a191ebe4fec1102946d4e31887e5197ca02dfe8 2021-11-30 14:16 +0000 [c37cc5d3bc] Sean Bright * channel: Short-circuit ast_channel_get_by_name() on empty arg. We know that passing a NULL or empty argument to ast_channel_get_by_name() will never result in a matching channel and will always result in an error being emitted, so just short-circuit out in that case. ASTERISK-28219 #close Change-Id: I88eadc748e9c6996fc17467b0a05881bbfd00bce 2021-10-26 16:12 +0000 [04d00c203c] Mike Bradeen * res_rtp_asterisk: Addressing possible rtp range issues res/res_rtp_asterisk.c: Adding 1 to rtpstart if it is deteremined that rtpstart was configured to be an odd value. Also adding a loop counter to prevent a possible infinite loop when looking for a free port. ASTERISK-27406 Change-Id: I90f07deef0716da4a30206e9f849458b2dbe346b 2021-08-24 09:56 +0000 [6c9e8afd4e] Mark Petersen * apps/app_dial.c: HANGUPCAUSE reason code for CANCEL is set to AST_CAUSE_NORMAL_CLEARING changed that when we recive a CANCEL that we set HANGUPCAUSE to AST_CAUSE_NORMAL_CLEARING ASTERISK-28053 Reported by: roadkill Change-Id: Ib653aec2282f55b59d87484391cc07c8e6612b89 2021-11-19 02:54 +0000 [178cb0ffe4] Alexander Traud * res: Fix for Doxygen. These are the remaining issues found in /res. ASTERISK-29761 Change-Id: I572e6019c422780dde5ce8448b6c85c77af6046d 2021-11-08 18:30 +0000 [b2e71b82e7] Dustin Marquess * res_fax_spandsp: Add spandsp 3.0.0+ compatibility Newer versions of spandsp did refactoring of code to add new features like color FAXing. This refactoring broke backwards compatibility. Add support for the new version while retaining support for 0.0.6. ASTERISK-29729 #close Change-Id: I3bd74550604ebcf0304528d647fa39abc62fbaa1 2021-11-19 09:47 +0000 [20d9158c9c] Alexander Traud * main: Fix for Doxygen. ASTERISK-29763 Change-Id: Ib8359e3590a9109eb04a5376559d040e5e21867e 2021-12-02 18:26 +0000 Asterisk Development Team * asterisk 18.9.0-rc1 Released. 2021-12-02 11:59 +0000 [868d2d5e53] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.9.0 2021-11-28 04:29 +0000 [f946b92553] Alexander Traud * progdocs: Fix for Doxygen, the hidden parts. ASTERISK-29779 Change-Id: If338163488498f65fa7248b60e80299c0a928e4b 2021-11-12 10:05 +0000 [751bbf4b97] Alexander Traud * progdocs: Fix grouping for latest Doxygen. Since Doxygen 1.8.16, a special comment block is required. Otherwise (pure C comment), the group command is ignored. Additionally, several unbalanced group commands were fixed. ASTERISK-29732 Change-Id: I4687857b9d56e6f44fd440b73af156691660202e 2021-11-25 12:41 +0000 [bcb7aee723] Naveen Albert * documentation: Standardize examples Most examples in the XML documentation use the example tag to demonstrate examples, which gets parsed specially in the Wiki to make it easier to follow for users. This fixes a few modules to use the example tag instead of vanilla para tags to bring them in line with the standard syntax. ASTERISK-29777 #close Change-Id: I9acb6cc5faf1d220e73c6dd28592371d768d279b 2021-11-28 14:52 +0000 [04ac4fe509] Sean Bright * config.c: Prevent UB in ast_realtime_require_field. A backend's implementation of the realtime 'require' function may call va_arg() and then fail, leaving the va_list in an undefined state. Pass a copy of the va_list instead. ASTERISK-29771 #close Change-Id: I555565a72af84e96d49f62fe8cb66ba5a78461f4 2021-11-01 10:40 +0000 [70cdb0f9a8] Naveen Albert * app_voicemail: Refactor email generation functions Refactors generic functions used for email generation into utils.c so that they can be used by multiple modules, including app_voicemail and app_minivm, to avoid code duplication. ASTERISK-29715 #close Change-Id: I1de0ed3483623e9599711129edc817c45ad237ee 2021-11-25 10:34 +0000 [b290bb1251] Alexander Traud * stir/shaken: Avoid a compiler extension of GCC. ASTERISK-29776 Change-Id: I86e5eca66fb775a5744af0c929fb269e70575a73 2021-11-20 04:00 +0000 [858c9e1d80] Alexander Traud * chan_misdn: Fix for Doxygen. ASTERISK-29764 Change-Id: I6e5466cce03e25695c5c7d8b68c305184dcf5375 2021-11-23 07:45 +0000 [422f5389f6] Alexander Traud * progdocs: Remove outdated references in doxyref.h. ASTERISK-29773 Change-Id: Ica93160d9158cc0e80c5fda829b80d1b49a6b9b9 2021-11-20 06:05 +0000 [31e385bebb] Alexander Traud * xmldoc: Fix for Doxygen. ASTERISK-29765 Change-Id: I654ba0debe8351038d4433716434a09370f04c9d 2021-10-28 02:28 +0000 [89237be105] Jaco Kroon * logger: use __FUNCTION__ instead of __PRETTY_FUNCTION__ This avoids a few long-name overflows, at the cost of less instructive names in the case of C++ (specifically overloaded functions and class methods). This in turn is offset against the fact that we're logging the filename and line numbers in any case. Change-Id: I54101a0bb5f8cb9ef63ec12c5e0d4c8edafff9ed Signed-off-by: Jaco Kroon 2021-11-16 16:34 +0000 [ea941032ff] Mike Bradeen * astobj2.c: Fix core when ref_log enabled In the AO2_ALLOC_OPT_LOCK_NOLOCK case the referenced obj structure is freed, but is then referenced later if ref_log is enabled. The change is to store the obj->priv_data.options value locally and reference it instead of the value from the freed obj ASTERISK-29730 Change-Id: I60cc5dc1f5a4330e7ad56976fc38a42de0ab6072 2021-11-19 03:46 +0000 [3f86c95cf5] Alexander Traud * channels: Fix for Doxygen. ASTERISK-29762 Change-Id: Ia8811ac12b93ff8c18164699c6fbc604cb0a23f7 2021-11-16 04:06 +0000 [7d4e37a180] Joshua C. Colp * bridge: Deny full Local channel pair in bridge. Local channels are made up of two pairs - the 1 and 2 sides. When a frame goes in one side, it comes out the other. Back and forth. When both halves are in a bridge this creates an infinite loop of frames. This change makes it so that bridging no longer allows both of these sides to exist in the same bridge. ASTERISK-29748 Change-Id: I29928b6de87cd9be996a77daccefd7c360fef651 2021-11-06 18:35 +0000 [ca2e13e18f] Naveen Albert * res_tonedetect: Add call progress tone detection Makes basic call progress tone detection available in a tech-agnostic manner with the addition of the ToneScan application. This can determine if the channel has encountered a busy signal, SIT tones, dial tone, modem, fax machine, etc. A few basic async progress tone detect options are also added to the TONE_DETECT function. ASTERISK-29720 #close Change-Id: Ia02437e0450473031e294798b8cb421fb8f24e90 2021-11-08 13:59 +0000 [70b14f3eda] Boris P. Korzun * rtp_engine: Add type field for JSON RTCP Report stasis messages ASTERISK-29727 #close Change-Id: I2eca8aeb591cb63ac2238d08eab662367453cb82 2021-11-17 03:24 +0000 [783b775946] Alexander Traud * odbc: Fix for Doxygen. ASTERISK-29754 Change-Id: Ia09eb68d283d201d9a6fbeccfc0efe83fe0502a5 2021-11-17 02:54 +0000 [c549eda0a7] Alexander Traud * parking: Fix for Doxygen. ASTERISK-29753 Change-Id: I7a61974584f6169502e6860fc711919fe7bbfaa7 2021-11-17 05:43 +0000 [b4eebfa191] Alexander Traud * ari-stubs: Avoid 'is' as comparism with an literal. Python 3.9.7 gave a syntax warning. Change-Id: I3e3a982fe720726bc0015bcdb0e638a626ec89d4 2021-11-17 04:26 +0000 [b5962fe528] Alexander Traud * frame: Fix for Doxygen. ASTERISK-29755 Change-Id: I8240013ec3db0669c0acf67e26bf6c9cbb5b72af 2021-11-17 06:18 +0000 [5b5a9ea4f0] Alexander Traud * res_ari: Fix for Doxygen. ASTERISK-29756 Change-Id: I2f1c1eea1c902492b77b74de9950f20ebbb7e758 2021-11-16 12:07 +0000 [e27b91d542] Alexander Traud * channel: Fix for Doxygen. ASTERISK-29751 Change-Id: Ie04da5029c57ebee44733bdf05013156abe80176 2021-11-08 10:08 +0000 [53610679bf] Alexander Traud * BuildSystem: Consistently allow 'ye' even for Jansson. Furthermore, consistently use not 'No' but ':' for non-existent file paths. Finally, use the same pattern for checking file paths: a) = ":" b) != "x:" Change-Id: I0c80c76d2cc98b0e5c859131290f4e3141a1a544 2021-11-16 10:26 +0000 [6988386234] Alexander Traud * stasis: Fix for Doxygen. ASTERISK-29750 Change-Id: Iea50173e785b2e9d49bc24c0af7111cfd96d44a9 2021-11-17 02:30 +0000 [e7d5db1471] Alexander Traud * app: Fix for Doxygen. ASTERISK-29752 Change-Id: If40cbd01d47a6cfd620b18206dedb8460216c8af 2021-11-16 06:51 +0000 [31c26fcbc6] Alexander Traud * res_xmpp: Fix for Doxygen. ASTERISK-29749 Change-Id: I7885793b63bdeaa883e76edb899bbba9660eb1c5 2021-11-15 07:38 +0000 [026c6d51b1] Alexander Traud * addons: Fix for Doxygen. ASTERISK-29742 Change-Id: Ie752cb9638ced1ebe3a55d710c6c18ef6bd0aafc 2021-11-16 03:55 +0000 [bae495601a] Alexander Traud * res_pjsip: Fix for Doxygen. ASTERISK-29747 Change-Id: Ic7a1e9453f805a6264fe86c96b7d18b87b376084 2021-11-13 06:04 +0000 [cb043633d4] Alexander Traud * chan_iax2: Fix for Doxygen. ASTERISK-29737 Change-Id: I282003cc553989fd5c19ceeac9e478fa4ee06cec 2021-11-15 08:12 +0000 [42055f4a65] Alexander Traud * bridges: Fix for Doxygen. ASTERISK-29743 Change-Id: I6e1bbbaa5875e19994a328ab40a5d429c6010e8b 2021-11-15 07:29 +0000 [1a9df88d98] Alexander Traud * tests: Fix for Doxygen. ASTERISK-29741 Change-Id: I012d72b237bda2ef2d0f86307dfc6dc7add4b54b 2021-11-15 07:18 +0000 [09bac49a01] Alexander Traud * apps: Fix for Doxygen. ASTERISK-29740 Change-Id: Icb6fbcfea0a5f1c82caa5001902b6a786adbf307 2021-11-12 12:41 +0000 [44a9c16e9c] Alexander Traud * progdocs: Avoid 'name' with Doxygen \file. Fixes four misuses of the parameter 'name'. Additionally, for consistency and to avoid such an issue in future, those few other places, which used '\file name', were changed just to '\file'. Then, Doxygen uses the name of the current file. ASTERISK-29733 Change-Id: I0c18b4c863c6988b138c77448057349a9ee7052d 2021-11-13 04:40 +0000 [d08792ceba] Alexander Traud * bridge_channel: Fix for Doxygen. ASTERISK-29736 Change-Id: Ia5370289e6526001a6b52754b533bcea1a9d7e5c 2021-11-12 13:52 +0000 [57b4956a8a] Alexander Traud * progdocs: Avoid multiple use of section labels. ASTERISK-29735 Change-Id: I56935e73f7bd1d4ae2721d11040f4835da64b810 2021-11-12 13:17 +0000 [23b16c5372] Alexander Traud * progdocs: Use Doxygen \example correctly. ASTERISK-29734 Change-Id: I83b51e85cd71867645ab3a8a820f8fd1f065abd2 2021-10-30 20:04 +0000 [4bc3dc6543] Josh Soref * bridges: Spelling fixes Correct typos of the following word families: multiplication potentially iteration interaction virtual synthesis convolve initializes overlap ASTERISK-29714 Change-Id: Ia40f1aca8f2996ab407c6ed9d24cb10a67c6684b (cherry picked from commit 2a8fb4695ef87c363fc49f142b696ceed85a7f98) 2021-11-15 13:02 +0000 [721026ff37] Naveen Albert * app_morsecode: Fix deadlock Fixes a deadlock in app_morsecode caused by locking the channel twice when reading variables from the channel. The duplicate lock is simply removed. ASTERISK-29744 #close Change-Id: I204000701f123361d7f85e0498fedc90243c75e4 2021-10-24 13:38 +0000 [1cd2584b27] Naveen Albert * res_pjsip_callerid: Fix OLI parsing Fix parsing of ANI2/OLI information, since it was previously parsing the user, when it should have been parsing other_param. Also improves the parsing by using pjproject native functions rather than trying to parse the parameters ourselves like chan_sip did. A previous attempt at this caused a crash, but this works correctly now. ASTERISK-29703 #close Change-Id: I8f3c79032d9ea1a21d16f8e11f22bd8d887738a1 2021-10-25 12:51 +0000 [3c4b7cef64] Naveen Albert * app_read: Fix custom terminator functionality regression Currently, when the t option is specified with no arguments, the # character is still treated as a terminator, even though no character should be treated as a terminator. This is because a previous regression fix was modified to remove the use of NULL as a default altogether. However, NULL and an empty string actually refer to different arrangements and should be treated differently. NULL is the default terminator (#), while an empty string removes the terminator altogether. This is the behavior being used by the rest of the core. Additionally, since S_OR catches empty strings as well as NULL (not intended), this is changed to a ternary operator instead, which fixes the behavior. ASTERISK-29705 #close Change-Id: I9b6b72196dd04f5b1e0ab5aa1b0adf627725e086 2021-10-30 20:04 +0000 [59715a073b] Josh Soref * utils: Spelling fixes Correct typos of the following word families: command-line immediately extensions momentarily mustn't numbered bytes caching ASTERISK-29714 Change-Id: I8b2b125c5d4d2f9e87a58515c97468ad47ca44f8 2021-10-30 20:04 +0000 [3685e55673] Josh Soref * pbx: Spelling fixes Correct typos of the following word families: process populate with africa accessing contexts exercise university organizations withhold maintaining independent rotation ignore eventname ASTERISK-29714 Change-Id: I90eacc5bc3dcf75a9c898cfb85164f37dec08345 2021-10-30 20:04 +0000 [4cf87f6175] Josh Soref * rest-api-templates: Spelling fixes Correct typos of the following word families: overwritten descendants ASTERISK-29714 Change-Id: I2307e35887a3437e50317a4b86f0893f25f9fd3b 2021-10-30 20:04 +0000 [c1b21bee6d] Josh Soref * channels: Spelling fixes Correct typos of the following word families: appease permanently overriding residue silliness extension channels globally reference japanese group coordinate registry information inconvenience attempts cadence payloads presence provisioning mimics behavior width natively syslabel not owning unquelch mostly constants interesting active unequipped brodmann commanding backlogged without bitstream firmware maintain exclusive practically structs appearance range retransmission indication provisional associating always whether cyrillic distinctive components reinitialized initialized capability switches occurring happened outbound ASTERISK-29714 Change-Id: Ife52ee89cd2170b684fa651ca72b1cb911a57339 2021-10-30 20:04 +0000 [4fc59ccc92] Josh Soref * tests: Spelling fixes Correct typos of the following word families: mounting jitterbuffer thrashing original manipulating entries actual possibility tasks options positives taskprocessor other dynamic declarative ASTERISK-29714 Change-Id: I6b94659d045eec5d8d020fce2e9b6e2f593dfeb6 2021-10-30 20:04 +0000 [c3978efef6] Josh Soref * Makefile: Spelling fixes Correct typos of the following word families: libraries install overwrite ASTERISK-29714 Change-Id: I6488814f79186d6c23dfd7b7f9bba0a046126174 2021-10-30 20:04 +0000 [2a8b651b7e] Josh Soref * contrib: Spelling fixes Correct typos of the following word families: standard increase comments valgrind promiscuous editing libtonezone storage aggressive whitespace russellbryant consecutive peternixon ASTERISK-29714 Change-Id: I9cafbf41b579c9c0c84c81719d2c4f900beec245 2021-10-30 20:04 +0000 [3ac7afe09c] Josh Soref * formats: Spelling fixes Correct typos of the following word families: truncate ASTERISK-29714 Change-Id: I6507760c72b919873cff7cac22b3781036cd4955 2021-10-30 20:04 +0000 [49ef881eb4] Josh Soref * addons: Spelling fixes Correct typos of the following word families: definition listener fastcopy logical registration classify documentation explicitly dialed endpoint elements arithmetic might prepend byte terminal inquiry skipping aliases calling absent authentication transmit their ericsson disconnecting redir items client adapter transmitter existing satisfies pointer interval supplied ASTERISK-29714 Change-Id: I8548438246f7b718d88e0b9e0a1eb384bbec88e4 2021-10-30 20:04 +0000 [70af726dcd] Josh Soref * agi: Spelling fixes Correct typos of the following word families: pretend speech ASTERISK-29714 Change-Id: I7d0527c329cda07552247ea11b2d7db207a3d87d 2021-10-30 20:04 +0000 [c0fafa1863] Josh Soref * funcs: Spelling fixes Correct typos of the following word families: effectively emitted expect anthony ASTERISK-29714 Change-Id: Ic16f9ec855bb6d14ec8e170b90af9a36b06d488a 2021-10-30 20:04 +0000 [8fb9588e8c] Josh Soref * build_tools: Spelling fixes Correct typos of the following word families: binutils ASTERISK-29714 Change-Id: I2f676ab48cd50edc400c43307cb53679e4c09b97 2021-10-30 20:04 +0000 [7a59a9365a] Josh Soref * menuselect: Spelling fixes Correct typos of the following word families: dependency unless random dependencies delimited randomly modules ASTERISK-29714 Change-Id: I3920603a8dc7c0a1852d2f885e06b1144692d40e 2021-10-30 20:04 +0000 [b13acf3ae6] Josh Soref * include: Spelling fixes Correct typos of the following word families: activities forward occurs unprepared association compress extracted doubly callback prometheus underlying keyframe continue convenience calculates ignorepattern determine subscribers subsystem synthetic applies example manager established result microseconds occurrences unsuccessful accommodates related signifying unsubscribe greater fastforward itself unregistering using translator sorcery implementation serializers asynchronous unknowingly initialization determining category these persistent propagate outputted string allocated decremented second cacheability destructor impaired decrypted relies signaling based suspended retrieved functions search auth considered ASTERISK-29714 Change-Id: I542ce887a16603f886a915920d5710d4a0a1358d 2021-10-30 20:04 +0000 [135d51e55e] Josh Soref * doc: Spelling fixes Correct typos of the following word families: transparent roughly ASTERISK-29714 Change-Id: I2b90c68dfde4aa3f0d58f64f8187465336acb1b3 2021-10-30 20:04 +0000 [ae83d927d8] Josh Soref * configs: Spelling fixes Correct typos of the following word families: password excludes undesirable checksums through screening interpreting database causes initiation member busydetect defined severely throughput recognized counter require indefinitely accounts ASTERISK-29714 Change-Id: Ie8f2a7b274a162dd627ee6a2165f5e8a3876527e 2021-10-30 20:04 +0000 [dcf492e7b6] Josh Soref * res: Spelling fixes Correct typos of the following word families: identifying structures actcount initializer attributes statement enough locking declaration userevent provides unregister session execute searches verification suppressed prepared passwords recipients event because brief unidentified redundancy character the module reload operation backslashes accurate incorrect collision initializing instance interpreted buddies omitted manually requires queries generator scheduler configuration has owner resource performed masquerade apparently routable ASTERISK-29714 Change-Id: I88485116d2c59b776aa2e1f8b4ce8239a21decda 2021-10-30 20:04 +0000 [ccfebc3cfc] Josh Soref * codecs: Spelling fixes Correct typos of the following word families: voiced denumerator codeword upsampling constructed residual subroutine conditional quantizing courtesy number ASTERISK-29714 Change-Id: I471fb8086a5277d8f05047fedee22cfa97a4252d 2021-10-30 20:04 +0000 [4019a93edf] Josh Soref * main: Spelling fixes Correct typos of the following word families: analysis nuisance converting although transaction desctitle acquire update evaluate thousand this dissolved management integrity reconstructed decrement further on irrelevant currently constancy anyway unconstrained featuregroups right larger evaluated encumbered languages digits authoritative framing blindxfer tolerate traverser exclamation perform permissions rearrangement performing processing declension happily duplicate compound hundred returns elicit allocate actually paths inheritance atxferdropcall earlier synchronization multiplier acknowledge across against thousands joyous manipulators guaranteed emulating soundfile ASTERISK-29714 Change-Id: I926ba4b11e9f6dd3fdd93170ab1f9b997910be70 2021-10-30 20:04 +0000 [998ad0e179] Josh Soref * CREDITS: Spelling fixes Correct typos of the following word families: contributors ASTERISK-29714 Change-Id: I6f46dae8bf8125a21ce8ff318380b2b412d9d2f9 2021-10-30 20:04 +0000 [e7b1dcf769] Josh Soref * apps: Spelling fixes Correct typos of the following word families: simultaneously administrator directforward attachfmt dailplan automatically applicable nouns explicit outside sponsored attachment audio spied doesn't counting encoded implements recursively emailaddress arguments queuerules members priority output advanced silencethreshold brazilian debugging argument meadmin formatting integrated sneakiness ASTERISK-29714 Change-Id: Ie5ecaec91c00b26309da4e51cfc0991a5bb7d092 2021-10-30 20:04 +0000 [0150c3b698] Josh Soref * UPGRADE.txt: Spelling fixes Correct typos of the following word families: themselves support received ASTERISK-29714 Change-Id: Ibd0a7996d5801c754d3d44fba31fe788a13dba95 2021-10-30 20:04 +0000 [42d1c134f7] Josh Soref * CHANGES: Spelling fixes Correct typos of the following word families: issuing execution bridging alert respective unlikely confbridge offered negotiation announced engineer systems inherited passthrough functionality supporting conflicts semantically monitor specify specifiable ASTERISK-29714 Change-Id: Ia6b1cf634f52c5f7b1b8769dc54dae78106ed98c 2021-11-08 07:00 +0000 [301647788e] George Joseph * CI: Rename 'master' node to 'built-in' Jenkins renamed the 'master' node to 'built-in' in version 2.319 so we have to adjust as well. Change-Id: Ice663c3a66d0eedf76e8e5fe530328455991ec25 2021-11-08 08:08 +0000 [608e52c939] Alexander Traud * BuildSystem: In POSIX sh, == in place of = is undefined. ASTERISK-29724 Change-Id: I59aa0e52effdc16992f3a736ccf73430a6ef135b 2021-10-24 06:55 +0000 [36c5f5e5fa] Naveen Albert * sig_analog: Fix truncated buffer copy Fixes compiler warning caused by a truncated copy of the ANI2 into a buffer of size 10. This could prevent the null terminator from being copied if the copy value exceeds the size of the buffer. This increases the buffer size to 101 to ensure there is no way for truncation to occur. ASTERISK-29702 #close Change-Id: Ief9052212952840fa44de6463b8699fdb3e163d0 2021-11-08 09:01 +0000 [e63461b008] Sean Bright * pbx.c: Don't remove dashes from hints on reload. When reloading dialplan, hints created dynamically would lose any dash characters. Now we ignore those dashes if we are dealing with a hint during a reload. ASTERISK-28040 #close Change-Id: I95e48f5a268efa3c6840ab69798525d3dce91636 2021-10-24 07:31 +0000 [92857e70b6] Naveen Albert * app_voicemail: Fix phantom voicemail bug on rerecord If users are able to press # for options while leaving a message and then press 3 to rerecord the message, if the caller hangs up during the rerecord prompt but before Asterisk starts recording a message, then an "empty" voicemail gets processed whereby an email gets sent out notifying the user of a 0:00 duration message. The file doesn't actually exist, so playback will fail since there was no message to begin with. This adds a check after the streaming of the rerecord announcement to see if the caller has hung up. If so, we bail out early so that we can clean up properly. ASTERISK-29391 #close Change-Id: Id965d72759a2fd3b39afb76fec08aaebebe75c31 2021-10-25 19:47 +0000 [bea08a563b] Naveen Albert * chan_iax2: Allow both secret and outkey at dial time Historically, the dial syntax for IAX2 has held that an outkey (used only for RSA authenticated calls) and a secret (used only for plain text and MD5 authenticated calls, historically) were mutually exclusive, and thus the same position in the dial string was used for both values. Now that encryption is possible with RSA authentication, this poses a limitation, since encryption requires a secret and RSA authentication requires an outkey. Thus, the dial syntax is extended so that both a secret and an outkey can be specified. The new extended syntax is backwards compatible with the old syntax. However, a secret can now be specified after the outkey, or the outkey can be specified after the secret. This makes it possible to spawn an encrypted RSA authenticated call without a corresponding peer being predefined in iax.conf. ASTERISK-29707 #close Change-Id: I1f8149313ed760169d604afbb07720a8b07dd00e 2021-10-28 07:09 +0000 [95da40cd50] Alexander Traud * res_snmp: As build tool, prefer pkg-config over net-snmp-config. ASTERISK-29709 Change-Id: Ie169df878bdfc3a06b3097c5c38d185b480f54d4 2021-10-28 07:41 +0000 [8b76a3cd3b] Alexander Traud * stasis: Avoid 'dispatched' as unused variable in normal mode. ASTERISK-29710 Change-Id: Ia849f1172e4e694c5d5d7f0cad449f936ee12216 2021-10-29 10:05 +0000 [2c03f73016] Sean Bright * various: Fix GCC 11.2 compilation issues. * Initialize some variables that are never used anyway. * Use valid pointers instead of integers cast to void pointers when calling pthread_setspecific(). ASTERISK-29711 #close ASTERISK-29713 #close Change-Id: I8728cd6f2f4b28e0e48113c5da450b768c2a6683 2021-09-09 09:39 +0000 [08cb67251f] George Joseph * ast_coredumper: Refactor to better find things The search for a running asterisk when --running is used has been greatly simplified and in the event it doesn't work, you can now specify a pid to use on the command line with --pid. The search for asterisk modules when --tarball-coredumps is used has been enhanced to have a better chance of finding them and in the event it doesn't work, you can now specify --libdir on the command line to indicate the library directory where they were installed. The DATEFORMAT variable was renamed to DATEOPTS and is now passed to the 'date' utility rather than running DATEFORMAT as a command. The coredump and output files are now renamed with DATEOPTS. This can be disabled by specifying --no-rename. Several confusing and conflicting options were removed: --append-coredumps --conffile --no-default-search --tarball-uniqueid The script was re-structured to make it easier for follow. Change-Id: I674be64bdde3ef310b6a551d4911c3b600ffee59 2021-10-21 12:29 +0000 [ae97aaedb0] Kevin Harwell * strings/json: Add string delimter match, and object create with vars methods Add a function to check if there is an exact match a one string between delimiters in another string. Add a function that will create an ast_json object out of a list of Asterisk variables. An excludes string can also optionally be passed in. Also, add a macro to make it easier to get object integers. Change-Id: I5f34f18e102126aef3997f19a553a266d70d6226 2021-09-21 12:09 +0000 [2e55c0fded] Ben Ford * STIR/SHAKEN: Option split and response codes. The stir_shaken configuration option now has 4 different choices to pick from: off, attest, verify, and on. Off and on behave the same way they do now. Attest will only perform attestation on the endpoint, and verify will only perform verification on the endpoint. Certain responses are required to be sent based on certain conditions for STIR/SHAKEN. For example, if we get a Date header that is outside of the time range that is considered valid, a 403 Stale Date response should be sent. This and several other responses have been added. Change-Id: I4ac1ecf652cd0e336006b0ca638dc826b5b1ebf7 2021-08-25 08:15 +0000 [a203769c9d] Rodrigo Ramírez Norambuena * app_queue: Add LoginTime field for member in a queue. Add a time_t logintime to storage a time when a member is added into a queue. Also, includes show this time (in seconds) using a 'queue show' command and the field LoginTime for response for AMI events. ASTERISK-18069 #close Change-Id: Ied6c3a300f78d78eebedeb3e16a1520fc3fff190 2021-10-21 12:49 +0000 [859f579504] Kevin Harwell * res_speech: Add a type conversion, and new engine unregister methods Add a new function that converts a speech results type to a string. Also add another function to unregister an engine, but returns a pointer to the unregistered engine object instead of a success/fail integer. Change-Id: I0f7de17cb411021c09fb03988bc2b904e1380192 2021-10-07 13:07 +0000 [0b2646aee6] Mike Bradeen * various: Fix GCC 11 compilation issues. test_voicemail_api: Use empty char* for empty_msg_ids. chan_skinny: Fix size of calledParty to be maximum extension. menuselect: Change Makefile to stop deprecated warnings. Added comments test_linkedlist: 'bogus' variable was manually allocated from a macro and the test fails if this happens but the compiler couldn't 'see' this and returns a warning. memset to all 0's after allocation. chan_ooh323: Fixed various indentation issues that triggered misleading indentation warnings. ASTERISK-29682 Reported by: George Joseph Change-Id: If4fe42222c8444dc16828a42731ee53b4ce5cbbe 2021-09-20 11:10 +0000 [63c8d12e95] Shloime Rosenblum * apps/app_playback.c: Add 'mix' option to app_playback I am adding a mix option that will play by filename and say.conf unlike say option that will only play with say.conf. It will look on the format of the name, if it is like say it play with say.conf if not it will play the file name. ASTERISK-29662 Change-Id: I815816916a308f0fa8f165140dc15772dcbd547a 2021-10-19 11:35 +0000 [c07e3c2f4d] George Joseph * BuildSystem: Check for alternate openssl packages OpenSSL is one of those packages that often have alternatives with later versions. For instance, CentOS/EL 7 has an openssl package at version 1.0.2 but there's an openssl11 package from the epel repository that has 1.1.1. This gets installed to /usr/include/openssl11 and /usr/lib64/openssl11. Unfortunately, the existing --with-ssl and --with-crypto ./configure options expect to point to a source tree and don't work in this situation. Also unfortunately, the checks in ./configure don't use pkg-config. In order to make this work with the existing situation, you'd have to run... ./configure --with-ssl=/usr/lib64/openssl11 \ --with-crypto=/usr/lib64/openssl11 \ CFLAGS=-I/usr/include/openssl11 BUT... those options don't get passed down to bundled pjproject so when you run make, you have to include the CFLAGS again which is a big pain. Oh... To make matters worse, although you can specify PJPROJECT_CONFIGURE_OPTS on the ./configure command line, they don't get saved so if you do a make clean, which will force a re-configure of bundled pjproject, those options don't get used. So... * In configure.ac... Since pkg-config is installed by install_prereq anyway, we now use it to check for the system openssl >= 1.1.0. If that works, great. If not, we check for the openssl11 package. If that works, great. If not, we fall back to just checking for any openssl. If pkg-config isn't installed for some reason, or --with-ssl= or --with-crypto= were specified on the ./configure command line, we fall back to the existing logic that uses AST_EXT_LIB_CHECK(). * The whole OpenSSL check process has been moved up before THIRD_PARTY_CONFIGURE(), which does the initial pjproject bundled configure, is run. This way the results of the above checks, which may result in new include or library directories, is included. * Although not strictly needed for openssl, We now save the value of PJPROJECT_CONFIGURE_OPTS in the makeopts file so it can be used again if a re-configure is triggered. ASTERISK-29693 Change-Id: I341ab7603e6b156aa15a66f43675ac5029d5fbde 2021-10-14 14:38 +0000 [8c2720e540] Sean Bright * func_talkdetect.c: Fix logical errors in silence detection. There are 3 separate changes here: 1. The documentation erroneously stated that the dsp_talking_threshold argument was a number of milliseconds when it is actually an energy level used by the DSP code to classify talking vs. silence. 2. Fixes a copy paste error in the argument handling code. 3. Don't erroneously switch to the talking state if we aren't actively handling a frame we've classified as talking. Patch inspired by one provided by Moritz Fain (License #6961). ASTERISK-27816 #close Change-Id: I5953fd570b98b49c41cee55bfe3b941753fb2511 2021-10-14 10:15 +0000 [e3466893e9] Sebastien Duthil * main/stun.c: fix crash upon STUN request timeout Some ast_stun_request users do not provide a destination address when sending to a connection-mode socket. ASTERISK-29691 Change-Id: Idd9114c3380216ba48abfc3c68619e79ad37defc 2021-10-12 13:17 +0000 [bac66e9743] Mike Bradeen * build: prevent binary downloads for non x86 architectures download_externals: Add check for i686 and i386 (in addition to the current x86_64) and exit if not one of the three. ASTERISK-26497 Change-Id: Ia4d429fcefa5b2f5b6e99159d4607de8e8325b2f 2021-10-11 14:04 +0000 [482281deff] Sean Bright * configure: Remove unused OpenSSL SRTP check. Discovered while looking at ASTERISK~29684. Usage was removed in change I3c77c7b00b2ffa2e935632097fa057b9fdf480c0. Change-Id: Iaf2f7a16ea5a7eee6375319347e4b40b8e7b10e3 2021-10-13 10:26 +0000 Asterisk Development Team * asterisk 18.8.0-rc1 Released. 2021-10-13 05:21 +0000 [9063680148] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.8.0 2021-10-07 12:50 +0000 [804b1987fb] Sean Bright * Makefile: Use basename in a POSIX-compliant way. If you aren't using GNU coreutils, chances are that your basename doesn't know about the -s argument. Luckily for us, basename does what we need it do even without the -s argument. Change-Id: I8b81a429bb037b997ee6640ff8a2b5e860962bb7 2021-10-05 19:59 +0000 [e091aa2763] Mark Murawski * pbx_ael: Fix crash and lockup issue regarding 'ael reload' Avoid infinite recursion and crash Change-Id: I8ed05ec3aa2806c50c77edc5dd0cd4e4fa08b3f4 2021-05-24 13:04 +0000 [437b2bfbd6] Naveen Albert * chan_iax2: Add encryption for RSA authentication Adds support for encryption to RSA-authenticated calls. Also prevents crashes if an RSA IAX2 call is initiated to a switch requiring encryption but no secret is provided. ASTERISK-20219 Change-Id: I18f1f9d7c59b4f9cffa00f3b94a4c875846efd40 2021-07-19 11:34 +0000 [15e432220c] Matthew Kern * res_pjsip_t38: bind UDPTL sessions like RTP In res_pjsip_sdp_rtp, the bind_rtp_to_media_address option and the fallback use of the transport's bind address solve problems sending media on systems that cannot send ipv4 packets on ipv6 sockets, and certain other situations. This change extends both of these behaviors to UDPTL sessions as well in res_pjsip_t38, to fix fax-specific problems on these systems, introducing a new option endpoint/t38_bind_udptl_to_media_address. ASTERISK-29402 Change-Id: I87220c0e9cdd2fe9d156846cb906debe08c63557 2021-09-29 12:58 +0000 [5a6f140765] Naveen Albert * app_read: Fix null pointer crash If the terminator character is not explicitly specified and an indications tone is used for reading a digit, there is no null pointer check so Asterisk crashes. This prevents null usage from occuring. ASTERISK-29673 #close Change-Id: Ie941833e123c3dbfb88371b5de5edbbe065514ac 2021-09-29 04:32 +0000 [0ab4e7491d] Jean Aunis * res_rtp_asterisk: fix memory leak Add missing reference decrement in rtp_deallocate_transport() ASTERISK-29671 Change-Id: I8d22dbedb90e8dade0829b7a28372f404b07caa9 2021-09-19 15:08 +0000 [29c44caecb] Shloime Rosenblum * main/say.c: Support future dates with Q and q format params The current versions do not support future dates in all say application when using the 'Q' or 'q' format parameter and says "today" for everything that is greater than today ASTERISK-29637 Change-Id: I1fb1cef0ce3c18d87b1fc94ea309d13bc344af02 2021-07-21 16:36 +0000 [4368764032] Joseph Nadiv * res_pjsip_registrar: Remove unavailable contacts if exceeds max_contacts The behavior of max_contacts and remove_existing are connected. If remove_existing is enabled, the soonest expiring contacts are removed. This may occur when there is an unavailable contact. Similarly, when remove_existing is not enabled, registrations from good endpoints are rejected in favor of retaining unavailable contacts. This commit adds a new AOR option remove_unavailable, and the effect of this setting will depend on remove_existing. If remove_existing is set to no, we will still remove unavailable contacts when they exceed max_contacts, if there are any. If remove_existing is set to yes, we will prioritize the removal of unavailable contacts before those that are expiring soonest. ASTERISK-29525 Change-Id: Ia2711b08f2b4d1177411b1be23e970d7fdff5784 2021-09-23 09:13 +0000 [ea36473c45] Joshua C. Colp * ari: Ignore invisible bridges when listing bridges. When listing bridges we go through the ones present in ARI, get their snapshot, turn it into JSON, and add it to the payload we ultimately return. An invisible "dial bridge" exists within ARI that would also try to be added to this payload if the channel "create" and "dial" routes were used. This would ultimately fail due to invisible bridges having no snapshot resulting in the listing of bridges failing. This change makes it so that the listing of bridges ignores invisible ones. ASTERISK-29668 Change-Id: I14fa4b589b4657d1c2a5226b0f527f45a0cd370a 2021-09-19 06:14 +0000 [484da42d6c] Naveen Albert * func_vmcount: Add support for multiple mailboxes Allows multiple mailboxes to be specified for VMCOUNT instead of just one. ASTERISK-29661 #close Change-Id: I9108528300795fd5b607efa9d4dd7b74be031813 2021-09-21 09:58 +0000 [e98839b73c] Sean Bright * message.c: Support 'To' header override with AMI's MessageSend. The MessageSend AMI action has been updated to allow the Destination and the To addresses to be provided separately. This brings the MessageSend manager command in line with the capabilities of the MessageSend dialplan application. ASTERISK-29663 #close Change-Id: I8513168d3e189a9fed88aaab6f5547ccb50d332c 2021-09-15 13:21 +0000 [cf0d656ae6] Naveen Albert * func_channel: Add CHANNEL_EXISTS function. Adds a function to check for the existence of a channel by name or by UNIQUEID. ASTERISK-29656 #close Change-Id: Ib464e9eb6e13dc683a846286798fecff4fd943cb 2021-09-05 13:11 +0000 [cfd0246d11] Naveen Albert * app_queue: Fix hint updates for included contexts Previously, if custom hints were used with the hint: format in app_queue, when device state changes occured, app_queue would only do a literal string comparison of the context used for the hint in app_queue and the context of the hint which just changed state. This caused hints to not update and become stale if the context associated with the agent included the context which actually changes state, essentially completely breaking device state for any such agents defined in this manner. This fix adds an additional check to ensure that included contexts are also compared against the context which changed state, so that the behavior is correct no matter whether the context is specified to app_queue directly or indirectly. ASTERISK-29578 #close Change-Id: I8caf2f8da8157ef3d9ea71a8568c1eec95592b78 2021-09-10 09:40 +0000 [b2c834e349] Sean Bright * res_http_media_cache.c: Compare unaltered MIME types. Rather than stripping parameters from Content-Type headers before comparison, first try to compare the whole string. If no match is found, strip the parameters and try that way. ASTERISK-29275 #close Change-Id: I2963c8ecbb3a9605b78b6421c415108d77a66a0f 2021-07-25 17:19 +0000 [a65bb134f5] Naveen Albert * logger: Add custom logging capabilities Adds the ability for users to log to custom log levels by providing custom log level names in logger.conf. Also adds a logger show levels CLI command. ASTERISK-29529 Change-Id: If082703cf81a436ae5a565c75225fa8c0554b702 2021-09-17 10:57 +0000 [dce142baa4] Sean Bright * app_externalivr.c: Fix mixed leading whitespace in source code. No functional changes. Change-Id: I46514152c0af67f395526374aaa847ccd6a85378 2021-09-17 14:58 +0000 [03377c35fc] Guido Falsi * res_rtp_asterisk.c: Fix build failure when not building with pjproject. Some code has been added referencing symbols defined in a block protected by #ifdef HAVE_PJPROJECT. Protect those code parts in ifdef blocks too. ASTERISK-29660 Change-Id: Ib18d4392d51ac80ca5481dabf6e498a4e3e49e6f 2021-09-16 13:43 +0000 Asterisk Development Team * asterisk 18.7.0-rc1 Released. 2021-09-16 08:39 +0000 [00cf86dafe] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.7.0 2021-09-13 10:18 +0000 [e8f7b53023] Carlos Oliva * app_mp3: Force output to 16 bits in mpg123 In new mpg123 versions (since 1.26) the default output is 32 bits Asterisk expects the output in 16 bits, so we force the output to be on 16 bits. It will work wit new and old versions of mpg123. Thanks Thomas Orgis for giving the key! ASTERISK-29635 #close Change-Id: I88c7740118b5af4e895bd8b765b68ed5c11fc816 2021-09-14 12:02 +0000 [0947c30224] George Joseph * pjproject: Add patch to fix trailing whitespace issue in rtpmap An issue was found where a particular manufacturer's phones add a trailing space to the end of the rtpmap attribute when specifying a payload type that has a "param" after the format name and clock rate. For example: a=rtpmap:120 opus/48000/2 \r\n Because pjmedia_sdp_attr_get_rtpmap currently takes everything after the second '/' up to the line end as the param, the space is included in future comparisons, which then fail if the param being compared to doesn't also have the space. We now use pj_scan_get() to parse the param part of rtpmap so trailing whitespace is automatically stripped. ASTERISK-29654 Change-Id: Ibd0a4e243a69cde7ba9312275b13ab62ab86bc1b 2021-06-08 15:44 +0000 [1a23c9c047] Naveen Albert * res_pjsip_caller_id: Add ANI2/OLI parsing Adds parsing of ANI II digits (Originating Line Information) to PJSIP, on par with what currently exists in chan_sip. ASTERISK-29472 Change-Id: Ifc938a7a7d45ce33999ebf3656a542226f6d3847 2021-06-28 10:37 +0000 [60daa8f761] Naveen Albert * app_mf: Add channel agnostic MF sender Adds a SendMF application and PlayMF manager event to send arbitrary R1 MF tones on the current or specified channel. ASTERISK-29496 Change-Id: I5d89afdbccee3f86cc702ed96d882f3d351327a4 2021-09-10 09:56 +0000 [847349853a] Sean Bright * test_http_media_cache.c: Fix copy/paste error during test deregistration. Change-Id: I9a3a978b2f818be464e062d97b93831b127ef28c 2021-09-02 18:20 +0000 [c736cef310] Naveen Albert * app_stack: Include current location if branch fails Previously, the error emitted when app_stack tries to branch to a dialplan location that doesn't exist has included only the information about the attempted branch in the error log. This adds the current location as well so users can see where the branch failed in the logs. ASTERISK-29626 Change-Id: Ia23502ab2ad21485a1ac74295063a8f25a6df5ce 2021-09-03 13:27 +0000 [d9747104ff] Sungtae Kim * resource_channels.c: Fix external media data option Fixed the external media creation handle to handle the 'data' option correctly. ASTERISK-29629 Change-Id: I22e57fe8ebf3d3e08fb2121aa4a8a52cc62e8129 2021-09-02 18:57 +0000 [6198c1d28c] Naveen Albert * func_strings: Add STRBETWEEN function Adds the STRBETWEEN function, which can be used to insert a substring between each character in a string. For instance, this can be used to insert pauses between DTMF tones in a string of digits. ASTERISK-29627 Change-Id: Ice23009d4a8e9bb9718d2b2301d405567087d258 2021-09-08 14:29 +0000 [ee62a07914] Sean Bright * test_abstract_jb.c: Fix put and put_out_of_order memory leaks. We can't rely on RAII_VAR(...) to properly clean up data that is allocated within a loop. ASTERISK-27176 #close Change-Id: Ib575616101230c4f603519114ec62ebf3936882c 2021-09-02 19:00 +0000 [19de228e8b] Naveen Albert * func_env: Add DIRNAME and BASENAME functions Adds the DIRNAME and BASENAME functions, which are wrappers around the corresponding C library functions. These can be used to safely and conveniently work with file paths and names in the dialplan. ASTERISK-29628 #close Change-Id: Id3aeb907f65c0ff96b6e57751ff0cb49d61db7f3 2021-07-26 12:46 +0000 [b6b7b1490b] Naveen Albert * func_sayfiles: Retrieve say file names Up until now, all of the logic used to translate arguments to the Say applications has been directly coupled to playback, preventing other modules from using this logic. This refactors code in say.c and adds a SAYFILES function that can be used to retrieve the file names that would be played. These can then be used in other applications or for other purposes. Additionally, a SayMoney application and a SayOrdinal application are added. Both SayOrdinal and SayNumber are also expanded to support integers greater than one billion. ASTERISK-29531 Change-Id: If9718c89353b8e153d84add3cc4637b79585db19 2021-08-09 12:41 +0000 [a6eb1b6f95] Naveen Albert * res_tonedetect: Tone detection module dsp.c contains arbitrary tone detection functionality which is currently only used for fax tone recognition. This change makes this functionality publicly accessible so that other modules can take advantage of this. Additionally, a WaitForTone and TONE_DETECT app and function are included to allow users to do their own tone detection operations in the dialplan. ASTERISK-29546 Change-Id: Ie38c395000f4fd4d04e942e8658e177f8f499b26 2021-09-08 09:36 +0000 [2806a45034] George Joseph * res_snmp: Add -fPIC to _ASTCFLAGS With gcc 11, res/res_snmp.c and res/snmp/agent.c need the -fPIC option added to its _ASTCFLAGS. ASTERISK-29634 Change-Id: I34649c85e075fd954e578378fabf798c3f038f50 2021-09-04 12:07 +0000 [858cb386fd] Sean Bright * term.c: Add support for extended number format terminfo files. ncurses 6.1 introduced an extended number format for terminfo files which the terminfo parsing in Asterisk is not able to parse. This results in some TERM values that do support color (screen-256color on Ubuntu 20.04 for example) to not get a color console. ASTERISK-29630 #close Change-Id: I27a4fcfab502219924af2d6b1c46feba92903cb3 2021-09-07 12:32 +0000 [347e9a7e4d] Sean Bright * app_voicemail.c: Ability to silence instructions if greeting is present. There is an option to silence voicemail instructions but it does not take into consideration if a recorded greeting exists or not. Add a new 'S' option that does that. ASTERISK-29632 #close Change-Id: I03f2f043a9beb9d99deab302247e2a8686066fb4 2021-09-03 00:30 +0000 [c1a575907b] Jasper Hafkenscheid * res_srtp: Disable parsing of not enabled cryptos When compiled without extended srtp crypto suites also disable parsing these from received SDP. This prevents using these, as some client implementations are not stable. ASTERISK-29625 Change-Id: I7dafb29be1cdaabdc984002573f4bea87520533a 2021-09-06 11:37 +0000 [689c703b2c] Sean Bright * dns.c: Load IPv6 DNS resolvers if configured. IPv6 nameserver addresses are stored in different part of the __res_state structure, so look there if we appear to have support for it. ASTERISK-28004 #close Change-Id: I67067077d8a406ee996664518d9c8fbf11f6977d 2021-09-08 07:52 +0000 [de19836c24] George Joseph * bridge_softmix: Suppress error on topology change failure There are conditions under which a failure to change topology is expected so there's no need to print an ERROR message. ASTERISK-29618 Reported by: Alexander Change-Id: Idc168b8588e018bf3a23769f08c4ad646086d481 2021-08-31 02:50 +0000 [479cc17f45] sungtae kim * resource_channels.c: Fix wrong external media parameter parse Fixed ARI external media handler to accept body parameters. ASTERISK-29622 Change-Id: I49509c48a6cbc0fb4165bfa4f834b5e8b9ace20d 2021-08-25 10:21 +0000 [5c836c8e36] Sean Bright * config_options: Handle ACO arrays correctly in generated XML docs. There are 3 separate changes here but they are all closely related: * Only try to set matchfield attributes on 'field' nodes * We need to adjust how we treat the category pointer based on the value of the category_match, to avoid memory corruption. We now generate a regex-like string when match types other than ACO_WHITELIST and ACO_BLACKLIST are used. * Switch app_agent_pool from ACO_BLACKLIST_ARRAY to ACO_BLACKLIST_EXACT since we only have one category we need to ignore, not two. ASTERISK-29614 #close Change-Id: I7be7bdb1bb9814f942bc6bb4fdd0a55a7b7efe1e 2021-08-18 14:44 +0000 [5a685249ce] Naveen Albert * chan_iax2: Add ANI2/OLI information element Adds an information element for ANI2 so that Originating Line Information can be transmitted over IAX2 channels. ASTERISK-29605 #close Change-Id: Iaeacdf6ccde18eaff7f776a0f49fee87dcb549d2 2021-08-31 15:03 +0000 [042ae05be7] Mark Murawski * pbx_ael: Fix crash and lockup issue regarding 'ael reload' Currently pbx_ael does not check if a reload is currently pending before proceeding with a reload. This can cause multiple threads to operate at the same time on what should be mutex protected data. This change adds protection to reloading to ensure only one ael reload is executing at a time. ASTERISK-29609 #close Change-Id: I5ed392ad226f6e4e7696ad742076d3e45c57af35 2021-08-25 06:49 +0000 [dd980e00b4] Naveen Albert * app_read: Allow reading # as a digit Allows for the digit # to be read as a digit, just like any other DTMF digit, as opposed to forcing it to be used as an end of input indicator. The default behavior remains unchanged. ASTERISK-18454 #close Change-Id: I3033432adb9d296ad227e76b540b8b4a2417665b 2021-04-05 14:06 +0000 [ac492f2ff8] Sebastien Duthil * res_rtp_asterisk: Automatically refresh stunaddr from DNS This allows the STUN server to change its IP address without having to reload the res_rtp_asterisk module. The refresh of the name resolution occurs first when the module is loaded, then recurringly, slightly after the previous DNS answer TTL expires. ASTERISK-29508 #close Change-Id: I7955a046293f913ba121bbd82153b04439e3465f 2021-08-24 20:04 +0000 [e660a2c03b] Naveen Albert * bridge_basic: Change warning to verbose if transfer cancelled The attended transfer feature will emit a warning if the user cancels the transfer or the attended transfer doesn't complete for any reason. Changes the warning to a verbose message, since nothing is actually wrong here. ASTERISK-29612 #close Change-Id: I64c93cdb21360a0a8d45e9cb6db3af8168f66e6d 2021-08-20 15:35 +0000 [c7af46995e] Naveen Albert * app_queue: Don't reset queue stats on reload Prevents reloads of app_queue from also resetting queue statistics. Also preserves individual queue agent statistics if we're just reloading members. ASTERISK-28701 Change-Id: Ib5d4cdec175e44de38ef0f6ede4a7701751766f1 2021-08-25 09:23 +0000 [82d6bd7ec9] Alexander Traud * res_rtp_asterisk: sqrt(.) requires the header math.h. ASTERISK-29616 Change-Id: I6c01623926bf10ccac32612687a50fdab3ba0900 2021-08-25 09:29 +0000 [8410afc7ab] Alexander Traud * dialplan: Add one static and fix two whitespace errors. Change-Id: Ia14d515ab63e773097adc6af772ca7123a392f83 2021-06-19 23:36 +0000 [241686f860] Sarah Autumn * sig_analog: Changes to improve electromechanical signalling compatibility This changeset is intended to address compatibility issues encountered when interfacing Asterisk to electromechanical telephone switches that implement ANI-B, ANI-C, or ANI-D. In particular the behaviours that this impacts include: - FGC-CAMA did not work at all when using MF signaling. Modified the switch case block to send calls to the correct part of the signaling-handling state machine. - For FGC-CAMA operation, the delay between called number ST and second wink for ANI spill has been made configurable; previously all calls were made to wait for one full second. - After the ANI spill, previous behavior was to require a 'ST' tone to advance the call. This has been changed to allow 'STP' 'ST2P' or 'ST3P' as well, for compatibility with ANI-D. - Store ANI2 (ANI INFO) digits in the CALLERID(ANI2) channel variable. - For calls with an ANI failure, No. 1 Crossbar switches will send forward a single-digit failure code, with no calling number digits and no ST pulse to terminate the spill. I've made the ANI timeout configurable so to reduce dead air time on calls with ANI fail. - ANI info digits configurable. Modern digital switches will send 2 digits, but ANI-B sends only a single info digit. This caused the ANI reported by Asterisk to be misaligned. - Changed a confusing log message to be more informative. ASTERISK-29518 Change-Id: Ib7e27d987aee4ed9bc3663c57ef413e21b404256 2021-08-05 11:55 +0000 [eb486db3af] Andre Barbosa * media_cache: Don't lock when curl the remote file When playing a remote sound file, which is not in cache, first we need to download it with ast_bucket_file_retrieve. This can take a while if the remote host is slow. The current CURL timeout is 180secs, so in extreme situations, it can take 3 minutes to return. Because ast_media_cache_retrieve has a lock on all function, while we are waiting for the delayed download, Asterisk is not able to play any more files, even the files already cached locally. ASTERISK-29544 #close Change-Id: I8d4142b463ae4a1d4c41bff2bf63324821567408 2021-08-16 08:25 +0000 [b72425b1f0] George Joseph * res_pjproject: Allow mapping to Asterisk TRACE level Allow mapping pjproject log messages to the Asterisk TRACE log level. The defaults were also changes to log pjproject levels 3,4 to DEBUG and 5,6 to TRACE. Previously 3,4,5,6 all went to DEBUG. ASTERISK-29582 Change-Id: I859a37a8dec263ed68099709cfbd3e665324c72d 2021-08-12 16:02 +0000 [dffc5e7f5c] Naveen Albert * app_milliwatt: Timing fix The Milliwatt application uses incorrect tone timings that cause it to play the 1004 Hz tone constantly. This adds an option to enable the correct timing behavior, so that the Milliwatt application can be used for milliwatt test lines. The default behavior remains unchanged for compatability reasons, even though it is incorrect. ASTERISK-29575 #close Change-Id: I73ccc6c6fcaa31931c6fff3b85ad1805b2ce9d8c 2021-06-28 09:25 +0000 [c52ef4ac79] Naveen Albert * func_math: Return integer instead of float if possible The MIN, MAX, and ABS functions all support float arguments, but currently return floats even if the arguments are all integers and the response is a whole number, in which case the user is likely expecting an integer. This casts the float to an integer before printing into the response buffer if possible. ASTERISK-29495 Change-Id: I902d29eacf3ecd0f8a6a5e433c97f0421d205488 2021-08-04 09:46 +0000 [9cac1c16da] Naveen Albert * app_morsecode: Add American Morse code Previously, the Morsecode application only supported international Morse code. This adds support for American Morse code and adds an option to configure the frequency used in off intervals. Additionally, the application checks for hangup between tones to prevent application execution from continuing after hangup. ASTERISK-29541 Change-Id: I172431a2e18e6527d577e74adfb05b154cba7bd4 2021-08-04 14:16 +0000 [3eec5b8c5c] Naveen Albert * func_scramble: Audio scrambler function Adds a function to scramble audio on a channel using whole spectrum frequency inversion. This can be used as a privacy enhancement with applications like ChanSpy or other potentially sensitive audio. ASTERISK-29542 Change-Id: I01020769d91060a1f56a708eb405f87648d1a67e 2021-08-04 19:28 +0000 [cb1dfecc11] Naveen Albert * app_originate: Add ability to set codecs A list of codecs to use for dialplan-originated calls can now be specified in Originate, similar to the ability in call files and the manager action. Additionally, we now default to just using the slin codec for originated calls, rather than all the slin* codecs up through slin192, which has been known to cause issues and inconsistencies from AMI and call file behavior. ASTERISK-29543 Change-Id: I96a1aeb83d54b635b7a51e1b4680f03791622883 2021-08-16 11:11 +0000 [a8e8b3aaff] Alexander Traud * BuildSystem: Remove two dead exceptions for compiler Clang. Commit 305ce3d added -Wno-parentheses-equality to Makefile.rules, turning the previous two warning suppressions from commit e9520db redundant. Let us remove the latter. Change-Id: I0b471254b31e6e05902062761dded4b3e626c7ac 2021-08-10 12:41 +0000 [121860e3f6] Sean Bright * mgcp: Remove dead debug code ASTERISK-20339 #close Change-Id: I36f364aaa1971241d8f3ea1a5909b463d185a2d5 2021-08-11 06:15 +0000 [13fd0789a2] Joshua C. Colp * policy: Add deprecation and removal versions to modules. app_meetme is deprecated in 19, to be removed in 21. app_osplookup is deprecated in 19, to be removed in 21. chan_alsa is deprecated in 19, to be removed in 21. chan_mgcp is deprecated in 19, to be removed in 21. chan_skinny is deprecated in 19, to be removed in 21. res_pktccops is deprecated in 19, to be removed in 21. cdr_mysql was deprecated in 1.8, to be removed in 19. app_mysql was deprecated in 1.8, to be removed in 19. app_ices was deprecated in 16, to be removed in 19. app_macro was deprecated in 16, to be removed in 21. app_fax was deprecated in 16, to be removed in 19. app_url was deprecated in 16, to be removed in 19. app_image was deprecated in 16, to be removed in 19. app_nbscat was deprecated in 16, to be removed in 19. app_dahdiras was deprecated in 16, to be removed in 19. cdr_syslog was deprecated in 16, to be removed in 19. chan_oss was deprecated in 16, to be removed in 19. chan_phone was deprecated in 16, to be removed in 19. chan_sip was deprecated in 17, to be removed in 21. chan_nbs was deprecated in 16, to be removed in 19. chan_misdn was deprecated in 16, to be removed in 19. chan_vpb was deprecated in 16, to be removed in 19. res_config_sqlite was deprecated in 16, to be removed in 19. res_monitor was deprecated in 16, to be removed in 21. conf2ael was deprecated in 16, to be removed in 19. muted was deprecated in 16, to be removed in 19. ASTERISK-29548 ASTERISK-29549 ASTERISK-29550 ASTERISK-29551 ASTERISK-29552 ASTERISK-29553 ASTERISK-29554 ASTERISK-29555 ASTERISK-29557 ASTERISK-29558 ASTERISK-29559 ASTERISK-29560 ASTERISK-29561 ASTERISK-29562 ASTERISK-29563 ASTERISK-29564 ASTERISK-29565 ASTERISK-29566 ASTERISK-29567 ASTERISK-29568 ASTERISK-29569 ASTERISK-29570 ASTERISK-29571 ASTERISK-29572 ASTERISK-29573 ASTERISK-29574 Change-Id: Ic3bee31a10d42c4b3bbc913d893f7b2a28a27131 2021-08-12 11:00 +0000 [288d018fb7] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.6.0 2021-06-16 15:30 +0000 [118d848238] Naveen Albert * func_frame_drop: New function Adds function to selectively drop specified frames in the TX or RX direction on a channel, including control frames. ASTERISK-29478 Change-Id: I8147c9d55d74e2e48861edba6b22f930920541ec 2021-08-02 12:33 +0000 [0b1a629ecd] Alexander Traud * aelparse: Accept an included context with timings. With Asterisk 1.6.0, in the main parser for the configuration file extensions.conf, the separator was changed from vertical bar to comma. However, the first separator was not changed in aelparse; it still had to be a vertical bar, and no comma was allowed. Additionally, this change allows the vertical bar for the first and last parameter again, even in the main parser, because the vertical bar was still accepted for the other parameters. ASTERISK-29540 Change-Id: I882e17c73adf4bf2f20f9046390860d04a9f8d81 2021-08-03 11:30 +0000 [628830921e] Kevin Harwell * format_ogg_speex: Implement a "not supported" write handler This format did not specify a "write" handler, so when attempting to write to it (ast_writestream) a crash would occur. This patch adds a default handler that simply issues a "not supported" warning, thus no longer crashing. ASTERISK-29539 Change-Id: I8f6ddc7cc3b15da30803be3b1cf68e2ba0fbce91 2021-08-05 14:28 +0000 Asterisk Development Team * asterisk 18.6.0-rc1 Released. 2021-06-28 08:48 +0000 [adf707f2ae] Naveen Albert * cdr_adaptive_odbc: Prevent filter warnings Previously, if CDR filters were used so that not all CDR records used all sections defined in cdr_adaptive_odbc.conf, then warnings will always be emitted (if each CDR record is unique to a particular section, n-1 warnings to be specific). This turns the offending warning log into a verbose message like the other one, since this behavior is intentional and not indicative of anything wrong. ASTERISK-29494 Change-Id: Ifd314fa9298722bc99494d5ca2658a5caa94a5f8 2021-07-25 16:53 +0000 [940f6c4a03] Naveen Albert * app_queue: Allow streaming multiple announcement files Allows multiple files comprising an agent announcement to be played by separating on the ampersand, similar to the multi-file support in other Asterisk applications. ASTERISK-29528 Change-Id: Iec600d8cd5ba14aa1e4e37f906accb356cd7891a 2021-04-13 02:36 +0000 [1e4ed61a2b] Igor Goncharovsky * res_pjsip_header_funcs: Add PJSIP_HEADERS() ability to read header by pattern PJSIP currently does not provide a function to replace SIP_HEADERS() function to get a list of headers from INVITE request. It may be used to get all X- headers in case the actual set and names of headers unknown. ASTERISK-29389 Change-Id: Ic09d395de71a0021e0d6c5c29e1e19d689079f8b 2021-07-08 07:34 +0000 [71dd1d91ad] Rijnhard Hessel * res_statsd: handle non-standard meter type safely Meter types are not well supported, lacking support in telegraf, datadog and the official statsd servers. We deprecate meters and provide a compliant fallback for any existing usages. A flag has been introduced to allow meters to fallback to counters. ASTERISK-29513 Change-Id: I5fcb385983a1b88f03696ff30a26b55c546a1dd7 2021-07-22 11:39 +0000 [feb1e06ac5] under * codec_builtin.c: G729 audio gets corrupted by Asterisk due to smoother If Asterisk gets G.729 6-byte VAD frames inbound, then at outbound Asterisk sends this G.729 stream with non-continuous timestamps. This makes the audio stream not-playable at the receiver side. Linphone isn't able to play such an audio - lots of disruptions are heard. Also I had complains of bad audio from users which use other types of phones. After debugging, I found this is a regression connected with RTP Smoother (main/smoother.c). Smoother has a special code to handle G.729 VAD frames (search for AST_SMOOTHER_FLAG_G729 in smoother.c). However, this flag is never set in Asterisk-12 and newer. Previously it has been set (see Asterisk-11). ASTERISK-29526 #close Change-Id: I6f51ecb1a3ecd9c6d59ec5a6811a27446e17065d 2021-06-16 15:26 +0000 [016f6a0e14] Naveen Albert * app_dtmfstore: New application to store digits Adds application to asynchronously collect digits dialed on a channel in the TX or RX direction using a framehook and stores them in a specified variable, up to a configurable number of digits. ASTERISK-29477 Change-Id: I51aa93fc9507f7636ac44806c4420ce690423e6f 2021-07-27 07:53 +0000 [9117f09d28] Joshua C. Colp * docs: Remove embedded macro in WaitForCond XML documentation. Change-Id: I40c6514e1843e320f3cbe0b2c70d4a98c0e35b9c 2021-07-22 16:56 +0000 [993b3ba919] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.5.1 2021-06-14 13:28 +0000 [3025ef4f6e] Kevin Harwell * AST-2021-009 - pjproject-bundled: Avoid crash during handshake for TLS If an SSL socket parent/listener was destroyed during the handshake, depending on timing, it was possible for the handling callback to attempt access of it after the fact thus causing a crash. ASTERISK-29415 #close Change-Id: I105dacdcd130ea7fdd4cf2010ccf35b5eaf1432d 2021-05-10 17:59 +0000 [2a141a58b6] Kevin Harwell * AST-2021-008 - chan_iax2: remote crash on unsupported media format If chan_iax2 received a packet with an unsupported media format, for example vp9, then it would set the frame's format to NULL. This could then result in a crash later when an attempt was made to access the format. This patch makes it so chan_iax2 now ignores/drops frames received with unsupported media format types. ASTERISK-29392 #close Change-Id: Ifa869a90dafe33eed8fd9463574fe6f1c0ad3eb1 2021-04-28 07:36 +0000 [523a795289] Joshua C. Colp * AST-2021-007 - res_pjsip_session: Don't offer if no channel exists. If a re-INVITE is received after we have sent a BYE request then it is possible for no channel to be present on the session. If this occurs we allow PJSIP to produce the offer instead. Since the call is being hung up if it produces an incorrect offer it doesn't actually matter. This also ensures that code which produces SDP does not need to handle if a channel is not present. ASTERISK-29381 Change-Id: I673cb88c432f38f69b2e0851d55cc57a62236042 2021-06-29 11:07 +0000 [2c3defc6c6] Andre Barbosa * res_stasis_playback: Check for chan hangup on play_on_channels Verify `ast_check_hangup` before looping to the next sound file. If the call is already hangup we just break the cycle. It also ensures that the PlaybackFinished event is sent if the call was hangup. This is also use-full when we are playing a big list of file for a channel that is hangup. Before this patch Asterisk will give a warning for every sound not played and fire a PlaybackStart for every sound file on the list tried to be played. With the patch we just break the playback cycle when the chan is hangup. ASTERISK-29501 #close Change-Id: Ic4e1c01b974c9a1f2d9678c9d6b380bcfc69feb8 2021-07-15 15:04 +0000 [30feaadabf] Sean Bright * res_pjsip_stir_shaken: RFC 8225 compliance and error message cleanup. From RFC 8225 Section 5.2.1: The "dest" claim is a JSON object with the claim name of "dest" and MUST have at least one identity claim object. The "dest" claim value is an array containing one or more identity claim JSON objects representing the destination identities of any type (currently "tn" or "uri"). If the "dest" claim value array contains both "tn" and "uri" claim names, the JSON object should list the "tn" array first and the "uri" array second. Within the "tn" and "uri" arrays, the identity strings should be put in lexicographical order, including the scheme-specific portion of the URI characters. Additionally, make it clear that there was a failure to sign the JWT payload and not necessarily a memory allocation failure. Change-Id: Ia8733b861aef6edfaa9c2136e97b447a01578dc9 2021-06-30 17:15 +0000 [4bd975f415] Sebastien Duthil * stun: Emit warning message when STUN request times out Without this message, it is not obvious that the reason is STUN timeout. ASTERISK-29507 #close Change-Id: I26e4853c23a1aed324552e1b9683ea3c05cb1f74 2021-07-02 10:15 +0000 [76c09b1cfd] Sean Bright * res_http_media_cache.c: Parse media URLs to find extensions. Use the URI parsing functions to parse playback URLs in order to find their file extensions. For backwards compatibility, we first look at the full URL, then at any Content-Type header, and finally at just the path portion of the URL. ASTERISK-27871 #close Change-Id: I16d0682f6d794be96539261b3e48f237909139cb 2021-07-13 10:31 +0000 [fcebc4d24a] Sean Bright * main/cdr.c: Correct Party A selection. This appears to just have been a copy/paste error from 6258bbe7. Fix suggested by Ross Beer in ASTERISK~29166. Change-Id: I51e0de92042e53f37597c6f83a75621ef0d1ae37 2021-05-26 12:09 +0000 [a41d192e99] Naveen Albert * app_reload: New Reload application Adds an application to reload modules from within the dialplan. ASTERISK-29454 Change-Id: Ic8ab025d8b38dd525b872b41c465c999c5810774 2021-07-08 09:32 +0000 [b9bb96ffed] Igor Goncharovsky * res_ari: Fix audiosocket segfault Add check that data parameter specified when audiosocket used for externalMedia. ASTERISK-29514 #close Change-Id: Ie562f03c5d6c3835a3631f376b3d43e75b8f9617 2021-06-30 08:07 +0000 [146b59df3f] Sean Bright * res_pjsip_config_wizard.c: Add port matching support. In f8b0c2c9 we added support for port numbers in 'match' statements but neglected to include that support in the PJSIP config wizard. The removed code would have also prevented IPv6 addresses from being successfully used in the config wizard as well. ASTERISK-29503 #close Change-Id: Idd5bbfd48009e7a741757743dbaea68e2835a34d 2021-05-22 09:31 +0000 [1b21b1abf7] Naveen Albert * app_waitforcond: New application While several applications exist to wait for a certain event to occur, none allow waiting for any generic expression to become true. This application allows for waiting for a condition to become true, with configurable timeout and checking interval. ASTERISK-29444 Change-Id: I08adf2824b8bc63405778cf355963b5005612f41 2021-06-04 06:11 +0000 [283812e492] Andre Barbosa * res_stasis_playback: Send PlaybackFinish event only once for errors When we try to play a list of sound files in the same Play command, we get only one PlaybackFinish event, after all sounds are played. But in the case where the Play fails (because channel is destroyed for example), Asterisk will send one PlaybackFinish event for each sound file still to be played. If the list is big, Asterisk is sending many events. This patch adds a failed state so we can understand that the play failed. On that case we don't send the event, if we still have a list of sounds to be played. When we reach the last sound, we send the PlaybackFinish with the failed state. ASTERISK-29464 #close Change-Id: I4c2e5921cc597702513af0d7c6c2c982e1798322 2021-06-17 07:57 +0000 [88da59efe7] George Joseph * jitterbuffer: Correct signed/unsigned mismatch causing assert If the system time has stepped backwards because of a time adjustment between the time a frame is timestamped and the time we check the timestamps in abstract_jb:hook_event_cb(), we get a negative interval, but we don't check for that there. abstract_jb:hook_event_cb() then calls fixedjitterbuffer:fixed_jb_get() (via abstract_jb:jb_get_fixed) and the first thing that does is assert(interval >= 0). There are several issues with this... * abstract_jb:hook_event_cb() saves the interval in a variable named "now" which is confusing in itself. * "now" is defined as an unsigned int which converts the negative value returned from ast_tvdiff_ms() to a large positive value. * fixed_jb_get()'s parameter is defined as a signed int so the interval gets converted back to a negative value. * fixed_jb_get()'s assert is NOT an ast_assert but a direct define that points to the system assert() so it triggers even in production mode. So... * hook_event_cb()'s "now" was renamed to "relative_frame_start" and changed to an int64_t. * hook_event_cb() now checks for a negative value right after retrieving both the current and framedata timestamps and just returns the frame if the difference is negative. * fixed_jb_get()'s local define of ASSERT() was changed to call ast_assert() instead of the system assert(). ASTERISK-29480 Reported by: Dan Cropp Change-Id: Ic469dec73c2edc3ba134cda6721a999a9714f3c9 2021-05-21 19:08 +0000 [c4236dcff2] Naveen Albert * app_dial: Expanded A option to add caller announcement Hitherto, the A option has made it possible to play audio upon answer to the called party only. This option is expanded to allow for playback of an audio file to the caller instead of or in addition to the audio played to the answerer. ASTERISK-29442 Change-Id: If6eed3ff5c341dc8c588c8210987f2571e891e5e 2021-06-21 06:31 +0000 [5e1cb3253c] Joshua C. Colp * core: Don't play silence for Busy() and Congestion() applications. When using the Busy() and Congestion() applications the function ast_safe_sleep is used by wait_for_hangup to safely wait on the channel. This function may send silence if Asterisk is configured to do so using the transmit_silence option. In a scenario where an answered channel dials a Local channel either directly or through call forwarding and the Busy() or Congestion() dialplan applications were executed with the transmit_silence option enabled the busy or congestion tone would not be heard. This is because inband generation of tones (such as busy and congestion) is stopped when other audio is sent to the channel they are being played to. In the given scenario the transmit_silence option would result in silence being sent to the channel, thus stopping the inband generation. This change adds a variant of ast_safe_sleep which can be used when silence should not be played to the channel. The wait_for_hangup function has been updated to use this resulting in the tones being generated as expected. ASTERISK-29485 Change-Id: I066bfc987a3ad6f0ccc88e0af4cd63f6a4729133 2021-05-07 01:18 +0000 [6b041d1092] Bernd Zobl * res_pjsip_sdp_rtp: Evaluate remotely held for Session Progress With the fix for ASTERISK_28754 channels are no longer put on hold if an outbound INVITE is answered with a "Session Progress" containing "inactive" audio. The previous change moved the evaluation of the media attributes to `negotiate_incoming_sdp_stream()` to have the `remotely_held` status available when building the SDP in `create_outgoing_sdp_stream()`. This however means that an answer to an outbound INVITE, which does not traverse `negotiate_incoming_sdp_stream()`, cannot set the `remotely_held` status anymore. This change moves the check so that both, `negotiate_incoming_sdp_stream()` and `apply_negotiated_sdp_stream()` can do the checks. ASTERISK-29479 Change-Id: Icde805a819399d5123b688e1ed1d2bcd9d5b0f75 2021-06-17 14:44 +0000 Asterisk Development Team * asterisk 18.5.0-rc1 Released. 2021-06-17 09:39 +0000 [0747162d4f] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.5.0 2021-06-16 08:50 +0000 [702e1d33b5] George Joseph * res_pjsip_messaging: Overwrite user in existing contact URI When the MessageSend destination is in the form PJSIP/@ and the endpoint's contact URI already has a user component, that user component will now be replaced with when creating the request URI. ASTERISK_29404 Change-Id: I80e5910fa25c803d1440da0594a0d6b34b6b4ad5 2021-03-16 11:45 +0000 [804788037e] Bernd Zobl * res_pjsip/pjsip_message_filter: set preferred transport in pjsip_message_filter Set preferred transport when querying the local address to use in filter_on_tx_messages(). This prevents the module to erroneously select the wrong transport if more than one transports of the same type (TCP or TLS) are configured. ASTERISK-29241 Change-Id: I598e60257a7f92b29efce1fb3e9a2fc06f1439b6 2021-06-10 09:34 +0000 [2b174a38fe] Naveen Albert * pbx_builtins: Corrects SayNumber warning Previously, SayNumber always emitted a warning if the caller hung up during execution. Usually this isn't correct, so check if the channel hung up and, if so, don't emit a warning. ASTERISK-29475 Change-Id: Ieea4a67301c6ea83bbc7690c1d4808d79a704594 2021-05-22 07:53 +0000 [6b67821098] Jaco Kroon * func_lock: Prevent module unloading in-use module. The scenario where a channel still has an associated datastore we cannot unload since there is a function pointer to the destroy and fixup functions in play. Thus increase the module ref count whenever we allocate a datastore, and decrease it during destroy. In order to tighten the race that still exists in spite of this (below) add some extra failure cases to prevent allocations in these cases. Race: If module ref is zero, an LOCK or TRYLOCK is invoked (near) simultaneously on a channel that has NOT PREVIOUSLY taken a lock, and if in such a case the datastore is created *prior* to unloading being set to true (first step in module unload) then it's possible that the module will unload with the destructor being called (and segfault) post the module being unloaded. The module will however wait for such locks to release prior to unloading. If post that we can recheck the module ref before returning the we can (in theory, I think) eliminate the last of the race. This race is mostly theoretical in nature. Change-Id: I21a514a0b56755c578a687f4867eacb8b59e23cf Signed-off-by: Jaco Kroon 2021-05-22 07:29 +0000 [6f303335d3] Jaco Kroon * func_lock: Add "dialplan locks show" cli command. For example: arthur*CLI> dialplan locks show func_lock locks: Name Requesters Owner uls-autoref 0 (unlocked) 1 total locks listed. Obviously other potentially useful stats could be added (eg, how many times there was contention, how many times it failed etc ... but that would require keeping the stats and I'm not convinced that's worth the effort. This was useful to troubleshoot some other issues so submitting it. Change-Id: Ib875e56feb49d523300aec5f36c635ed74843a9f Signed-off-by: Jaco Kroon 2021-05-22 07:42 +0000 [a3df5d7de8] Jaco Kroon * func_lock: Fix memory corruption during unload. AST_TRAVERSE accessess current as current = current->(field).next ... and since we free current (and ast_free poisons the memory) we either end up on a ast_mutex_lock to a non-existing lock that can never be obtained, or a segfault. Incidentally add logging in the "we have to wait for a lock to release" case, and remove an ineffective statement that sets memory that was just cleared by ast_calloc to zero. Change-Id: Id19ba3d9867b23d0e6783b97e6ecd8e62698b8c3 Signed-off-by: Jaco Kroon 2021-05-22 07:48 +0000 [6bd741b77d] Jaco Kroon * func_lock: Fix requesters counter in error paths. In two places we bail out with failure after we've already incremented the requesters counter, if this occured then it would effectively result in unload to wait indefinitely, thus preventing clean shutdown. Change-Id: I362a6c0dc424f736d4a9c733d818e72d19675283 Signed-off-by: Jaco Kroon 2021-05-25 10:36 +0000 [a611a0cd42] Naveen Albert * app_originate: Allow setting Caller ID and variables Caller ID can now be set on the called channel and Variables can now be set on the destination using the Originate application, just as they can be currently using call files or the Manager Action. ASTERISK-29450 Change-Id: Ia64cfe97d2792bcbf4775b3126cad662922a8b66 2021-06-10 16:24 +0000 [26059f8616] Sean Bright * menuselect: Fix description of several modules. The text description needs to be the last thing on the AST_MODULE_INFO line to be pulled in properly by menuselect. Change-Id: I0c913e36fea8b661f42e56920b6c5513ae8fd832 2021-05-23 19:20 +0000 [a40e58a4da] Naveen Albert * app_confbridge: New ConfKick() application Adds a new ConfKick() application, which may be used to kick a specific channel, all channels, or all non-admin channels from a specified conference bridge, similar to existing CLI and AMI commands. ASTERISK-29446 Change-Id: I5d96b683880bfdd27b2ab1c3f2e897c5046ded9b 2021-06-02 08:11 +0000 [6873c5f3e4] Naveen Albert * sip_to_pjsip: Fix missing cases Adds the "auto" case which is valid with both chan_sip dtmfmode and chan_pjsip's dtmf_mode, adds subscribecontext to subscribe_context conversion, and accounts for cipher = ALL being invalid. ASTERISK-29459 Change-Id: Ie27d6606efad3591038000e5f3c34fa94730f6f2 2021-06-02 08:25 +0000 [99573f9540] Naveen Albert * res_pjsip_dtmf_info: Hook flash Adds hook flash recognition support for application/hook-flash. ASTERISK-29460 Change-Id: I1d060fa89a7cf41244c98f892fff44eb1c9738ea 2021-05-20 09:51 +0000 [a861522467] Naveen Albert * app_confbridge: New option to prevent answer supervision A new user option, answer_channel, adds the capability to prevent answering the channel if it hasn't already been answered yet. ASTERISK-29440 Change-Id: I26642729d0345f178c7b8045506605c8402de54b 2021-04-22 13:07 +0000 [8e2672d2a4] George Joseph * res_pjsip_messaging: Refactor outgoing URI processing * Implemented the new "to" parameter of the MessageSend() dialplan application. This allows a user to specify a complete SIP "To" header separate from the Request URI. * Completely refactored the get_outbound_endpoint() function to actually handle all the destination combinations that we advertized as supporting. * We now also accept a destination in the same format as Dial()... PJSIP/number@endpoint * Added lots of debugging. ASTERISK-29404 Reported by Brian J. Murrell Change-Id: I67a485196d9199916468f7f98bfb9a0b993a4cce 2021-05-16 10:21 +0000 [9106c9d1f1] Naveen Albert * func_math: Three new dialplan functions Introduces three new dialplan functions, MIN and MAX, which can be used to calculate the minimum or maximum of up to two numbers, and ABS, an absolute value function. ASTERISK-29431 Change-Id: I2bda9269d18f9d54833c85e48e41fce0e0ce4d8d 2021-05-19 13:45 +0000 [26a38c4084] Ben Ford * STIR/SHAKEN: Add Date header, dest->tn, and URL checking. STIR/SHAKEN requires a Date header alongside the Identity header, so that has been added. Still on the outgoing side, we were missing the dest->tn section of the JSON payload, so that has been added as well. Moving to the incoming side, URL checking has been added to the public cert URL to ensure that it starts with http. https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021 Change-Id: Idee5b1b5e45bc3b483b3070e46ce322dca5b3f1c 2021-05-24 13:38 +0000 [16e4a9d8cf] Joshua C. Colp * res_pjsip: On partial transport reload also move factories. For connection oriented transports PJSIP uses factories to produce transports. When doing a partial transport reload we need to also move the factory of the transport over so that anything referencing the transport (such as an endpoint) has the factory available. ASTERISK-29441 Change-Id: Ieae0fb98eab2d9257cad996a1136e5a62d307161 2021-05-20 08:18 +0000 [033c2a2283] Naveen Albert * func_volume: Add read capability to function. Up until now, the VOLUME function has been write only, so that TX/RX values can be set but not read afterwards. Now, previously set TX/RX values can be read later. ASTERISK-29439 Change-Id: Ia23e92fa2e755c36e9c8e69f2940d2703ccccb5f 2021-04-13 02:57 +0000 [59d15c4c2a] Evgenios_Greek * stasis: Fix "FRACK!, Failed assertion bad magic number" when unsubscribing When unsubscribing from an endpoint technology a FRACK would occur due to incorrect reference counting. This fixes that issue, along with some other issues. Fixed a typo in get_subscription when calling ao2_find as it needed to pass the endpoint ID and not the entire object. Fixed scenario where a subscription would get returned when it shouldn't have been when searching based on endpoint technology. A doulbe unreference has also been resolved by only explicitly releasing the reference held by tech_subscriptions. ASTERISK-28237 #close Reported by: Lucas Tardioli Silveira Change-Id: Ia91b15f8e5ea68f850c66889a6325d9575901729 2021-05-20 02:15 +0000 [b21d4d1b87] Joseph Nadiv * res_pjsip.c: Support endpoints with domain info in username In multidomain environments, it is desirable to create PJSIP endpoints with the domain info in the endpoint name in pjsip_endpoint.conf. This resulted in an error with registrations, NOTIFY, and OPTIONS packet generation. This commit will detect if there is an @ in the endpoint identifier and generate the URI accordingly so NOTIFY and OPTIONS From headers will generate correctly. ASTERISK-28393 Change-Id: I96f8d01dfdd5573ba7a28299e46271dd4210b619 2021-05-20 07:51 +0000 [3aed363716] Joshua C. Colp * res_rtp_asterisk: Set correct raddr port on RTCP srflx candidates. RTCP ICE candidates use a base address derived from the RTP candidate. The port on the base address was not being updated to the RTCP port. This change sets the base port to the RTCP port and all is well. ASTERISK-29433 Change-Id: Ide2d2115b307bfd3c2dfbc4d187515d724519040 2021-05-25 05:38 +0000 [60ed1847b8] Joshua C. Colp * asterisk: We've moved to Libera Chat! Change-Id: I48c1933dd79b50ddc0a6793acec4754b4e95c575 2021-05-19 13:13 +0000 [0f8e2174a7] Jeremy Lainé * res_rtp_asterisk: make it possible to remove SOFTWARE attribute By default Asterisk reports the PJSIP version in a SOFTWARE attribute of every STUN packet it sends. This may not be desired in a production environment, and RFC5389 recommends making the use of the SOFTWARE attribute a configurable option: https://datatracker.ietf.org/doc/html/rfc5389#section-16.1.2 This patch adds a `stun_software_attribute` yes/no option to make it possible to omit the SOFTWARE attribute from STUN packets. ASTERISK-29434 Change-Id: Id3f2b1dd9584536ebb3a1d7e8395fd8b3e46860b 2021-04-15 10:43 +0000 [655ee680cd] George Joseph * res_pjsip_outbound_authenticator_digest: Be tolerant of RFC8760 UASs RFC7616 and RFC8760 allow more than one WWW-Authenticate or Proxy-Authenticate header per realm, each with different digest algorithms (including new ones like SHA-256 and SHA-512-256). Thankfully however a UAS can NOT send back multiple Authenticate headers for the same realm with the same digest algorithm. The UAS is also supposed to send the headers in order of preference with the first one being the most preferred. We're supposed to send an Authorization header for the first one we encounter for a realm that we can support. The UAS can also send multiple realms, especially when it's a proxy that has forked the request in which case the proxy will aggregate all of the Authenticate headers and then send them all back to the UAC. It doesn't stop there though... Each realm can require a different username from the others. There's also nothing preventing each digest algorithm from having a unique password although I'm not sure if that adds any benefit. So now... For each Authenticate header we encounter, we have to determine if we support the digest algorithm and, if not, just skip the header. We then have to find an auth object that matches the realm AND the digest algorithm or find a wildcard object that matches the digest algorithm. If we find one, we add it to the results vector and read the next Authenticate header. If the next header is for the same realm AND we already added an auth object for that realm, we skip the header. Otherwise we repeat the process for the next header. In the end, we'll have accumulated a list of credentials we can pass to pjproject that it can use to add Authentication headers to a request. NOTE: Neither we nor pjproject can currently handle digest algorithms other than MD5. We don't even have a place for it in the ast_sip_auth object. For this reason, we just skip processing any Authenticate header that's not MD5. When we support the others, we'll move the check into the loop that searches the objects. Changes: * Added a new API ast_sip_retrieve_auths_vector() that takes in a vector of auth ids (usually supplied on a call to ast_sip_create_request_with_auth()) and populates another vector with the actual objects. * Refactored res_pjsip_outbound_authenticator_digest to handle multiple Authenticate headers and set the stage for handling additional digest algorithms. * Added a pjproject patch that allows them to ignore digest algorithms they don't support. This patch has already been merged upstream. * Updated documentation for auth objects in the XML and in pjsip.conf.sample. * Although res_pjsip_authenticator_digest isn't affected by this change, some debugging and a testsuite AMI event was added to facilitate testing. Discovered during OpenSIPit 2021. ASTERISK-29397 Change-Id: I3aef5ce4fe1d27e48d61268520f284d15d650281 2021-04-14 09:44 +0000 [83c2a16b2e] Joseph Nadiv * res_pjsip_dialog_info_body_generator: Add LOCAL/REMOTE tags in dialog-info+xml RFC 4235 Section 4.1.6 describes XML elements that should be sent to subscribed endpoints to identify the local and remote participants in the dialog. This patch adds this functionality to PJSIP by iterating through the ringing channels causing the NOTIFY, and inserts the channel info into the dialog so that information is properly passed to the endpoint in dialog-info+xml. ASTERISK-24601 Patch submitted: Joshua Elson Modified by: Joseph Nadiv and Sean Bright Tested by: Joseph Nadiv Change-Id: I20c5cf5b45f34d7179df6573c5abf863eb72964b 2021-05-13 09:47 +0000 [bfc25e5de2] Naveen Albert * app_voicemail: Configurable voicemail beep Hitherto, VoiceMail() played a non-customizable beep tone to indicate the caller could leave a message. In some cases, the beep may not be desired, or a different tone may be desired. To increase flexibility, a new option allows customization of the tone. If the t option is specified, the default beep will be overridden. Supplying an argument will cause it to use the specified file for the tone, and omitting it will cause it to skip the beep altogether. If the option is not used, the default behavior persists. ASTERISK-29349 Change-Id: I1c439c0011497e28a28067fc1cf1e654c8843280 2021-05-13 10:32 +0000 [0ad3504ce0] Naveen Albert * AMI: Add AMI event to expose hook flash events Although Asterisk can receive and propogate flash events, it currently provides no mechanism for doing anything with them itself. This AMI event allows flash events to be processed by Asterisk. Additionally, AST_CONTROL_FLASH is included in a switch statement in channel.c to avoid throwing a warning when we shouldn't. ASTERISK-29380 Change-Id: Ie17ffe65086e0282c88542e38eed6a461ec79e81 2021-05-13 08:50 +0000 [7b82587dd6] Naveen Albert * chan_sip: Expand hook flash recognition. Some ATAs send hook flash events as application/hook-flash, rather than a DTMF event. Now, we also recognize hook-flash as a flash event. ASTERISK-29370 Change-Id: I1c3b82a040dff3affcd94bad8ce33edc90c04725 2021-05-11 12:00 +0000 [6d5cac1d10] Joshua C. Colp * pjsip: Add patch for resolving STUN packet lifetime issues. In some cases it was possible for a STUN packet to be destroyed prematurely or even destroyed partially multiple times. This patch provided by Teluu fixes the lifetime of these packets and ensures they aren't partially destroyed multiple times. https://github.com/pjsip/pjproject/pull/2709 ASTERISK-29377 Change-Id: Ie842ad24ddf345e01c69a4d333023f05f787abca 2021-05-13 10:13 +0000 [283fa3a93b] Naveen Albert * main/file.c: Don't throw error on flash event. AST_CONTROL_FLASH isn't accounted for in a switch statement in file.c where it should be ignored. Adding this to the switch ensures a warning isn't thrown on RFC2833 flash events, since nothing's amiss. ASTERISK-29372 Change-Id: I4fa549bfb7ba1894a4044de999ea124877422fbc 2021-05-12 21:20 +0000 [78d7862463] Sean Bright * chan_pjsip: Correct misleading trace message ASTERISK-29358 #close Change-Id: I050daff67066873df4e8fc7f4bd977c1ca06e647 2021-04-26 17:00 +0000 [a84d34035a] Ben Ford * STIR/SHAKEN: Switch to base64 URL encoding. STIR/SHAKEN encodes using base64 URL format. Currently, we just use base64. New functions have been added that convert to and from base64 encoding. The origid field should also be an UUID. This means there's no reason to have it as an option in stir_shaken.conf, as we can simply generate one when creating the Identity header. https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021 Change-Id: Icf094a2a54e87db91d6b12244c9f5ba4fc2e0b8c 2021-05-11 12:26 +0000 [e0cbdfe063] Ben Ford * STIR/SHAKEN: OPENSSL_free serial hex from openssl. We're getting the serial number of the certificate from openssl and freeing it with ast_free(), but it needs to be freed with OPENSSL_free() instead. Now we duplicate the string and free the one from openssl with OPENSSL_free(), which means we can still use ast_free() on the returned string. https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021 Change-Id: Ia6e1a4028c1933a0e1d204b769ebb9f5a11f00ab 2021-04-21 11:12 +0000 [5e6508b56f] Ben Ford * STIR/SHAKEN: Fix certificate type and storage. During OpenSIPit, we found out that the public certificates must be of type X.509. When reading in public keys, we use the corresponding X.509 functions now. We also discovered that we needed a better naming scheme for the certificates since certificates with the same name would cause issues (overwriting certs, etc.). Now when we download a public certificate, we get the serial number from it and use that as the name of the cached certificate. The configuration option public_key_url in stir_shaken.conf has also been renamed to public_cert_url, which better describes what the option is for. https://wiki.asterisk.org/wiki/display/AST/OpenSIPit+2021 Change-Id: Ia00b20835f5f976e3603797f2f2fb19672d8114d 2021-04-22 13:07 +0000 [40bdfff73b] George Joseph * Updates for the MessageSend Dialplan App Enhancements: * The MessageSend dialplan application now takes an optional third argument that can set the message's "To" field on outgoing messages. It's an alternative to using the MESSAGE(to) dialplan function. NOTE: No channel driver currently implements this field. A follow-on commit for res_pjsip_messaging will implement it for the chan_pjsip channel driver. * To prevent confusion with the first argument, currently named "to", it's been renamed to "destination". Its function, creating the request URI, hasn't changed. * The documentation for MessageSend was updated to be more clear about the parameters and how they interact the MESSAGE() dialplan function. * With the rename of MessageSend's first parameter, and the fact that message.c references elements in chan_sip.c, res_pjsip_messaging.c and res_xmpp, they each needed documentation updates to use MessageDestinationInfo instead of MessageToInfo. * appdocsxml.dtd was updated to include a missing element declaration for "dataType". This was showing up as an error in Eclipse's dtd editor. * Despite the changes in this commit, there should be no impact to current users of MessageSend. Change-Id: I6fb5b569657a02866a66ea352fd53d30d8ac965a 2021-04-30 15:21 +0000 [78f518622d] Sean Bright * translate.c: Avoid refleak when checking for a translation path Change-Id: Idbd61ff77545f4a78b06a5064b55112e774b70e6 2021-04-28 07:17 +0000 [8faed04b01] Joshua C. Colp * chan_local: Skip filtering audio formats on removed streams. When a stream topology is provided to chan_local when dialing it filters the audio formats down. This operation did not skip streams which were removed (that have no formats) resulting in calling being aborted. This change causes such streams to be skipped. ASTERISK-29407 Change-Id: I1de8b98727cb2d10f4bc287da0b5fdcb381addd6 2021-04-27 12:31 +0000 [95414fc918] Sean Bright * res_rtp_asterisk: More robust timestamp checking We assume that a timestamp value of 0 represents an 'uninitialized' timestamp, but 0 is a valid value. Add a simple wrapper to be able to differentiate between whether the value is set or not. This also removes the fix for ASTERISK~28812 which should not be needed if we are checking the last timestamp appropriately. ASTERISK-29030 #close Change-Id: Ie70d657d580d9a1f2877e25a6ef161c5ad761cf7 2021-04-29 15:32 +0000 Asterisk Development Team * asterisk 18.4.0-rc1 Released. 2021-04-29 10:25 +0000 [1949d828b7] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.4.0 2021-04-23 12:37 +0000 [d2dcd15bd8] Sean Bright * res_pjsip.c: OPTIONS processing can now optionally skip authentication ASTERISK-27477 #close Change-Id: I68f6715bba92a525149e35d142a49377a34a1193 2021-04-21 06:42 +0000 [dec44306cf] Jean Aunis * translate.c: Take sampling rate into account when checking codec's buffer size Up/down sampling changes the number of samples produced by a translation. This must be taken into account when checking the codec's buffer size. ASTERISK-29328 Change-Id: I9aebe2f8788e00321a7f5c47aa97c617f39e9055 2021-04-25 04:45 +0000 [c2f4925ee0] Joshua C. Colp * svn: Switch to https scheme. Some versions of SVN seemingly don't follow the redirect to https. Change-Id: Ia7c76c18cb620bcf56f08e1211a7d80d321fe253 2021-04-20 08:42 +0000 [5f3d96a765] George Joseph * res_pjsip: Update documentation for the auth object Change-Id: I2f76867ce02ec611964925159be099de83346e38 2021-04-02 07:21 +0000 [88aec107df] George Joseph * bridge_channel_write_frame: Check for NULL channel There is a possibility, when bridge_channel_write_frame() is called, that the bridge_channel->chan will be NULL. The first thing bridge_channel_write_frame() does though is call ast_channel_is_multistream() which had no check for a NULL channel and therefore caused a segfault. Since it's still possible for bridge_channel_write_frame() to write the frame to the other channels in the bridge, we don't want to bail before we call ast_channel_is_multistream() but we can just skip the multi-channel stuff. So... bridge_channel_write_frame() only calls ast_channel_is_multistream() if bridge_channel->chan is not NULL. As a safety measure, ast_channel_is_multistream() now returns false if the supplied channel is NULL. ASTERISK-29379 Reported-by: Vyrva Igor Reported-by: Ross Beer Change-Id: Idfe62dbea8c69813ecfd58e113a6620dc42352ce 2021-04-01 10:38 +0000 [404533c149] Sean Bright * loader.c: Speed up deprecation metadata lookup Only use an XPath query once per module, then just navigate the DOM for everything else. Change-Id: Ia0336a7185f9180ccba4b6f631a00f9a22a36e92 2021-04-01 08:39 +0000 [19eef2a6dc] George Joseph * res_prometheus: Clone containers before iterating The channels, bridges and endpoints scrape functions were grabbing their respective global containers, getting the count of entries, allocating metric arrays based on that count, then iterating over the container. If the global container had new objects added after the count was taken and the metric arrays were allocated, we'd run out of metric entries and attempt to write past the end of the arrays. Now each of the scape functions clone their respective global containers and all operations are done on the clone. Since the clone is stable between getting the count and iterating over it, we can't run past the end of the metrics array. ASTERISK-29130 Reported-By: Francisco Correia Reported-By: BJ Weschke Reported-By: Sébastien Duthil Change-Id: If0c8e40853bc0e9429f2ba9c7f5f358d90c311af 2021-03-10 09:03 +0000 [a9a9864478] Joshua C. Colp * loader: Output warnings for deprecated modules. Using the information from the MODULEINFO XML we can now output useful information at the end of module loading for deprecated modules. This includes the version it was deprecated in, the version it will be removed in, and the replacement if available. ASTERISK-29339 Change-Id: I2080dab97d2186be94c421b41dabf6d79a11611a 2021-03-22 15:22 +0000 [17c86dcfaa] Kevin Harwell * res_rtp_asterisk: Fix standard deviation calculation For some input to the standard deviation algorithm extremely large, and wrong numbers were being calculated. This patch uses a new formula for correctly calculating both the running mean and standard deviation for the given inputs. ASTERISK-29364 #close Change-Id: Ibc6e18be41c28bed3fde06d612607acc3fbd621f 2021-03-29 17:40 +0000 [0ad1ff8a72] Kevin Harwell * res_rtp_asterisk: Don't count 0 as a minimum lost packets The calculated minimum lost packets represents the lowest number of lost packets missed during an RTCP report interval. Zero of course is the lowest, but the idea is that this value contain the lowest number of lost packets once some have been missed. This patch checks to make sure the number of lost packets over an interval is not zero before checking and setting the minimum value. Also, this patch updates the rtp lost packet test to check for packet loss over several reports vs one. Change-Id: I07d6e21cec61e289c2326138d6bcbcb3c3d5e008 2021-03-31 12:17 +0000 [1414b9cc57] Kevin Harwell * res_rtp_asterisk: Statically declare rtp_drop_packets_data object This patch makes the drop_packets_data object static. Change-Id: If4f9b21fa0c47d41a35b6b05941d978efb4da87b 2021-03-29 17:52 +0000 [b0d828f14a] Joshua C. Colp * res_rtp_asterisk: Only raise flash control frame on end. Flash in RTP is conveyed the same as DTMF, just with a specific digit. In Asterisk however we do flash as a single control frame. This change makes it so that only on end do we provide the flash control frame to the core. Previously we would provide a flash control frame on both begin and end, causing flash to work improperly. ASTERISK-29373 Change-Id: I1accd9c6e859811336e670e698bd8bd124f33226 2021-03-05 12:53 +0000 [b912b31853] Kevin Harwell * res_rtp_asterisk: Add a DEVMODE RTP drop packets CLI command This patch makes it so when Asterisk is compiled in DEVMODE a CLI command is available that allows someone to drop incoming RTP packets. The command allows for dropping of packets once, or on a timed interval (e.g. drop 10 packets every 5 seconds). A user can also specify to drop packets by IP address. Change-Id: I25fa7ae9bad6ed68e273bbcccf0ee51cae6e7024 2021-03-30 06:59 +0000 [65a4a3a4e6] Joshua C. Colp * res_pjsip: Give error when TLS transport configured but not supported. Change-Id: I058af496021ff870ccec2d8cbade637b348ab80b 2021-03-05 12:47 +0000 [15de2f1727] Kevin Harwell * time: Add timeval create and unit conversion functions Added a TIME_UNIT enumeration, and a function that converts a string to one of the enumerated values. Also, added functions that create and initialize a timeval object using a specified value, and unit type. Change-Id: Ic31a1c3262a44f77a5ef78bfc85dcf69a8d47392 2021-03-24 08:38 +0000 [35302efe73] Sean Bright * app_queue: Add alembic migration to add ringinuse to queue_members. ASTERISK-28356 #close Change-Id: I53a1bfdd3113d620bea88349019173a2f3f0ae39 2021-03-28 10:47 +0000 [be3153346b] Sean Bright * modules.conf: Fix more differing usages of assignment operators. I missed the changes in 18 and master in the previous review. ASTERISK-24434 #close Change-Id: Ieb132b2a998ce96daa9c9acf26535a974b895876 2021-03-24 10:52 +0000 [bbfb8f2b9d] Ben Ford * logger.conf.sample: Add more debug documentation. Change-Id: Iff0e713f2120d8dce8e1e26924b99ed17f9d9dff 2021-03-23 17:24 +0000 [31364fa4c8] Sean Bright * queues.conf.sample: Correct 'context' documentation. ASTERISK-24631 #close Change-Id: I8bf8776906a72ee02f24de6a85345940b9ff6b6f 2021-03-23 15:15 +0000 [e27fa9eceb] Sean Bright * app_queue.c: Remove dead 'updatecdr' code. Also removed the sample documentation, and some oddly-placed documentation about the timeout argument to the Queue() application itself. There is a large section on the timeout behavior below. ASTERISK-26614 #close Change-Id: I8f84e8304b50305b7c4cba2d9787a5d77c3a6217 2021-03-19 09:11 +0000 [a0009c807e] Mark Murawski * logger: Console sessions will now respect logger.conf dateformat= option The 'core' console (ie: asterisk -c) does read logger.conf and does use the dateformat= option. Whereas 'remote' consoles (ie: asterisk -r -T) does not read logger.conf and uses a hard coded dateformat option for printing received verbose messages: main/logger.c: static char dateformat[256] = "%b %e %T" This change will load logger.conf for each remote console session and use the dateformat= option to set the per-line timestamp for verbose messages Change-Id: I3ea10990dbd920e9f7ce8ff771bc65aa7f4ea8c1 ASTERISK-25358: #close Reported-by: Igor Liferenko 2021-03-19 15:57 +0000 [4393207751] Sean Bright * app_queue.c: Don't crash when realtime queue name is empty. ASTERISK-27542 #close Change-Id: If0b9719380a25533d2aed1053cff845dc3a4854a 2021-03-18 11:14 +0000 [c78d0ce429] George Joseph * res_pjsip_session: Make reschedule_reinvite check for NULL topologies When the check for equal topologies was added to reschedule_reinvite() it was assumed that both the pending and active media states would actually have non-NULL topologies. We since discovered this isn't the case. We now only test for equal topologies if both media states have non-NULL topologies. The logic had to be rearranged a bit to make sure that we cloned the media states if their topologies were non-NULL but weren't equal. ASTERISK-29215 Change-Id: I61313cca7fc571144338aac826091791b87b6e17 2021-03-19 04:56 +0000 [55c467eab1] Joshua C. Colp * app_queue: Only send QueueMemberStatus if status changes. If a queue member was updated with the same status multiple times each time a QueueMemberStatus event would be sent which would be a duplicate of the previous. This change makes it so that the QueueMemberStatus event is only sent if the status actually changes. ASTERISK-29355 Change-Id: I580c60d992a0a8f2bea8b91c868771b3b490d116 2021-03-19 08:52 +0000 [ed2f637b47] Joshua C. Colp * core_unreal: Fix deadlock with T.38 control frames. When using the ast_unreal_lock_all function no channel locks can be held before calling it. This change unlocks the channel that indicate was called on before doing so and then relocks it afterwards. ASTERISK-29035 Change-Id: Id65016201b5f9c9519a216e250f9101c629e19e9 2021-03-01 17:32 +0000 [f213833514] Joshua C. Colp * res_pjsip: Add support for partial transport reload. Some configuration items for a transport do not result in the underlying transport changing, but instead are just state we keep ourselves and use. It is perfectly reasonable to change these items. These include local_net and external_* information. ASTERISK-29354 Change-Id: I027857ccfe4419f460243e562b5f098434b3d43a 2021-03-13 05:01 +0000 [f47c5cbdf9] Jaco Kroon * menuselect: exit non-zero in case of failure on --enable|disable options. ASTERISK-29348 Change-Id: I77e3466435f5a51a57538b29addb68d811af238d Signed-off-by: Jaco Kroon 2021-03-17 10:28 +0000 [2e7fc84398] Joshua C. Colp * res_rtp_asterisk: Force resync on SSRC change. When an SSRC change occurs the timestamps are likely to change as well. As a result we need to reset the timestamp mapping done in the calc_rxstamp function so that they map properly from timestamp to real time. This previously occurred but due to packet retransmission support the explicit setting of the marker bit was not effective. ASTERISK-29352 Change-Id: I2d4c8f93ea24abc1030196706de2d70facf05a5a 2021-03-10 08:05 +0000 [6aac148d59] Joshua C. Colp * menuselect: Add ability to set deprecated and removed versions. The "deprecated_in" and "removed_in" information can now be set in MODULEINFO for a module and is then displayed in menuselect so users can be aware of when a module is slated to be deprecated and then removed. ASTERISK-29337 Change-Id: I6952889cf08e0e9e99cf8b43f99b3cef4688087a 2021-03-10 04:47 +0000 [be3e469f98] Joshua C. Colp * documentation: Fix non-matching module support levels. Some modules have a different support level documented in their MODULEINFO XML and Asterisk module definition. This change brings the two in sync for the modules which were not matching. ASTERISK-29336 Change-Id: If2f819103d4a271e2e0624ef4db365e897fa3d35 2021-03-10 08:18 +0000 [60fb559ccc] Joshua C. Colp * xml: Allow deprecated_in and removed_in for MODULEINFO. ASTERISK-29337 Change-Id: I2211b7da8d29369f8649aeabce07679da0787f2b 2021-03-09 08:54 +0000 [60800b038a] Joshua C. Colp * xml: Embed module information into core XML documentation. This change embeds the MODULEINFO block of modules into the core XML documentation. This provides a shared mechanism for use by both menuselect and Asterisk for information and a definitive source of truth. ASTERISK-29335 Change-Id: Ifbfd5c700049cf320a3e45351ac65dd89bc99d90 2021-03-11 17:23 +0000 Asterisk Development Team * asterisk 18.3.0-rc1 Released. 2021-03-11 10:33 +0000 [263f906af4] Kevin Harwell * manager: Increase the non breaking AMI version number ASTERISK~29244 added three new AMI events, so bump the version number. Change-Id: I0e77fa36d38fb27dec3481d4ef08131330da0632 2021-03-11 10:40 +0000 [0afd37e3b5] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.3.0 2021-03-09 18:35 +0000 [f7bda066bb] Joshua C. Colp * channel: Fix crash in suppress API. There exists an inconsistency with framehook usage such that it is only on reads that the frame should be freed, not on writes as well. ASTERISK-29071 Change-Id: I5ef918ebe4debac8a469e8d43bf9d6b673e8e472 2021-02-24 12:00 +0000 [23e41313a8] Jaco Kroon * func_callerid+res_agi: Fix compile errors related to -Werror=zero-length-bounds Change-Id: I75152cece8a00b7523d542e5ac22796f9595692b Signed-off-by: Jaco Kroon 2021-02-24 12:34 +0000 [52707fba7f] Jaco Kroon * app.h: Fix -Werror=zero-length-bounds compile errors in dev mode. Change-Id: I5c104dc1f8417ccd3d01faf86e84ccbf89bc3b31 Signed-off-by: Jaco Kroon 2021-03-06 16:57 +0000 [94debe5085] Sean Bright * app_dial.c: Only send DTMF on first progress event. ASTERISK-29329 #close Change-Id: Ic58e7a17f1ff3f785a5b21dced88682581149601 2021-03-05 11:16 +0000 [262473c6d9] Alexander Traud * res_format_attr_*: Parameter Names are Case-Insensitive. see RFC 4855: parameter names are case-insensitive both in media type strings and in the default mapping to the SDP a=fmtp attribute. This change is required for H.263+ because some implementations are known to use even mixed-case. This does not fix ASTERISK~29268 because H.264 was not fixed. This approach here lowers/uppers both parameter names and parameter values. H.264 needs a different approach because one of its parameter values is not case-insensitive: sprop-parameter-sets is Base64. Change-Id: Idf2a73457be231647aed3c87b1da197afba86892 2021-03-05 11:45 +0000 [4fc0e16838] Alexander Traud * chan_iax2: System Header strings is included via asterisk.h/compat.h. The system header strings was included mistakenly with commit 3de0204. That header is included via asterisk.h and there via the compat.h. Change-Id: I3dc49060e275295f785670c87cc65fd3c3abd24a 2021-03-08 15:43 +0000 [3084084648] Sean Bright * modules.conf: Fix differing usage of assignment operators. ASTERISK-24434 #close Change-Id: I0144e8d65d878128da59dcf3df12ca8cee47d6db 2021-03-08 14:06 +0000 [e4cd7a7d0b] Sean Bright * strings.h: ast_str_to_upper() and _to_lower() are not pure. Because they modify their argument they are not pure functions and should not be marked as such, otherwise the compiler may optimize them away. ASTERISK-29306 #close Change-Id: Ibec03a08522dd39e8a137ece9bc6a3059dfaad5f 2021-03-08 17:16 +0000 [16e4d1f36f] Sean Bright * res_musiconhold.c: Plug ref leak caused by ao2_replace() misuse. ao2_replace() bumps the reference count of the object that is doing the replacing, which is not what we want. We just want to drop the old ref on the old object and update the pointer to point to the new object. Pointed out by George Joseph in #asterisk-dev Change-Id: Ie8167ed3d4b52b9d1ea2d785f885e8c27206743d 2021-02-19 05:50 +0000 [90ef6a14a7] Torrey Searle * res/res_rtp_asterisk: generate new SSRC on native bridge end For RTCP to work, we update the ssrc to be the one corresponding to the native bridge while active. However when the bridge ends we should generate a new SSRC as the sequence numbers will not continue from the native bridge left off. ASTERISK-29300 #close Change-Id: I23334b6934d2bf6490bda4bbf6414d96b8d17d10 2021-03-01 15:35 +0000 [a9acbd19f3] Joshua C. Colp * sorcery: Add support for more intelligent reloading. Some sorcery objects actually contain dynamic content that can change despite the underlying configuration itself not changing. A good example of this is the res_pjsip_endpoint_identifier_ip module which allows specifying hostnames. While the configuration may not change between reloads the DNS information of the hostnames can. This change adds the ability for a sorcery object to be marked as having dynamic contents which is then taken into account when reloading by the sorcery file based config module. If there is an object with dynamic content then a reload will be forced while if there are none then the existing behavior of not reloading occurs. ASTERISK-29321 Change-Id: I9342dc55be46cc00204533c266a68d972760a0b1 2021-03-02 12:55 +0000 [269bb08ea2] George Joseph * res_pjsip_refer: Move the progress dlg release to a serializer Although the dlg session count was incremented in a pjsip servant thread, there's no guarantee that the last thread to unref this progress object was one. Before we decrement, we need to make sure that this is either a servant thread or that we push the decrement to a serializer that is one. Because pjsip_dlg_dec_session requires the dialog lock, we don't want to wait on the task to complete if we had to push it to a serializer. Change-Id: I8ff2d5d94be3ff04298394070434e22a7d3cbc41 2021-03-03 12:31 +0000 [5f1c21e4ca] Joshua C. Colp * res_pjsip_registrar: Include source IP and port in log messages. When registering it can be useful to see the source IP address and port in cases where multiple devices are using the same endpoint or when anonymous is in use. ASTERISK-29325 Change-Id: Ie178a6f55f53f8473035854c411bc3d056e0a2e0 2021-03-03 12:44 +0000 [682f7d9437] Joshua C. Colp * asterisk: Update copyright. ASTERISK-29326 Change-Id: Ia95dbfb66e2d11ac4d1228444283bb2e4d77396a 2021-02-25 13:50 +0000 [77328142b4] Ben Ford * AST-2021-006 - res_pjsip_t38.c: Check for session_media on reinvite. When Asterisk sends a reinvite negotiating T38 faxing, it's possible a crash can occur if the response contains a m=image and zero port. The reinvite callback code now checks session_media to see if it is null or not before trying to access the udptl variable on it. ASTERISK-29305 Change-Id: I1dfc51c5fa586e38579ede4bc228edee213ccaa9 2021-01-28 08:39 +0000 [0323293142] Alexander Traud * res_format_attr_h263: Generate valid SDP fmtp for H.263+. Fixed: * RFC 4629 does not allow the value "0" for MPI, K, and N. * Allow value "0" for PAR. * BPP is printed only when specified because "0" has a meaning. New: * Added CPCF and MaxBR. * Some implementations provide CIF without MPI: a=fmtp:xx CIF;F=1 Although a violation of RFC 3555 section 3, we can support that. Changed: * Resorts the CIFs from large to small which partly fixes ASTERISK~29267. Change-Id: I95a650c715007b8dde11a77cb37d9c6c123a441e 2021-02-24 07:04 +0000 [976b1a1d7a] Joshua C. Colp * res_pjsip_nat: Don't rewrite Contact on REGISTER responses. When sending a SIP response to an incoming REGISTER request we don't want to change the Contact header as it will contain the Contacts registered to the AOR and not our own Contact URI. ASTERISK-29235 Change-Id: I35a0723545281dd01fcd5cae497baab58720478c 2021-03-03 07:32 +0000 [b43b81d953] Joshua C. Colp * channel: Fix memory leak in suppress API. A frame suppression API exists as part of channels which allows audio frames to or from a channel to be dropped. The MuteAudio AMI action uses this API to perform its job. This API uses a framehook to intercept flowing audio and drop it when appropriate. It is the responsibility of the framehook to free the frame it is given if it changes the frame. The suppression API failed to do this resulting in a leak of audio frames. This change adds the freeing of these frames. ASTERISK-29071 Change-Id: Ie50acd454d672d36af914050c327d2e120d8ba7b 2021-01-27 14:01 +0000 [df8d335ad1] Salah Ahmed * res_rtp_asterisk: Check remote ICE reset and reset local ice attrb This change will check is the remote ICE session got reset or not by checking the offered ufrag and password with session. If the remote ICE reset session then Asterisk reset its local ufrag and password to reject binding request with Old ufrag and Password. ASTERISK-29266 Change-Id: I9c55e79a7af98a8fbb497d336b828ba41bc34eeb 2021-01-07 08:25 +0000 [3286c04856] Holger Hans Peter Freyther * pjsip: Generate progress (once) when receiving a 180 with a SDP ASTERISK-29105 Change-Id: If1615fe7115fe544ef974b044d3cea5c48b94a38 2021-02-28 03:24 +0000 [7b052ec965] Nico Kooijman * main: With Dutch language year after 2020 is not spoken in say.c Implemented the english way of saying the year in ast_say_date_with_format_nl. Currently the numbers are spoken correctly until 2020 and stopped working this year. ASTERISK-29297 #close Reported-by: Jacek Konieczny Change-Id: If5918eed5ab05df31df4dd23f08a909a60f6aba4 2021-02-24 20:51 +0000 [dedfb334bd] Nick French * res_pjsip: dont return early from registration if init auth fails If set_outbound_initial_authentication_credentials() fails, handle_client_registration() bails early without creating or sending a register message. [set_outbound_initial_authentication_credentials() failures can occur during the process of retrieving an oauth access token.] The return from handle_client_registration is ignored, so returning an error doesn't do any good. This is a real problem when the registration request is a re-register, because then the registration will still be marked 'active' despite the re-register never being sent at all. So instead, log a warning but let the registration be created and sent (and probably fail) and follow the normal registration failed retry/abort logic. ASTERISK-29315 #close Change-Id: I2e03b1ea7fba1fa1a8279086aa4b17679e7fa7fa 2021-02-23 10:14 +0000 [d5e73d2121] Alexei Gradinari * res_fax: validate the remote/local Station ID for UTF-8 format If the remote Station ID contains invalid UTF-8 characters the asterisk fails to publish the Stasis and ReceiveFax status messages. json.c: Error building JSON from '{s: s, s: s}': Invalid UTF-8 string. 0: /usr/sbin/asterisk(ast_json_vpack+0x98) [0x4f3f28] 1: /usr/sbin/asterisk(ast_json_pack+0x8c) [0x4f3fcc] 2: /usr/sbin/asterisk(ast_channel_publish_varset+0x2b) [0x57aa0b] 3: /usr/sbin/asterisk(pbx_builtin_setvar_helper+0x121) [0x530641] 4: /usr/lib64/asterisk/modules/res_fax.so(+0x44fe) [0x7f27f4bff4fe] ... stasis_channels.c: Error creating message json.c: Error building JSON from '{s: s, s: s, s: s, s: s, s: s, s: s, s: o}': Invalid UTF-8 string. 0: /usr/sbin/asterisk(ast_json_vpack+0x98) [0x4f3f28] 1: /usr/sbin/asterisk(ast_json_pack+0x8c) [0x4f3fcc] 2: /usr/lib64/asterisk/modules/res_fax.so(+0x5acd) [0x7f27f4c00acd] ... res_fax.c: Error publishing ReceiveFax status message This patch replaces the invalid UTF-8 Station IDs with an empty string. ASTERISK-29312 #close Change-Id: Ieb00b6ecf67db3bfca787649caa8517f29d987db 2021-02-25 13:55 +0000 [6673c1b177] Sean Bright * app_page.c: Don't fail to Page if beep sound file is missing ASTERISK-16799 #close Change-Id: I40367b0d6dbf66a39721bde060c8b2d734a61cf4 2021-02-19 13:25 +0000 [15afabdf8e] George Joseph * res_pjsip_refer: Refactor progress locking and serialization Although refer_progress_notify() always runs in the progress serializer, the pjproject evsub module itself can cause the subscription to be destroyed which then triggers refer_progress_on_evsub_state() to clean it up. In this case, it's possible that refer_progress_notify() could get the subscription pulled out from under it while it's trying to use it. At one point we tried to have refer_progress_on_evsub_state() push the cleanup to the serializer and wait for its return before returning to pjproject but since pjproject calls its state callbacks with the dialog locked, this required us to unlock the dialog while waiting for the serialized cleanup, then lock it again before returning to pjproject. There were also still some cases where other callers of refer_progress_notify() weren't using the serializer and crashes were resulting. Although all callers of refer_progress_notify() now use the progress serializer, we decided to simplify the locking so we didn't have to unlock and relock the dialog in refer_progress_on_evsub_state(). Now, refer_progress_notify() holds the dialog lock for its duration and since pjproject also holds the dialog lock while calling refer_progress_on_evsub_state() (which does the cleanup), there should be no more chances for the subscription to be cleaned up while still being used to send NOTIFYs. To be extra safe, we also now increment the session count on the dialog when we create a progress object and decrement the count when the progress is destroyed. ASTERISK-29313 Change-Id: I97a8bb01771a3c85345649b8124507f7622a8480 2021-02-24 16:05 +0000 [be0a61bc3d] Kevin Harwell * res_rtp_asterisk: Add packet subtype during RTCP debug when relevant For some RTCP packet types the report count is actually the packet's subtype. This was not being reflected in the packet debug output. This patch makes it so for some RTCP packet types a "Packet Subtype" is now output in the debug replacing the "Reception reports" (i.e count). Change-Id: Id4f4b77bb37077a4c4f039abd6a069287bfefcb8 2021-02-15 13:02 +0000 [beb579bc99] Boris P. Korzun * res_config_pgsql: Limit realtime_pgsql() to return one (no more) record. Added a SELECT 'LIMIT' clause to realtime_pgsql() and refactored the function. ASTERISK-29293 #close Change-Id: If5a6d4b1072ea2e6e89059b21139d554a74b34f5 2021-02-15 12:24 +0000 [83b0f5963f] Ben Ford * res_pjsip_session.c: Check topology on re-invite. Removes an unnecessary check for the conditional that compares the stream topologies to see if they are equal to suppress re-invites. This was a problem when a Digium phone received an INVITE that offered codecs different than what it supported, causing Asterisk to send the re-invite. ASTERISK-29303 Change-Id: I04dc91befb2387904e28a9aaeaa3bcdbcaa7fa63 2021-02-23 05:28 +0000 [7ab53fce7a] Jaco Kroon * res_odbc_transaction: correctly initialise forcecommit value from DSN. Also improve the in-process documentation to clarify that the value is initialised from the DSN and not default false, but that the DSN's value is default false if unset. ASTERISK-29311 #close Change-Id: I46e2379f7b0656034442bce77cb37ccd4e61098d Signed-off-by: Jaco Kroon 2021-02-16 12:33 +0000 [1af2a84c8b] Joshua C. Colp * res_pjsip_session: Always produce offer on re-INVITE without SDP. When PJSIP receives a re-INVITE without an SDP offer the INVITE session library will first call the on_create_offer callback and if unavailable then use the active negotiated SDP as the offer. In some cases this would result in a different SDP then was previously used without an incremented SDP version number. The two known cases are: 1. Sending an initial INVITE with a set of codecs and having the remote side answer with a subset. The active negotiated SDP would have the pruned list but would not have an incremented SDP version number. 2. Using re-INVITE for unhold. We would modify the active negotiated SDP but would not increment the SDP version. To solve these, and potential other unknown cases, the on_create_offer callback has now been implemented which produces a fresh offer with incremented SDP version number. This better fits within the model provided by the INVITE session library. ASTERISK-28452 Change-Id: I2d81048d54edcb80fe38fdbb954a86f0a58281a1 2021-02-10 11:59 +0000 [916d5d5e45] Jaco Kroon * app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS This partially reverts commit 3d1bf3c537bba0416f691f48165fdd0a32554e8a, specifically for app.h. This works with both gcc 9.3.0 and 10.2.0 now, both for C and C++ (as tested with external modules). ASTERISK-29287 Change-Id: I5b9f02a9b290675682a1d13f1788fdda597c9fca Signed-off-by: Jaco Kroon 2019-09-13 08:02 +0000 [985d3e4940] Ivan Poddubnyi * app_queue: Fix conversion of complex extension states into device states Queue members using dialplan hints as a state interface must handle INUSE+RINGING hint as RINGINUSE devstate, and INUSE + ONHOLD as INUSE. ASTERISK-28369 Change-Id: I127e06943d4b4f1afc518f9e396de77449992b9f 2021-02-05 06:29 +0000 [1adf9368ee] Alexander Traud * chan_sip: Filter pass-through audio/video formats away, again. Instead of looking for pass-through formats in the list of transcodable formats (which is going to find nothing), go through the result which is going to be the jointcaps of the tech_pvt of the channel. Finally, only with that list, ast_format_cap_remove(.) is going to succeed. This restores the behaviour of Asterisk 1.8. However, it does not fix ASTERISK_29282 because that issue report is about chan_sip and PJSIP. Here, only chan_sip is fixed because PJSIP does not even call ast_rtp_instance_available_formats -> ast_translate_available_format. Change-Id: Icade2366ac2b82935b95a9981678c987da2e8c34 2021-02-17 14:51 +0000 [bee35fe04a] Jaco Kroon * func_odbc: Introduce minargs config and expose ARGC in addition to ARGn. minargs enables enforcing of minimum count of arguments to pass to func_odbc, so if you're unconditionally using ARG1 through ARG4 then this should be set to 4. func_odbc will generate an error in this case, so for example [FOO] minargs = 4 and ODBC_FOO(a,b,c) in dialplan will now error out instead of using a potentially leaked ARG4 from Gosub(). ARGC is needed if you're using optional argument, to verify whether or not an argument has been passed, else it's possible to use a leaked ARGn from Gosub (app_stack). So now you can safely do ${IF($[${ARGC}>3]?${ARGV}:default value)} kind of thing. Change-Id: I6ca0b137d90b03f6aa9c496991f6cbf1518f6c24 Signed-off-by: Jaco Kroon 2021-01-13 14:05 +0000 [092628c982] Sebastien Duthil * app_mixmonitor: Add AMI events MixMonitorStart, -Stop and -Mute. ASTERISK-29244 Change-Id: I1862d58264c2c8b5d8983272cb29734b184d67c5 2021-02-09 11:25 +0000 [dbd8908f8d] George Joseph * res_pjsip_refer: Always serialize calls to refer_progress_notify refer_progress_notify wasn't always being called from the progress serializer. This could allow clearing notification->progress->sub in one thread while another was trying to use it. * Instances where refer_progress_notify was being called in-line, have been changed to use ast_sip_push_task(). Change-Id: Idcf1934c4e873f2c82e2d106f8d9f040caf9fa1e 2021-02-01 15:24 +0000 [fad0cf12e6] Kevin Harwell * AST-2021-002: Remote crash possible when negotiating T.38 When an endpoint requests to re-negotiate for fax and the incoming re-invite is received prior to Asterisk sending out the 200 OK for the initial invite the re-invite gets delayed. When Asterisk does finally send the re-inivite the SDP includes streams for both audio and T.38. This happens because when the pending topology and active topologies differ (pending stream is not in the active) in the delayed scenario the pending stream is appended to the active topology. However, in the fax case the pending stream should replace the active. This patch makes it so when a delay occurs during fax negotiation, to or from, the audio stream is replaced by the T.38 stream, or vice versa instead of being appended. Further when Asterisk sent the re-invite with both audio and T.38, and the endpoint responded with a declined T.38 stream then Asterisk would crash when attempting to change the T.38 state. This patch also puts in a check that ensures the media state has a valid fax session (associated udptl object) before changing the T.38 state internally. ASTERISK-29203 #close Change-Id: I407f4fa58651255b6a9030d34fd6578cf65ccf09 2021-01-26 11:09 +0000 [703158b903] Alexander Traud * rtp: Enable srtp replay protection Add option "srtpreplayprotection" rtp.conf to enable srtp replay protection. ASTERISK-29260 Reported by: Alexander Traud Change-Id: I5cd346e3c6b6812039d1901aa4b7be688173b458 2020-12-28 06:43 +0000 [2770cc5872] Ivan Poddubnyi * res_pjsip_diversion: Fix adding more than one histinfo to Supported New responses sent within a PJSIP sessions are based on those that were sent before. Therefore, adding/modifying a header once causes it to be sent on all responses that follow. Sending 181 Call Is Being Forwarded many times first adds "histinfo" duplicated more and more, and eventually overflows past the array boundary. This commit adds a check preventing adding "histinfo" more than once, and skipping it if there is no more space in the header. Similar overflow situations can also occur in res_pjsip_path and res_pjsip_outbound_registration so those were also modified to check the bounds and suppress duplicate Supported values. ASTERISK-29227 Reported by: Ivan Poddubny Change-Id: Id43704a1f1a0293e35cc7f844026f0b04f2ac322 2020-12-11 14:49 +0000 [5a6f2f913b] Sean Bright * res_rtp_asterisk.c: Fix signed mismatch that leads to overflow ASTERISK-29205 #close Change-Id: Ib7aa65644e8df76e2378d7613ee7cf751b9d0bea 2021-02-05 05:26 +0000 [acb7ce4fe7] Joshua C. Colp * pjsip: Make modify_local_offer2 tolerate previous failed SDP. If a remote side is broken and sends an SDP that can not be negotiated the call will be torn down but there is a window where a second 183 Session Progress or 200 OK that is forked can be received that also attempts to negotiate SDP. Since the code marked the SDP negotiation as being done and complete prior to this it assumes that there is an active local and remote SDP which it can modify, while in fact there is not as the SDP did not successfully negotiate. Since there is no local or remote SDP a crash occurs. This patch changes the pjmedia_sdp_neg_modify_local_offer2 function to no longer assume that a previous SDP negotiation was successful. ASTERISK-29196 Change-Id: I22de45916d3b05fdc2a67da92b3a38271ee5949e 2021-01-11 14:20 +0000 [62e2dd484d] Ben Ford * core_unreal: Fix T.38 faxing when using local channels. After some changes to streams and topologies, receiving fax through local channels stopped working. This change adds a stream topology with a stream of type IMAGE to the local channel pair and allows fax to be received. ASTERISK-29035 #close Change-Id: Id103cc5c9295295d8e68d5628e76220f8f17e9fb 2021-02-02 02:33 +0000 [57d130d3aa] Boris P. Korzun * format_wav: Support of MIME-type for wav16 Provided a support of a MIME-type for wav16. Added new MIME-type for classic wav. ASTERISK-29275 #close Change-Id: I749bda287ba1ab20c1e0af5e4c0153817d47873b 2021-02-05 02:33 +0000 [45e48e387c] Alexander Traud * chan_sip: Allow [peer] without audio (text+video). Two previous commits, 620d9f4 and 6d980de, allow to set up a call without audio, again. That was introduced originally with commit f04d5fb but changed and broke over time. The original commit missed one scenario: A [peer] section in sip.conf, which does not allow audio at all. In that case, chan_sip rejected the call, although even when the requester offered no audio. Now, chan_sip does not check whether there is no audio format but checks whether there is no format in general. In other words, if there is at least one format to offer, the call succeeds. However, to prevent calls with no-audio, chan_sip still rejects calls when both call parties (caller = requester of the call *and* callee = [peer] section in sip.conf) included audio. In such a case, it is expected that the call should have audio. ASTERISK-29280 Change-Id: I0fb74faf51ef22a60c10b467df6a4d1c1943b73e 2021-01-28 12:02 +0000 [28f187d6c5] George Joseph * chan_iax2.c: Require secret and auth method if encryption is enabled If there's no secret specified for an iax2 peer and there's no secret specified in the dial string, Asterisk will crash if the auth method requested by the peer is MD5 or plaintext. You also couldn't specify a default auth method in the [general] section of iax.conf so if you don't have static peers defined and just use the dial string, Asterisk will still crash even if you have a secret specified in the dial string. * Added logic to iax2_call() and authenticate_reply() to print a warning and hanhup the call if encryption is requested and there's no secret or auth method. This prevents the crash. * Added the ability to specify a default "auth" in the [general] section of iax.conf. ASTERISK-29624 Reported by: N A Change-Id: I5928e16137581f7d383fcc7fa04ad96c919e6254 2021-02-03 12:53 +0000 [24d6adfe99] Sean Bright * app_read: Release tone zone reference on early return. Change-Id: I350939f2220f9e5d44ddf4c8d9a4c99fde4d169a 2021-01-27 11:42 +0000 [87ad1138ff] Alexander Traud * chan_sip: Set up calls without audio (text+video), again. The previous commit 6d980de fixed this issue in the core of Asterisk. With that, each channel technology can be used without audio theoretically. Practically, the channel-technology driver chan_sip turned out to have an invalid check preventing that. chan_sip tested whether there is at least one audio format. However, chan_sip has to test whether there is at least one format. More cannot be tested while requesting chan_sip because only the [general] capabilities but not the [peer] caps are known yet. And the [peer] caps might not be a subset or show any intersection with the [general] caps. This change here fixes this. The original commit f04d5fb, thirteen years ago, contained a software bug as it passed ANY audio capability to the channel-technology driver. Instead, it should have passed NO audio format. Therefore, this addressed issue here was not noticed in Asterisk 1.6.x and Asterisk 1.8. Then, Asterisk 10 changed that from ANY to NO, but nobody reported since then. ASTERISK-29265 Change-Id: Ic16a3bf13cd1b5c4fc4041ed74961177d96b600f 2021-01-22 09:12 +0000 [088816284a] Dan Cropp * chan_pjsip, app_transfer: Add TRANSFERSTATUSPROTOCOL variable When a Transfer/REFER is executed, TRANSFERSTATUSPROTOCOL variable is 0 when no protocl specific error SIP example of failure, 3xx-6xx for the SIP error code received This allows applications to perform actions based on the failure reason. ASTERISK-29252 #close Reported-by: Dan Cropp Change-Id: Ia6a94784b4925628af122409cdd733c9f29abfc4 2021-01-22 07:38 +0000 [176274caa4] Mark Petersen * res/res_pjsip.c: allow user=phone when number contain *# if From number contain * or # asterisk will not add user=phone Currently only number that uses AST_DIGIT_ANYNUM can have "user=phone" but the validation should use AST_DIGIT_ANY this is a problem when you want to send call to ISUP as they will disregard the From header and either replace From with anonymous or with p-asserted-identity ASTERISK-29261 Reported by: Mark Petersen Tested by: Mark Petersen Change-Id: I3307bdbf757582740bfee4110e85f7b6c9291cc4 2021-01-22 02:54 +0000 [f64ddf3db3] Alexander Traud * channel: Set up calls without audio (text+video), again. ASTERISK-29259 Change-Id: Ib6a6550e0e08355745d66da8e60ef49e81f9c6c5 2021-01-21 13:28 +0000 [4c154f3431] Alexander Traud * chan_sip: SDP: Reject audio streams correctly. This completes the fix for ASTERISK_24543. Only when the call is an outgoing call, consult and append the configured format capabilities (p->caps). When all audio formats got rejected the negotiated format capabilities (p->jointcaps) contain no audio formats for incoming calls. This is required when there are other accepted media streams. ASTERISK-29258 Change-Id: I8bab31c7f3f3700dce204b429ad238a524efebb9 2021-01-22 11:17 +0000 [7c0fbaf010] Ivan Poddubnyi * main/frame: Add missing control frame names to ast_frame_subclass2str Log proper control frame names instead of "Unknown control '14'", etc. Change-Id: I1724f2f4d1b064b25a5c93a7da0cb03be5143935 2021-01-23 07:15 +0000 [f1c88a497b] Boris P. Korzun * res_musiconhold: Add support of various URL-schemes by MoH. Provided a support of variuos URL-schemes for res_musiconhold, registered by ast_bucket_scheme_register(). ASTERISK-29262 #close Change-Id: If0ea8697587353dce358a70035d82649fd4632b6 2020-12-22 04:42 +0000 [017e09b40a] Robert Cripps * res/res_pjsip_session.c: Check that media type matches in function ast_sip_session_media_state_add. Check ast_media_type matches when a ast_sip_session_media is found otherwise when transitioning from say image to audio, the wrong session is returned in the first if statement. ASTERISK-29220 #close Change-Id: I6f6efa9b821ebe8881bb4c8c957f8802ddcb4b5d 2021-01-14 08:47 +0000 [fb42b60326] Sean Bright * res_pjsip_pubsub: Fix truncation of persisted SUBSCRIBE packet The last argument to ast_copy_string() is the buffer size, not the number of characters, so we add 1 to avoid stamping out the final \n in the persisted SUBSCRIBE message. Change-Id: I019b78942836f57965299af15d173911fcead5b2 2021-01-08 10:02 +0000 [9c56870929] Jaco Kroon * AC_HEADER_STDC causes a compile failure with autoconf 2.70 From https://www.mail-archive.com/bug-autoconf@gnu.org/msg04408.html > ... the long-obsolete AC_HEADER_STDC, previously used internally by > AC_INCLUDES_DEFAULT, used AC_EGREP_HEADER. The AC_HEADER_STDC macro > is now a no-op (and is not used at all within Autoconf anymore), so > that change is likely what made the first use of AC_EGREP_HEADER the > one inside the if condition, causing the observed results. The implication is that the test does nothing anyway, and due to it being a no-op from 2.70 onwards, results in the required not being set to yes, resulting in ./configure to fail. Change-Id: Ic1ff38d87f791fbf1f2a80512f81bb7110392460 Signed-off-by: Jaco Kroon 2021-01-15 03:33 +0000 [a25bcf70ed] Alexander Traud * pjsip_scheduler: Fix pjsip show scheduled_tasks like for compiler Clang. Otherwise, Clang 10 warned because of logical-not-parentheses. Change-Id: Ia8fb493f727b08070eb2dcf520c08df34ed11d79 2021-01-15 05:09 +0000 [3f119192bb] Alexander Traud * res_pjsip_session: Avoid sometimes-uninitialized warning with Clang. ASTERISK-29248 Change-Id: I2b17bd5ffb246bc64c463402c9831413da78a556 2021-01-11 14:25 +0000 [87a35f8e94] Ben Ford * chan_pjsip.c: Add parameters to frame in indicate. There are a couple of parameters (datalen and data) that do not get set in chan_pjsip_indicate which could cause an Invalid message to pop up for things such as fax. This patch adds them to the frame. Change-Id: Ia51be086a0708be905e73d1f433572c49c7e38f8 2021-01-14 16:26 +0000 Asterisk Development Team * asterisk 18.2.0-rc1 Released. 2021-01-14 09:56 +0000 [89fea9bafe] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.2.0 2020-12-30 07:56 +0000 [c10557c401] Jean Aunis * Stasis/messaging: tech subscriptions conflict with endpoint subscriptions. When both a tech subscription and an endpoint subscription exist for a given endpoint, TextMessageReceived events are dispatched to the tech subscription only. ASTERISK-29229 Change-Id: I9eac4cba5f9e27285a282509395347abc58fc2b8 2020-12-29 12:16 +0000 [c3fad2fd01] Ivan Poddubnyi * chan_pjsip: Assign SIPDOMAIN after creating a channel session->channel doesn't exist until chan_pjsip creates it, so intead of setting a channel variable every new incoming call sets one and the same global variable. This patch moves the code to chan_pjsip so that SIPDOMAIN is set on a newly created channel, it also removes a misleading reference to channel->session used to fetch call pickup configuraion. ASTERISK-29240 Change-Id: I90c9bbbed01f5d8863585631a29322ae4e046755 2020-12-23 08:44 +0000 [ad606d4ad1] Alexander Traud * chan_sip: SDP: Sidestep stream parsing when its media is disabled. Previously, chan_sip parsed all known media streams in an SDP offer like video (and text) even when videosupport=no (and textsupport=no). This wasted processor power. Furthermore, chan_sip accepted SDP offers, including no audio but just video (or text) streams although videosupport=no (or textsupport=no). Finally, chan_sip denied the whole offer instead of individual streams when they had encryption (SDES-sRTP) unexpectedly enabled. ASTERISK-29238 ASTERISK-29237 ASTERISK-29222 Change-Id: Ie49e4e2a11f0265f914b684738348ba8c0f89755 2020-12-31 05:53 +0000 [cc496044db] Ivan Poddubnyi * chan_pjsip: Stop queueing control frames twice on outgoing channels The fix for ASTERISK-27902 made chan_pjsip process SIP responses twice. This resulted in extra noise in logs (for example, "is making progress" and "is ringing" get logged twice by app_dial), as well as in noise in signalling: one incoming 183 Session Progress results in 2 outgoing 183-s. This change splits the response handler into 2 functions: - one for updating HANGUPCAUSE, which is still called twice, - another that does the rest, which is called only once as before. ASTERISK-28016 Reported-by: Alex Hermann ASTERISK-28549 Reported-by: Gant Liu ASTERISK-28185 Reported-by: Julien Change-Id: I0a1874be5bb5ed12d572d17c7f80de6e5e542940 2020-12-17 09:24 +0000 [cba8426b4c] Mark Petersen * contrib/systemd: Added note on common issues with systemd and asterisk With newer version of linux /var/run/ is a symlink to /run/ that has been turned into tmpfs. Added note that if asterisk has to bind to a specific IP that systemd has to wait until the network is up. Added note on how to make sure that the environment variable HOSTNAME is included. ASTERISK-29216 Reported by: Mark Petersen Tested by: Mark Petersen Change-Id: Ib3e560655befd3e99eec743687144f5569533379 2021-01-07 08:40 +0000 [b3927ff8bc] George Joseph * Revert "res_pjsip_outbound_registration.c: Use our own scheduler and other stuff" This reverts commit 860e40dd80f0603582b98a7da8150f15b564cce3. Reason for revert: Too many issues reported. Need to research and correct. ASTERISK-29230 ASTERISK-29231 Reported by: Michael Maier Change-Id: I9011e2eecda4e91e1cfeeda6d1a7f1a0453eab41 2020-12-18 13:06 +0000 [3a230cc6a9] Jaco Kroon * func_lock: fix multiple-channel-grant problems. Under contention it becomes possible that multiple channels will be told they successfully obtained the lock, which is a bug. Please refer ASTERISK-29217 This introduces a couple of changes. 1. Replaces requesters ao2 container with simple counter (we don't really care who is waiting for the lock, only how many). This is updated undex ->mutex to prevent memory access races. 2. Correct semantics for ast_cond_timedwait() as described in pthread_cond_broadcast(3P) is used (multiple threads can be released on a single _signal()). 3. Module unload races are taken care of and memory properly cleaned up. Change-Id: I6f68b5ec82ff25b2909daf6e4d19ca864a463e29 Signed-off-by: Jaco Kroon 2020-12-23 11:41 +0000 [49f625b8db] Jaco Kroon * pbx_lua: Add LUA_VERSIONS environment variable to ./configure. On Gentoo it's possible to have multiple lua versions installed, all with a path of /usr, so it's not possible to use the current --with-lua option to determisticly pin to a specific version as is required by the Gentoo PMS standards. This environment variable allows to lock to specific versions, unversioned check will be skipped if this variable is supplied. Change-Id: I8c403eda05df25ee0193960262ce849c7d2fd088 Signed-off-by: Jaco Kroon 2020-12-07 16:59 +0000 [fb23f98521] Dan Cropp * chan_pjsip: Incorporate channel reference count into transfer_refer(). Add channel reference count for PJSIP REFER. The call could be terminated prior to the result of the transfer. In that scenario, when the SUBSCRIBE/NOTIFY occurred several minutes later, it would attempt to access a session which was no longer valid. Terminate event subscription if pjsip_xfer_initiate() or pjsip_xfer_send_request() fails in transfer_refer(). ASTERISK-29201 #close Reported-by: Dan Cropp Change-Id: I3fd92fd14b4e3844d3d7b0f60fe417a4df5f2435 2020-12-23 13:06 +0000 [0e1ba9a778] Kevin Harwell * app_mixmonitor: cleanup datastore when monitor thread fails to launch launch_monitor_thread is responsible for creating and initializing the mixmonitor, and dependent data structures. There was one off nominal path after the datastore gets created that triggers when the channel being monitored is hung up prior to monitor starting itself. If this happened the monitor thread would not "launch", and the mixmonitor object and associated objects are freed, including the underlying datastore data object. However, the datastore itself was not removed from the channel, so when the channel eventually gets destroyed it tries to access the previously freed datastore data and crashes. This patch removes and frees datastore object itself from the channel before freeing the mixmonitor object thus ensuring the channel does not call it when destroyed. ASTERISK-28947 #close Change-Id: Id4f9e958956d62473ed5ff06c98ae3436e839ff8 2020-12-24 09:03 +0000 [9ff548f1db] Sean Bright * app_voicemail: Prevent deadlocks when out of ODBC database connections ASTERISK-28992 #close Change-Id: Ia7d608924036139ee2520b840d077762d02668d0 2020-12-22 17:40 +0000 [d9aef0e6e5] Kevin Harwell * pbx_realtime: wrong type stored on publish of ast_channel_snapshot_type A prior patch segmented channel snapshots, and changed the underlying data object type associated with ast_channel_snapshot_type stasis messages. Prior to Asterisk 18 it was a type ast_channel_snapshot, but now it type ast_channel_snapshot_update. When publishing ast_channel_snapshot_type in pbx_realtime the ast_channel_snapshot was being passed in as the message data object. When a handler, expecting a data object type of ast_channel_snapshot_update, dereferenced this value a crash would occur. This patch makes it so pbx_realtime now uses the expected type, and channel snapshot publish method when publishing. ASTERISK-29168 #close Change-Id: I9a2cfa0ec285169317f4b9146e4027da8a4fe896 2020-12-18 09:16 +0000 [68d3d3af6f] Sean Bright * asterisk: Export additional manager functions Rename check_manager_enabled() and check_webmanager_enabled() to begin with ast_ so that the symbols are automatically exported by the linker. ASTERISK~29184 Change-Id: I85762b9a5d14500c15f6bad6507138c8858644c9 2020-12-19 11:54 +0000 [3c8598ffef] Nick French * res_pjsip: Prevent segfault in UDP registration with flow transports Segfault occurs during outbound UDP registration when all transport states are being iterated over. The transport object in the transport is accessed, but flow transports have a NULL transport object. Modify to not iterate over any flow transport ASTERISK-29210 #close Change-Id: If28dc3a18bdcbd0a49598b09b7fe4404d45c996a 2020-12-26 12:14 +0000 [3d379845e6] Richard Mudgett * chan_vpb.cc: Fix compile errors. Fix the usual compile problem when someone adds a new callback to struct ast_channel_tech. Change-Id: I9bdeb8a8cc65f03b2d6e4f2eb5809af47c906c32 2020-12-26 11:42 +0000 [027f4e3a21] Richard Mudgett * res_pjsip_session.c: Fix compiler warnings. AST_VECTOR_SIZE() returns a size_t. This is not always equivalent to an unsigned long on all machines. Change-Id: I0a4189a104e6e3a2e2273de06620eaef19df9338 2020-12-13 06:03 +0000 [d8b7a6f599] Sungtae Kim * res_pjsip_session: Fixed NULL active media topology handle Added NULL pointer check to prevent Asterisk crash. ASTERISK-29215 Change-Id: If07e50ea8d78cb610af9195fc13b5dca4bfcef95 2020-12-22 02:58 +0000 [a7aea71e60] Torrey Searle * res/res_pjsip_diversion: prevent crash on tel: uri in History-Info Add a check to see if the URI is a Tel URI and prevent crashing on trying to retrieve the reason parameter. ASTERISK-29191 ASTERISK-29219 Change-Id: I0320aa205f22cda511d60a2edf2b037e8fd6cc37 2020-12-11 13:27 +0000 [13682210e2] Sean Bright * app_chanspy: Spyee information missing in ChanSpyStop AMI Event The documentation in the wiki says there should be spyee-channel information elements in the ChanSpyStop AMI event. https://wiki.asterisk.org/wiki/x/Xc5uAg However, this is not the case in Asterisk <= 16.10.0 Version. We're using these Spyee* arguments since Asterisk 11.x, so these arguments vanished in Asterisk 12 or higher. For maximum compatibility, we still send the ChanSpyStop event even if we are not able to find any 'Spyee' information. ASTERISK-28883 #close Change-Id: I81ce397a3fd614c094d043ffe5b1b1d76188835f 2020-11-30 19:27 +0000 [4b450b4334] Sungtae Kim * res_ari: Fix wrong media uri handle for channel play Fixed wrong null object handle in /channels//play request handler. ASTERISK-29188 Change-Id: I6691c640247a51ad15f23e4a203ca8430809bafe 2020-12-08 11:37 +0000 [7a6cfde4db] Pirmin Walthert * res_pjsip_nat.c: Create deep copies of strings when appropriate In rewrite_uri asterisk was not making deep copies of strings when changing the uri. This was in some cases causing garbage in the route header and in other cases even crashing asterisk when receiving a message with a record-route header set. Thanks to Ralf Kubis for pointing out why this happens. A similar problem was found in res_pjsip_transport_websocket.c. Pjproject needs as well to be patched to avoid garbage in CANCEL messages. ASTERISK-29024 #close Change-Id: Ic5acd7fa2fbda3080f5f36ef12e46804939b198b 2020-12-10 09:09 +0000 [ccb4951bf8] George Joseph * logger.c: Automatically add a newline to formats that don't have one Scope tracing allows you to not specify a format string or variable, in which case it just prints the indent, file, function, and line number. The trace output automatically adds a newline to the end in this case. If you also have debugging turned on for the module, a debug message is also printed but the standard log functionality which prints it doesn't add the newline so you have messages that don't break correctly. * format_log_message_ap(), which is the common log message formatter for all channels, now adds a newline to the end of format strings that don't already have a newline. ASTERISK-29209 Reported by: Alexander Traud Change-Id: I994a7df27f88df343b7d19f3e81a4b562d9d41da 2020-12-16 06:17 +0000 [938a240793] Joshua C. Colp * res_pjsip_pidf_digium_body_supplement: Support Sangoma user agent. This adds support for both Digium and Sangoma user agent strings for the Sangoma specific body supplement. Change-Id: Ib99362b24b91d3cbe888d8b2fce3fad5515d9482 2020-12-10 17:06 +0000 [0774d9f9aa] Nathan Bruning * res_musiconhold: Don't crash when real-time doesn't return any entries ASTERISK-29211 #close Change-Id: Ifbf0a4f786ab2a52342f9d1a1db4c9907f069877 2020-10-29 12:21 +0000 [5b4e71fa0a] Joshua C. Colp * pjsip: Match lifetime of INVITE session to our session. In some circumstances it was possible for an INVITE session to be destroyed while we were still using it. This occurred due to the reference on the INVITE session being released internally as a result of its state changing to DISCONNECTED. This change adds a reference to the INVITE session which is released when our own session is destroyed, ensuring that the INVITE session remains valid for the lifetime of our session. ASTERISK-29022 Change-Id: I300c6d9005ff0e6efbe1132daefc7e47ca6228c9 2020-10-29 06:25 +0000 [92fcd4edba] laszlovl * Introduce astcachedir, to be used for temporary bucket files As described in the issue, /tmp is not a suitable location for a large amount of cached media files, since most distributions make /tmp a RAM-based tmpfs mount with limited capacity. I opted for a location that can be configured separately, as opposed to using a subdirectory of spooldir, given the different storage profile (transient files vs files that might stay there indefinitely). This commit just makes the cache directory configurable, but leaves it at /tmp by default, to ensure backwards compatibility. A future commit that only targets master could change the default location to something more sensible such as /var/tmp/asterisk. At that point, the cachedir could be created and cleaned up during uninstall by the Makefile script. ASTERISK-29143 Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d 2020-11-21 11:51 +0000 [f39d5ea7cd] Sean Bright * res_http_media_cache.c: Set reasonable number of redirects By default libcurl does not follow redirects, so we explicitly enable it by setting CURLOPT_FOLLOWLOCATION. Once that is enabled, libcurl will follow up to CURLOPT_MAXREDIRS redirects, which by default is configured to be unlimited. This patch sets CURLOPT_MAXREDIRS to a more reasonable default (8). If we determine at some point that this needs to be increased on configurable it is a trivial change. ASTERISK-29173 #close Change-Id: I4925ebbcf0c7d728bb9252b3795b3479ae225b30 2020-11-23 14:56 +0000 [f9438e6457] Sean Bright * media_cache: Fix reference leak with bucket file metadata Change-Id: Ia0e4124110df613ce5fdfa9ef8780016ebaa52c6 2020-11-24 00:55 +0000 [6a85dc860f] Stanislav * res_pjsip_stir_shaken: Fix module description the 'J' is missing in module description. "PSIP STIR/SHAKEN Module for Asterisk" -> "PJSIP STIR/SHAKEN Module for Asterisk" ASTERISK-29175 #close Change-Id: I17da008540ee2e8496b644d05f995b320b54ad7a 2020-10-12 05:30 +0000 [fd57fae048] Joshua C. Colp * voicemail: add option 'e' to play greetings as early media When using this option, answering the channel is deferred until all prompts/greetings have been played and the caller is about to leave their message. ASTERISK-29118 #close Change-Id: I41b9f0428783c0bd697c8c994f906d1e75ce9ddb 2020-11-02 01:24 +0000 [bf9f0f13c4] Alexander Traud * loader: Sync load- and build-time deps. In MODULEINFO, each depend has to be listed in .requires of AST_MODULE_INFO. ASTERISK-29148 Change-Id: I254dd33194ae38d2877b8021c57c2a5deb6bbcd2 2020-11-18 13:11 +0000 [994fbdaf48] Sean Bright * CHANGES: Remove already applied CHANGES update Change-Id: Iee7163bc732d58c5cbaa2cfab1f5aab4a412060a 2020-11-17 14:19 +0000 [c79bd583d9] Alexander Greiner-Baer * res_pjsip: set Accept-Encoding to identity in OPTIONS response RFC 3261 says that the Accept-Encoding header should be present in an options response. Permitted values according to RFC 2616 are only compression algorithms like gzip or the default identity encoding. Therefore "text/plain" is not a correct value here. As long as the header is hard coded, it should be set to "identity". Without this fix an Alcatel OmniPCX periodically logs warnings like "[sip_acceptIncorrectHeader] Header Accept-Encoding is malformed" on a SIP Trunk. ASTERISK-29165 #close Change-Id: I0aa2211ebf0b4c2ed554ac7cda794523803a3840 2020-11-04 07:39 +0000 [e884d935f6] Alexander Traud * chan_sip: Remove unused sip_socket->port. 12 years ago, with ASTERISK_12115 the last four get/uses of socket.port vanished. However, the struct member itself and all seven set/uses remained as dead code. ASTERISK-28798 Change-Id: Ib90516a49eca3d724a70191278aaf2144fb58c59 2020-11-13 06:19 +0000 [33e3542132] Boris P. Korzun * bridge_basic: Fixed setup of recall channels Fixed a bug (like a typo) in retransfer_enter() at main/bridge_basic.c:2641. common_recall_channel_setup() setups common things on the recalled transfer target, but used same target as source instead trasfered. ASTERISK-29161 #close Change-Id: Ieb549654a621c38b1ad5e9d15b9f18823d9cc31f 2020-11-03 02:27 +0000 [6e1fb58183] Alexander Traud * modules.conf: Align the comments for more conclusiveness. Change-Id: I79cc693cd5a6e5dd7d403b7e91d970ff1ddf8306 2020-11-11 08:55 +0000 [2413598705] George Joseph * app_queue: Fix deadlock between update and show queues Operations that update queues when shared_lastcall is set lock the queue in question, then have to lock the queues container to find the other queues with the same member. On the other hand, __queues_show (which is called by both the CLI and AMI) does the reverse. It locks the queues container, then iterates over the queues locking each in turn to display them. This creates a deadlock. * Moved queue print logic from __queues_show to a separate function that can be called for a single queue. * Updated __queues_show so it doesn't need to lock or traverse the queues container to show a single queue. * Updated __queues_show to snap a copy of the queues container and iterate over that instead of locking the queues container and iterating over it while locked. This prevents us from having to hold both the container lock and the queue locks at the same time. This also allows us to sort the queue entries. ASTERISK-29155 Change-Id: I78d4dc36728c2d7bc187b97d82673fc77f2bcf41 2020-11-12 12:36 +0000 Asterisk Development Team * asterisk 18.1.0-rc1 Released. 2020-11-12 05:50 +0000 [98d1537c1e] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.1.0 2020-11-02 13:53 +0000 [860e40dd80] George Joseph * res_pjsip_outbound_registration.c: Use our own scheduler and other stuff * Instead of using the pjproject timer heap, we now use our own pjsip_scheduler. This allows us to more easily debug and allows us to see times in "pjsip show/list registrations" as well as being able to see the registrations in "pjsip show scheduled_tasks". * Added the last registration time, registration interval, and the next registration time to the CLI output. * Removed calls to pjsip_regc_info() except where absolutely necessary. Most of the calls were just to get the server and client URIs for log messages so we now just save them on the client_state object when we create it. * Added log messages where needed and updated most of the existong ones to include the registration object name at the start of the message. Change-Id: I4534a0fc78c7cb69f23b7b449dda9748c90daca2 2020-11-02 13:53 +0000 [569fc28966] George Joseph * pjsip_scheduler.c: Add type ONESHOT and enhance cli show command * Added a ONESHOT type that never reschedules. * Added "like" capability to "pjsip show scheduled_tasks" so you can do the following: CLI> pjsip show scheduled_tasks like outreg PJSIP Scheduled Tasks: Task Name Interval Times Run ... ============================================= ========= ========= ... pjsip/outreg/testtrunk-reg-0-00000074 50.000 oneshot ... pjsip/outreg/voipms-reg-0-00000073 110.000 oneshot ... * Fixed incorrect display of "Next Start". * Compacted the displays of times in the CLI. * Added two new functions (ast_sip_sched_task_get_times2, ast_sip_sched_task_get_times_by_name2) that retrieve the interval, next start time, and next run time in addition to the times already returned by ast_sip_sched_task_get_times(). Change-Id: Ie718ca9fd30490b8a167bedf6b0b06d619dc52f3 2020-10-02 14:32 +0000 [da0f2ea99e] Alexei Gradinari * sched: AST_SCHED_REPLACE_UNREF can lead to use after free of data The data can be freed if the old object '_data' is the same object as new 'data'. Because at first the object is unreferenced which can lead to destroying it. This could happened in res_pjsip_pubsub when the publication is updated which could lead to segfault in function publish_expire. Change-Id: I0164f57c387243510bdbd2f8dcf33377b6c202da 2020-10-30 11:43 +0000 [5a6037778b] Alexander Traud * res_pjsip/config_transport: Load and run without OpenSSL. ASTERISK-28933 Reported-by: Walter Doekes Change-Id: I65eac49e5b0a79261ea80e2b9b38a836886ed59f 2020-10-30 05:53 +0000 [be54c7e9ea] Alexander Traud * res_stir_shaken: Include OpenSSL headers where used actually. This avoids the inclusion of the OpenSSL headers in the public header, which avoids one external library dependency in res_pjsip_stir_shaken. Change-Id: I6a07e2d81d2b5442e24e99b8cc733a99f881dcf4 2020-10-18 13:40 +0000 [c635c78265] Dovid Bender * func_curl.c: Allow user to set what return codes constitute a failure. Currently any response from res_curl where we get an answer from the web server, regardless of what the response is (404, 403 etc.) Asterisk currently treats it as a success. This patch allows you to set which codes should be considered as a failure by Asterisk. If say we set failurecodes=404,403 then when using curl in realtime if a server gives a 404 error Asterisk will try to failover to the next option set in extconfig.conf ASTERISK-28825 Reported by: Dovid Bender Code by: Gobinda Paul Change-Id: I94443e508343e0a3e535e51ea6e0562767639987 2020-11-04 15:08 +0000 [6baa4b53be] Kevin Harwell * AST-2020-001 - res_pjsip: Return dialog locked and referenced pjproject returns the dialog locked and with a reference. However, in Asterisk the method that handles this decrements the reference and removes the lock prior to returning. This makes it possible, under some circumstances, for another thread to free said dialog before the thread that created it attempts to use it again. Of course when the thread that created it tries to use a freed dialog a crash can occur. This patch makes it so Asterisk now returns the newly created dialog both locked, and with an added reference. This allows the caller to de-reference, and unlock the dialog when it is safe to do so. In the case of a new SIP Invite the lock, and reference are now held for the entirety of the new invite handling process. Otherwise it's possible for the dialog, or its dependent objects, like the transaction, to disappear. For example if there is a TCP transport error. ASTERISK-29057 #close Change-Id: I5ef645a47829596f402cf383dc02c629c618969e 2020-11-03 10:38 +0000 [82325ba58b] Ben Ford * AST-2020-002 - res_pjsip: Stop sending INVITEs after challenge limit. If Asterisk sends out and INVITE and receives a challenge with a different nonce value each time, it will continually send out INVITEs, even if the call is hung up. The endpoint must be configured for outbound authentication in order for this to occur. A limit has been set on outbound INVITEs so that, once reached, Asterisk will stop sending INVITEs and the transaction will terminate. ASTERISK-29013 Change-Id: I2d001ca745b00ca8aa12030f2240cd72363b46f7 2020-10-29 10:21 +0000 [fe540d0326] Sean Bright * sip_to_pjsip.py: Handle #include globs and other fixes * Wildcards in #includes are now properly expanded * Implement operators for Section class to allow sorting ASTERISK-29142 #close Change-Id: I9b9cd95f4cbe5c24506b75d17173c5aa1a83e5df 2020-10-29 03:55 +0000 [e0ee53dc9c] Alexander Traud * Compiler fixes for GCC with -Og ASTERISK-29144 Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62 2020-10-29 08:59 +0000 [2dacadd9df] Alexander Traud * Compiler fixes for GCC with -Os ASTERISK-29145 Change-Id: I9af705f2b9725c53141aef5d0ff512a1800f073c 2020-10-30 03:46 +0000 [f86af1fbd0] Alexander Traud * Compiler fixes for GCC when printf %s is NULL ASTERISK-29146 Change-Id: Ib04bdad87d729f805f5fc620ef9952f58ea96d41 2020-10-23 10:26 +0000 [5b25c75d7b] Alexander Traud * chan_sip: On authentication, pick MD5 for sure. RFC 8760 added new digest-access-authentication schemes. Testing revealed that chan_sip does not pick MD5 if several schemes are offered by the User Agent Server (UAS). This change does not implement any of the new schemes like SHA-256. This change makes sure, MD5 is picked so UAS with SHA-2 enabled, like the service www.linphone.org/freesip, can still be used. This should have worked since day one because SIP/2.0 already envisioned several schemes (see RFC 3261 and its augmented BNF for 'algorithm' which includes 'token' as third alternative; note: if 'algorithm' was not present, MD5 is still assumed even in RFC 7616). Change-Id: I61ca0b1f74b5ec2b5f3062c2d661cafeaf597fcd 2020-06-04 09:23 +0000 [fb3b14ab7d] Walter Doekes * main/say: Work around gcc 9 format-truncation false positive Version: gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0 Warning: say.c:2371:24: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 10 [-Werror=format-truncation=] 2371 | snprintf(buf, 10, "%d", num); say.c:2371:23: note: directive argument in the range [-2147483648, 9] That's not possible though, as the if() starts out checking for (num < 0), making this Warning a false positive. (Also replaced some elseif with elseif while in the vicinity.) Change-Id: Ic7a70120188c9aa525a6d70289385bfce878438a 2020-10-19 15:31 +0000 [439f7bb848] Kevin Harwell * res_pjsip, res_pjsip_session: initialize local variables This patch initializes a couple of local variables to some default values. Interestingly, in the 'pj_status_t dlg_status' case the value not being initialized caused memory to grow, and not be recovered, in the off nominal path (at least on my machine). Change-Id: I22ee65e1e1bff8efacea8a167c6c8428898523f7 2020-10-23 09:55 +0000 [f89531cb98] Alexander Traud * install_prereq: Add GMime 3.0. Ubuntu 20.10 does not come with GMime 2.6. Ubuntu 16.04 LTS does not come with GMime 3.0. aptitude ignores any missing package. Therefore, it installs the correct package(s). However, in Ubuntu 18.04 LTS and Ubuntu 20.04 LTS, both versions are installed alongside although only one is really needed. Change-Id: Ic58aa9f2e131d94671f286f17dbd61e1ccbabcb7 2020-10-13 12:15 +0000 [f041763e3b] Nick French * res_pjsip_session: Restore calls to ast_sip_message_apply_transport() Commit 44bb0858cb3ea6a8db8b8d1c7fedcfec341ddf66 ("debugging: Add enough to choke a mule") accidentally removed calls to ast_sip_message_apply_transport when it was attempting to just add debugging code. The kiss of death was saying that there were no functional changes in the commit comment. This makes outbound calls that use the 'flow' transport mechanism fail, since this call is used to relay headers into the outbound INVITE requests. ASTERISK-29124 #close Change-Id: I0f3e32c2e8ac415e30b1d29966d75a1546f0526a 2020-10-23 09:49 +0000 [2773f93154] Alexander Traud * BuildSystem: Enable Lua 5.4. Note to maintainers: Lua 5.4, Lua 5.3, and Lua 5.2 have not been tested at runtime with pbx_lua. Until then, use the lowest available version of Lua, if you enabled the module pbx_lua at all. Change-Id: Ie5270448b11fcb4e2a53d899e4fe7fea793ce7e0 2020-10-22 11:21 +0000 [6f321b561a] Sean Bright * features.conf.sample: Sample sound files incorrectly quoted ASTERISK-29136 #close Change-Id: I3186536d65a50014c8da4780c9224919caa81440 2020-10-12 00:45 +0000 [ff33f7f44f] Andrew Siplas * logger.conf.sample: add missing comment mark Add missing comment mark from stock configuration. ASTERISK-29123 #close Change-Id: I4f94eb4544166bca8af4c17fd11edee3c6980620 2020-10-06 10:32 +0000 [412b385de5] Joshua C. Colp * res_pjsip: Adjust outgoing offer call pref. This changes the outgoing offer call preference default option to match the behavior of previous versions of Asterisk. The additional advanced codec negotiation options have also been removed from the sample configuration and marked as reserved for future functionality in XML documentation. The codec preference options have also been fixed to enforce local codec configuration. ASTERISK-29109 Change-Id: Iad19347bd5f3d89900c15ecddfebf5e20950a1c2 2020-08-28 16:32 +0000 [6255e7976c] Kevin Harwell * Logging: Add debug logging categories Added debug logging categories that allow a user to output debug information based on a specified category. This lets the user limit, and filter debug output to data relevant to a particular context, or topic. For instance the following categories are now available for debug logging purposes: dtls, dtls_packet, ice, rtcp, rtcp_packet, rtp, rtp_packet, stun, stun_packet These debug categories can be enable/disable via an Asterisk CLI command. While this overrides, and outputs debug data, core system debugging is not affected by this patch. Statements still output at their appropriate debug level. As well backwards compatibility has been maintained with past debug groups that could be enabled using the CLI (e.g. rtpdebug, stundebug, etc.). ASTERISK-29054 #close Change-Id: I6e6cb247bb1f01dbf34750b2cd98e5b5b41a1849 (cherry picked from commit 56028426de0692e8e36167251053c91b96e97c41) 2020-09-30 15:00 +0000 [a6faa53af0] Sean Bright * tcptls.c: Don't close TCP client file descriptors more than once ASTERISK-28430 #close Change-Id: Ib556b0a0c95cca939e956886214ec8d828d89606 2020-10-05 10:44 +0000 [7ced144867] Jean Aunis * resource_endpoints.c: memory leak when providing a 404 response When handling a send_message request to a non-existing endpoint, the response's body is overriden and not properly freed. ASTERISK-29108 Change-Id: Ie1d3d70065f80793445b60f5e4a7eb31b4b9c5c8 2020-09-29 19:57 +0000 [abee490639] Sean Bright * app_voicemail.c: Document VMSayName interruption behavior ASTERISK-26424 #close Change-Id: I797ad0ed302d0b3d2c90543eff5b7207ed08ecf0 2020-09-29 13:04 +0000 [5a0b19a4f3] Sean Bright * pbx.c: On error, ast_add_extension2_lockopt should always free 'data' In the event that the desired extension already exists, ast_add_extension2_lockopt() will free the 'data' it is passed before returning an error, so we should not be freeing it ourselves. Additionally, there were two places where ast_add_extension2_lockopt() could return an error without also freeing the 'data' pointer, so we add that. ASTERISK-29097 #close Change-Id: I904707aae55169feda050a5ed7c6793b53fe6eae 2020-09-24 13:46 +0000 [4a049ad510] George Joseph * app_confbridge/bridge_softmix: Add ability to force estimated bitrate app_confbridge now has the ability to set the estimated bitrate on an SFU bridge. To use it, set a bridge profile's remb_behavior to "force" and set remb_estimated_bitrate to a rate in bits per second. The remb_estimated_bitrate parameter is ignored if remb_behavior is something other than "force". Change-Id: Idce6464ff014a37ea3b82944452e56cc4d75ab0a 2020-09-23 04:05 +0000 [08ccfd4588] Jasper van der Neut * channels: Don't dereference NULL pointer Check result of ast_translator_build_path against NULL before dereferencing. ASTERISK-29091 Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29 2020-09-22 22:39 +0000 [4499fbc819] Holger Hans Peter Freyther * res_pjsip_sdp_rtp: Fix accidentally native bridging calls Stop advertising RFC2833 support on the rtp_engine when DTMF mode is auto but no tel_event was found inside SDP file. On an incoming call create_rtp will be called and when session->dtmf is set to AST_SIP_DTMF_AUTO, the AST_RTP_PROPERTY_DTMF will be set without looking at the SDP file. Once get_codecs gets called we move the DTMF mode from RFC2833 to INBAND but continued to advertise RFC2833 support. This meant the native_rtp bridge would falsely consider the two channels as compatible. In addition to changing the DTMF mode we now set or remove the AST_RTP_PROPERTY_DTMF. The property is checked in ast_rtp_dtmf_compatible and called by native_rtp_bridge_compatible. ASTERISK-29051 #close Change-Id: I1e0c1e324598a437932c0b7836bcb626aba8e287 2020-09-28 07:42 +0000 [b3b6b5e9f7] lvl * res_musiconhold: Load all realtime entries, not just the first ASTERISK-29099 Change-Id: I45636679c0fb5a5f59114c8741626631a604e8a6 2020-09-24 09:54 +0000 [c470327e6c] Torrey Searle * res_pjsip_diversion: fix double 181 Arming response to both AST_SIP_SESSION_BEFORE_REDIRECTING and AST_SIP_SESSION_BEFORE_MEDIA causes 302 to to be handled twice, resulting in to 181 being generated. Change-Id: I866e5461564644ffb8a5e12b6f1330b50a7b63ab 2020-09-24 11:47 +0000 [5929e0ccbd] Sean Bright * res_musiconhold: Clarify that playlist mode only supports HTTP(S) URLs Change-Id: I41e77a04e4a523f4ed61a7a20b738ffd42be441e 2020-09-23 15:20 +0000 [9b08eddf90] Sean Bright * dsp.c: Update calls to ast_format_cmp to check result properly ASTERISK-28311 #close Change-Id: Ib1ce8fc1a8752751f5bf3615c59245532dfd9aa2 2020-09-18 15:02 +0000 [d0644faa5a] Sean Bright * res_musiconhold: Start playlist after initial announcement Only track our sample offset if we are playing a non-announcement file, otherwise we will skip that number of samples when we start playing the first MoH file. ASTERISK-24329 #close Change-Id: Ib6b3c84fcaa1063889ab38ba7e7fc50050a3ccfc 2020-09-22 05:05 +0000 [9eeb40af33] Joshua C. Colp * res_pjsip_session: Fix stream name memory leak. When constructing a stream name based on the media type and position the allocated name was not being freed causing a leak. Change-Id: I52510863b24a2f531f0a55b440bb2c81844029de 2020-09-18 08:09 +0000 [28c88e8fe2] Sean Bright * func_curl.c: Prevent crash when using CURLOPT(httpheader) Because we use shared thread-local cURL instances, we need to ensure that the state of the cURL instance is correct before each invocation. In the case of custom headers, we were not resetting cURL's internal HTTP header pointer which could result in a crash if subsequent requests do not configure custom headers. ASTERISK-29085 #close Change-Id: I8b4ab34038156dfba613030a45f10e932d2e992d 2020-09-22 05:13 +0000 [957aff751d] Joshua C. Colp * res_pjsip_session: Fix session reference leak. The ast_sip_dialog_get_session function returns the session with reference count increased. This was not taken into account and was causing sessions to remain around when they should not be. ASTERISK-29089 Change-Id: I430fa721b0a824311a59effec6056e9ec528e3e8 2020-09-16 08:01 +0000 [2bce21da88] Michal Hajek * res_stasis.c: Add compare function for bridges moh container Sometimes not play MOH on bridge. ASTERISK-29081 Reported-by: Michal Hajek Change-Id: I760c73e0c9be1d340303b5d1c18a00c4759e8232 2020-09-17 11:40 +0000 [99bd7d95de] George Joseph * logger.h: Fix ast_trace to respect scope_level ast_trace() was always emitting messages when it's level was set to -1 because it was ignoring scope_level. Change-Id: I849c8f4f4613899c37f82be0202024e7d117e506 2020-09-15 15:44 +0000 [c90c182932] Sean Bright * audiosocket: Fix module menuselect descriptions The module description needs to be on the same line as the AST_MODULE_INFO or it is not parsed correctly. Change-Id: I9ba11df1415369790e8656fcb527bb2749373c21 2020-09-17 13:01 +0000 [fdc13060df] George Joseph * bridge_softmix/sfu_topologies_on_join: Ignore topology change failures When a channel joins a bridge, we do topology change requests on all existing channels to add the new participant to them. However the announcer channel will return an error because it doesn't support topology in the first place. Unfortunately, there doesn't seem to be a reliable way to tell if the error is expected or not so the error is ignored for all channels. If the request fails on a "real" channel, that channel just won't get the new participant's video. Change-Id: Ic95db4683f27d224c1869fe887795d6b9fdea4f0 2020-09-15 16:16 +0000 [6f32c254be] Sean Bright * res_pjsip_session.c: Fix build when TEST_FRAMEWORK is not defined Change-Id: Id4852c26e9c412af8e37b5dd3c15da9453ad3276 2020-08-13 03:34 +0000 [83140c9fed] Torrey Searle * res_pjsip_diversion: implement support for History-Info Implemention of History-Info capable of interworking with Diversion Header following RFC7544 ASTERISK-29027 #close Change-Id: I2296369582d4b295c5ea1e60bec391dd1d318fa6 2020-09-14 13:23 +0000 [4964302984] Sean Bright * format_cap: Perform codec lookups by pointer instead of name ASTERISK-28416 #close Change-Id: I069420875ebdbcaada52d92599a5f7de3cb2cdf4 2020-09-11 11:09 +0000 [cc71be0078] George Joseph * res_pjsip_session: Fix issue with COLP and 491 The recent 491 changes introduced a check to determine if the active and pending topologies were equal and to suppress the re-invite if they were. When a re-invite is sent for a COLP-only change, the pending topology is NULL so that check doesn't happen and the re-invite is correctly sent. Of course, sending the re-invite sets the pending topology. If a 491 is received, when we resend the re-invite, the pending topology is set and since we didn't request a change to the topology in the first place, pending and active topologies are equal so the topologies-equal check causes the re-invite to be erroneously suppressed. This change checks if the topologies are equal before we run the media state resolver (which recreates the pending topology) so that when we do the final topologies-equal check we know if this was a topology change request. If it wasn't a change request, we don't suppress the re-invite even though the topologies are equal. ASTERISK-29014 Change-Id: Iffd7dd0500301156a566119ebde528d1a9573314 2020-08-20 15:09 +0000 [ad4f2a8c99] George Joseph * debugging: Add enough to choke a mule Added to: * bridges/bridge_softmix.c * channels/chan_pjsip.c * include/asterisk/res_pjsip_session.h * main/channel.c * res/res_pjsip_session.c There NO functional changes in this commit. Change-Id: I06af034d1ff3ea1feb56596fd7bd6d7939dfdcc3 2020-08-20 11:21 +0000 [d4f3b17dd3] George Joseph * res_pjsip_session: Handle multi-stream re-invites better When both Asterisk and a UA send re-invites at the same time, both send 491 "Transaction in progress" responses to each other and back off a specified amount of time before retrying. When Asterisk prepares to send its re-invite, it sets up the session's pending media state with the new topology it wants, then sends the re-invite. Unfortunately, when it received the re-invite from the UA, it partially processed the media in the re-invite and reset the pending media state before sending the 491 losing the state it set in its own re-invite. Asterisk also was not tracking re-invites received while an existing re-invite was queued resulting in sending stale SDP with missing or duplicated streams, or no re-invite at all because we erroneously determined that a re-invite wasn't needed. There was also an issue in bridge_softmix where we were using a stream from the wrong topology to determine if a stream was added. This also caused us to erroneously determine that a re-invite wasn't needed. Regardless of how the delayed re-invite was triggered, we need to reconcile the topology that was active at the time the delayed request was queued, the pending topology of the queued request, and the topology currently active on the session. To do this we need a topology resolver AND we need to make stream named unique so we can accurately tell what a stream has been added or removed and if we can re-use a slot in the topology. Summary of changes: * bridge_softmix: * We no longer reset the stream name to "removed" in remove_all_original_streams(). That was causing multiple streams to have the same name and wrecked the checks for duplicate streams. * softmix_bridge_stream_sources_update() was checking the old_stream to see if it had the softmix prefix and not considering the stream as "new" if it did. If the stream in that slot has something in it because another re-invite happened, then that slot in old might have a softmix stream but the same stream in new might actually be a new one. Now we check the new_stream's name instead of the old_stream's. * stream: * Instead of using plain media type name ("audio", "video", etc) as the default stream name, we now append the stream position to it to make it unique. We need to do this so we can distinguish multiple streams of the same type from each other. * When we set a stream's state to REMOVED, we no longer reset its name to "removed" or destroy its metadata. Again, we need to do this so we can distinguish multiple streams of the same type from each other. * res_pjsip_session: * Added resolve_refresh_media_states() that takes in 3 media states and creates an up-to-date pending media state that includes the changes that might have happened while a delayed session refresh was in the delayed queue. * Added is_media_state_valid() that checks the consistency of a media state and returns a true/false value. A valid state has: * The same number of stream entries as media session entries. Some media session entries can be NULL however. * No duplicate streams. * A valid stream for each non-NULL media session. * A stream that matches each media session's stream_num and media type. * Updated handle_incoming_sdp() to set the stream name to include the stream position number in the name to make it unique. * Updated the ast_sip_session_delayed_request structure to include both the pending and active media states and updated the associated delay functions to process them. * Updated sip_session_refresh() to accept both the pending and active media states that were in effect when the request was originally queued and to pass them on should the request need to be delayed again. * Updated sip_session_refresh() to call resolve_refresh_media_states() and substitute its results for the pending state passed in. * Updated sip_session_refresh() with additional debugging. * Updated session_reinvite_on_rx_request() to simply return PJ_FALSE to pjproject if a transaction is in progress. This stops us from creating a partial pending media state that would be invalid later on. * Updated reschedule_reinvite() to clone both the current pending and active media states and pass them to delay_request() so the resolver can tell what the original intention of the re-invite was. * Added a large unit test for the resolver. ASTERISK-29014 Change-Id: Id3440972943c611a15f652c6c569fa0e4536bfcb 2020-08-31 07:21 +0000 [1fd12b88c7] Sungtae Kim * realtime: Increased reg_server character size Currently, the ps_contacts table's reg_server column in realtime database type is varchar(20). This is fine for normal cases, but if the hostname is longer than 20, it returns error and then failed to register the contact address of the peer. Normally, 20 characters limitation for the hostname is fine, but with the cloud env. So, increased the size to 255. ASTERISK-29056 Change-Id: Iac52c8c35030303cfa551bb39f410b33bffc507d 2020-08-30 15:42 +0000 [a0d41a27d4] Sungtae Kim * res_stasis.c: Added video_single option for bridge creation Currently, it was not possible to create bridge with video_mode single. This made hard to put the bridge in a vidoe_single mode. So, added video_single option for Bridge creation using the ARI. This allows create a bridge with video_mode single. ASTERISK-29055 Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae 2020-08-31 11:14 +0000 [7eaae4e7b6] Ben Ford * Bridging: Use a ref to bridge_channel's channel to prevent crash. There's a race condition with bridging where a bridge can be torn down causing the bridge_channel's ast_channel to become NULL when it's still needed. This particular case happened with attended transfers, but the crash occurred when trying to publish a stasis message. Now, the bridge_channel is locked, a ref to the ast_channel is obtained, and that ref is passed down the chain. Change-Id: Ic48715c0c041615d17d286790ae3e8c61bb28814 2020-09-09 15:43 +0000 Asterisk Development Team * asterisk 18.0.0-rc1 Released. 2020-09-09 09:08 +0000 [f589985840] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.0.0 2020-09-01 08:43 +0000 [5a49757e40] Patrick Verzele * res_pjsip_session: Deferred re-INVITE without SDP send a=sendrecv instead of a=sendonly Building on ASTERISK-25854. When the device requests hold by sending SDP with attribute recvonly, asterisk places the session in sendonly mode. When the device later requests to resume the call by using a re-INVITE excluding SDP, asterisk needs to change the sendonly mode to sendrecv again. Change-Id: I60341ce3d87f95869f3bc6dc358bd3e8286477a6 2020-08-28 16:31 +0000 [ec03909831] Kevin Harwell * conversions: Add string to signed integer conversion functions Change-Id: Id603b0b03b78eb84c7fca030a08b343c0d5973f9 2020-08-26 04:58 +0000 [c83e4821e5] Kfir Itzhak * app_queue: Fix leave-empty not recording a call as abandoned This fixes a bug introduced mistakenly in ASTERISK-25665: If leave-empty is enabled, a call may sometimes be removed from a queue without recording it as abandoned. This causes Asterisk to not generate an abandon event for that call, and for the queue abandoned counter to be incorrect. ASTERISK-29043 #close Change-Id: I1a71b81df78adff59af587f1d8483cf57df430c7 2020-08-28 09:34 +0000 [e32815dddb] George Joseph * ast_coredumper: Fix issues with naming If you run ast_coredumper --tarball-coredumps in the same directory as the actual coredump, tar can fail because the link to the actual coredump becomes recursive. The resulting tarball will have everything _except_ the coredump (which is usually what you need) There's also an issue that the directory name in the tarball is the same as the coredump so if you extract the tarball the directory it creates will overwrite the coredump. So: * Made the link to the coredump use the absolute path to the file instead of a relative one. This prevents the recursive link and allows tar to add the coredump. * The tarballed directory is now named .output instead of just so if you expand the tarball it won't overwrite the coredump. Change-Id: I8b3eeb26e09a577c702ff966924bb0a2f9a759ea 2020-08-28 04:29 +0000 [4f0766dcda] Joshua C. Colp * parking: Copy parker UUID as well. When fixing issues uncovered by GCC10 a copy of the parker UUID was removed accidentally. This change restores it so that the subscription has the data it needs. ASTERISK-29042 Change-Id: I7d396a14ea648bd26d3c363dd78e78bd386b544a 2020-08-26 10:43 +0000 [9ed1b1452d] Alexander Traud * sip_nat_settings: Update script for latest Linux. With the latest Linux, 'ifconfig' is not installed on default anymore. Furthermore, the output of the current net-tools 'ifconfig' changed. Therefore, parsing failed. This update uses 'ip addr show' instead. Finally, the service for the external IP changed. Change-Id: I9b1a7c3f457e3553b50a3e9a55524e40d70245a0 2020-08-26 10:19 +0000 [217449a1e5] Alexander Traud * samples: Fix keep_alive_interval default in pjsip.conf. Since ASTERISK_27978 the default is not off but 90 seconds. That change happened because ASTERISK_27347 disabled the keep-alives in the bundled PJProject and Asterisk should behave the same as before. Change-Id: Ie63dc558ade6a5a2b969c30a4bd492d63730dc46 2020-08-24 16:26 +0000 [31fbfc5e95] Kevin Harwell * chan_pjsip: disallow PJSIP_SEND_SESSION_REFRESH pre-answer execution This patch makes it so if the PJSIP_SEND_SESSION_REFRESH dialplan function is called on a channel prior to answering a warning is issued and the function returns unsuccessful. ASTERISK-28878 #close Change-Id: I053f767d10cf3b2b898fa9e3e7c35ff07e23c9bb 2020-08-27 05:31 +0000 [6d50d152d8] Joshua C. Colp * pbx: Fix hints deadlock between reload and ExtensionState. When the ExtensionState AMI action is executed on a pattern matched hint it can end up adding a new hint if one does not already exist. This results in a locking order of contexts -> hints -> contexts. If at the same time a reload is occurring and adding its own hint it will have a locking order of hints -> contexts. This results in a deadlock as one thread wants a lock on contexts that the other has, and the other thread wants a lock on hints that the other has. This change enforces a hints -> contexts locking order by explicitly locking hints in the places where a hint is added when queried for. This matches the order seen through normal adding of hints. ASTERISK-29046 Change-Id: I49f027f4aab5d2d50855ae937bcf5e2fd8bfc504 2020-08-14 11:13 +0000 [5a8cacb93d] George Joseph * logger.c: Added a new log formatter called "plain" Added a new log formatter called "plain" that always prints file, function and line number if available (even for verbose messages) and never prints color control characters. It also doesn't apply any special formatting for verbose messages. Most suitable for file output but can be used for other channels as well. You use it in logger.conf like so: debug => [plain]debug console => [plain]error,warning,debug,notice,pjsip_history messages => [plain]warning,error,verbose Change-Id: I4fdfe4089f66ce2f9cb29f3005522090dbb5243d 2020-08-21 16:53 +0000 [0319e0b07f] Nickolay Shmyrev * res_speech: Bump reference on format object Properly bump reference on format object to avoid memory corruption on double free ASTERISK-29040 #close Change-Id: Ic5a7faabfe2ef965ddb024186e1de7ca4542e2a3 2020-07-22 03:45 +0000 [addd295cda] Torrey Searle * res_pjsip_diversion: handle 181 Adapt the response handler so it also called when 181 is received. In the case 181 is received, also generate the 181 response. ASTERISK-29001 #close Change-Id: I73cfee46a8ca85371280ebdb38674f8fde7510df 2020-08-21 00:09 +0000 [36dd15c659] Evandro César Arruda * app_queue: Member lastpause time reseting This fixes the reseting members lastpause problem when realtime members is being used, the function rt_handle_member_record was forcing the reset members lastpause because it does not exist in realtime ASTERISK-29034 #close Change-Id: Ic9107e4456732a1f78412a32adb2ef87f5da40b5 2020-08-21 09:17 +0000 [b575868000] Sean Bright * app_voicemail: Process urgent messages with mailcmd Rather than putting messages into INBOX and then moving them to Urgent later, put them directly in to the Urgent folder. This prevents mailcmd from being skipped. ASTERISK-27273 #close Change-Id: I49934e093290d308506ab8d45a40ef705c5ae4f5 2020-08-18 04:36 +0000 [3c074038fe] Joshua C. Colp * res_pjsip_session: Don't aggressively terminate on failed re-INVITE. Per the RFC when an outgoing re-INVITE is done we should only terminate the dialog if a 481 or 408 is received. ASTERISK-29033 Change-Id: I6c3ff513aa41005d02de0396ba820083e9b18503 2020-08-19 12:29 +0000 [5ec7099312] Sean Bright * bridge_channel: Ensure text messages are zero terminated T.140 data in RTP is not zero terminated, so when we are queuing a text frame on a bridge we need to ensure that we are passing a zero terminated string. ASTERISK-28974 #close Change-Id: Ic10057387ce30b2094613ea67e3ae8c5c431dda3 2020-08-07 09:31 +0000 [5dfeeba623] Sean Bright * res_musiconhold.c: Use ast_file_read_dir to scan MoH directory Two changes of note in this patch: * Use ast_file_read_dir instead of opendir/readdir/closedir * If the files list should be sorted, do that at the end rather than as we go which improves performance for large lists Change-Id: Ic7e9c913c0f85754c99c74c9cf6dd3514b1b941f 2020-08-19 07:37 +0000 [c4c72d55a2] George Joseph * scope_trace: Added debug messages and added additional macros The SCOPE_ENTER and SCOPE_EXIT* macros now print debug messages at the same level as the scope level. This allows the same messages to be printed to the debug log when AST_DEVMODE isn't enabled. Also added a few variants of the SCOPE_EXIT macros that will also call ast_log instead of ast_debug to make it easier to use scope tracing and still print error messages. Change-Id: I7fe55f7ec28069919a0fc0b11a82235ce904cc21 2020-08-20 08:32 +0000 [d26ab7f8f9] George Joseph * stream.c: Added 2 more debugging utils and added pos to stream string * Added ast_stream_to_stra and ast_stream_topology_to_stra() macros which are shortcuts for ast_str_tmp(256, ast_stream_to_str(stream, &STR_TMP)) * Added the stream position to the string representation of the stream. * Fixed some formatting in ast_stream_to_str(). Change-Id: Idaf4cb0affa46d4dce58a73a111f35435331cc4b 2020-02-18 06:30 +0000 [9058d9e591] Dennis Buteyn * chan_sip: Clear ToHost property on peer when changing to dynamic host The ToHost parameter was not cleared when a peer's host value was changed to dynamic. This causes invites to be sent to the original host. ASTERISK-29011 #close Change-Id: I9678d512741f71baca8f131a65b7523020b07d5c 2020-07-20 14:39 +0000 [6faf76308d] George Joseph * ACN: Changes specific to the core Allow passing a topology from the called channel back to the calling channel. * Added a new function ast_queue_answer() that accepts a stream topology and queues an ANSWER CONTROL frame with it as the data. This allows the called channel to indicate its resolved topology. * Added a new virtual function to the channel tech structure answer_with_stream_topology() that allows the calling channel to receive the called channel's topology. Added ast_raw_answer_with_stream_topology() that invokes that virtual function. * Modified app_dial.c and features.c to grab the topology from the ANSWER frame queued by the answering channel and send it to the calling channel with ast_raw_answer_with_stream_topology(). * Modified frame.c to automatically cleanup the reference to the topology on ANSWER frames. Added a few debugging messages to stream.c. Change-Id: I0115d2ed68d6bae0f87e85abcf16c771bdaf992c 2020-08-06 12:51 +0000 [543f936147] cmaj * Makefile: Fix certified version numbers Adds sed before awk to produce reasonable ASTERISKVERSIONNUM on certified versions of Asterisk eg. 16.8-cert3 is 160803 instead of the previous 00800. ASTERISK-29021 #close Change-Id: Icf241df0ff6db09011b8c936a317a84b0b634e16 2020-08-06 11:41 +0000 [57554c2834] Sean Bright * res_musiconhold.c: Prevent crash with realtime MoH The MoH class internal file vector is potentially being manipulated by multiple threads at the same time without sufficient locking. Switch to a reference counted list and operate on copies where necessary. ASTERISK-28927 #close Change-Id: I479c5dcf88db670956e8cac177b5826c986b0217 2020-08-06 13:10 +0000 [a3d87f78ed] Joshua C. Colp * res_pjsip: Fix codec preference defaults. When reading in a codec preference configuration option the value would be set on the respective option before applying any default adjustments, resulting in the configuration not being as expected. This was exposed by the REST API push configuration as it used the configuration returned by Asterisk to then do a modification. In the case of codec preferences one of the options had a transcode value of "unspecified" when the defaults should have ensured it would be "allow" instead. This also renames the options in other places that were missed. Change-Id: I4ad42e74fdf181be2e17bc75901c62591d403964 2020-08-04 10:51 +0000 [da8a617dc9] Sean Bright * vector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors The assumed behavior of realloc() - that it was effectively a free() if its second argument was 0 - is Linux specific behavior and is not guaranteed by either POSIX or the C specification. Instead, if we want to resize a vector to 0, do it explicitly. Change-Id: Ife31d4b510ebab41cb5477fdc7ea4e3138ca8b4f 2020-06-30 10:40 +0000 [6482ab5bea] Michael Neuhauser * pjproject: clone sdp to protect against (nat) modifications PJSIP, UDP transport with external_media_address and session timers enabled. Connected to SIP server that is not in local net. Asterisk initiated the connection and is refreshing the session after 150s (timeout 300s). The 2nd refresh-INVITE triggered by the pjsip timer has a malformed IP address in its SDP (garbage string). This only happens when the SDP is modified by the nat-code to replace the local IP address with the configured external_media_address. Analysis: the code to modify the SDP (in res_pjsip_session.c:session_outgoing_nat_hook() and also (redundantly?) in res_pjsip_sdp_rtp.c:change_outgoing_sdp_stream_media_address()) uses the tdata->pool to allocate the replacement string. But the same pjmedia_sdp_stream that was modified for the 1st refresh-INVITE is also used for the 2nd refresh-INVITE (because it is stored in pjmedia's pjmedia_sdp_neg structure). The problem is, that at that moment, the tdata->pool that holds the stringified external_media_address from the 1. refresh-INVITE has long been reused for something else. Fix by Sauw Ming of pjproject (see https://github.com/pjsip/pjproject/pull/2476): the local, potentially modified pjmedia_sdp_stream is cloned in pjproject/source/pjsip/src/pjmedia/sip_neg.c:process_answer() and the clone is stored, thereby detaching from the tdata->pool (which is only released *after* process_answer()) ASTERISK-28973 Reported-by: Michael Neuhauser Change-Id: I272ac22436076596e06aa51b9fa23fd1c7734a0e 2020-08-04 14:36 +0000 [769a9611e7] Ben Ford * utils.c: NULL terminate ast_base64decode_string. With the addition of STIR/SHAKEN, the function ast_base64decode_string was added for convenience since there is a lot of converting done during the STIR/SHAKEN process. This function returned the decoded string for you, but did not NULL terminate it, causing some issues (specifically with MALLOC_DEBUG). Now, the returned string is NULL terminated, and the documentation has been updated to reflect this. Change-Id: Icdd7d05b323b0c47ff6ed43492937a03641bdcf5 2020-07-21 09:17 +0000 [802aa97fa0] George Joseph * ACN: Configuration renaming for pjsip endpoint This change renames the codec preference endpoint options. incoming_offer_codec_prefs becomes codec_prefs_incoming_offer to keep the options together when showing an endpoint. Change-Id: I6202965b4723777f22a83afcbbafcdafb1d11c8d 2020-07-20 13:05 +0000 [de23cb4002] Ben Ford * res_stir_shaken: Fix memory allocation error in curl.c Fixed a memory allocation that was not passing in the correct size for the struct in curl.c. Change-Id: I5fb92fbbe84b075fa6aefa2423786df80e114c3a (cherry picked from commit deaa3742dc998e38369d34bfc308d84e9036dcba) 2020-07-23 14:47 +0000 [71446b68fc] George Joseph * res_pjsip_session: Ensure reused streams have correct bundle group When a bundled stream is removed, its bundle_group is reset to -1. If that stream is later reused, the bundle parameters on session media need to be reset correctly it could mistakenly be rebundled with a stream that was removed and never reused. Since the removed stream has no rtp instance, a crash will result. Change-Id: Ie2b792220f9291587ab5f9fd123145559dba96d7 2020-07-22 04:41 +0000 [99eafe5771] Joshua C. Colp * res_pjsip_registrar: Don't specify an expiration for static contacts. Statically configured contacts on an AOR don't have an expiration time so when adding them to the resulting 200 OK if an endpoint registers ensure they are marked as such. ASTERISK-28995 Change-Id: I9f0e45eb2ccdedc9a0df5358634a19ccab0ad596 2020-07-13 15:06 +0000 [d9ae902f52] Sean Bright * utf8.c: Add UTF-8 validation and utility functions There are various places in Asterisk - specifically in regards to database integration - where having some kind of UTF-8 validation would be beneficial. This patch adds: * Functions to validate that a given string contains only valid UTF-8 sequences. * A function to copy a string (similar to ast_copy_string) stopping when an invalid UTF-8 sequence is encountered. * A UTF-8 validator that allows for progressive validation. All of this is based on the excellent UTF-8 decoder by Björn Höhrmann. More information is available here: https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ The API was written in such a way that should allow us to replace the implementation later should we determine that we need something more comprehensive. Change-Id: I3555d787a79e7c780a7800cd26e0b5056368abf9 2020-07-10 18:14 +0000 [2e32b56bdb] sungtae kim * stasis_bridge.c: Fixed wrong video_mode shown Currently, if the bridge has created by the ARI, the video_mode parameter was not shown in the BridgeCreated event correctly. Fixed it and added video_mode shown in the 'bridge show ' cli. ASTERISK-28987 Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295 2020-07-20 13:17 +0000 [9022f35f09] Sean Bright * vector.h: Add AST_VECTOR_SORT() Allows a vector to be sorted in-place, rather than only during insertion. Change-Id: I22cba9ddf556a7e44dacc53c4431bd81dd2fa780 2020-07-16 08:41 +0000 [a678dafac8] George Joseph * CI: Force publishAsteriskDocs to use python2 Change-Id: I7d951e75ad2d472fa096647dfb55670b11105e23 2020-07-22 12:57 +0000 [af70bbb13a] Joshua C. Colp * websocket / pjsip: Increase maximum packet size. When dealing with a lot of video streams on WebRTC the resulting SDPs can grow to be quite large. This effectively doubles the maximum size to allow more streams to exist. The res_http_websocket module has also been changed to use a buffer on the session for reading in packets to ensure that the stack space usage is not excessive. Change-Id: I31d4351d70c8e2c11564807a7528b984f3fbdd01 2020-07-13 15:42 +0000 [7a43bedd72] Sean Bright * acl.c: Coerce a NULL pointer into the empty string If an ACL is misconfigured in the realtime database (for instance, the "rule" is blank) and Asterisk attempts to read the ACL, Asterisk will crash. ASTERISK-28978 #close Change-Id: Ic1536c4df856231bfd2da00128f7822224d77610 2020-07-13 04:41 +0000 [8d15f72721] Joshua C. Colp * pjsip: Include timer patch to prevent cancelling timer 0. I noticed this while looking at another issue and brought it up with Teluu. It was possible for an uninitialized timer to be cancelled, resulting in the invalid timer id of 0 being placed into the timer heap causing issues. This change is a backport from the pjproject repository preventing this from happening. Change-Id: I1ba318b1f153a6dd7458846396e2867282b428e7 2020-07-15 09:14 +0000 [3330764213] George Joseph * Update .gitreview defaultbranch to 18 Change-Id: Ib2c42fc2d46563e2fbadbd5513cb029b4042791e 2020-07-15 08:59 +0000 [1f5e6805bf] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.0.0 2020-07-02 17:19 +0000 [e4d24f5137] Nickolay Shmyrev * res_http_websocket: Avoid reading past end of string We read beyond the end of the buffer when copying the string out of the buffer when we used ast_copy_string() because the original string was not null terminated. Instead switch to ast_strndup() which does not exhibit the same behavior. ASTERISK-28975 #close Change-Id: Ib4a75cffeb1eb8cf01136ef30306bd623e531a2a 2020-06-24 11:49 +0000 [5fbed5af24] Ben Ford * res_stir_shaken: Add stir_shaken option and general improvements. Added a new configuration option for PJSIP endpoints - stir_shaken. If set to yes, then STIR/SHAKEN support will be added to inbound and outbound INVITEs. The default is no. Alembic has been updated to include this option. Previously the dialplan function was not trimming the whitespace from the parameters it recieved. Now it does. Also added a conditional that, when TEST_FRAMEWORK is enabled, the timestamp in the identity header will be overlooked. This is just for testing, since the testsuite will rely on a SIPp scenario with a preset identity header to trigger the MISMATCH result. Change-Id: I43d67f1489b8c1c5729ed3ca8d71e35ddf438df1 2020-07-09 09:56 +0000 [e88beedd08] George Joseph * res_pjsip_session: Fix segv in session_on_rx_response session_on_rx_response wasn't checking for a NULL dialog before attempting to get the invite session from it. Change-Id: Id13534375966cc2eb7f2b55717c9813c63c10065 2020-06-23 02:34 +0000 [312c23b0e1] Walter Doekes * app_queue: (Breaking change) shared_lastcall and autofill default to no If your queues.conf had _no_ [general] section, they would default to 'yes'. Now, they always default to 'no'. (Actually, commit ed615afb7e0d630a58feba569c657eadc6ddc0a9 already partially fixed it for shared_lastcall.) ASTERISK-28951 Change-Id: Ic39d8a0202906bc454194368bbfbae62990fe5f6 2020-07-06 14:23 +0000 [9bd1d686a1] George Joseph * ACN: Add tracing to existing code Prior to making any modifications to the pjsip infrastructure for ACN, I've added the tracing functions to the existing code. This should make the final commit easier to review, but we can also now run a "before and after" trace. No functional changes were made with this commit. Change-Id: Ia83a1a2687ccb96f2bc8a2a3928a5214c4be775c 2020-07-06 09:56 +0000 [2d22e34206] George Joseph * ACN: res_pjsip endpoint options This commit adds the endpoint options required to control Advanced Codec Negotiation. incoming_offer_codec_prefs outgoing_offer_codec_prefs incoming_answer_codec_prefs outgoing_answer_codec_prefs The documentation may need tweaking and some additional edits added, especially for the "answer" prefs. That'll be handled when things finalize. This commit is safe to merge as it doens't alter any existing functionality nor does it alter the previous codec negotiation work which may now be obsolete. Change-Id: I920ba925d7dd36430dfd2ebd9d82d23f123d0e11 2020-06-23 18:27 +0000 [81b5e4a73f] sungtae kim * res_pjsip.c: Added disable_rport option for pjsip.conf Currently when the pjsip making an outgoing request, it keep adding the rport parameter in a request message as a default. This causes unexpected rport handle at the other end. Added option for disable this behaviour in the pjsip.conf. This is a system option, but working as a gloabl option. ASTERISK-28959 Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc 2020-07-06 10:57 +0000 [d093e44b1e] George Joseph * frame.c: Make debugging easier * ast_frame_subclass2str() and ast_frame_type2str() now return a pointer to the buffer that was passed in instead of void. This makes it easier to use these functions inline in printf-style debugging statements. * Added many missing control frame entries in ast_frame_subclass2str. Change-Id: Ifd0d6578e758cd644c96d17a5383ff2128c572fc 2020-07-05 18:51 +0000 [955b7b4fdb] George Joseph * Scope Trace: Make it easier to trace through synchronous tasks Tracing through synchronous tasks was a little troublesome because the new thread's stack counter reset to 0. This change allows a synchronous task to set its trace level to be the same as the thread that pushed the task. For now, the task's level has to be passed in the task's data structure but a future enhancement to the taskprocessor subsystem could automatically set the trace level of the servant to be that of the caller. This doesn't really make sense for async tasks because you never know when they're going to run anyway. Change-Id: Ib8049c0b815063a45d8c7b0cb4e30b7b87b1d825 2020-06-22 12:16 +0000 [7163efd934] Nickolay Shmyrev * res_http_websocket.c: Continue reading after ping/pong Do not return error if the client received ping frame while looking for a string and just wait for another frame. ASTERISK-28958 #close Change-Id: I4d06b4827bd71e56cbaafc011ffdcef9f0332922 2020-06-30 11:08 +0000 [4eba6b9eb2] Kevin Harwell * PJSIP_MEDIA_OFFER: override configuration on refresh When using the PSJIP_MEDIA_OFFER dialplan function it was not overriding an endpoint's configured codecs on refresh unless they had a shared codec between the two. This patch makes it so whatever is set using PJSIP_MEDIA_OFFER is used when creating the SDP for a refresh no matter what. ASTERISK-28878 #close Change-Id: I0f7dc86fd0fb607c308e6f98ede303c54d1eacb6 2020-06-10 17:02 +0000 [cfed0ea033] Kevin Harwell * manager - Add Content-Type parameter to the SendText action This patch allows a user of AMI to now specify the type of message content contained within by setting the 'Content-Type' parameter. Note, the AMI version has been bumped for this change. ASTERISK-28945 #close Change-Id: Ibb5315702532c6b954e1498beddc8855fabdf4bb 2020-06-26 11:14 +0000 [8d1064eaaf] George Joseph * Streams: Add features for Advanced Codec Negotiation The Streams API becomes the home for the core ACN capabilities. These include... * Parsing and formatting of codec negotation preferences. * Resolving pending streams and topologies with those configured using configured preferences. * Utility functions for creating string representations of streams, topologies, and negotiation preferences. For codec negotiation preferences: * Added ast_stream_codec_prefs_parse() which takes a string representation of codec negotiation preferences, which may come from a pjsip endpoint for example, and populates a ast_stream_codec_negotiation_prefs structure. * Added ast_stream_codec_prefs_to_str() which does the reverse. * Added many functions to parse individual parameter name and value strings to their respectrive enum values, and the reverse. For streams: * Added ast_stream_create_resolved() which takes a "live" stream and resolves it with a configured stream and the negotiation preferences to create a new stream. * Added ast_stream_to_str() which create a string representation of a stream suitable for debug or display purposes. For topology: * Added ast_stream_topology_create_resolved() which takes a "live" topology and resolves it, stream by stream, with a configured topology stream and the negotiation preferences to create a new topology. * Added ast_stream_topology_to_str() which create a string representation of a topology suitable for debug or display purposes. * Renamed ast_format_caps_from_topology() to ast_stream_topology_get_formats() to be more consistent with the existing ast_stream_get_formats(). Additional changes: * A new function ast_format_cap_append_names() appends the results to the ast_str buffer instead of replacing buffer contents. Change-Id: I2df77dedd0c72c52deb6e329effe057a8e06cd56 2020-06-30 08:56 +0000 [7440fd0397] George Joseph * Scope Trace: Add some new tracing macros and an ast_str helper Created new SCOPE_ functions that don't depend on RAII_VAR. Besides generating less code, the use of the explicit SCOPE_EXIT macros capture the line number where the scope exited. The RAII_VAR versions can't do that. * SCOPE_ENTER(level, ...): Like SCOPE_TRACE but doesn't use RAII_VAR and therefore needs needs one of... * SCOPE_EXIT(...): Decrements the trace stack counter and optionally prints a message. * SCOPE_EXIT_EXPR(__expr, ...): Decrements the trace stack counter, optionally prints a message, then executes the expression. SCOPE_EXIT_EXPR(break, "My while got broken\n"); * SCOPE_EXIT_RTN(, ...): Decrements the trace stack counter, optionally prints a message, then returns without a value. SCOPE_EXIT_RTN("Bye\n"); * SCOPE_EXIT_RTN_VALUE(__return_value, ...): Decrements the trace stack counter, optionally prints a message, then returns the value specified. SCOPE_EXIT_RTN_VALUE(rc, "Returning with RC: %d\n", rc); Create an ast_str helper ast_str_tmp() that allocates a temporary ast_str that can be passed to a function that needs it, then frees it. This makes using the above macros easier. Example: SCOPE_ENTER(1, Format Caps 1: %s Format Caps 2: %s\n", ast_str_tmp(32, ast_format_cap_get_names(cap1, &STR_TMP), ast_str_tmp(32, ast_format_cap_get_names(cap2, &STR_TMP)); The calls to ast_str_tmp create an ast_str of the specified initial length which can be referenced as STR_TMP. It then calls the expression, which must return a char *, ast_strdupa's it, frees STR_TMP, then returns the ast_strdupa'd string. That string is freed when the function returns. Change-Id: I44059b20d55a889aa91440d2f8a590865998be51 2020-06-26 05:18 +0000 [4f86118bd8] Joshua C. Colp * res_pjsip: Apply AOR outbound proxy to static contacts. The outbound proxy for an AOR was not being applied to any statically configured Contacts. This resulted in the OPTIONS requests being sent to the wrong target. This change sets the outbound proxy on statically configured contacts once the AOR configuration is done being applied. ASTERISK-28965 Change-Id: Ia60f3e93ea63f819c5a46bc8b54be2e588dfa9e0 2020-06-24 05:25 +0000 [9b5042433b] Joshua C. Colp * menuselect: Resolve infinite loop in dependency scenario. Given a scenario where a module has a dependency on both an external library and a module if the external library was available and the module was not an infinite loop would occur. This happened due to the code changing the dependecy status to no failure on each dependency checking loop iteration, resulting in the code thinking that it had gone from no failure to failure each time triggering another dependency check. This change makes it so that the old dependency status is preserved throughout the dependency checking allowing it to determine that after the first iteration the dependency status does not transition from no failure to failure. ASTERISK-28930 Change-Id: Iea06d45d9fd6d8bfd068882a0bb7e23a53ec3e84 2020-06-22 04:08 +0000 [a423f935c9] Frederic LE FOLL * chan_sip: chan_sip does not process 400 response to an INVITE. chan_sip handle_response() function, for a 400 response to an INVITE, calls handle_response_invite() and does not generate ACK. handle_response_invite() does not recognize 400 response and has no default response processing for unexpected responses, thus it does not generate ACK either. The ACK on response repetition comes from handle_response() mechanism "We must re-send ACKs to re-transmitted final responses". According to code history, 400 response specific processing was introduced with commit "channels/chan_sip: Add improved support for 4xx error codes" This commit added support for : - 400/414/493 in handle_response_subscribe() handle_response_register() and handle_response(). - 414/493 only in handle_response_invite(). This fix adds 400 response support in handle_response_invite(). ASTERISK-28957 Change-Id: Ic71a087e5398dfc7273946b9ec6f9a36960218ad 2020-06-22 15:27 +0000 [8b925fbda3] Kevin Harwell * chan_pjsip: don't use PJSIP_SC_NULL as it only exists pjproject 2.8+ A patch made a reference to the PJSIP_SC_NULL enumeration value, which was added to pjproject 2.8 and above thus making it so Asterisk would fail to compile with prior versions of pjproject. This patch removes the reference, and instead initializes the value to '0'. ASTERISK-28886 #close Change-Id: I68491c80da1a0154b2286c9458440141c98db9d7 2020-06-03 05:05 +0000 [0c1c386634] Università di Bologna - CESIA VoIP * res_corosync: Fix crash in huge distributed environment. 1) Fix memory-leaks Added code to release ast_events extracted from corosync and stasis messages 2) Clean stasis cache when a member of the corosync cluster leaves the group Added code to remove from the stasis cache of the members remained on the group all the messages with the EID of the left member. If the device states of the left member remain in the stasis cache of other members, they will not be updated anymore and high priority cached values, like BUSY, will take precedence over current device states. 3) Stop corosync event propagation when node is not joined to the group Updated dispatch_thread_handler code to detect when asterisk is not joined to the corosync group and added some condition in publish_event_to_corosync code to send corosync messages only when joined. When a node is not joined its corosync daemon can't send messages: the cpg_mcast_joined function append new messages to the FIFO buffer until it's full and then it blocks indefinitely. In this scenario if the stasis_message_cb callback, registered by res_corosync to handle stasis messages, try to send a corosync messages, the thread of the stasis thread-pool will be blocked until the node join the corosync cluster. ASTERISK-28888 Reported by: Università di Bologna - CESIA VoIP Change-Id: Ie8e99bc23f141a73c13ae6fb1948d148d4de17f2 2020-06-13 11:29 +0000 [9445dac43b] Moises Silva * res_http_websocket: Add payload masking to the websocket client ASTERISK-28949 Change-Id: Id465030f2b1997b83d408933fdbabe01827469ca 2020-06-18 03:49 +0000 [00a52b4752] Joshua C. Colp * app_stream_echo: Fix state of added streams. When stream support was added to Asterisk the stream state was used inconsistently, resulting in odd behavior. This was then standardized to be the state of a stream from the perspective of Asterisk. This change updates the StreamEcho dialplan application to use the correct state, send only, since we are only sending to the endpoint and not expecting them to send us multiple video streams. ASTERISK-28954 Change-Id: I35bfd533ef1184ffe62586b22bbd253c82872a56 2020-06-18 05:14 +0000 [d88e230037] Guido Falsi * chan_dadhi: Fix setvar in dahdi channels The change to how setvar works for various channels performed in ASTERISK~23756 missed some required change in the dahdi channel, where the variables are actually set while reading configuration. This change should fix the issue. ASTERISK-28955 Change-Id: Ibfeb7f8cbdd735346dc4028de6a265f24f9df274 2020-06-17 03:58 +0000 [ee8ea9275f] Joshua C. Colp * res_pjsip_session: Preserve label on incoming re-INVITE. When a re-INVITE is received we create a new set of streams that are then swapped in as the active streams. We did not preserve the SDP label from the previous streams, resulting in the label getting lost. This change ensures that if an SDP label is present on the previous stream then it is set on the new stream. ASTERISK-28953 Change-Id: I9dd63b88b562fe96ce5c791a3dae5bcaca258445 2020-06-10 04:35 +0000 [a143c3a7b7] Joshua C. Colp * res_sorcery_memory_cache: Disallow per-object expire with full backend. The AMI action and CLI command did not take into account the properties of full backend caching. This resulted in an expired object remaining removed until a full backend update occurred, instead of having the object updated when needed. This change makes it so that the AMI action and CLI command for object expire will now fail instead of putting the cache into an undesired state. If full backend caching is enabled then only operations which act on the entire cache are available. ASTERISK-28942 Change-Id: Id662d888f177ab566c8e802ad583083b742d21f4 2020-06-02 09:04 +0000 [1274117102] Ben Ford * res_stir_shaken: Add outbound INVITE support. Integrated STIR/SHAKEN support with outgoing INVITEs. When an INVITE is sent, the caller ID will be checked to see if there is a certificate that corresponds to it. If so, that information will be retrieved and an Identity header will be added to the SIP message. The format is: header.payload.signature;info=alg=ES256;ppt=shaken Header, payload, and signature are all BASE64 encoded. The public key URL is retrieved from the certificate. Currently the algorithm and ppt are ES256 and shaken, respectively. This message is signed and can be used for verification on the receiving end. Two new configuration options have been added to the certificate object: attestation and origid. The attestation is required and must be A, B, or C. origid is the origination identifier. A new utility function has been added as well that takes a string, allocates space, BASE64 encodes it, then returns it, eliminating the need to calculate the size yourself. Change-Id: I1f84d6a5839cb2ed152ef4255b380cfc2de662b4 2020-06-15 06:53 +0000 [db012e8cc6] Walter Doekes * app_queue: Remove stale code in try_calling Because ring_entry() is not called, outgoing->chan is not touched here either. ASTERISK-28950 ASTERISK-28644 Change-Id: I564613715dfaf45af868251eb75a451f512af90f 2020-06-15 07:09 +0000 [f1cfd54976] Walter Doekes * res_pjsip: Include instead of internal "pjsua-lib/pjsua.h" Change-Id: I24b5453df412232cf7f9a171ea4a34b35ad3ae78 2020-06-16 08:18 +0000 [0fb6738314] Walter Doekes * app_queue: Read latest wrapuptime instead of (possibly stale) copy Before this changeset, it was possible that a queue member (agent) was called even though they just got out of a call, and wrapuptime seconds hadn't passed yet. This could happen if a member ended a call _between_ a new call attempt and asterisk trying that particular member for a new call. In that case, Asterisk would check the hangup time of the call-before-the-last-call instead of the hangup time of the-last-call. ASTERISK-28952 Change-Id: Ie0cab8f0e8d639c01cba633d4968ba19873d80b3 2020-05-15 16:08 +0000 [415b55af5a] Kevin Harwell * pjproject: Upgrade bundled version to pjproject 2.10 This patch makes the usual necessary changes when upgrading to a new version pjproject. For instance, version number bump, patches removed from third-party, new *.md5 file added, etc.. This patch also includes a change to the Asterisk pjproject Makefile to explicitly create the 'source/pjsip-apps/lib' directory. This directory is no longer there by default so needs to be added so the Asterisk malloc debug can be built. This patch also includes some minor changes to Asterisk that were a result of the upgrade. Specifically, there was a backward incompatibility change made in 2.10 that modified the "expires header" variable field from a signed to an unsigned value. This potentially effects comparison. Namely, those check for a value less than zero. This patch modified a few locations in the Asterisk code that may have been affected. Lastly, this patch adds a new macro PJSIP_MINVERSION that can be used to check a minimum version of pjproject at compile time. ASTERISK-28899 #close Change-Id: Iec8821c6cbbc08c369d0e3cd2f14e691b41d0c81 2020-06-03 11:47 +0000 [de2813cf23] Joshua C. Colp * core_unreal / core_local: Add multistream and re-negotiation. When requesting a Local channel the requested stream topology or a converted stream topology will now be placed onto the resulting channels. Frames written in on streams will now also preserve the stream identifier as they are queued on the opposite channel. Finally when a stream topology change is requested it is immediately accepted and reflected on both channels. Each channel also receives a queued frame to indicate that the topology has changed. ASTERISK-28938 Change-Id: I4e9d94da5230d4bd046dc755651493fce1d87186 2020-06-12 05:16 +0000 [bbe0f2230d] sungtae kim * res_ari: Fix create channel request channelId parameter parsing If channelId parameters were passed in the body, the Asterisk doesn't parsing it correctly. Fixed it to parse the channelId, other_channel_id parameter correclty. ASTERISK-28948 Change-Id: I59b49161a94869169ee19c1ffab5afcef7026157 2020-06-08 06:27 +0000 [c84d962eae] Joshua C. Colp * res_rtp_asterisk: Don't assume setting retrans props means to enable. The "value" passed in when setting an RTP property determines whether it should be enabled or disabled. The RTP send and receive retrans props did not examine this to know if the buffers should be enabled. They assumed they always should be. This change makes it so that the "value" passed in is respected. ASTERISK-28939 Change-Id: I9244cdbdc5fd065c7f6b02cbfa572bc55c7123dc 2020-06-10 12:11 +0000 [8ad06394c4] Joshua C. Colp * bridge_softmix: Add additional old states for adding new source. There are three states that an old stream can be in to allow becoming a source stream in a new stream: 1. Removed 2. Inactive 3. Sendonly This change adds the two missing ones, inactive and sendonly, so if a stream transitions from those to a state where they are providing video to Asterisk we properly re-negotiate the other participants. ASTERISK-28944 Change-Id: Id8256b9b254b403411586284bbaedbf50452de01 2020-06-03 11:23 +0000 [41f3a7da4d] George Joseph * res_fax: Don't start a gateway if either channel is hung up When fax_gateway_framehook is called and a gateway hasn't already been started, the framehook gets the t38 state for both the current channel and the peer. That call trickles down to the channel driver which determines the state. If either channel is hung up (or in the process of being hung up), the channel driver's tech_pvt is going to be NULL which, in the case of chan_pjsip, will cause a segfault. * Added a hangup check for both the channel and peer channel before starting a fax gateway. * Added a check for NULL tech_pvt to chan_pjsip_queryoption so we don't attempt to reference a tech_pvt that's already gone. ASTERISK-28923 Reported by: Yury Kirsanov Change-Id: I4e10e63b667bbb68c1c8623f977488f5d807897c 2020-06-07 19:02 +0000 [b9f42a717e] George Joseph * app_confbridge: Plug ref leak of bridge channel with send_events When send_events is enabled for a user, we were leaking a reference to the bridge channel in confbridge_manager.c:send_message(). This also caused the bridge snapshot to not be destroyed. Change-Id: I87a7ae9175e3cd29f6d6a8750e0ec5427bd98e97 2020-06-01 18:25 +0000 [3d1bf3c537] Kevin Harwell * Compiler fixes for gcc 10 This patch fixes a few compile warnings/errors that now occur when using gcc 10+. Also, the Makefile.rules check to turn off partial inlining in gcc versions greater or equal to 8.2.1 had a bug where it only it only checked against versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures any version above the specified version is correctly compared. Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9 2020-06-08 14:34 +0000 [559fa0e89c] Ben Ford * cli.c: Fix compiler error. Added default variable value to fix a compiler error. Change-Id: I7b592adbb1274dc5464dea1c5e5de0685c928553 2020-06-09 06:57 +0000 [fa7c69f40f] sungtae kim * res_ari: Fix create request body parameter parsing. If parameters were passed in the body as JSON to the create route they were not being parsed before checking to ensure that required fields were set. This change moves the parsing so it occurs before checking. ASTERISK-28940 Change-Id: I898b4c3c7ae1cde19a6840e59f498822701cf5cf 2020-06-05 04:30 +0000 [e74dde5100] Walter Doekes * pjsip: Prevent invalid memory access when attempting to contact a non-sip URI You cannot cast a pjsip_uri to a pjsip_sip_uri using pjsip_uri_get_uri, without checking that it's a PJSIP_URI_SCHEME_IS_SIP(S). ASTERISK-28936 Change-Id: I9f572b3677e4730458e9402719e580f8681afe2a 2020-05-19 14:46 +0000 [3927f79cb5] Ben Ford * res_stir_shaken: Add inbound INVITE support. Integrated STIR/SHAKEN support with incoming INVITES. Upon receiving an INVITE, the Identity header is retrieved, parsing the message to verify the signature. If any of the parsing fails, AST_STIR_SHAKEN_VERIFY_NOT_PRESENT will be added to the channel for this caller ID. If verification itself fails, AST_STIR_SHAKEN_VERIFY_SIGNATURE_FAILED will be added. If anything in the payload does not line up with the SIP signaling, AST_STIR_SHAKEN_VERIFY_MISMATCH will be added. If all of the above steps pass, then AST_STIR_SHAKEN_VERIFY_PASSED will be added, completing the verification process. A new config option has been added to the general section for stir_shaken.conf. "signature_timeout" is the amount of time a signature will be considered valid. If an INVITE is received and the amount of time between when it was received and when it was signed is greater than signature_timeout, verification will fail. Some changes were also made to signing and verification. There was an error where the whole JSON string was being signed rather than the header combined with the payload. This has been changed to sign the correct thing. Verification has been changed to do this as well, and the unit tests have been updated to reflect these changes. A couple of utility functions have also been added. One decodes a BASE64 string and returns the decoded string, doing all the length calculations for you. The other retrieves a string value from a header in a rdata object. Change-Id: I855f857be3d1c63b64812ac35d9ce0534085b913 2020-06-05 04:45 +0000 [1fcb6b1b21] Joshua C. Colp * bridge_channel: Don't queue unmapped frames. If a frame is written to a channel in a bridge we would normally queue this frame up and the channel thread would then act upon it. If this frame had no stream mapping on the channel it would then be discarded. This change adds a check before the queueing occurs to determine if a mapping exists. If it does not exist then the frame is not even queued at all. This stops a frame duplication from happening and from the channel thread having to wake up and deal with it. Change-Id: I17189b9b1dec45fc7e4490e8081d444a25a00bda 2020-05-27 03:47 +0000 [d2500c6273] Joshua C. Colp * res_fax: Don't consume frames given to fax gateway on write. In a particular fax gateway scenario whereby it would have to translate using the read translation path on a channel the frame being translated would be consumed. When the frame is in the write path it is not permitted to free the frame as the caller expects it to continue to exist. This change makes it so that the frame is only consumed on the read path where it is acceptable to free it. ASTERISK-28900 Change-Id: I011c321288a1b056d92b37c85e229f4a28ee737d 2020-06-02 06:24 +0000 [0a4dffe6f8] Alexander Traud * pjproject_bundled: Honor --without-pjproject. The previous change missed that 'make' uses 'PJPROJECT_BUNDLED' anyway. ASTERISK-28929 Change-Id: I7ef0e78a06ea391b59d95b99d46bbed3fec4fed9 2020-06-04 01:50 +0000 [e8c6e9ae5d] Pirmin Walthert * res_pjsip_logger: use the correct pointer when logging tx_messages to pcap When writing tx messages to pcap files, Asterisk is using the wrong pointer resulting in lots of wasted space. This patch fixes it to use the correct pointer. ASTERISK-28932 #close Change-Id: I5b8253dd59a083a2ca2c81f232f1d14d33c6fd23 2020-05-28 20:03 +0000 [25ae412f75] sungtae kim * bridge.c: Fixed null pointer exception If the bridge show all command could not get the bridge snapshot, it causes null pointer exception. Fixed it to check the snapshot is null. ASTERISK-28920 Change-Id: I3521fc1b832bfc69644d0833f2c78177e1e51f58 2020-05-14 13:24 +0000 [ca3c22c5f1] George Joseph * Scope Tracing: A new facility for tracing scope enter/exit What's wrong with ast_debug? ast_debug is fine for general purpose debug output but it's not really geared for scope tracing since it doesn't present its output in a way that makes capturing and analyzing flow through Asterisk easy. How is scope tracing better? Scope tracing uses the same "cleanup" attribute that RAII_VAR uses to print messages to a separate "trace" log level. Even better, the messages are indented and unindented based on a thread-local call depth counter. When output to a separate log file, the output is uncluttered and easy to follow. Here's an example of the output. The leading timestamps and thread ids are removed and the output cut off at 68 columns for commit message restrictions but you get the idea. --> res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001 --> res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173 --> res_pjsip_session.c:3669 handle_incoming_response PJSIP/ --> chan_pjsip.c:3265 chan_pjsip_incoming_response_after --> chan_pjsip.c:3194 chan_pjsip_incoming_response P chan_pjsip.c:3245 chan_pjsip_incoming_respon <-- chan_pjsip.c:3194 chan_pjsip_incoming_response P <-- chan_pjsip.c:3265 chan_pjsip_incoming_response_after <-- res_pjsip_session.c:3669 handle_incoming_response PJSIP/ <-- res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173 <-- res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001 The messages with the "-->" or "<--" were produced by including the following at the top of each function: SCOPE_TRACE(1, "%s\n", ast_sip_session_get_name(session)); Scope isn't limited to functions any more than RAII_VAR is. You can also see entry and exit from "if", "for", "while", etc blocks. There is also an ast_trace() macro that doesn't track entry or exit but simply outputs a message to the trace log using the current indent level. The deepest message in the sample (chan_pjsip.c:3245) was used to indicate which "case" in a "select" was executed. How do you use it? More documentation is available in logger.h but here's an overview: * Configure with --enable-dev-mode. Like debug, scope tracing is #ifdef'd out if devmode isn't enabled. * Add a SCOPE_TRACE() call to the top of your function. * Set a logger channel in logger.conf to output the "trace" level. * Use the CLI (or cli.conf) to set a trace level similar to setting debug level... CLI> core set trace 2 res_pjsip.so Summary Of Changes: * Added LOG_TRACE logger level. Actually it occupies the slot formerly occupied by the now defunct "event" level. * Added core asterisk option "trace" similar to debug. Includes ability to specify global trace level in asterisk.conf and CLI commands to turn on/off and set levels. Levels can be set globally (probably not a good idea), or by module/source file. * Updated sample asterisk.conf and logger.conf. Tracing is disabled by default in both. * Added __ast_trace() to logger.c which keeps track of the indent level using TLS. It's #ifdef'd out if devmode isn't enabled. * Added ast_trace() and SCOPE_TRACE() macros to logger.h. These are all #ifdef'd out if devmode isn't enabled. Why not use gcc's -finstrument-functions capability? gcc's facility doesn't allow access to local data and doesn't operate on non-function scopes. Known Issues: The only know issue is that we currently don't know the line number where the scope exited. It's reported as the same place the scope was entered. There's probably a way to get around it but it might involve looking at the stack and doing an 'addr2line' to get the line number. Kind of like ast_backtrace() does. Not sure if it's worth it. Change-Id: Ic5ebb859883f9c10a08c5630802de33500cad027 2020-05-29 04:28 +0000 [c16937cdbe] Pirmin Walthert * res_pjsip_logger.c: correct the return value checks when writing to pcap files fwrite() does return the number of elements written and not the number of bytes. However asterisk is currently comparing the return value to the size of the written element what means that asterisk logs five WARNING messages on every packet written to the pcap file. This patch changes the code to check for the correct value, which will always be 1. ASTERISK-28921 #close Change-Id: I2455032d9cb4c5a500692923f9e2a22e68b08fc2 2020-05-27 09:35 +0000 [9c2871edf4] Joshua C. Colp * res_pjsip: Use correct pool for storing the contact_user value. When replacing the user portion of the Contact URI the code was using the ephemeral pool instead of the tdata pool. This could cause the Contact user value to become invalid after a period of time. The code will now use the tdata pool which persists for the lifetime of the message instead. ASTERISK-28794 Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5 2020-05-13 07:06 +0000 [1399f8b4fe] Pirmin Walthert * res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header While asterisk is filtering out the x-ast-orig-host parameter from the contact on response messages, it is not filtering it out from the request URI and the to header on SIP requests (for example INVITE). ASTERISK-28884 #close Change-Id: Id032b33098a1befea9b243ca994184baecccc59e 2020-05-18 09:05 +0000 [afa2c9a868] Joshua C. Colp * bridge: Don't try to match audio formats. When bridging channels we were trying to match the audio formats of both sides in combination with the configured formats. While this is allowed in SDP in practice this causes extra reinvites and problems. This change ensures that audio streams use the formats of the first existing active audio stream. It is only when other stream types (like video) exist that this will result in re-negotiation occurring for those streams only. ASTERISK-28871 Change-Id: I22f5a3e7db29e00c165e74d05d10856f6086fe47 2020-05-19 07:55 +0000 [ec7890d7c6] Joshua C. Colp * res_sorcery_config: Always reload configuration on errors. When a configuration file in Asterisk is loaded information about it is stored such that on a reload it is not reloaded if nothing has changed. This can be problematic when an error exists in a configuration file in PJSIP since the error will be output at start and not subsequently on reload if the file is unchanged. This change makes it so that if an error is encountered when res_sorcery_config is loading a configuration file a reload will always read in the configuration file, allowing the error to be seen easier. Change-Id: If2e05a017570f1f5f4f49120da09601e9ecdf9ed 2020-05-18 10:10 +0000 [4de0e50c32] Alexander Traud * res_srtp: Set all possible flags while selecting the Crypto Suite. The flags of a previous selection could have been set within the object 'srtp', for example, when the previous selection returned failure after setting just 'some' flags. Now, not to clutter the code, all possible flags are cleared first, and then the selected flags are set as before. ASTERISK-28903 Change-Id: I1b9d7aade7d5120244ce7e3a8865518cbd6e0eee 2020-05-19 04:18 +0000 [e8c8d69d47] Joshua C. Colp * bridge_softmix: Always remove audio from mixed frame. When receiving audio from a channel we determine if it is talking or silence based on a threshold value. If this threshold is met we always mix the audio into the conference bridge. If this threshold is not met we also mix the audio into the conference bridge UNLESS the drop silence option is enabled. The code that removed the audio from the mixed frame assumed that it was always not present if it did not meet the threshold to be considered talking. This is incorrect. If it has been stated that the audio was mixed into the mixed frame then it has been mixed into the mixed frame. By not removing audio that was considered non-talking it was possible for a channel to receive a slight echo of audio of itself at times. This change ensures that the audio is always removed from the mixed frame going back to the channel so it no longer receives the slight echo. ASTERISK-28898 Change-Id: I7b1b582cc1bcdb318ecc60c9d2e3d87ae31d55cb 2020-05-13 16:37 +0000 [f506cc4896] Ben Ford * res_stir_shaken: Add unit tests for signing and verification. Added two unit tests, one for signing and another for verifying. stir_shaken_sign checks to make sure that all the required parameters are passed in and then signs the actual payload. If a signature is produced and a payload returned as a result, the test passes. stir_shaken_verify takes the signature from a signed payload to verify. This unit test also verifies that all the required information is passed in, and then attempts to verify the signature. If verification is successful and a payload is returned, the test passes. Change-Id: I9fa43380f861ccf710cd0f6b6c102a517c86ea13 2020-04-30 17:57 +0000 [a7aaee70c6] Joshua C. Colp * res_pjsip_logger: Expand functionality to improve logging. The PJSIP packet logger now has the following CLI commands: pjsip set logger pcap When used this will create a pcap file containing the incoming and outgoing SIP packets, in unencrypted form. pjsip set logger verbose This allows you to toggle logging to verbose on and off. pjsip set logger host add This allows you to add an additional IP address or subnet mask to logging, allowing you to log multiple instead of just a single IP address or all traffic. The normal "pjsip set logger host" CLI command has also been expanded to allow subnet masks as well. ASTERISK-28895 Change-Id: If5859161a72b0d7dd2d1f92d45bed88e0cd07d0e 2020-05-13 13:32 +0000 [fef97a9a72] Nicholas John Koch * res_musiconhold: Added check for dot character in path of playlist entries to avoid warnings A warning was triggered that there may be a problem regarding file extension (which is correct and should not be set anyway). The warning also appeared if there was dot within the path itself. E.g. [sales-queue-hold] mode=playlist entry=/var/www/domain.tld/moh/funky_music The music played correctly but you get a warning message. Now there will be a check if the position of a potential dot character is after the last position of a slash character. This dot charachter will be treated as a extension naming. Dots within the path then ignored. ASTERISK-28892 Reported-By: Nicholas John Koch Change-Id: I2ec35a613413affbf5fcc01c8c181eba24865b9e 2020-05-18 11:31 +0000 [c8c94b6cf1] sungtae kim * res_rtp_asterisk.c: Fixed memory leak Added freeifaddrs() for memory releasing. ASTERISK-28904 Change-Id: I109403866e85a30659351946903a679de9727a8f 2020-05-12 18:15 +0000 [15cbff9d54] Joshua C. Colp * ari: Allow variables to be set on channel create. This change adds the same variable functionality that is available for originating a channel to the create call. Now when creating a channel you can specify dialplan variables to set instead of having to do another API call. ASTERISK-28896 Change-Id: If13997ba818136d7c070585504fc4164378aa992 2020-05-10 05:01 +0000 [c8dec423d2] Peter Sokolov (License #7070) * pjsip_resolver.c: Ensure AAAA dns requests are made. 1. Modify sip_resolve and sip_resolve_callback to request AAAA lookups when an IPV6 transport type has been requested. 2. Rename all occurrences of pjsip_transport_get_type_name to pjsip_transport_get_type_desc. This ensures that the log/debug info shows whether the transport is IPv6 or IPv4. 3. Do not add the constant PJSIP_TRANSPORT_IPV6 to existing transport types. This results in invalid values. Use a bitwise or instead. ASTERISK-26780 Patches: pjsip_resolver.c uploaded by Peter Sokolov (License #7070) Change-Id: I8b1e298f8efa682d0a7644113258fe76d9889c58 2020-05-04 16:11 +0000 [e29df34de0] Ben Ford * res_stir_shaken: Added dialplan function and API call. Adds the "STIR_SHAKEN" dialplan function and an API call to add a STIR_SHAKEN verification result to a channel. This information will be held in a datastore on the channel that can later be queried through the "STIR_SHAKEN" dialplan funtion to get information on STIR_SHAKEN results including identity, attestation, and verify_result. Here are some examples: STIR_SHAKEN(count) STIR_SHAKEN(0, identity) STIR_SHAKEN(1, attestation) STIR_SHAKEN(2, verify_result) Getting the count can be used to iterate through the results and pull information by specifying the index and the field you want to retrieve. Change-Id: Ice6d52a3a7d6e4607c9c35b28a1f7c25f5284a82 2020-05-08 06:11 +0000 [801d570f6e] Guido Falsi * pjproject: Fix race condition when building with parallel make Pjproject makefiles miss some dependencies which can cause race conditions when building with parallel make processes. This patch adds such dependencies correctly. ASTERISK-28879 #close Reported-by: Dmitry Wagin Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22 2020-05-09 02:46 +0000 [4a072c4890] Roger James * res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered. Changed source and destination address fields in struct pjsip_history_entry so that they are long enough to hold an IPv6 address. ASTERISK-28854 Change-Id: Id65bb9aa961e9ecbcb500815e18170f774e34d3e 2020-04-01 08:38 +0000 [f9ea75d117] Alexander Traud * tcptls: Fix notice when TLS is enabled but not supported. ASTERISK-28797 Change-Id: Iab364a2c2519fd9d11d1c28293fda43d61b64c28 2020-04-04 04:28 +0000 [527e4f6542] Alexander Traud * app_osplookup: Avoid a format truncation. Ensure that output buffers for the osp_convert_inout function have sufficient space for additional data such as brackets and ports. ASTERISK-28804 Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b 2020-04-14 11:02 +0000 [6b2d945174] Pirmin Walthert * app.c: make sure that no non-async-signal-safe syscalls are used after fork before exec Posix does only allow async-signal-safe syscalls after fork before exec. As asterisk ignores this, functions like TrySystem or System sometimes end up in a deadlocked child process. The patch prevents the use of non-async-signal-safe syscalls. ASTERISK-28776 Change-Id: Idc76365c0592ee3f3b3bd72a4f48f7a098978e8e 2020-05-04 11:31 +0000 [7fbfbe7da0] George Joseph * streams: Fix one memory leak and one formats ref issue ast_stream_topology_create_from_format_cap() was setting the stream->formats directly but not freeing the default formats. This causes a memory leak. * ast_stream_topology_create_from_format_cap() now calls ast_stream_set_formats() which properly cleans up the existing stream formats. When cloning a stream, the source stream's format caps _pointer_ is copied to the new stream and it's reference count bumped. If either stream is set to "removed", this will cause _both_ streams to have their format caps cleared. * ast_stream_clone() now creates a new format caps object and copies the formats from the source stream instead of just copying the pointer. ASTERISK-28870 Change-Id: If697d81c3658eb7baeea6dab413b13423938fb53 2020-04-08 18:41 +0000 [f217fcdc62] Nathan Bruning * app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions Add a new "masquarade" channel event, and use it in app_queue to track unique id's. Testcase is submitted as https://gerrit.asterisk.org/c/testsuite/+/14210 ASTERISK-28829 #close ASTERISK-25844 #close Change-Id: Ifc5f9f9fd70903f3c6e49738d3bc632b085d2df6 2020-05-04 03:29 +0000 [44e5dd288b] Jaco Kroon * Remove #include These are not provided by standards, and as a result causes failure to compile on musl. https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E Change-Id: I6a357cefd106c72cfecafd898638f6b5692c2e05 2020-05-03 05:30 +0000 [c831f03273] Guido Falsi * pjproject: Remove bashism from configure.m4 script The configure.m4 script for pjproject contains some += syntax, which is specific to bash, replacing it with string substitutions makes the script compatible with traditional Bourne shells. ASTERISK-28866 #close Reported-by: Christoph Moench-Tegeder Change-Id: I382a78160e028044598b7da83ec7e1ff42b91c05 2020-05-01 07:29 +0000 [1cfd30bd8a] Joshua C. Colp * res_stir_shaken: Use ast_asprintf for creating file path. Change-Id: Ice5d92ecea2f1101c80487484f48ef98be2f1824 2020-04-15 13:15 +0000 [9acf840f7c] Ben Ford * res_stir_shaken: Implemented signature verification. There are a lot of moving parts in this patch, but the focus of it is on the verification of the signature using a public key located at the public key URL provided in the JSON payload. First, we check the database to see if we have already downloaded the key. If so, check to see if it has expired. If it has, redownload from the URL. If we don't have an entry in the database, just go ahead and download the public key. The expiration is tested each time we download the file. After that, read the public key from the file and use it to verify the signature. All sanity checking is done when the payload is first received, so the verification is complete once this point is reached. The XML has also been added since a new config option was added to general (curl_timeout). The maximum amount of time to wait for a download can be configured through this option, with a low value by default. Change-Id: I3ba4c63880493bf8c7d17a9cfca1af0e934d1a1c 2020-04-30 10:56 +0000 [7baf2c4bf1] George Joseph * app_voicemail: Add workaround for a gcc 10 issue with -Wrestrict The gcc 10 -Wrestrict option was causing "overlap" errors when snprintf was copying one char[256] structure member to another char[256] member in the same structure. Using ast_alloca instead of declaring the structure inline solves the issue. Here's a link to the "enhancement": https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg00570.html We may follow up with a gcc bug report. Change-Id: Ie0099adcb0a9727bd9aa99e024dd912a67eaf534 2020-04-28 10:31 +0000 [3078a00a6d] Joshua C. Colp * pjsip: Increase maximum ICE candidate count. In practice it has been seen that some users come close to our maximum ICE candidate count of 32. In case people have gone over this increases the count to 64, giving ample room. ASTERISK-28859 Change-Id: I35cd68948ec0ada86c14eb53092cdaf8b62996cf 2020-04-27 10:28 +0000 [29070b61f7] Alexander Traud * core_local: Local calls are always secure. In a Dialplan, the channel drivers 'chan_sip' and 'chan_iax2' support the channel items 'secure_bridge_media' and 'secure_bridge_signaling'. That way, a channel can be forced to use encryption even if not specified in its configuration. However, when the Local Proxy kicks in, for example, in case of a forwarding (SIP status 302), Local Proxy stated it does not know those items. Consequently, such a call could not be proxied how clever your Dialplan was. Because local calls within Asterisk are always secure, Local Proxy accepts such a request now. ASTERISK-22920 Change-Id: I4c143bb70f686790953cc04c5a4b810bbb03636c 2020-04-26 05:56 +0000 [e4366308e1] Guido Falsi * res_rtp_asterisk: Protect access to nochecksums with #ifdef Recently code accessing nochecksums variable has been added without including #ifdef SO_NO_CHECK protection, while the variable is created only when such constant is defined. ASTERISK-28852 #close Change-Id: I381718893b80599ab8635f2b594a10c1000d595e 2020-04-26 06:08 +0000 [97494d8984] Guido Falsi * core/dns: Add system include required on FreeBSD While testing the latest RC on FreeBSD I noticed this new file fails to build. On FreeBSD inlcuding resolv.h requires sockaddr_in to be defined, and it's defined in netinet/in.h. So I added this include. ASTERISK-28853 #close Change-Id: I6997daf3956e6eb70ab6cb358628d162fad80079 2020-04-17 02:39 +0000 [3303defd3f] Peter Turczak * chan_mobile: Add smoother to make SIP/RTP endpoints happy. In contrast to RFC 3551, section 4.2, several SIP/RTP clients misbehave severly (up to crashing). This patch adds another smoother for the audio received via bt. Therefore the audio frames sent to the core will be CHANNEL_FRAME_SIZE. ASTERISK-28832 #close Change-Id: Ic5f9e2f35868ae59cc9356afbd1388b779a1267f 2020-04-22 12:38 +0000 [26b8c99963] Alexander Traud * app_fax: SpanDSP headers do not use ast_malloc; ignore that. Since Asterisk 14, app_fax did not compile at all because Asterisk requires that not malloc but ast_malloc is used everywhere. However, the system headers of SpanDSP use malloc. Because we cannot (and do not need to) change system headers, let us ignore this. ASTERISK-28848 Change-Id: I31f7a6b92a07032c5cef1c16b8901b107fe35546 2020-04-21 04:52 +0000 [1c5e68580a] Joshua C. Colp * stream: Enforce formats immutability and ensure formats exist. Some places in Asterisk did not treat the formats on a stream as immutable when they are. The ast_stream_get_formats function is now const to enforce this and parts of Asterisk have been updated to take this into account. Some violations of this were also fixed along the way. An additional minor tweak is that streams are now allocated with an empty format capabilities structure removing the need in various places to check that one is present on the stream. ASTERISK-28846 Change-Id: I32f29715330db4ff48edd6f1f359090458a9bfbe 2020-04-21 10:40 +0000 [9ad3d2829c] sungtae kim * res_ari_channels: Fixed endpoint 80 characters limit Fixed it to copy the entire string from the requested endpoint body except tech-prefix. ASTERISK-28847 Change-Id: I91b5f6708a1200363f3267b847dd6a0915222c25 2020-04-20 10:18 +0000 [e56f4de7e6] Joshua C. Colp * fax: Fix crashes in PJSIP re-negotiation scenarios. This change fixes a few re-negotiation issues uncovered with fax. 1. The fax support uses its own mechanism for re-negotiation by conveying T.38 information in its own frames. The new support for re-negotiating when adding/removing/changing streams was also being triggered for this causing multiple re-INVITEs. The new support will no longer trigger when transitioning between fax. 2. In off-nominal re-negotiation cases it was possible for some state information to be left over and used by the next re-negotiation. This is now cleared. ASTERISK-28811 ASTERISK-28839 Change-Id: I8ed5924b53be9fe06a385c58817e5584b0f25cc2 2020-04-15 15:13 +0000 [9f117ac9ef] Daniel Heckl * res_pjsip: Fixed format of IPv6 addresses for external media addresses ASTERISK-28835 Change-Id: I66289afd164c5cdd6c5caa39e79d629a467e7a26 2020-04-20 13:11 +0000 [52f07176b6] Alexander Traud * chan_sip: externhost/externaddr with non-default TCP/TLS ports. ASTERISK-28372 Reported by: Anton Satskiy ASTERISK-24428 Reported by: sstream Change-Id: I2b7432a9bf3b09dc8515297ff955636db7a6224c 2020-04-17 05:41 +0000 [abf4d74384] Alexander Traud * cdr_odbc: Sync load- and build-time deps. MODULEINFO is checked while buidling/linking the module. AST_MODULE_INFO is checked while loading/running the module. ASTERISK-28838 Change-Id: I55dc05ce19552d0415c9045021b42bd82ef44e52 2020-04-16 08:15 +0000 [6cfc6ff53c] Joshua C. Colp * confbridge: Add support for disabling text messaging. When in a conference bridge it may be necessary to have text messages disabled for specific participants or for all. This change adds a configuration option, "text_messaging", which can be used to enable or disable this on the user profile. By default existing behavior is preserved as it defaults to "yes". ASTERISK-28841 Change-Id: I30b5d9ae6f4803881d1ed9300590d405e392bc13 2020-04-17 04:18 +0000 [191f136260] Alexander Traud * res_pjsip_refer: Add build-time dependency. ASTERISK-28838 Change-Id: Ic693c3f464e35ec0db242afdb0a1415806af4e25 2020-04-17 05:17 +0000 [5c2b8fdeca] Alexander Traud * app_getcpeid: Add build-time dependency. ASTERISK-28838 Change-Id: I68b78e7e4718be82507247433127ce3992a5ba96 2020-04-17 04:47 +0000 [008f46bf1e] Alexander Traud * res_pjsip: Sync load- and build-time deps. MODULEINFO is checked while buidling/linking the module. AST_MODULE_INFO is checked while loading/running the module. ASTERISK-28838 Change-Id: I4bb868532ca217fec1351885d99eb55c21b58042 2020-04-17 06:51 +0000 [e2affa3b0a] Alexander Traud * curl: Add build-time dependency. ASTERISK-28838 Change-Id: I34724e799e1ffaf723eb2c358abe8934dbadcd52 2020-04-17 04:55 +0000 [f1135b453b] Alexander Traud * res_pjsip: Add build-time dependency. ASTERISK-28838 Change-Id: Icb08304744ae3f34dce6ccb76f94379b8382a074 2020-04-15 13:01 +0000 [966acc6251] Alexander Traud * pjproject_bundled: Honor --without-pjproject. ASTERISK-28837 Change-Id: Id057324912a3cfe6f50af372675626bb515907d9 2020-04-14 10:48 +0000 [d50fd0acc0] Pirmin Walthert * res_rtp_asterisk: Resolve loop when receive buffer is flushed When the receive buffer was flushed by a received packet while it already contained a packet with the same sequence number, Asterisk never left the while loop which tried to order the packets. This change makes it so if the packet is in the receive buffer it is retrieved and freed allowing the buffer to empty. ASTERISK-28827 Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3 2020-04-15 07:16 +0000 [a107e85b2e] Alexander Traud * install_prereq: Add libcap for high bits in DiffServ/ToS. works automatically; see Mantis 7047 (now ASTERISK-6863) Change-Id: I27d2c109180bd857b6757fd532de48eddb78aee6 2020-04-15 01:20 +0000 [4d0ab620be] Alexander Traud * chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets. ASTERISK-27195 Reported by: Joshua Roys Change-Id: I6e72ecb874200dec7a3865c7babaf5ac0d3101de 2020-04-15 06:09 +0000 [4ef5ba58f5] Alexander Traud * BuildSystem: Only if found LibPRI, check its optional parts. Change-Id: If8445f899ee4ce0c606c484943d4ce0c8e43b5da 2020-04-14 10:31 +0000 [ca032d1e2e] Pirmin Walthert * res_rtp_asterisk: Free payload when error on insertion to data buffer When the ast_data_buffer_put rejects to add a packet, for example because the buffer already contains a packet with the same sequence number, the payload will never be freed, resulting in a memory leak. The data buffer will now return an error if this situation occurs allowing the caller to free the payload. The res_rtp_asterisk module has also been updated to do this. ASTERISK-28826 Change-Id: Ie6c49495d1c921d5f997651c7d0f79646f095cf1 2020-04-14 06:26 +0000 [ef580f96e7] Alexander Traud * BuildSystem: Only if found external PJProject, check its optional parts. Change-Id: I11d5693d25c166c99d8cebffc16184d58f6362de 2020-04-08 05:29 +0000 [7db03e12a7] Bernard Merindol * res_rtp_asterisk.c: Check for first DTMF having timestamp set to 0 When the first DTMF receive in RF2833 codec have TimeStamp at 0 is not processed. ASTERISK-28812 Change-Id: I3196803a062dd2daee4938c9a778c3810cb7e504 2020-04-13 11:47 +0000 [611529fa52] Alexander Traud * res_stir_shaken: Do not build without OpenSSL. Change-Id: Idba5151a3079f9dcc0076d635422c5df5845114f 2020-04-13 11:38 +0000 [27de0c9700] Alexander Traud * res_audiosocket: Avoid Sometimes-uninitialized Warning with Clang. Change-Id: I40c014c2cb88e943cf6f1b99a08c7c885e855b3a 2020-04-07 07:05 +0000 [de66713fd5] Jean Aunis * func_volume: Accept decimal number as argument Allow voice volume to be multiplied or divided by a floating point number. ASTERISK-28813 Change-Id: I5b42b890ec4e1f6b0b3400cb44ff16522b021c8c 2019-12-03 12:35 +0000 [2b80e5f5da] Jaco Kroon * res_rtp_asterisk: iterate all local addresses looking to populate ICE. By using pjproject to give us a list of candidates, and then filtering, if the host has >32 addresses configured, then it is possible that we end up filtering out all 32 of those, and ending up with no candidates at all. Instead, get getifaddrs (which pjsip is using underlying anyway) to retrieve all local addresses, and iterate those, adding the first 32 addresses not excluded by the ICE ACL. In our setup at any point in time We've got between 6 and 328 addresses on any given system. The lower limit is the lower limit but the upper limit is growing on a near daily basis currently. Change-Id: I109eaffc3e2b432f00bf958e3caa0f38cacb4edb Signed-off-by: Jaco Kroon 2020-04-10 08:13 +0000 [3431949a52] Alexander Traud * pjproject_bundled: Repair ./configure --with-ssl without ARG. ASTERISK-28758 Reported by: Patrick Wakano Reported by: Dmitriy Serov Change-Id: Ifb6b85c559d116739af00bc48d1f547caa85efac 2020-04-11 14:03 +0000 [1cf569ba2b] Jaco Kroon * res_pjsip: document legal dtls_verify endpoint options. Change-Id: I7fa7c5c8a7ddb0bd525982f58bff3264ebbd9a1b 2020-04-12 09:53 +0000 [610e058189] Alexander Traud * BuildSystem: Search for Python/C API when possibly needed only. The Python/C API is used only if the Test Framework was enabled in Asterisk 'make menuselect'. The Test Framework is available only if the Developer Mode was enabled in Asterisk './configure --enable-dev-mode'. And that Python/C API is used only if the PJProject was found and not disabled in Asterisk; the user did not go for './configure --without-pjproject'. Furthermore, because version 2 of that Python/C API is required (currently) and because some platforms do not offer a generic version 2, the script searches for 2.7 explicitly as well. To avoid version mismatch between the Python/C API and the Python environment, the script searches for the latter in the same versions, in the same the order as well. Because this Python/C API is just for (some) Asterisk contributors, the script also goes for the Python 3 environment as a last resort for all other Asterisk users. This allows 'make full' even on minimal installations of Ubuntu 18.04 LTS and newer. Because the Python/C API is Asterisk contributor specific, the Python packages are removed from the script './contrib/scripts/install_prereq' as this script is intended for Asterisk users. Asterisk contributors have to install much more packages in any case, like: sudo apt install autoconf automake git git-review python2.7-dev ASTERISK-28824 ASTERISK-27717 Change-Id: Id46d357e18869f64dcc217b8fdba821b63eeb876 2020-04-01 11:52 +0000 [da9554d925] Alexander Traud * chan_sip: TCP/TLS client without server. It is possible to configure a TCP/TLS client without having a TCP/TLS server. In that case, no error or warning was printed but the headers Contact and Via in SIP REGISTER were "(null)". ASTERISK-28798 Change-Id: I387ca5cb6a65f1eb675a29c5e41df8ec6c242ab2 2020-04-13 12:05 +0000 [52ecbbd014] Alexander Traud * _pjsua: Build even with Clang. Change-Id: Iebf7687613aa0295ea3c82256460b337f1595be2 2020-04-13 11:27 +0000 [ee1c7f465b] Alexander Traud * res_rtp_asterisk: Build without PJProject. Change-Id: Ifc5059cd867e77b9c92ed9f4b895a9a91200d3ec 2020-04-08 14:33 +0000 [fa3c8f94e0] Kevin Harwell * chan_pjsip: digit_begin - constant DTMF tone if RTP is not setup yet If chan_pjsip is configured for DTMF_RFC_4733, and the core triggers a digit begin before media, or rtp has been setup then it's possible the outgoing channel will hear a constant DTMF tone upon answering. This happens because when there is no media, or rtp chan_pjsip notifies the core to initiate inband DTMF. However, upon digit end if media, and rtp become available then chan_pjsip does not notify the core to stop inband DTMF. Thus the tone continues playing. This patch makes it so chan_pjsip only notifies the core to start inband DTMF in only the required cases. Now if there is no media, or rtp availabe upon digit begin chan_pjsip does nothing, but tells the core it handled it. ASTERISK-28817 #close Change-Id: I0dbea9fff444a2595fb18c64b89653e90d2f6eb5 2020-04-09 08:25 +0000 [7febd22304] Alexander Traud * bridge_softmix_binaural: Show state in menuselect. ASTERISK-28819 Change-Id: Iba7ee7bc7936d7a156171c8fc0f1670e864e7600 2020-04-07 12:44 +0000 [7cdb493a1e] Alexander Traud * BuildSystem: Remove doc/tex and doc/pdf leftovers. Furthermore, the nowhere used compress is removed. ASTERISK-28816 Change-Id: I77daab80cfabb56d51c3ea6b1d14bd9b9fbc577c 2020-04-09 07:05 +0000 [7a04947abd] Alexander Traud * BuildSystem: Allow space in path. ASTERISK-28818 Change-Id: Ib7f246896457d9e3b14d7f5199136d6545ce0b6f 2020-04-06 08:00 +0000 [1ef1b1b0c2] Alexander Traud * res_rtp_asterisk: Avoid absolute value on unsigned subtraction. ASTERISK-28809 Change-Id: I269731715347c8e5ef7db1b6ffd3f8d15fc04be4 2020-03-31 15:14 +0000 [d40e343710] Sebastien Duthil * func_channel: allow reading 4 fields from dialplan The following fields return an error when read from dialplan: - exten - context - userfield - channame ASTERISK-28796 #close Change-Id: Ieacaac629490f8710fdacc9de80ed5916c5f6ee2 2020-04-03 12:25 +0000 [b38f664250] Alexander Traud * chan_unistim: Avoid tautological warnings with clang. ASTERISK-28803 Change-Id: I15449621b68d0ad4d57b7c337c1167adb15135af 2020-04-06 06:56 +0000 [bb28ed0d1b] Alexander Traud * test_stasis: Avoid always true warning with clang. ASTERISK-28808 Change-Id: I5e76831373532d7b8065d024e66cd1fb75dedd80 2020-04-06 09:29 +0000 [60925c68e8] Sean Bright * Revert "res_config_odbc: Preserve empty strings returned by the database" This reverts commit a3a2fbaec685d931d56f669f2d4171220e9977ac. Reason for revert: There is a lot of code that relies on the broken behavior that this fixes. Change-Id: I410c395a0168acbdaf89e616e3cb5e1312d190cb 2020-04-01 04:00 +0000 [c5f3836bcc] Jaco Kroon * main/backtrace: binutils-2.34 fix. My tester missed this one previously, have confirmed a positive build this time round. Change-Id: Id06853375954a200f03f9a1b9c97fe0b10d31fbf 2020-03-26 17:42 +0000 [d845464c76] Jason Hord (license 6978) * res_pjsip: Don't set endpoint to unavailable in all cases. When an AOR is modified endpoints are updated that reference the AOR so they can start receiving updates and reflect the correct state. If this is the case then we shouldn't change the endpoint to be offline if it does not reference the AOR but instead only when the endpoint is completely updated for all its AORs. ASTERISK-28056 patches: pjsip_options-aor.diff submitted by jhord (license 6978) Change-Id: I3ee00023be2393113cd4e056599f23f3499ef164 2020-03-25 12:51 +0000 [7ba6d43083] George Joseph * test_res_pjsip_session_caps: Create unit test This unit test runs through combinations of... * Local codecs * Remote Codecs * Codec Preference * Incoming/Outgoing A few new APIs were created to make it easier to test the functionality but didn't result in any actual functional change. ASTERISK_28777 Change-Id: Ic8957c43e7ceeab0e9272af60ea53f056164f164 2020-03-13 14:40 +0000 [2ee455958e] George Joseph * codec_negotiation: Implement outgoing_call_offer_pref Based on this new endpoint setting, a joint list of preferred codecs between those received from the Asterisk core (remote), and those specified in the endpoint's "allow" parameter (local) is created and is used to create the outgoing SDP offer. * Add outgoing_call_offer_pref to pjsip_configuration (endpoint) * Add "call_direction" to res_pjsip_session. * Update pjsip_session_caps.c to make the functions more generic so they could be used for both incoming and outgoing. * Update ast_sip_session_create_outgoing to create the pending_media_state->topology with the results of ast_sip_session_create_joint_call_stream(). * The endpoint "preferred_codec_only" option now automatically sets AST_SIP_CALL_CODEC_PREF_FIRST in incoming_call_offer_pref. * A helper function ast_stream_get_format_count() was added to streams to return the current count of formats. ASTERISK-28777 Change-Id: Id4ec0b4a906c2ae5885bf947f101c59059935437 2020-03-26 13:34 +0000 [57a457c26c] Ben Ford * res_stir_shaken: Implemented signing of JSON payload. This change provides functions that take in a JSON payload, verify that the contents contain all the mandatory fields and required values (if any), and signs the payload with the private key. Four fields are added to the payload: x5u, attest, iat, and origid. As of now, these are just placeholder values that will be set to actual values once the logic is implemented for what to do when an actual payload is received, but the functions to add these values have all been implemented and are ready to use. Upon successful signing and the addition of those four values, a ast_stir_shaken_payload is returned, containing other useful information such as the algorithm and signature. Change-Id: I74fa41c0640ab2a64a1a80110155bd7062f13393 2020-03-31 12:52 +0000 [3c345ec56d] Kevin Harwell * channel: write to a stream on multi-frame writes If a frame handling routine returns a list of frames (vs. a single frame) those frames are never passed to a tech's write_stream handler even if one is available. For instance, if a codec translation occurred and that codec returned multiple frames then those particular frames were always only sent to the tech's "write" handler. If that tech (pjsip for example) was stream capable then those frames were essentially ignored. Thus resulting in bad audio. This patch makes it so the "write_stream" handler is appropriately called for all cases, and for all frames if available. ASTERISK-28795 #close Change-Id: I868faea0b73a07ed5a32c2b05bb9cf4b586f739d 2020-03-24 06:43 +0000 [fc07eeaba1] Alexander Traud * test_utils: Avoid incorrect error message on load. In case of no OpenSSL headers, the module was built but did not load. ASTERISK-28789 Change-Id: Ie007e84296bcf2bd4237f19d68ba5f932b84cd02 2020-03-23 12:25 +0000 [cd8cbf7384] Alexander Traud * func_aes: Avoid incorrect error message on load. In case of no OpenSSL headers, the module func_aes was built but did not load. ASTERISK-28788 Change-Id: I0b99b8468cbeb3b0eab23069cbd64062ef885ffc 2020-03-26 17:18 +0000 [dbddb6725d] sungtae kim * dial.c: Removed dial string 80 character limitation The dial application had 80 characters of destination length limitation. But this limitation causes unexpected dial string cut if the dial string is long. Removed unnecessary limited buffer to support longer dial destination. ASTERISK-27946 Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330 2020-03-19 04:34 +0000 [e12244153a] Torrey Searle * res_pjsip_session: implement processing of Content-Disposition RFC5621 requires any content type with a Content-Disposition with handling=required to be rejected with a 415 response ASTERISK-28782 #close Change-Id: Iad969df75936730254b95c1a8bc3b48497070bb4 2020-03-18 08:49 +0000 [d32e559e8a] Jaco Kroon * acl: implement a centralized ACL output mechanism for HAs and ACLs. named_acl.c (which is really a named_ha) now uses ast_ha_output. I've also updated main/manager.c to output the actual ACL on "manager show user " if one is set. If this works then we can add similar to other modules as required. Change-Id: I0ec9876a90dddd379c80ec078d48e3ee6991eb0f 2020-03-26 08:49 +0000 [1b6c58896f] Joshua C. Colp * chan_sip: Send 403 when ACL fails. Change-Id: I0910c79196f2b7c7e5ad6f1db95e83800ac737a2 2020-03-26 11:42 +0000 [3ed80fc57b] Joshua C. Colp * CHANGES: Change md file extension to txt. Change-Id: I168e2d3a65d444fb0961bd228257441fe718f6a7 (cherry picked from commit c9cd68126152bae26d42f5b9ce8811ddf1eda4d8) 2020-03-23 05:49 +0000 [21e9051461] Joshua C. Colp * res_pjsip_session: Apply intention behind requested formats. When an outgoing channel is created a list of formats may optionally be provided which is used as a request that the formats be used if possible. If an endpoint is not configured for any of the formats we ignore this request and use what is configured. This has the side effect of also including other stream types (such as video) that were not present in the requested formats. This change makes it so that the intention of the request is preserved - that is if only an audio format is requested then even if there is no joint audio format between the request and the configuration we will still only place an audio stream in the outgoing call. ASTERISK-28787 Change-Id: Ia54c0c63e94aca176169b9bae4bb8a8380ea245f 2020-03-25 04:38 +0000 [96e8d411e1] Joshua C. Colp * res_rtp_asterisk: Ensure sufficient space for worst case NACK. ASTERISK-28790 Change-Id: I10df52f98b19ed62575f25dab36e82d136dccd99 2020-03-17 15:54 +0000 [26713dc88b] Kevin Harwell * ast_coredumper: add Asterisk information dump This patch makes it so ast_coredumper now outputs the following information to a *-info.txt file when processing a core file: asterisk version and "built by" string BUILD_OPTS system start, and last reloaded date/time taskprocessor list equivalent of "bridge show all" equivalent of "core show channels verbose" Also a slight modification was made when trying to obtain the pid(s) of a running Asterisk. If it fails to retrieve any it now reports an error. Change-Id: I54f35c19ab69b8f8dc78cc933c3fb7c99cef346b 2020-03-20 09:12 +0000 [6f731f153b] Jaco Kroon * netsock2: compile fixes. This fixes ast_addressfamily_to_sockaddrsize to reference the provided argument, and ast_sockaddr_from_sockaddr to not use the name of a structure as argument. Change-Id: Ibf5db469c47c3b4214edf8456326086174e8edd7 2020-03-23 15:00 +0000 [211bb8a79c] Ben Ford * res_stir_shaken: Initial commit and reading private key. This commit sets up some of the initial framework for the module and adds a way to read the private key from the specified file, which will then be appended to the certificate object. This works fine for now, but eventually some other structure will likely need to be used to store all this information. Similarly, the caller_id_number is specified on the certificate config object, but in the end we will want that information to be tied to the certificate itself and read it from there. A method has been added that will retrieve the private key associated with the caller_id_number passed in. Tab completion for certificates and stores has also been added. Change-Id: Ic4bc1416fab5d6afe15a8e2d32f7ddd4e023295f 2020-03-18 04:21 +0000 [4f92dcd66b] Jaco Kroon * dahdiras: Only set plugin dahdi.so to pppd if we're running as root. Users of this should set plugin dahdi.so in their options file. ASTERISK-16676 Change-Id: I6d01ad0a10e9fea477876d0941c3f38aac357e91 2020-03-18 04:38 +0000 [40e93b0240] Jaco Kroon * dundi: fix NULL dereference. If a negative (error) return is received from dundi_lookup_internal, this is not handled correctly when assigning the result to the buffer. As such, use a signed integer in the assignment and do a proper comparison. ASTERISK-21205 Change-Id: I5214ebb6491e2bd14f90c7d3ce229da86888f739 2020-03-19 13:34 +0000 [34750d2068] Joshua C. Colp * res_pjsip_sdp_rtp: Only do hold/unhold on default audio stream. When examining a stream to determine hold/unhold information we only care about the default audio stream. Other streams aren't used for hold/unhold. ASTERISK-28784 Change-Id: I7a1f10f07822c4aee1f98a38b9628849b578afe4 2020-02-14 02:45 +0000 [8147f43756] Sungtae Kim * res_pjsip_session: Fixed wrong session termination When the Asterisk receives 200 OK with invalid SDP, the Asterisk/PJPROJECT terminating the session. But if the channel was in the Bridge, Asterisk tries send the Re-Invite before terminating the session. And when the Asterisk sending the Re-Invite, it doesn't check the SDP is NULL or not. This crashes the Asterisk. Fixed it to close the session correctly if the UAS sends the 200 OK with wrong SDP. ASTERISK-28743 Change-Id: Ifa864e0e125b1a7ed2f3abd4164187e1dddc56da 2020-03-18 04:49 +0000 [a699e016dd] Jaco Kroon * build: enable building with uClibc This patch has been included in Gentoo distribution for at least since asterisk 1.8, but there are references in the logs going back as far as 1.0.0 - not sure if this is still required in any way, it does apply, and it doesn't (as far as we can determine) cause build failures. Change-Id: I46d8845e30200205e80580680bf060aa3012ba54 2020-03-18 04:43 +0000 [f824cd6a13] Jaco Kroon * build: search from newest to oldest for gmime. We (Gentoo distribution) reckon that in the case of multiple versions of gmime installed we should prefer the newest one. Change-Id: Idf7be613230232eb1d573d93c4a5a8297f4ecd2d 2020-03-19 08:48 +0000 [9620ecbf80] Joshua C. Colp * res_pjsip_session: Don't restrict non-audio default streams to sendrecv. The state of the default audio stream is used for hold/unhold so we restrict it to sendrecv as the core does not handle when it changes as a result of hold/unhold. This restriction does not apply to other media types though so we now only restrict it to audio. This allows the other default streams to store their state at all values, and not just sendrecv and removed. ASTERISK-28783 Change-Id: I139740f38cea7f7d92a876ec2631ef50681f6625 2020-03-06 10:50 +0000 [5562fb2ea0] Michael Neuhauser * chan_psip, res_pjsip_sdp_rtp: ignore rtptimeout if direct-media is active Do not hang up a PJSIP channel on RTP timeout if that channel is in a direct-media bridge. Also reset the time of the last received RTP packet when direct-media ends (wait full rtp_timeout period before checking first time after audio came back to Asterisk). ASTERISK-28774 Reported-by: Michael Neuhauser Change-Id: I8b62012be7685849e8fb2b1c5dd39d35313ca2d1 2019-11-27 07:54 +0000 [82c3939c38] Jaco Kroon * res_rtp_asterisk: implement ACL mechanism for ICE and STUN addresses. A pure blacklist is not good enough, we need a whitelist mechanism as well, and the simplest way to do that is to re-use existing ACL infrastructure. This makes it simpler to blacklist say an entire block (/24) except a smaller block (eg, a /29 or even a /32). Normally you'd need to recursively split the block, so if you want to blacklist a /24 except for a /29 you'd end up with a blacklit for a /25, /26, /27 and /28. I feel that having an ACL instead of a blacklist only is clearer. Change-Id: Id57a8df51fcfd3bd85ea67c489c85c6c3ecd7b30 Signed-off-by: Jaco Kroon 2020-03-16 05:11 +0000 [2ad64e97c0] Jaco Kroon * Update main/backtrace.c to deal with changes in binutils 2.34. binutils 2.34 merged this commit: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;\ h=fd3619828e94a24a92cddec42cbc0ab33352eeb4 Which effectively does things like: -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) +#define bfd_section_size(sec) ((sec)->size) So in order to remain backwards compatible we need to detect this API change, and adjust accordingly. The simplest is to notice that the bfd_get_section_size and bfd_get_section_vma MACROs are no longer defined, and define then onto the new API. The alternative is to litter the code with a number of #ifdef #else #endif splatters right through the code. Change-Id: I3efe0f8e8f3e338d16fcbc2b26a505367b6e172f 2020-03-15 09:07 +0000 [c4e0983742] Sean Bright * func_odbc.conf.sample: Clarify sample documentation ASTERISK-20325 #close Change-Id: I06cb9b467b0fd06c8af2a5aee049f872c09cc4b6 2020-03-13 13:43 +0000 [49cf84578e] Sean Bright * chan_vpb: Fix 'catching polymorphic type ... by value' error Fixes the following compile error: chan_vpb.cc:2688:26: error: catching polymorphic type ‘class std::exception’ by value Change-Id: Ic87bc357d72427d77626735c83200fd278a7a649 2020-03-09 19:07 +0000 [d68f940f6e] Sean Bright * dns_txt: Add TXT record parsing support Change-Id: Ie0eca23b8e6f4c7d9846b6013d79099314d90ef5 2020-03-12 09:22 +0000 [98d10d0a16] Joshua C. Colp * audiohook: Don't allow audiohooks to attach to hung up channels. Given a scenario where MixMonitor was initiated over AMI it was possible for the channel and MixMonitor thread to remain alive past hang up of the channel. This scenario required the AMI initiated MixMonitor to retrieve the channel, a hangup to occur on the channel in another thread, and then for MixMonitor to actually start. If this occurred the MixMonitor thread would remain alive indefinitely and the channel reference would remain. This change ensures that audiohooks are never able to be attached to channels that have been hung up. An additional fix has also been done in app_mixmonitor to properly release the channel reference if this occurs. ASTERISK-28780 Change-Id: I8044c06daa06f0f16607788c596f55623be26f58 2020-03-04 15:45 +0000 [00a7e4b51d] George Joseph * CI: Create generic jenkinsfile This is a generic jenkinsfile to build Asterisk and optionally perform one or more of the following: * Publish the API docs to the wiki * Run the Unit tests * Run Testsuite Tests This job can be triggered manually from Jenkins or be triggered automatically on a schedule based on a cron string. Change-Id: Id9d22a778a1916b666e0e700af2b9f1bacda0852 2020-03-06 10:13 +0000 [a1dba820cf] Torrey Searle * res_rtp_asterisk: Send correct sender SSRC when p2p bridge in use bridge_p2p_rtp_write will forward rtp to the bridged rtp instance without modifying the ssrc. However, it is not updating the SSRC in the bridged rtp. Thus, when SSRC packets are generated, they have the correct SSRC for the sender. ASTERISK-28773 #close Change-Id: I39f923bde28ebb4f0fddc926b92494aed294a478 2020-03-05 03:08 +0000 [14ba1806f3] Torrey Searle * res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated If ICE support is enabled but not negotiated, the rtp->ice structure is not being destroyed. This leads to Asterisk waiting for ICE to complete instead of immediately starting the DTLS handshake, resulting in the call leg having no RTP. ASTERISK-28769 #close Change-Id: I17c137546dc9ecfb9583c24dcf4c2ced8bbd7a27 2020-02-25 18:30 +0000 [ed2a7e3eaf] Paulo Vicentini * chan_pjsip: Check audio frame when remote SSRC changes. If the SSRC of a received RTP packet differed from the previous SSRC an SSRC change control frame would be queued ahead of the media frame. In the case of audio this would result in the format of the audio frame not being checked, and if it differed or was not allowed then it could cause the call to drop due to failure to set up a translation path. The chan_pjsip module will now no longer assume the first frame will be the audio frame and instead goes through the complete list to find it. ASTERISK-28759 Change-Id: I6d854cc523f343e299a615636fc65bdbd5f809ec 2020-03-06 14:59 +0000 [517224ce85] Sean Bright * enum.c: Add support for regular expression flag in NAPTR record A regular expression in a NAPTR response record can have a trailing 'i' flag to indicate that the expression should be evaluated in a case-insensitive way. We were not checking for that flag which caused the record parsing to fail on otherwise valid input. Although this change will initially go into Asterisk 13, 16, and 17, it is my intention to replace the majority of this code in 16 and up - including this fix - by changing enum.c to consume the new DNS API which duplicates most of this logic already. Asterisk 13 doesn't have the DNS API, so this fix will be as good as it gets. ASTERISK-26711 #close Reported by: Vitold Change-Id: I33943a5b3e7539c6dca3a5079982ee15a08186f0 2020-03-06 06:10 +0000 [0a7fe3097f] Jared Smith * indications.conf.sample: Add indication tones for Indonesia These tones come from http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf ASTERISK-23407 Change-Id: I48e2285f1e5bb29b3335f762006f66c423d0fcb8 2020-03-03 08:42 +0000 [e089779908] Rodrigo Ramírez Norambuena * res_rtp_asterisk: Add 'rtp show settings' cli command This change introduce a CLI command for the RTP to display the general configuration. In the first step add the follow fields of the configurations: - rtpstart - rtpend - dtmftimeout - rtpchecksum - strictrtp - learning_min_sequential - icesupport Change-Id: Ibe5450898e2c3e1ed68c10993aa1ac6bf09b821f 2020-03-04 16:53 +0000 [ab63f0cd0f] Sean Bright * enum.c: Make ast_get_txt() actually do something. The ast_get_txt() API function (and by extension, the TXTCIDNAME dialplan function) were broken in 65b8381550a9f46fdce84de79960073e9d51b05d such that we would never actually make a DNS TXT query as described. This patch restores the documented behavior. ASTERISK-19460 #close Reported by: George Joseph Change-Id: I1b19aea711488cb1ecd63843cddce05010e39376 2020-03-03 10:57 +0000 [d1a2ff0aaf] lvl * res_pjsip_refer: ensure refer progress is still sent after Proceeding() ASTERISK-28766 #close Change-Id: I5ce2210062f9325db762edbf6e46075079bb2cd1 2020-02-24 12:47 +0000 [06dada3f01] Kevin Harwell * codec negotiation: add incoming_call_offer_prefs option Add a new option, incoming_call_offer_pref, to res_pjsip endpoints that specifies the preferred order of codecs after receiving an offer. This patch does the following: Adds a new enumeration, ast_sip_call_codec_pref, used by the the new configuration option that's added to the endpoint media structure. Adds a new ast_sip_session_caps structure that's set for each session media object. Creates a new file, res_pjsip_session_caps that "implements" the new structure and option, and is compiled into the res_pjsip_session library. ASTERISK-28756 #close Change-Id: I35e7a2a0c236cfb6bd9cdf89539f57a1ffefc76f 2020-02-20 11:33 +0000 [87fda066ea] Joshua C. Colp * res_rtp_asterisk: Improve video performance in certain networks. The receive buffer will now grow if we end up flushing the receive queue after not receiving the expected packet in time. This is done in hopes that if this is encountered again the extra buffer size will allow more time to pass and any missing packets to be received. The send buffer will now grow if we are asked for packets and can't find them. This is done in hopes that the packets are from the past and have simply been expired. If so then in the future with the extra buffer space the packets should be available. Sequence number cycling has been handled so that the correct sequence number is calculated and used in various places, including for sorting packets and for determining if a packet is old or not. NACK sending is now more aggressive. If a substantial number of missing sequence numbers are added a NACK will be sent immediately. Afterwards once the receive buffer reaches 25% a single NACK is sent. If the buffer continues to grow and reaches 50% or greater a NACK will be sent for each received future packet to aggressively ask the remote endpoint to retransmit. ASTERISK-28764 Change-Id: I97633dfa8a09a7889cef815b2be369f3f0314b41 2020-02-28 12:55 +0000 [a715cf5aaa] Kevin Harwell * message & stasis/messaging: make text message variables work in ARI When a text message was received any associated variable was not written to the ARI TextMessageReceived event. This occurred because Asterisk only wrote out "send" variables. However, even those "send" variables would fail ARI validation due to a TextMessageVariable formatting bug. Since it seems the TextMessageReceived event has never been able to include actual variables it was decided to remove the TextMessageVariable object type from ARI, and simply return a JSON object of key/value pairs for variables. This aligns more with how the ARI sendMessage handles variables, and other places in ARI. ASTERISK-28755 #close Change-Id: Ia6051c01a53b30cf7edef84c27df4ed4479b8b6f 2020-01-12 05:37 +0000 [b7fbb9c41f] Sebastian Kemper * check_expr2: fix cross-compile/hardening issues When building check_expr2 with ASLR PIE hardening enabled the linker fails. This is resolved by adding the regular compiler flags when building the object files from ast_expr2f.c and ast_expr2.c. Note: The STANDALONE define is removed because it is already defined in _ASTCFLAGS. YY_NO_INPUT is defined so that the compile survives '--enable-dev-mode'. Also, a Makefile variable "CROSS_COMPILING" is added so that the build system doesn't try to run check_expr2 when cross-compiling, because that will fail the build as will. ASTERISK-28685 #close Signed-off-by: Sebastian Kemper Change-Id: If435b7db9f9ad8266245bda51c81c220f9658915 2020-02-24 09:00 +0000 [77c9ba8e63] Torrey Searle * res/res_pjsip_sdp_rtp: Fix MOH transitions Update the state of remote_hold immediately on receipt of remote SDP so that the information is available when building the SDP answer ASTERISK-28754 #close Change-Id: I7026032a807e9c95081cb8f060400b05deb4836f 2020-02-25 03:51 +0000 [680e6b9774] Walter Doekes * app_queue: Refactor odd placement of if's around say_position Change-Id: Icba97905e331812f129e5966e91a59b104c7a748 2020-02-24 12:44 +0000 [1e1651b4f4] Kevin Harwell * format_cap: make function parameters 'const' There were a couple places where the format cap function parameter was not 'const' when it should have been. This patch makes them 'const'. Change-Id: Ife753fb16a962d842a6b44f45363a61a66bfdb2e 2020-02-24 08:39 +0000 [0b5c6fddf1] Walter Doekes * say: Remove unused "plural" option from main/say There are exceptions for plural objects, but they are detected using the supplied NUMBER, not using an extra option. Change-Id: I95d1d1b2796b1aba92048a2dbae8a3856ed8a113 2020-02-20 06:52 +0000 [5cd7230f3c] Jaco Kroon * addons/res_config_mysql: silense warnings about printf format errors. Warnings without this: res_config_mysql.c: In function 'update2_mysql': res_config_mysql.c:741:15: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'my_ulonglong' {aka 'long unsigned int'} [-Wformat=] ast_debug(1, "MySQL RealTime: Updated %llu rows on table: %s\n", numrows, tablename); (reformatted for readability within line-wrap) Change-Id: I2af4d419a37c1a7eeee750cf9ae4a9a2b3a37fd3 2020-02-18 07:10 +0000 [d6712790cd] Joshua C. Colp * pjsip: Update ACLs on named ACL changes. This change extends the Sorcery API to allow a wizard to be told to explicitly reload objects or a specific object type even if the wizard believes that nothing has changed. This has been leveraged by res_pjsip and res_pjsip_acl to reload endpoints and PJSIP ACLs when a named ACL changes. ASTERISK-28697 Change-Id: Ib8fee9bd9dd490db635132c479127a4114c1ca0b 2020-02-19 13:20 +0000 [7f2d56fc8c] Sean Bright * tcptls.c: Log more informative OpenSSL errors Dump OpenSSL's error stack to the error log when things fail. ASTERISK-28750 #close Reported by: Martin Zeh Change-Id: Ib63cd0df20275586e68ac4c2ddad222ed7bd9c0a 2020-02-19 08:38 +0000 [de6919f339] Sean Bright * ast_tls_cert: Allow private key size to be set on command line The default size in release branches will be 1024 but we'll use 2048 in master. ASTERISK~28750 Change-Id: I435cea18bdd58824ed2b55259575c7ec7133842a 2020-02-13 13:39 +0000 [78b01f41ae] George Joseph * res_pjsip_outbound_registration: Fix SRV failover on timeout In order to retry outbound registrations for some situations, we need access to the tdata from the original request. For instance, for 401/407 responses we need it to properly construct the subsequent request with the authentication. We also need it if we're iterating over a DNS SRV response record set so we can skip entries we've already tried. We've been getting the tdata from the server response rdata and transaction but that only works for the failures where there was actually a response (4XX, 5XX, etc). For timeouts there's no response and therefore no rdata or transaction from which to get the tdata. When processing a single A/AAAA record for a server, this wasn't an issue as we just retried that same server after the retry timer expired. If we got an SRV record set for the server though, without the state from the tdata, we just kept trying the first entry in the set repeatedly instead of skipping to the next one in the list. * Added a "last_tdata" member to the client state structure to keep track of the sent tdata. * Updated registration_client_send() to save the tdata it used into the client_state. * Updated sip_outbound_registration_response_cb() to use the tdata saved in client_state when we don't get a response from the server. We still use the tdata from the transaction when we DO get a response from the server so we can properly handle 4XX responses where our new request depends on it. General note on timeouts: Although res_pjsip_outbound_registration skips to the next record immediately when a timeout occurs during SRV set traversal, it's pjproject that determines how long to wait before a timeout is declared. As with other SIP message types, pjproject will continue trying the same server at an interval specified by "timer_t1" until "timer_b" expires. Both of those timers are set in the pjsip.conf "system" section. ASTERISK-28746 Change-Id: I199b8274392d17661dd3ce3b4d69a3968368fa06 2020-01-04 18:11 +0000 [5a5be92b79] Joshua C. Colp * bridging: Add better support for adding/removing streams. This change adds support to bridge_softmix to allow the addition and removal of additional video source streams. When such a change occurs each participant is renegotiated as needed to reflect the update. If another video source is added then each participant gets another source. If a video source is removed then it is removed from each participant. This functionality allows you to have both your webcam and screenshare providing video if you desire, or even more streams. Mapping has been changed to use the topology index on the source channel as a unique identifier for outgoing participant streams, this will never change and provides an easy way to establish the mapping. The bridge_simple and bridge_native_rtp modules have also been updated to renegotiate when the stream topology of a party changes allowing the same behavior to occur as added to bridge_softmix. If a screen share is added then the opposite party is renegotiated. If that screen share is removed then the opposite party is renegotiated again. Some additional fixes are also included in here. Stream state is now conveyed in SDP so sendonly/recvonly/inactive streams can be requested. Removed streams now also remove previous state from themselves so consumers don't get confused. ASTERISK-28733 Change-Id: I93f41fb41b85646bef71408111c17ccea30cb0c5 2020-01-23 13:17 +0000 [168637cc0c] Ben Ford * RTP/ICE: Send on first valid pair. When handling ICE negotiations, it's possible that there can be a delay between STUN binding requests which in turn will cause a delay in ICE completion, preventing media from flowing. It should be possible to send media when there is at least one valid pair, preventing this scenario from occurring. A change was added to PJPROJECT that adds an optional callback (on_valid_pair) that will be called when the first valid pair is found during ICE negotiation. Asterisk uses this to start the DTLS handshake, allowing media to flow. It will only be called once, either on the first valid pair, or when ICE negotiation is complete. ASTERISK-28716 Change-Id: Ia7b68c34f06d2a1d91c5ed51627b66fd0363d867 2020-02-18 08:33 +0000 [8dcdce42a9] Sean Bright * app_mixmonitor: Turn on synchronization by default The optional synchronization behavior created in 64906c4c9ba63e18f2c71310fdbf14450dac7b62 is now the default for MixMonitor. * Add a new flag 'n' that allows for this behavior to be turned off * Add a notice when the 'S' option is used indicating that it is no longer necessary Change-Id: I158987c475cda4e1ff1256dd0daccdd99df568b4 2020-02-17 08:05 +0000 [ddfb60ac2c] Sean Bright * app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used When opening a file for writing, Asterisk silently converts filenames ending with 'wav49' to 'WAV.' We aren't taking that in to account when setting the MIXMONITOR_FILENAME variable in MixMonitor. * If the user wants to write to a wav49 file, make sure that it is reflected properly in MIXMONITOR_FILENAME. * Add a note to the documentation describing this behavior. * Add a note in main/file.c indicating that app_mixmonitor needs to be changed if the logic in build_filename was changed. ASTERISK-24798 #close Reported by: xrobau Change-Id: I384691ce624eb55c80a125b9ca206d2d691c574c 2020-02-12 10:05 +0000 [bf4340f0ec] Torrey Searle * res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough When moh_passthrough is used, asterisk is only generating invites of type sendonly and sendrecv instead of taking fully into account the on hold state of the local and remote parties ASTERISK-28738 #close Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761 2020-02-15 08:01 +0000 [0f6ee98c3f] Joshua C. Colp * stasis: Use format specifier for size_t. Change-Id: Ic9b4afcc5398e7f46314419fc3c90433d818e35c 2020-02-13 15:08 +0000 [3865b3fd6a] Kevin Harwell * res_rtp_asterisk: bad audio (static) due to incomplete dtls/srtp setup There was a race condition between client initiated DTLS setup, and handling of server side ice completion that caused the underlying SSL object to get cleared during DTLS initialization. If this happened Asterisk would be left in a partial DTLS setup state. RTP packets were sent and received, but were not being encrypted and decrypted. This resulted in no audio, or static. Specifically, this occurred when '__rtp_recvfrom' was processing the handshake sequence from the client to the server, and then 'ast_rtp_on_ice_complete' gets called from another thread and clears the SSL object when calling the 'dtls_perform_setup' function. The timing had to be just right in the sense that from the external SSL library perspective SSL initialization completed (rtp recv), Asterisk clears/resets the SSL object (ice done), and then checks to see if SSL is intialized (rtp recv). Since it was cleared, Asterisk thinks it is not finished, thus not completing 'dtls_srtp_setup'. This patch removes calls to 'dtls_perform_setup', which clears the SSL object, in 'ast_rtp_on_ice_complete'. When ice completes, there is no reason to clear the underlying SSL object. If an ice candidate changes a full protocol level renegotiation occurs. Also, in the case of bundled ICE candidates are reused when a stream is added. So no real reason to have to clear, and reset in this instance. Also, this patch adds a bit of extra logging to aid in diagnosis of any future problems. ASTERISK-28742 #close Change-Id: I34c9e6bad5a39b087164646e2836e3e48fe6892f 2020-02-11 07:46 +0000 [aeff1f2c53] Sean Bright * res_musiconhold: Avoid spurious warning when 'format' is the empty string The change to res_config_odbc that allowed empty strings to be returned to realtime consumers¹ causes a warning to be emitted when loading MoH classes. So we need to treat an empty 'format' as if it was not specified to avoid the warning. ASTERISK-28735 #close Reported by: Ross Beer [1] https://gerrit.asterisk.org/c/asterisk/+/13722 Change-Id: I9a271d721e1a0973e80ebe7d75b46a0d8fa0e5a5 2020-02-10 15:40 +0000 [1e037ebb97] Sean Bright * func_odbc: Prevent snprintf() truncation warning For reasons that are not clear to me - this only appears for me when _not_ building in dev-mode. Change-Id: Ib45c54daaea8e0d571cb470cab1daaae2edba968 2020-02-10 05:04 +0000 [ac155decae] Joshua C. Colp * res_pjsip_session: Fix off-nominal session refreshes. Given a scenario where session refreshes occur close to each other while another is finishing it was possible for the session refreshes to occur out of order. It was also possible for session refreshes to be delayed for quite some time if a session refresh did not result in a topology change. For the out of order session refreshes the first session refresh would be queued due to a transaction in progress. This transaction would then finish. When finished a separate task to process the delayed requests queue would be queued for handling. A second refresh would be requested internally before this delayed request queued task was processed. As no transaction was in progress this session refresh would be immediately handled before the queued session refresh. The code will now check if any delayed requests exist before allowing a session refresh to immediately occur. If any exist then the session refresh is queued. For the delayed session refreshes if a session refresh did not result in a topology change the attempt would be immediately stopped and no other delayed requests would be processed. The code will now go through the entire delayed requests queue until a delayed request results in a request actually being sent. ASTERISK-28730 Change-Id: Ied640280133871f77d3f332be62265e754605088 2020-02-07 13:44 +0000 [a72caa041f] George Joseph * doc: Fix CHANGES entries to have .txt suffix and update READMEs Although the wiki page for the new CHANGES and UPGRADE scheme states that the files must have the ".txt" suffix, the READMEs didn't. Change-Id: I490306aa2cc24d6f014738e9ebbc78592efe0f05 (cherry picked from commit 7416703f04f12eb583a3427a3f64d06951c18c6e) 2020-01-16 09:50 +0000 [9d9bde76a9] Sean Bright * pjproject_bundled: Allow brackets in via parameters ASTERISK-26955 #close Reported by: Peter Sokolov Change-Id: Ib2803640905a77b65d0cee2d0ed2c7b310d470ac 2020-02-05 02:26 +0000 [0c02d0a450] Sylvain Afchain * install_prereq: Install aptitude non-interactively Currently aptitude is installed using interactive mode. This patch changes this to use the non-interactive mode as it can block automatic dependencies installation, ex: CI, Docker build. ASTERISK-28726 #close Change-Id: I271ee00d230513a6f044810351a32d83b2181133 2020-02-04 08:18 +0000 [1b53d329ac] Joshua C. Colp * res_rtp_asterisk: Don't produce transport-cc if no packets. The code assumed that when the transport-cc feedback function was called at least one packet will have been received. In practice this isn't always true, so now we just reschedule the sending and do nothing. Change-Id: Iabe7b358704da446fc3b0596b847bff8b8a0da6a 2020-02-03 10:24 +0000 [b76ab5e5c9] George Joseph * message.c: Add option to suppress the Message channel AMI and ARI events In order to reduce the amount of AMI and ARI events generated, the global "Message/ast_msg_queue" channel can be set to suppress it's normal channel housekeeping events such as "Newexten", "VarSet", etc. This can greatly reduce load on the manager and ARI applications when the Digium Phone Module for Asterisk is in use. To enable, set "hide_messaging_ami_events" in asterisk.conf to "yes" In Asterisk versions <18, the default is "no" preserving existing behavior. Beginning with Asterisk 18, the option will default to "yes". NOTE: This change does not affect UserEvents or the ARI TextMessageReceived events. * Added the "hide_messaging_ami_events" option to asterisk.conf. * Changed message.c to set the AST_CHAN_TP_INTERNAL property on the "Message/ast_msg_queue" channel if the option is set in asterisk.conf. This suppresses the reporting of the events. Change-Id: Ia2e3516d43f4e0df994fc6598565d6bba2d7018b 2020-01-31 06:58 +0000 [43620cbf6c] Walter Doekes * chan_sip: Return 503 if we're out of RTP ports If you're for some reason out of RTP ports, chan_sip would previously responde to an INVITE with a 403, which will fail the call. Now, it returns a 503, allowing the device/proxy to retry the call on a different machine. ASTERISK-28718 Change-Id: I968dcf6c1e30ecddcce397dcda36db727c83ca90 2020-01-29 08:57 +0000 [eb9252ea27] Sean Bright * res_config_odbc: Preserve empty strings returned by the database When res_config_odbc (and perhaps other realtime backends) reads a SQL NULL from the database, it coalesces the value to the empty string which prevents it from being returned to the realtime core. However, if it instead reads the empty string from the database, it needs a way to encode that fact without having the value omitted entirely. It does this by changing the value to a string with a single space. The realtime code in main/config.c recognizes this special case and _turns the string back into the empty string_ before passing it to realtime API consumers. For all of this to work, we need to ensure that we actually pass the single-space-string back to the realtime core, which is currently failing because we are trimming the value before checking its content. So instead we now special case the single-space-string case so that empty values are returned properly. ASTERISK-28719 #close Reported by: EDV O-TON Change-Id: I673ed8c31ad037aa224e80c78c7a1dc4e4a4e3de 2020-01-28 13:23 +0000 [31dc904380] Sean Bright * res_stasis_playback: Prevent media_index from going out of bounds Incrementing stasis_app_playback.media_index directly in our playback loop means that when we reach the end of our playlist the index into the vector will be outside of the bounds of the vector. Instead use a temporary variable and only assign when we're sure that we are in bounds. ASTERISK-28713 #close Reported by: Sébastien Duthil Change-Id: Ib53f7f156097e0607eb5871d9d78d246ed274928 2020-01-28 09:18 +0000 [a1f0c833ab] Joshua C. Colp * res_pjsip_pubsub: Increment persistence data ref when recreating. Each subscription needs to have a reference to the persisted data for it, as well as the main JSON contained within the tree. When recreating a subscription this did not occur and they both shared the same reference. ASTERISK-28714 Change-Id: I706abd49ea182ea367a4ac3feca2706460ae9f4a 2020-01-27 19:58 +0000 [03d24ca4c1] Sean Bright * res_pjsip_messaging: Allow Content-Type to be overridden ASTERISK-26082 #close Reported by: Alex Change-Id: I6549e90932016349bc72b0f053432dc25286f4fb 2020-01-28 02:34 +0000 [113d05e504] Walter Doekes * chan_sip: Clarify in sample docs how directmediapermit/-acl should be used It said "restrict [...] which peers should be able to pass [audio] to each other". However, these settings are not global (for which you would expect signaling IPs to be checked). These settings are available per peer only, and the IPs being checked, are the RTP IPs. Change-Id: I2a6c6cd7c2f5f30d1df4844e3e0308a077021660 2020-01-27 12:01 +0000 [cce2b0da95] Kevin Harwell * stasis/app: don't lock an app before a call to send Calling 'app_send' eventually calls the app's message handler. It's possible for a handler to obtain a lock on another object, and then need/want to lock the app object. If the caller of 'app_send' locks the app object prior to calling then there's a potential for a deadlock, if another thread calls 'app_send' without locking. This patch makes it so 'app_send' is not called with the app object locked in the section of code doing such. ASTERISK-28423 #close Change-Id: I6767c6d0933c7db1b984018966eefca4c0638a27 2020-01-27 11:44 +0000 [4206830a52] Kevin Harwell * res_stasis: trigger cleanup after update The cleanup code in stasis shuts down applications if they are in a deactivated state, and no longer have explicit subscriptions. When registering an app the cleanup code was running before calling 'update'. When it should be executed after 'update' since a call to register may re-activate the app. We don't want it to shutdown before the 'update' otherwise the app won't be re-activated, or registered. This patch makes it so the cleanup code is executed post 'update'. ASTERISK-28679 #close Change-Id: I8f2c0b17e33bb8128441567b97fd4c7bf74a327b 2020-01-27 08:03 +0000 [b1ca2c5d71] Sean Bright * res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly We need to wait for the message sending callback to finish to know if we succeeded or failed. ASTERISK-25421 #close Reported by: Dmitriy Serov Change-Id: I22b954398821d2caf4c6fe58f0607c8cfa378059 2020-01-13 04:13 +0000 [711a3fed56] Walter Doekes * chan_sip: Always process updated SDP on media source change Fixes no-audio issues when the media source is changed and strictrtp is enabled (default). If the peer media source changes, the SDP session version also changes. If it is lower than the one we had stored, chan_sip would ignore it. This changeset keeps track of the remote media origin identifier, comparing that as well. If it changes, the session version needn't be higher for us to accept the SDP. Common scenario where this would've caused problems: a separate media gateway that informs the caller about premium rates before handing off the call to the final destination. (An alternative fix would be to set ignoresdpversion=yes on the peer.) ASTERISK-28686 Change-Id: I88fdbc5aeb777b583e7738c084254c482a7776ee 2020-01-23 09:06 +0000 [313189aae2] Sean Bright * chan_pjsip: Ignore RTP that we haven't negotiated If chan_pjsip receives an RTP packet whose payload differs from the channel's native format, and asymmetric_rtp_codec is disabled (the default), Asterisk will switch the channel's native format to match that of the incoming packet without regard to the negotiated payloads. We now check that the received frame is in a format we have negotiated before switching payloads which results in these packets being dropped instead of causing the session to terminate. ASTERISK-28139 #close Reported by: Paul Brooks Change-Id: Icc3b85cee1772026cee5dc1b68459bf9431c14a3 2020-01-22 12:56 +0000 [6818c3d1d2] George Joseph * cdr.c: Set event time on party b when leaving a parking bridge When Alice calls Bob and Bob does a blind transfer to Charlie, Bob's bridge leave event generates a finalize on both the party_a and party_b CDRs but while the party_a CDR has the correct end time set from the event time, party_b's leg did not. This caused that CDR's end time to be equal to the answered time and resulted in a billsec of 0. * We now pass the bridge leave message event time to cdr_object_party_b_left_bridge_cb() and set it on that CDR before calling cdr_object_finalize() on it. NOTE: This issue affected transfers using chan_sip most of the time but also occasionally affected chan_pjsip probably due to message timing. ASTERISK-28677 Reported by: Maciej Michno Change-Id: I790720f1e7326f9b8ce8293028743b0ef0fb2cca 2020-01-22 09:39 +0000 [0dce6f746b] Sean Bright * http: Add ability to disable /httpstatus URI Add a new configuration option 'enable_status' which allows the /httpstatus URI handler to be administratively disabled. We also no longer unconditionally register the /static and /httpstatus URI handlers, but instead do it based upon configuration. Behavior change: If enable_static was turned off, the URI handler was still installed but returned a 403 when it was accessed. Because we now register/unregister the URI handlers as appropriate, if the /static URI is disabled we will return a 404 instead. Additionally: * Change 'enablestatic' to 'enable_static' but keep the former for backwards compatibility. * Improve some internal variable names ASTERISK-28710 #close Change-Id: I647510f796473793b1d3ce1beb32659813be69e1 2020-01-18 15:54 +0000 [5bd7281442] Andrew Siplas * chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout" The no-entry timeout set to 999999 == 16⅔ minutes, change to INT_MAX to match behavior of "no timeout" defined in comment. ASTERISK-28702 #close Change-Id: I4ea015986e061374385dba247b272f7aac60bf11 2020-01-20 11:18 +0000 [c376e9f8a8] Sean Bright * res_statsd: Document that res_statsd does nothing on its own ASTERISK-24484 #close Reported by: Dan Jenkins Change-Id: I05f298904511d6739aefb1486b6fcbee27efa9ec 2020-01-20 13:53 +0000 [dfad69ce7c] Sean Bright * translate.c: Fix silk 24kHz truncation in 'core show translation' SILK @ 24kHz is not shown in the 'core show translation' output because of an off-by-one-error. Discovered while looking into ASTERISK~19871. ASTERISK-28706 Reported by: Sean Bright Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510 2020-01-20 15:26 +0000 [262221f4d9] Sean Bright * func_odbc.conf.sample: Add example lookup Change-Id: Ia05aab1f579597963d2ea23920d2210cfcb97c84 2020-01-16 15:29 +0000 [f09cf4da44] Sean Bright * app_voicemail: Remove MessageExists and MESSAGE_EXISTS() * The MailboxExists dialplan application was deprecated on 2006-09-26 in Asterisk 1.6.0 (commit ec83b111831fe865753f5b1c382ab73750685e50) * The MAILBOX_EXISTS dialplan function was deprecated on 2011-12-06 in Asterisk 11.0.0 (commit fd64bb66f94f1a7bb47e17319512b14e522353ec) Change-Id: I71cfc9d7b9217a37b802f4cc6ef2d57900b7398f 2020-01-16 13:47 +0000 [5cbf47714a] Sean Bright * app_voicemail, say: Fix various leading whitespace problems In af90afd90c64c5183c2207d061f9aa15138081b2, Japanese language support was added to app_voicemail and main/say.c, but the leading whitespace is not consistent with Asterisk coding guidelines. This patch fixes that. Whitespace only, no functional change. ASTERISK~23324 Reported by: Kevin McCoy Change-Id: I72c725f5930084673749bd7c9cc426a987f08e87 2020-01-16 07:32 +0000 [50d02d6194] Sean Bright * pbx.c: Include filesystem cache in free memory calculation ASTERISK-28695 #close Reported by: Kevin Flyn Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8 2020-01-16 09:09 +0000 [f309b86e36] Sean Bright * chan_sip.c: Stop handling continuation lines after reading headers lws2sws() does not stop trying to handle header continuation lines even after all headers have been found. This is problematic if the first character of a SIP message body is a space or tab character, so we update to recognize the end of the message header. ASTERISK-28693 #close Reported by: Frank Matano Change-Id: Idec8fa58545cd3fd898cbe0075d76c223f8d33df 2020-01-15 14:29 +0000 [ba8ccb9132] Sean Bright * app_voicemail: Prevent crash when saving message with realtime voicemail ast_store_realtime() is not NULL tolerant, so we need to initialize the field values we pass to it to the empty string to avoid a crash. ASTERISK-23739 #close Reported by: Stas Kobzar Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c 2020-01-14 16:20 +0000 [9be89d9913] Sean Bright * app_voicemail: Set globals to default values when voicemail.conf missing If voicemail.conf exists but is empty, the config parsing process will default a number of global variables to non-zero values. On the other hand, if voicemail.conf is missing (arguably semantically equivalent to an empty file), this process is skipped and the globals are defaulted to 0. Set the globals to the same values they would be set to if a configuration were present. This allows voicemail configuration to be done completely by Realtime without the need to create an empty voicemail.conf file. ASTERISK-27622 #close Reported by: Jim Van Meggelen Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409 2020-01-13 16:37 +0000 [094e87b0dc] Sean Bright * res_realtime: Fix 'realtime update2' argument handling The change in 9b99ef50b5d01ee8111d26efa7b926bdfaf3f980 updated the syntax of the 'realtime update2' CLI command but did not correctly update the calls to ast_update2_realtime(). The issue this addresses was originally opened because we aren't allowing a SQL NULL to be set as part of the update, but this is a limitation of the Realtime API and is not a bug. Additionally, this patch: * Corrects the example in the command documentation to reflect 'update2' instead of 'update.' * Fixes the leading spacing of the command documentation. * Checks that the required 'NULL' literal argument is present where we expect it to be. ASTERISK-21794 #close Reported by: Cédric Bassaget Change-Id: Idda63a5dc50d5f9bcb34c27ea3238d90f733b2cd 2019-07-17 19:47 +0000 [163efbd724] Seán C McCord * feat: AudioSocket channel, application, and ARI support. This commit adds support for [AudioSocket]( https://wiki.asterisk.org/wiki/display/AST/AudioSocket), a very simple bidirectional audio streaming protocol. There are both channel and application interfaces. A description of the protocol can be found on the above referenced GitHub page. A short talk about the reasons and implementation can be found on [YouTube](https://www.youtube.com/watch?v=tjduXbZZEgI), from CommCon 2019. ARI support has also been added via the existing "externalMedia" ARI functionality. The UUID is specified using the arbitrary "data" field. ASTERISK-28484 #close Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5 2020-01-10 13:30 +0000 [0c2bf1664c] Sean Bright * func_curl: Add 'followlocation' option to CURLOPT() We allow for 'maxredirs' to be set, but this value is ignored when followlocation is not enabled which, by default, it is not. ASTERISK-17491 #close Reported by: candrews Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a 2020-01-11 07:29 +0000 [9522390a69] Sean Bright * app_queue: Deprecate the QueueMemberPause.Reason field The QueueMemberPause AMI event includes two fields that return the reason a member was paused. * In release branches, deprecate Reason in favor of PausedReason. * In master, remove the Reason field entirely. ASTERISK-28349 #close Reported by: Niksa Baldun Change-Id: I01da58f2b0ab927baeee754870f62b51b7b3d296 2020-01-10 15:13 +0000 [29d867ed67] Sean Bright * res_pjsip_endpoint_identifier_ip: Document support for hostnames ASTERISK-25429 #close Reported by: Joshua C. Colp Change-Id: I7cdfc6026821636acc2465094b7fcde8471a3824 2020-01-10 14:43 +0000 [90af050fa4] Sean Bright * res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY ASTERISK-27775 #close Reported by: AvayaXAsterisk Change-Id: Iad158e908e34675ad98f74d09c5e73024e50c257 2019-12-03 12:27 +0000 [3bc8b36537] Jaco Kroon * netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr. ast_addressfamily_to_sockaddrize will determine the size that's required, and ast_sockaddr_from_sockaddr then wraps this new function and ast_sockaddr_copy_sockaddr to copy arbitrary sockaddr's (without knowing the address family) into the ast_sockaddr structure. Change-Id: Iee604e96e9096c79b477d6e5ff310cf0b06dae86 Signed-off-by: Jaco Kroon 2020-01-09 04:37 +0000 [2f8b20b949] Corey Farrell * app_record: Do not hang up if beep audio is missing Additionally alter the warning to mention that it was "beep" which could not be streamed to give admins a better clue about what the warning means. ASTERISK-28682 Change-Id: If5aed21226a173117ed17589f44826dd1ba6576e 2020-01-08 13:54 +0000 [00a7432156] Kevin Harwell * app_agent_pool: Update XML docs for AgentLogin This patch fixes some wrongly formatted documentation for the AgentLogin application. A couple of "see also" links should contain only the function name, and no parameters. Change-Id: I3f788b47dce3292e311f8a9856938d59a0bd0661 2020-01-08 12:11 +0000 [d5f3ec92d0] George Joseph * CI: Update buildAsterisk.sh to do a "make full" If you do a "make all" when building Asterisk the xml documentation produced will be missing certain AMI events where their documentation is located not at the top of the c source file but embedded further down next to the event's manager_event() registration call. See main/manager_mwi.c for an example. "make full" does produce the correct documentation so we're changing it in the build script. A separate commit/issue will address the problem with "make all". ASTERISK-28507 Reported by: David Lee Change-Id: I4a22635d6eef99eacecc0efb69e28360eebdb86c 2020-01-06 09:02 +0000 [4e7adbd8f4] Joshua C. Colp * res_pjsip_pubsub: Add ability to persist generator state information. Some body generators, such as dialog-info+xml, require storing state information which is then conveyed in the NOTIFY request itself. Up until now there was no way for such body generators to persist this information. Two new API calls have been added to allow body generators to set and get persisted data. This data is persisted out alongside the normal persistence information and allows the body generator to restore state information or to simply use this for normal storage of state. State is stored in the form of JSON and it is up to the body generator to interpret this as needed. The dialog-info+xml body generator has been updated to take advantage of this to persist the version number. ASTERISK-27759 Change-Id: I5fda56c624fd13c17b3c48e0319b77079e9e27de 2019-12-24 09:16 +0000 [312abaa1fe] Sean Bright * res_pjsip_endpoint_identifier_ip.c: Add port matching support Adds source port matching support when IP matching is used: [example] type = identify match = 1.2.3.4:5060/32, 1.2.3.4:6000/32, asterisk.org:4444 If the IP matches but the source port does not, we reject and search for alternatives. SRV lookups are still performed if enabled (srv_lookups = yes), unless the configured FQDN includes a port number in which case just a host lookup is performed. ASTERISK-28639 #close Reported by: Mitch Claborn Change-Id: I256d5bd5d478b95f526e2f80ace31b690eebba92 2019-12-30 11:04 +0000 [ee7d72eb72] George Joseph * sig_pri: Fix deadlock caused by sig_pri_queue_hangup The change to add setting hangupsource to sig_pri_queue_hangup() made in https://gerrit.asterisk.org/c/asterisk/+/12857 casued deadlocks when a hangup request was received from the core at the same time a hanguprequest was received from the remote end via the D channel. Although the PRI's channel private structure was being unlocked before setting the hangupsource, the PRI's own lock was still being held during the process. If channel actions were also coming from the core, a deadlock on the PRI could result. This deadlock could then escalate to the entire DAHDI subsystem via DAHDI's global interface list lock, especially if someone used the PRI CLI commands. Fix: * We now unlock the PRI as well as the PRI's channel private structure before setting the hangupsource, then relock both afterwards. ASTERISK-28605 Reported by: Dirk Wendland Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9 2019-12-30 13:13 +0000 [fe3cce816c] Richard Mudgett * app_chanisavail.c: Simplify dialplan using ChanIsAvail. Dialplan has to be careful about passing an empty device list or empty positions in the list. As a result, dialplan has to check for these conditions before using ChanIsAvail. Simplify dialplan by making ChanIsAvail handle these conditions gracefully. * Made tolerate empty positions in the device list. * Simplified the code and eliminated some unnecessary indention. ASTERISK-28638 Change-Id: I9e4b67e2cbf26b2417c2d03485b8568e898931d3 2020-01-02 14:25 +0000 [1c9ddad4db] George Joseph * stasis.c: Use correct topic name in stasis_topic_pool_delete_topic When a topic is created for an object, its name is only : For example: bridge:cb68b3a8-fce7-4738-8a17-d7847562f020 When a topic is added to a pool, its name has the pool's topic name prepended. For example: bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020 The topic_pool_entry's name however, is only what was passed in to stasis_topic_pool_get_topic which is bridge:cb68b3a8-fce7-4738-8a17-d7847562f020 That's actually correct because the entry is qualified by the pool that's in. When you're ready to delete the entry from the pool, you retrieve the tropic name from the object but since it now has the pool's topic name prepended, it won't be found in the pool container. Fix: * Modified stasis_topic_pool_delete_topic() to skip past the pool topic's name, if it was prepended to the topic name, before searching the container for a pool entry. ASTERISK-28633 Reported by: Joeran Vinzens Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6 2019-12-30 15:05 +0000 [19069f7db7] Richard Mudgett * app_bridgeaddchan.c: Make BridgeAdd be more like Bridge * Made BridgeAdd not hangup the call if there is a problem. * Reduced message level from warning to verbose for normal exception cases. * Added a loop safety check to BridgeAdd. * Made BridgeAdd set BRIDGERESULT with the status when dialplan is resumed. Change-Id: I374d39b8a3edcc794eeb5c6b9f31a01424cdc426 2019-12-29 22:38 +0000 [abcb4ab321] Richard Mudgett * app_dial.c: Simplify dialplan using Dial. Dialplan has to be careful about passing an empty destination list or empty positions in the list. As a result, dialplan has to check for these conditions before using Dial. Simplify dialplan by making Dial handle these conditions gracefully. * Made tolerate empty positions in the dialed device list. * Reduced some message log levels from notice to verbose. ASTERISK-28638 Change-Id: I6edc731aff451f8bdfaee5498078dd18c3a11ab9 2019-12-29 20:41 +0000 [d86a6ac5ce] Richard Mudgett * app_page.c: Simplify dialplan using Page. Dialplan has to be careful about passing an empty destination list or empty positions in the list. As a result, dialplan has to check for these conditions before using Page. Simplify dialplan by making Page handle these conditions gracefully. * Made tolerate empty positions in the paged device list. * Reduced some warnings associated with the 's' option to verbose messages. The warning level for those messages really serves no purpose as that is why the 's' option exists. ASTERISK-28638 Change-Id: I95b64a6d6800cd1a25279c88889314ae60fc21e3 2019-12-29 18:36 +0000 [0376f2bba9] Richard Mudgett * features.c: Make Bridge application tolerate unspecified channel. The Bridge application was inconsistent if the channel to bridge with is not specified. If no parameters are given then a warning is issued and the current channel is hung up. If options are given but no channel is specified then a warning is issued and the current channel is not hung up. * Made the Bridge application give a verbose message instead of a warning if the channel to bridge with is not specified and made not hang up the current channel. As a result dialplan no longer needs to check if a channel name is passed before calling Bridge and simply needs to check the BRIDGERESULT channel variable instead. This is something you likely want your dialplan to do anyway. * Fixed up L() option warning message. It is up to the caller to determine if the channel is hung up because of the warning. Dial() hangs up the current channel while Bridge() does not. Change-Id: I44349a8dc3912397f28852777de04f19e7bb9c73 2019-12-29 17:48 +0000 [0d1f3d9bf3] Richard Mudgett * app_chanspy.c: Reduce log message level from notice to verbose. Change-Id: Ica5f38ccd8cdc077aef14d0c50425e0b29ac7e0a 2019-12-29 17:31 +0000 [a457947198] Richard Mudgett * app_softhangup.c: Reduce unnecessary warning to verbose message. Why log a warning for something your dialplan explicitly asked for? Change-Id: I167b90daf4c7d75dd4b7ef94849f6cef05aa43a7 2020-01-05 10:00 +0000 [b40dd11afe] Sean Bright * res_pjsip_config_wizard: Fix change detection for wizard settings ast_sorcery_changeset_create() is not commutative and will fail to detect differences between two variable lists depending on what changed, so switch to ast_variable_lists_match(). ASTERISK-28492 #close Reported by: Jean-Denis Girard Change-Id: I7b3256983ddfaa2138d3de92a444a53b5193a4e1 2020-01-03 10:20 +0000 [7d94bdde9d] Sean Bright * res_agi: Improve GET FULL VARIABLE documentation ASTERISK-28673 #close Reported by: Jonathan Harris Change-Id: I591afdec669622bfa19243aabec31b579652c92f 2019-11-26 13:24 +0000 [87110c1bdf] Sean Bright * websocket: Consider pending SSL data when waiting for socket input When TLS is in use, checking the readiness of the underlying FD is insufficient for determining if there is data available to be read. So before polling the FD, check if there is any buffered data in the TLS layer and use that first. ASTERISK-28562 #close Reported by: Robert Sutton Change-Id: I95fcb3e2004700d5cf8e5ee04943f0115b15e10d 2019-11-22 08:32 +0000 [034ac357ad] Jean Aunis * ARI: Ability to inhibit COLP frames when adding channels to a bridge This patch adds a new flag "inhibitConnectedLineUpdates" to the 'addChannel' operation in the Bridges REST API. When set, this flag avoids generating COLP frames when the specified channels enter the bridge. ASTERISK-28629 Change-Id: Ib995d4f0c6106279aa448b34b042b68f0f2ca5dc 2019-12-27 17:29 +0000 [fc99ac8c9a] Sean Bright * db: Initialize condition primitive before use The db_init() function ultimately calls db_sync() which signals the condition before it is initialized. Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab 2019-12-18 09:13 +0000 [40b5cf8f52] Sean Bright * config.c: Skip UTF-8 BOMs if present when reading config files ASTERISK-28667 #close Change-Id: I4767ed365c98f3e1587b7653321048a31d8a53b2 2019-11-21 12:48 +0000 [c626ccec12] Kevin Reeves * main/file.c: Limit media cache usage to remote files. When testing for the existance of a file, the media cache is searched even if the file has no chance of being in it. This can cause performance issues as the media cache size increases. As a result, calls to applications like Read and Playback using local files must scan through the media cache before playing. Under load and with a large cache, this can delay the playback of those files. This patch updates the function that checks for the existance of a file to only consult the media cache database if the requested file is a remote path. It introduces a new is_remote_path() function in main/file.c. ASTERISK-28625 #close Reported-by: kevin@phoneburner.com Change-Id: If91137493732d9034dafa381c081c69274a7dcc9 2019-12-17 18:20 +0000 [095c204fe0] snuffy * contrib/valgrind: Fix use of frame-level suppression Fix use of frame-level wildcard usage in suppression file. ASTERISK-27243 #close Reported-by: Richard Kenner Change-Id: I1c0c64c5f305d2c9aa124e11f1f64a2eec52dc51 2019-12-17 07:38 +0000 [e494d5fd76] Pascal Cadotte Michaud * sip_to_pjsip.py: Fix trustrpid typo ASTERISK-28664 #close Change-Id: I6c28b1002fd7075ae0ed36f026f8c1855c9418a6 2019-11-27 11:34 +0000 [a83625b366] Frederic LE FOLL * app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR. Temporary channel lifespan is very short and CDR deactivation request through ast_cdr_set_property() may happen when CDR is not available yet. Use CDR_PROP() dialplan function instead, it will first wait for pending CDR insertion requests to be processed. ASTERISK-28636 Change-Id: I1cbe09e8d2169c0962c1195133ff260d291f2074 2019-12-16 06:35 +0000 [ed394ce5b1] Joshua C. Colp * configure: Add check for MySQL client bool and my_bool type usage. Instead of trying to use the defined MySQL client version from the header use a configure check to determine whether the bool or my_bool type should be used for defining a boolean. ASTERISK-28604 Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7 2019-12-11 18:03 +0000 [89b7144fbd] Joshua C. Colp * confbridge: Add support for specifying maximum sample rate. ConfBridge has the ability to move between different sample rates for mixing the conference bridge. Up until now there has only been the ability to set the conference bridge to mix at a specific sample rate, or to let it move between sample rates as necessary. This change adds the ability to configure a conference bridge with a maximum sample rate so it can move between sample rates but only up to the configured maximum. ASTERISK-28658 Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee 2019-12-16 05:23 +0000 [a603d7d324] Joshua C. Colp * res_pjsip_session: Set stream state on created streams for incoming SDP. A previous review, 13174, made a change whereby on an incoming offer SDP the pending topology was initialized to the configured. This caused a problem for bundle with WebRTC where bundle could reference a stream that did not actually exist if the configuration had both audio and video but the offer SDP only contained audio. This change undoes that review and instead fixes the original problem it sought to solve by setting the state of created streams based on the contents of the offer SDP. This way the stream state is not inactive until negotiation later completes. ASTERISK-28659 Change-Id: Ic5ae5a86437d3e686ac5afd91d133cc916198355 2019-12-13 13:46 +0000 [b6f5607359] Kevin Harwell * res_fax: wrap v21 detected Asterisk initiated negotiation with config option A previous patch: Gerrit Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39 made it so a T.38 Gateway tries to negotiate with both sides by sending T.38 negotiation request to both endpoints supported T.38 versus the previous behavior of forwarding negotiation to the "other" channel once a preamble was detected. This had the unfortunate side effect of breaking some setups. Specifically ones that set the max datagram option on an endpoint configuration (configured max datagram was not propagated since Asterisk now initiates negotiations). This patch adds a configuration option, "negotiate_both", that when enabled makes it so Asterisk initiates the negotiation requests to both endpoints vs. the previous behavior of waiting, and forwarding the request. The default is disabled keeping with the old behavior. ASTERISK-28660 Change-Id: I5deb875f3485e20bc75119ec743090655d864a1a 2019-12-04 02:35 +0000 [32160cb456] Jaco Kroon * ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging. Due to use in res_rtp_asterisk there is a need to be able to apply an ACL without logging any invalid/denies. It's probably sensible to at least validate the ACL once directly after load and report invalid ACLs. Change-Id: I256169229d945ca7c1bbf228fc492d91df345843 Signed-off-by: Jaco Kroon 2019-12-11 10:52 +0000 [bf4dd3d837] Pascal Cadotte Michaud * PJSIP_CONTACT: add missing argument documentation add missing argument "rtt" and "status" to the documentation The change to the dtd file allow an enumlist to contain one or many configOptionToEnum or enum. This is different from the previous patch I submitted when you could have a configOptionToEnum or (a configOptionToEnum followed by one or manu enums) or (one or many enums) ASTERISK-28626 Change-Id: Ia71743ee7ec813f40297b0ddefeee7909db63b6d 2019-12-11 07:01 +0000 [d0b198b330] Joshua Colp * Revert "PJSIP_CONTACT: add missing argument documentation" This reverts commit 7e3015d77913accad9b1dcd200ceec30e52bf445. Reason for revert: Regression in XML validation. validity error : Content model of enumlist is not determinist: (configOptionToEnum | (configOptionToEnum , enum+) | enum+) As we are preparing to do releases and this is not critical I am reverting this for now until resolved. Change-Id: I30c2295f9d7f0a0475674ee77071a7ebabf5b83f 2019-12-04 15:01 +0000 [39c920ac78] George Joseph * res_rtp_asterisk: Add frame list cleanups to ast_rtp_read In Asterisk 16+, there are a few places in ast_rtp_read where we've allocated a frame list but return a null frame instead of the list. In these cases, any frames left in the list won't be freed. In the vast majority of the cases, the list is empty when we return so there's nothing to free but there have been leaks reported in the wild that can be traced back to frames left in the list before returning. The escape paths now all have logic to free frames left in the list. ASTERISK-28609 Reported by: Ted G Change-Id: Ia1d7075857ebd26b47183c44b1aebb0d8f985f7a 2019-12-04 08:35 +0000 [365d007eb6] Jaco Kroon * chan_sip: in case of tcp/tls, be less annoying about tx errors. chan_sip.c:3782 __sip_xmit: sip_xmit of 0x7f1478069230 (len 600) to 213.150.203.60:1492 returned -2: Interrupted system call returned -2 implies this wasn't actually an OS error, so errno makes no sense either. Internal error was already logged higher up, and -2 generally means that either there isn't a valid connection available, or the pipe notification failed, and that is already correctly logged. ASTERISK-28651 #close Change-Id: I46eb82924beeff9dfd86fa6c7eb87d2651b950f2 Signed-off-by: Jaco Kroon 2019-08-25 21:20 +0000 [cbc1136704] George Joseph * res_pjsip_nat: Restore original contact for REGISTER responses RFC3261 Section 10 "Registrations", specifically paragraph "10.2.4: Refreshing Bindings", states that a user agent compares each contact address (in a 200 REGISTER response) to see if it created the contact. If the Asterisk endpoint has the rewrite_contact option set however, the contact host and port sent back in the 200 response will be the rewritten one and not the one sent by the user agent. This prevents the user agent from matching its own contact. Some user agents get very upset when this happens and will not consider the registration successful. While this is rare, it is acceptable behavior especially if more than 1 user agent is allowed to register to a single endpoint/aor. This commit updates res_pjsip_nat (where rewrite_contact is implemented) to store the original incoming Contact header in a new "x-ast-orig-host" URI parameter before rewriting it, and to restore the original host and port to the Contact headers in the outgoing response. This is only done if the request is a REGISTER and rewrite_contact is enabled. pjsip_message_filter was also updated to ensure that if a request comes in with any existing x-ast-* URI parameters, we remove them so they don't conflict. Asterisk will never send a request with those headers in it but someone might just decide to add them to a request they craft and send to Asterisk. NOTE: If a device changes its contact address and registers again, it's a NEW registration. If the device didn't unregister the original registration then all existing behavior based on aor/remove_existing and aor/max_contacts apply. ASTERISK-28502 Reported-by: Ross Beer Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e 2019-12-04 15:26 +0000 [b1be06df8d] Sean Bright * res_pjsip_registrar.c: Prevent potential double free if AOR is not found The simple fix here is simply to NULL out username and password after we call ast_free on them. Unfortunately, I noticed that we weren't checking for allocation failures for username and password, and adding those checks made things noisy and cumbersome. So instead we partially rollback the recent LGTM patch, and move the alloca calls into find_aor_name(). ASTERISK-28641 #close Reported by: Ross Beer Change-Id: Ic9d01624e717a020be0b0aee31f0814e7f1ffbe2 2019-12-04 15:12 +0000 [0183e2bc67] Sean Bright * res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases We're appropriately sizing the id_domain_alias buffer, but then copying the data into the id_domain one. We were then using the uninitialized id_domain_alias buffer we just allocated. This is ASTERISK~28641 adjacent, but significant enough to warrant its own patch. Change-Id: I81c38724d18deab8c6573153e2b99dbb6e2f33d9 2019-12-03 05:58 +0000 [9c9296c635] Jean Aunis * chan_sip: voice frames are no longer transmitted after emitting a COLP The SIP transaction state was reset when emitting an UPDATE or a re-INVITE related to a COLP, preventing RTP packets to be emitted. ASTERISK-28647 Change-Id: Ie7a30fa7a97f711e7ba6cc17f221a0993d48bd8b 2019-11-27 12:11 +0000 [7624cbb155] Frederic LE FOLL * chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime. During capabilities selection (joint capabilities of us and peer, configured capability for this peer, or general configured capabilities), if sip_new() does not keep framing information, then directmedia activation will fail for any framing different from default framing. ASTERISK-28637 Change-Id: I99257502788653c2816fc991cac7946453082466 2019-12-04 03:33 +0000 [0e750cdd10] Walter Doekes * app_queue: Fix old confusing comment about when the members are called ASTERISK-28644 Change-Id: I2771a931d00a8fc2b9f9a4d1a33ea8f1ad24e06b 2019-12-03 15:42 +0000 [6ee1f1f507] Sean Bright * res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled We need to copy the endpoint name before we call ao2_cleanup() on it, otherwise we might try to access memory that has been reclaimed. ASTERISK-28445 #close Reported by: Bernhard Schmidt Change-Id: I404b952608aa606e0babd3c4108346721fb726b3 2019-11-22 10:39 +0000 [fd823225a6] Thomas Arimont (license 5525) * channel.c: Resolve issue with receiving SIP INFO packets for DTMF The problem is essentially the same as in ASTERISK~28245. Besides the direct media scenario we have an additional scenario where a special client is involved. This device mutes audio by default in transmit direction (no rtp frames) and activates audio only by a foot switch. In this situation dtmf input (pin for conferences, transfer features codes , etc) using SIP INFO mode is not understood properly especially when SIP INFO messages are sent quickly. This patch ensures that SIP INFO frames are properly queued and processed in the above scenario. The patch also corrects situations where successive dtmf events are received quicker than the signalled event duration (plus minimum gap/pause) allows, i.e. DTMF events have to be buffered in the ast channel read queue and emulation has to be processed asynchronously at slower speed. Reported by: Thomas Arimont patches: trigger_dtmf_emulation.patch submitted by Thomas Arimont (license 5525) Change-Id: I309bf61dd065c9978c8e48f5b9a936ab47de64c2 2019-12-02 06:48 +0000 [366da90f74] George Joseph * CI: Turn off shallow cloning altogether Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196 2019-11-25 06:55 +0000 [811ae88da4] Joshua Colp * parking: Fall back to parker channel name even if it matches parkee. ASTERISK-28631 Change-Id: Ia74d084799fbb9bee3403e30d2391aacd46243cc 2019-11-22 15:31 +0000 [91c3b5b09d] Sean Bright * media_cache.c: Various CLI improvements * Use ast_cli_completion_add() to improve performance when large number of cached items are present. * Only complete one URI for commands that only accept a single URI. * Change command documentation to wrap at 80 characters to improve readability. Change-Id: Iedb0a2c3541e49561bc231dca2dcc0ebd8612902 2016-09-30 21:56 +0000 [48161dfc71] Rodrigo Ramírez Norambuena * queue_log: Add alembic script for generate db table for queue_log Change-Id: I35b928a6251f9da9a1742b2cd14c63a00c3d0f0c 2019-11-15 11:34 +0000 [330ffa2bce] Salah Ahmed * res_pjsip_t38: T.38 error correction mode selection at 200 ok received if asterisk offer T38 SDP with none error correction scheme and the endpoint respond with redundancy EC scheme, asterisk switch to that mode. Since we configure the endpoint as none EC mode we should not switch to any other mode except none. following logic implemented in code. 1. If asterisk offer none, and anything except none in answer will be ignored. 2. If asterisk offer fec, answer with fec, redundancy and none will be accepted. 3. If asterisk offer redundancy, answer with redundancy and none will be accepted. ASTERISK-28621 Change-Id: I343c62253ea4c8b7ee17abbfb377a4d484a14b19 2019-10-21 14:55 +0000 [4a1cadeadb] Ben Ford * chan_sip.c: Prevent address change on unauthenticated SIP request. If the name of a peer is known and a SIP request is sent using that peer's name, the address of the peer will change even if the request fails the authentication challenge. This means that an endpoint can be altered and even rendered unusuable, even if it was in a working state previously. This can only occur when the nat option is set to the default, or auto_force_rport. This change checks the result of authentication first to ensure it is successful before setting the address and the nat option. ASTERISK-28589 #close Change-Id: I581c5ed1da60ca89f590bd70872de2b660de02df 2019-10-24 12:41 +0000 [7e3a6e158f] George Joseph * manager.c: Prevent the Originate action from running the Originate app If an AMI user without the "system" authorization calls the Originate AMI command with the Originate application, the second Originate could run the "System" command. Action: Originate Channel: Local/1111 Application: Originate Data: Local/2222,app,System,touch /tmp/owned If the "system" authorization isn't set, we now block the Originate app as well as the System, Exec, etc. apps. ASTERISK-28580 Reported by: Eliel Sardañons Change-Id: Ic4c9dedc34c426f03c8c14fce334a71386d8a5fa 2019-11-21 07:24 +0000 [7e3015d779] Pascal Cadotte Michaud * PJSIP_CONTACT: add missing argument documentation add missing argument "rtt" and "status" to the documentation ASTERISK-28626 Change-Id: I8419e4c8203e411b87d93dc395acdbcf7526dedf 2019-11-20 12:56 +0000 [d5d41409e2] Kevin Harwell * res_pjsip_outbound_registration: add support for SRV failover ASTERISK-28624 Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561 2019-11-19 12:11 +0000 [2a6a2800e7] George Joseph * CI: Fix missing script block in jenkinsfiles Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3 (cherry picked from commit 95213b01d2d5e72e38b40c30fa5d0c8cf4b37b16) 2019-11-19 11:40 +0000 [4abb54b2e4] George Joseph * CI: Fix missing script block in jenkinsfiles Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f (cherry picked from commit d60f23ecbdb748b188da424c92335152941c7673) (cherry picked from commit ce8a23fdf966dc6824678f3cb722753db06baa7a) (cherry picked from commit f0d1ce50afd25a1269e680b90c8bb612bd543565) 2019-11-19 08:51 +0000 [e8e1314fcb] George Joseph * CI: Increase clone depth and do better cleanup The original clone depth of 10 was causing the need to rebase changes whose parent was older than the 10 commits. The clone depth has been increased to 100. Workspace cleanup was only happening for successful builds which wasn't enough to keep the 8G workspace in-memory drives on the docker slaves from filling up. Now the workspaces are cleaned up after every build regardless of success/failure. If you need to preserve builds temporarily, you can log into Jenkins/Manage Jenkins/Configure System and change the CLEANUP_WS_* environment variable for the job type you're troubleshooting to "FALSE". Change-Id: I0d7366e87cea714e5dbc9488caf718802fce75ca 2019-11-19 09:31 +0000 [a5fa0d662e] Sean Bright * res_pjsip_registrar: Fix uninitlized variable warning Fixes: error: ‘domain_name’ may be used uninitialized in this function Found with gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008 Change-Id: I44413b49ea1205aa25538142161deb73883c79e8 2019-11-05 12:16 +0000 [5bda460300] Michael Cargile * app_amd: Fixed timeout issue ASTERISK_28143 attempted to fix an issue where calls with no audio would never timeout. It did so by adding AST_FRAME_NULL as a frame type to process in its calculations. Unfortunately these frames seem to show up at irregular time intervals. This resulted in app_amd returning prematurely most of the time. * Removed AST_FRAME_NULL from the calculations * Added a check to see how much time has actually passed since app_amd began ASTERISK-28608 Change-Id: I642a21b02d389b17e40ccd5357754b034c3daa42 2019-11-07 11:54 +0000 [a68299f508] Frederic LE FOLL * chan_dahdi: PRI span status may stay "Down, Active" after a short alarm Upon a short PRI disconnection, libpri may maintain Q.921 layer 'up' and may thus not send PRI_EVENT_DCHAN_DOWN / PRI_EVENT_DCHAN_UP events. If pri_event_alarm() clears DCHAN_UP status bit upon alarm detection and no Q.921 reconnection sequence occurs, chan_dahdi will keep seeing span status "Down" at the end of alarm. This patch modifies pri_event_alarm() in order to keep DCHAN_UP bit unchanged. libpri will send a PRI_EVENT_DCHAN_DOWN event if it detects a disconnection of Q.921 layer and this will clear DCHAN_UP if required. ASTERISK-28615 Change-Id: Ibe27df4971fd4c82cc6850020bce4a8b2692c996 2019-11-07 11:05 +0000 [772b59034f] lvl * app_senddtmf: Add receive mode to AMI Action PlayDTMF ASTERISK-28614 Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664 2019-11-07 10:56 +0000 [f2d5ed54ea] Alexei Gradinari * serializer: set high/low alert levels on whole pool The current code sets alert levels starting from index 1. Need to set on whole pool starting from index 0. Change-Id: I5decbb43160954fb9a512f04302637fc666b6f5d 2019-11-14 04:19 +0000 [02129ad4d0] Joshua Colp * res_rtp_asterisk: Always return provided DTLS packet length. OpenSSL can not tolerate if the packet sent out does not match the length that it provided to the sender. This change lies and says that each time the full packet was sent. If a problem does occur then a retransmission will occur as appropriate. ASTERISK-28576 Change-Id: Id42455b15c9dc4eb987c8c023ece6fbf3c22a449 2019-11-13 14:25 +0000 [bf7c808604] Sean Bright * func_env: Prevent FILE() from reading garbage at end-of-file If the last line of a file does not have a terminating EOL sequence, we potentially add garbage to the value returned from the FILE() function. There is no overflow potential here as we are reading from a buffer of a known size, we are just reading too much of it. ASTERISK-26481 #close Change-Id: I50dd4fcf416fb3c83150040a1a79a59d9eb1ae01 2019-11-13 17:24 +0000 [e77cb32583] Kevin Harwell * bridge_softmix: clear hold when joining a softmix bridge MOH continues to play to a channel if that channel was on hold prior to entering a softmix bridge. MOH will not stop even if the original "holder" attempts an unhold. For the most part a softmix bridge ignores holds, so a participating channel shouldn't join while on hold. This patch checks to see if the channel joining the softmix bridge is currently on hold. If so then it indicates an unhold. ASTERISK-28618 Change-Id: I66ccd4efc80f5b4c3dd68186b379eb442916392b 2019-10-23 12:36 +0000 [bdd785d31c] Kevin Harwell * various files - fix some alerts raised by lgtm code analysis This patch fixes several issues reported by the lgtm code analysis tool: https://lgtm.com/projects/g/asterisk/asterisk Not all reported issues were addressed in this patch. This patch mostly fixes confirmed reported errors, potential problematic code points, and a few other "low hanging" warnings or recommendations found in core supported modules. These include, but are not limited to the following: * innapropriate stack allocation in loops * buffer overflows * variable declaration "hiding" another variable declaration * comparisons results that are always the same * ambiguously signed bit-field members * missing header guards Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25 2019-11-07 11:54 +0000 [d257a0898e] Martin Tomec * func_curl.c: Support custom http headers When user wants to send json data, the default Content-Type header is incorect (application/x-www-form-urlencoded). This patch allows to set any custom headers so the Content-Type header can be overriden. User can set multiple headers by multiple calls of curlopt(). This approach is not consistent with other parameters, but is more readable in dialplan than one call with multiple headers. ASTERISK-28613 Change-Id: I4dd68c3f4e25362ef941d73a3861f58348dcfbf9 2019-11-15 04:46 +0000 [807a70b7ae] Joshua Colp * parking: Fix case where we can't get the parker. ASTERISK-28616 Change-Id: Iabe31ae38d01604284fcc5c2438d44e29a32ea4d 2019-11-06 05:47 +0000 [990a91b44a] George Joseph * stasis: Don't hold app_registry and session locks unnecessarily resource_events:stasis_app_message_handler() was locking the session, then attempting to determine if the app had debug enabled which locked the app_registry container. res_stasis:__stasis_app_register was locking the app_registry container then calling app_update which caused app_handler (which locks the session) to run. The result was a deadlock. * Updated resource_events:stasis_app_message_handler() to determine if debug was set (which locks the app_registry) before obtaining the session lock. * Updated res_stasis:__stasis_app_register to release the app_registry container lock before calling app_update (which locks the sesison). ASTERISK-28423 Reported by Ross Beer Change-Id: I58c69d08cb372852a63933608e4d6c3e456247b4 2019-11-12 05:00 +0000 [e924c5107c] Joshua Colp * parking: Use channel snapshot instead of channel. There exists a scenario where a thread can hold a lock on the channels container while trying to lock a bridge. At the same time another thread can hold the lock for said bridge while attempting to retrieve a channel. This causes a deadlock. This change fixes this scenario by retrieving a channel snapshot instead of a channel, as information present in the snapshot is all that is needed. ASTERISK-28616 Change-Id: I68ceb1d62c7378addcd286e21be08a660a7cecf2 2019-11-12 12:36 +0000 [0e3b397812] Kevin Harwell * res_pjsip_session: initialize pending's topology to endpoint's Found during some testing, there is a race condition between selecting an appropriate bridge type for a call versus the applying of media on the callee's session. In some instances a native bridge type would have been chosen, but due to the callee's media not yet being established at bridge compatibility check time the simple bridge type is picked instead. When using chan_pjsip this initiates a topology change event. The topologies are then compared for the two sessions. However, when the topology was created for the caller its streams are initialized to "inactive". This topology is then used as a base when creating the callee's topology, and streams. Soon after the caller's topology's stream(s) get updated based on the sdp (get set to sendrecv in the failing scenario). Now when the topology change event is raised, and the two topologies are compared, the comparison fails due to a stream state mismatch (sendrecv vs inactive). And since they differ a reinvite is sent out (to the caller in this case). This patch makes it such that when the caller's topology is initially created it gets created based on its configured endpoint's media topology. When the endpoint's topology is created its stream's state(s) are initialized to sendrecv instead of inactive. Subsequently, now when the callee's topology is created its topology streams are now initialized to sendrecv. Thus when the topology change event occurs due to the mentioned scenario the stream states match for the given sessions, and the reinvite is not sent unless due to some other valid mismatch. Note, this patch only changes one pending media state's creation point. It's possible other places *could* be changed, however for now it was deemed best to only alter what's here. Change-Id: I6ba3a6a75f64824a1b963044c37acbe951c389c7 2019-11-08 09:20 +0000 [8a1f30af04] Corey Farrell * core: Improve MALLOC_DEBUG for frames. * Pass caller information to frame allocation functions. * Disable caching as it interfers with MALLOC_DEBUG reporting. * Stop using ast_calloc_cache. Change-Id: Id343cd80a3db941d2daefde2a060750fea8cd260 2019-10-29 08:23 +0000 [a47cb71bb1] George Joseph * Build: Fix compile issues with seldom used modules The following modules needed tweaks for API changes. addons/cdr_mysql.c addons/chan_ooh323.c apps/app_meetme.c ASTERISK-28604 Change-Id: Ib40e513ae55b5114be035cdc929abb6a8ce2d06d 2019-10-25 06:46 +0000 [e73eba85c1] Joshua Colp * res_pjsip_outbound_registration: Extend documentation for "max_retries". If the "max_retries" option is set to 0 then upon failure no further attemps are made, so explicitly document the behavior. ASTERISK-28602 Change-Id: I1e30daae9dd6c49ce18744164214d3def505acbf 2019-10-24 09:15 +0000 [16e668c7dd] Sean Bright * res_calendar: Resolve memory leak on calendar destruction Calling ne_uri_parse allocates memory that needs to be freed with a corresponding call to ne_uri_free. ASTERISK-28572 #close Change-Id: I8a6834da27000a6807d89cb7a157b2a88fcb5e61 2019-10-24 05:21 +0000 [360936ead5] Joshua Colp * res_ari_events: Add module reference when a WebSocket is open. This change ensures that the module isn't unloaded when a WebSocket is open. Previously it was possible to unload the module manually or during shutdown which could cause a crash when any active WebSockets were terminated. ASTERISK-28585 Change-Id: I85c71ab112f99875b586419a34c08c8b34c14c5c 2019-10-18 13:47 +0000 [a4222614c4] Sean Bright * utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN ASTERISK-28590 #close Change-Id: I51abce00c04d0a06550bda5205580705185b9c1c 2019-10-18 06:36 +0000 [d71d0f9489] George Joseph * ExternalMedia: Change return object from ExternalMedia to Channel When we created the External Media addition to ARI we created an ExternalMedia object to be returned from the channels/externalMedia REST endpoint. This object contained the channel object that was created plus local_address and local_port attributes (which are also in the Channel variables). At the time, we thought that creating an ExternalMedia object would give us more flexibility in the future but as we created the sample speech to text application, we discovered that it doesn't work so well with ARI client libraries that a) don't have the ExternalMedia object defined and/or b) can't promote the embedded channel structure to a first-class Channel object. This change causes the channels/externalMedia REST endpoint to return a Channel object (like channels/create and channels/originate) instead of the ExternalMedia object. Change-Id: If280094debd35102cf21e0a31a5e0846fec14af9 2019-10-18 04:22 +0000 [ddb0091da5] Salah Ahmed * Crash during "pjsip show channelstats" execution During execution "pjsip show channelstats" cli command by an external module asterisk crashed. It seems this is a separate thread running to fetch and print rtp stats. The crash happened on the ao2_lock method, just before it going to read the rtp stats on a rtp instance. According to gdb backtrace log, it seems the session media was already cleaned up at that moment. ASTERISK-28578 Change-Id: I3e05980dd4694577be6d39be2c21a5736bae3c6f 2019-10-17 05:50 +0000 [6e907ae5d4] Joshua Colp * res_rtp_asterisk: Remove a log message that slipped in. This was only supposed to be for testing, so now it can be removed. Change-Id: I3dfc2e776e70b3196aeed5688372ea80c0214b59 2019-10-16 16:06 +0000 [0dc7e29dd8] Sean Bright * README-SERIOUSLY.bestpractices.md: Speling correetions. ASTERISK-28586 #close Change-Id: I43dc4e8bd9dc685b17695b215a5360314074734f 2019-09-26 19:24 +0000 [2d67dbfef5] cmaj * app_voicemail.c: Support multiple file formats for forwarded messages. If you specify multiple formats in voicemail.conf, eg. "format = gsm|wav" and are using realtime ODBC backend, only the first format gets stored in the database. So when you forward a message later on, there is a bug generating the email, related to the stored format (GSM) being different than the desired email format (WAV) specified for the user. Sox can handle this, but Asterisk needs to tell sox exactly what to do. ASTERISK-22192 Change-Id: I7321e7f7e7c58adbf41dd4fd7191c887b9b2eafd 2019-10-14 06:19 +0000 [a60d2e905c] Joshua Colp * test_res_rtp: Enable FIR and REMB nominal tests. Now that both FIR and REMB are being sent in compound packets these tests can be enabled. This also extends the REMB nominal test to cover the REMB contents itself. Change-Id: Ibfee526ad780eefcce5dd787f53785382210024a 2019-10-08 13:40 +0000 [52ade18420] Christoph Moench-Tegeder * cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12 PostgreSQL 12 finally removed column adsrc from table pg_catalog.pg_attrdef (column default values), which has been deprecated since version 8.0. Since then, the official/correct/supported way to retrieve the column default value from the catalog is function pg_catalog.pg_get_expr(). This change breaks compatibility with pre-8.0 PostgreSQL servers, but has reached end-of-support more than a decade ago. cdr_pgsql and res_config_pgsql still have support for pre-7.3 servers, but cleaning that up is perhaps a topic for a major release, not this bugfix. ASTERISK-28571 Change-Id: I834cb3addf1937e19e87ede140bdd16cea531ebe 2019-10-10 15:30 +0000 [5dae803eea] Kevin Harwell * res_pjsip_mwi: potential double unref, and potential unwanted double link When creating an unsolicited MWI aggregate subscription it was possible for the subscription object to be double unref'ed. This patch removes the explicit unref as it is not needed since the RAII_VAR will handle it at function end. Less concerning there was also a bug that could potentially allow the aggregate subscription object to be added to the unsolicited container twice. This patch ensures it is added only once. ASTERISK-28575 Change-Id: I9ccfdb5ea788bc0c3618db183aae235e53c12763 2019-10-09 16:00 +0000 [b27a5183da] Chris Savinovich * test_taskprocessor.c: Fix test failure on Ubuntu Fixes a failure in /main/taskprocesor unit test, only occurring in Ubuntu. Newer versions of GCC require variable initialization. Change-Id: I2994d8aab9307a8c2c7330584f287a27144a580c 2019-10-09 09:32 +0000 [5d9f9f4871] George Joseph * pjproject_bundled: Replace earlier reverts with official fixes. Issues in pjproject 2.9 caused us to revert some of their changes as a work around. This introduced another issue where pjproject wouldn't build with older gcc versions such as that found on CentOS 6. This commit replaces the reverts with the official fixes for the original issues and allows pjproject to be built on CentOS 6 again. ASTERISK-28574 Reported-by: Niklas Larsson Change-Id: I06f8507bea553d1a01b0b8874197d35b9d47ec4c 2019-10-09 15:17 +0000 [bf6f27388d] Joshua Colp (license 5000) * pbx: deadlock when outgoing dialed channel hangs up too quickly Here's the basic scenario that occurred when executing an AMI fast originate while at the same time something else locks the channels container, and also wants a lock on the dialed channel: 1. pbx_outgoing_attempt obtains a lock on a dialed channel 2. concurrently another thread obtains a lock on the channels container, and subsequently requests a lock on the dialed channel. It waits on #1. For instance, "core show channel * Revert "app_voicemail: Cleanup stale lock files on module load" This reverts commit fd2e8d0da7ba539470ed73d463d8bc641f7843af. Reason for revert: Problematic for users who store their voicemail on network storage devices, or share voicemail storage between multiple Asterisk instances. ASTERISK-28567 #close Change-Id: I3ff4ca983d8e753fe2971f3439bd154705693c41 2019-10-01 06:29 +0000 [c03f50c1c8] lvl * chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel ASTERISK-28086 #close Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea 2019-10-02 12:56 +0000 [12dbeb69b0] Kevin Harwell * res_pjsip_mwi: use an ao2_global object for mwi containers On shutdown it's possible for the unsolicited mwi container to be freed before other dependent threads are done using it. This patch ensures this can no longer happen by wrapping the container in an ao2_global object. The solicited container was also changed too. ASTERISK-28552 Change-Id: I8f812286dc19a34916acacd71ce2ec26e1042047 2019-10-02 12:55 +0000 [c0efe19cec] Kevin Harwell * serializer: move/add asterisk serializer pool functionality Serializer pools have previously existed in Asterisk. However, for the most part the code has been duplicated across modules. This patch abstracts the code into an 'ast_serializer_pool' object. As well the code is now centralized in serializer.c/h. In addition serializer pools can now optionally be monitored by a shutdown group. This will prevent the pool from being destroyed until all serializers have completed. Change-Id: Ib1e906144b90ffd4d5ed9826f0b719ca9c6d2971 2019-10-02 12:56 +0000 [2970a13fb8] Kevin Harwell * res_pjsip/res_pjsip_mwi: use centralized serializer pools Both res_pjsip and res_pjsip_mwi made use of serializer pools. However, they both implemented their own serializer pool functionality that was pretty much identical in each of the source files. This patch removes the duplicated code, and uses the new 'ast_serializer_pool' object instead. Additionally res_pjsip_mwi enables a shutdown group on the pool since if the timing was right the module could be unloaded while taskprocessor threads still needed to execute, thus causing a crash. Change-Id: I959b0805ad024585bbb6276593118be34fbf6e1d 2019-10-04 15:31 +0000 [51850a79ef] Sean Bright * cdr_mysql: Don't clean up on unload unless we can unregister from CDRs ASTERISK-28566 #close Change-Id: I6daa4e5128e9406d04d3aed670c3bae98d38d40c 2019-10-01 09:01 +0000 [729b286d59] Joshua Colp * stasis: Pass bumped topic_all reference to proxy_dtor. This avoids use of the global variable and ensures topic_all remains active until all topics are freed. ASTERISK-28553 patches: ASTERISK-28553.patch by coreyfarrell (license 5909) Change-Id: I9a8cd8977f3c3a6aa00783f8336d2cfb9c2820f1 2019-09-19 03:56 +0000 [b43cdc7f1e] Torrey Searle * channel/chan_pjsip: add dialplan function for music on hold Add a new dialplan function PJSIP_MOH_PASSTHROUGH that allows the on-hold behavior to be controlled on a per-call basis ASTERISK-28542 #close Change-Id: Iebe905b2ad6dbaa87ab330267147180b05a3c3a8 2019-09-24 14:18 +0000 [068ed2c626] Alexei Gradinari * res_pjsip_pubsub: add endpoint to some warning There are some warning messages which are not informative without endpoint: "No registered subscribe handler for event presence.winfo" "No registered publish handler for event presence" This patch adds an endpoint name to these messages. Change-Id: Ia2811ec226d8a12659b4f9d4d224b48289650827 2019-09-27 09:54 +0000 [377d7bdab6] Sean Bright * res_pjsip_transport_websocket: Don't put brackets around local_name if IPv6 ASTERISK-28544 #close Change-Id: I8e62c444d107674c298f472e3545661de8a80dce 2015-03-27 17:34 +0000 [ba64d68273] Jonathan Rose * basic-pbx: Bring forward queue configuration from 13 Original commit: cfbf5fbe918bc34f3d600760fc0b6f13a3a9a0ed Change-Id: I34a841d73c429ca8d944481f8dccb756ee231c9c 2019-09-25 11:01 +0000 [702019fc80] Sean Bright * pbx: Prevent Realtime switch crash on invalid priority pbx_extension_helper takes two 'context' arguments. One (con) is a pointer directly to a 'struct ast_context' and the other (context) is the name of the context. In all cases, one of these arguments is NULL and the other is non-NULL. Functions that are ultimately called by pbx_extension_helper expect that 'context' will be non-NULL, so we set it unconditionally on entry into this function. ASTERISK-28534 #close Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d 2019-09-24 15:44 +0000 [4c3655ecfd] Ben Ford * taskprocessor.c: Added "like" support to 'core show taskprocessors' Added "like" support for 'core show taskprocessors'. Now you can specify a specific set of taskprocessors (or just one) by adding the keyword "like" to the above command, followed by your search criteria. Change-Id: I021e740201e9ba487204b5451e46feb0e3222464 2019-09-18 06:56 +0000 [966488ab52] Sean Bright * res_musiconhold: Add new 'playlist' mode Allow the list of files to be played to be provided explicitly in the music class's configuration. The primary driver for this change is to allow URLs to be used for MoH. Change-Id: I9f43b80b43880980b18b2bee26ec09429d0b92fa 2019-09-24 17:43 +0000 [982a5025b3] Sean Bright * res_pjsip_registrar: Validate Contact URI before adding to responses If a permanent contact URI associated with an AOR is invalid, we add a Contact header to REGISTER responses with a NULL URI, causing a crash. ASTERISK-28463 #close Change-Id: Id2b643e58b975bc560aab1c111e6669d54db9102 2019-09-20 09:08 +0000 [f7045cefd9] Corey Farrell * stasis_state: Create internal stasis_state_proxy object. This improves the way which stasis_state reference counting works. Since manager->states holds onto the proxy object instead of the real object this allows stasis_state objects to be freed when appropriate without use of a special state_remove function. Additionally each distinct eid associated with the state holds a reference to the state to prevent early release and potentially allow easier debug of leaks. Change-Id: I400e0db4b9afa3d5cb4ac7dad60907897e73f9a9 2019-09-24 11:21 +0000 [67ba62f4e6] Kevin Harwell * res_pjsip_pubsub: change warning to debug The following message: "Subscription request from endpoint rejected. Expiration of 0 is invalid" Would sometimes spam the log with warnings if Asterisk restarted and a bunch of clients sent unsubscribes. This patch changes it from a warning to a debug message. Change-Id: I841ec42f65559f3135e037df0e55f89b6447a467 2019-09-24 09:40 +0000 [4de1e6d0e6] Ben Ford * taskprocessor.c: Add CLI commands to reset taskprocessor stats. Added two new CLI commands to reset stats for taskprocessors. You can reset stats for a single, specific taskprocessor ('core reset taskprocessor '), or you can reset all taskprocessors ('core reset taskprocessors'). These commands will reset the counter for the number of tasks processed as well as the max queue size. Change-Id: Iaf17fc4ae29396ab0c6ac92408fc7bdc2f12362d 2019-09-19 09:50 +0000 [cc83e76aa5] George Joseph * pjproject_bundled: Revert pjproject 2.9 commits causing leaks We've found a connection re-use regression in pjproject 2.9 introduced by commit "Close #1019: Support for multiple listeners." https://trac.pjsip.org/repos/changeset/6002 https://trac.pjsip.org/repos/ticket/1019 Normally, multiple SSL requests should reuse the same connection if one already exists to the remote server. When a transport error occurs, the next request should establish a new connection and any following requests should use that same one. With this patch, when a transport error occurs, every new request creates a new connection so you can wind up with thousands of open tcp sockets, possibly exhausting file handles, and increasing memory usage. Reverting pjproject commit 6002 (and related 6021) restores the expected behavior. We also found a memory leak in SSL processing that was introduced by commit "Fixed #2204: Add OpenSSL remote certificate chain info" https://trac.pjsip.org/repos/changeset/6014 https://trac.pjsip.org/repos/ticket/2204 Apparently the remote certificate chain is continually recreated causing the leak. Reverting pjproject commit 6014 (and related 6022) restores the expected behavior. Both of these issues have been acknowledged by Teluu. ASTERISK-28521 Change-Id: I8ae7233c3ac4ec29a3b991f738e655dabcaba9f1 2019-09-22 16:59 +0000 [725e991faf] Corey Farrell * core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option. Previous to this patch passing a NULL tag to ao2_alloc or ao2_ref based functions would result in the reference not being logged under REF_DEBUG. This could sometimes cause inaccurate logging if NULL was accidentally passed to a reference action. Now reference logging is only disabled by option passed to the allocation method. Change-Id: I3c17d867d901d53f9fcd512bef4d52e342637b54 2019-09-23 11:01 +0000 [a4caaef64c] Kevin Harwell * res_sorcery_memory_cache: stale item update leak When a stale item was being updated the object was being retrieved, but its reference was not being decremented after the update. This patch makes it so the object is now appropriately de-referenced. ASTERISK-28523 Change-Id: I9d8173d3a0416a242f4eba92fa0853279c500ec7 2019-09-23 07:09 +0000 [e82f2f6e82] George Joseph * astmm.c: Display backtrace with memory show allocations You can currently capture backtraces of memory allocations but they only get displayed when you stop asterisk and the atexit hooks are enabled. Now, if memory backtrace is on and you issue a "memory show allocations" CLI command for a specific file, then a backtrace will show for each allocation that occurred after you turned "memory backtrace on". The backtrace display is shown only when a specific file's allocations are displayed to prevent a massive CLI dump of every file's allocations. Change-Id: Ic657afc1fc6ec7205e16eb36a97a611d235a2b4f 2019-09-22 21:04 +0000 [a4142c8437] Corey Farrell * core: Fix ABI mismatch of ao2_global_obj. astobj2.c declares DEBUG_THREADS_LOOSE_ABI to avoid overhead of debug threads tracking information in the internal structures of astobj2. Unfortunately this means that ao2_global_obj contains the statically allocated debug threads tracking fields which are used by initialization and cleanup but main/astobj2.c believed those fields and associated space did not exist. Change-Id: Icef41ad97d88a8c1d1515e034ec8133cab3b1527 2019-09-20 08:29 +0000 [ca608d2575] Corey Farrell * stasis: refcounter.py can incorrectly report skewed objects. It is possible for topic->name to be NULL, this causes the allocation reference to not be logged. Use the name variable instead which has been verified to be a non-empty. Change-Id: I3d0031d03c8356e4808f00cdf2d5428712575883 2019-09-19 17:32 +0000 [3dfbc05c53] Corey Farrell * stasis: Fix leaks * Release reference returned by cache_remove * state_alloc unconditionally bumped state_topic even when it was locally allocated. Change-Id: I51101bf7d07b8dc8ce8fc46b6cb31fbbd213fbc7 2019-09-19 10:53 +0000 [863fe2225f] Corey Farrell * app_voicemail: Fix module unload leak. Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a 2019-09-06 08:18 +0000 [7298a785ad] Joshua Colp * func_jitterbuffer: Add audio/video sync support. This change adds support to the JITTERBUFFER dialplan function for audio and video synchronization. When enabled the RTCP SR report is used to produce an NTP timestamp for both the audio and video streams. Using this information the video frames are queued until their NTP timestamp is equal to or behind the NTP timestamp of the audio. The audio jitterbuffer acts as the leader deciding when to shrink/grow the jitterbuffer when adaptive is in use. For both adaptive and fixed the video buffer follows the size of the audio jitterbuffer. ASTERISK-28533 Change-Id: I3fd75160426465e6d46bb2e198c07b9d314a4492 2019-08-22 07:44 +0000 [c18983207d] Florian Floimair * core: Add H.265/HEVC passthrough support This change adds H.265/HEVC as a known codec and creates a cached "h265" media format for use. Note that RFC 7798 section 7.2 also describes additional SDP parameters. Handling of these is not yet supported. ASTERISK-28512 Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2 2019-09-14 10:05 +0000 [4072e219f7] Guido Falsi * chan_dahdi: Fix build with clang/llvm On FreeBSD using the clang/llvm compiler build fails to build due to the switch statement argument being a non integer type expression. Switch to an if/else if/else construct to sidestep the issue. ASTERISK-28536 #close Change-Id: Idf4a82cc1e94580a2d017fe9e351c226f23e20c8 2019-09-15 14:35 +0000 [c358da472e] Joshua Colp * chan_pjsip: Relock correct channel during "fax" redirect. When fax detection occurs on an outbound PJSIP channel the redirect operation will result in a masquerade occurring and the underlying channel on the session changing. The code incorrectly relocked the new channel instead of the old channel when returning. This resulted in the new channel being locked indefinitely. The code now always acts on the expected channel. ASTERISK-28538 Change-Id: I2b2e60d07e74383ae7e90d752c036c4b02d6b3a3 2019-08-28 05:07 +0000 [8979921da9] Boris P. Korzun * func_odbc: acf_odbc_read() and cli_odbc_read() unicode support Added ast_odbc_ast_str_SQLGetData() considers SQL_DESC_OCTET_LENGTH column attribute for correct allocating the buffer. ASTERISK-28497 #close Change-Id: I50e86c8a277996f13d4a4b9b318ece0d60b279bf 2019-09-03 12:20 +0000 [723b695ce5] Ben Ford * res_rtp_asterisk.c: Send RTCP as compound packets. According to RFC3550, ALL RTCP packets must be sent in a compond packet of at least two individual packets, including SR/RR and SDES. REMB, FIR, and NACK were not following this format, and as a result, would fail the packet check in ast_rtcp_interpret. This was found from writing unit tests for RTCP. The browser would accept the way we were constructing these RTCP packets, but when sending directly from one Asterisk instance to another, the above mentioned problem would occur. Change-Id: Ieb140e9c22568a251a564cd953dd22cd33244605 2019-09-11 15:58 +0000 [32ce6e9a06] Michael Goryainov * channels: Allow updating variable value When modifying an already defined variable in some channel drivers they add a new variable with the same name to the list, but that value is never used, only the first one found. Introduce ast_variable_list_replace() and use it where appropriate. ASTERISK-23756 #close Patches: setvar-multiplie.patch submitted by Michael Goryainov Change-Id: Ie1897a96c82b8945e752733612ee963686f32839 2019-08-27 17:44 +0000 [cf364cd007] sungtae kim * res_musiconhold: Added unregister realtime moh class This fix allows a realtime moh class to be unregistered from the command line. This is useful when the contents of a directory referenced by a realtime moh class have changed. The realtime moh class is then reloaded on the next request and uses the new directory contents. ASTERISK-17808 Change-Id: Ibc4c6834592257c4bb90601ee299682d15befbce 2019-08-28 14:25 +0000 [0e56643d9f] Ben Ford * res_rtp: Add unit tests for RTCP stats. Added unit tests for RTCP video stats. These tests include NACK, REMB, FIR/FUR/PLI, SR/RR/SDES, and packet loss statistics. The REMB and FIR tests are currently disabled due to a bug. We expect to receive a compound packet, but the code sends this out as a single packet, which the browser accepts, but makes Asterisk upset. While writing these tests, I noticed an issue with NACK as well. Where it is handling a received NACK request, it was reading in only the first 8 bits of following packets that were also lost. This has been changed to the correct value of 16 bits. Also made a minor fix to the data buffer unit test. Change-Id: I56107c7411003a247589bbb6086d25c54719901b 2019-09-05 11:09 +0000 [2d0eee5418] Frederic LE FOLL * ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf. ChanIsAvail() creates a temporary channel with ast_request() to test resource availability. It should not generate a CDR when it hangs up this temporary channel. This patch disables CDR generation for the temporary channel with ast_cdr_set_property(). ASTERISK-28527 Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1 2019-09-05 10:52 +0000 [41b67f150e] Frederic LE FOLL * chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up When the remote ISDN party ends an ISDN call on a PRI link (DISCONNECT), CHANNEL(hangupsource) information is not available. chan_dahdi already contains an ast_set_hangupsource() in __dahdi_exception() function but it seems that ISDN message processing does not use this part of code. Two other channel modules associate ast_queue_hangup() and ast_set_hangupsource() functions calls: - chan_pjsip in chan_pjsip_session_end() function, - chan_sip in sip_queue_hangup_cause() function. chan_iax2 separates them, in iax2_queue_hangup()/iax2_destroy() and set_hangup_source_and_cause(). Thus, I propose to add ast_set_hangupsource() beside ast_queue_hangup() in sig_pri_queue_hangup(), like chan_pjsip and chan_sip already do. ASTERISK-28525 Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c 2019-08-05 06:59 +0000 [2ae1a22e0e] George Joseph * ARI: External Media The Channel resource has a new sub-resource "externalMedia". This allows an application to create a channel for the sole purpose of exchanging media with an external server. Once created, this channel could be placed into a bridge with existing channels to allow the external server to inject audio into the bridge or receive audio from the bridge. See https://wiki.asterisk.org/wiki/display/AST/External+Media+and+ARI for more information. Change-Id: I9618899198880b4c650354581b50c0401b58bc46 2019-09-10 07:32 +0000 [5fb9b23105] George Joseph * chan_sip: Update links referenced in deprecation notice The links in the deprecation notice were the shortened variety but it makes better sense to show the unshortened links as they're more descriptive. I.E. wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip rather than wiki.asterisk.org/wiki/x/tAHOAQ Change-Id: If2da5d5243e2d4a6f193b15691d23e7e5a7c57a9 2019-09-08 10:38 +0000 [e4289b9e56] Sean Bright * codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary ASTERISK-28511 Change-Id: If0d58598ce14aad3c786a1c0127b5f7b200b737d 2019-08-26 07:53 +0000 [1e9714a050] Joshua Colp * AST-2019-005 - translate: Don't assume all frames will have a src. This change removes the assumption that a frame will always have a src set on it. This assumption is incorrect. Given a scenario where an RTP packet is received with no payload the resulting audio frame will have no samples. If this frame goes through a signed linear translation path an interpolated frame can be created (if generic packet loss concealment is enabled) that has minimal data on it, including no src. If this frame is given to a translation path a crash will occur due to the lack of src. ASTERISK-28499 Change-Id: I024d10dd98207eb8a6b35b59880bcdf1090538f8 2019-08-20 15:05 +0000 [18f5f5fc99] Alexei Gradinari (license 5691) * AST-2019-004 - res_pjsip_t38.c: Add NULL checks before using session media After receiving a 200 OK with a declined stream in response to a T.38 initiated re-invite Asterisk would crash when attempting to dereference a NULL session media object. This patch checks to make sure the session media object is not NULL before attempting to use it. ASTERISK-28495 patches: ast-2019-004.patch submitted by Alexei Gradinari (license 5691) Change-Id: I168f45f4da29cfe739acf87e597baa2aae7aa572 2019-09-04 16:19 +0000 [ed757cc7bb] Chris-Savinovich * test_utils.c: Skip test adsi_loaded_test if module not loaded. Module res_adsi.so is deprecated, therefore it does not load by default. Module not loaded causes it to yield a FAIL when tested by tests/test_utils.c. This fix checks if the corresponding module is loaded at the start of the test, and if not, it passes the test and exits with a message. This fix is applied to all versions where the module is marked deprecated. Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94 2019-08-27 06:10 +0000 [3863ab9af9] Igor Goncharovsky * chan_unistim: Fix clang warning: variable sized type not at end of a struct On reading information about initial client packet unistim use dirty implementation of destination ip address retrieval. This fix uses CMSG_*(..) to get ip address and make clang compile without warning. ASTERISK-25592 #close Reported-by: Alexander Traud Change-Id: Ic1fd34c2c2bcc951da65bf62e3f7a8adff8351b1 2019-08-23 17:03 +0000 [172e183b9d] Kevin Harwell * res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions res_pjsip_mwi allows both solicited and unsolicited MWI subscription types. While both can be set in the configuration for a given endpoint/aor, only one is allowed. Precedence is given to unsolicited. Meaning if an endpoint/aor is configured to allow both types then the solicited subscription is rejected when it comes in. However, there is a configuration option to override that behavior: mwi_subscribe_replaces_unsolicited When set to "yes" then when a solicited subscription comes in instead of rejecting it Asterisk is suppose to replace the unsolicited one if it exists. Prior to this patch there was a bug in Asterisk that allowed the solicted one to be added, but did not remove the unsolicited. As a matter of fact a new unsolicited subscription got added everytime a SIP register was received. Over time this eventually could "flood" a phone with SIP notifies. This patch fixes that behavior to now make it work as expected. If configured to do so a solicited subscription now properly replaces the unsolicited one. As well when an unsubscribe is received the unsolicited subscription is restored. Logic was also put in to handle reloads, and any configuration changes that might result from that. For instance, if a solicited subscription had previously replaced an unsolicited one, but after reload it was configured to not allow that then the solicited one needs to be shutdown, and the unsolicited one added. ASTERISK-28488 Change-Id: Iec2ec12d9431097e97ed5f37119963aee41af7b1 2019-08-27 00:49 +0000 [1d06a1efb3] Igor Goncharovsky * chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk Current implementation of ast_channel_tech send_digit_begin hook uses same function for tone playback as key press handler. This cause every incoming dtmf send back to asterisk. In case of two unistim phones connected to each other, it'll cause indefinite DTMF loop. Fix add separate function for dtmf tone phone play. Change-Id: I5795db468df552f0c89c7576b6b3858b26c4eab4 2019-08-16 06:01 +0000 [649003821e] Igor Goncharovsky * chan_unistim: Fix RTP port byte order for big-endian arch This patch fixes one-way oudio that users expirienced on big-endian architechtires. RTP port number bytes was stored in improper order and phone sent RTP to wrong RTP port. Reported-by: Andrey Ionov Change-Id: I9a9ca7f26e31a67bbbceff12923baa10dfb8a3be 2019-08-23 15:14 +0000 [b096389660] Sean Bright * codec_resample: Upgrade speex_resample to fix up-sampling bug ASTERISK-28511 #close Change-Id: Idd07bf341e89ac999c7f5701d9b72b8a9cb11e82 2019-08-22 13:19 +0000 [3ef52b0b17] Alexei Gradinari * Fix misname 'res_external_mwi' to 'res_mwi_external' in comments. Change-Id: Ic784be8500e5cb75dcb34bae9f03cfd93b6b34fb 2019-08-21 13:29 +0000 [19045db392] George Joseph * chan_rtp: Accept hostname as well as ip address as destination The UnicastRTP channel driver provided by chan_rtp now accepts ":" as an alternative to ":" in the destination. The first AAAA (preferred) or A record resolved will be used as the destination. The lookup is synchronous so beware of possible dialplan delays if you specify a hostname. Change-Id: Ie6f95b983a8792bf0dacc64c7953a41032dba677 2019-08-21 12:03 +0000 [9e015713cc] George Joseph * dns_core: Create new API ast_dns_resolve_ipv6_and_ipv4 The new function takes in a pointer to an ast_sockaddr structure, a hostname and an optional port and then dispatches parallel "AAAA" and "A" record queries. If an "AAAA" record is returned, it's parsed into the ast_sockaddr structure along with the port if it was supplied. If no "AAAA" record was returned, the first "A" record returned (if any) is parsed instead. This is a synchronous call. If you need asynchronous lookups, use ast_dns_query_set_resolve_async and roll your own. Change-Id: I194b0b0e73da94b35cc35263a868ffac3a8d0a95 2019-08-21 10:58 +0000 [0844d6b127] Dan Cropp * pjproject: Configurable setting for cnonce to include hyphens or not NEC SIP Station interface with authenticated registration only supports cnonce up to 32 characters. In Linux, PJSIP would generate 36 character cnonce which included hyphens. Teluu developed this patch adding a compile time setting to default to not include the hyphens. They felt it best to still generate the UUID and strip the hyphens. They have indicated it will be part of PJSIP 2.10. ASTERISK-28509 Reported-by: Dan Cropp Change-Id: Ibdfcf845d4f8c0a14df09fd983b11f2d72c5f470 2019-08-20 13:04 +0000 [8da4e28a81] George Joseph * res_ari.c: Prefer exact handler match over wildcard Given the following request path and 2 handler paths... Request: /channels/externalMedia Handler: /channels/{channelId} "wildcard" Handler: /channels/externalmedia "non-wildcard" ...if /channels/externalMedia was registered as a handler after /channels/{channelId} as shown above, the request would automatically match the wildcard handler and attempt to parse "externalMedia" into the channelId variable which isn't what was intended. It'd work if the non-wildard entry was defined in rest-api/api-docs/channels.json before the wildcard entry but that makes the json files order-dependent which isn't a good thing. To combat this issue, the search loop saves any wildcard match but continues looking for exact matches at the same level. If it finds one, it's used. If it hasn't found an exact match at the end of the current level, the wildcard is used. Regardless, after searching the current level, the wildcard is cleared so it won't accidentally match for a different object or a higher level. BTW, it's currently not possible for more than 1 wildcard entry to be defined for a level. For instance, there couldn't be: Handler: /channels/{channelId} Handler: /channels/{channelName} We wouldn't know which one to match. Change-Id: I574aa3cbe4249c92c30f74b9b40e750e9002f925 2019-08-09 15:53 +0000 [64906c4c9b] Sean Bright * audiohook.c: Substitute silence for unavailable audio frames There are 4 scenarios to consider when capturing audio from a channel with an audiohook: 1. There is no rx and no tx audio, so return nothing. 2. There is rx but no tx audio, so return rx. 3. There is tx but no rx audio, so return tx. 4. There is rx and tx audio, so mix them and return. The file passed as the primary argument to MixMonitor will be written to in scenarios 2, 3, and 4. However, if you pass the r() and t() options to MixMonitor, a frame will only be written to the r() file if there was rx audio and a frame will only be written to the t() file if there was tx audio. If you subsequently take the r() and t() files and try to mix them, the sides of the conversation will 'drift' and be non-representative of the user experience. This patch adds a new 'S' option to MixMonitor that injects a frame of silence on either the r() side or the t() side of the channel so that when later mixed, there is no such drift. Change-Id: Ibf5ed73a811087727bd561a89a59f4447b4ee20e 2019-07-30 12:08 +0000 [c7270dca81] Stas Kobzar * res_pjsip: Channel variable SIPFROMDOMAIN In chan_sip, there was variable SIPFROMDOMAIN that allows to set From header URI domain per channel. This patch introduces res_pjsip variable SIPFROMDOMAIN for backward compatibility with chan_sip. ASTERISK-28489 Change-Id: I715133e43172ce2a1e82093538dc39f9e99e5f2e 2019-08-14 14:52 +0000 [15624d9a7a] Alexei Gradinari * app_voicemail/IMAP: check mailstream not NULL in leave_voicemail The function leave_voicemail checks if expungeonhangup is set, but does not check if IMAP stream is closed, so it could call imap function with NULL stream. This leads to segfault. ASTERISK-28505 #close Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c 2019-08-09 05:51 +0000 [e40f248fac] Sean Bright * menuselect: Fix curses build on Gentoo Linux Because keypad() is exported by libtinfo, it needs to be explicitly added to the linker options. ASTERISK-28487 #close Change-Id: I6c2ad5b95f422c263d078b5c0e84c111807dffc6 2019-08-08 12:10 +0000 [446bac733d] George Joseph * CI: Escape backslashes in printenv/sort/tr Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94 (cherry picked from commit c6558e09af3ac15b31377de735cc96d8df0275a7) 2019-08-07 17:54 +0000 [b805e1237d] Kevin Harwell * srtp: Fix possible race condition, and add NULL checks Somehow it's possible for the srtp session object to be NULL even though the Asterisk srtp object itself is valid. When this happened it would cause a crash down in the srtp code when attempting to protect or unprotect data. After looking at the code there is at least one spot that makes this situation possible. If Asterisk fails to unprotect the data, and after several retries it still can't then the srtp->session gets freed, and set to NULL while still leaving the Asterisk srtp object around. However, according to the original issue reporter this does not appear to be their situation since they found no errors logged stating the above happened (which Asterisk does for that situation). An issue was found however, where a possible race condition could occur between the pjsip incoming negotiation, and the receiving of RTP packets. Both places could attempt to create/setup srtp for the same rtp instance at the same time. This potentially could be the cause of the problem as well. Given the above this patch adds locking around srtp setup for a given rtp, or rtcp instance. NULL checks for the session have also been added within the protect and unprotect functions as a precaution. These checks should at least stop Asterisk from crashing if it gets in this situation again. This patch also fixes one other issue noticed during investigation. When doing a replace the old object was freed before creating the replacement. If the new replacement object failed to create then the rtp/rtcp instance would now point to freed srtp data which could potentially cause a crash as well when the next attempt to reference it was made. This is now fixed so the old srtp object is kept upon replacement failure. Lastly, more logging has been added to help diagnose future issues. ASTERISK-28472 Change-Id: I240e11cbb1e9ea8083d59d50db069891228fe5cc 2019-08-08 07:12 +0000 [be6130607d] George Joseph * CI: Add "throttle" label and "skip_gate" capability To make throttling by label fully active, the "throttle" option has to be specified with a specific label. You can now specify "skip_gate" in the Gerrit comments when you do a +2 code review to tell Jenkins not to actually run the gate. You'd do this if you plan to manually merge the change. Also updated the "printenv" debug output to better sort multi-line comments. Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2 2019-08-05 07:23 +0000 [261646c1c4] Joshua Colp * cdr / cel: Use event time at event creation instead of processing. When updating times on CDR or CEL records using the time at which it is done can result in times being incorrect if the system is heavily loaded and stasis message processing is delayed. This change instead makes it so CDR and CEL use the time at which the stasis messages that drive the systems are created. This allows them to be backed up while still producing correct records. ASTERISK-28498 Change-Id: I6829227e67aefa318efe5e183a94d4a1b4e8500a 2019-08-06 10:40 +0000 [c01dd2a41a] George Joseph * CI: Make node labels job-specific Originally, the eligible nodes for a job were labelled only by "swdev-docker". So basically any node could run any job. We had found that allowing a node to run more than 1 gate at a time was problematic so we limited the nodes to processing 1 job at a time. With the creation of the Asterisk 17 branches however, we now have so many active branches that getting checks and gates through in a timely manner is problematic when a node can run only 1 job at a time. Now the nodes are also labelled by the job type they can run. For instance: "asterisk-check", "asterisk-gate", etc. With the "Throttle Concurrent Builds" plugin, we can now allow a node to run more than 1 job BUT throttle by job type. For instance: Allow 2 jobs but only 1 asterisk-gate at a time. Now a node can run 2 checks or 1 check and 1 gate or 1 gate but not 2 gates at a time. Change-Id: I2032bf6afbcec5c341d9b852214c0c812d3d6db5 2019-08-06 08:20 +0000 [9d07d5a6d6] Sean Bright * app_voicemail: Remove extra menuselect build options You now select voicemail backends like normal dialplan applications, so there is no longer a need for their own menuselect category. Reported by snuff-work in #asterisk-dev Change-Id: Idfa4c9c8349726074318a9e6b68d24c374521005 2019-08-01 16:22 +0000 [3656c42cb0] Kevin Harwell * various modules: json integer overflow There were still a few places in the code that could overflow when "packing" a json object with a value outside the base type integer's range. For instance: unsigned int value = INT_MAX + 1 ast_json_pack("{s: i}", value); would result in a negative number being "packed". In those situations this patch alters those values to a ast_json_int_t, which widens the value up to a long or long long. ASTERISK-28480 Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1 2019-07-29 10:15 +0000 [1f8ae708a0] Sean Bright * res_musiconhold: Use a vector instead of custom array allocation Change-Id: Ic476a56608b1820ca93dcf68d10cd76fc0b94141 2019-08-01 05:07 +0000 [86452c9fa4] Joshua Colp * res_pjsip: Fix multiple of the same contact in "pjsip show contacts". The code for gathering contacts could result in the same contact being retrieved and added to the list multiple times. The container which stores the contacts to display will now only allow a contact to be added to it once instead of multiple times. ASTERISK-28228 Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df 2019-07-17 07:35 +0000 [084901d548] Torrey Searle * main/udptl.c: correctly handle udptl sequence wrap around incorrect handling of UDPTL squence number wrap arounds causes loss of packets every time the wrap around occurs ASTERISK-28483 #close Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234 2019-07-24 15:12 +0000 [5f66fb5139] Sean Bright * manager: Send fewer packets The functions that build manager message headers do so in a way that results in a single messages being split across multiple packets. While this doesn't matter to the remote end, it makes network captures noisier and harder to follow, and also means additional system calls. With this patch, we build up more of the message content into the TLS buffer before flushing to the network. This change is completely internal to the manager code and does not affect any of the existing API's consumers. Change-Id: I50128b0769060ca5272dbbb5e60242d131eaddf9 2019-07-29 11:38 +0000 [5e6e1175d5] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 17.0.0 2019-07-26 13:03 +0000 [8d10028b98] George Joseph * Update master for Asterisk 18 Change-Id: I8b8ed97001446fab0c14d7c89391ee572fb29dd6 2019-07-29 10:04 +0000 [7ce9ee7f2e] Sean Bright * res_musiconhold: Use ast_pipe_nonblock() wrapper Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2 2019-07-29 08:31 +0000 [8e44d823c1] George Joseph * loader.c: Fix possible SEGV when a module fails to register When a module fails to register itself (usually a coding error in the module), dlerror() can return NULL. We weren't checking for that in load_dlopen() before trying to strdup the error message so a SEGV was thrown. dlerror() is now surrounded with an S_OR so we don't SEGV. Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956 2019-08-28 15:58 +0000 Asterisk Development Team * asterisk 17.0.0-rc1 Released. 2019-08-22 13:19 +0000 [c961d3d9ad] Alexei Gradinari * Fix misname 'res_external_mwi' to 'res_mwi_external' in comments. Change-Id: Ic784be8500e5cb75dcb34bae9f03cfd93b6b34fb 2019-08-21 10:58 +0000 [64a2eeef89] Dan Cropp * pjproject: Configurable setting for cnonce to include hyphens or not NEC SIP Station interface with authenticated registration only supports cnonce up to 32 characters. In Linux, PJSIP would generate 36 character cnonce which included hyphens. Teluu developed this patch adding a compile time setting to default to not include the hyphens. They felt it best to still generate the UUID and strip the hyphens. They have indicated it will be part of PJSIP 2.10. ASTERISK-28509 Reported-by: Dan Cropp Change-Id: Ibdfcf845d4f8c0a14df09fd983b11f2d72c5f470 2019-08-20 13:04 +0000 [fe6551f69b] George Joseph * res_ari.c: Prefer exact handler match over wildcard Given the following request path and 2 handler paths... Request: /channels/externalMedia Handler: /channels/{channelId} "wildcard" Handler: /channels/externalmedia "non-wildcard" ...if /channels/externalMedia was registered as a handler after /channels/{channelId} as shown above, the request would automatically match the wildcard handler and attempt to parse "externalMedia" into the channelId variable which isn't what was intended. It'd work if the non-wildard entry was defined in rest-api/api-docs/channels.json before the wildcard entry but that makes the json files order-dependent which isn't a good thing. To combat this issue, the search loop saves any wildcard match but continues looking for exact matches at the same level. If it finds one, it's used. If it hasn't found an exact match at the end of the current level, the wildcard is used. Regardless, after searching the current level, the wildcard is cleared so it won't accidentally match for a different object or a higher level. BTW, it's currently not possible for more than 1 wildcard entry to be defined for a level. For instance, there couldn't be: Handler: /channels/{channelId} Handler: /channels/{channelName} We wouldn't know which one to match. Change-Id: I574aa3cbe4249c92c30f74b9b40e750e9002f925 2019-08-14 14:52 +0000 [7591e0f3a4] Alexei Gradinari * app_voicemail/IMAP: check mailstream not NULL in leave_voicemail The function leave_voicemail checks if expungeonhangup is set, but does not check if IMAP stream is closed, so it could call imap function with NULL stream. This leads to segfault. ASTERISK-28505 #close Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c 2019-08-09 05:51 +0000 [fa7883c492] Sean Bright * menuselect: Fix curses build on Gentoo Linux Because keypad() is exported by libtinfo, it needs to be explicitly added to the linker options. ASTERISK-28487 #close Change-Id: I6c2ad5b95f422c263d078b5c0e84c111807dffc6 2019-08-07 17:54 +0000 [a92f9f595b] Kevin Harwell * srtp: Fix possible race condition, and add NULL checks Somehow it's possible for the srtp session object to be NULL even though the Asterisk srtp object itself is valid. When this happened it would cause a crash down in the srtp code when attempting to protect or unprotect data. After looking at the code there is at least one spot that makes this situation possible. If Asterisk fails to unprotect the data, and after several retries it still can't then the srtp->session gets freed, and set to NULL while still leaving the Asterisk srtp object around. However, according to the original issue reporter this does not appear to be their situation since they found no errors logged stating the above happened (which Asterisk does for that situation). An issue was found however, where a possible race condition could occur between the pjsip incoming negotiation, and the receiving of RTP packets. Both places could attempt to create/setup srtp for the same rtp instance at the same time. This potentially could be the cause of the problem as well. Given the above this patch adds locking around srtp setup for a given rtp, or rtcp instance. NULL checks for the session have also been added within the protect and unprotect functions as a precaution. These checks should at least stop Asterisk from crashing if it gets in this situation again. This patch also fixes one other issue noticed during investigation. When doing a replace the old object was freed before creating the replacement. If the new replacement object failed to create then the rtp/rtcp instance would now point to freed srtp data which could potentially cause a crash as well when the next attempt to reference it was made. This is now fixed so the old srtp object is kept upon replacement failure. Lastly, more logging has been added to help diagnose future issues. ASTERISK-28472 Change-Id: I240e11cbb1e9ea8083d59d50db069891228fe5cc 2019-08-08 12:10 +0000 [b083537d84] George Joseph * CI: Escape backslashes in printenv/sort/tr Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94 (cherry picked from commit c6558e09af3ac15b31377de735cc96d8df0275a7) 2019-08-08 07:12 +0000 [c4b6e3c1af] George Joseph * CI: Add "throttle" label and "skip_gate" capability To make throttling by label fully active, the "throttle" option has to be specified with a specific label. You can now specify "skip_gate" in the Gerrit comments when you do a +2 code review to tell Jenkins not to actually run the gate. You'd do this if you plan to manually merge the change. Also updated the "printenv" debug output to better sort multi-line comments. Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2 2019-08-05 07:23 +0000 [37a49cc6d3] Joshua Colp * cdr / cel: Use event time at event creation instead of processing. When updating times on CDR or CEL records using the time at which it is done can result in times being incorrect if the system is heavily loaded and stasis message processing is delayed. This change instead makes it so CDR and CEL use the time at which the stasis messages that drive the systems are created. This allows them to be backed up while still producing correct records. ASTERISK-28498 Change-Id: I6829227e67aefa318efe5e183a94d4a1b4e8500a 2019-08-06 10:40 +0000 [6d610a6b56] George Joseph * CI: Make node labels job-specific Originally, the eligible nodes for a job were labelled only by "swdev-docker". So basically any node could run any job. We had found that allowing a node to run more than 1 gate at a time was problematic so we limited the nodes to processing 1 job at a time. With the creation of the Asterisk 17 branches however, we now have so many active branches that getting checks and gates through in a timely manner is problematic when a node can run only 1 job at a time. Now the nodes are also labelled by the job type they can run. For instance: "asterisk-check", "asterisk-gate", etc. With the "Throttle Concurrent Builds" plugin, we can now allow a node to run more than 1 job BUT throttle by job type. For instance: Allow 2 jobs but only 1 asterisk-gate at a time. Now a node can run 2 checks or 1 check and 1 gate or 1 gate but not 2 gates at a time. Change-Id: I2032bf6afbcec5c341d9b852214c0c812d3d6db5 2019-08-01 16:22 +0000 [66b607db88] Kevin Harwell * various modules: json integer overflow There were still a few places in the code that could overflow when "packing" a json object with a value outside the base type integer's range. For instance: unsigned int value = INT_MAX + 1 ast_json_pack("{s: i}", value); would result in a negative number being "packed". In those situations this patch alters those values to a ast_json_int_t, which widens the value up to a long or long long. ASTERISK-28480 Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1 2019-08-06 08:20 +0000 [40e3bdc50c] Sean Bright * app_voicemail: Remove extra menuselect build options You now select voicemail backends like normal dialplan applications, so there is no longer a need for their own menuselect category. Reported by snuff-work in #asterisk-dev Change-Id: Idfa4c9c8349726074318a9e6b68d24c374521005 2019-08-01 05:07 +0000 [02826c20f5] Joshua Colp * res_pjsip: Fix multiple of the same contact in "pjsip show contacts". The code for gathering contacts could result in the same contact being retrieved and added to the list multiple times. The container which stores the contacts to display will now only allow a contact to be added to it once instead of multiple times. ASTERISK-28228 Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df 2019-07-17 07:35 +0000 [6af55244a7] Torrey Searle * main/udptl.c: correctly handle udptl sequence wrap around incorrect handling of UDPTL squence number wrap arounds causes loss of packets every time the wrap around occurs ASTERISK-28483 #close Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234 2019-07-29 11:46 +0000 [8b3fd0f564] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 17.0.0 2019-07-29 11:10 +0000 [7b3a612d69] George Joseph * doc: Add "master-only" flag back to the CHANGES and UPGRADE files In order to run the documentation scripts the flags needs to be added back to the staging files. Change-Id: Ia10a153c50c970cfa1e85815208dfaddb3f2ccd4 2019-07-29 08:31 +0000 [2938679ff2] George Joseph * loader.c: Fix possible SEGV when a module fails to register When a module fails to register itself (usually a coding error in the module), dlerror() can return NULL. We weren't checking for that in load_dlopen() before trying to strdup the error message so a SEGV was thrown. dlerror() is now surrounded with an S_OR so we don't SEGV. Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956 2019-07-26 13:06 +0000 [80d8dce6af] George Joseph * Prepare Asterisk 17 Branch Change-Id: Idb79a69646d2511e7bf1573b9b0322cc22ea54e8 2019-07-24 15:15 +0000 [03813e51f0] George Joseph * CI: Don't enable non-core modules in Certified branches We don't support non-core modules for Certified releases but we were enabling them for CI builds which was causing lots of test failures. Now we don't. Change-Id: I0b3254c08a2479f3d39151690350cce5ce5ad766 2019-07-23 12:58 +0000 [2424ecaf66] Sean Bright * res_config_sqlite3: Only join threads that we started ASTERISK-28477 #close Reported by: Dennis ASTERISK-28478 #close Reported by: Dennis Change-Id: I77347ad46a86dc5b35ed68270cee56acefb4f475 2019-05-12 13:29 +0000 [098797628e] Leonid Fainshtein * openr2(6/6): Set hangup cause Change-Id: I94dc38920e6e77cc73062648f62fdd613d0d1452 Signed-off-by: Oron Peled 2019-04-22 14:14 +0000 [f67094503d] Tzafrir Cohen * openr2(5/6): added cli command -- mfcr2 destroy link Change-Id: I452d6a853bcd8c6e194455b19e5e017713e9c0fe Signed-off-by: Oron Peled 2019-04-22 10:27 +0000 [64bf3e3e82] Tzafrir Cohen * openr2(4/6): added new cli command -- mfcr2 show links * This command show the MFC/R2 links Change-Id: I213822e1b7ef9c05bd89a2ba62df8e0856ce9f84 Signed-off-by: Oron Peled 2019-04-22 07:27 +0000 [f61adf2cf5] Tzafrir Cohen * openr2(3/6): Convert r2links to standard Asterisk AST_LIST* Change-Id: Ibcb2401515a58782a1488c0b9efbed201c3f3a17 Signed-off-by: Oron Peled 2019-04-22 07:33 +0000 [97d2549bb1] Tzafrir Cohen * openr2(2/6): Stop polling channels when DAHDI returns -ENODEV (e.g: plug-out) Otherwise, OpenR2 threads go crazy and consume almost all CPU resources Change-Id: I10a41f617613fe7399c5bdced5c64a2751173f28 Signed-off-by: Oron Peled 2019-04-22 10:02 +0000 [2f0a8e12f9] Tzafrir Cohen * openr2(1/6): bugfix in configuration saving Details: - The memcpy() call copied part of "dahdi_conf" and not "dahdi_conf.mfcr2" - As a result, the memcmp() in dahdi_r2_get_link() always fails - This cause dahdi_r2_get_link() to create new link for every channel (instead of a new link for every ~30 channels) - With the fix, far less links are generated -- so we use far less threads Change-Id: I7259dd6272f5e46e8a6c7f5bf3e8c2ec01b8c132 Signed-off-by: Oron Peled 2019-07-22 10:43 +0000 [4304c6534a] Walter Doekes * contrib/scripts: Make spandspflow2pcap.py Python 2.7+/3.3+ compatible Change-Id: Ica182a891743017ff3cda16de3d95335fffd9a91 2019-07-19 11:20 +0000 [be8d41bd24] George Joseph * CI: Add cleanWs to cleanup steps in jenkinsfiles We're at the point where there are enough Jenkins jobs for Asterisk branches than even cleaned checkouts of Asterisk will add up to more disk space than is available on the in-memory workspace mount. Since we archive all relevent artifacts anyway, there's no need to keep the workspace around after the job finishes, whether it succeeds or fails. Change-Id: I1cd3b73ebb045a987df0f62526d152a510210c39 2019-07-19 08:38 +0000 [8b88994b18] George Joseph * CI: Add install-headers to the install make targets The testsuite actually needs the headers installed to run it's self_test. Change-Id: Ice41d331131b876ad4a9c056085fe6aac34b32b2 2019-07-17 08:06 +0000 [3c6f11992b] Walter Doekes * sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread When fixing ASTERISK~24212, a change was done so a scheduled callback could not be removed while it was running. The caller of ast_sched_del would have to wait. However, when the caller of ast_sched_del is the callback itself (however wrong this might be), this new check would cause a deadlock: it would wait forever for itself. This changeset introduces an additional check: if ast_sched_del is called by the callback itself, it is immediately rejected (along with an ERROR log and a backtrace). Additionally, the AST_SCHED_DEL_UNREF macro is adjusted so the after-ast_sched_del-refcall function is only run if ast_sched_del returned success. This should fix the following spurious race condition found in chan_sip: - thread 1: schedule sip_poke_peer_now (using AST_SCHED_REPLACE) - thread 2: run sip_poke_peer_now - thread 2: blank out sched-ID (too soon!) - thread 1: set sched-ID (too late!) - thread 2: try to delete the currently running sched-ID After this fix, an ERROR would be logged, but no deadlocks (in do_monitor) nor excess calls to sip_unref_peer(peer) (causing double frees of rtp_instances and other madness) should occur. (Thanks Richard Mudgett for reviewing/improving this "scary" change.) Note that this change does not fix the observed race condition: unlocked access to peer->pokeexpire (and potentially other scheduled items in chan_sip), causing AST_SCHED_DEL_UNREF to look at a changing id. But it will make the deadlock go away. And in the observed case, it will not have adverse affects (like memory leaks) because the scheduled item is removed through a different path. ASTERISK-28282 Change-Id: Ic26777fa0732725e6ca7010df17af77a012aa856 2019-07-16 07:55 +0000 [c781806e26] George Joseph * Build: Separate header install/uninstall Asterisk headers are no longer installed and uninstalled automatically when performing a "make install" or a "make uninstall". To install/uninstall the headers, use "make install-headers" and "make uninstall-headers". The headers also continue to be uninstalled when performing a "make uninstall-all". Also corrects an issue where /usr/include/asterisk.h was never being removed at all. Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643 2019-07-09 14:42 +0000 [ba25038fd5] Kevin Harwell * manager: Log AMI actions When manager debugging is turned on, this patch makes it so incoming AMI actions are now also logged. Change-Id: I8047524510e7ac97d99482b2448f8e368f29cd47 2019-07-14 13:26 +0000 [2feac1d361] Joshua Colp * res_rtp_asterisk: Move where DTLS MTU variable is defined. The DTLS MTU variable is not dependent on pjproject and should not exist in its block. Change-Id: I7e97d64dc192f2ac81bfe2b72b8229d321c7d026 2019-06-12 13:03 +0000 [3c520147e1] George Joseph * res_pjsip_messaging: Check for body in in-dialog message We now check that a body exists and it has a length > 0 before attempting to process it. ASTERISK-28447 Reported-by: Gil Richard Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f 2019-06-28 11:15 +0000 [8438d19b81] Francesco Castellano * chan_sip: Handle invalid SDP answer to T.38 re-invite The chan_sip module performs a T.38 re-invite using a single media stream of udptl, and expects the SDP answer to be the same. If an SDP answer is received instead that contains an additional media stream with no joint codec a crash will occur as the code assumes that at least one joint codec will exist in this scenario. This change removes this assumption. ASTERISK-28465 Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87 2019-06-12 13:49 +0000 [c93c579190] Kevin Harwell * app_voicemail: Remove dependency on the stasis cache app_voicemail utilized the stasis cache when polling mailboxes for MWI. This caused a memory leak (items were not being appropriately removed from the cache), and subsequent slowdown in system processing. This patch removes the stasis cache dependency, thus alleviating the memory leak. It does this by utilizing the new MWI API that better manages state lifetime. ASTERISK-28443 ASTERISK-27121 Change-Id: Ie89fedaca81ea1fd03d150d9d3a1ef3d53740e46 2019-06-12 13:11 +0000 [9637e1dfdc] Kevin Harwell * MWI: Update modules that subscribe to MWI to use new API calls The MWI core recently got some new API calls that make tracking MWI state lifetime more reliable. This patch updates those modules that subscribe to specific MWI topics to use the new API. Specifically, these modules now subscribe to both MWI topics and MWI state. ASTERISK-28442 Change-Id: I32bef880b647246823dbccdf44a98d384fcabfbd 2019-06-11 14:12 +0000 [b31ac83900] Kevin Harwell * mwi: Update the MWI core to use stasis_state API ** Note ** This patch is meant to be the minimum needed in order for the MWI core to use the now underlying stasis_state module. As such it does not completely remove its reliance on the stasis_cache. Doing so has allowed current consumers to not have to change, and update those code paths for this patch. When time allows, subsequent patches can/will be made to those consumers to take advantage of some of the new MWI API included here. Thus, eventually and ultimately removing MWI dependency on the stasis_cache. ** End Note ** This patch makes it so the MWI core now takes advantage of the new stasis_state API. Consumers of MWI should no longer need to depend upon stasis topic pooling, and the stasis cache directly. Similar functionality and implementation details have now been pushed into the stasis_state module. However, all MWI state should be accessed via the MWI API itself. As such a few new methods, and constructs have been added to the MWI core that facilitate consumer publishing, subscribing, and iterating over MWI state data. * ast_mwi_subscriber * Created via ast_mwi_add_subscriber, a subscriber subscribes to a given mailbox in order to receive updates about the given mailbox. Adding a subscriber will create the underlying topic, and associated state data if those do not already exist for it. The topic, and last known state data is guaranteed to exist for the lifetime of the subscriber. * ast_mwi_publisher * Before publishing to a particular topic a publisher should be created. This can be achieved by using ast_mwi_add_publisher. Publishing to a mailbox should then be done using one of the MWI publish functions. This ensures the message is published to the appropriate topic, and the last known state is maintained. * ast_mwi_observer * Add an observer in order to watch for particular MWI module related events. For instance if a submodule needs to know when a subscription is added to any mailbox an observer can be added to watch for that. * other * Urgent message count is now part of the published MWI state object. Also state can be iterated over using defined callbacks. ASTERISK-28442 Change-Id: I93f935f9090cd5ddff6d4bc80ff90703c05cf776 2019-07-08 18:10 +0000 [83c6ebbae8] Kevin Harwell * stasis_state: Make unsubscribes NULL tolerant Regular stasis unsubscribes can handle NULL subscription objects. This patch makes it so stasis state unsubscribes handles NULL's as well. ASTERISK-28442 Change-Id: Ic3648e8df043a85b77cff085e9ff10356028e479 2019-07-04 19:46 +0000 [64a908f897] Rodrigo Ramírez Norambuena * README.md: Update year Change-Id: I746fb94d112c7d797e206bca0fd1e13fcd26bae3 2019-07-01 16:57 +0000 [0e669712e2] Chris-Savinovich * chan_dahdi.c: crash in chan_dahdi Fixes a crash in chan_dahdi occurring on 32-bit systems. A previous patch introduced a variable of type unassigned long long which is 64-bits. Casting it as 'ast_json_int_t' along with JSON type 'I' makes it work with 32-bit systems. ASTERISK-28457 Change-Id: I9cef6b5f2d826fc5c93f2f6a1c997c4e3e6c93fe 2019-07-01 10:49 +0000 [93936e367d] Kevin Harwell * res_pjsip_sdp_rtp: Remove unused variable The variable 'endpoint_caps' in function 'set_caps' is not used, so remove. ASTERISK-28458 Change-Id: Ia8766d05a0738aecb29dd018302c2dafca5cab34 2019-06-11 12:30 +0000 [363bafc29e] Kevin Harwell * stasis_state: Add new stasis_state module This new module describes an API that can be thought of as a combination of stasis topic pools, and caching. Except, hopefully done in a more efficient and less memory "leaky" manner. The API defines methods, and data structures for managing, and tracking published message state through stasis. By adding a subscriber or publisher, consumers can more easily track the lifetime of the contained state. For instance, when no more publishers and/or subscribers have need of the topic, and associated state its data is removed from the managed container. * stasis_state_manager * The manager stores and well, manages state data. Each state is an association of a unique stasis topic, and the last known published stasis message on that topic. There is only ever one managed state object per topic. For each topic all messages are forwarded to an "all" topic also maintained by the manager. * stasis_state_subscriber * Topic and state can be created, or referenced within the manager by adding a stasis_state_subscriber. When adding a subscriber if no state currently exists new managed state is immediately created. If managed state already exists then a new subscriber is created referencing that state. The managed state is guaranteed to live throughout the subscriber's lifetime. State is only removed from the manager when no other entities require it. * stasis_state_publisher * Topic and state can be created, or referenced within the manager by also adding a stasis_state_publisher. When adding a publisher if no state currently exists new managed state is created. If managed state already exists then a new publisher is created referencing that state. The managed state is guaranteed to live throughout the publisher's lifetime. State is only removed from the manager when no other entities require it. * stasis_state_observer * Some modules may wish to watch for, and react to managed state events. By registering a state observer, and implementing handlers for the desired callbacks those modules can do so. * other * Callbacks also exist that allow consumers to iterate over all, or some of the managed state. ASTERISK-28442 Change-Id: I7a4a06685a96e511da9f5bd23f9601642d7bd8e5 2019-06-27 13:50 +0000 [6b1f6ea2c4] Chris-Savinovich * app_voicemail.c: Build all three variants for app_voicemail at the same time Changes made to apps/Makefile to optionally build all three app_voicemail variations at the same time: 1) file (default), 2) odbc, and 3) imap. This functionality was requested by users. modules.conf.sample warns the user to make sure only one voicemail is loaded at a time. Change-Id: Iba3cd8ffb4b7e8b1c64a11dd383e1eafcd3ed0e7 2019-06-27 15:04 +0000 [c2ffb004aa] George Joseph * tcptls.c: Add peer hostname and port to some error messages Where possble, hostname and port has been added to error messages, mostly on the server side. ASTERISK-26006 Reported by: Oleksandr Natalenko Change-Id: Iff4f897277bc36ce8c5b493b71d0a4a7b74e62f0 2019-06-27 12:46 +0000 [8b3ee7fe61] George Joseph * pjproject_bundled: Add peer information to most SSL/TLS errors Most SSL/TLS error messages coming from pjproject now have either the peer address:port or peer hostname, depending on what was available at the time and code location where the error was generated. ASTERISK-28444 Reported by: Bernhard Schmidt Change-Id: I41770e8a1ea5e96f6e16b236692c4269ce1ba91e 2019-04-15 18:26 +0000 [613a335de5] sungtae kim * res/ari/resource_channels.c: Added hangup reason code for channels Currently, DELETE /ari/channels/ supports only few hangup reasons. It's good enough for simple use, but when it needs to set the detail reason, it comes challenges. Added reason_code query parameter for that. ASTERISK-28385 Change-Id: I1cf1d991ffd759d0591b347445a55f416ddc3ff2 2019-04-02 14:42 +0000 [e52fbae00f] Dan Cropp * chan_pjsip: Transmit REFER waits for the REFER result setting TRANSFERSTATUS Previously, when a Transfer (REFER) was performed, chan_pjsip would set the TRANSFERSTATUS to SUCCESS when the REFER was queued up. This did not reflect a successful/unsuccessful transfer the way chan_sip did. Added a callback module to process the refer subscription information. Now depends on res_pjsip_pubsub so call transfer progress can be monitored and reported ASTERISK-26968 #close Reported-by: Dan Cropp Change-Id: If6c27c757c66f71e8b75e3fe49da53ebe62395dc 2019-06-24 08:30 +0000 [13e89d372b] George Joseph * sig_pri: Address gcc9 issues A few more format truncation issues addressed. Change-Id: I047f373169caaca0eec4889d3c0e5e10f130017a 2019-05-21 01:38 +0000 [29bc7cf6b3] Nasir Iqbal * app_amd: issue with silence suppression fixed Now AMD algorithm will not ignore AST_FRAME_NULL, As I think using manual wait time instead of `framelength` is enough to fix timeout / TOOLONG issue. ASTERISK-28419 #close Change-Id: I16ea2d6295bc99b975e8c092e5f9fbd9214debdb 2019-05-29 17:54 +0000 [f414ca069c] Alexei Gradinari * res_fax: gateway sends T.38 request to both endpoints if V.21 detected According T.38 Gateway 'Use case 3' https://wiki.asterisk.org/wiki/display/AST/T.38+Gateway T.38 Gateway should send T.38 negotiation request to called endpoint if FAX preamble (using V.21 detector) generated by called endpoint. But it does not, because fax_gateway_detect_v21 constructs T.38 negotiation request, but forwards it only to other channel, not to the channel on which FAX preamble is detected. Some SIP endpoints could be improperly configured to rely on the other side to initiate T.38 re-INVITEs. With this patch the T.38 Gateway tries to negotiate with both sides by sending T.38 negotiation request to both endpoints supported T.38. Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39 2019-06-19 11:58 +0000 [0ba52ce3cf] George Joseph * CI: New way to determnine libdir We were using the presence of /usr/lib64 to determine where shared libraries should be installed. This only existed on Redhat based systems and was safe. If it existed, use it, otherwise use /usr/lib. Unfortunately, Ubuntu 19 decided to create a /usr/lib64 BUT NOT INCLUDE IT IN THE DEFAULT ld.so.conf. So if anything is installed there, it won't work. The new method, just looks for $ID in /etc/os-release and if it's centos or fedora, uses /usr/lib64 and if ubuntu, uses /usr/lib. NOTE: This applies only to the CI scripts. Normal asterisk build and install is not affected. Change-Id: Iad66374b550fd89349bedbbf2b93f8edd195a7c3 2019-06-14 15:45 +0000 [e3866cb714] Alexei Gradinari * translate.c do not log WARNING on empty audio frame There is WARNING "no samples for ..." on each Playtones. The function ast_playtones_start calls ast_activate_generator, which calls ast_prod. The function ast_prod calls ast_write with empty audio frame. In this case it's spam log. Change-Id: Id4ac309489d9ff281bad02abdef341cecdede660 2019-06-17 12:11 +0000 [92d4ec2906] George Joseph * chan_dahdi: Address gcc9 issues Fixed format-truncation issues in chan_dahdi.c and sig_analog.c. Since they're related to fields provided by dahdi-tools we can't change the buffer sizes so we're just checking the return from snprintf and printing an errior if we overflow. Change-Id: Idc1f3c1565b88a7d145332a0196074b5832864e5 2019-06-10 16:58 +0000 [f3e5419d41] George Joseph * app_confbridge: Attended transfer event fixup When a channel already in a conference bridge is attended transfered to another extension, or when an existing call is attended transferred into a conference bridge, we now generate ConfbridgeJoin and ConfbridgeLeave events for the entering and departing channels. Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1 2019-06-13 10:11 +0000 [c70d874f7d] Sean Bright * pjproject: Update to 2.9 release Relies on https://github.com/asterisk/third-party/pull/4 Change-Id: Iec9cad42cb4ae109a86a3d4dae61e8bce4424ce3 2019-06-11 07:26 +0000 [a8e5cf557d] Joshua Colp * res_rtp_asterisk: Add support for DTLS packet fragmentation. This change adds support for larger TLS certificates by allowing OpenSSL to fragment the DTLS packets according to the configured MTU. By default this is set to 1200. This is accomplished by implementing our own BIO method that supports MTU querying. The configured MTU is returned to OpenSSL which fragments the packet accordingly. When a packet is to be sent it is done directly out the RTP instance. ASTERISK-28018 Change-Id: If2d5032019a28ffd48f43e9e93ed71dbdbf39c06 2019-05-21 14:12 +0000 [3eaeb3e6c4] Alexei Gradinari * app_attended_transfer: new application AttendedTransfer AttendedTransfer queues up attended transfer to the given extension. This application can be useful with Custom Dynamic Features. For example to make attended transfer to a predefined number. features.conf ;;; [applicationmap] my_atxfer => *7,self,GoSub,"my_atxfer,s,1",default ;;; extensions.conf ;;; [globals] DYNAMIC_FEATURES=my_atxfer TRANSFER_CONTEXT=my_transfer [my_atxfer] exten => s,1,AttendedTransfer(1234567890) same => n,Return() [my_transfer] include => default ;;; This application also can be used to completly redefine Attended transfer feature using dialplan. For example: features.conf ;;; [featuremap] atxfer => *7 [applicationmap] custom_atxfer => *2,self,GoSub,"custom_atxfer,s,1",default ;;; extensions.conf ;;; [globals] DYNAMIC_FEATURES=custom_atxfer TRANSFER_CONTEXT=my_transfer [custom_atxfer] exten => s,1, same => n,Playback(pbx-transfer) same => n,Read(dest,dial,10,i,3,3) same => n,AttendedTransfer(${dest}) same => n,Return() [my_transfer] include => default ;;; Change-Id: Ie5cfa455d0813cffd5c85a6fb117f07d8f0b903b 2019-06-06 07:48 +0000 [d2f7b22640] Abhay Gupta * chan_pjsip.c: Check for channel and session to not be NULL in hangup We have seen some rare case of segmentation fault in hangup function and we could notice that channel pointer was NULL. Debug log shows that there is a 200 OK answer and SIP timeout at the same time. It looks that while the SIP session was being destroyed due to timeout call hangup due to answer event lead to race condition and channel is being destroyed from two different places. The check ensures we check it not to be NULL before freeing it. ASTERISK-25371 Change-Id: I19f6566830640625e08f7b87bfe15758ad33a778 2019-05-21 14:53 +0000 [745cbab501] Alexei Gradinari * app_blind_transfer: new application BlindTransfer BlindTransfer redirects all channels currently bridged to the caller channel to the specified destination. This application can be useful with Custom Dynamic Features. For example to make blind transfer to a predefined number. features.conf ;;; [applicationmap] my_blindxfer => *6,self,GoSub,"my_blindxfer,s,1",default ;;; extensions.conf ;;; [globals] DYNAMIC_FEATURES=my_blindxfer [my_blindxfer] exten => s,1,BlindTransfer(1234567890,default) same => n,Return() ;;; This application also can be used to completly redefine Blind transfer feature using dialplan. For example: features.conf ;;; [featuremap] blindxfer => [applicationmap] custom_blindxfer => ##,self,GoSub,"custom_blindxfer,s,1",default ;;; extensions.conf ;;; [globals] DYNAMIC_FEATURES=custom_blindxfer [custom_blindxfer] exten => s,1, same => n,Playback(pbx-transfer) same => n,Read(dest,dial,10,i,3,3) same => n,BlindTransfer(${dest},default) same => n,Return() ;;; Change-Id: I9d55e7f69ccfd4472dec00d62771d6de8803215a 2019-01-08 00:14 +0000 [bcaa01b024] Kirsty Tyerman * pbx_dundi: added IPv4/IPv6 dual bind support to DUNDi ASTERISK-28234 Reported-by: Kirsty Tyerman Change-Id: I5d6e6b52dbe51415046bb3953fd16f5b421bc2e1 2019-06-04 12:41 +0000 [e61f2af89d] Chris-Savinovich * cdr_pgsql: fix error in connection string Fixes an error occurring in function pgsql_reconnect() caused when value of hostname is blank. Which in turn will cause the connection string to look like this: "host= port=xx", which creates a sintax error. This fix now checks if the corresponding values for host, port, dbname, and user are blank. Note that since this is a reconnect function the database library will replace any missing value pairs with default ones. ASTERISK-28435 Change-Id: I0a921f99bbd265768be08cd492f04b30855b8423 2019-05-28 15:35 +0000 [1b62781be0] Alexei Gradinari * res_fax: fix segfault on inactive "reserved" fax session The change #10017 "Handle fax gateway being started more than once" introdiced a bug which leads to segfault in res_fax_spandsp. The res_fax_spandsp module does not support reserving sessions, so fax_session_reserve returns a fax session with state AST_FAX_STATE_INACTIVE. The fax_gateway_start does not create a real fax session if the fax session is already present and the state is not AST_FAX_STATE_RESERVED. But the "reserved" session created for res_fax_spandsp has state AST_FAX_STATE_INACTIVE, so fax_gateway_start not starting. Then when fax_gateway_framehook is called and gateway T.38 state is NEGOTIATED the call of gateway->s->tech->write(gateway->s, f) leads to segfault, because session tech_pvt is not set, i.e. the tech session was not initialized/started. This patch adds check also on AST_FAX_STATE_INACTIVE to the "reserved" session created for res_fax_spandsp will start. This patch also adds extra check and log ERROR if tech_pvt is not set before call tech->write. ASTERISK-27981 #close Change-Id: Ife3e65e5f18c902db2ff0538fccf7d28f88fa803 2019-05-28 17:15 +0000 [bfd93995d9] Alexei Gradinari * res_fax: add channel name to CLI 'fax show session' This patch adds a channel name to output of CLI 'fax show session' and also expands the channel name field up to 30 characters on CLI 'fax show sessions' Change-Id: Id059c43ff41811f5e76712b83fb63b8f246da953 2019-05-24 09:01 +0000 [9969c77bc2] Ben Ford * build: Fix file format in CHANGES-staging. One of the change files doesn't conform to the format that the release scripts need in order to parse it. Change-Id: Ie0b634cf27e4cbc671b9fe92993b6f2ecf60254c 2019-05-23 09:44 +0000 [db535439f2] Guido Falsi * chan_dahdi: add missing include. After some definitions have been moved to asterisk/mwi.h the files channels/chan_dahdi.h channels/sig_pri.c are missing this new include. ASTERISK-28427 #close Change-Id: Ia8cc595eeda653324643f40dcd9799d4c3f0ac91 2019-05-17 17:45 +0000 [408210bd4c] Alexei Gradinari * app_readexten: new option 'p' to stop reading on '#' key This patch adds the 'p' option. The extension entered will be considered complete when a # is entered. Change-Id: If77c40c9c8b525885730821e768f5dea71cf04c1 2019-05-10 09:36 +0000 [0bb38796b7] Matt Jordan * res_prometheus: Add metrics for PJSIP outbound registrations When monitoring Asterisk instances, it's often useful to know when an outbound registration fails, as this often maps to the notion of a trunk and having a trunk fail is usually a "bad thing". As such, this patch adds monitoring metrics that track the state of PJSIP outbound registrations. It does this by looking for the Registry events coming across the Stasis system topic, and publishing those as metrics to Prometheus. Note that while this may support other outbound registration types (IAX2, SIP, etc.) those haven't been tested. Your mileage may vary. (And why are you still using IAX2 and SIP? It's 2019 folks. Get with the program.) This patch also adds Sorcery observers to handle modifications to the underlying PJSIP outbound registration objects. This is useful when a reload is triggered that modifies the properties of an outbound registration, or when ARI push configuration is used and an object is updated or deleted. Because we rely on properties of the registration object to define the metric (label key/value pairs), we delete the relevant metric when we notice that something has changed and wait for a new Stasis message to arrive to re-create the metric. ASTERISK-28403 Change-Id: If01420e38530fc20b6dd4aa15cd281d94cd2b87e 2019-01-03 10:28 +0000 [a2648b22eb] Matt Jordan * res_prometheus: Add CLI commands This patch adds a few CLI commands to the res_prometheus module to aid system administrators setting up and configuring the module. This includes: * prometheus show status: Display basic statistics about the Prometheus module, including its essential configuration, when it was last scraped, and how long the scrape took. The last two bits of information are useful when Prometheus isn't generating metrics appropriately, as it will at least tell you if Asterisk has had its HTTP route hit by the remote server. * prometheus show metrics: Dump the current metrics to the CLI. Useful for system administrators to see what metrics are currently available without having to cURL or go to Prometheus itself. ASTERISK-28403 Change-Id: Ic09813e5e14b901571c5c96ebeae2a02566c5172 2019-05-09 09:41 +0000 [066280f0cc] Matt Jordan * res_prometheus: Add Asterisk bridge metrics This patch adds basic Asterisk bridge statistics to the res_prometheus module. This includes: * asterisk_bridges_count: The current number of bridges active on the system. * asterisk_bridges_channels_count: The number of channels active in a bridge. In all cases, enough information is provided with each bridge metric to determine a unique instance of Asterisk that provided the data, along with the technology, subclass, and creator of the bridge. ASTERISK-28403 Change-Id: Ie27417dd72c5bc7624eb2a7a6a8829d7551788dc 2019-05-09 09:41 +0000 [ed6cd13b5b] Matt Jordan * res_prometheus: Add Asterisk endpoint metrics This patch adds basic Asterisk endpoint statistics to the res_prometheus module. This includes: * asterisk_endpoints_state: The current state (unknown, online, offline) for each defined endpoint. * asterisk_endpoints_channels_count: The current number of channels associated with a given endpoint. * asterisk_endpoints_count: The current number of defined endpoints. In all cases, enough information is provided with each endpoint metric to determine a unique instance of Asterisk that provided the data, as well as the underlying technology and resource definition. ASTERISK-28403 Change-Id: I46443963330c206a7d12722d08dcaabef672310e 2019-05-21 11:29 +0000 [3224ac07c9] Morten Tryfoss * res_rtp_asterisk: timestamp should be unsigned instead of signed int Using timestamp with signed int will cause timestamps exceeding max value to be negative. This causes the jitterbuffer to do passthrough of the packet. ASTERISK-28421 Change-Id: I9dabd0718180f2978856c50f43aac4e52dc3cde9 2019-05-02 19:45 +0000 [0760af71ad] Matt Jordan * res_prometheus: Add Asterisk channel metrics This patch adds basic Asterisk channel statistics to the res_prometheus module. This includes: * asterisk_calls_sum: A running sum of the total number of processed calls * asterisk_calls_count: The current number of calls * asterisk_channels_count: The current number of channels * asterisk_channels_state: The state of any particular channel * asterisk_channels_duration_seconds: How long a channel has existed, in seconds In all cases, enough information is provided with each channel metric to determine a unique instance of Asterisk that provided the data, as well as the name, type, unique ID, and - if present - linked ID of each channel. ASTERISK-28403 Change-Id: I0db306ec94205d4f58d1e7fbabfe04b185869f59 2019-04-29 10:10 +0000 [54f7f7dc20] Matt Jordan * pjproject/Makefile: Updates for Darwin compatible builds This patch fixes three compatibility issues for Darwin compatible builds: (1) Use BSD compatible command line option for sed For some versions of BSD sed, the -r command line option is unknown. Both GNU and BSD sed support the -E command line option for enabling extended regular expressions; as such, this patch replaces the -r option with -E. (2) Look for '_' in pjproject generated symbols In Darwin comaptible systems, the symbols generated for pjproject may be prefixed with an '_'. When exporting these to a symbol file, the invocation to sed has to optionally look for a prefix of said '_' character. (3) Use -all_load/-noall_load when linking The flags -whole-archive/-no-whole-archive are not supported by the linker, and must instead be replaced with -all_load/-noall_load. Change-Id: I58121756de6a0560a6e49ca9d6bf9566a333cde3 2019-01-03 10:28 +0000 [c50f29dfad] Matt Jordan * Add core Prometheus support to Asterisk Prometheus is the defacto monitoring tool for containerized applications. This patch adds native support to Asterisk for serving up Prometheus compatible metrics, such that a Prometheus server can scrape an Asterisk instance in the same fashion as it does other HTTP services. The core module in this patch provides an API that future work can build on top of. The API manages metrics in one of two ways: (1) Registered metrics. In this particular case, the API assumes that the metric (either allocated on the stack or on the heap) will have its value updated by the module registering it at will, and not just when Prometheus scrapes Asterisk. When a scrape does occur, the metrics are locked so that the current value can be retrieved. (2) Scrape callbacks. In this case, the API allows consumers to be called via a callback function when a Prometheus initiated scrape occurs. The consumers of the API are responsible for populating the response to Prometheus themselves, typically using stack allocated metrics that are then formatted properly into strings via this module's convenience functions. These two mechanisms balance the different ways in which information is generated within Asterisk: some information is generated in a fashion that makes it appropriate to update the relevant metrics immediately; some information is better to defer until a Prometheus server asks for it. Note that some care has been taken in how metrics are defined to minimize the impact on performance. Prometheus's metric definition and its support for nesting metrics based on labels - which are effectively key/value pairs - can make storage and managing of metrics somewhat tricky. While a naive approach, where we allow for any number of labels and perform a lot of heap allocations to manage the information, would absolutely have worked, this patch instead opts to try to place as much information in length limited arrays, stack allocations, and vectors to minimize the performance impacts of scrapes. The author of this patch has worked on enough systems that were driven to their knees by poor monitoring implementations to be a bit cautious. Additionally, this patch only adds support for gauges and counters. Additional work to add summaries, histograms, and other Prometheus metric types may add value in the future. This would be of particular interest if someone wanted to track SIP response types. Finally, this patch includes unit tests for the core APIs. ASTERISK-28403 Change-Id: I891433a272c92fd11c705a2c36d65479a415ec42 2019-05-20 12:45 +0000 [3853fab3f5] Joshua Colp * pjproject-bundled: Add upstream timer fixes Fixed #2191: - Stricter double timer entry scheduling prevention. - Integrate group lock in SIP transport, e.g: for add/dec ref, for timer scheduling. ASTERISK-28161 Reported-by: Ross Beer Change-Id: I2e09aa66de0dda9414d8a8259a649c4d2d96a9f5 2019-05-17 18:44 +0000 [be83591f99] George Joseph * res_rtp_asterisk: Add ability to propose local address in ICE You can now add the "include_local_address" flag to an entry in rtp.conf "[ice_host_candidates]" to include both the advertized address and the local address in ICE negotiation: [ice_host_candidates] 192.168.1.1 = 1.2.3.4,include_local_address This causes both 192.168.1.1 and 1.2.3.4 to be advertized. Change-Id: Ide492cd45ce84546175ca7d557de80d9770513db 2019-05-13 15:37 +0000 [466a17964f] Alexei Gradinari * pjsip: replace 180 by 183 if SDP negotiation has completed The caller endpoint hears dead silence if a callee replies 180 (without SDP) and the caller already received 183 (with SDP). It happens because Asterisk sends 180 (WITH SDP) to the caller, there are not incoming RTP packets from the callee and Asterisk does not generate inband ringing, so there are not any outgoing RTP packets to the caller. This patch replaces 180 by 183 if SDP negotiation has completed, as if the caller endpoint is configured with "inband_progress=yes". In this case Asterisk will generate inband ringing untill Asterisk receive incoming RTP packets from the callee. ASTERISK-27994 #close Change-Id: I7450b751083ec30d68d6abffe922215a15ae5a73 2019-05-10 10:48 +0000 [c5c953c1f1] George Joseph * Fixes for GCC 9 Various fixes for issues caught by gcc 9. Mostly snprintf trying to copy to a buffer potentially too small. ASTERISK-28412 Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e 2019-05-08 10:41 +0000 [7a6fd83aca] Joshua Colp * res_rtp_asterisk: Fix sequence number cycling and packet loss count. This change fixes two bugs which both resulted in the packet loss count exceeding 65,000. The first issue is that the sequence number check to determine if cycling had occurred was using the wrong variable resulting in the check never seeing that cycling has occurred, throwing off the packet loss calculation. It now uses the correct variable. The second issue is that the packet loss calculation assumed that the received number of packets in an interval could never exceed the expected number. In practice this isn't true due to delayed or retransmitted packets. The expected will now be updated to the received number if the received exceeds it. ASTERISK-28379 Change-Id: If888ebc194ab69ac3194113a808c414b014ce0f6 2019-05-07 11:08 +0000 [86836e0442] Ben Ford * pjsip_options.c: Allow immediate qualifies for new contacts. When multiple endpoints try to register close together using the same AOR with qualify_frequency set, one contact would qualify immediately while the other contacts would have to wait out the duration of the timer before being able to qualify. Changing the conditional to check the contact container count for a non-zero value allows all contacts to qualify immediately. Change-Id: I79478118ee7e0d6e76af7c354d66684220db9415 2019-05-06 16:26 +0000 [def6bbc96b] Kevin Harwell * conversions.c: Add conversions for largest max sized integer Added a conversion for umax (largest maximum sized integer allowed). Adjusted the other current conversion functions (uint and ulong) to be derivatives of the umax conversion since they are simply subsets of umax. Also made the negative check move the pointer on spaces since strtoumax does it anyways. Change-Id: I56c2ef2629d49b524c8df58af12951c181f81f08 2019-05-03 10:49 +0000 [85242a9bb9] Abhay Gupta * stasis: Hangup channel for Local channel No such extension error When we use early bridge with create and dial from stasis using Local channel and the dialplan does not any entry the it is returned from core_local.c with No such extension . In such case asterisk locks up till the channel is not hangup with the error Exceptionally long voice queue length * Found that in such case app_control_dial fails on ast_call method and return -1 * Since it is called from stasis_app_send_command_async and return -1 does not cause resources to be freed and since no PBX exist it is not able to read from channel causing exceptionally long queue * After putting this code found that the channel was releasing immediately and resources were freed. ASTERISK-28399 Reported by: Abhay Gupta Tested by: Abhay Gupta Change-Id: I0a55c923fc6995559f808d63b9488762b4489318 2019-05-03 13:31 +0000 [089581f20a] George Joseph * build: Pass --fno-partial-inlining to third-party when appropriate When the gcc version is >= 8.2.1, we were already setting the --fno-partial-inlining flag for Asterisk source files to get around a gcc bug but we weren't passing the flag down to the bundled builds of pjproject and jansson. ASTERISK-28392 Change-Id: I99ede9bc35408ecd096f7d5369e8192d3dc75704 2019-05-02 13:29 +0000 [ef92c69fa8] George Joseph * res_pjsip: Check return from pjsip_parse_uri calls Updated ast_sip_create_rdata_with_contact and registrar_find_contact to check the return from pjsip_parse_uri before attempting to use the uri returned. ASTERISK-28402 Reported-by: Ross Beer Change-Id: I9810b3b163c45ed5a56ec743586e5ce107f13ba7 2019-04-30 09:21 +0000 [71040078a3] Abhay Gupta * stasis: Only place stasis created and dialed channels into dial bridge. The dial bridge is meant to hold channels which have been created and dialed in stasis. It handles the frames coming from them and raises the appropriate events. It was possible for the code to mistakenly place calls which came from the dialplan into the dial bridge if they were not in an answered state. These channels are not outgoing channels and should not be placed into the dial bridge. The code now checks to ensure that only stasis created channels are placed into the dial bridge by checking that a PBX does not exist on the channel. ASTERISK-27756 Change-Id: Ideee69ff06c9a0b31f7ed61165f5c055f51d21b6 2019-04-09 23:30 +0000 [3087c82eb6] Holger Hans Peter Freyther * stasis: Call callbacks when imparting fails After a bridge has been deleted the stasis control will depart the channel and might attempt to re-add it to the dial bridge. The later can fail and this can lead to a situation that the stasis control is unlinked but the after_bridge_cb_failed cb is executed trying to access a dangling control object. Fix it by calling the after_cb's before bridge_channel_impart_signal. ASTERISK-26718 Change-Id: Ib4e8f70d7a21bd54afe3cb51cc6717ef7c355496 2019-04-30 06:22 +0000 [80dba268ea] Joshua Colp * app_confbridge: Add "all" variants of REMB behavior. When producing a combined REMB value the normal behavior is to have a REMB value which is unique for each sender based on all of their receivers. This can result in one sender having low bitrate while all the rest are high. This change adds "all" variants which produces a bridge level REMB value instead. All REMB reports are combined together into a single REMB value that is the same for each sender. ASTERISK-28401 Change-Id: I883e6cc26003b497c8180b346111c79a131ba88c 2019-04-23 05:00 +0000 [6bb70c93f1] Joshua Colp * rtp: Add support for transport-cc in receiver direction. The transport-cc draft is a mechanism by which additional information about packet reception can be provided to the sender of packets so they can do sender side bandwidth estimation. This is accomplished by having a transport specific sequence number and an RTCP feedback message. This change implements this in the receiver direction. For each received RTP packet where transport-cc is negotiated we store the time at which the RTP packet was received and its sequence number. At a 1 second interval we go through all packets in that period of time and use the stored time of each in comparison to its preceding packet to calculate its delta. This delta information is placed in the RTCP feedback message, along with indicators for any packets which were not received. The browser then uses this information to better estimate available bandwidth and adjust accordingly. This may result in it lowering the available send bandwidth or adjusting how "bursty" it can be. ASTERISK-28400 Change-Id: I654a2cff5bd5554ab94457a14f70adb71f574afc 2018-12-04 02:10 +0000 [7ce6d960d4] Abhay Gupta * app_amd: Fix infinite loop on silent calls The total time logic will now be executed on calls which do not pass any media. ASTERISK-28143 Change-Id: I24726bd29d7e467fc721ca265363417234b22855 2019-04-29 11:13 +0000 [ed615afb7e] Rodrigo Ramírez Norambuena * app_queue: Set correct value by default for shared_lastcall There a long history here: In commit dd1e62c095c has introduce by default shared_lastcall = true by default but this now only happen is there not [general] directive in queues.conf After that, the commit 4b50e3f1ee84ae29da6d9eb3cfd9896a49d2394b fix the sample file. We'll need to keep the same setting if there a general or not section in configuration file since the shared_lastcall is by a long time in sample files as default value to 'no'. Change-Id: Id44faec370136df8d57902b453ad4059ed21b94c 2019-04-23 09:47 +0000 [dc02d0d9f2] Ben Ford * stasis: Fix crash at shutdown. When compiling in dev mode, stasis statistics are enabled and can cause a crash at shutdown due to the following: - Containers are freed - Topics and subscriptions remain - When those topics and subscriptions are deallocated, they go to do things with the container This changes the containers to global ao2 objects, and whenever needed in the code, a reference must be obtained and checked before any operations can be done. ASTERISK-28353 #close Change-Id: Ie7d5e907fcfcb4d65bd36d5e4eb923126fde8d33 2019-03-29 09:04 +0000 [8e21c25ce5] Antoni Goldstein * app_dial.c: RINGTIME, PROGRESSTIME and ms resolution dial timings Added RINGTIME, RINGTIME_MS, PROGRESSTIME, PROGRESSTIME_MS variables filled at the earliest received PROGRESS or RINGING. Added millisecond versions of DIALEDTIME and ANSWEREDTIME. Added millisecond versions of ast_channel_get_up_time and ast_channel_get_duration in channel.c. ASTERISK-28363 Change-Id: If95f1a7d8c4acbac740037de0c6e3109ff6620b1 2019-04-09 14:48 +0000 [ff0d0ac23a] Kevin Harwell * mwi core: Move core MWI functionality into its own files There is enough MWI functionality to warrant it having its own 'c' and header files. This patch moves all current core MWI data structures, and functions into the following files: main/mwi.h main/mwi.c Note, code was simply moved, and not modified. However, this patch is also in preparation for core MWI changes, and additions to come. Change-Id: I9dde8bfae1e7ec254fa63166e090f77e4d3097e0 2019-04-07 11:36 +0000 [8b7324ed3f] Guido Falsi * core/buildsystem: check the actual compiler being version Make compiler check use the output of the actual compiler being used as reported by the CC variable, instead of unconditionally running the "gcc" binary. Also only run the check if the compiler is gcc or a cross-compile gcc. ASTERISK-28374 Change-Id: Icaacf6d93686ad21076878aa1504a23b4fc9d0f4 2019-04-19 09:33 +0000 [4f69ea928a] Lucas Mendes * res_indications: Fix indications remove command autocomplete We changed the validation of autocomplete parameter in the "indications remove" command to avoid continue the execution of the command after asking for autocomplete out of range parameters. ASTERISK-28391 Reported by: lmendes86 Change-Id: I92b24131fd02f2e3c7fec966eea6f7a663310d40 2019-04-17 14:45 +0000 [d4e25710f7] George Joseph * res_remb_modifier: Propertly initialize bitrate to 0.0 ...and return the frame unaltered if bitrate can't be determined. Change-Id: Ib2175ab84f85a3d7060d31625f5a2c7fbcc2ba4c 2019-04-08 17:04 +0000 [cffa2a74cb] Dan Cropp * res_pjsip: Added a norefersub configuration setting Added a new PJSIP global setting called norefersub. Default is true to keep support working as before. res_pjsip_refer: Configures PJSIP norefersub capability accordingly. Checks the PJSIP global setting value. If it is true (default) it adds the norefersub capability to PJSIP. If it is false (disabled) it does not add the norefersub capability to PJSIP. This is useful for Cisco switches that do not follow RFC4488. ASTERISK-28375 #close Reported-by: Dan Cropp Change-Id: I0b1c28ebc905d881f4a16e752715487a688b30e9 2019-04-09 19:09 +0000 [1d3272d4ed] sungtae kim * main/stasis.c: Added detail info for stasis show app cli Currently, the "stasis show app" cli doesn't give detail of subscription/subscriber information. Added more printings to show details. ASTERISK-28378 Change-Id: If25a6f14fe4f622bfb37462e891333da1fdf875f 2019-04-16 10:58 +0000 [e69fcdfd83] Sean Bright * res_mwi_devstate: Specify AST_MODFLAG_LOAD_ORDER to enable load priority Suggested by abelbeck on the issue tracker. ASTERISK~28384 Reported by: abelbeck Change-Id: Icee0fff2b58dbfaa80f2b68270fe69dfb0463fc0 2019-04-12 11:32 +0000 [8a32b68038] George Joseph * CI: Move test group config files to Jenkins One of the downaides of having things like test configuration in the git repo is that it can't be changed at runtime. You have to create a review for the changes and merge it mefore it will take effect. This review moves the data currently held in tests/CI/periodic-dailyTestGroups.json and tests/CI/gateTestGroups.json into a Jenkins Config File attached to the job definitions. This allows us to alter it from the Jenkins UI at runtime. The original files stay in the repo as documentation. Change-Id: I14b9702f6285ce1fb2420287ba0e7d3b59109763 2019-04-13 13:36 +0000 [d58d7d4500] Sean Bright * app_voicemail: Don't split mailbox options on comma Because the per-mailbox options are the last thing on a line, don't look for or stomp on any subsequent commas. ASTERISK-27935 #close Reported by: Sébastien Duthil Change-Id: I07b2eb4a33c303d0c7114d5b906f8c067c60a153 2019-04-12 09:33 +0000 [7e5709d726] Sean Bright * pbx.c: Ignore dashes in extensions when using extenpatternmatchnew Because hyphens are not matched literally in Asterisk dialplan, we need to ignore them in our candidate extensions as well. ASTERISK-17695 #close Reported by: test011 Change-Id: I227f02301577b1633e8a55b9fe9dc149935c03f0 2019-04-09 10:10 +0000 [63f86cac09] Sean Bright * app_voicemail: Cleanup stale lock files on module load If Asterisk crashes while a VM directory is locked, lock files in the VM spool directory will not get properly cleaned up. We now clear them on module load. ASTERISK-20207 #close Reported by: Steven Wheeler Change-Id: If40ccd508e2f6e5ade94dde2f0bcef99056d0aaf 2019-04-12 07:33 +0000 [26cdf042f4] George Joseph * ARI: Run 'make ari-stubs' An earlier contributor apparently forgot to run 'make ari-stubs' before committing after making ARI model changes. Change-Id: I7813e5638e2821d11f4b968dc2aeab4f725190a6 2019-04-11 15:48 +0000 [f827193424] Sean Bright * res_ael: Create consistent label names across reloads Reset the internal counter that the AEL2 compiler uses for unique label names before compiling. This keeps dialplan labels consistent across reloads assuming the AEL2 has not changed. ASTERISK-17799 #close Reported by: Kirill Katsnelson Change-Id: I30b3cc887d1ee0644d3f341e2fef16f525d7fae5 2019-04-11 15:29 +0000 [f7f1a2cbb7] Sean Bright * res_ael: Use Gosub in for loop expressions In AEL2, if a 'for' statement contains macro* calls, like: for (&iterator(${TRY},A); "${A}" != ""; &iterate(A)) { The AEL2 parser will translate these into calls to the deprecated Macro dialplan application and use the antiquated pipe delimiter. Instead, convert these into calls to the Gosub dialplan application and use commas as argument separators. ASTERISK-18593 #close Reported by: Luke-Jr * 'macro' in this context means AEL2 macros, not the 'Macro' application Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc 2019-04-11 11:03 +0000 [395c7ed5b7] Sean Bright * res_ael: Fix pattern matching against literal '+' When generating the regular expression that matches against existing extensions, we need to escape literal characters that can also be regular expression metacharacters. This was already being done for '*' but we need to do the same for '+'. In passing, remove some unreachable code - strcmp() is already run immediately when entering extension_matches(). ASTERISK-14939 #close Reported by: klaus3000 Change-Id: I8d2cccb3479168fba1b0a6704c52198b396468f1 2019-04-11 12:49 +0000 [2cf4e8bff9] Sean Bright * pbx.c: Properly parse labels with leading digits If the target of a Goto is a label that starts with a number, we erroneously treat the leading digits as a priority. ASTERISK-20182 #close Reported by: Janu Change-Id: Ia78408c0805a729103917247ecfc802f6fafc94b 2019-04-10 18:07 +0000 [a8f1e26d34] Alexander Anikin * chan_ooh323: fix h323 log file path Change h323 log path relative to AST_LOG_DIR instead of /var/log/asterisk hardcoded Add return back error message from OOH323EP initialize ASTERISK-28348 #close Reported by: Dmitry Shubin Change-Id: Ib102dd36bbe6c2a7a4ce6870ae9110d9000d7e98 2019-04-09 16:47 +0000 [fe58bc7bdf] Alexei Gradinari * res_pjsip: Fix transport_states ref leak Add missing ao2_ref(transport_state, -1) while iterate on a transport_states container. Change-Id: I40e35b5a339121300c80075c30db47201a6c374e 2019-04-01 15:38 +0000 [a4ab7f5f80] Ben Ford * build: Revise CHANGES and UPGRADE.txt handling. This changes the way that we handle adding changes to CHANGES and UPGRADE.txt. The reason for this is because whenever someone needed to make a change to one of these files and someone else had already done so, you would run into merge conflicts. With this new setup, there will never be merge conflicts since all changes will be documented in the doc/-staging directory. The release script is now responsible for merging all of these changes into the appropriate files. There is a special format that these files have to follow in order to be parsed. The files do not need to have a meaningful name, but it is strongly recommended. For example, if you made a change to pjsip, you may have something like this "res_pjsip_relative_title", where "relative_title" is something more descriptive than that. Inside each file, you will need a subject line for your change, followed by a description. There can be multiple subject lines. The file may look something like this: Subject: res_pjsip Subject: Core A description that explains the changes made and why. The release script will handle the bulleting and section separators! You can still separate with new lines within your description. The headers ("Subject" and "Master-Only") are case sensative, but the value for "Master-Only" ("true" or "True") is not. For more information, check out the wiki page: https://wiki.asterisk.org/wiki/display/AST/CHANGES+and+UPGRADE.txt ASTERISK-28111 #close Change-Id: I19cf4b569321c88155a65e9b0b80f6d58075dd47 2019-04-04 16:02 +0000 [391112d89a] Chris-Savinovich * config.c: Fix a crash in extconfig parsing When extconfig.conf file is parsed, the code previously searched for character comma without verifying if error (null or blank). This caused a segmentation error. Change-Id: Id76b452d8f330d11c2742c37232761ad71472a8b 2019-04-03 10:55 +0000 [5009d6d97a] Salah Ahmed * chan_pjsip: DTMF Mode auto_info fallback lead to both inband and info When the dtmf_mode on an endpoint is configured as "auto_info" Asterisk will produce an inband DTMF tone alongside an INFO message when sending DTMF. ASTERISK-28371 Change-Id: I1380b82f006e110a1b83fbb50c9873edd13a5d9a 2019-04-02 15:49 +0000 [ccac55b894] Sebastian Kemper * loader: support for permanent dlopen() Asterisk assumes that dlopen() will always run the constructor of a shared library and every dlclose() will run its destructor. But dlopen() may be permanent, meaning the constructor will only be run once, as is the case with musl libc. With a permanent dlopen() the Asterisk module loader does not work correctly, because it's expectations regarding when the constructors and destructors are run are not met. In fact a segmentation fault will occur when the first module is "re-opened" that has AST_MODFLAG_GLOBAL_SYMBOLS set (the dlopen() does not call the constructor, resource_being_loaded is not set to NULL, then strlen is called with NULL instead of a string, see issue ASTERISK-28319). This commit adds code to the loader that will manually run the constructors/destructors of the (non-builtin) modules where needed. To achieve this a new ao2 container (linked list) is started and filled with objects that contain the names of the modules and the pointers to their respective info structs. This behavior can be activated when configuring Asterisk (--enable-permanent-dlopen). By default this is disabled, of course. ASTERISK-28319 #close Signed-off-by: Sebastian Kemper Change-Id: I86693a0ecf25d5ba81c73773a03df4abc3426875 2019-04-03 17:55 +0000 [8ae9339f71] George Joseph * CI: Add --no-dev-mode option to buildAsterisk.sh The new option disables dev mode, TEST_FRAMEWORK and MALLOC_DEBUG making the build more production-like. Change-Id: Ieb72497d4d91d5416684aaed702cc3f532099738 2019-04-03 10:24 +0000 [dd1cc7791c] Ben Ford * build: Fix compiler warnings/errors. The compiler complained about a couple of variables that weren't initialized but were being used. Initializing them to NULL resolves the warnings/errors. ASTERISK-28362 #close Change-Id: I6243afc5459b416edff6bbf571b0489f6b852e4b 2019-03-27 12:59 +0000 [d1d0692858] Kevin Harwell * bridge_softmix: use a float type to store the internal REMB bitrate REMB's exponent is 6-bits (0..63) and has a mantissa of 18-bits. We were using an unsigned integer to represent the bitrate. However, that type is not large enough to hold all potential bitrate values. If the bitrate is large enough bits were being shifted off the "front" of the mantissa, which caused the wrong value to be sent to the browser. This patch makes it so it now uses a float type to hold the bitrate. Using a float allows for all bitrate values to be correctly represented. ASTERISK-28255 Change-Id: Ice00fdd16693b16b41230664be5d9f0e465b239e 2019-03-29 08:07 +0000 [e8cf3693f6] Sean Bright * app_queue: Fix a few member pause bugs * Always set member->lastpause when setting member->paused * Fixed typo (using member->lastcall instead of member->lastpause) in 'queue show' output. * Use a constant 'now' in 'queue show' output for a better point-in-time view of time based stats. ASTERISK-27541 #close Reported by: César Benjamín García Martínez Change-Id: Ib41ced90cfdb66f9bb1e7b263d0f6fc1ac6e18fa 2019-03-26 14:56 +0000 [4edd24841d] Ben Ford * alembic: Fix errors during upgrade head. When trying to upgrade using alembic, a couple different errors kept popping up that prevented the upgrade. An additional parameter was needed when changing the schema for mwi_subscribe_replaces_unsolicited from an integer to an enum. When changing from a string to an enum, the type needed to be cast for postgresql. The other issue was a parameter being used during column creation that did not exist. After fixing the upgrade process, it revealed errors with the downgrade process. One was a variable not being defined in the downgrade function, and the other was tables not existing when using MySQL. This was due to a context check that should have encompassed MySQL, but in the end was not doing so. Change-Id: Ib4d70cf3ce5080023a50be496272a777b55d6c8e 2019-01-26 15:51 +0000 [30d568ddec] sungtae kim * stasis.c: Added topic_all container Added topic_all container for centralizing the topic. This makes more easier to managing the topics. Added cli commands. stasis show topics : It shows all registered topics. stasis show topic : It shows speicifed topic's detail info. ASTERISK-28264 Change-Id: Ie86d125d2966f93de74ee00f47ae6fbc8c081c5f 2019-03-27 14:30 +0000 [f78306470b] Matthew Fredrickson * res/res_rtp_asterisk: Enable rxjitter calculation for video It looks like we're not properly calculating jitter values on received video streams. This patch enables the code that does jitter calculations for those streams. Change-Id: Iaac985808829c8f034db8c57318789c4c8c11392 2019-03-27 11:03 +0000 [d5d8448ce5] Ben Ford * build: Add staging directories for future changes. This is the first step in changing the release process so that changes made to the CHANGES and UPGRADE.txt files do not result in merge conflicts every time multiple people modify these files. The changes made will go in these new directories: doc/CHANGES-staging and doc/UPGRADE-staging. The README.md files explain how things will work, but here's a little overview. When you make a change that would go in either CHANGES or UPGRADE.txt, this should instead be documented in a new file in the doc/CHANGES-staging or doc/UPGRADE-staging directory, respectively. The format will look like this: Subject: res_pjsip A description that explains the changes made and why. The release script will handle the bulleting and section separators! The 'Subject:' header is case-sensitive. You can still separate with new lines within your description. Subject: res_ari Master-Only: true You can have more than one subject, and they don't have to be the same! Also, the 'Master-Only' header should always be true and is also case-sensitive (but the value is not - you can have 'true' or 'True'). This header will only ever be present in the master branch. For more information, check out the wiki page: https://wiki.asterisk.org/wiki/display/AST/CHANGES+and+UPGRADE.txt This is an initial change for ASTERISK_28111. Functionally, this will make no difference, but it will prep the directories for when the changes from CHANGES and UPGRADE.txt are extracted. Change-Id: I8d852f284f66ac456b26dcb899ee46babf7d15b6 2019-03-25 18:05 +0000 [f236377ce9] Alexei Gradinari * pjsip: restrict function PJSIP_PARSE_URI to parse only SIP/SIPS URIs The next usage of PJSIP_PARSE_URI will crash asterisk ${PJSIP_PARSE_URI(tel:+1234567890,host)} or ${PJSIP_PARSE_URI(192.168.1.1:5060,host)} The function pjsip_parse_uri successfully parses then, but returns struct pjsip_other_uri *. This patch restricts parsing only SIP/SIPS URIs. Change-Id: I16f255c2b86a80a67e9f9604b94b129a381dd25e 2019-03-26 13:07 +0000 [7043ed6ac9] Sean Bright * pjproject: Add timer patch from pjproject r5934 ASTERISK-28161 #close Reported by: Ross Beer Change-Id: I65331d554695753005eaa66c1d5d4807fe9009c8 2019-03-26 16:55 +0000 [834d022da5] Sean Bright * app_queue: Fix documentation for QUEUE_MEMBER function. It was a copy/paste of the QUEUE_MEMBER_COUNT function's synopsis. ASTERISK-20986 #close Reported by: Olivier Krief Change-Id: If51ec481feb35824a4e78ab5600b197b819b10be 2019-03-21 18:09 +0000 [76768ad6ce] sungtae kim * main/json.c: Added app_name, app_data to channel type It was difficult to check the channel's current application and parameters using ARI for current channels. Added app_name, app_data items to show the current application information. ASTERISK-28343 Change-Id: Ia48972b3850e5099deab0faeaaf51223a1f2f38c 2019-03-25 06:34 +0000 [d480f5eab2] Joshua Colp * manager: Use separate lock for session event notification. When notifying a manager session that new events were available the same lock was used that was also held when doing things within the session (such as sending events out). If the manager session blocked for a period of time this would cause a back up of messages in Stasis and would also block any other sessions from receiving events. This change adds a separate lock to the manager session which is strictly used for notifying it that new events are available. ASTERISK-28350 Change-Id: Ifbcac007faca9ad0231640f5e82a6ca9228f261b 2019-03-25 14:31 +0000 [1499640da9] Sean Bright * chan_sip: Ensure 'qualifygap' isn't negative Passing negative intervals to the scheduler rips a hole in the space-time continuum. ASTERISK-25792 #close Reported by: Paul Sandys Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7 2019-03-25 11:42 +0000 [e5d990d01d] Alexei Gradinari * res_config_odbc: set empty extended field as a single whitespace If Realtime @ variable value is NULL or empty or contains only whitespaces then when we try to retrieve it using PJSIP_ENDPOINT we get WARNING pjsip_endpoint_function_read: Unknown property @my_var for PJSIP endpoint. And the variable is missing in the result of CLI pjsip show endpoint. This patch keeps empty sorcery extended field. ASTERISK-28341 #close Change-Id: I221fccc04cbfa2be17ce971f64ae0e74e465eea0 2019-03-22 14:46 +0000 [41a2662e16] Matthew Fredrickson * main/taskprocessor: Increase max name length of taskprocessors Since the new names went in, the maximum taskprocessor name is too short. This patch increases the name field to a length to better handle the new names. Change-Id: I32f32d6926f25c8ef5a91303fd2988d2c2858877 2019-03-14 11:46 +0000 [7e77815ad1] George Joseph * sorcery.c: Sorcery enhancements for wizard management Added ability to specifiy a wizard is read-only when applying it to a specific object type. This allows you to specify create, update and delete callbacks for the wizard but limit which object types can use them. Added the ability to allow an object type to have multiple wizards of the same type. This is indicated when a wizard is added to a specific object type. Added 3 new sorcery wizard functions: * ast_sorcery_object_type_insert_wizard which does the same thing as the existing ast_sorcery_insert_wizard_mapping function but accepts the new read-only and allot-duplicates flags and also returns the ast_sorcery_wizard structure used and it's internal data structure. This allows immediate use of the wizard's callbacks without having to register a "wizard mapped" observer. * ast_sorcery_object_type_apply_wizard which does the same thing as the existing ast_sorcery_apply_wizard_mapping function but has the added capabilities of ast_sorcery_object_type_insert_wizard. * ast_sorcery_object_type_remove_wizard which removes a wizard matching both its name and its original argument string. * The original logic in __ast_sorcery_insert_wizard_mapping was moved to __ast_sorcery_object_type_insert_wizard and enhanced for the new capabilities, then __ast_sorcery_insert_wizard_mapping was refactored to just call __ast_sorcery_insert_wizard_mapping. * Added a unit test to test_sorcery.c to test the read-only capability. Change-Id: I40f35840252e4313d99e11dbd80e270a3aa10605 2019-03-10 17:53 +0000 [629962d1f7] sungtae kim * res/res_stasis: Fixed wrong StasisEnd timestamp Because StasisEnd's timestamp created it's own timestamp, it makes wrong timestamp, compare to other channel event(ChannelDestroyed). Fixed to getting a timestamp from the Channel's timestamp. ASTERISK-28333 Change-Id: I5eb8380fc472f1100535a6bc4983c64767026116 2019-03-14 09:55 +0000 [0fac5bcbe5] Sean Bright * vector: Add AST_VECTOR_COMPACT() to reclaim wasted space This might be useful in situations where you are loading an undetermined number of items into a vector and don't want to keep (potentially) 2x the necessary memory around indefinitely. Change-Id: I9711daa0fe01783fc6f04c5710eba84f2676d7b9 2019-03-14 11:53 +0000 [45a8892e67] Richard Mudgett * taskprocessor.c: Fix printf type mismatch A size_t is not always an unsigned long. * Use the %zu format specifier in the ast_cli() printf format string since AST_VECTOR_SIZE() returns a size_t value. Change-Id: Ib102dd36bbe6c2a7a4ce6870ae9110d978dd7e98 2019-03-08 09:40 +0000 [63d90c38eb] George Joseph * app.c: Remove deletion of pool topic on mwi state delete As part of an earlier voicemail refactor, ast_delete_mwi_state_full was modified to remove the pool topic for a mailbox when the state was deleted. This was an attempt to prevent stale topics from accumulating when app_voicemail was reloaded and a mailbox went away. Unfortunately because of the fact that when app_voicemail reloads, ALL mailboxes are deleted then only current ones recreated, topics were being removed from the pool that still had subscribers on them, then recreated as new topics of the same name. So now modules like res_pjsip_mwi are listening on a topic that will never receive any messages because app_voicemail is publishing on a different topic that happens to have the same name. The solutiuon to this is not easy and given that accumulating topics for deleted mailboxes is less evil that not sending NOTIFYs... * Removed the call to stasis_topic_pool_delete_topic in ast_delete_mwi_state_full. Also: * Fixed a topic reference leak in res_pjsip_mwi mwi_stasis_subscription_alloc. * Added some debugging to mwi_stasis_subscription_alloc, stasis_topic_create, and topic_dtor. * Fixed a topic reference leak in an error path in internal_stasis_subscribe. ASTERISK-28306 Reported-by: Jared Hull Change-Id: Id7da0990b3ac4be4b58491536b35f41291247b27 2019-03-02 05:37 +0000 [71c0c7f631] sungtae kim * res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics Added ARI resource for channel statistics. GET /ari/channels/{channelId}/rtp_statistics : It returns given channel's rtp statistics detail. ASTERISK-28320 Change-Id: I4343eec070438cec13f2a4f22e7fd9e574381376 2019-03-09 08:39 +0000 [7d5409912f] cirillor * Variable ALTCONF ignored when service is used in Debian When variable ALTCONF is defined, the command start prints the message "Unable to open specified master config file '"/etc/asterisk/asteris..." and use default configurations. ASTERISK-28332 Change-Id: I7595e582a0ee2c1051ea35435e247e27906957ef 2019-03-13 06:05 +0000 [1d074debfb] Joshua Colp * stasis: Allow empty application arguments to move. Change-Id: I1e4d37415f3034abe36496dc30209c2303e6af5c 2019-03-12 20:39 +0000 [a40198a4d4] Corey Farrell * Revert "Test_cel: Fails when DONT_OPTIMIZE is off" This reverts commit 1c8378bbc9639739c079df37897ff02f94af0f07. Change-Id: I1b9227b263c3dc4246a50aebf52a7640a0f7ea07 2019-03-06 07:20 +0000 [48e407e506] Dömsödi Gergely * app_queue: fix ring_entry to access nativeformats with a channel lock Fixes an intermittent segmentation fault which occured when accessing nativeformats of a channel which entered into a queue. ASTERISK-27964 Reported by: Francisco Seratti Change-Id: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e 2019-03-12 13:25 +0000 [6f158d27fc] George Joseph * Makefile.moddir_rules: Pass PJPROJECT_BUNDLED to download_externals The download_externals script wasn't getting the PJPROJECT_BUNDLED environment variable passed down to it so it wasn't downloading the appropriate variant of res_digium_phone. This could cause crashes in the DPMA. Change-Id: I5daa9369c7af1fd556d892e89a85f279a2533425 2019-03-06 16:21 +0000 [e2eb19b363] sungtae kim * res/res_ari: Added timestamp as a requirement for all ARI events Changed to requirement to having timestamp for all of ARI events. The below ARI events were changed to having timestamp. PlaybackStarted, PlaybackContinuing, PlaybackFinished, RecordingStarted, RecordingFinished, RecordingFailed, ApplicationReplaced, ApplicationMoveFailed ASTERISK-28326 Change-Id: I382c2fef58f5fe107e1074869a6d05310accb41f 2019-03-07 13:48 +0000 [449dff997c] Chris-Savinovich * partial-inlining: disable partial-inlining if gcc>=8.2.1 Apply flag -fno-partial-inlining on default optimization if and only if gcc version >= 8.2.1 (this is the current ver on Fedora and Ubuntu). This is done to avoid a bug that causes arithmetic calculations to fail if the following conditions are met: 1. TEST_FRAMEWORK on 2. DONT_OPTIMIZE off 3. Fedora and Ubuntu 4. GCC 8.2.1 5. There must exist a certain combination of multithreading. 6. Optimization level -O2 and -O3 7. Flag -fpartial-inline activated (default when optimization level>=2) The following link points to a similar gcc bug reported in 2015. This leads me to believe the bug has regressed. Note I am not able to replicate this bug in an environment other than Asterisk + Test Framework + Test_cel because the multithreading combination that causes it seems to be unique. Therefore I am temporarily abandoning any thoughts of reporting the new occurrence of this bug to gcc.gnu.org. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65307 Change-Id: Ibd1afe60e0a38b88e85fdcd9b051004601c2f102 2019-03-07 06:28 +0000 [0231dd6ae7] Joshua Colp * stasis: Improve topic/subscription names and statistics. Topic names now follow: :[/] This ensures that they are all unique, and also provides better insight in to what each topic is for. Subscriber ids now also use the main topic name they are subscribed to and an incrementing integer as their identifier to make it easier to understand what the subscription is primarily responsible for. Both the CLI commands for listing topic and subscription statistics now sort to make it a bit easier to see what is going on. Subscriptions will now show all topics that they are receiving messages from, not just the main topic they were subscribed to. ASTERISK-28335 Change-Id: I484e971a38c3640f2bd156282e532eed84bf220d 2019-03-05 08:15 +0000 [0d6d51b175] cirillor * chan_dahdi: Add logical group at DAHDIChannel event and CHANNEL function Add logical group at DAHDIChannel event and create "dahdi_group" at CHANNEL function. ASTERISK-28317 Change-Id: Ic1f834cd53982a9707a9748395ee746d6575086a 2019-03-03 09:20 +0000 [8641fd9700] sungtae kim * res/res_rtp_asterisk.c: Fixing possible divide by zero Currently, when the Asterisk calculates rtp statistics, it uses sample_count as a unsigned integer parameter. This would be fine for most of cases, but in case of large enough number of sample_count, this might be causing the divide by zero error. ASTERISK-28321 Change-Id: If7e0629abaceddd2166eb012456c53033ea26249 2019-03-08 14:12 +0000 [825ea9ddb9] Sean Bright * res_musiconhold: Remove redundant option parsing Change-Id: I481fabd8eaf2e4e7ffb5c8285b294742826e7d12 2019-03-04 01:50 +0000 [4661c08549] Torrey Searle * chan_pjsip: add a flag to ignore 183 responses if no SDP present chan_sip will always ignore 183 responses that do not contain SDP however, chan_pjsip will currently always translate it into a 183 with SDP. This new flag allows chan_pjsip to have the same behavior as chan_sip. ASTERISK-28322 #close Change-Id: If81cfaa17c11b6ac703e3d71696f259d86c6be4a 2019-03-07 17:17 +0000 [9b7b8cb155] Corey Farrell * jansson: json_pack with new format to verify required runtime version. Add a json_pack at startup that will fail if runtime links against a library older than jansson-2.11. Change-Id: I101aebafe0f9407650206f7c552dad3d69377b5a 2019-03-07 17:15 +0000 [57850c7861] Sean Bright * app_meetme: Don't mute joining admins if conference is muted ASTERISK-28328 #close Change-Id: I4f6069fb34923b7521520c2a205a1e56227e592b 2019-03-06 15:04 +0000 [2473b791b9] Sean Bright * Replace calls to strtok() with strtok_r() strtok() uses a static buffer, making it not thread safe. Also add a #define to cause a compile failure if strtok is used. Change-Id: Icce265153e1e65adafa8849334438ab6d190e541 2019-03-07 16:05 +0000 [7b02a9617c] Sean Bright * samples: Fix comment typo in pjsip.conf.sample Change-Id: I84a45c3d9fd26ca61aca99927eec83b57f1de857 2019-03-07 07:52 +0000 [6626df586e] Ben Ford * res_stasis: Add ability to switch applications. Added the ability to move between Stasis applications within Stasis. This can be done by calling 'move' in an application, providing (at minimum) the channel's id and the application to switch to. If the application is not registered or active, nothing will happen and the channel will remain in the current application, and an event will be triggered to let the application know that the move failed. The event name is "ApplicationMoveFailed", and provides the "destination" that the channel was attempting to move to, as well as the usual channel information. Optionally, a list of arguments can be passed to the function call for the receiving application. A full example of a 'move' call would look like this: client.channels.move(channelId, app, appArgs) The control object used to control the channel in Stasis can now switch which application it belongs to, rather than belonging to one Stasis application for its lifetime. This allows us to use the same control object instead of having to tear down the current one and create another. ASTERISK-28267 #close Change-Id: I43d12b10045a98a8d42541889b85695be26f288a 2019-03-04 16:05 +0000 [f6b5b7208c] Sean Bright * app_queue: Handle empty 'interface' in queue member config While the 'interface' column is a NOT NULL, the empty string is still allowed. res_config_odbc treats the empty string as a NULL and we crash when trying to dereference. Also cleaned up an adjacent error message for consistency. ASTERISK-28168 #close Change-Id: I55e012b540fbcda99bb40bede3099b7ae5db8202 2019-03-04 12:36 +0000 [f098d4a325] Sean Bright * sip_to_pjsip: Make multiline comment parsing consistent with Asterisk In Asterisk configuration, a multiline comment starts with ;-- as long as it is not followed by another dash (i.e. ;--- is not a multiline comment). ASTERISK-28323 #close Change-Id: I32dc38e0fac01d3c0805d27d35d2365a7c37ca72 2019-02-28 06:24 +0000 [2980622d2b] Joshua Colp * basic-pbx: Update configuration to work with current modules. The res_pjsip_websocket module requires the res_http_websocket module so ensure it is loaded. As well the res_pjsip_notify module needs the pjsip_notify.conf configuration file so ensure it is installed. ASTERISK-28272 Change-Id: I261659b84e7a6ac4cb49990d9badb4b2ad01bacd 2019-02-08 15:32 +0000 [3638c433ac] sungtae kim * bridging: Add creation timestamps This small feature will help to checking the bridge's status to figure out which bridge is in old/zombie or not. Also added detail items for the 'bridge show *' cli to provide more detail info. And added creation item to the ARI as well. ASTERISK-28279 Change-Id: I460238c488eca4d216b9176576211cb03286e040 2019-02-28 10:01 +0000 [106a8ff05c] Sean Bright * res_pjsip_diversion: Use static pj_str_t for Diversion header names PJSIP assumes that these header names are not allocated, and does not clone the name strings when reusing headers. Block unload of res_pjsip_diversion until shutdown to ensure static memory stays valid. ASTERISK-28312 #close Change-Id: Ibd6ea55ec4a604bbd43ac07f8d0b54da2c39b8b9 2019-03-01 15:17 +0000 [f8295e0771] Rodrigo Ramírez Norambuena * CHANGES: Document addition of 'wrapuptime' argument to AddQueueMember() Change-Id: Ieb332d018ae3f2fc82b9465381fde0f299af1611 2019-02-28 15:36 +0000 [8dc5f86095] Sean Bright * menuselect: Add license header to menuselect_gtk.c This file was added to the Subversion repository on 2007-03-15 by Russell Bryant, a Digium employee at the time. ASTERISK-24173 #close Change-Id: Ie866fa9d31d550467613d362b35b03c031ee594d 2019-02-27 19:09 +0000 [719a4643ab] Sean Bright * res_config_odbc: Avoid deadlock when max_connections = 1 Rather than calling ast_odbc_find_table() in the prepare callback, call it beforehand and pass it in to the callback to avoid the need for a second connection. ASTERISK-28166 #close Change-Id: I6f8a0b9990d636fd6bc1a92ed70f7050d2436202 2019-01-30 13:25 +0000 [8f9ffe5905] George Joseph * res_pjsip_sdp_rtp: Fix return code from apply_negotiated_sdp_stream apply_negotiated_sdp_stream was returning a "1" when no joint capabilities were found on an outgoing call instead of a "-1". This indicated to res_pjsip_session that the handler DID handle the sdp when in fact it didn't. Without the appropriate setup, a subsequent media frame coming in would have an invalid stream_num and cause a seg fault when the stream was attempted to be retrieved. apply_negotiated_sdp_stream now returns the correct "-1" and any media is now discarded before it reaches the core stream processing. ASTERISK-28260 Reported by: Sotiris Ganouris Change-Id: Ia095cb16b4862f2f6ad6d2d2a77453fa2542371f 2019-02-28 06:51 +0000 [101272d0dc] Sean Bright * Revert "pjsip_message_filter: Only do interface lookup for wildcard addresses." This reverts commit d524ad523d0d32babba309810b5bccd09cb7f467. Reason for revert: This causes Contact and Via headers to have the wrong transport address. ASTERISK-28309 #close Change-Id: Ibba4d6176f68e39279fcd9a545f81d56e747bed8 2019-02-27 19:52 +0000 [82a43394ed] Sean Bright * res_pjsip_config_wizard: Don't crash if misconfigured If both send_registrations and send_auth are both set to yes, outbound_auth/username must be set or we crash. ASTERISK-27992 #close Change-Id: I6418d56de1ae53f80393b314c2584048fbf7f11d 2019-02-20 11:03 +0000 [930a7fe910] Kevin Harwell * res_pjsip_registrar: blocked threads on reliable transport shutdown take 3 When a contact was removed by the registrar it did not always check to see if the circumstances involved a monitored reliable transport. For instance, if the 'remove_existing' option was set to 'true' then when existing contacts were removed due to 'max_contacts' being reached, those existing contacts being removed did not unregister the transport monitor. Also, it was possible to add more than one monitor on a reliable transport for a given aor and contact. This patch makes it so all contact removals done by the registrar also remove any associated transport monitors if necessary. It also makes it so duplicate monitors cannot be added for a given transport. ASTERISK-28213 Change-Id: I94b06f9026ed177d6adfd538317c784a42c1b17a 2019-02-27 10:37 +0000 [e0fc663295] George Joseph * CI: Update jenkinsfiles with new Gerrit URLs The recent upgrade of Gerrit to 2.16 elimiated referencing a repository in a way the jenkinsfiles were relying on so the URL references were changed to a more consistent and supported format. Change-Id: I2e8e3f213b9a96bb1b27665eca4a9a24bc49820e (cherry picked from commit 5ce084579f897096163b4e0c2ed4e8e1a8558cca) 2019-02-20 13:15 +0000 [9ee76cf070] George Joseph * res_mwi_devstate.c: New module to allow presence subs to VM boxes This module allows presence subscriptions to voicemail boxes. This allows common BLF keys to act as voicemail waiting indicators. ASTERISK-28301 Change-Id: I62a246c24f3d7d432e33e22d7a4a57c15c292fdd 2019-02-25 09:41 +0000 [360f543677] Torrey Searle * res/res_rtp_asterisk: smoother can cause wrong timestamps if dtmf happen Delivery timeval in the smoother object will fall behind while a DTMF is being generated. This can eventually lead to invalid rtp timestamps. To prevent this from happening the smoother needs to be reset after every DTMF to keep the timing up to date. ASTERISK-28303 #close Change-Id: Iaba3f7b428ebd72a4caa90e13b829ab4f088310f 2019-02-25 15:32 +0000 [574128dec6] Kevin Harwell * rest-api-templates/asterisk_processor - replace http line breaks with line feed Including line breaks (
,
,
) in certain parts of the rest-api json definition (e.g. summary, notes) displays them correctly in swagger. However, when the field gets converted to the wiki format those breaks get escaped and show up in the text as the actual string literal "
" etc... This patch makes it so when converting to the wiki format it replaces all line break values (
, etc...) with line feeds ('\n'). Change-Id: Ie1c9faa0d1c5d622804cc0a21ce769095b08aa3d 2019-02-25 06:10 +0000 [e687cf214d] Joshua C. Colp * res_ari_applications: Fix incorrect call to ao2_lock. When listing the applications the apps lock was incorrectly locked twice instead of being locked and then unlocked. ASTERISK-28302 Change-Id: If7d064592a9e88c0f1049214c50e02be6dabf79e 2019-02-21 12:06 +0000 [e6b67b2a5d] Joshua Colp * res_pjsip_sdp_rtp: Allow only single ssrc attribute. When processing SSRC attributes we were iterating through all of them, even though we only need to know the remote SSRC once. This was problematic because some browsers group SSRCs together on a stream, and due to our negotiation only end up using the first one. Since we set the second one as the remote SSRC we would drop the received media from them instead of allowing it through. In the future this may be extended to allow SSRC groups and to use information from the attributes. Change-Id: I4dc87087dbe56a83aa65f0f897bbd4ca75ec1270 2019-01-09 04:27 +0000 [b4ccaad671] Sungtae Kim * http.c: Support separated HTTP request Currently, the Asterisk does not support seperated HTTP request. This patch make the Asterisk enables to wait lest part of HTTP request. Also increases acceptable HTTP body length to 40k to support more larger request. ASTERISK-28236 Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1 2019-02-20 12:48 +0000 [bc8dead610] George Joseph * Core: Increase AST_PBX_MAX_STACK to 512 if not LOW_MEMORY The current settings AST_PBX_MAX_STACK is 128 entries which is too low for some FreePBX installations with complex parking arrangements. Increased to 512 if LOW_MEMORY is not defined. ASTERISK-28300 Change-Id: I7c4b540bc92e6642df0f3da639b003f7da8b1299 2019-02-20 12:22 +0000 [a286f546f1] Joshua C. Colp * stasis: Store subscriber uniqueids with topic statistics. This change provides an easier mechanism to determine which subscribers are subscribed to a topic. Using this you can inspect the specific subscribers for further details. Change-Id: I8deea21703cd5c5357b85593b46c3eaf24e18c0c 2019-02-15 12:53 +0000 [c2adeb9dc2] George Joseph * taskprocessor: Enable subsystems and overload by subsystem To prevent one subsystem's taskprocessors from causing others to stall, new capabilities have been added to taskprocessors. * Any taskprocessor name that has a '/' will have the part before the '/' saved as its "subsystem". Examples: "sorcery/acl-0000006a" and "sorcery/aor-00000019" will be grouped to subsystem "sorcery". "pjsip/distributor-00000025" and "pjsip/distributor-00000026" will bn grouped to subsystem "pjsip". Taskprocessors with no '/' have an empty subsystem. * When a taskprocessor enters high-water alert status and it has a non-empty subsystem, the subsystem alert count will be incremented. * When a taskprocessor leaves high-water alert status and it has a non-empty subsystem, the subsystem alert count will be decremented. * A new api ast_taskprocessor_get_subsystem_alert() has been added that returns the number of taskprocessors in alert for the subsystem. * A new CLI command "core show taskprocessor alerted subsystems" has been added. * A new unit test was addded. REMINDER: The taskprocessor code itself doesn't take any action based on high-water alerts or overloading. It's up to taskprocessor users to check and take action themselves. Currently only the pjsip distributor does this. * A new pjsip/global option "taskprocessor_overload_trigger" has been added that allows the user to select the trigger mechanism the distributor uses to pause accepting new requests. "none": Don't pause on any overload condition. "global": Pause on ANY taskprocessor overload (the default and current behavior) "pjsip_only": Pause only on pjsip taskprocessor overloads. * The core pjsip pool was renamed from "SIP" to "pjsip" so it can be properly grouped into the "pjsip" subsystem. * stasis taskprocessor names were changed to "stasis" as the subsystem. * Sorcery core taskprocessor names were changed to "sorcery" to match the object taskprocessors. Change-Id: I8c19068bb2fc26610a9f0b8624bdf577a04fcd56 2019-02-08 14:48 +0000 [8681fc9db7] Kevin Harwell * ARI event type filtering Event type filtering is now enabled, and configurable per application. An app is now able to specify which events are sent to the application by configuring an allowed and/or disallowed list(s). This can be done by issuing the following: PUT /applications/{applicationName}/eventFilter And then enumerating the allowed/disallowed event types as a body parameter. ASTERISK-28106 Change-Id: I9671ba1fcdb3b6c830b553d4c5365aed5d588d5b 2019-02-19 10:06 +0000 [f4c9a351d8] Joshua Colp * CI: Use tmpfs option to Docker instead of mount. Some tests require Asterisk to execute scripts which are stored in /tmp. When mount is used for tmpfs there is no ability to allow scripts to be executed from that location. This change switches to using tmpfs which can be told to allow executables to be run from /tmp. Change-Id: I0e598ca2b76af1f7f2d29f0da7b1731a214a291a 2019-02-08 14:47 +0000 [8f1b3edde8] Kevin Harwell * json.c/strings.c - Add a couple of utility functions Added 'ast_json_object_string_get' to the JSON wrapper in order to make it a little easier to retrieve a string field from the JSON object. Also added an 'ast_strings_equal' function that safely checks (checks for NULLs) for equality between two strings. Change-Id: I26f0a16d61537505eb41b4b05ef2e6d67fc2541b 2018-12-11 08:15 +0000 [ce0523a57e] Rodrigo Ramírez Norambuena * app_queue: Enable set the wrapuptime from AddQueueMember application This change add ability to set the wrapuptime per-member using the AddQueueMember application. The feature to set wrapuptime per member was include in the issue ASTERISK-27483 for static member by configuration file and was not added to set from AddQueueMember. ASTERISK-28055 #close Change-Id: I7c7ee4a6f804922cd7c42cb02eea26eb3806c6cf 2019-02-12 03:50 +0000 [8ea9608efb] Torrey Searle * res/res_rtp_asterisk: clear smoother when local bridging p2p_write updates txformat but doesn't require a smoother. If a smoother was created by another bridge type the smoother could fall out of date causing one way audio issues. To prevent this the smoother is now destroyed on the start of native bridge. ASTERISK-28284 #close Change-Id: I84e67f144963787fff9b4d79ac500514fb40cdc6 2019-02-14 17:09 +0000 [fb651756c7] sungtae kim * chan_pjsip: Changed to continued after invalid media for pjsip show channelstats Currently, the pjsip show channelstats cli does not show channel's stats after hits the invalid channel info. This makes hard to use this cli. Changed to keep iterate after hits the invalid channel info. ASTERISK-28292 Change-Id: I3efdff1c9e1b1efd3c971fb82ae77aa133a6f43c 2019-01-22 06:02 +0000 [7e1d881d89] Sungtae Kim * res_pjsip_session Added rtcp stats result vector into the session Currently, the Asterisk's pjsip_session module does not keeping the rtcp's stats info after it was removed. But by adding the results vector and keeping it until session is destroying, it can give more useful information for other modules. ASTERISK-28253 Change-Id: Ib25c2d3fc4da084aecfde2a82c1b1d733bd64fa5 2019-02-07 09:52 +0000 [c2ea9c90a2] Joshua Colp * ci: Rerun unit tests when non-code changes occur. This change makes it so that even if non-code changes occur (such as commit message changing) unit tests will still be run and result in a verification. ASTERISK-28251 Change-Id: I6491fff7c93e5d5cd8e41054486968bf66c4f608 2019-02-07 09:23 +0000 [61a8f79a29] Kevin Harwell * res_pjsip_registrar: lock transport monitor when setting 'removing' flag A previous patch attempt to mitigate blocked threads on transport shutdown for a given contact. It was thought that a second lock could be avoided by checking the 'removing' flag on the transport monitor twice (once before and once after the normal named aor locking). However as with usual threading issues if the timing was right the original problem still occured. This patch adds locking around the first 'removing' flag check and set, thus nullifying the secondary check, so it was removed. ASTERISK-28213 Change-Id: Iaa8e36e5311789549b76d8de42dfcea96013b2ed 2019-02-06 06:16 +0000 [54a912b26d] Joshua Colp * res_odbc: Add basic query logging. When Asterisk is connected and used with a database the response time of the database can cause problems in Asterisk if it is long. Normally the only way to see this problem would be to retrieve a backtrace from Asterisk and examine where things are blocked, or examine the database to see if there is any indication of a problem. This change adds some basic query logging to make it easier to investigate such a problem. When logging is enabled res_odbc will now keep track of the number of queries executed, as well as the query that has taken the longest time to execute. There is also an option which will cause a WARNING message to be output if a query takes longer than a configurable amount of time to execute. This makes it easier and clearer for users that their database may be experiencing a problem that could impact Asterisk. ASTERISK-28277 Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6 2018-12-05 16:09 +0000 [5a2a7d65b5] Sungtae Kim * main/cdr: Fixed cdr start overwriting The CDR was overwriting the start time when the call continued the dialplan from the ARI stasis or a Local channel was originated. This change fixes this by no longer reinitializing the CDR when transitioning out of the dialed pending state to the single state. ASTERISK-28181 Change-Id: I921bc04064b6cff1deb2eea56a94d86489561cdc 2018-11-19 18:44 +0000 [e2bbab17b3] Giuseppe Sucameli * Fix deadlock handling subscribe req during res_parking reload Split destroy_hint method to separate hint removal and extension hint state changed callback, the latter now called via stasis. This avoids deadlock between res_parking reload that is removing the parking lot and the related hint and subscribe requests coming for the same parking lot. ASTERISK-28173 Change-Id: I5b03c3455b3b12b6f83cea4cc34f4b4b20444f7e 2019-02-04 13:55 +0000 [f174eb4ac1] Sean Bright * sounds: Sort 'core show sounds' output Change-Id: Ib39052a745040f75eb635f15a042da15b20e22ab 2019-01-29 10:48 +0000 [3f9c5fba95] Ben Ford * res_stasis: Auto-create context and extens on Stasis app launch. At AstriCon, there was a strong desire for the ability to completely bypass dialplan when using ARI. This is possible through the automatic creation of a context and a couple of extensions whenever an application is started. For example, if you have an application named 'ari-example', a context named 'stasis-ari-example' will be automatically created whenever this application is started as long as one does not already exist. Two extensions (a match-all extension for Stasis and a 'h' extension) are created within this context. Any endpoint that registers to Asterisk within this context will send all calls to the corresponding Stasis application. When the application is destroyed, the context is removed. ASTERISK-28104 #close Change-Id: Ie35bd93075e05b05e3ae129a83c9426931b7ebac 2019-02-04 07:09 +0000 [ac2d302c2c] George Joseph * bundled-jansson: On OpenSuse Leap libjansson.a was placed in lib64 On OpenSuse Leap, libjansson.a is installed in third-party/jansson/dest/lib64 instead of lib (which is where the top-level makeopts looks). This causes a link failure. * Updated jansson/Makefile to add an explicit --libdir to force the installation to third-party/jansson/dest/lib. ASTERISK-28271 Reported by: David Wilcox Change-Id: Ibf8af75e5da13562105fcc39ed898c6ef0b5a5f3 2019-01-28 17:21 +0000 [ac90968afd] sungtae kim * Added ARI resource /ari/asterisk/ping Added ARI resource. GET /ari/asterisk/ping : It returns "pong" message with timestamp and asterisk id. It would be useful for simple heath check. Change-Id: I8d24e1dcc96f60f73437c68d9463ed746f688b29 2019-01-15 17:20 +0000 [f668db9ba0] Kevin Harwell * pjsip/config_global: regcontext context not created The context specified by 'regcontext' was not being created, so when Asterisk attempted to later dynamically add an extension it would fail. This patch now creates the context if a 'regcontext' is specified. ASTERISK-28238 Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265 2019-01-22 09:02 +0000 [7071e9d64c] George Joseph * media_index.c: Refactored so it doesn't cache the index Testing revealed that the cache added no benefit but that it could consume excessive memory. Two new index related functions were created: ast_sounds_get_index_for_file() and ast_media_index_update_for_file() which restrict index updating to specific sound files. The original ast_sounds_get_index() and ast_media_index_update() calls are still available but since they no longer cache the results internally, developers should re-use an index they may already have instead of calling ast_sounds_get_index() repeatedly. If information for only a single file is needed, ast_sounds_get_index_for_file() should be called instead of ast_sounds_get_index(). The media_index directory scan code was elimininated in favor of using the existing ast_file_read_dirs() function. Since there's no more cache, ast_sounds_index_init now only registers the sounds cli commands instead of generating the initial index and subscribing to stasis format register/unregister messages. "sounds" is no longer a valid target for the "module reload" command. Both the sounds cli commands and the sounds ari resources were refactored to only call ast_sounds_get_index() once per invocation and to use ast_sounds_get_index_for_file() when a specific sound file is requested. Change-Id: I1cef327ba1b0648d85d218b70ce469ad07f4aa8d 2019-01-25 12:27 +0000 [0bcaadc037] Kevin Harwell * codecs.conf.sample: update codec opus docs The option value "sdp" for some of the settings was removed a while back, however the sample conf was not updated. This patch removes any wording with regards to the old "sdp" option value, and adjusts the defaults to what they are now. ASTERISK-28263 Change-Id: I41bfa44e9f69446bcc5c8fd92e3675c676fdc445 2019-01-22 09:24 +0000 [aede739778] eyalhasson * format_g726: add support for seeking Added support for the seek function in format_g726 so playback can start from anywhere. Before the fix, playback of g726 files always started from the beginning. ASTERISK-28246 Change-Id: I626235bc4642df1479050d3d06828412603a9b40 2019-01-23 04:45 +0000 [69e9fd63e1] Jeremy Lainé * res_http_websocket: ensure control frames do not interfere with data Control frames (PING / PONG / CLOSE) can be received in the middle of a fragmented message. In order to ensure they do not interfere with the reassembly buffer, we exit early and do not return the payload to the caller. ASTERISK-28257 #close Change-Id: Ia5367144fe08ac6141bba3309517a48ec7f013bc 2019-01-23 07:59 +0000 [d9fae4a824] Jean Aunis * build : Fix cross-compilation errors Bundled pjproject and jansson must be configured with the host and build parameters provided to the configure script. Autotools do not permit to check for the existence of local header files, so the control of hrirs.h must not be done when cross-compiling. ASTERISK-28250 Change-Id: If0a76e52a87d4ab82b7d4c72d27d8759ca931880 2019-01-22 15:03 +0000 [f9ca0afb39] Gerald Schnabel * manager_channels: Fix throwing of HangupHandler manager events The type value extracted from stasis message data in channel_hangup_handler_cb isn't compared against the valid values "run", "pop" and "push". Thus the manager events HangupHandlerPush, HangupHandlerPop and HangupHandlerRun are never thrown. This regression was introduced by ASTERISK_21462. ASTERISK-28252 Change-Id: I9956e35e18da1873113644df1ddc3c7cd37bf524 2019-01-19 15:55 +0000 [1c8378bbc9] Chris-Savinovich * Test_cel: Fails when DONT_OPTIMIZE is off A bug in GCC causes TEST_CEL to return failure under the following conditions: 1. TEST_FRAMEWORK on 2. DONT_OPTIMIZE off 3. Fedora and Ubuntu 4. GCC 8.2.1 5. Test name: test_cel_dial_pickup 6. There must exist a certain combination of multithreading. The bug affects arithmetic calculations when the optimization level is bigger than O1 and the -fpartial-inline flag is on. Provided these conditions, function ast_str_to_lower() fails to convert to lower case due to said function being of type force_inline. The solution is to remove the "force_inline" type declaration from function ast_str_to_lower() Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7 2018-12-10 07:20 +0000 [c6980e32ae] George Joseph * app_voicemail: Add Mailbox Aliases You can now define an "aliases" context in voicemail.conf whose entries point to actual mailboxes. These can be used anywhere the mailbox is specified. Example: [general] aliasescontext = myaliases [default] 1234 = yadayada [myaliases] 4321@devices = 1234@default Now you can use 4321@devices to refer to the 1234@default mailbox. This can be useful to provide channel drivers with constant mailbox specifications such as @devices leaving app_voicemail to control exactly which mailbox the alias points to. Now, only voicemail has to be reloaded to make changes instead of individual channel drivers which are usually more expensive to reload. Change-Id: I395b9205c91523a334fe971be0d1de4522067b04 2019-01-22 12:07 +0000 [b82d2856b4] Kevin Harwell * res_pjsip_registrar: mitigate blocked threads on reliable transport shutdown When a reliable transport is shutdown it's possible for the pjsip registrar resource shutdown handler to get called multiple times. If this happens and one of the threads is taking "too long" (slow database call for instance) then the others get blocked waiting to delete. Since it only takes one to delete the contact then the other threads should be able to continue on if one of the threads is currently "deleting". This patch makes it so now when a thread enters the shutdown handler it checks to see if a thread is currently already "deleting". If so, then the thread does not attempt to get the lock, and instead continues on thus avoiding the blockage. ASTERISK-28213 #close Change-Id: I7563ca596312b1dff4f3ab41483e89fe2862328a 2019-01-22 09:02 +0000 [deffb8a6e0] George Joseph * pjproject_bundled: Add patch for double free issue in timer heap Fixed #2172: Avoid double reference counter decrements in timer in the scenario of race condition between pj_timer_heap_cancel() and pj_timer_heap_poll(). Change-Id: If000e9438c83ac5084b678eb811e902c035bd2d8 2018-12-16 06:43 +0000 [a526676836] Xiemin Chen * bridge_softmix: Use MSID:LABEL metadata as the cloned stream's appendix To avoid the stream name collide if there're more than one video track in one client. If client has multi video tracks, the name of ast_stream which represents each video track may be the same. Use the MSID:LABEL here because it's identifiable. ASTERISK-28196 #close Reported-by: xiemchen Change-Id: Ib62b2886e8d3a30e481d94616b0ceaeab68a870b 2019-01-08 01:38 +0000 [0b8867f7d6] Jeremy Lainé * res_http_websocket: respond to CLOSE opcode This ensures that Asterisk responds properly to frames received from a client with opcode 8 (CLOSE) by echoing back the status code in its own CLOSE frame. Handling of the CLOSE opcode is moved up with the rest of the opcodes so that unmasking gets applied. The payload is no longer returned to the caller, but neither ARI nor the chan_sip nor pjsip made use of the payload, which is a good thing since it was masked. ASTERISK-28231 #close Change-Id: Icb1b60205fc77ee970ddc91d1f545671781344cf 2019-01-18 16:11 +0000 [20f672539e] Sean Bright * pjsip_transport_management: Shutdown transport immediately on disconnect The transport management code that checks for idle connections keeps a reference to PJSIP's transport for IDLE_TIMEOUT milliseconds (32000 by default). Because of this, if the transport is closed before this timeout, the idle checking code will keep the transport from actually being shutdown until the timeout expires. Rather than passing the AO2 object to the scheduler task, we just pass its key and look it up when it is time to potentially close the idle connection. The other transport management code handles cleaning up everything else for us. Additionally, because we use the address of the transport when generating its name, we concatenate an incrementing ID to the end of the name to guarantee uniqueness. Related to ASTERISK~28231 Change-Id: I02ee9f4073b6abca9169d30c47aa69b5e8ae9afb 2019-01-20 12:15 +0000 [17f76d27cc] Valentin Vidic * channel.c: Fix segfault with Monitor(wav,file,i) If the Monitor is started with the i option the read_stream will be NULL. One code path in channel.c checks if write_stream is set but than uses read_stream instead causing a segfault. ASTERISK-28249 Change-Id: I1bae9126537be54895c7fea2d08dd9488d8cc525 2019-01-10 13:34 +0000 [1323730f6c] Joshua C. Colp * stasis / manager / ari: Better filter messages. Previously both AMI and ARI used a default route on their stasis message router to handle some of the messages for publishing out their respective connection. This caused messages to be given to their subscription that could not be formatted into AMI or JSON. This change adds an API call to the stasis message router which allows a default route to be set as well as formatters that the default route is expecting. This allows both AMI and ARI to specify that their default route only wants messages of their given formatter. By doing so stasis can more intelligently filter at publishing time so that they do not receive messages which will not be turned into AMI or JSON. ASTERISK-28244 Change-Id: I65272819a53ce99f869181d1d370da559a7d1703 2019-01-17 09:56 +0000 [58b55f2a30] Sean Bright * sched: Make sched_settime() return void because it cannot fail Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5 2019-01-04 17:14 +0000 [2b8602e8cf] Sean Bright * res_pjsip_transport_websocket: Don't assert on 0 length payloads When --enable-dev-mode is used, pjsip_tpmgr_receive_packet() will assert if passed a payload length of 0, so treat empty frames as if we didn't receive them. Change-Id: I9c5fdccd89cc8d2f3ed7e3ee405ef0fc78178f48 2019-01-12 02:29 +0000 [d60ee2eeae] Mohit Dhiman * stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure. During Bridging of two channels if masquerade operation is performed on a channel (clone channel) which was created with endpoint details (ast_channel_alloc_with_endpoint()) and the original channel which is created without endpoint details (ast_channel_alloc()) then both the channels must exchange their endpoint details or else after masquerade when clone channel is being destroyed the endpoint cleanup callbacks will be destroyed too and after call completion unique_id of original channel will still be there in ast_endpoint structure's channel_ids container. ASTERISK-28197 Change-Id: I97ce73da390af20fd082fb09d722a6fe9cb2f39d 2019-01-11 09:48 +0000 [f0546d1d87] Alexei Gradinari * res_pjsip: add option to enable ContactStatus event when contact is updated The commit I2f97ebfa79969a36a97bb7b9afd5b6268cf1a07d removed sending out the ContactStatus AMI event when a contact is updated. Thist change broke things which rely on old behavior. This patch adds a new PJSIP global configuration option 'send_contact_status_on_update_registration' to be able to preserve old ContactStatus behavior. By default new behavior, i.e. the ContactStatus event will not be sent when a device refreshes its registration. Change-Id: I706adf7584e7077eb6bde6d9799ca408bc82ce46 2019-01-07 08:06 +0000 [18e206381a] Joshua Colp * res_pjsip_sdp_rtp: Only enable abs-send-time when WebRTC is enabled. For video streams it was possible for the abs-send-time information to be placed into RTP streams even if not negotiated. Depending on the endpoint in use this could cause video to not flow. We now only enable abs-send-time for negotiation if WebRTC is enabled. ASTERISK-28230 Change-Id: I0eb682302f8da3a4ea3c42e839208d55f825ed0c 2019-01-05 11:14 +0000 [7bd30905fd] Diederik de Groot * RAII: Change order or variables in clang version This prevents use-after-scope issues when unwinding the stack, which happens in reverse order. The varname variable needs to remain alive for the destruction to be able to access it. Issue was found using clang + address-sanitizer. ASTERISK-28232 #close Change-Id: I00811c34ae910836a5fb6d22304528aef92624db 2019-01-04 09:57 +0000 [f662a26ea0] Alexei Gradinari * RTP: reset DTMF last seqno/timestamp on RTP renegotiation The remote side may start a new stream when renegotiating RTP. Need to reset the DTMF last sequence number and the timestamp of the last END packet on RTP renegotiation. If the new time stamp is lower then the timestamp of the last DTMF END packet the asterisk drops all DTMF frames as out of order. This bug was caught using Cisco ip-phone SPA5XX and codec g722. On SIP session update the SPA50X resets stream and a new timestamp is twice smaller then the previous. ASTERISK-28162 #close Change-Id: Ic72b4497e74d801b27a635559c1cf29c16c95254 2019-01-02 11:44 +0000 [2c48b5d9bf] Bryan Boatright * app_voicemail: Fix Channel variable VM_MESSAGEFILE for "urgent" voicemail If a voicemail is marked "urgent" then the VM_MESSAGEFILE channel variable is not updated correctly since urgent messages are in a different directory. The fix is to update the channel variable when the path to the urgent message is created. ASTERISK-28225 Change-Id: I8efbace06e6122ea0793f7bdb073d4378e8274ca 2019-01-02 11:33 +0000 [b7b080a0aa] Joshua Colp * app_queue: Fix crash when using 'b' option on non-ringall queue. When using the 'b' option to Queue with a queue that was not configured for ring all a crash would occur as the wrong pointer would be used. ASTERISK-28218 Change-Id: If1390f64e321047dff24fd2410c95dde74904980 2018-12-19 13:02 +0000 [7c08ff51d7] Richard Mudgett * stasic.c: Fix printf format type mismatches with arguments. An int64_t is not likely the same size as a long. * Changed the int64_t values in the statistics structs to longs so casting is not necessary when generating the formatted CLI output. The offending members did not need to be int64_t anyway as they were only set by an int type variable which was already truncating bits. * Reordered the statistics structs to reduce potential padding bytes. Change-Id: Ic090a070e9dc4ca650ebdb9c01ed50a581289962 2018-12-26 11:49 +0000 [110934706f] Corey Farrell * stasis: Fix ABI between DEVMODE and non-DEVMODE. Eliminate differences with DEVMODE prototypes for public functions. ASTERISK-28212 #close Change-Id: I872c04842ab6b61e9dd6d37e4166bc619aa20626 2018-12-26 10:26 +0000 [4c084c6b1b] George Joseph * Revert "stasis_cache: Stop caching stasis subscription change messages" This reverts commit 5ec6d2c33e3b02755e0b2ea3fc94f048af5c741f. This commit caused issues with polling when combined with the revert commit "Revert "app_voicemail: Remove need to subscribe to stasis" ASTERISK-28222 Reported by: abelbeck Change-Id: I1e83a433e4202574181bc128dce876ef24936a52 2018-12-24 11:42 +0000 [809e836265] George Joseph * ast_coredumper: Refactor the pid determination process In order to get a dump of the running process, we need to find the pid of the main asterisk process. This can be tricky if there are also instances of "asterisk -r" running or if an alternate location for asterisk.conf was specified on the command line with the -C option that also specified an alternation location for the pid file. So now... 1. We find the asterisk executable with "which" or the --asterisk-bin command line option. 2. If there's only 1 process with an executable path that matches, we use that pid. If not... 3. We try " -rx 'core show settings'" and parse the output to find the pidfile, then read that for the pid. If that didn't work... 4. We get a list of all the pids matching and look in /proc//cmdline for a -C argument and retry the "core show settings" using the same -C option. We can't parse the output of "ps" to get the -C path because it may contain spaces. The contents of /proc//cmdline are delimited by NULLs. For BSDs we may have to mount /proc first. :( ASTERISK-28221 Reported by: Andrew Nagy Change-Id: I8aa1f3f912f949df2b5348908803c636bde1d57c 2018-12-19 12:39 +0000 [314782e874] Richard Mudgett * backtrace.c: Fix casting pointer to/from integral type. The backtrace library bfd.h include file does not get the sizes of pointers and ints right on some platforms. On my old test box the size of bfd_vma is 8 while the size of a pointer is 4. gcc on the box complains of the integer casting to/from pointers size mismatch. * uintptr_t to the rescue by doing an appropriate two stage cast. Change-Id: Icb2621583f50c8728de08a3c824d95fe53cc45d0 2018-12-18 10:33 +0000 [c23c8d92d5] George Joseph * app_voicemail: Don't delete mailbox state unless mailbox is deleted The free_user function was automatically deleting the stasis mailbox state but this only makes sense when the mailbox is actually deleted, not just the structure freed. This was causing issues where leave_voicemail would publish the mwi message to stasis and delete the state before the message could be processed by res_pjsip_mwi. * Removed the delete of state from free_user(). * Created a new free_user_final() function that both frees the data structure and deletes the state. This function is only called during module load/unload where it's appropriate to delete the state. ASTERISK-28215 Change-Id: I305e8b3c930e9ac41d901e5dc8a58fd7904d98dd 2018-12-14 11:52 +0000 [357219dfb3] Sean Bright * res_rtp_asterisk: Remove some unused structure fields. All of the fields that were removed were no longer referenced except for 'lastrxts' and 'rxseqno' which were only ever written to. Change-Id: I5a5d31eb33e97663843698f58d0d97f22a76627c 2018-12-13 15:56 +0000 [5b12dfa6dd] Sean Bright * res_format_attr_h264.c: Make sure profile-level-id fmtp attribute is set The profile-iop octet (the 2nd) of profile-level-id can be zero according to RFC 6184 Section 8.1. So we ignore its value when deciding to include profile-level-id in the outgoing SDP. ASTERISK-27959 #close Reported by: David Kuehling Change-Id: Id28cd916a3d7748058fe9609b585d07d9e243f73 2018-12-11 14:49 +0000 [3db1df301e] Sean Bright * bridge_builtin_features.c: Set auto(mix)mon variables on both channels This is how features behaved up through Asterisk 11, but was changed when the new bridging framework was implemented in Asterisk 12. Reported by rrittgarn in #asterisk. Change-Id: I72cf86223947a8118c75f46e2c603dbc11e3125b 2018-12-07 14:22 +0000 [cb1a08bdcb] Alexei Gradinari * confbridge: announce to the marked users when they join an empty conference Currently the file sound_only_person is not played when a marked user (with announce_only_user=yes) joins an empty conference. This patch fixes it. ASTERISK-28201 #close Change-Id: I85b67687e6b220939c3af8091d83a70a7b174cf4 2018-11-30 05:40 +0000 [fe07093660] Joshua C. Colp * stasis: Add statistics gathering in developer mode. This change adds statistics gathering to Stasis topics, subscriptions, and message types. These can be viewed using CLI commands and provide insight into how Stasis is used and how long certain operations take to execute. These are only available when Asterisk is compiled in developer mode and do not have any impact under normal operation. ASTERISK-28117 Change-Id: I94411b53767f89ee01714daaecf0c2f1666e863f 2018-12-11 08:54 +0000 [42ff856216] Sean Bright * Use non-blocking socket() and pipe() wrappers Change-Id: I050ceffe5a133d5add2dab46687209813d58f597 2018-12-11 09:06 +0000 [bedf16b041] Sean Bright * utils: Don't set or clear flags that don't need setting or clearing Change-Id: I0e7fb507ac09b15e45e1ff8501ecfca67afa5217 2018-12-11 06:55 +0000 [00b36bb045] Sean Bright * build: Update config.guess and config.sub Pulled from the authoritative respository at: https://git.savannah.gnu.org/cgit/config.git/tree/ Change-Id: I748708ce24d4d47ff1f395075d0b08d3da3355e0 2018-12-11 08:28 +0000 [d1598dbc7d] George Joseph * Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit" This reverts commit 3f53041267234b21aedd522c1197ec57cca90845. Pending resolution of ASTERISK_28200 Change-Id: Iad4f3614cac95b00fdbb2b799aab8ae6285ec988 2018-12-06 11:23 +0000 [a24bb1c4b6] Sebastian Damm * res/res_ari: Add additional hangup reasons The ARI DELETE /channels command takes a "reason" parameter Previously, there were only five reasons implemented This patch adds more reasons to choose from for more complex setups ASTERISK-28198 #close Change-Id: I85996f1076c9946d65c778413f040a845a90fecc 2018-12-07 06:57 +0000 [6d69fb3cc2] Sean Bright * utils: Wrap socket() and pipe() to reduce syscalls Some platforms provide an implementation of socket() and pipe2() that allow the caller to specify that the resulting file descriptors should be non-blocking. Using these allows us to potentially elide 3 calls into 1 by avoiding extraneous calls to fcntl() to set the O_NONBLOCK flag afterwards. In passing, change ast_alertpipe_init() to use pipe2() directly instead of the wrapper if it is available. Change-Id: I3ebe654fb549587537161506c6c950f4ab298bb0 2018-11-29 09:53 +0000 [3f3dd992a2] George Joseph * stasis: Allow filtering by formatter A subscriber can now indicate that it only wants messages that have formatters of a specific type. For instance, manager can indicate that it only wants messages that have a "to_ami" formatter. You can combine this with the existing filter for message type to get only messages with specific formatters or messages of specific types. ASTERISK-28186 Change-Id: Ifdb7a222a73b6b56c6bb9e4ee93dc8a394a5494c 2018-12-05 15:28 +0000 [b899119a5d] David M. Lee * Removing registrar_expire from basic-pbx config The module has been removed, so it shouldn't be in the default config any more. Change-Id: Ie7e09f00f9c9a885574e29478250de4c2cefd9f1 2018-12-04 18:00 +0000 [0bde3751a0] Giuseppe Sucameli * chan_sip: Fix leak using contact ACL Free old peer's contactacl before overwrite it within build_peer. ASTERISK-28194 Change-Id: Ie580db6494e50cee0e2a44b38e568e34116ff54c 2018-12-05 09:37 +0000 [19c4e0f592] George Joseph * CI: Various updates to buildAsterisk.sh * Added ---no-configure, --no-menuselect, --no-make and --no-alembic options that prevent those actions from being performed. Useful for testing and re-running portions of the build after fixing earlier failures. * Added "set -e" to abort the script on command failure. Not sure why this wasn't there in the first place. * Fixed a few echos that were redirecting to stderr when they shouldn't have been. * Catch more alembic failures by actually trying to generate the SQL. Change-Id: I9f395fa4e9254be7299e7c1014f1a13db78faffb 2018-12-03 17:45 +0000 [cbb7633ad3] Kevin Harwell * pjsip_add_use_callerid_contact: fixed alembic script Change-Id: I413f1583c797fb79651786cd8d0b003599f8ed10 2018-12-03 16:41 +0000 [8f5df046f6] Sean Bright * core: Add some documentation to the malloc_trim code This adds documentation to handle_cli_malloc_trim() indicating how it can be useful when debugging OOM conditions. Change-Id: I1936185e78035bf123cd5e097b793a55eeebdc78 2018-12-03 14:01 +0000 [58e50e56cb] Chris-Savinovich * core: Merge malloc_trim patch We've had multiple opportunities where Richard Mudgett's malloc_trim patch has been useful. Let's get it pushed up to gerrit and merged. Since malloc_trim is only available in libc, an entry is added to configure.ac to create a definition for HAVE_MALLOC_TRIM. Change-Id: Ia38308c550149d9d6eae4ca414a649957de9700c 2018-11-11 10:29 +0000 [8644511cbf] Sungtae Kim * res_pjsip: Patch for res_pjsip_* module load/reload crash The session_supplements for the pjsip makes crashes when the module load/unload. ASTERISK-28157 Change-Id: I5b82be3a75d702cf1933d8d1417f44aa10ad1029 2018-10-22 07:47 +0000 [140702ba2d] lvl * app_queue: Revert broken queue channel reference patch Revert commit 6409e7b11a2310196a9978b30a6b79e2760be592, and add NULL checks for all app_queue event handling code. Related issues: ASTERISK~25185, ASTERISK~27006, ASTERISK~25844 ASTERISK-28125 Change-Id: I37334ea184ebb56e54471496b82937d4927815a0 2018-11-30 14:00 +0000 [6c13b20803] Chris-Savinovich * test_websocket_client.c: Disable websocket_client_create_and_connect test. This test was occasionally failing, with: WARNING[5812]: http.c:1939 httpd_helper_thread: Failed to set TCP_NODELAY on HTTP connection: Bad file descriptor ERROR[5812]: iostream.c:91 ast_iostream_nonblock: Failed to get fcntl() flags for file descriptor: Bad file descriptor ERROR[5812]: iostream.c:569 ast_iostream_close: close() failed: Bad file descriptor Disabled for now by making the test explicit only. Change-Id: I778f6cbb6104c6b4e89737a2eaf1a9540888d351 2018-11-28 01:14 +0000 [ecb9ed0958] Pirmin Walthert * pjproject_bundled: check whether UPDATE is supported on outgoing calls In ASTERISK-27095 an issue had been fixed because of which chan_pjsip was not trying to send UPDATE messages when connected_line_method was set to invite. However this only solved the issue for incoming INVITES. For outgoing INVITES (important when transferring calls) the options variable needs to be updated at a different place. ASTERISK-28182 #close Reported-by: nappsoft Change-Id: I76cc06da4ca76ddd6dce814a8b97cc66b98aaf29 2018-11-29 13:26 +0000 [4f0bf0270e] George Joseph * Revert "app_voicemail: Remove need to subscribe to stasis" This reverts commit 29115e23848cceee0e2763bc70e87cb311919cdd. That commit closed a long standing hole which allowed subscriptions to mailboxes that weren't configured in voicemail.conf. This caused an issue with FreePBX which depdended on that behavior. The commit is being reverted until FreePBX can handle the new behavior. ASTERISK-28151 Reported by: Ronald Raikes Change-Id: I57b7b85e75d7dd97c742b5c69d718a0f61260c15 2018-11-26 16:18 +0000 [f4924d40db] George Joseph * test_cel: Plug a few ref leaks These are only a few of the leaks. The large number of macros and return paths in this file would make a weeks worth of work to plug them all. Change-Id: Ie2369fa944023d44767871c5c30974cb077ffb56 2018-09-19 14:34 +0000 [3667c5e1d2] George Joseph * bridges: Remove reliance on stasis caching * The bridging core no longer uses the stasis cache for bridge snapshots. The latest bridge snapshot is now stored on the ast_bridge structure itself. * The following APIs are no longer available since the stasis cache is no longer used: ast_bridge_topic_cached() ast_bridge_topic_all_cached() * A topic pool is now used for individual bridge topics. * The ast_bridge_cache() function was removed since there's no longer a separate container of snapshots. * A new function "ast_bridges()" was created to retrieve the container of all bridges. Users formerly calling ast_bridge_cache() can use the new function to iterate over bridges and retrieve the latest snapshot directly from the bridge. * The ast_bridge_snapshot_get_latest() function was renamed to ast_bridge_get_snapshot_by_uniqueid(). * A new function "ast_bridge_get_snapshot()" was created to retrieve the bridge snapshot directly from the bridge structure. * The ast_bridge_topic_all() function now returns a normal topic not a cached one so you can't use stasis cache functions on it either. * The ast_bridge_snapshot_type() stasis message now has the ast_bridge_snapshot_update structure as it's data. It contains the last snapshot and the new one. * cdr, cel, manager and ari have been updated to use the new arrangement. Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369 2018-11-07 11:18 +0000 [50ac85cb40] Joshua Colp * stasis: Segment channel snapshot to reduce creation cost. When a channel snapshot was created it used to be done from scratch, copying all data (many strings). This incurs a cost when doing so. This change segments the channel snapshot into different components which can be reused if unchanged from the previous snapshot creation, reducing the cost. In normal cases this results in some pointers being copied with reference count being bumped, some integers being set, and a string or two copied. The other benefit is that it is now possible to determine if a channel snapshot update is redundant and thus stop it before a message is published to stasis. The specific segments in the channel snapshot were split up based on whether they are changed together, how often they are changed, and their general grouping. In practice only 1 (or 0) of the segments actually get changed in normal operation. Invalidation is done by setting a flag on the channel when the segment source is changed, forcing creation of a new segment when the channel snapshot is created. ASTERISK-28119 Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423 2018-10-10 09:28 +0000 [d0ccbb3377] Joshua Colp * stasis: Use an implementation specific channel snapshot cache. Channels no longer use the Stasis cache for channel snapshots. Instead they are stored in a hash table in stasis_channels which reduces the number of Stasis messages created and allows better storage. As a result the following APIs are no longer available since the stasis cache is no longer used: ast_channel_topic_cached() ast_channel_topic_all_cached() The ast_channel_cache_all() and ast_channel_cache_by_name() functions now return an ao2_container of ast_channel_snapshots rather than a container of stasis_messages therefore you can't (and don't need to) call stasis_cache functions on it. The ast_channel_topic_all() function now returns a normal topic not a cached one so you can't use stasis cache functions on it either. The ast_channel_snapshot_type() stasis message now has the ast_channel_snapshot_update structure as it's data. It contains the last snapshot and the new one. ast_channel_snapshot_get_latest() still returns the latest snapshot. The latest snapshot is now stored on the channel itself to eliminate cache hits when Stasis messages that have the snapshot as a payload are created. ASTERISK-28102 Change-Id: I9334febff60a82d7c39703e49059fa3a68825786 2018-11-26 06:09 +0000 [8e1ab4f11c] Corey Farrell * jansson: Upgrade to 2.12. This brings in jansson-2.12, removes all patches that were merged upstream. README is created in third-party/jansson/patches to explain how to add patches but also because the patches folder must exist for the build process to succeed. Change-Id: If0f2d541c50997690660c21fb7b03d625a5cdadd 2018-11-23 09:40 +0000 [3f53041267] Alexei Gradinari * RTP: need to reset DTMF last seqno/timestamp on voice packet with marker bit The marker bit set on the voice packet indicates the start of a new stream and a new time stamp. Need to reset the DTMF last sequence number and the timestamp of the last END packet. If the new time stamp is lower then the timestamp of the last DTMF END packet the asterisk drops all DTMF frames as out of order. This bug was caught using Cisco ip-phone SPA50X and codec g722. On SIP session update the SPA50X resets stream indicating it with market bit and a new timestamp is twice smaller then the previous. ASTERISK-28162 #close Change-Id: If9c5742158fa836ad549713a9814d46a5d2b1620 2018-11-19 14:10 +0000 [021ce938ca] Corey Farrell * astobj2: Remove legacy ao2_container_alloc routine. Replace usage of ao2_container_alloc with ao2_container_alloc_hash or ao2_container_alloc_list. Remove ao2_container_alloc macro. Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088 2018-11-14 05:02 +0000 [bc7f4f4db3] Corey Farrell * astobj2: Create function to copy weak proxied objects from container. Create ao2_container_dup_weakproxy_objs to perform a similar function to ao2_container_dup. This function expects the source container to have weakproxy objects, inserts the associated non-weak objects into the destination container. Orphaned weakproxy objects are ignored. Create test for this new function and for ao2_weakproxy_find. Change-Id: I898387f058057e08696fe9070f8cd94ef3a27482 2018-11-16 14:45 +0000 [4b5d11ec17] Michael Walton (license 6502) * func_strings: HASHKEY - negative array index can cause corruption This patch makes it so only matching non-empty key names, and keys created by the HASH function are eligible for inclusion in the comma separated string. It also fixes a bug where it was possible to write to a negative index if the result buffer was empty. ASTERISK-28159 patches: ASTERISK-28159.diff submitted by Michael Walton (license 6502) Change-Id: I6e57fe7307dfd856271753aed5ba64c59b511487 2018-11-19 11:59 +0000 [bcdfb90362] George Joseph * CI: Get job timeouts from environment The job timeouts were hard coded in the jenkinsfiles which means changes had to go through gerrit. Now they are taken from the following environment variables (and their defaults) that can be set in Jenkins configuration... TIMEOUT_GATES = "60 MINUTES" TIMEOUT_DAILIES = "3 HOURS" TIMEOUT_REF_DEBUG = "24 HOURS" TIMEOUT_UNITTESTS = "30 MINUTES" Change-Id: I673a551c1780bf665a3bc160b245da574aa4bbab 2018-11-19 07:00 +0000 [64e21c9ea9] Corey Farrell * app_queue: Cleanup queue_ref / queue_unref routines. This replaces the inline functions with macros. This removes the need to directly use __ao2_ref, opts instead for standard ao2_bump and ao2_cleanup macros. Change-Id: If4e04e9bab2e3c883188437cb9f487b3e498a21b 2018-11-08 09:53 +0000 [ece5f8015f] George Joseph * backtrace: Refactor ast_bt_get_symbols so it doesn't crash We've been seeing crashes in libbfd when we attempt to generate a stack trace from multiple threads. It turns out that libbfd is NOT thread-safe. It can cache the bfd structure and give it to multiple threads without protecting itself. To get around this, we've added a global mutex around the bfd functions and also have refactored the use of those functions to be more efficient and to provide more information about inlined functions. Also added a few more tests to test_pbx.c. One just calls ast_assert() and the other calls ast_log_backtrace(). Neither are run by default. WARNING: This change necessitated changing the return value of ast_bt_get_symbols() from an array of strings to a VECTOR of strings. However, the use of this function outside Asterisk is not likely. ASTERISK-28140 Change-Id: I79d02862ddaa2423a0809caa4b3b85c128131621 2018-11-18 17:53 +0000 [56eb18f395] Joshua C. Colp * stasis: Remove stringfields and lock from change message. When a subscribe or unsubscribe occurs a message is published containing this information. This change makes it so that the message no longer uses stringfields or a lock, as both are not really needed for the message. Change-Id: I3f4831931d79f94fd979baf48048738df5dc1632 2018-11-13 09:28 +0000 [fa048183aa] Alexei Gradinari * pjsip: New function PJSIP_PARSE_URI to parse URI and return part of URI New dialplan function PJSIP_PARSE_URI added to parse an URI and return a specified part of the URI. This is useful when need to get part of the URI instead of cutting it using a CUT function. For example to get 'user' part of Remote URI ${PJSIP_PARSE_URI(${CHANNEL(pjsip,remote_uri)},user)} ASTERISK-28144 #close Change-Id: I5d828fb87f6803b6c1152bb7b44835f027bb9d5a 2018-09-23 15:50 +0000 [3077ad0c24] Joshua Colp * stasis: Add internal filtering of messages. This change adds the ability for subscriptions to indicate which message types they are interested in accepting. By doing so the filtering is done before being dispatched to the subscriber, reducing the amount of work that has to be done. This is optional and if a subscriber does not add message types they wish to accept and set the subscription to selective filtering the previous behavior is preserved and they receive all messages. There is also the ability to explicitly force the reception of all messages for cases such as AMI or ARI where a large number of messages are expected that are then generically converted into a different format. ASTERISK-28103 Change-Id: I99bee23895baa0a117985d51683f7963b77aa190 2018-11-18 10:38 +0000 [915b80709d] George Joseph * CI: Add tmpfs to all jenkinsfiles Change-Id: Ida29d70d48d5f39aabf0b25c66b51f79324a8cba 2018-11-17 15:40 +0000 [f5e3832dff] George Joseph * CI: Mount a tmpfs on /tmp for testsuite docker containers Change-Id: I0566d81b0852f22066cd76d58eae5f1fda5602aa (cherry picked from commit 73efe86436427e5f43c532e5d42505ab4ec104d9) 2018-11-17 13:07 +0000 [be87185f6d] George Joseph * CI: Pass work directory to runTestsuite The testsuite can now use a user-specified work directory for all it's temp files. This allows the docker containers to use a tmpfs backed directory for the temp files instead of it's own write-layer image. * runTestsuite.sh now accepts a --work-dir command line argument that gets exported as AST_WORK_DIR before running the testsuite. * gates.jenkinsfile now specifies --work-dir to be /astroot. Since the Asterisk CI docker hosts now mount /srv/jenkins/workspace on a tmpfs, asterisk should be compiled and the testsuite run all in memory. Change-Id: If5ee905a15821296c355bb84cda38950ad8edc45 (cherry picked from commit a335f4c9adb0a00211345634f61917bdf5b412c2) 2018-11-16 20:33 +0000 [1dea497454] Sungtae Kim * res/res_ari: Fix null endpoint handle The res_ari(POST /channels/create handler) deos not check the endpoint parameter length. And it causes core dump. Fixed it to check the parameter length. Also fixed memory leak. ASTERISK-28169 Change-Id: Ibf10a9eb8a2e3a9ee1e13fbe748b2ecf955c3993 2018-11-15 11:41 +0000 [8ff3435c8a] George Joseph * CI: Allow runUnittests to use 'expect' to run the tests There seems to be a race condition between starting the asterisk daemon and attempting to use 'asterisk -r' that can cause the control socket file to not be created. Since all of the Jenkins slaves have 'expect' installed, the runUnittests script can use it to start asterisk in the forground and issue the commands interactively. This is much more reliable and it can also make startup errors more visible since they'll be in the Jenkins console output. If 'expect' isn't installed, the original daemon/asterisk -r process is used. Also added a "core show settings" before running the tests and added "notice,warning,error" to the console log. Change-Id: Idd656085f854afede813ac241b9e312b31358160 2018-11-12 12:23 +0000 [9abd5e1004] Corey Farrell * taskprocessor: Prevent race creating new taskprocessor. Task processors are retrieved using a 'get or create' pattern. The singleton container was unlocked between the get and create steps so it's possible that two threads could create task processors with the same name at the same time. Change-Id: Id64fae94a6a1e940ddf38fde622dcd4391635382 2018-11-16 06:20 +0000 [752fd06d12] Corey Farrell * pjproject-bundled: Use AST_DEVMODE for conditional compilation. We previously allowed resample and g711 codecs to be built when TEST_FRAMEWORK was enabled. This could cause errors if the testsuite was run without this option enabled. Switch the build system to allow those codecs to be built when --enable-dev-mode is used. This removes a chance for strange testsuite errors from use of an inadequate pjsua binary. Change-Id: Iee8a3613cdb711fa7e7d217c5a775a575907ae22 2018-11-15 14:47 +0000 [02c7a061ea] Corey Farrell * res_pjsip_caller_id: Use static pj_str_t for fromto header names. PJSIP assumes that these header names are not allocated, does not clone the name strings when reusing headers. Block unload of res_pjsip_caller_id until shutdown to ensure static memory stays valid. It was previously unsafe to unload while any sessions are active. Change-Id: I190854dea943d6e441cf03733f8a0da661aea27f 2018-10-24 07:38 +0000 [d0554783e2] Torrey Searle * res/res_pjsip_nat: Fix logic for REINVITES The presence of Record-Route in re-invites is optional, thus it is important to make sure the dialog doesn't have a routset before rewriting the contact header. ASTERISK-28129 #close Change-Id: Ic8ceb54ccfc93f7e315e476c514a2c777f2da7dc 2018-11-15 05:33 +0000 [c3d7b19cdd] Corey Farrell * core: Fix handling of restart from remote console. We cannot use need_el_end and SIGURG when restarting. Instead we need to run el_end within the SIGHUP restartnow handler. ASTERISK-28158 Change-Id: Ia852276363c81bdcf1aa29eb4558c5c2fa1218a0 2018-10-25 10:25 +0000 [eb5b83b8ea] Jan Hoffmann (license 6986) * AST-2018-010: Fix length of buffer needed for SRV and NAPTR results When dn_expand was being called on SRV and NAPTR results, the return value was being used to calculate the size of the buffer needed to store the host names. Since dn_expand returns the length of the COMPRESSED name the buffer could be too short to hold the EXPANDED name. The expanded name is NULL terminated so using strlen() is the correct way to determine the length actually needed for the buffer. ASTERISK-28127 Reported by: Jan Hoffmann patches: patch.diff submitted by janhoffmann (license 6986) Change-Id: I4d35d6c431c6c6836cb61d37b1378cc47f0b414d 2018-11-13 10:51 +0000 [4b24731640] Corey Farrell * test_res_pjsip_scheduler: Fix possible write after free in scheduler_policy. It's possible for a 4th task to be spawned before we cancel. This results in a write to the already freed test_data1. Wait long enough to verify success of the cancelation before freeing test_data1. Change-Id: I057e2fcbe97f8a175e50890be89c28c20490a20f 2018-10-17 08:48 +0000 [da562eb82d] Robert Cripps * bridge_native_rtp.c: Fail native bridge if no framing match. ASTERISK-28110 #close Change-Id: Ic64b8fc6a140a93fbdb2f97550a40d0ff334e607 2018-11-11 18:32 +0000 [944d90a7ea] Corey Farrell * taskprocessor: Do not use separate allocation for stats or name. Merge storage for the stats object and name string into the main allocation for struct ast_taskprocessor. Change-Id: I74fe9a7f357f0e6d63152f163cf5eef6428218e1 2018-11-11 07:34 +0000 [194e40122a] Corey Farrell * core: Ensure that el_end is always run when needed. * Ignore console=yes configuration option in remote console processes. * Use new flag to tell consolethread to run el_end and exit when needed. ASTERISK-28158 Change-Id: I9e23b31d4211417ddc88c6bbfd83ea4c9f3e5438 2018-11-08 15:37 +0000 [d9add7e086] Corey Farrell * jansson-bundled: Patch for off-nominal crash. pack_string crashed on non-NULL strings returned when s->has_error was true if the string was the result of 's' format without '#', '%' or '+'. Change-Id: Ic125df691d81ba2cbc413e37bdae657b304d20d0 2018-11-02 06:38 +0000 [8e34cb302e] Corey Farrell * pbx_config: Only the first [globals] section is seen. If multiple [globals] sections are used (for example via separate included files), only the first one is processed. This can result in lost global variables when using a modular extensions.conf. ASTERISK-28146 #close Change-Id: Iaac810c0a7c4d9b1bf8989fcc041cdb910ef08a0 2018-11-06 16:44 +0000 [a3fc97aa13] Chris-Savinovich * res_pjsip: Send a 503 response when overload state if reliable transport. When Asterisk's taskprocessors get overloaded we need to reduce the work load. res_pjsip currently ignores new SIP requests and relies on SIP retransmissions in the hope that the overload condition will clear soon enough to handle the retransmitted SIP request. This change adds the following code after ast_taskprocessor_alert_get() has returned TRUE: 1- identifies transport type. If non-udp then send a 503 response 2- if transport type is udp/udp6 then ignore, as before. Change-Id: I1c230b40d43a254ea0f226b7acf9ee480a5d3836 2018-11-06 16:35 +0000 [fdca9cb64f] Kevin Harwell * res_pjsip: formatting error in documentation The use of a '|' in the "global/debug" synopsis documentation caused the generated html table on the wiki to add an extra column that included the text after the pipe. This patch replaces the pipe with a comma. ASTERISK-28150 Change-Id: I3d79a6ca6d733d9cb290e779438114884b98a719 2018-11-05 12:44 +0000 [5f3f707793] Alexei Gradinari * res_pjsip.c: Make taskprocessor scheduling algorithm pick the shortest queue The current round-robin method does not take the current taskprocessor load into consideration when distributing requests. Using the least-size method the request goes to the taskprocessor that is servicing the least number of active tasks at the current time. Longer running tasks with the round-robin method can delay processing tasks. * Change the algorithm from round-robin to least-size for picking the PJSIP taskprocessor from the default serializer pool. Change-Id: I7b8d8cc2c2490494f579374b6af0a4868e3a37cd 2018-11-05 08:30 +0000 [bf579222c4] Joshua Colp * stasis: Clarify lifetime of topics. As mentioned in the comment I've added in the code there is no ability to unsubscribe all subscribers from a topic and explicitly destroy it. This is not currently a problem as we have two types of topics: Long lived topics which exist for the lifetime of the system. Ephemeral topics which feed a long lived topic. In the case of the ephemeral topics there is no subscriber which does not have its lifetime managed by the same entity that has created the topic. This ensures that when the topic is being unreferenced the subscribers are also unsubscribed and destroyed, allowing the topic to ultimately be destroyed as well. Change-Id: Ic5e244da7b16b1895ba1fc5ece481ebba5809c9a 2018-10-09 07:44 +0000 [2cf5079205] Jasper Hafkenscheid * chan_sip: Attempt ast_do_pickup in handle_invite_replaces When a call pickup is performed using and invite with replaces header the ast_do_pickup method is attempted and a PICKUP stasis message is sent. ASTERISK-28081 #close Reported-by: Luit van Drongelen Change-Id: Ieb1442027a3ce6ae55faca47bc095e53972f947a 2018-10-26 10:53 +0000 [ebff81e3a0] Pascal Cadotte Michaud * contrib/sip_to_pjsip: add a --quiet option to avoid prints Using the --quiet or -q option in conjonction with /dev/stdout as the output file allow the output to be used as a valid configuration. Given a script that generates a valid sip.conf I can pipe the output of that script into `sip_to_pjsip.py -q /dev/stdin /dev/stdout`. This allow me to use that piped command in my pjsip.conf using the `exec` command. ASTERISK-28136 Change-Id: I7b0e2e90e2549f3f8e01dc96701f111b5874c88d 2018-10-31 07:53 +0000 [0c9e217c81] Joshua Colp * res_pjsip: Add XML documentation for "use_callerid_contact" ASTERISK-28087 Change-Id: I69d48813ec514f5ef06c6de994cba52630e0a3b4 2018-10-30 10:52 +0000 [c7528f16e6] Richard Mudgett * alembic: Fix use_callerid_contact option add script. ASTERISK-28087 Change-Id: I046d018015427d0916fab571b5a4f5367476f729 2018-10-22 11:49 +0000 [eee935983b] Alexei Gradinari * pjsip: new endpoint's options to control Connected Line updates This patch adds new options 'trust_connected_line' and 'send_connected_line' to the endpoint. The option 'trust_connected_line' is to control if connected line updates are accepted from this endpoint. The option 'send_connected_line' is to control if connected line updates can be sent to this endpoint. The default value is 'yes' for both options. Change-Id: I16af967815efd904597ec2f033337e4333d097cd 2018-10-27 09:59 +0000 [b0155f7e58] Pascal Cadotte Michaud * contrib/sip_to_pjsip: handle setvar in conversion Given a sip.conf with the following content: setvar FOO=1 setvar BAR=42 I want my generated pjsip.conf to containt the following set_vars set_var FOO=1 set_var BAR=42 in the matching endpoint section. Change-Id: I6c822401fda4133c3b44bf31e655b4eb939d4d26 2018-10-26 16:18 +0000 [e407b8af21] Alexei Gradinari * res_pjsip_notify: improve realtime performance on CLI completion on the endpoint The module 'res_pjsip_notify' inefficiently makes a lot of DB requests on CLI completion on the endpoint. For example if there are 10k endpoints the module makes 10k requests of these 10k records. Even if a part of the endpoint entered the module makes the same 10k requests and then filtered them by itself. This patch gathers endpoints container by prefix and adds all gathered endpoints to completion at once. ASTERISK-28137 #close Change-Id: Ic20024912cc77bf4d3e476c4cd853293c52b254b 2018-10-02 07:31 +0000 [cac4ccef25] Torrey Searle * res_pjsip_session: add new flag use_callerid_contact Add a new global flag to res_pjsip to allow the callerid to be used as the username in the contact header. This allows chan_pjsip to have the same behavour as chan_sip ASTERISK-28087 #close Change-Id: I9a720e058323f6862a91c62f8a8c1a4b5c087b95 2018-10-10 07:09 +0000 [90a11c4ae7] Corey Farrell * chan_sip deprecation. This officially deprecates chan_sip in Asterisk 17+. A warning is printed upon startup or module load to tell users that they should consider migrating. chan_sip is still built by default but the default modules.conf skips loading it at startup. Very important to note we are not scheduling a time where chan_sip will be removed. The goal of this change is to accurately inform end users of the current state of chan_sip and encourage movement to the fully supported chan_pjsip. Change-Id: Icebd8848f63feab94ef882d36b2e99d73155af93 2018-10-25 07:54 +0000 [e81d33e78f] Corey Farrell * UPDATE.txt: Fix formatting to match previous files. Add 'Section:' headings and use '-' for bullet points. Change-Id: I7e2be35601ac8fea53b90d926da564512b6716e4 2018-10-18 14:51 +0000 [79c2b4fddd] Sean Bright * res_parking: Stop setting the deprecated PARKINGSLOT channel variable. Change-Id: Ia155ce2a53d61556aa4685524d1b48cfacfa3a8b 2018-10-17 19:34 +0000 [1b397ebd00] Richard Mudgett * logger.c: Fix default console logging when no logger.conf available. Default logging was not setup correctly when there was no logger.conf. This resulted in many expected log messages not actually getting out to the console. Change-Id: I542e61c03b2f630ff5327f9de5641d776c6fa70c 2018-09-26 15:05 +0000 [4a567cee3a] Alexei Gradinari * app_dial/queue/followme: 'I' options to block initial updates in both directions The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates from the called parties to the caller. This patch also blocks updates in the other direction before call is answered. ASTERISK-27980 Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01 2018-10-22 14:31 +0000 [96d5e444f0] Richard Mudgett * modules.conf.sample: Update preload usage documentation. Change-Id: Id449d4435c38148b56ac4cfd61ae4d90ac66bb90 2018-10-16 07:02 +0000 [8d1c6bb6e6] George Joseph * bridge_softmix: Add SDP "label" attribute to streams Adding the "label" attribute used for participant info correlation was previously done in app_confbridge but it wasn't working correctly because it didn't have knowledge about which video streams belonged to which channel. Only bridge_softmix has that data so now it's set when the bridge topology is changed. ASTERISK-28107 Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499 2018-10-18 14:24 +0000 [056ca07449] Sean Bright * func_callerid: Remove deprecated CALLERPRES() function. Change-Id: Ia1b2b386505b3102136dab02c45eaaf09f0f89c5 2018-07-18 07:45 +0000 [37b2e68628] Nick French * res_pjsip: Implement additional SIP RFCs for Google Voice trunk compatability This change implements a few different generic things which were brought on by Google Voice SIP. 1. The concept of flow transports have been introduced. These are configurable transports in pjsip.conf which can be used to reference a flow of signaling to a target. These have runtime configuration that can be changed by the signaling itself (such as Service-Routes and P-Preferred-Identity). When used these guarantee an individual connection (in the case of TCP or TLS) even if multiple flow transports exist to the same target. 2. Service-Routes (RFC 3608) support has been added to the outbound registration module which when received will be stored on the flow transport and used for requests referencing it. 3. P-Associated-URI / P-Preferred-Identity (RFC 3325) support has been added to the outbound registration module. If a P-Associated-URI header is received it will be used on requests as the P-Preferred-Identity. 4. Configurable outbound extension support has been added to the outbound registration module. When set the extension will be placed in the Supported header. 5. Header parameters can now be configured on an outbound registration which will be placed in the Contact header. 6. Google specific OAuth / Bearer token authentication (draft-ietf-sipcore-sip-authn-02) has been added to the outbound registration module. All functionality changes are controlled by pjsip.conf configuration options and do not affect non-configured pjsip endpoints otherwise. ASTERISK-27971 #close Change-Id: Id214c2d1c550a41fcf564b7df8f3da7be565bd58 2018-10-23 07:37 +0000 [f940b7b63d] Sean Bright * say: Remove legacy language deprecation logic These language codes (tw, ge, mx, and cz) were deprecated in 1.6.2. Change-Id: I18e4d2af2e83556fa91e39a7338030583ef05d50 2018-10-18 14:39 +0000 [9e8d671658] Sean Bright * res_xmpp: Remove deprecated JabberStatus application. Change-Id: I1a00ca22d59d6b6d2166aa56f0e9338a33e5ac60 2018-10-16 14:11 +0000 [687ab7aeee] Corey Farrell * astobj2: Eliminate legacy container allocation macros. These macros have been documented as legacy for a long time but are still used in new code because they exist. Remove all references to: * ao2_container_alloc_options * ao2_t_container_alloc_options * ao2_t_container_alloc These macro's are also removed. Only ao2_container_alloc remains due to it's use in over 100 places. Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a 2018-09-28 13:31 +0000 [4c19b94968] Corey Farrell * lock: Replace __ast_mutex_logger with private log_mutex_error. __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 2018-10-18 14:36 +0000 [9838a5e57a] Richard Mudgett * app_dial/app_queue: Update application option documentation * Update the post-answer documentation and example. The Dial example was incorrect and misleading for the post-answer subroutine useage. * Fix note and warning paragraphs in option descriptions. They don't show up in the wiki. Change-Id: I81019a1fd75d5b9151f76b52c38e2a90da682d14 2018-10-18 14:56 +0000 [90bd8371f2] Sean Bright * samples: PARKINGSLOT -> PARKING_SPACE in parking sample config PARKINGSLOT was deprecated in Asterisk 12 but the sample config was not updated to reflect that. Change-Id: I3e087c19d9ee587094fa5304102d8084a79c2b3c 2018-10-18 14:17 +0000 [be04a64c49] Sean Bright * options.c: Remove 'internal_timing' notice Change-Id: I9882394617724a497df1d6f529a87965191be3ce 2018-10-18 12:32 +0000 [467f7c6724] Richard Mudgett * Fix 'statement' typo throughout code. Most were in comments. A couple were in warning messages. Pointed out by Jonathan H on the Asterisk users mailing list. Change-Id: I6286939dff5d0a27a2758140570106f1cb351855 2018-10-17 16:08 +0000 [7ab4befc2b] Richard Mudgett * res_rtp_asterisk.c: Add conditional module dependency to res_pjproject * The dependency ensures that res_pjproject cannot be manually unloaded before res_rtp_asterisk. * The dependency allows startup loading errors to report that res_rtp_asterisk depends upon res_pjproject. Change-Id: Icf5e7581f4ddd6189929f6174c74dd951f887377 2018-10-17 14:34 +0000 [1fad6b9079] Richard Mudgett * modules: Add missing run time module support levels. Change-Id: I29b9dbfa4bbfc49f21eba356858e38b1d3041824 2018-10-14 07:58 +0000 [5ab94d2a3e] Corey Farrell * taskprocessor: Warn on unused result from pushing task. 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 2018-10-16 12:28 +0000 [915861b431] Richard Mudgett * bundled pjproject: Remove timer cleanup usage patch. This patch is not in the upstream pjproject and does unsafe things with the timer->_timer_id and timer->_grp_lock values in pj_timer_entry_reset() outside of the timer heap lock. pj_timer_entry_reset() is also called for timers that are not about to be rescheduled in a few places. Change-Id: I4fe0b4bc648f7be5903cf4531b94fc87275713c1 2018-10-10 04:37 +0000 [79677ead28] Corey Farrell * refdebug: Create refstats.py script. This allows us to process AO2 statistics for total objects, memory usage, memory overhead and lock usage. * Install refstats.py and reflocks.py into the Asterisk scripts folder. * Enable support for reflocks.py without DEBUG_THREADS. Steal a bit from the ao2 magic to flag when an object lock is used. Remove 'lockobj' from reflocks.py since we can now record 'used' or 'unused' for those objects. Add comments to explain thread safety of the 'struct __priv_data' bitfields. Change-Id: I84e9d679cc86d772cc97c888d9d856a17e0d3a4a 2018-10-12 12:14 +0000 [aae5bdc22e] Alexei Gradinari * res_pjsip: set callerid_tag to empty string This patch sets the callerid_tag to empty string by default. If the callerid_tag is set to NULL then the tag does not become part of a connected line update. For example: Alice's tag is "Alice". Bob's tag is empty. Charlie's tag is "Charlie". Alice calls Bob and then does attended transfer to Charlie. When Alice hangs up the CONNECTEDLINE(tag) is "Alice" on the interception routine on the Charlie's channel, but should be empty. Ths patch also fix memory leaks if there are more then one options "callerid", "callerid_tag", "voicemail_extension" and "contact_user" in the pjsip.conf endpoint definition. Change-Id: I86ba455c4677ca8d516d9a04ce7fb4d24dd576e4 2018-10-11 06:24 +0000 [f06de6900e] Corey Farrell * threadpool: Eliminate pointless AO2 usage. thread_worker_pair, set_size_data and task_pushed_data structures are allocated with AO2 objects, passed to a taskprocessor, then released. They never have multiple owners or use locking so AO2 only adds overhead. Change-Id: I2204d2615d9d952670fcb48e0a9c0dd1a6ba5036 2018-10-12 12:21 +0000 [675d8a46b4] Corey Farrell * main/astfd: Fix GCC8 format-truncation warning. The field used to store call arguments was not large enough to hold the arguments string that can be constructed for 'open'. Expand it to prevent this warning/error. Change-Id: I514927f256481bc84df10a51b19d5b5fb1bc387e 2018-10-09 16:18 +0000 [682f96cb5c] Richard Mudgett * res_statsd.c: Fix returned reload status. The return status when there was no change in statsd.conf was incorrect. This resulted in the wrong status message on the CLI when reloading the module. * Fixed cleanup on initial load if initializing statsd failed. Change-Id: Id24fae75f1a7ff584a444a5680e867d989792481 2018-10-03 16:51 +0000 [17f4e6ad4d] Emmanuel BUU * core/frame: generate correct T.140 payload in ast_sendtext_data() ast_sendtext_data() would create an incorrect T.140 text frame which length include the null terminator byte. It causes ultimately RTP packets to be send with this trailing 0. The proposed fix just set the correct length to the text frame ASTERISK-28089 Reported by: Emmanuel BUU Tested by: Emmanuel BUU Change-Id: I7ab1b9ed1e21683b2b667ea0a59d9aba3c77dd96 2018-10-04 18:33 +0000 [c8ee1a183f] Corey Farrell * loader: Flag module as declined in all cases where it fails to load. 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 2018-10-04 13:13 +0000 [c6c3a63696] Richard Mudgett * func_periodic_hook.c: Cleanup module resources on failure. * Make load_module() cleanup if it failed to setup the module. * Make unload_module() always return 0. It is silly to fail unloading if the hook function we try to unregister was not even registered. Change-Id: I280fc6e8ba2a7ee2588ca01d870eebaf74b4ffe6 2018-10-04 11:49 +0000 [9f02861d22] Richard Mudgett * codec_speex.c: Cleanup module loading to DECLINE and not FAILURE. If codec_speex fails to register a translator it would cause Asterisk to exit instead of continue as a DECLINED module. * Make unload_module() always return 0. It is silly to fail unloading if any translators we try to unregister were not even registered. Change-Id: Ia262591f68333dad17673ba7104d11c88096f51a 2018-10-04 13:03 +0000 [30717bafbf] George Joseph * CI: Fix missing () in gates.jenkinsfile Change-Id: I2f252e0f8c7f1a6328438fbd2be5d6574b7dfa5b 2018-10-04 10:13 +0000 [58622a87f4] George Joseph * CI: Add timestamps and timeouts to jenkinsfiles Change-Id: Ide83574dc957bc1df28e30a69079140050dfc35f 2018-10-03 17:02 +0000 [b2ed667712] Sean Bright * ast_coredumper: Remove .gdbinit file on exit Change-Id: I1297de78628773ca368e687c6f148bf74857cae9 2018-10-03 09:33 +0000 [e19f27a667] Sean Bright * CI: Look up configured kernel.core_pattern sysctl Change-Id: I8246a0147df8d821fbbcabc1db1887104b8bedc4 2018-10-03 15:51 +0000 [42880fab50] Corey Farrell * jenkins: Fix cleanup command redirection. Fix redirection to /dev/null of cleanup commands. The '2' was being interpreted as part of the command instead of part of the redirect. Change-Id: I2e3a591b165e0288c4b82b9ef475fdfd5392a90a 2018-10-03 15:29 +0000 [a29cefe5b2] George Joseph * ast_coredumper: Don't use "declare -n" Change-Id: I7ddfed4cd6549a0cd458e4d5cf9ac95d784de6cb 2018-10-02 16:15 +0000 [3601329c5a] Richard Mudgett * res_smdi.c: Fix module ref counting and inverted test. I think this module is so screwed up that it doesn't work anymore. Even with these attempts to fix things it still won't gracefully shut down. The module refs will not go to zero to allow unloading the module. * Fix module ref counting dealing with the SMDI interface object. There were several off-nominal paths that unbalanced the module ref count. Also the destructor freed the ao2 object itself which is bad. Made the smdi_read thread not hold its own ref to the SMDI interface object so when all refs go away the destructor will stop the listener thread. * Fixed the smdi_load() return code of 1 concerning the number of listeners. The test was inverted. Change-Id: Ic288db51b58e395d6a2fc3847f77176c16988784 2018-10-02 16:23 +0000 [305d08f112] Richard Mudgett * res_smdi.c: Made use defaults if the smdi.conf file does not exist. This module is an optional dependency of a couple of other modules. If it declines to load, it then forces other modules that can optionally use this module to also decline. * Made use the default configuration if the config file does not exist and simplified some of the logic. Change-Id: Ib93191f1fe28c0dd9ebe3d84c7762b32f83c4eb9 2018-10-02 17:15 +0000 [932d0a40cf] Corey Farrell * astobj2: Comment on OBJ_NOLOCK in ao2_container_clone. The test for OBJ_NOLOCK looks wrong but it isn't. Add comments to prevent confusion. Change-Id: I9662b82eb39e7627a1f1944fd18f967a2b987344 2018-10-03 09:05 +0000 [f608b73a29] Sean Bright * CI: Use brace expansion instead of calling out to seq Also make the shebang in publishAsteriskDocs.sh the first line. Change-Id: I3fdd6f22e652e4fb5b5fe85df46fa34eb6d0cf08 2018-10-03 08:59 +0000 [9c9f060b3a] Sean Bright * CI: Use bindport instead of port in test http.conf Change-Id: Ife9a6879da63a56e5b8348a2024eeed4e7b1615b 2018-10-03 07:56 +0000 [286339aa34] Sean Bright * http.c: Reload TLS even if http.conf hasn't changed There is currently no way to indicate to Asterisk that TLS certificates and/or keys have been updated other than by modifying http.conf or restarting Asterisk. There is already code in main/tcptls.c that determines if a reload is actually necessary based on the hashes of the certicate and dependent files, so this change merely gives us a way to request a reload without explicitly modifying http.conf. Change-Id: Ie795420dcc7eb3d91336820688a29adbcc321276 2018-10-02 13:29 +0000 [a69a50b6ec] Richard Mudgett * res_statsd.c: Made use defaults if the statsd.conf file does not exist. This module is an optional dependency of many modules. If it declines to load it then forces other modules that can optionally use this module to also decline. * Made use default configuration if there is a config error or the config file does not exist. Change-Id: If1068a582ec54ab7fb437265cb5370a97a825737 2018-10-01 22:12 +0000 [cacbe32534] Corey Farrell * core: Disable astobj2 locking for some common objects. * ACO options * Indications * Module loader ref_debug object * Media index info and variants * xmldoc items These allocation locations were identified using reflocks.py on the master branch. Change-Id: Ie999b9941760be3d1946cdb6e30cb85fd97504d8 2018-09-13 13:03 +0000 [639718211a] Corey Farrell * Resolve warning about duplicate 'dialplan' CLI. Change-Id: I029db1b4a32ccfb38374d6fe944dc430866f4b30 2018-10-02 01:33 +0000 [b25a261aa5] Corey Farrell * loader: Fix result of module reload error. When a module reload fails we never set AST_MODULE_RELOAD_ERROR. This caused reload failures to incorrectly report 'No module found'. Change-Id: I5f3953e0f7d135e53ec797f24c97ee3f73f232e7 2018-09-28 10:13 +0000 [e4cf513f81] Corey Farrell * loader: Improve error handling. * 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 2018-09-25 16:19 +0000 [24cece660b] Emmanuel BUU * core/frame: Fix ast_frdup() and ast_frisolate() for empty text frames If a channel creates an AST_TEXT_FRAME with datalen == 0, the ast_frdup() and ast_frisolate() functions could create a clone frame with an invalid data.ptr which would cause a crash. The proposed fix is to make sure that for such empty text frames, ast_frdup() and ast_frisolate() return cloned text frames with a valid data.ptr. ASTERISK-28076 Reported by: Emmanuel BUU Tested by: Emmanuel BUU Change-Id: Ib882dd028598f13c4c233edbfdd7e54ad44a68e9 2018-09-30 23:11 +0000 [13df745278] Corey Farrell * astobj2: Record lock usage to refs log when DEBUG_THREADS is enabled. When DEBUG_THREADS is enabled we can know if the astobj2 mutex / rwlock was ever used, so it can be recorded in the REF_DEBUG destructor entry. Create contrib/scripts/reflocks.py to process locking used by allocator. This can be used to identify places where AO2_ALLOC_OPT_LOCK_NOLOCK should be used to reduce memory usage. Change-Id: I2e3cd23336a97df2692b545f548fd79b14b53bf4 2018-10-01 12:11 +0000 [52b530503f] Corey Farrell * app_page: Add dependency against app_confbridge. Change-Id: I1946509f518961d23fb21229d91676ee3e441921 2018-09-28 13:55 +0000 [b68b3012ea] Richard Mudgett * app_queue.c: Fix json ref leak Declining the queue_member_status_type stasis message in stasis.conf causes these messages to leak json objects. * Add missing ast_json_unref() if the type is NULL in queue_publish_member_blob(). ASTERISK-28084 Change-Id: I691ecf49bd1f7d9c29182e1eee8c4bb7103be9fc 2018-10-01 03:24 +0000 [497973c8a2] Corey Farrell * Append CHANGES/UPGRADE.txt for module loader changes. Change-Id: Ib8db4e14187f5c11ecbff532df17d30c5d36fa3e 2018-09-25 17:33 +0000 [8bb031abc7] Alexei Gradinari * res_pjsip: improve realtime performance on CLI 'pjsip show contacts' CLI command 'pjsip show contacts' inefficiently make a lot of DB requests. For example if there are 10k aors then asterisk requests these 10k records of aor and then does 10k requests of contact - one request per aor. Even if use 'like ' the asterisk requests all aor's and contact's records and then filters them by itself. This patch gathers contact's container by - retrieving all dynamic contacts by regex (filtered by reg_server) - retrieving all aors with permanent contacts - finally filters container by regex ASTERISK-28077 #close Change-Id: Id0ad65d14952a02fb213273a90f3f680a8149618 2018-09-28 14:45 +0000 [24b92291d5] Corey Farrell * jansson-bundled: Add patches to improve json_pack error reporting. Change-Id: I045e420d5e73e60639079246e810da6ae21ae22b 2018-09-27 19:32 +0000 [205c6be895] Corey Farrell * lock: Improve performance of DEBUG_THREADS. 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 2018-09-27 13:19 +0000 [f10c7b6eeb] George Joseph * app_confbridge: Use bridge join hook to send join and leave events The first attempt at publishing confbridge events to participants involved publishing them at the same time stasis events were created. This caused issues with bridge and channel locks. The second attempt involved publishing them when the stasis events were received by the code that published the confbridge AMI events. This caused timing issues because, depending on resources available, the event could be received before channels actually joined the bridge and would therefore fail to send messages to the participant. This attempt reverts to the original mechanism with one exception. The join and leave events are published via bridge join and leave hooks. This guarantees the states of the channels and bridge and provides deterministic timing for event publishing. Change-Id: I2660074f8a30a5224cb953d5e047ee84484a9036 2018-09-27 04:51 +0000 [62a0db2df1] Corey Farrell * astobj2: Reduce memory overhead. Reduce options to 2-bit field, magic to 30 bit field. Move ref_counter next to options and explicitly use int32_t so the fields will pack. This reduces memory overhead for every ao2 object by 8 bytes on x86_64. Change-Id: Idc1baabb35ec3b3d8de463c4fa3011eaf7fcafb5 2018-09-27 15:01 +0000 [ac23e5ad48] Sean Bright * config.c: Cleanup AST_INCLUDE_GLOB * In main/config.c, AST_INCLUDE_GLOB is fixed to '1' making the #ifdefs pointless. * In utils/extconf.c, AST_INCLUDE_GLOB is never defined so there is a lot of dead code. Change-Id: I1bad1a46d7466ddf90d52cc724e997195495226c 2018-09-27 05:33 +0000 [39bf9881e0] Corey Farrell * astobj2: Fix shutdown order. When REF_DEBUG and AO2_DEBUG are both enabled we closed the refs log before we shutdown astobj2_container. This caused the AO2_DEBUG container registration container to be reported as a leak. Change-Id: If9111c4c21c68064b22c546d5d7a41fac430430e 2018-09-05 21:14 +0000 [f23a12244d] Cao Minh Hiep * app_queue: Fix Attended transfer hangup with removing pending member. This issue related to setting of holdtime, announcements, member delays. It works well if we set the member delays to "0" and no announcements and no holdtime.This issue will happen if we set member delays to "1", "2"... or announcements or holdtime and hangs up the call during processing it. And here is the reason: (At the step of answering a phone.) It takes care any holdtime, announcements, member delays, or other options after a call has been answered if it exists. Normally, After the call has been aswered, and we wait for the processing one of the cases of the member delays or hold time or announcements finished, "if (ast_check_hangup(peer))" will be not executed, then queue will be updated at update_queue(). Here, pending member will be removed. However, after the call has been aswered, if we hangs up the call during one of the cases of the member delays or hold time or announcements, "if (ast_check_hangup(peer))" will be executed. outgoing = NULL and at hangupcalls, pending members will not be removed. * This fixed patch will remove the pending member from container before hanging up the call with outgoing is NULL. ASTERISK-27920 Reported by: Cao Minh Hiep Tested by: Cao Minh Hiep Change-Id: Ib780fbf48ace9d2d8eaa1270b9d530a4fc14c855 2018-06-26 09:17 +0000 [f3422312ea] Moritz Fain * res_stasis: Fix stale data in ARI bridges Fixed an issue that resulted in "Allocation failed" each time an ARI request was made to start playing MOH on a bridge. In bridge_moh_create() we were attaching the after bridge callbacks to chan which is the ;1 channel of the unreal channel pair. We should have attached them to the ;2 channel which is pushed into the bridge by ast_unreal_channel_push_to_bridge(). The callbacks are called when the specific channel leaves the bridging system. Since the ;1 channel is never put into a bridge the callbacks never get called. The callbacks then never remove the moh_wrapper from the app_bridges_moh container. As a result we cannot find the channel associated with the wrapper to start MOH because it has hungup. This is the reason causing the reported issue. * Rather than using after bridge callbacks to cleanup, we now have moh_channel_thread() doing the cleanup when the channel hangs up. * Fixed moh_channel_thread() accumulating control frames on the stasis bridge MOH channel until MOH is stopped. Control frames are no longer accumulated while MOH is playing. * Fixed channel ref counting issue. stasis_app_bridge_moh_channel() may or may not return a channel ref. As a result ast_ari_bridges_start_moh() wouldn't know it may have a channel ref to release. stasis_app_bridge_moh_channel() will now return a ref with the channel it returns. * Eliminated RAII_VAR in bridge_moh_create(). ASTERISK-26094 #close Change-Id: Ibff479e167b3320c68aaabfada7e1d0ef7bd548c 2018-09-10 11:28 +0000 [b11a6643cf] Ben Ford * res_rtp_asterisk.c: Add "seqno" strictrtp option When networks experience disruptions, there can be large gaps of time between receiving packets. When strictrtp is enabled, this created issues where a flood of packets could come in and be seen as an attack. Another option - seqno - has been added to the strictrtp option that ignores the time interval and goes strictly by sequence number for validity. Change-Id: I8a42b8d193673899c8fc22fe7f98ea87df89be71 2018-09-20 13:59 +0000 [e6a69ea2cf] Alexei Gradinari * res_odbc: fix missing SQL error diagnostic On SQL error there is not diagnostic information about this error. There is only WARNING res_odbc.c: SQL Execute error -1! The function ast_odbc_print_errors calls a SQLGetDiagField to get the number of available diagnostic records, but the SQLGetDiagField returns 0. However SQLGetDiagRec could return one diagnostic records in this case. Looking at many example of getting diagnostics error information I found out that the best way it's to use only SQLGetDiagRec while it returns SQL_SUCCESS. Also this patch adds calls of ast_odbc_print_errors on SQL_ERROR to res_config_odbc. ASTERISK-28065 #close Change-Id: Iba5ae5470ac49ecd911dd084effbe9efac68ccc1 2018-09-26 08:12 +0000 [950d0b65e5] George Joseph * CI: Add --test-timeout option to runTestsuite.sh The default is 600 seconds. Also added timeouts to the *TestGroups.json files. Change-Id: I8ab6a69e704b6a10f06a0e52ede02312a2b72fe0 2018-09-18 08:01 +0000 [6627c56b3d] Peter Katzmann * chan_sip: SipNotify on Chan_Sip vi AMI behave different to CLI With tls and udp enabled asterisk generates a warning about sending message via udp instead of tls. sip notify command via cli works as expected and without warning. asterisk has to set the connection information accordingly to connection and not on presumption ASTERISK-28057 #close Change-Id: Ib43315aba1f2c14ba077b52d8c5b00be0006656e 2018-09-24 17:56 +0000 [1ba51b00cc] George Joseph * configure.ac: Check for unbound version >= 1.5 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 2018-09-24 12:43 +0000 [8bb264841a] Joshua Colp * res_rtp_asterisk: Raise event when RTP port is allocated This change raises a testsuite event to provide what port Asterisk has actually allocated for RTP. This ensures that testsuite tests can remove any assumption of ports and instead use the actual port in use. ASTERISK-28070 Change-Id: I91bd45782e84284e01c89acf4b2da352e14ae044 2018-07-16 22:55 +0000 [adf539b2f0] Corey Farrell * jansson: Backport fixes to bundled, use json_vsprintf if available. 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 2018-07-16 22:55 +0000 [93777faf36] Corey Farrell * json: Take advantage of new API's. * Use "o*" format specifier for optional fields in ast_json_party_id. * Stop using ast_json_deep_copy on immutable objects, it is now thread safe to just use ast_json_ref. Additional changes to ast_json_pack calls in the vicinity: * Use "O" when an object needs to be bumped. This was previously avoided as it was not thread safe. * Use "o?" and "O?" to replace NULL with ast_json_null(). The "?" is a new feature of ast_json_pack starting with Asterisk 16. Change-Id: I8382d28d7d83ee0ce13334e51ae45dbc0bdaef48 2018-09-20 10:15 +0000 [06c0676da0] George Joseph * app_voicemail: Cleanup mailbox topic and cache app_voicemail wasn't properly cleaning up the stasis cache or the mwi topic pool when the module was unloaded or when a user was deleted as a result of a reload. This resulted in leaks in both areas. * app_voicemail now calls ast_delete_mwi_state_full when it frees a user structure and ast_delete_mwi_state_full in turn now calls the new stasis_topic_pool_delete_topic function to clear the topic from the pool. Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8 2018-09-17 15:35 +0000 [31fba4e869] Kevin Harwell * rtp_engine: rtcp_report_to_json can overflow the ssrc integer value 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 2018-09-21 14:32 +0000 [22cf065ec9] George Joseph * app_voicemail: Fix stack overrun in append_mailbox The append_mailbox function wasn't calculating the correct length to pass to ast_alloca and it wasn't handling the case where context might be empty. Found by the Address Sanitizer. Change-Id: I7eb51c7bd18a7a8dbdba261462a95cc69e84f161 2018-09-21 15:23 +0000 [4d51a8e05b] George Joseph * channel.c: Address stack overflow in does_id_conflict() does_id_conflict() was passing a pointer to an int to a callback that expected a pointer to a size_t. Found by the Address Sanitizer. Change-Id: I0ff542067eef63a14a60301654d65d34fe2ad503 2018-09-21 10:19 +0000 [bdc8159799] Corey Farrell * res_rtp_asterisk: Fix crash on ast_rtp_new failure. ast_rtp_new free'd rtp upon failure, but rtp_engine.c would also call the destroy callback. Remove call to ast_free from ast_rtp_new, leave it to rtp_engine.c to initiate the full cleanup. Add error detection for the ssrc_mapping vector initialization. In rtp_allocate_transport set rtp->s = -1 in the failure path where we close that FD to ensure we don't try closing it twice. ASTERISK-27854 #close Change-Id: Ie02aecbb46228ca804e24b19cec2bb6f7b94e451 2018-09-20 15:26 +0000 [ad4a6bc27a] Sean Bright * res_rtp_asterisk: Reset all settings on module reload 'rtpchecksums' and 'rtcpinterval' are not being reset to their defaults if they are not present in the updated configuration file. Change-Id: I1162e40199314d46cf3225d5e1271c4c81176670 2018-09-20 09:41 +0000 [d277db4a38] George Joseph * stasis: Add function to delete topic from pool 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 "-pool". Change-Id: Ib7957951ee5c9b9b4482af7b9b4349112d62bc25 2018-08-16 10:45 +0000 [a801543f79] Sean Bright * AST-2018-009: Fix crash processing websocket HTTP Upgrade requests The HTTP request processing in res_http_websocket allocates additional space on the stack for various headers received during an Upgrade request. An attacker could send a specially crafted request that causes this code to overflow the stack, resulting in a crash. * No longer allocate memory from the stack in a loop to parse the header values. NOTE: There is a slight API change when using the passed in strings as is. We now require the passed in strings to no longer have leading or trailing whitespace. This isn't a problem as the only callers have already done this before passing the strings to the affected function. ASTERISK-28013 #close Change-Id: Ia564825a8a95e085fd17e658cb777fe1afa8091a 2018-09-03 09:55 +0000 [406be41f21] David Hajek * chan_sip.c: chan_sip unstable with TLS after asterisk start or reloads Fixes random asterisk crash on start or reload with TLS phones. ASTERISK-28034 #close Reported-by: David Hajek Change-Id: I2a859f97dc80c348e2fa56e918214ee29521c4ac 2018-09-20 04:48 +0000 [b9874da790] Joshua Colp * res_remb_modifier: Add module for controlling REMB from CLI. This adds a module which registers a CLI command that can set the REMB bitrate value for REMB as it enters or exits Asterisk. This allows you to ignore what Asterisk or a client produces and is useful for demonstrations. This does not generate REMB frames, however, but just modifies them as they flow to or from a channel. Change-Id: Ib089427c46a4a36d645cecfe02406adb38c17bec 2018-09-14 15:51 +0000 [c99a9b228b] Richard Mudgett * stasis: No need to keep a stasis type ref in a stasis msg or cache object. Stasis message types are global ao2 objects and we make stasis messages and cache entries hold references to them. Since there are currently situations where cache objects are never deleted, the reference count on the types can exceed 100000 and generate a FRACK assertion message. The stasis message cache could conceivably also have that many messages legitimately on large systems. The only down side to not holding the message type ref in the stasis message is it only makes a crash either at shutdown or when manually unloading a busy module slightly more likely. However, this is more exposing a pre-existing stasis shutdown ordering issue than a problem with not holding a message type ref in stasis messages. * Made stasis messages and cache entries no longer hold a ref to the message type. Change-Id: Ibaa28efa8d8ad3836f0c65957192424c7f561707 2018-09-18 13:59 +0000 [58035702cb] Richard Mudgett * pjproject: Update initial 2.8 patches to apply cleanly. ASTERISK-28059 Change-Id: I027472f2753391646dde594a709a75f14422db93 2018-09-14 15:48 +0000 [79e3becc5d] Richard Mudgett * stasis_message.c: Don't create immutable stasis objects with locks. * Create the stasis message object without a lock as it is immutable. * Create the stasis message type object without a lock as it is immutable. * Creating the stasis message type could crash if the passed in type name is NULL and REF_DEBUG is enabled. Added missing NULL check when passing the ao2 object tag string. Change-Id: I28763c58bb9f0b427c11971d0103bf94055e7b32 2018-09-17 11:38 +0000 [ce9a980be6] Joshua Colp * pjproject: Upgrade to 2.8. 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 2018-09-18 09:39 +0000 [6a1c313fac] Florian Floimair * alembic: fix suppress_q850_reason_headers column name In the original commit introducing the feature the column in the alembic script was called 'suppress_q850_reason_header'. In the code however the option is called 'suppress_q850_reason_headers' (trailing 's'). This leads to errors when ARI push configuration is used. Change-Id: Ie84808adbca6fcc9136556e4f5d741adbef5d14f 2018-09-13 07:55 +0000 [cdece3b637] George Joseph * app_voicemail: Remove need to subscribe to stasis app_voicemail was using the stasis cache to build and maintain a list of mailboxes that had subscribers. It then used this list to determine if a mailbox should be polled for new messages if polling was enabled. For this to work, stasis had to cache every subscription and unsubscription to the mailbox which caused a lot of overhead, both cpu and memory related. Since polling is only required when changes are being made to mailboxes outside of app_voicemail and since the number of mailboxes that don't have any subscribers is likely to be very low, all mailboxes are now polled instead of just the ones with subscribers. This paves the way for disabling the caching of stasis subscription change messages. Also fixed cleanup in some of the unit tests that not only left test users in the users list but also caused segfaults if the tests were run more than once. ASTERISK-27121 Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee 2018-09-18 06:08 +0000 [32a7b9f4b3] Joshua Colp * res_pjsip_session: Don't add declined stream if one does not exist. Given a scenario where a session refresh was done with a removed stream we would always add a removed stream to the outgoing SDP even if one did not already exist. This change makes it so that a removed stream is only placed into the SDP if one already exists. ASTERISK-28047 Change-Id: Ibb97d21cdeb87a8acae0c720861b0ff255708442 2018-09-10 10:12 +0000 [246c39e46c] Corey Farrell * install_prereq: Remove unpackaged version of jansson. This is removed in favor of ./configure --with-jansson-bundled. The install-unpackaged command would only install jansson once, so once installed it would never update, where the bundled copy will be kept up to date. Change-Id: Ideab1f65419608d3795aa608e9da873823cc42d3 2018-09-17 10:38 +0000 [3d9deb35f0] Sean Bright * autoconf: Check for srtp_get_version_string() before using it Change-Id: Id2a916ff9448706090e72ff2c7fb3f5ba24a05df 2018-09-17 07:10 +0000 [ceafac3d7f] George Joseph * CI: Fix typo in testsuite git checkout Change-Id: I30024515e5b00a5044fd39fbff27d818f016b719 2018-09-16 06:08 +0000 [b68617ac2c] Sean Bright * res_srtp.c: Show linked version of libsrtp on module init Change-Id: Ib0a645d6985de5757cc4399ed2524b2d02c4f342 2018-09-07 09:40 +0000 [07cb13f75f] Sean Bright * res_pjsip: Log IPv6 addresses correctly 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 2018-09-14 12:31 +0000 [8be6998f8d] George Joseph * CI: Use proper credentials for Security testsuite checkout Can't do anonymous http checkout from Security-testsuite. Need to use same credentials as the gerrit review checkout. Change-Id: I87af68c995cb8926f5e87f9af245600d76984f05 2018-09-13 11:06 +0000 [5ec6d2c33e] George Joseph * stasis_cache: Stop caching stasis subscription change messages Since app_voicemail no longer uses the cache to maintain its state there is no longer a need to cache these messages. ASTERISK-27121 Change-Id: I321c708505f5ad8d00e1b0afc4c27dc2ac12ecb4 2018-09-12 12:39 +0000 [2ba2ff050d] Corey Farrell * CI: Use .gitreview to default BRANCH_NAME. This ensures that binary modules are avoided in the master branch even if BRANCH_NAME is not set. Change-Id: I79162d2063f22fa9d6b31fde4827ace2dd5bf0da 2018-09-11 07:22 +0000 [bc8cdcefa8] Walter Doekes * optional_api: Remove unused nonoptreq fields As they're not actively used, they only grow stale. The moduleinfo field itself is kept in Asterisk 13/15 for ABI compatibility. ASTERISK-28046 #close Change-Id: I8df66a7007f807840414bb348511a8c14c05a9fc 2018-09-03 06:50 +0000 [012272a114] lvl * manager: Set AMI event "Newexten" to the EVENT_FLAG_DIALPLAN class The documentation already specified EVENT_FLAG_DIALPLAN for this event, but the implementation was using EVENT_FLAG_CALL. Using EVENT_FLAG_DIALPLAN allows AMI clients to opt out of receiving this highly verbose event. ASTERISK-28033 Change-Id: I45b3119f30e4dbc17b49831f2b1a4f2c1beadafe 2018-09-12 07:18 +0000 [65e0eb8fc6] Sean Bright * res_pjproject: Fix sockaddr conversion routines for non-bundled PJSIP The bundled version of pjproject has a patch for Solaris compatability that changes the definition of various socket structures which we need to account for when compiling against a non-bundled version. ASTERISK-28049 #close Change-Id: Ia1ea47c433fc2d915115193ee889a752373925f0 2018-09-10 22:28 +0000 [28b32fbd44] Corey Farrell * Build System: Resolve conflict between DESTDIR and bundled jansson. If Asterisk is built using a DESTDIR this will cause the bundled jansson to be installed to an unexpected location and we will fail to find it. Change-Id: Id033e2813261e0d45232383d44c6391122169548 2018-08-30 03:42 +0000 [35e02d6f17] Frederic LE FOLL * res_musiconhold.c: Restart MOH if previous hold just reached end-of-file On MOH activation, moh_files_readframe() is called while the current stream attached to the channel is NULL and it calls ast_moh_files_next() immediately. However, it won't call ast_moh_files_next() again if sample reading fails. The failure may occur because res_musiconhold retains the last sample reading position in the channel data and MOH during the previous hold/retrieve just reached EOF. Obviously, a bit of bad luck is required here. * Restructured moh_files_readframe() to try a second time to start MOH if there was no stream setup and the saved position was at EOF. Also added comments describing what is going on for each step. ASTERISK-28029 Change-Id: I1508cf2c094f8feca22d6f76deaa9fdfa9944860 2018-09-05 06:39 +0000 [f97d92bd0a] Joshua Colp * core: Don't stop generators when writing RTCP frames. Generators provide such functionality as tone generation or silence generation. RTCP frames provide RTCP information and should not stop generators from operating. ASTERISK-28005 Change-Id: Ieadada07b068a7aa426e8763f1b73a18e1ac34a9 2018-09-03 06:28 +0000 [1174759f0c] lvl * app_queue: Update realtime queuemembers after wait_a_bit(), not before This ensures the most up-to-date information is used for the next call attempt. ASTERISK-28032 Change-Id: I02fc17c6ffb50bb60ea97c2d2e6023e8061815ce 2018-08-28 08:42 +0000 [600c5d79fd] Sean Bright * res_pjproject: Add utility functions to convert between socket structures 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 2018-08-30 13:08 +0000 [0dd8ab3532] George Joseph * stasis_cache: Prune stasis_subscription_change messages The stasis cache provides a way to reconstruct the current state of topic subscribers. Unfortunately, since every subscribe and unsubscribe is cached, the cache continues to grow unabated while asterisk is running. This patch removes subscribe messages from the cache when the corresponding unsubscribe is received. This patch also registers the cache containers with ao2 so that if AO2_DEBUG is turned on, you can list the container and get its stats from the CLI. ASTERISK-27121 Change-Id: I3d18905e477f3721815da91f30da8d3fbb2d4f56 2018-09-03 09:27 +0000 [1a3115d1c5] Rodrigo Ramírez Norambuena * app_dial: set the comment for OPT_ARG_ANNOUNCE to really what is done Change-Id: I08f88adb09f7e5813f37e70fecd787468cdb32c8 2018-08-15 14:27 +0000 [b779a93d8d] Chris-Savinovich * pbx_config.c: Fix reloading module if initially declined to load Added decline if extensions.conf file not available when loading pbx_config, and also made sure everything gets properly unregistered and/or destroyed on unload. Change-Id: Ib00665106043b1be5148ffa7a477396038915854 2018-08-30 14:42 +0000 [e387750104] Richard Mudgett * http.c: Give HTTP error response when received lines are too long. Added a check when we receive a HTTP request line or header line that is too long. We now return an error response to the sender because we are not able to process the request. Change-Id: I6df2705435fd7dde4d5d3bdf7acec859cfb7c12d 2018-08-29 16:14 +0000 [f657793ee4] Richard Mudgett * iostream.c: Fix ast_iostream_gets() needlessly returning failure. Providing a buffer larger than the internal buffer of ast_iostream_gets() fails to get lines longer than the internal buffer. * Made ast_iostream_gets() fill the supplied buffer with read data until either a '\n' is found or the supplied buffer is filled just like fgets(). Change-Id: If18b3f6ee500e22f0633a68779ed09f7e0f305ed 2018-08-06 15:37 +0000 [d60411a2b4] Richard Mudgett * res_pjsip: Fix mwi_subscribe_replaces_unsolicited type mismatch ASTERISK-27988 Change-Id: Iccafdd0552ea8aaed647620fb14499f1bf341843 2018-08-29 05:18 +0000 [40def05949] Joshua Colp * res_fax: Handle fax gateway being started more than once. The T.38 fax gateway state machine can cause the fax gateway to be started more than once on a channel depending on the responses of the remote endpoint. This would previously leak the channel name, channel unique id, and underlying fax engine state. This change instead makes it so that if the fax gateway session is already present and not reserved the fax gateway is not started again. ASTERISK-27981 Change-Id: I552d95086860cb18f2522ee40ef47b13b6da2e0e 2018-08-28 08:01 +0000 [39459b1ee4] Sean Bright * res_pjsip_transport_websocket: Properly set src_name for IPv6 SIP responses over WebSockets when the client is using IPv6 have invalid Via headers according to RFC 3261. The 'received' header parameter should not be wrapped in brackets if it is an IPv6 address. When src_name is populated by the built-in PJSIP transports, the code uses pj_sockaddr_print() with 'flags' set to 0, meaning that the brackets are not rendered around IPv6 addresses. This may be related to ASTERISK~27101. See also: https://github.com/onsip/SIP.js/pull/594 ASTERISK-28020 #close Change-Id: I8ea9d289901b837512bee2ca2535e3dc14f04d77 2018-08-26 13:18 +0000 [a2001c00e6] Corey Farrell * Create --disable-binary-modules option. This new option can be passed for ./configure or ./tests/CI/buildAsterisk.sh to prevent download/install of binary modules. Normally enabling the categories MENUSELECT_CODECS or MENUSELECT_RES will result in binary modules being enabled even if the build target is incompatible with those modules. This includes CI scripts which enable categories before disabling specific modules. If more binary modules are offered in the future this will help avoid accidentally downloading them if unwanted or incompatible. Adding a binary module will only require creating a new menuselect entry similar to the existing ones, it will not be necessary to modify the CI scripts. Change-Id: I6b1bd1c75a2e48f05b8b8a45b7a7a2d00a079166 2018-08-21 07:59 +0000 [289016239d] Emmanuel BUU * res/res_rtp_asterisk: remove debug traces generated by an empty frame The realtime text timer pops regularly and sends text frames even if the buffer is empty. This causes a lot of unecessary debug logging. * Made red_write() test if we need to send a frame before calling ast_rtp_write() ASTERISK-28002 Reported by: Emmanuel BUU Tested by: Emmanuel BUU Change-Id: Icf81310c3b8080b615a42060afc02ab41f9523dd 2018-08-13 08:12 +0000 [9680790531] Jaco Kroon * chan_sip: improved ip:port finding of peers for non-UDP transports. Also remove function peer_ipcmp_cb since it's not used (according to rmudgett). Prior to b2c4e8660a9c89d07041271371151779b7ec75f6 (ASTERISK_27457) insecure=port was the defacto standard. That commit also prevented insecure=port from being applied for sip/tcp or sip/tls. Into consideration there are three sets of behaviour: 1. "previous" - before the above commit. 2. "current" - post above commit, pre this one. 3. "new" - post this commit. The problem that the above commit tried to address was guests over TCP. It succeeded in doing that but broke transport!=udp with host!=dynamic. This commit attempts to restore sane behaviour with respect to transport!=udp for host!=dynamic whilst still retaining the guest users over tcp. It should be noted that when looking for a peer, two passes are made, the first pass doesn't have SIP_INSECURE_PORT set for the searched-for peer, thus looking for full matches (IP + Port), the second pass sets SIP_INSECURE_PORT, thus expecting matches on IP only where the matched peer allows for that (in the author's opinion: UDP with insecure=port, or any TCP based, non-dynamic host). In previous behaviour there was special handling for transport=tcp|tls whereby a peer would match during the first pass if the utilized transport was TCP|TLS (and the peer allowed that specific transport). This behaviour was wrong, or dubious at best. Consider two dynamic tcp peers, both registering from the same IP (NAT), in this case either peer could match for connections from an IP. It's also this behaviour that prevented SIP guests over tcp. The above referenced commit removed this behaviour, but kept applying the SIP_INSECURE_PORT only to WS|WSS|UDP. Since WS and WSS is also TCP based, the logic here should fall into the TCP category. This patch updates things such that the previously non-explicit (TCP behaviour) transport test gets performed explicitly (ie, matched peer must allow for the used transport), as well as the indeterministic source-port nature of the TCP protocol is taken into account. The new match algorithm now looks like: 1. As per previous behaviour, IP address is matched first. 2. Explicit filter with respect to transport protocol, previous behaviour was semi-implied in the test for TCP pure IP match - this now made explicit. 3. During first pass (without SIP_INSECURE_PORT), always match on port. 4. If doing UDP, match if matched against peer also has SIP_INSECURE_PORT, else don't match. 5. Match if not a dynamic host (for non-UDP protocols) 6. Don't match if this is WS|WSS, or we can't trust the Contact address (presumably due to NAT) 7. Match (we have a valid Contact thus if the IP matches we have no choice, this will likely only apply to non-NAT). To logic-test this we need a few different scenarios. Towards this end, I work with a set number of peers defined in sip.conf: [peer1] host=1.1.1.1 transport=tcp [peer2] host=1.1.1.1 transport=udp [peer3] host=1.1.1.1 port=5061 insecure=port transport=udp [peer4] host=1.1.1.2 transport=udp,tcp [peer5] host=dynamic transport=udp,tcp Test cases for UDP: 1 - incoming UDP request from 1.1.1.1: - previous: - pass 1: * peer1 or peer2 if from port 5060 (indeterminate, depends on peer ordering) * peer3 if from port 5061 * peer5 if registered from 1.1.1.1 and source port matches - pass 2: * peer3 - current: as per previous. - new: - pass 1: * peer2 if from port 5060 * peer3 if from port 5061 * peer5 if registered from 1.1.1.1 and source port matches - pass 2: * peer3 2 - incoming UDP request from 1.1.1.2: - previous: - pass 1: * peer5 if registered from 1.1.1.2 and port matches * peer4 if source port is 5060 - pass 2: * no match (guest) - current: as previous. - new as previous (with the variation that if peer5 didn't have udp as allowed transport it would not match peer5 whereas previous and current code could). 3 - incoming UDP request from anywhere else: - previous: - pass 1: * peer5 if registered from that address and source port matches. - pass 2: * peer5 if insecure=port is additionally set. * no match (guest) - current - as per previous - new - as per previous Test cases for TCP based transports: 4 - incoming TCP request from 1.1.1.1 - previous: - pass 1 (indeterministic, depends on ordering of peers in memory): * peer1; or * peer5 if peer5 registered from 1.1.1.1 (irrespective of source port); or * peer2 if the source port happens to be 5060; or * peer3 if the source port happens to be 5061. - pass 2: cannot happen since pass 1 will always find a peer. - current: - pass 1: * peer1 or peer2 if from source port 5060 * peer3 if from source port 5060 * peer5 if registered as 1.1.1.1 and source port matches - pass 2: * no match (guest) - new: - pass 1: * peer 1 if from port 5060 * peer 5 if registered and source port matches - pass 2: * peer 1 5 - incoming TCP request from 1.1.1.2 - previous (indeterminate, depends on ordering): - pass 1: * peer4; or * peer5 if peer5 registered from 1.1.1.2 - pass 2: cannot happen since pass 1 will always find a peer. - current: - pass 1: * peer4 if source port is 5060 * peer5 if peer5 registered as 1.1.1.2 and source port matches - pass 2: * no match (guest). - new: - pass 1: * peer4 if source port is 5060 * peer5 if peer5 registered as 1.1.1.2 and source port matches - pass 2: * peer4 6 - incoming TCP request from anywhere else: - previous: - pass 1: * peer5 if registered from that address - pass 2: cannot happen since pass 1 will always find a peer. - current: - pass 1: * peer5 if registered from that address and port matches. - pass 2: * no match (guest) - new: as per current. It should be noted the test cases don't make explicit mention of TLS, WS or WSS. WS and WSS previously followed UDP semantics, they will now enforce source port matching. TLS follow TCP semantics. The previous commit specifically tried to address test-case 6, but broke test-cases 4 and 5 in the process. ASTERISK-27881 #close Change-Id: I61a9804e4feba9c7224c481f7a10bf7eb7c7f2a2 2018-08-20 07:23 +0000 [a74f8e51a6] Jaco Kroon * AMI: be less verbose when adding HTTP headers to AMI/HTTP messages. All HTTP/AMI message headers are being sent to the verbose channel. There are multiple places this is happening. Consolidate the loop into a function. Drop the debug/verbose message. Convert to using ast_asprintf to perform the length calculation, memory allocation and snprintf all in one step. Change-Id: Ic45e673fde05bd544be95ad5cdbc69518207c1a1 2018-08-23 06:57 +0000 [3bdbbb7637] Florian Floimair * alembic: increase uri column size When mobile SIP clients register with Asterisk that use some sort of push notifications, the URI can get quite lengthy due to the additional push-service annotations (things like tokens, pn-type, etc.) contained in it. ASTERISK-28022 #close Change-Id: I4c7ceadc3bb405f3daf722641c8cd5ca4188cc37 2018-08-22 10:50 +0000 [c8bacd45f1] Matthew Fredrickson * sample_configs: noload res_hep.so by default Change disables loading of res_hep.so in default installation. Loading res_hep has a performance impact whether it's used or not. This disables loading of it in sample config files. Change-Id: I5ec150cf941634fabc72973e5bf1a965cb0ef9d0 2018-08-21 13:50 +0000 [14c6f8be9d] Sean Bright * app_queue: Silence GCC 8 compiler warning I'm only seeing an error in 14+, so I assume it is due to different compiler options: app_queue.c: In function ‘handle_queue_add_member’: app_queue.c:10234:19: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 3 [-Werror=format-overflow=] sprintf(num, "%d", state); ^~ app_queue.c:10234:18: note: directive argument in the range [-2147483648, 99] sprintf(num, "%d", state); ^~~~ Compiler: gcc version 8.0.1 20180414 (experimental) [trunk revision 259383] (Ubuntu 8-20180414-1ubuntu2) Change-Id: I18577590da46829c1ea7d8b82e41d69f105baa10 2018-08-20 11:23 +0000 [5ec27d5206] Richard Mudgett * AMI: Remove docs for nonexistent AMI ContactStatus event headers Change-Id: I5736965c64c44338f7330e85a24bb46818607f19 2018-08-06 06:22 +0000 [457ba355aa] Joshua Colp * res_pjsip: Reduce processing when a Contact is updated. When a Contact is updated the only material change that qualify support cares about is the underlying configuration for the AOR. In this case we will update things with the new AOR information but otherwise the callback to indicate the Contact has changed can be ignored. This is because it is only when a Contact is added or deleted that material changes occur within the qualify support. An update can't change the URI since it would result in a new Contact so it can be ignored. Change-Id: I2f97ebfa79969a36a97bb7b9afd5b6268cf1a07d 2018-08-10 19:28 +0000 [40f1604e2f] Richard Mudgett * res_pjsip_t38.c: Fix crash if already saw a final T.38 reINVITE response. We were still getting crashes after the first fix. Somehow we receive a non-2xx final response before we get a 200 final response. With the failure response we had already cleaned up and destroyed some data structures. When the unexpected 200 response comes in we crash. * Add protection code to prevent processing another final T.38 reINVITE response. ASTERISK-27944 Change-Id: I8b5baba8d07fe4d63f0d7d05d3eb9a3d27d40a74 2018-08-09 18:46 +0000 [8cd36ab9b6] Richard Mudgett * res_sorcery_realtime.c: Fix unqualified fetch warning. The allow_unqualified_fetch option for the sorcery realtime backend blocked actually fetching all rows when the option is set to warn. * Made issue a warning and actually do the request when allow_unqualified_fetch=warn is set. Change-Id: I74456c80a03a62dce66fc3dc3cb0cf2351ac4312 2018-06-11 00:07 +0000 [328f772d3b] Kirsty Tyerman * pbx_dundi: Added IPv6 support for dundi Change includes move to netsock2 library. ASTERISK-27164 Reported-by: Adam Secombe Change-Id: Ia9e8dc3d153de7a291dbda4bd87fc827dd2bb846 2018-08-15 21:31 +0000 [273e2802aa] Richard Mudgett * pbx_dundi.c: Misc memory management fixes when destroying peers * In destroy_peer(), fixed memory leaks of lookup history strings and qualify transactions when destroying peers. * In destroy_peer(), fixed leaving the registerexpire scheduled callback active when a peer is destroyed on a reload. The reload marks and sweeps peers so any peers not explicitly configured get destroyed. Peers created dynamically from the '*' peer will not exist until they re-register after the reload. These destroyed peers caused memory corruption when the registerexpire timer expired. * Made build_peer() not schedule any callbacks on the '*' peer (empty_eid). It is a special peer that is cloned to dynamically created peers so it doesn't actually get involved in any message transactions. * Made do_register_expire() remove the dundi/dpeers AstDB entry when a peer registration expires. * Fix deep_copy_peer() to not copy some things that cannot be copied to the cloned peer structure. Timers, message transactions, and lookup history are specific to a peer instance. * Made set_config() lock around processing the mappings configuration. * Reordered unload_module() to handle load_module() declining the load due to error. Change-Id: Ib846b2b60d027f3a2c2b3b563d9a83a357dce1d6 2018-08-15 23:49 +0000 [d4e72ee296] Richard Mudgett * pbx_dundi.c: Handle thread shutdown better. Change-Id: Id52f99bd6a948fe6dd82acc0a28b2447a224fe87 2018-08-15 18:14 +0000 [916abe7cdc] Richard Mudgett * pbx_dundi: Fix debug frame decode string. * Fixed a typo in the name of the REGREQ frame decode string array. * Fixed off by one range check indexing into the frame decode string array. * Removed some unneeded casts associated with the decode string array. Change-Id: I77435e81cd284bab6209d545919bf236ad7933c2 2018-08-16 16:21 +0000 [c035d0afe0] Richard Mudgett * pbx_dundi: Update sample config documentation. Change-Id: I33d0ad0611c2124ca3440f0f811fa0f45e4e2849 2018-08-15 14:44 +0000 [aee5f7c1b6] Richard Mudgett * res_rtp_asterisk.c: Fix unused variable warnings Compiling without SRTP support installed resulted in some unused variable warnings. These warnings also showed that the srtp variable was obtained and passed around some functions but not really used even when a system has SRTP installed. Change-Id: I6daad34be3e89b19adef6e2fbe738018975155fc 2018-08-16 13:51 +0000 [00563ce21a] George Joseph * CI: Fixup for non-13 branches Change-Id: I5e1d4a09e58b92b541bc8ed6f9e10e54c4e5101f 2018-08-16 13:28 +0000 [e5f30eba79] George Joseph * CI: Final version of setting correct gerrit creds Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3 2018-08-16 12:08 +0000 [8e1c541acf] George Joseph * CI: Add https credentials to gerrit checkouts If the review to be tested is in a project with restricted access, we need to use the jenkins user's gerrit https credentials when we do the checkout or the checkout will fail. Change-Id: I9dc9994763c5ebfeb9f1cff60fb53f6902b7fd5f 2018-08-16 09:04 +0000 [01c90fefb3] Rodrigo Ramírez Norambuena * make config: os-release output error. Fix not show the error "/bin/sh: /etc/os-release: No such file or directory" when the command 'make config' is run in a System without systemv. The instruction 'make config' pre execute the syntax "$(shell . /etc/os-release && echo $$ID)" to identified if system is a Slackware and Opensuse. This change prevent show the message and is send to the /dev/null Change-Id: I7f43e281a8d9405b2519fc653de82d9b8b645fdf 2018-08-09 02:34 +0000 [926d647def] Torrey Searle * res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered If in the initial sdp the caller doesn't include the line a=rtcp-mux Then asterisk shoud not include rtcp-mux in the response regardless of rtcp-mux being enabled on the endpoint ASTERISK-28007 #close Change-Id: I58e9b9f40a139afc0da5de41906cc608fb62adc7 2018-08-15 14:49 +0000 [a83c464d9d] Corey Farrell * res_resolver_unbound: Fix leak of config nameserver strings. Change-Id: I3f396316bb40d1ae6e91f5f688042420f1a540ed 2018-08-15 13:51 +0000 [24302bda21] Corey Farrell * res_pjsip: Resolve transport management leak at shutdown. Cleanup idle check scheduled events at shutdown. Change-Id: I61bfbb56bac69fe840c3242927d31ff3593be461 2018-08-15 11:31 +0000 [eb34b881a4] Corey Farrell * res_odbc: Allow unload at shutdown. This makes it possible for REF_DEBUG to report no leaks when loading res_odbc. Change-Id: I1a3dea786bd6e7f4820a6dd5cbaa197fa783ce93 2018-08-15 11:12 +0000 [52fe5fe2c8] Corey Farrell * res_pjsip: Fix leak in pjsip_options. sip_options_get_endpoint_state_compositor_state leaked a reference to the first available endpoint state compositor that was found. Change-Id: Idb6be19f7219b6eed1dfb19c1e740dd40cb3fdc7 2018-08-14 11:55 +0000 [58c3677581] Richard Mudgett * contrib/scripts: Make astgenkey executable Change-Id: I11641d65592536dea9cbca5aa94a24c25d24dd5f 2018-08-14 07:29 +0000 [fca3d4fe5f] Joshua Colp * res_pjsip_caller_id: Add "party" parameter to RPID header. This change adds the "party" parameter to the Remote-Party-ID header which indicates which party the header information is applicable to. In Asterisk this is determined on whether we are the calling or called party. This is added to improve interoperability with some implementations. ASTERISK-28006 Change-Id: I1eec3e377ffff8633b5c1dd59a05e9533122cfca 2018-08-07 10:57 +0000 [c31a01bd75] Ben Ford * res_pjsip/rtp: No joint capabilities between streams. When a conference contained a mixture of audio/video and audio-only users, a NOTICE message would pop up stating there are no joint capabilities between streams. This happens because streams can never be removed, but they can be in a REMOVED state. If we have the scenario where user A joins with audio/video, user B joins with audio-only, and user C joins with audio/video, then user A leaves, the message would be triggered. That removed stream is still in the SDP, but Asterisk would pass it through, causing it to be seen as a ulaw stream. A check has been added for removed streams, setting their status to REMOVED when handling negotiated SDPs. Also addressed an issue where user A joins, then user B joins but does not receive video until much later. Full frames were not being sent, causing some PLI from the browser. Because the video was flowing in one direction, the browser sets the SSRC to 1, but Asterisk was dropping the PLI because of that. Added a check to see if the SSRC is 1 or not, which sends full frames and allows video to flow between user A and user B. This should only happen when dealing with PSFB or FUR, and in the case of PSFB, only for PLI. ASTERISK-27398 Change-Id: I26e7c6f101bc119549eeca406b5bcd25ad8ebc5e 2018-08-12 11:04 +0000 [2ce061091e] Ivan Poddubny * app_queue: set QUEUESTATUS to LEAVEEMPTY instead of CONTINUE When a call leaves a queue on leaveempty condition, QUEUESTATUS must be set to LEAVEEMPTY, no matter whether Queue was executed with or without the "c" (continue) option. The regression was introduced in the fix for ASTERISK_25665. The following fix (ASTERISK_27065) was incomplete, as QUEUESTATUS was overwritten in case when "c" is set, regardless of what was the cause for leaving the queue. ASTERISK-27973 #close Reported-by: Valentin Safonov Change-Id: Iec013fe6a26a4e825ca572a1dda4f3cee5f6f80c 2018-08-09 15:25 +0000 [63ca367ab9] Corey Farrell * Sample configs: Fix pjsip.conf syntax error. It is valid for a config file to be empty or contain only comments, but not valid for a config value to be set when no uncommented context exists. This caused an error to be loged numerous times during start when loading the default pjsip.conf. Change-Id: Icf3b0d69b4ecb6e935eecd43c99ed8b32a5a1cf6 2018-07-19 22:28 +0000 [addfc93815] Corey Farrell * CI: Add support for coverage processing. Enable coverage with `./tests/CI/buildAsterisk.sh --coverage`. This will cause Asterisk to be compiled with coverage support. It also initializes 'before' coverage data for all sources. Accept --tested-only to disable modules which are not run by any test. Enabling coverage also sets tested-only true by default. To build everything with coverage enabled use `--coverage --tested-only=0`. ./tests/CI/processCoverage.sh is used to process the coverage and generate HTML reports. Fix utils/check_expr2 which failed to compiled with coverage enabled. Add status output 5 times per stage of astobj2_test_perf to ensure remote CLI does not timeout when compiled with coverage. Remote CLI disconnects if no output is received for 60 seconds. When coverage is enabled it takes about 70 seconds for my laptop to run the stages of this test, so with the change a message is printed every 14 seconds. Change-Id: I890f7d5665087426ad7d3e363187691b9afc2222 2018-08-06 12:19 +0000 [c6ad25dcb7] Richard Mudgett * res_pjsip.h: Fix doxygen comments. Change-Id: I9cf97bdc756012d1f552ab007f4aa85e0ddb4e62 2018-08-06 06:36 +0000 [455ca1095e] Joshua Colp * stasis: Reduce calculation of stasis message type hash. 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 2018-07-30 07:49 +0000 [603d1e8d4b] Alexander Traud * pjproject_bundled: Fix for Solaris builds. Do not undef s_addr. The authors of PJProject undef s_addr because of some issue in Microsoft Windows. However in Oracle Solaris, s_addr is not a structure member, but defined to map to the real structure member. Updates the patch from ASTERISK_20366 ASTERISK-27997 Change-Id: I8223026d4d54e2a46521085fcc94bfa6ebe35b11 2018-08-03 15:59 +0000 [acbb9f52b2] Richard Mudgett * res_pjsip: Make pjlib.h consistently included. * 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 2018-08-02 14:37 +0000 [a90177cd63] Salah Ahmed * dialplan_functions: wrong srtp use status report of a dialplan function If asterisk offer an endpoint with SRTP and that endpoint respond with non srtp, in that case channel(rtp,secure,audio) reply wrong status. Why delete flag AST_SRTP_CRYPTO_OFFER_OK while check identical remote_key: Currently this flag has being set redundantly. In either case identical or different remote_key this flag has being set. So if we don't set it while we receive identical remote_key or non SRTP SDP response then we can take decision of srtp use by using that flag. ASTERISK-27999 Change-Id: I29dc2843cf4e5ae2604301cb4ff258f1822dc2d7 2018-07-30 06:05 +0000 [1c7c867ce0] Alexander Traud * pjproject_bundled: Find shared libraries in root --with-ssl=PATH. The script configure from Teluu expects shared libraries (.so) in a subfolder called 'lib', when --with-xyz=PATH is specified. However for OpenSSL, the default location is the root of the source folder = PATH. Furthermore, Asterisk supports both, 'lib' and root. For consistency and because Asterisk is using (only) OpenSSL in PJProject, it is enhanced to support both locations, just like Asterisk. ASTERISK-27995 Change-Id: I8eb916a88b6b8c22e29bb40bee8faaca6c73406f 2018-08-01 09:45 +0000 [cbf082ed53] Joshua Colp * res_pjsip_registrar: Improve performance on inbound handling. This change removes a sorcery lookup for retrieving all contacts at the end of the registration process by keeping track of the contacts that are added/updated/deleted. This ensures at the end of the process the container of contacts we have is the current state. Pool usage has also been reduced by allocating one for usage throughout the handling of a REGISTER and resetting it to a clean state. This ensures that in most cases we allocate once and just reuse it. ASTERISK-28001 Change-Id: I1a78b2d46f9a2045dbbff1a3fd6dba84b612b3cb 2018-07-17 07:13 +0000 [3424795f3a] Torrey Searle * thirdparty/pjproject: fix deadlock in response retransmissions The tdata containing the response can be shared by both the dialog object and the tsx object. In order to prevent the race condition between the tsx retransmission and the dialog sending a response, clone the tdata before modifying it for the dialog send response. ASTERISK-27966 #close Change-Id: Ic381004a3a212fe1d8eca0e707fe09dba4a6ab4e 2018-07-31 23:54 +0000 [a10a3aff6a] Corey Farrell * Build System: Improve ccache matching for different menuselect options. 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 2018-07-31 11:24 +0000 [68a3d39a99] Richard Mudgett * pjsip_wizard.conf.sample: Update remote_hosts description. Remove the note that SRV records are not supported as that is no longer true. ASTERISK-27993 Change-Id: Id0dd6ef40e52702be9727a2b6122216cb00bb4ca 2018-07-27 13:23 +0000 [a354599ecc] George Joseph * CI: Add optional uninstall step before installing asterisk Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7 2018-07-28 11:49 +0000 [7418dfa2c7] Alexander Traud * BuildSystem: Enable ncurses for menuselect in Solaris 11. The check for the library ncurses should use not use the header but , because on some platforms is not a drop-in replacement for : For example in Solaris, the symbol initscr is a typedef in to a symbol which does not exist in the library ncurses (initscr32). Simply use when you link to ncurses. Furthermore in Solaris, the header is in a subdirectory /usr/include/ncurses and not available via pkg-config. ASTERISK-15331 ASTERISK-14935 ASTERISK-12382 ASTERISK-9107 Change-Id: Ife367776b0ccf17d3fefed868245376bfb93745d 2018-07-28 08:00 +0000 [3aa6be6b51] Joshua Colp * res_pjsip_pubsub: Use ast_true for "prune_on_boot". Change-Id: Iedec4e7390b3e821987681da24d0298632b9873d 2018-07-28 07:39 +0000 [0a4d58735f] Alexander Traud * BuildSystem: Enable Jansson in Solaris 11. In Solaris, the header 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 2018-07-24 13:44 +0000 [e5ae04b48b] Richard Mudgett * res_pjsip_endpoint_identifier_ip.c: Added regex support to match_header This patch adds regular expression support to make the identify section's match_header option more useful when attempting to match complex headers like the 'To' or 'From' headers. The 'From' header has variable components such as the tag parameter that you cannot predict. To specify a regular expression put slashes around the regular expression in place of the header value. [identify-alice] type=identify endpoint=alice match_header=From: // * Added regex support to match_header so you could match a 'To' header among other complex headers. Fixed reported crashes when trying to match special headers like 'Contact'. The identify section's match_header method used code that assumed you were matching a generic header. Any other type of header could cause a crash if the header structure variant did not match the generic header enough. * Made use code that will work for any header type instead of code specific to generic headers. Other fixes while in the area: * Made check all headers of the requested name. * Added some more sanity checks to the configured identify matching options when applying the configuration. ASTERISK-27548 Change-Id: I27dfd4ff5e2259b906640e3c330681b76b4ed1f1 2018-07-27 10:46 +0000 [4265391859] Joshua Colp * res_pjsip_pubsub: Treat "prune_on_boot" as a yes / no. The alembic for the PJSIP subscription persistence table has the "prune_on_boot" field as a boolean. While in Asterisk we are tolerant of many different definitions of true and false in the database we only accept "yes" and "no". This change makes the field treated as a yes/no instead of an integer, thus storing "yes" and "no" instead of "1" and "0". Change-Id: Ic8b9211b36babefe78f70def6828a135a6ae7ab6 2018-07-27 08:26 +0000 [870fe7f60c] Alexander Traud * res_rtp_asterisk: In Developer Mode, do not require OpenSSL. OpenSSL is an optional external library and should stay optional even when Developer Mode is configured. ASTERISK-27990 Change-Id: Ia68a4cd5474b26d45e0f43b04032ad598022853b 2018-07-26 18:54 +0000 [116a599b7e] George Joseph * CI: Fix placement of job summary statments Change-Id: Iace19e718f4e8fb48eb7dc9f98af53b115cc45f3 2018-07-26 12:52 +0000 [709f4b81e7] Corey Farrell * loader: Process dependencies for built-in modules. With the new module loader it was missed that built-in modules never parsed dependencies from mod->info into vectors of mod. This caused manager to be initialized before acl (named_acl). If manager.conf used any named ACL's they would not be found and result in no ACL being applied to the AMI user. In addition to the manager ACL fix this adds "extconfig" to all builtin modules which support realtime configuration. This only matters if one of the builtin modules is configured with 'preload', depending on "extconfig" will cause config.c to automatically be initialize during the preload stage. Change-Id: I482ed6bca6c1064b05bb538d7861cd7a4f02d9fc 2018-07-18 09:32 +0000 [cb276b5085] Emmanuel BUU * res_rtp_asterisk: Avoid merging command and regular T.140 text packets When realtime text packets are to be sent, the text is accumulated in a buffer and sent regularly by a timer. It can happen that commands such as a backspace, CR, or LF get merged with regular text. This breaks some UAs. The proposed change: * We test if the current packet contains a command. If so we send the buffer immediately. * We test if the buffer contained a command. If so we send the buffer immediately. * We accumulate the text (or the command) in the buffer. ASTERISK-27970 Change-Id: Ifbe993311410fa855cb8aa4a12084db75f413462 2018-07-26 11:34 +0000 [e55cad967e] George Joseph * CI: Add docker info to job summary Change-Id: I45d52005a9b692ad303c11792f226ace1e449901 2018-07-23 13:49 +0000 [852e157b19] Corey Farrell * Build System: Create 'make install-configs' target. This target requires specifying CONFIG_SRC=path_to_configs. This can be used to install custom configs for the Asterisk build while still performing directory replacements on asterisk.conf. Modify internal INSTALL_CONFIGS so first argument requires full path to the config sources relative to Asterisk source root. Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab 2018-07-25 15:33 +0000 [783bff0637] Kevin Harwell * json.c: improve ast_json_to_ast_variables performance When converting from a json object to an ast variables list the conversion algorithm was doing a complete traversal of the entire variables list for every item appended from the json structure. This patch makes it so the list is no longer traversed for each new ast variable being appended. Change-Id: I8bf496a1fc449485150d6db36bfc0354934a3977 2018-07-25 05:32 +0000 [66f581313f] Joshua Colp * devicestate: Don't create topic when change isn't cached. 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 2018-07-25 10:20 +0000 [3dcf26cb94] George Joseph * CI: Explicitly pass BRANCH_NAME to buildAsterisk and installAsterisk Change-Id: I652f4a0ea5107c778e27a78bccb67b18b0c4e087 2018-07-24 13:29 +0000 [797835c5b9] George Joseph * CI: Add options to initialize and cleanup database to runTestsuite.sh Change-Id: I352333233bab5377723bf37d490ba84fc55bc853 2018-07-25 09:07 +0000 [05a4b448af] Corey Farrell * CI: Do not `mkdir 2`. Change-Id: Ib7377d26a6c98b38bad463f47c84f1875ac84eb7 2018-07-25 07:34 +0000 [2f275f8472] Corey Farrell * Build System: Silence build of bundled jansson. Change-Id: I7392c79c0173057f5378010bf1fe65e300e8fc56 2018-07-25 07:13 +0000 [ceb199e19f] George Joseph * CI: RefDebug: Fix reference to testsuite URL Change-Id: I0ee41d95a87f0d97b01f2757012b846bcfe6443d 2018-07-24 14:28 +0000 [af5984d694] Corey Farrell * Build System: Fix bundled jansson install. Update the bundled jansson Makefile to do nothing during Asterisk install, use a target that is not phony to initiate the jansson make and install. Change-Id: I7643cc3d39af9feba8fc0da676b646efc5f8b3bb 2018-07-24 10:43 +0000 [cdb725526e] Corey Farrell * CI: Use bundled jansson if needed. Use pkg-config to determine if jansson is at least 2.11, enabled bundled version otherwise. Change-Id: Ib555a8b72ff6f6925f9280ef035caa0b91ca4bd2 2018-07-24 04:57 +0000 [c5bac9ed90] Florian Floimair * res_pjsip: Change log message from error to warning for valid use cases If a SIP MESSAGE is triggered for an endpoint that is currently not registered - and therefore has no valid contact associated - an error message was logged. Since this is a valid request in a valid use cases this is now changed to a warning, as discussed with Matt Fredrickson on the asterisk-dev mailing list. Change-Id: I55eb62d2712818a58c7532119dec288bd98cf0c0 2018-07-24 05:39 +0000 [f827f36ff3] George Joseph * CI: Add --privileged flag to docker options Change-Id: If92d55f15306e55dd7091ac3c47b13ebbbb03488 2018-07-24 05:22 +0000 [eed429c811] George Joseph * CI: Set correct user:group when publishing docs Change-Id: Ibabeb9ac730d9755cf54318d0da74771c939b86b 2018-07-23 12:21 +0000 [0504594a3e] Richard Mudgett * core: AST_DEVMODE no longer affects ABI. Remove AST_DEVMODE from the AST_BUILDOPTS list and the AST_BUILDOPTS_SUM calculation as it no longer affects API/ABI compatibility. Change-Id: Id5bd6dfade173a53b3a49f715586b86e3fb24acb 2018-07-20 16:21 +0000 [0f8657aae9] Richard Mudgett * asterisk.c: Make displayed copyright always consistent Change-Id: I4f5499486e8ec90d7c7ffeebc659ceda1db6d5b5 2018-07-23 10:23 +0000 [3b78651c3c] Corey Farrell * CI: Split --test-command argument. The --test-command argument has now been split, unit tests now use `--unittest-command` and the testsuite uses --testsuite-command. This will make it easier to create a script which run everything by forwarding the same arguments to all CI scripts. Change-Id: Ia54aa4848eaffbdf13175fcda40fc0b23080ad71 2018-07-20 06:20 +0000 [ba8f2c401c] George Joseph * xmldoc.c: Fix dump of xml document 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 2018-07-21 11:58 +0000 [0ee061326a] Corey Farrell * CI: Fix mkdir CACHE_DIR. Change-Id: Ic9f9a61e230047836c836206731f8ff7eb3538c9 2018-07-21 10:48 +0000 [747b65f675] Corey Farrell * build_tools/make_version: Get MAINLINE_BRANCH from .gitreview. Use .gitreview defaultbranch setting to determine the mainline branch. This allows the script to be used against other directories which might not be on the same defaultbranch. This can be used by CI scripts to report the testsuite version being used: ./build_tools/make_version ${TESTSUITE_DIR} Change-Id: Ifdad4a9d8a26138c41bc6b630ecc3e34ea1c2758 2018-07-22 10:41 +0000 [33f855bb69] Joshua Colp * sched: Make ABI compatible between dev mode and non-dev mode. 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 2018-07-20 15:52 +0000 [09c4be9433] Richard Mudgett * asterisk.c: Update displayed copyright year for v16 release. Change-Id: I60622731d928ee9506b1d28934095f0dc3e5306e 2018-07-16 15:08 +0000 [ee154464d7] Corey Farrell * Enable bundling of jansson, require 2.11. Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd 2018-07-20 09:25 +0000 [fa6d5db229] Corey Farrell * CI: Fix logger.conf for unit tests. Change-Id: Idea59d60eab20105de50b34f0f0d506e6ef55d5c 2018-07-19 10:34 +0000 [739cfe128d] George Joseph * CI: Add wiki doc publish to periodics Change-Id: I29ba26134e5083bc6788ede235f1a5d4383c148a 2018-07-20 06:54 +0000 [2c9757bc90] Joshua Colp * res_pjsip: Update default keepalive interval to 90 seconds. A change recently went in which disabled the built-in PJSIP keepalive. This defaulted to 90 seconds and kept TCP/TLS connections alive. Disabling this functionality has resulted in a behavior change of not doing keepalives by default resulting in TCP/TLS connections dropping for some people. This change makes our default keepalive interval 90 seconds to match the previous behavior and preserve it. ASTERISK-27978 Change-Id: Ibd9a45f3cbe5d9bb6d2161268696645ff781b1d6 2018-07-19 16:17 +0000 [e6bb2efaab] Richard Mudgett * res_pjsip: Update endpoint transport option documentation. Change-Id: I5394fdff6a296efc8e1695a156e616acd932ae52 2018-07-19 13:27 +0000 [8a100ca52b] Richard Mudgett * pjsip_resolver.c: Use replacement function * Use the replacement function ast_sip_push_task_wait_servant() instead of the deprecated ast_sip_push_task_synchronous(). Change-Id: I145b550ba7054640c7faa3b644e63137f505c612 2018-07-18 17:13 +0000 [d7db9f2152] Corey Farrell * contrib: Update systemd README.txt. Mention need to compile Asterisk with systemd development package installed. ASTERISK-27968 Change-Id: Ib3a973be403c61cbe09572b0f912fb1aa1bff026 2018-07-18 14:20 +0000 [e01e636959] Joshua Colp * Update UPDATE.txt for 16 and update ARI stubs. Copied UPGRADE.txt -> UPGRADE-16.txt Created new UPGRADE.txt Updated ARI stubs version to 17. Change-Id: I4210e53f8022a2a68c7653595bdd13fbebac41ee 2018-08-08 16:02 +0000 Asterisk Development Team * asterisk 16.0.0-rc1 Released. 2018-07-27 13:23 +0000 [d3789cc420] George Joseph * CI: Add optional uninstall step before installing asterisk Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7 2018-07-28 08:00 +0000 [89b669a227] Joshua Colp * res_pjsip_pubsub: Use ast_true for "prune_on_boot". Change-Id: Iedec4e7390b3e821987681da24d0298632b9873d 2018-07-27 10:46 +0000 [0028db48cc] Joshua Colp * res_pjsip_pubsub: Treat "prune_on_boot" as a yes / no. The alembic for the PJSIP subscription persistence table has the "prune_on_boot" field as a boolean. While in Asterisk we are tolerant of many different definitions of true and false in the database we only accept "yes" and "no". This change makes the field treated as a yes/no instead of an integer, thus storing "yes" and "no" instead of "1" and "0". Change-Id: Ic8b9211b36babefe78f70def6828a135a6ae7ab6 2018-07-26 18:54 +0000 [24e4e45177] George Joseph * CI: Fix placement of job summary statments Change-Id: Iace19e718f4e8fb48eb7dc9f98af53b115cc45f3 2018-07-26 12:52 +0000 [c384a4cdcd] Corey Farrell * loader: Process dependencies for built-in modules. With the new module loader it was missed that built-in modules never parsed dependencies from mod->info into vectors of mod. This caused manager to be initialized before acl (named_acl). If manager.conf used any named ACL's they would not be found and result in no ACL being applied to the AMI user. In addition to the manager ACL fix this adds "extconfig" to all builtin modules which support realtime configuration. This only matters if one of the builtin modules is configured with 'preload', depending on "extconfig" will cause config.c to automatically be initialize during the preload stage. Change-Id: I482ed6bca6c1064b05bb538d7861cd7a4f02d9fc 2018-07-26 11:34 +0000 [9f1041c4d0] George Joseph * CI: Add docker info to job summary Change-Id: I45d52005a9b692ad303c11792f226ace1e449901 2018-07-25 15:33 +0000 [c5761ee58e] Kevin Harwell * json.c: improve ast_json_to_ast_variables performance When converting from a json object to an ast variables list the conversion algorithm was doing a complete traversal of the entire variables list for every item appended from the json structure. This patch makes it so the list is no longer traversed for each new ast variable being appended. Change-Id: I8bf496a1fc449485150d6db36bfc0354934a3977 2018-07-25 10:20 +0000 [cfd61ba237] George Joseph * CI: Explicitly pass BRANCH_NAME to buildAsterisk and installAsterisk Change-Id: I652f4a0ea5107c778e27a78bccb67b18b0c4e087 2018-07-24 13:29 +0000 [a81870110a] George Joseph * CI: Add options to initialize and cleanup database to runTestsuite.sh Change-Id: I352333233bab5377723bf37d490ba84fc55bc853 2018-07-25 09:07 +0000 [4a01be5c80] Corey Farrell * CI: Do not `mkdir 2`. Change-Id: Ib7377d26a6c98b38bad463f47c84f1875ac84eb7 2018-07-25 07:34 +0000 [e6f2bae0cc] Corey Farrell * Build System: Silence build of bundled jansson. Change-Id: I7392c79c0173057f5378010bf1fe65e300e8fc56 2018-07-25 07:13 +0000 [f1156f0cfd] George Joseph * CI: RefDebug: Fix reference to testsuite URL Change-Id: I0ee41d95a87f0d97b01f2757012b846bcfe6443d 2018-07-24 14:28 +0000 [7e99090c9d] Corey Farrell * Build System: Fix bundled jansson install. Update the bundled jansson Makefile to do nothing during Asterisk install, use a target that is not phony to initiate the jansson make and install. Change-Id: I7643cc3d39af9feba8fc0da676b646efc5f8b3bb 2018-07-24 10:43 +0000 [b32adca9b4] Corey Farrell * CI: Use bundled jansson if needed. Use pkg-config to determine if jansson is at least 2.11, enabled bundled version otherwise. Change-Id: Ib555a8b72ff6f6925f9280ef035caa0b91ca4bd2 2018-07-24 05:39 +0000 [e22cbe7c17] George Joseph * CI: Add --privileged flag to docker options Change-Id: If92d55f15306e55dd7091ac3c47b13ebbbb03488 2018-07-24 05:22 +0000 [3509ada06f] George Joseph * CI: Set correct user:group when publishing docs Change-Id: Ibabeb9ac730d9755cf54318d0da74771c939b86b 2018-07-23 12:21 +0000 [008d304be2] Richard Mudgett * core: AST_DEVMODE no longer affects ABI. Remove AST_DEVMODE from the AST_BUILDOPTS list and the AST_BUILDOPTS_SUM calculation as it no longer affects API/ABI compatibility. Change-Id: Id5bd6dfade173a53b3a49f715586b86e3fb24acb 2018-07-23 10:23 +0000 [5dbbc68311] Corey Farrell * CI: Split --test-command argument. The --test-command argument has now been split, unit tests now use `--unittest-command` and the testsuite uses --testsuite-command. This will make it easier to create a script which run everything by forwarding the same arguments to all CI scripts. Change-Id: Ia54aa4848eaffbdf13175fcda40fc0b23080ad71 2018-07-21 11:58 +0000 [2a13a4344e] Corey Farrell * CI: Fix mkdir CACHE_DIR. Change-Id: Ic9f9a61e230047836c836206731f8ff7eb3538c9 2018-07-22 10:41 +0000 [9742fb07c9] Joshua Colp * sched: Make ABI compatible between dev mode and non-dev mode. 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 2018-07-20 15:52 +0000 [2c51079d05] Richard Mudgett * asterisk.c: Update displayed copyright year for v16 release. Change-Id: I60622731d928ee9506b1d28934095f0dc3e5306e 2018-07-16 15:08 +0000 [3cdffa1342] Corey Farrell * Enable bundling of jansson, require 2.11. Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd 2018-07-20 09:25 +0000 [136d855f69] Corey Farrell * CI: Fix logger.conf for unit tests. Change-Id: Idea59d60eab20105de50b34f0f0d506e6ef55d5c 2018-07-19 10:34 +0000 [0c1513d8a0] George Joseph * CI: Add wiki doc publish to periodics Change-Id: I29ba26134e5083bc6788ede235f1a5d4383c148a 2018-07-20 06:20 +0000 [61a974ed4e] George Joseph * xmldoc.c: Fix dump of xml document 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 2018-07-20 06:54 +0000 [50a26b15a3] Joshua Colp * res_pjsip: Update default keepalive interval to 90 seconds. A change recently went in which disabled the built-in PJSIP keepalive. This defaulted to 90 seconds and kept TCP/TLS connections alive. Disabling this functionality has resulted in a behavior change of not doing keepalives by default resulting in TCP/TLS connections dropping for some people. This change makes our default keepalive interval 90 seconds to match the previous behavior and preserve it. ASTERISK-27978 Change-Id: Ibd9a45f3cbe5d9bb6d2161268696645ff781b1d6 2018-07-18 14:19 +0000 [958f76205b] Joshua Colp * Update mainline version for the 16 branch. Change-Id: I4d36277d10335349d83ae218fa10fee99c3e4c14 2018-07-18 14:18 +0000 [e7a76ffee1] Joshua Colp * Update ARI version for master/16. ARI goes from 3.0.0 to 4.0.0 Change-Id: I0649fa34926dc4fc89a166f1d2e3bbd965ef9ebe 2018-05-29 09:31 +0000 [fe78d374b0] Alexander Traud * pjproject_bundled: Repair ./configure --with-ssl=PATH. Previously, Asterisk did not tell its bundled PJProject about this configure parameter. Therefore, PJProject used the platform provided OpenSSL always. ASTERISK-27880 Change-Id: Iea545aec854dd0e2c061c69bb118a76ce56c5dc6 2018-05-10 13:11 +0000 [5bacde37a2] Ben Ford * res_rtp_asterisk: Add support for sending NACK requests. 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 2018-07-18 11:12 +0000 [59323121f3] Joshua Colp * res_sorcery_config: Allow configuration section to be used based on name. A problem I've seen countless times is a global or system section for PJSIP not getting applied. This is inevitably the result of the "type=" line missing. This change alleviates that problem. The ability to specify an explicit section name has been added to res_sorcery_config. If the configured section name matches this and there are no unknown things configured the section is taken as being for the given type. Both the PJSIP "global" and "system" types now support this so you can just name your section "global" or "system" and it will be matched and used, even without a "type=" line. ASTERISK-27972 Change-Id: Ie22723663c1ddd24f869af8c9b4c1b59e2476893 2018-07-17 05:24 +0000 [134e2f0ddc] Joshua Colp * module: Remove deprecated modules and update support levels. I have removed the STATIC_BUILD option immediately as it has not been maintained in many years and is non-functional. ASTERISK-27965 Change-Id: I64783d017b86dba9ee3c7bcfb97e59889a3f76d7 2018-07-18 11:34 +0000 [94dd0544e5] Chris-Savinovich * stasis: Improve message type "Use of before/init after destruction" Fixes issue where error msg "Use of before/init after destruction" was being printed on disabled messages in dev mode. With this fix if message is disabled a warning will print. ASTERISK-25548 Change-Id: Ie0d866d1cbc60c16dbef08bc65e99505c3c1adfa 2018-07-17 14:12 +0000 [993ba84cd3] Nick French * SRTP: Lower SDES key lifetime minimum to 2^20 SRTP SDES key lifetime support was added in ASTERISK_17899. In that addition, the minimum key lifetime to be accepted was set at the 10 hours @ 20ms/packet = 1800000 packets. The firmware in the obi1xx ATA uses a hardcoded lifetime of 2^20 packets. Lower the limit to 2^20 to support a wider field of clients. ASTERISK-27967 #close Change-Id: I81a0703c595a0c9101dfdf02300149a3cc39bf94 2018-07-17 11:09 +0000 [fcc0a6fe8a] George Joseph * CI: Fix merge strategy Change-Id: I5e3fb6adfa6cbf694c0deecf02e3879297b0c12e 2018-07-17 10:41 +0000 [3e5a6a6cfc] George Joseph * CI: Fix regex in daily and ref_debug jobs Change-Id: Icf2e67818b2155a158d2390b138613e1f653ea92 2018-07-17 09:09 +0000 [0e8976116f] Nick French * res_pjsip: Remove spurious error logging when printing silent headers Asterisk patched the pjproject source to avoid crashing when pjproject sip_msg headers are encountered with NULL vptr's, but the patch also output error messages for some valid headers which simply did not need to be added to the message itself, such as hidden route headers. pjproject has since applied a similar patch to their baseline to avoid crashes, but their version also avoids the spurious error logging. Lets use their patch instead. ASTERISK-27961 #close Change-Id: I2ddbd82c8da10e0dcc9807a48089d1f3c2d6e389 2018-07-17 10:15 +0000 [fa333dedd0] George Joseph * CI: Add pre-build merge back in as RECURSIVE Change-Id: I0ff1730ef4a4f0ac9f18ccc9bc0dfe7a782f57a8 2018-07-17 09:01 +0000 [2553255ace] George Joseph * CI: Remove pre-build merge from gates and checks Change-Id: Ibc151f63dcec4db847915c2f3cbe5b467dd59574 2018-07-17 07:13 +0000 [524f900382] George Joseph * CI: Fix logic inversion in runTestsuite Change-Id: I56399aa384468f45494c2c3650420563a0b6efe1 2018-07-17 04:03 +0000 [0af4a558da] George Joseph * CI: Add teardownRealtime Change-Id: I2fe55c38607eaec2fbf69ef23a5019e0c443a64b 2018-07-15 13:58 +0000 [49f83a7490] Corey Farrell * loader: Fix startup issues. * 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 2018-07-16 13:30 +0000 [a9cef123d9] George Joseph * CI: Prevent Jenkins from triggering jobs back to itself Change-Id: I9cae8bb3d1a2cea335d3ccd88d471832549666fd 2018-07-13 18:26 +0000 [5febc995df] Richard Mudgett * Build: Fix modules getting their optimization setting overridden. Asterisk modules that use PJPROJECT services have their compiler optimization and possibly their symbolic debug options overridden by the PJPROJECT configure script selected settings. * We need to filter-out any -O and -g options in PJ_CFLAGS before echoing out the result so the PJPROJECT_INCLUDE variable does not override the Asterisk module settings when using bundled PJPROJECT. NOTE: This patch only has an effect when using bundled PJPROJECT. ASTERISK-27563 Change-Id: If124169735ecf572ad1535cd43bff94cb44d5b30 2018-07-16 11:08 +0000 [d15ef68892] George Joseph * CI: runUnittests: loop a few times on waitfullybooted Change-Id: Icebc0d013896f3b2a7214945cac60647435c1651 2018-07-16 10:49 +0000 [252c4284df] George Joseph * CI: Add realtime checks to dailies Change-Id: I6dc8ab1679b3505c6dde1d47e1b9276df47814f8 2018-07-16 09:13 +0000 [1a52ab70c7] George Joseph * CI: Add weekly REF_DEBUG testsuite run Change-Id: I5b581d0a0d1d1bb9b38961d40b112fb448355037 2018-07-16 08:44 +0000 [9633e9dfd7] George Joseph * CI: Fix bad reporting of status by the verification pub Change-Id: I6f31a130b3ba0187149aaaa2ce94195a79e0f6a6 2018-07-16 07:16 +0000 [b8d75bbb37] George Joseph * CI: Make build tag an acceptable docker name Change-Id: I3a4b8a4a9c488ddabf9daf651dc1334222056f38 2018-07-13 22:44 +0000 [0885ab8afc] Corey Farrell * Fix declaration of PBX_CURL for ./configure --without-libcurl When `--without-libcurl` is used PBX_CURL is never set. Set default value 0 so the proper value is passed to menuselect. Change-Id: I03e2842a00899cbca2dbde52bb1f6636d54bae1e 2018-07-10 13:28 +0000 [34f3fe9552] George Joseph * app_confbridge: Use the SDP 'label' attribute to correlate users Previously, the msid "label" attribute was used to correlate participant info but because streams could be reused, the msid wasn't being updated correctly when someone left the bridge and another joined. Now, instead of looking for the msid attribute on a channel's streams, app_confbridge sets an "SDP:LABEL" attribute on the stream which res_pjsip_sdp_rtp looks for. If it finds it, it adds a "label" attribute to the current sdp. Change-Id: I6cbaa87fb59a2e0688d956e72d2d09e4ac20d5a5 2018-07-13 06:56 +0000 [e8727fcfa8] George Joseph * CI: Add daily periodics to CI Change-Id: I26933e73928e091ae72e838c02f4f2ec7c3983d6 2018-07-11 11:57 +0000 [e19080a184] Alexander Traud (License 6520) * Bundled PJPROJECT: Disable internal connection oriented keep-alive. Turn off the periodic sending of CRLNCRLN. Default is on (90 seconds), which conflicts with the global section's keep_alive_interval option in pjsip.conf. patches: pjsip_keep_not_alive.patch submitted by Alexander Traud (License 6520) ASTERISK-27347 Change-Id: I6a197f56e1830d3b7e5ec70f17025840a290b057 2018-07-09 04:42 +0000 [1445384699] Torrey Searle * res_pjsip_sdp_rtp: include ice in ANSWER only if offered 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 2018-07-12 16:34 +0000 [33a84745d0] George Joseph * CI: Add Asterisk Gates Change-Id: I7e2467f9120812551238d8005deb97f965279205 2018-07-11 15:55 +0000 [65b002ab8f] George Joseph * CI: Remove duplicate checkout Change-Id: If5f925b4c4ed7000b153f3ed8386ce2140c886f8 2018-07-11 15:09 +0000 [ba8f8a2813] George Joseph * CI: Update cleanup steps and permissions Change-Id: I7ca92935979d94845af8e1caf4468cbd6209b7de 2018-07-11 14:54 +0000 [ad36c4ba9b] George Joseph * CI: Fix log artifact paths Change-Id: I55136de8f4d9c3b56bd4d054306a187bb04a4b7d 2018-07-11 14:45 +0000 [4842af6364] George Joseph * CI: Remove CleanBeforeCheckout option for testsuite Change-Id: I510231c9087f7be5272b8ef3f3223eadaaffb754 2018-07-11 14:00 +0000 [3dfc37c60a] George Joseph * CI: Move gates into source repo Change-Id: If028ede5f3b127fa274c63ce166bc04ad7c1e5db 2018-07-11 06:14 +0000 [b302ee6bd5] George Joseph * CI: Initial commit for moving CI into source repo Create tests/CI directory and add files used by Jenkins to build and test Asterisk. With this commit, Jenkins will run the Asterisk Unit Tests using the Jenkinsfile at tests/CI/unittests.jenkinsfile. Bash scripts to do the actual building and testing are also in the same directory. Output is placed in tests/CI/output so that directory has been added to .gitignore. Change-Id: I9448065465e6de2b878634510ace8fd1ef378608 2018-07-06 17:00 +0000 [f7137e1230] Joshua Elson * res_parking: Add dialplan function for lot channel This commit adds a new function to res_parking. This function, PARK_GET_CHANNEL allows the retrieval of the channel name of the channel occupying the parking slot. ASTERISK-22825 #close Change-Id: Idba6ae55b8a53f734238cb3d995cedb95c0e7b74 2018-06-23 01:33 +0000 [10de9fcbf1] Alexander Traud * chan_ooh323: IPTOS_MINCOST is not defined on Solaris. Furthermore, is required for SIOCGIF*. ASTERISK-27938 Change-Id: Idc9153ece769944765b66122efb11728d8d8ebde 2018-07-06 15:05 +0000 [5bb874ee09] Kevin Harwell * res_pjsip_session: sdp group:BUNDLE attribute being truncated When setting/appending the media id's to the bundle group attribute a '-1' was being passed to the 'ast_str_set/append' function for the 'max_len' parameter. This essentially capped the length of the string to what it was originally allocated with. In this case 64 bytes. This patch makes it so a '0' is passed as in for the 'max_len', which means "no maximum length". ASTERISK-27955 #close Change-Id: Iec565df6600401d54a502854a53d19bb4cc34876 2018-07-05 16:02 +0000 [96abe79ddf] Alexei Gradinari * res_pjsip_pubsub: segfault in function publish_expire The function pubsub_on_rx_publish_request incorrectly uses of AST_SCHED_REPLACE_UNREF. The AST_SCHED_REPLACE_UNREF should unref old '_data'. Because of this, there may be a double unref of variable 'publication' when ast_sched_del is unsuccessful that leads to use after free of the 'publication' in publish_expire. ASTERISK-27956 #close Change-Id: Ie0f0cfc7e036953d890b188656010b325a5cdc82 2018-07-06 09:04 +0000 [c1e49720fa] George Joseph * test.c: Make output jUnit compatible Separate "name" into "classname" and "name". Use '.' for classname separator instead of '/'. Prefix reserved words with '_'. Wrap output with a top-level "testsuites" element. Change-Id: Iec1a985eba1c478e5c1d65d5dfd95cb708442099 2018-07-06 07:57 +0000 [8f42447c68] George Joseph * res_pjsip: Add 'suppress_q850_reason_headers' option to endpoint 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 2018-07-05 15:43 +0000 [c9f8e068ed] Joshua Colp * res_pjsip_t38: Decline T.38 stream on failure case. When negotiating an incoming T.38 stream the code incorrectly returned failure instead of a decline for the stream when a problem occurred or the configuration didn't allow it. This resulted in SDP offers being rejected with a 488 response in all cases, even when another valid stream was present. This change makes it so the stream is now declined. If no streams are accepted a 488 response is sent while if at least one stream is accepted all the declined streams are, well, declined. ASTERISK-27763 Change-Id: I88bcf793788c412a9839d111a5c736bf6867807c 2018-07-02 18:43 +0000 [d5db664d70] Richard Mudgett * res_pjsip_t38.c: Be smarter about how we respond when T.38 is disabled. We were blindly responding with AST_T38_REFUSED when ANY T.38 control frame came accross the bridge. This causes T.38 Gateway to get confused and the T.38 session to get in a strange state. * Made the T.38 framehook only respond to request frames and ignore response frames. ASTERISK-27657 ASTERISK-27080 Change-Id: I5fb5967c7d1efb30a7ff375f82887ca82a55b05b 2018-07-03 12:10 +0000 [0aff1a278e] Richard Mudgett * res_pjsip/pjsip_transport_management.c: Fix deadlock with transport keep alive. Using the keep_alive_interval option can result in a deadlock between the pjproject transport manager group lock and the monitored transports ao2 container lock. The pjproject transport manager group lock has to be superior in the locking order to the monitored transports ao2 container lock because of pjproject callbacks called when already holding the group lock. The lock inversion happens when Asterisk attempts to send a keep alive packet over the reliable transports. * Made keepalive_transport_thread() iterate over the monitored transports container rather than use the ao2_callback() method. This avoids holding the container lock when sending the keep alive packet. ASTERISK-26686 Change-Id: I5d5392a52e698bbe41a93f7d8e92bf0e61fe3951 2018-07-02 18:44 +0000 [de5144e751] Joshua Colp * pjsip: Clarify certificate configuration for Websocket. The Websocket transport uses the built-in HTTP server. As a result the TLS configuration is done in http.conf and not in pjsip.conf. This change adds a warning if this is configured in pjsip.conf and also clarifies in the sample configuration file. Change-Id: I187d994d328c3ed274b6754fd4c2a4955bdc6dd9 2018-06-23 04:50 +0000 [804d931f27] Alexander Traud * bridge_softmix_binaural: Enable FFTW3 in Solaris 11. ASTERISK-27939 Change-Id: Ice5640e08385a64a0a6555deaccd91e86bca154f 2018-06-29 18:28 +0000 [1aa45ffdfa] Richard Mudgett * res_pjsip_t38.c: Fix crash by ignoring 1xx messages. If we initiated a T.38 reINVITE, we would crash if we received any other 1xx response message except 100 if it were followed by a 200 response. * Made ignore any 1xx response so we do not close out the T.38 negotiation too early. For good measure we'll now accept any 2xx response as acceptance of the reINVITE T.38 offer. ASTERISK-27944 Change-Id: I0ca88aae708d091db7335af73f41035a212adff4 2018-07-01 13:54 +0000 [f30ebd3823] Joshua Colp * res_pjsip_pubsub: Hold module reference for publications. Incoming publications need to ensure that the module remains loaded for the lifetime of them. This is now done by holding a reference to the module while the publication exists. This mirrors that of inbound subscriptions. ASTERISK-27783 Change-Id: Ia98c95a15e11af25728d5fb3e56e12cda0cfc7c0 2018-05-21 07:24 +0000 [9d3f3a4b0a] Robert Mordec * app_confbridge: Bridge and announcers not removed if conference ends quickly If a conference is ended very quickly after it was created (i.e., the first user immediately hangs up) then the conference bridge and announcer channels are not removed. When a conference is created, the push_announcer() function is added to the playback queue task processor and the conference object reference is bumped. If a conference is ended while the push_announcer() function is still going then the ao2_cleanup(conference) at the end of push_announcer() will call the destructor function - destroy_conference_bridge(). The destroy_conference_bridge() function will then add the hangup_playback() task to the playback queue and will wait for it to end. Since it is already a current task of the playback queue it will wait forever. This patch makes the conference thread call push_announcer() directly. This way the conference object reference bump is not needed. Since the playback queue task processor is only used by the conference thread itself, there is no danger of trying to play announcements before the announcer is pushed to the bridge. ASTERISK-27870 #close Change-Id: I947a50fb121422d90fd1816d643a54d75185a477 2018-06-21 00:28 +0000 [db02218db2] Matthew Fredrickson * main/cdr.c: Alleviate CDR deadlock There is a rare case (do to the infrequent timing involved) where CDR submission threads in batch mode can deadlock with a currently running CDR batch process. This patch should remove the need for holding the lock in the scheduler and should clean a few code paths up that inconsistently submitted new work to the CDR batch processor. ASTERISK-27909 Change-Id: I6333e865db7c593c102c2fd948cecdb96481974d Reported-by: Denis Lebedev 2018-06-25 22:08 +0000 [4b9bf4f5e0] Kirsty Tyerman * pbx_dundi: reordered unloading of module pbx_dundi Destroy scheduler after peers are pruned to stop dundi crashing when unloading module. ASTERISK-26987 Reported-by: Kirsty Tyerman Change-Id: Ic12e562cd90d8d813a9e97f302045091f59e3c05 2018-06-28 12:07 +0000 [7a238fe74d] Richard Mudgett * AMI SendText action: Fix to use correct thread to send the text. 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 2018-06-25 07:37 +0000 [e3585353f6] George Joseph * res_pjsip_messaging: Allow application/* for in-dialog MESSAGEs In addition to text/* content types, incoming_in_dialog_request now accepts application/* content types. Also fixed a length issue when copying the body text. It was one character short. ASTERISK-27942 Change-Id: I4e54d8cc6158dc47eb8fdd6ba0108c6fd53f2818 2018-06-25 15:42 +0000 [5f12e2bd07] George Joseph * app_confbridge: Move participant info code to confbridge_manager. With the participant info code in app_confbridge, we were still in the process of adding the channel to the bridge when trying to send an in-dialog MESSAGE. This caused 2 threads to grab the channel blocking flag at the same time. To mitigate this, the participant info code was moved to confbridge_manager so it runs after all channel/bridge actions have finished. Change-Id: I228806ac153074f45e0b35d5236166e92e132abd 2018-06-18 21:22 +0000 [880fbff6b7] George Joseph * res_pjsip_session: Add ability to accept multiple sdp answers 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 2018-06-21 11:45 +0000 [675e2ddb49] Alexander Traud * uuid: Enable UUID in Solaris 11. ASTERISK-27933 Reported by: bautsche Change-Id: I9b8362824efbfb2a16981e46e85f7c8322908c49 2018-06-13 02:25 +0000 [184b375b41] Kristian F. Høgh * app_queue: Add option for predial handlers on caller and callee channels Add predial handler support to app_queue. app_dial (ASTERISK_19548) and app_originate (ASTERISK_26587) have the ability to execute predial handlers on caller and callee channels. This patch adds predial handlers to app_queue and uses the same options as Dial and Originate (b and B). The caller routine gets executed when the caller first enters the queue. The callee routine gets executed for each queue member when they are about to be called. ASTERISK-27912 Change-Id: I5acf5c32587ee008658d12e8a8049eb8fa4d0f24 2018-06-21 16:39 +0000 [cad50d6dbf] Richard Mudgett * VECTOR: Passing parameters with side effects to macros is dangerous. * Fix several instances where we were bumping a ref in the parameter and then unrefing the object if it failed. The way the AST_VECTOR_APPEND() and AST_VECTOR_REPLACE() macros are implemented means if it fails the new value was never evaluated. Change-Id: I2847872a455b11ea7e5b7ce697c0a455a1d0ac9a 2018-06-20 16:57 +0000 [aaaa6f4a4b] Richard Mudgett * bridge_softmix.c: Fix memory leak. Made release the media_types vector in softmix_bridge_stream_topology_changed(). Change-Id: Ide3f47e379b614879220dfeeb13843f9f2b177b5 2018-06-21 11:22 +0000 [bfeded7e62] Alexander Traud * smsq: Remove an left-over special case for Solaris. Actually, this case was never needed because the check below does the same. Change-Id: Ia2fca4ba6c58c644a8b7cb2d9db8539728c14ffb 2018-06-21 11:17 +0000 [bbea9cfc3b] Alexander Traud * res_http_post: Enable GMime in Solaris 11. Change-Id: Ie434541f18f894c751d2e44bcb3efb3cac626019 2018-06-21 05:08 +0000 [7f3882c8e9] Alexander Traud * codecs/ilbc: Compile in Solaris 11. The symbol FS is the sampling frequency. That symbol is not used in Asterisk at all and was a copy-and-paste of the iLBC reference code from the IETF RFC. However, in Solaris, that symbol is defined by another header already. To compile in Solaris, that symbol has to go. Change-Id: I91ddbe5be7c00069c3a25abd5f58d7b2f04c51b1 2018-06-21 05:07 +0000 [9704c424f5] Alexander Traud * chan_oss: Compile in Solaris 11. M_READ existed already and was conflicting in name. Change-Id: I02108e07ae7d2dc314fe1e6c706c17731095a3e4 2018-06-21 05:04 +0000 [6f47b84fbd] Alexander Traud * func_env: Compile in Solaris 11. Change-Id: Idc9b36720f3d29c90a35a6a1ae79a7f9e1aaf50e 2018-06-21 05:01 +0000 [a5c53bd323] Alexander Traud * utils: Avoid an unused variable in Solaris 11. With ./configure --enable-dev-mode[=noisy], the build fails because every warning gets an error. Therefore, Asterisk has to be free of warnings and this variable must go. Change-Id: I63dd2bc4833b9bdb04602f83422d16caf289d46a 2018-06-21 04:59 +0000 [92109cf496] Alexander Traud * BuildSystem: Enable ./configure in Solaris 11. ASTERISK-27931 Change-Id: If298ce7f03be227a3687b9c20d382c9c55a72404 2018-06-20 13:24 +0000 [d6721e1e4c] Alexander Traud * BuildSystem: Enable autotools in Solaris 11. Because this was the last operating system which required a special case, a version appended to the autotools, the whole version stuff is removed by this change. This simplifies the script ./bootstrap.sh. Hopefully, this gives even broader platform compatibility. ASTERISK-27929 ASTERISK-27926 Change-Id: Id4cf433a1a7fa861d0210e1a2e16ca592b49fd5a 2018-06-13 11:33 +0000 [eb8bbe660e] Richard Mudgett * channel.c: Make CHECK_BLOCKING() save thread LWP id for messages. * Removed an unnecessary call to ast_channel_blocker_set() in __ast_read(). ASTERISK-27625 Change-Id: I342168b999984666fb869cd519fe779583a73834 2018-06-13 16:41 +0000 [da54605b8a] Richard Mudgett * ARI POST DTMF: Make not compete with channel's media thread. 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 2018-06-13 13:05 +0000 [7d874c1af7] Richard Mudgett * AMI PlayDTMF Action: Make not compete with channel's media thread. 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 2018-06-12 14:09 +0000 [080508d2eb] Richard Mudgett * channel.c: Fix usage of CHECK_BLOCKING() 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 2018-06-18 18:04 +0000 [0989b63047] Richard Mudgett * autoservice: Don't start channel autoservice if the thread is a user interface. 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 2018-06-18 16:07 +0000 [91c3ac19cb] Richard Mudgett * Dialplan functions: Fix some channel autoservice misuse. * Fix off nominal paths leaving the channel in autoservice. * Remove unnecessary start/stop channel autoservice. * Fix channel locking around a channel datastore search. Change-Id: I7ff2e42388064fe3149034ecae57604040b8b540 2018-06-19 10:43 +0000 [720c2d1da2] Richard Mudgett * Fix some doxygen and curly placement. Change-Id: I9a784a7c804120a8fa826c2a4cb9957e4b0b2fc8 2018-06-18 13:17 +0000 [c1686b8b3e] Richard Mudgett * tcptls.h: Remove redundant SSL_CTX typedef. It is invalid to typedef something more than once. Though not all gcc compilers on different OS's complain about it. Change-Id: I5a7d4565990c985822d61ce75bde0b45f9870540 2018-06-12 15:13 +0000 [a470bb9e27] Richard Mudgett * channel: Fix some more unprotected channel flag setting. Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c 2018-06-15 15:21 +0000 [8732d62334] Matthew Fredrickson * menuselect/menuselect_curses: Resolves sprintf usage error Acccording to the man page for sprintf, using the same buffer for output as one used as an input yields undefined behavior. This patch should work around this problem. ASTERISK-27903 Reported-by: Alexander Traud Change-Id: I2213dcb454aff26457e2e4cc9c6821276463ae3a 2018-06-12 09:30 +0000 [4c7ab73468] Sam Wierema * app_mp3: remove 10 seconds of silence after mp3 playback This patch changes the way asterisk polls output from mpg123, instead of waiting for 10 seconds(when playing an http url) it now uses a timeout of one second and iterates 10 times using this same timeout. The main difference is that for every timeout asterisk receives it now checks if mpg123 is still running before poll again. ASTERISK-27752 Change-Id: Ib7df8462e3e380cb328011890ad9270d9e9b4620 2018-06-13 04:40 +0000 [9d7958672b] Alexander Traud * tests/test_utils: Repair ./configure --with-ssl=PATH. ASTERISK-27914 Change-Id: Ibcab8f556ee77776f203cff8b06d776a673b7bc4 2018-06-04 20:31 +0000 [e1908ea484] Kirsty Tyerman * chan_iax2: better handling for timeout and EINTR The iax2 module is not handling timeout and EINTR case properly. Mainly when there is an interupt to the kernel thread. In case of ast_io_wait recieves a signal, or timeout it can be an error or return 0 which eventually escapes the thread loop, so that it cant recieve any data. This then causes the modules receive queue to build up on the kernel and stop any communications via iax in asterisk. The proposed patch is for the iax module, so that timeout and EINTR does not exit the thread. ASTERISK-27705 Reported-by: Kirsty Tyerman Change-Id: Ib4c32562f69335869adc1783608e940c3535fbfb 2018-05-31 16:22 +0000 [e7a7506f9c] George Joseph * app_confbridge: Enable sending events to participants ConfBridge can now send events to participants via in-dialog MESSAGEs. All current Confbridge events are supported, such as ConfbridgeJoin, ConfbridgeLeave, etc. In addition to those events, a new event ConfbridgeWelcome has been added that will send a list of all current participants to a new participant. For all but the ConfbridgeWelcome event, the JSON message contains information about the bridge, such as its id and name, and information about the channel that triggered the event such as channel name, callerid info, mute status, and the MSID labels for their audio and video tracks. You can use the labels to correlate callerid and mute status to specific video elements in a webrtc client. To control this behavior, the following options have been added to confbridge.conf: bridge_profile/enable_events: This must be enabled on any bridge where events are desired. user_profile/send_events: This must be set for a user profile to send events. Different user profiles connected to the same bridge can have different settings. This allows admins to get events but not normal users for instance. user_profile/echo_events: In some cases, you might not want the user triggering the event to get the event sent back to them. To prevent it, set this to false. A change was also made to res_pjsip_sdp_rtp to save the generated msid to the stream so it can be re-used. This allows participant A's video stream to appear as the same label to all other participants. Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e 2018-06-13 05:06 +0000 [b01fc2ef3d] Alexander Traud * res_rtp_asterisk: Instead of ./configure use OPENSSL_NO_SRTP. Previously, Asterisk used its script ./configure, to test whether OpenSSL was built with no-srtp (or was simply too old). However, the header file is the preferred way to detect the local configuration of OpenSSL. As a positive side-effect the script ./configure does not interleave the detection of the Open Settlement Protocol Toolkit (OSPTK) with the detection of individual features of OpenSSL anymore. Change-Id: I3c77c7b00b2ffa2e935632097fa057b9fdf480c0 2018-06-05 04:36 +0000 [41175caee0] Joshua Colp * rtp: Don't negotiate dynamic codecs using payload. In Asterisk there are some dynamic codecs that have a fixed payload number. This number was being improperly used to negotiate the codec, instead of using the name and sample rate. This could result in the wrong payload number being negotiated for a codec. This change makes it so that only static payloads will be negotiated using their payload number. ASTERISK-27848 Change-Id: Ia865830170fd3f808cdb33104f3d4c4ffdc77570 2018-04-16 14:13 +0000 [b649682caa] Sean Bright * AST-2018-007: iostreams potential DoS when client connection closed prematurely Before Asterisk sends an HTTP response (at least in the case of errors), it attempts to read & discard the content of the request. If the client lies about the Content-Length, or the connection is closed from the client side before "Content-Length" bytes are sent, the request handling thread will busy loop. ASTERISK-27807 Change-Id: I945c5fc888ed92be625b8c35039fc6d2aa89c762 2018-04-30 17:38 +0000 [81ac32a85f] Richard Mudgett * AST-2018-008: Fix enumeration of endpoints from ACL rejected addresses. When endpoint specific ACL rules block a SIP request they respond with a 403 forbidden. However, if an endpoint is not identified then a 401 unauthorized response is sent. This vulnerability just discloses which requests hit a defined endpoint. The ACL rules cannot be bypassed to gain access to the disclosed endpoints. * Made endpoint specific ACL rules now respond with a 401 unauthorized which is the same as if an endpoint were not identified. The fix is accomplished by replacing the found endpoint with the artificial endpoint which always fails authentication. ASTERISK-27818 Change-Id: Icb275a54ff8e2df6c671a6d9bda37b5d732b3b32 2018-06-08 15:02 +0000 [0743ad6422] Alexander Traud * res_rtp_asterisk: Allow OpenSSL configured with no-deprecated. 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 2018-06-08 06:01 +0000 [99aed78078] Alexander Traud * crypto.h: Repair ./configure --with-ssl=PATH. ASTERISK-27908 Change-Id: Iac49d9f82faeb8a4611c6805906bd6d650b1b1d8 2018-06-08 04:03 +0000 [ca682f0030] Alexander Traud * res_crypto: Allow OpenSSL configured with no-deprecated. The header had to be included explicitly. ASTERISK-27906 Change-Id: I41743801eed998c039d73db7a0762d104a4f75b2 2018-06-08 02:41 +0000 [234bf4b7ff] Alexander Traud * res_srtp: Repair ./configure --with-ssl=PATH. ASTERISK-27905 Change-Id: Ibb7dc148a0048f4f9c3b12937ba4240dff0d15e2 2018-05-31 10:25 +0000 [65ff2f057a] Alexei Gradinari * func_odbc: NODATA if SQLNumResultCols returned 0 columns on readsql The functions acf_odbc_read/cli_odbc_read ignore a number of columns returned by the SQLNumResultCols. If the number of columns is zero it means no data. In this case, a SQLFetch function has to be not called, because it will cause an error. ASTERISK-27888 #close Change-Id: Ie0f7bdac6c405aa5bbd38932c7b831f90729ee19 2018-06-07 08:46 +0000 [1725eaf8fb] George Joseph * chan_pjsip: Register for "BEFORE_MEDIA" responses chan_pjsip wasn't registering for "BEFORE_MEDIA" responses which meant it was not updating HANGUPCAUSE for 4XX responses. If the remote end sent a "180 Ringing", then a "486 Busy", the hangup cause was left at "180 Normal Clearing". * Removed chan_pjsip_incoming_response from the original session supplement (which was handling only "AFTER MEDIA") and added it to a new session supplement which accepts both "BEFORE_MEDIA" and "AFTER_MEDIA". * Also cleaned up some cleanup code in load module. ASTERISK-27902 Change-Id: If9b860541887aca8ac2c9f2ed51ceb0550fb007a 2018-06-07 07:19 +0000 [9f2eb17005] Alexander Traud * ooh323c: GCC 8.1 warned about output truncated before terminating nul. ASTERISK-27901 Change-Id: I5a8e894f4924ef52e3094f6870656a559d67f3d7 2018-06-05 13:43 +0000 [7af5e86821] Alexei Gradinari * pjsip_options: show/reload AOR qualify options using CLI Currentrly pjsip_options code does not handle the situation when the AOR qualify options were changed. Also there is no way to find out what qualify options are using. This patch add CLI commands to show and synchronize Aor qualify options: pjsip show qualify endpoint Show the current qualify options for all Aors on the PJSIP endpoint. pjsip show qualify aor Show the PJSIP Aor current qualify options. pjsip reload qualify endpoint Synchronize the qualify options for all Aors on the PJSIP endpoint. pjsip reload qualify aor Synchronize the PJSIP Aor qualify options. ASTERISK-27872 Change-Id: I1746d10ef2b7954f2293f2e606cdd7428068c38c 2018-05-22 16:21 +0000 [e46b442e38] Alexei Gradinari * pjsip_options: handle modification of qualify options in realtime Currentrly pjsip_options code does not handle the situation when the qualify options were changed in realtime database. Only 'module reload res_pjsip' helps. This patch add a check on contact add/update observers if the contact qualify options are different than local aor qualify options. If the qualify options were modified then synchronize the pjsip_options AOR local state. ASTERISK-27872 Change-Id: Id55210a18e62ed5d35a88e408d5fe84a3c513c62 2018-05-30 01:12 +0000 [e078558038] Pirmin Walthert * bridge_channel.c: Fix Deadlock when using Local channels and fax gateway ast_indicate is invoked with the bridge locked. As ast_indicate locks the other end of the bridge as well this can lead to a deadlock in some situations. (Especially when a different thread does the same in the reverse order). This patch calls ast_indicate after unlocking the bridge which fixes the deadlock. Calling ast_indicate with these parameters without locking the bridge should be safe as this is done at different places without a bridge lock. ASTERISK-27094 #close Reported-by: David Brillert Change-Id: I5f86c1e2ce75b9929a36ab589b18c450e62ea35f 2018-06-04 09:50 +0000 [437ab41881] George Joseph * app_sendtext: Allow content types other than text/plain There was no real reason to limit the conteny type to text/plain other than that's what it was limited to before. Now any text/* content type will be allowed for channel drivers that don't support enhanced messaging and any type will be allowed for channel drivers that do support enhanced messaging. Change-Id: I94a90cfee98b4bc8e22aa5c0b6afb7b862f979d9 2018-05-28 19:17 +0000 [a7f4121238] William McCall * app_confbridge: Add talking indicator for ConfBridgeList AMI response When an AMI client connects, it cannot determine if a user was talking prior to a transition in the user speaking state (which would generate a ConfbridgeTalking event). This patch causes app_confbridge to track the talking state and make this state available via ConfBridgeList. ASTERISK-27877 #close Change-Id: I19b5284f34966c3fda94f5b99a7e40e6b89767c6 2018-05-29 12:28 +0000 [6bbede84fb] Richard Mudgett * app_meetme: Fix manager event documentation for several events. The MeetmeJoin, MeetmeLeave, MeetmeEnd, MeetmeMute, MeetmeTalking, and MeetmeTalkRequest AMI events were documented with sending out a Usernum header when the User header was actually output. * Change the online documentation to match reality. ASTERISK-27873 ASTERISK-25261 Change-Id: I437bc70618d07c183c9624b7069c2fcae7f17a39 2018-05-28 10:29 +0000 [24503fb600] Alexander Traud * tcptls.h: Repair ./configure --with-ssl=PATH. 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 2018-05-25 09:55 +0000 [d36338ce2b] Alexander Traud * tcptls: 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-27876 Change-Id: I62c2aba4a630aefc231b71f646207e8c027d9497 2018-05-25 07:22 +0000 [91616f4524] Alexander Traud * tcptls: Allow OpenSSL 1.1.x configured with enable-ssl3-method no-deprecated. ASTERISK-27874 Change-Id: Ica65113511c7a1c13f7988e7d9e7d9e7f3f620dd 2018-05-15 08:45 +0000 [2bf26ce5ac] George Joseph * ast_coredumper: Fix output directory and variable precedence The OUTPUTDIR variable in ast_debug_tools.conf.sample is now set to "/tmp" instead of "/some/directory". Variables set on the command line or that are already in the environment now take predecence over variables set in the config files. ASTERISK-27846 Reported by: Ted G Change-Id: Ie8baec52d531886bf5849ec1d59bb59dc87ad387 2018-05-09 08:31 +0000 [c5d2bf05f4] Torrey Searle * res/res_rtp_asterisk: ensure marker bit is correctly set on ssrc change Certain race conditions between changing bridge types and DTMF can cause the current FLAG_NEED_MARKER_BIT to send the marker bit before the actual first packet of native bridging. This logic keeps track of the ssrc the bridge is currently sending and will correctly ensure the marker bit is set if SSRC as changed from the previous sent packet. ASTERISK-27845 Change-Id: I01858bd0235f1e5e629e20de71b422b16f55759b 2018-04-23 09:04 +0000 [a507c73a78] Joshua Colp * rtp: Add support for RTP extension negotiation and abs-send-time. 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 2018-05-22 17:17 +0000 [1bec0c73b3] Richard Mudgett * channel.c: Fix off nominal channel allocation failure path. __ast_channel_alloc_ap() had a failure exit path that hadn't setup the fd descriptors to -1 yet. The destructor would then attempt to close these fd's that had never been opened. Change-Id: Icf21093f36c60781e8cf6ee9d586536302af33e3 2018-05-18 12:46 +0000 [d402594f74] Rodrigo Ramírez Norambuena * app_queue: Update year Copyright and fix missing tabs in documentation Change-Id: Ieb8faf37dc765463ee5dbca1d1343242c756b1c7 2018-05-18 16:45 +0000 [39632c7e00] Alexei Gradinari * config.c: Fix successful DELETE treated as failure The config engine destroy_func callback function returns the number of rows deleted or -1 on error. But the function ast_destroy_realtime_fields treated non-zero return values as error. ASTERISK-27863 Change-Id: Ied02b38e8196cb03043e609a0679feebd288d17b 2018-05-14 06:07 +0000 [9f9dce05b2] Matthew Fredrickson * netsock2: Add ast_sockaddr_resolve_first_af to netsock2 public API 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 2018-05-20 06:36 +0000 [1424f42d25] Alexander Traud * libasteriskssl: Allow OpenSSL 1.0.2 configured with no-deprecated. Use CRYPTO_set_id_callback(.) only with OpenSSL 0.9.8 and older. ASTERISK-27867 Change-Id: Iadd58d5bf6f538eb224203970a4e88e26f259655 2018-05-19 08:23 +0000 [2228ae3f27] Alexander Traud * tcptls: Repair ./configure --with-ssl=PATH. SSL_OP_NO_TLSv1_1 and SSL_OP_NO_TLSv1_2 got discovered without honoring a PATH. ASTERISK-27865 Change-Id: I8cd358eed7411726d08fa7b01691bef122fbeb71 2018-03-27 18:53 +0000 [2ca3b6d9cc] Nic Colledge * app_voicemail: Fix data-type mismatch between app_voicemail and database Fix data-type mismatch between app_voicemail and database columns exposed by new version of MariaDB ASTERISK-27760 Change-Id: I8543ad480a08c98be78bde1ee870e6e6c84b2c5b 2018-05-12 06:53 +0000 [97f20fe5ed] Nic Colledge * app_voicemail: Fix incorrect msg leaving/retrieving an ODBC voicemail Correct the log warning message shown when ODBC voicemail retrieve_file is called and there is a null value in the category column. A more meaningfull message is now written at debug level. ASTERISK-27853 Change-Id: Ic36e97d5eb070a23a12ba45972f6b53e2182a3f4 2018-04-17 21:15 +0000 [52ed6bcc8f] Brian P. Martin * chan_mobile: support handling of caller-id names ("cnam"). Add support to handle caller-ID names ("cnam") in addition to caller-ID numbers. The prior code ignored the caller-ID name altogether, and used the local name for the cell phone (e.g. "my-iphone") in its place. Note: as of this writing, at least some Android phones don't pass cnam to us. This can be seen by issuing "core set debug 2" in the CLI and watching the "CLIP" record when a call comes in. If cnam isn't in the CLIP record, there's nothing we can do to provide one. We'll provide a null cnam field, so later Asterisk processes know to try other sources (e.g. cidname database, OpenCNAM, etc.). Reported by: Brian Martin Tested by: Brian Martin ASTERISK-27726 Change-Id: I89490d85fa406c36261879c50ae5e65595538ba5 2018-05-17 01:58 +0000 [f10fc135d4] Alexander Traud * res_pjsip_endpoint_identifier_ip: Unregister the module for headers. Asterisk uses Reference Counting to track whether a module can be unloaded. Every consumer who requires a module, increases the reference count. When the consumer goes, is unloaded itself, it has to decrease the reference count on all its used/required modules. That way core stop gracefully works on the command-line interface (CLI): One module after the other is unloaded. A recent change broke this for the module res_pjsip. ASTERISK-27861 Change-Id: I261abcb411d026bbb0691cc78f28300bfd3103a3 2018-05-11 12:49 +0000 [71d1e8d8c8] Alexander Traud * rtp_engine: Remove the double assigned RTP payload ID of H.263+. Mantis-3709 (Commit 68ff3c3, Asterisk 1.2) added support for the video format H.263+. For this, the RTP payload ID 103 got assigned statically. Commit f1aadc8 assigned another payload ID 98 for this format in Asterisk 1.6. Change-Id: I90e35b158487f8f1f8187da6241b54cd3b74e667 2018-05-11 12:26 +0000 [4722a653f4] Corey Farrell * cli: Display correct unit for HTTP timeout in "manager show settings". HTTP timeout is in seconds, not minutes. ASTERISK-27852 #close Change-Id: Ie6640835cb07307555741f9b559c2eb876d9343e 2018-05-11 10:37 +0000 [263637a38d] Alexander Traud * rtp_engine: Avoid a typo error in Doxygen for ast_rtp_codecs_find_payload_code. Change-Id: Ica089d4507a27ddfc4ce3a88d697ffbef378de48 2018-05-06 21:17 +0000 [b5914d90ac] Corey Farrell * Fix GCC 8 build issues. This fixes build warnings found by GCC 8. In some cases format truncation is intentional so the warning is just suppressed. ASTERISK-27824 #close Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84 2018-05-11 07:10 +0000 [919b0eb3f2] Alexander Traud * rtp_engine: Allow Media Formats with add_static_payload(-1) on egress again. This issue affected only installations with rtp_use_dynamic=yes in asterisk.conf which is the default since Asterisk 15. Codec 2 and SiLK were built-in examples of media formats which were affected. ASTERISK-27850 Reported by: Dinis Brazão, Selene Feigl Change-Id: I08c1e76433a67e4350141d38cacf3a1cb5086496 2018-05-09 09:30 +0000 [2e37684913] Corey Farrell * git: Ignore *.orig. This prevents accidental commit of files created by patch. Change-Id: I68380db61f0f9d620046f719ccd978811d0e9964 2018-04-18 02:27 +0000 [2d81709ab1] Alexander Traud * sip_to_pjsip: Enable python3 compatibility. The script remains compatible with Python 2.7 but now also works with Python 3.3 and newer; to ease the migration from chan_sip to chan_pjsip. ASTERISK-27811 Change-Id: I59cc6b52a1a89777eebcf25b3023bdf93babf835 2018-05-08 14:28 +0000 [cea87fe7b8] Corey Farrell * makeopts.in: Remove unused/undefined AST_MARCH_NATIVE. Change-Id: I617a96ebb83ec99f5d3176bbbee2d2a272ccb203 2018-05-08 04:59 +0000 [9f1e1d153a] Jaco Kroon * manager: fix digest auth for ami/http mechanism. Due to a fixed size buffer the digest authentication could be incorrectly calculated if a large URI was provided, causing authentication failure. The buffer is now dynamically allocated to allow any size URI within the normal limits of the HTTP request size. ASTERISK-27841 Change-Id: I660609db13b8f9e5f9567f339dd804f4985d41b3 2018-05-04 13:47 +0000 [d855658f23] Corey Farrell * app_macro: Prevent infinite loop in find_matching_priority. Use AST_PBX_MAX_STACK to escape if we recurse 128 times. This will prevent crash if dialplan contains an include loop. Log an error when this occurs, at most one message per call to Macro() so we avoid logger spam. ASTERISK-26570 #close Change-Id: I6c71b76998c31434391b150de055ae9a531e31da 2018-01-11 06:37 +0000 [f4c360143b] Tzafrir Cohen * cdr_mysql: my_connect_db(): reduce indentation ASTERISK-27572 Change-Id: I00bd5363ac94c764c56d8626a5945ed7f3934fcb 2018-01-11 06:33 +0000 [2e44adf1c3] Tzafrir Cohen * cdr_mysql: split mysql init out of my_load_module Split out mysql connection parts to a separate my_connect_db(). ASTERISK-27572 Change-Id: If2ee676056067cc693ff08be68ee4944bf35b49f 2018-05-04 16:07 +0000 [8f55f7c333] Matthew Fredrickson * res_hep: Adds hostname resolution support for capture_address Previously, only an IP address would be accepted for the capture_address config setting in hep.conf. This change allows capture_address to be a resolvable hostname or an IP address. ASTERISK-27796 #close Reported-By: Sebastian Gutierrez Change-Id: I33e1a37a8b86e20505dadeda760b861a9ef51f6f 2018-04-20 18:12 +0000 [7528b86cad] Joshua Colp * stream: Make the topology a reference counted object. The stream topology has no lock of its own resulting in another lock protecting it in some way (for example the channel lock). If multiple channels are being juggled at the same time this can be problematic. This change makes the topology a reference counted object instead which guarantees it will remain valid even without the channel lock being held. Change-Id: I4f4d3dd856a033ed55fe218c3a4fab364afedb03 2018-03-21 07:30 +0000 [6301531416] Tzafrir Cohen * chan_dahdi: Configurable dialed digit timeouts Analog phones dial overlap dialing and it is chan_dahdi's job to read the numbers. It has three timeout constants that this commit converts to channel-level configuration options: * firstdigit_timeout: Default time (ms) to detect first digit * interdigit_timeout: Default time (ms) to detect following digits * matchdigit_timeout: Default time (ms) to wait in case of ambiguous match. This happens when the dialed digits match a number in the current context but are also the prefix of another number. Change-Id: Ib728fa900a4f6ae56d1ed810aba61b6593fb7213 2018-05-03 06:34 +0000 [de3ca9bada] Joshua Colp * res_ari: Remove requirement that body exists when debug is on. The "ari set debug" code for incoming requests incorrectly assumed that all requests would contain a body. If one did not exist the request would be incorrectly rejected. The response that was sent was also incomplete as an incorrect function was used to construct the response. The code has now been changed to no longer require a request to have a body and the response updated to use the correct function. ASTERISK-27801 Change-Id: I4eef036ad54550a4368118cc348765ecac25e0f8 2018-04-30 15:15 +0000 [069a0b7593] Sean Bright * iostreams: Add some documentation for the ast_iostream_* functions Change-Id: Id71b87637f0a484eb5a1cd26c3d1c7c15c7dcf26 2018-05-02 07:43 +0000 [239074c759] Sean Bright * pjsip: Increase maximum number of usable ciphers & other cleanups * Increase maximum number of ciphers from 100 to 256 (or whatever PJ_SSL_SOCK_MAX_CIPHERS is #define'd to) * Simplify logic in cipher_name_to_id() * Make signed/unsigned comparison consistent Re: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897412 Reported by: Ondřej Holas Change-Id: Iea620f03915a1b873e79743154255c3148a514e7 2018-04-30 17:24 +0000 [11b7de82c5] Richard Mudgett * res_pjsip/pjsip_distributor.c: Add missing off-nominal request response. Change-Id: I389579b39c523d1d1e8ce020ef549a8bb5781c9b 2018-04-30 17:20 +0000 [6cab3c836a] Richard Mudgett * res_pjsip/pjsip_distributor.c: Pull some assignments out of if tests. Change-Id: I3d30d638b53a4bbe9bf9aad853c649d583894112 2018-04-30 09:38 +0000 [afdca5c68c] Joshua Colp * res_rtp_asterisk: Always update SRTP on local SSRC change. When the local SSRC changes we need to update the SRTP information so that the proper key is used. This is commonly done as a result of bridging two channels together. Previously we only updated the SRTP information if media had already flowed, but in practice the channel driver may have already performed SRTP negotiation and set up the previous SSRC. We now always do it on a local SSRC change. ASTERISK-27795 ASTERISK-27800 Change-Id: Ia7c8e74c28841388b5244ac0b8fd6c1dc6ee4c10 2018-02-13 12:55 +0000 [0827d5cc53] Gaurav Khurana * Add the ability to read the media file type from HTTP header for playback How it works today: media_cache tries to parse out the extension of the media file to be played from the URI provided to Asterisk while caching the file. What's expected: Better will be to have Asterisk get extension from other ways too. One of the common ways is to get the type of content from the CONTENT-TYPE header in the HTTP response for fetching the media file using the URI provided. Steps to Reproduce: Provide a URL of the form: http://host/media/1234 to Asterisk for media playback. It fails to play and logs show the following error line: [Sep 15 15:48:05] WARNING [29148] [C-00000092] file.c: File http://host/media/1234 does not exist in any format Scenario this issue is blocking: In the case where the media files are stored in some cloud object store, following can block the media being played via Asterisk: Cloud storage generally needs authenticated access to the storage. The way to do that is by using signed URIs. With the signed URIs there's no way to preserve the name of the file. In most cases Cloud storage returns a key to access the object and preserving file name is also not a thing there ASTERISK-27286 Reporter: Gaurav Khurana Change-Id: I1b14692a49b2c1ac67688f58757184122e92ba89 2018-04-25 01:57 +0000 [9c9f314f64] Christof Lauber * pbx_lua: Support displaying lua error message if no debug table exists The lua_error_function assumed that lua's debug table and traceback function are always accessible, which is not the case. This fixes the error message 'Error in the lua error handler' triggred by switch exec() function. If this happens lua's error message is shown without traceback. Change-Id: I34ba0a098f1ae06a3af7b4d1b098bd43f42f96c8 2017-12-11 12:34 +0000 [882e79b77e] Joshua Colp * pjsip: Rewrite OPTIONS support with new eyes. The OPTIONS support in PJSIP has organically grown, like many things in Asterisk. It has been tweaked, changed, and adapted based on situations run into. Unfortunately this has taken its toll. Configuration file based objects have poor performance and even dynamic ones aren't that great. This change scraps the existing code and starts fresh with new eyes. It leverages all of the APIs made available such as sorcery observers and serializers to provide a better implementation. 1. The state of contacts, AORs, and endpoints relevant to the qualify process is maintained. This state can be updated by external forces (such as a device registering/unregistering) and also the reload process. This state also includes the association between endpoints and AORs. 2. AORs are scheduled and not contacts. This reduces the amount of work spent juggling scheduled items. 3. Manipulation of which AORs are being qualified and the endpoint states all occur within a serializer to reduce the conflict that can occur with multiple threads attempting to modify things. 4. Operations regarding an AOR use a serializer specific to that AOR. 5. AORs and endpoint state act as state compositors. They take input from lower level objects (contacts feed AORs, AORs feed endpoint state) and determine if a sufficient enough change has occurred to be fed further up the chain. 6. Realtime is supported by using observers to know when a contact has been registered. If state does not exist for the associated AOR then it is retrieved and becomes active as appropriate. The end result of all of this is best shown with a configuration file of 3000 endpoints each with an AOR that has a static contact. In the old code it would take over a minute to load and use all 8 of my cores. This new code takes 2-3 seconds and barely touches the CPU even while dealing with all of the OPTIONS requests. ASTERISK-26806 Change-Id: I6a5ebbfca9001dfe933eaeac4d3babd8d2e6f082 2017-12-22 13:11 +0000 [661fec4b59] Richard Mudgett * core: Remove unused/incomplete SDP modules. Change-Id: Icc28fbdc46f58e54a21554e6fe8b078f841b1f86 2018-04-18 15:59 +0000 [ff652711c7] Kevin Harwell * translate: generic plc not filled in after translation If during translation a codec could not handle a given frame the translation core would return NULL, thus not passing along the "missing" frame. Due to this there was no frame to apply generic plc to, thus rendering it useless. This patch makes it so the translation core produces an interpolated slin frame in the cases where an attempt was made to translate to slin, but failed. This interpolated frame is then passed along and can be used by the generic plc algorithms to fill in the frame. ASTERISK-27814 #close Change-Id: I133d084da87adef913bf2ecc9c9240e3eaf4f40a 2018-04-20 07:40 +0000 [de9c0ede4a] Joshua Colp * bridge_softmix: Fix sporadic incorrect video stream mapping. When an externally initiated renegotiation occurred it was possible for video streams to be incorrectly remapped, resulting in no video flowing to some receivers. This change ensures that only the video source sets up mappings and also that removed streams do not have mappings set up. Change-Id: Iab05f2254df3606670774844bb0935f833d3a9b0 2018-04-20 14:07 +0000 [c481afe873] Alexander Anikin * chan_ooh323: fix ooManualProgress/ooManualRingback on ooh323 debuggin on Call ooManualProgress/Ringback outside of ast_debug function when ooh323 debugging is on ASTERISK-27812 #close ASTERISK-26893 #close Reported by: Dimos, Marco Giordani Change-Id: I5873762e4f05824e7b6e94a19dd4eb56adbbbb79 2018-04-19 13:44 +0000 [5712a0ae52] Joshua Colp * bridge_softmix: Fix some REMB bugs. This change fixes a bug where a REMB collector may be freed twice, and also tweaks REMB combining such that if there is no bitrate from anyone (or there are no sources) we report 0 instead of using an old bitrate. ASTERISK-27804 Change-Id: Ia9dc9c150043890ee7ff85e9cdec007f1a77fcfd 2018-04-20 07:13 +0000 [fe072f4405] Alexander Traud * BuildSystem: Enable IMAP storage on FreeBSD and DragonFly BSD. ASTERISK-27639 Change-Id: I1347f3f2f3737010d0a80a5c30b5aaf71cf3ccb0 2018-04-20 05:50 +0000 [efe40ff671] Alexander Traud * BuildSystem: Add DragonFly BSD. ASTERISK-27820 Change-Id: I310896143e94d65da1c2be3bb448204a8b86d557 2018-04-20 05:40 +0000 [d54637373a] Alexander Traud * menuselect: Add DragonFly BSD. In DragonFly BSD, added libraries from ports are placed into /usr/local. Therefore, this directory must be added for the preprocessor, compiler, and linker. Beside that, the script ./configure was updated: * OSARCH list was outdated and not used, removed. * AC_CANONICAL_BUILD was not used. * _REENTRANT, this feature test macro is obsolete. ASTERISK-27820 Change-Id: I186d88d99cfa4de6569888e12ac97bd2f441c422 2018-04-20 05:18 +0000 [6e9a612293] Alexander Traud * install_prereq: Add DragonFly BSD. ASTERISK-27820 Change-Id: I718ddb000fe5184b1bdc7759da67a370a7520144 2018-04-18 11:41 +0000 [b437656c2e] Chris-Savinovich * "confbridge show profile bridge" does not output "sfu" when video_mode is sfu Fixes a bug on the "confbridge show profile bridge" cli command that showed "video_mode=no video" when video_mode was set to "sfu" ASTERISK-27418 #close Change-Id: I481e3172c7f872664c7ac7809879d541c9f031e9 2018-04-18 15:40 +0000 [179ae87cf4] Corey Farrell * Build System: Add missing ASTMM_LIBC to flex output. Redirect libc allocation functions to use Asterisk functions for main/ast_expr2f.c and res/ael/ael_lex.c. This will resolve errors produced by astmm.h when these files are regenerated, though other issues still remain. ASTERISK~27813 Change-Id: I7263e9e4217a17bde4ffaa2087a8f8aeb2a8588c 2018-04-18 13:40 +0000 [80e6952013] Sean Bright * format_pcm: Correct behavior of fseek and ftell for G.722 There are twice as many samples in the same number of bytes, so redefine some of the G.722 format functions in terms of their PCM counterparts. Change-Id: I6a8c7352624b930a5f2d9e4857f75283fa5dd9f9 2018-04-17 05:33 +0000 [95e8450194] Alexander Anikin * chan_ooh323: introduce localras config parameter Introduce localras parameter that specify source IP for connecting to Gatekeeper. Useful for multihome configurations. ASTERISK-25129 #close Reported by: Dmitry Melekhov Tested by: Dmitry Melekhov Change-Id: I0b604b01793f3e02a776502659e07cd3fc7e3097 2018-04-18 05:32 +0000 [446320f1d4] Alexander Anikin * chan_ooh323: Fix cppcheck warnings Fix cppcheck warnings about redundant conditions and possible null pointer usage ASTERISK-27793 #close Reported by: Ilya Shipitsin Tested by: Ilya Shipitsin Change-Id: I0b31933b062a23331dbac9a82b8bcfe345f406f6 2018-04-04 13:12 +0000 [8de3fa2b56] Joshua Colp * bridge_softmix / app_confbridge: Add support for REMB combining. This change adds the ability for multiple REMB reports in bridge_softmix to be combined according to a configured behavior into a single report. This single report is sent back to the sender of video, which adjusts the encoding bitrate to be at or below the bitrate of the report. The available behaviors are: lowest, highest, and average. Lowest uses the lowest received bitrate. Highest uses the highest received bitrate. Average goes through the received bitrates adding them to the previous average and creates a new average. Other behaviors can be added in the future and the existing average one may be adjusted, but this provides the foundation to do so. Support for configuring which behavior to use has been added to app_confbridge. ASTERISK-27804 Change-Id: I9eafe4e7c1f72d67074a8d6acb26bfcf19322b66 2018-04-13 15:14 +0000 [f79a372941] George Joseph * streams: Add string metadata capability Replaces the never used opaque data array. Updated stream tests to include get/set metadata and stream clone with metadata. Added stream metadata dump to "core show channel" Change-Id: Id7473aa4b374d7ab53046c20e321037ba9a56863 2018-04-13 15:17 +0000 [f7e7ce6ba2] George Joseph * utils: Add ast_assert_return Similar to pjproject's PJ_ASSERT_RETURN macro, this one will do the following... If the assert passes... NoOp If the assert fails and AST_DEVMODE is defined, execute ast_assert() then, if DO_CRASH isn't set, return from the calling function with the supplied value. If the assert fails and AST_DEVMODE is not defined, return from the calling function with the supplied value. The macro will execute a return without a value if one isn't suppled. Change-Id: I0003844affeab550d5ff5bca7aa7cf8a559b873e 2018-04-10 16:09 +0000 [8135558bab] George Joseph * app_sendtext: Enhance SendText to support Enhanced Messaging SendText now accepts new channel variables that can be used to override the To and From display names and set the Content-Type of a message. Since you can now set Content-Type, other text/* content types are now valid. Change-Id: I648b4574478119f95de09d9f08e9595831b02830 2017-09-27 11:44 +0000 [4fb7967c73] George Joseph * bridge_softmix: Forward TEXT frames Core bridging and, more specifically, bridge_softmix have been enhanced to relay received frames of type TEXT or TEXT_DATA to all participants in a softmix bridge. res_pjsip_messaging and chan_pjsip have been enhanced to take advantage of this so when res_pjsip_messaging receives an in-dialog MESSAGE message from a user in a conference call, it's relayed to all other participants in the call. res_pjsip_messaging already queues TEXT frames to the channel when it receives an in-dialog MESSAGE from an endpoint and chan_pjsip will send an MESSAGE when it gets a TEXT frame. On a normal point-to-point call, the frames are forwarded between the two correctly. bridge_softmix was not though so messages weren't getting forwarded to conference bridge participants. Even if they were, the bridging code had no way to tell the participants who sent the message so it would look like it came from the bridge itself. * The TEXT frame type doesn't allow storage of any meta data, such as sender, on the frame so a new TEXT_DATA frame type was added that uses the new ast_msg_data structure as its payload. A channel driver can queue a frame of that type when it receives a message from outside. A channel driver can use it for sending messages by implementing the new send_text_data channel tech callback and setting the new AST_CHAN_TP_SEND_TEXT_DATA flag in its tech properties. If set, the bridging/channel core will use it instead of the original send_text callback and it will get the ast_msg_data structure. Channel drivers aren't required to implement this. Even if a TEXT_DATA enabled driver uses it for incoming messages, an outgoing channel driver that doesn't will still have it's send_text callback called with only the message text just as before. * res_pjsip_messaging now creates a TEXT_DATA frame for incoming in-dialog messages and sets the "from" to the display name in the "From" header, or if that's empty, the caller id name from the channel. This allows the chat client user to set a friendly name for the chat. * bridge_softmix now forwards TEXT and TEXT_DATA frames to all participants (except the sender). * A new function "ast_sendtext_data" was added to channel which takes an ast_msg_data structure and calls a channel's send_text_data callback, or if that's not defined, the original send_text callback. * bridge_channel now calls ast_sendtext_data for TEXT_DATA frame types and ast_sendtext for TEXT frame types. * chan_pjsip now uses the "from" name in the ast_msg_data structure (if it exists) to set the "From" header display name on outgoing text messages. Change-Id: Idacf5900bfd5f22ab8cd235aa56dfad090d18489 2018-04-17 07:06 +0000 [8a1ffb050b] Alexander Traud * utils/pval: Add -lBlocksRuntime for compiler clang conditionally. ASTERISK-27809 Change-Id: I930b364a33d54cc08dedfcd5bb45f7e83242f134 2018-04-17 05:27 +0000 [3d9345e3ae] Alexander Traud * chan_vpb: Avoid GNU old-style field designator extension. clang 6.0 warned about this. Beside that, this change removes the used variable 'desc'. ASTERISK-27808 Change-Id: Ia26bdcc0a562c058151814511cfcf70ecafa595b 2018-04-09 17:09 +0000 [f5d5083ea7] Ben Ford * res_rtp_asterisk: Add support for receiving and handling NACK requests. Adds the ability to receive and handle incoming NACK requests if retransmissions are enabled. If retransmissions are enabled, a data buffer is allocated that stores packets being sent. If a NACK request is received, the packet requested for retransmission is sent if it is still in the buffer. In the same request, if any of the following 16 packets are marked as not received, those will be sent as well if available, as outlined in RFC4585. Also changes RTCP RR and SR to use media source SSRC instead of packet source SSRC when determining which instance to use for RTCP reports. For more information, refer to the wiki page: https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements ASTERISK-27806 #close Change-Id: I7f7f124af3b9d5d2fd9cffc6ba8cb48a6fff06ec 2018-04-16 16:38 +0000 [d50d637764] Richard Mudgett * stringfields: Collect extended stringfields into the stringfield section. Use of extended stringfields is a temporary mechanism to avoid ABI breakage in released branches without resorting to more inconvienient methods. * Collect existing extended stringfields into the parent stringfield section of the struct. Change-Id: I8d46d037801b4518837c3ea4b6df95ceadc9436b 2018-04-13 14:32 +0000 [4aeec6100f] Ben Ford * res_musiconhold: Don't restart MOH from beginning after announcement. This reverts a problem introduced by the fix for ASTERISK_24329. Now, when an announcement is played while waiting in a queue, music on hold will not restart from the beginning of the sound file and will instead pick up where it left off. However, the incorrect behavior in ASTERISK_24329 is now present again; if an announcement X seconds long is played when music on hold starts, music on hold will start X seconds into the file. ASTERISK-27774 #close Reported by: lvl Change-Id: I86b2885ee7063268f9b9747eddb788336ade989b 2018-03-28 15:13 +0000 [3bb6cf43b5] Richard Mudgett * pjsip_scheduler.c: Add ability to trace scheduled tasks. When a scheduled task is created you can pass in the AST_SIP_SCHED_TASK_TRACK flag. This new flag causes scheduling events to be logged. Change-Id: I91967eb3d5a220915ce86881a28af772f9a7f56b 2018-03-27 11:04 +0000 [237d341bbd] Richard Mudgett * res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations. ast_sip_push_task_synchronous() did not necessarily execute the passed in task under the specified serializer. If the current thread is any registered pjsip thread then it would execute the task immediately instead of under the specified serializer. Reentrancy issues could result if the task does not execute with the right serializer. The original reason ast_sip_push_task_synchronous() checked to see if the current thread was a registered pjsip thread was because of a deadlock with masquerades and the channel technology's fixup callback (ASTERISK_22936). A subsequent masquerade deadlock fix (ASTERISK_24356) involving call pickups avoided the original deadlock situation entirely. The PJSIP channel technology's fixup callback no longer needed to call ast_sip_push_task_synchronous(). However, there are a few places where this unexpected behavior is still required to avoid deadlocks. The pjsip monitor thread executes callbacks that do calls to ast_sip_push_task_synchronous() that would deadlock if the task were actually pushed to the specified serializer. I ran into one dealing with the pubsub subscriptions where an ao2 destructor called ast_sip_push_task_synchronous(). * Split ast_sip_push_task_synchronous() into ast_sip_push_task_wait_servant() and ast_sip_push_task_wait_serializer(). ast_sip_push_task_wait_servant() has the old behavior of ast_sip_push_task_synchronous(). ast_sip_push_task_wait_serializer() has the new behavior where the task is always executed by the specified serializer or a picked serializer if one is not passed in. Both functions behave the same if the current thread is not a SIP servant. * Redirected ast_sip_push_task_synchronous() to ast_sip_push_task_wait_servant() to preserve API for released branches. ASTERISK_26806 Change-Id: Id040fa42c0e5972f4c8deef380921461d213b9f3 2018-03-21 19:43 +0000 [c2f85e881d] Richard Mudgett * pjsip_scheduler.c: Fix some corner cases. * Fix the periodic interval wander because it may take significant time between the sched thread queueing the task in the serializer and the serializer actually executing the task. The time it takes to actually execute the task was already taken into account. * Pass a schtd ref to the serializer when we queue a scheduled task on the serializer. We don't want it going away on us while it is in the serializer queue. * Skip the scheduled task if the task was canceled between queueing the task to the serializer and the serializer actually executing the task. * Reorder struct ast_sip_sched_task to avoid unnecessary padding. Removed task_id and added next_periodic. * Hold a ref to the passed in serializer so the serializer cannot go away on the scheduled task. ASTERISK_26806 Change-Id: I6c8046b75f6953792c8c30e55b836a4291143f24 2018-03-22 19:09 +0000 [96c4a57edf] Richard Mudgett * pjsip_scheduler.c: Sort "pjsip show scheduled_tasks" output. * A side benefit is that the scheduled tasks are not completely blocked while the CLI command executes. * Adjusted the "Task Name" column width to have more room for longer names. Change-Id: Iec64aa463ee8b10eef90120e00c38b1fb444087e 2018-04-02 15:59 +0000 [429c758e48] Evandro Cesar Arruda * cdr_mysql: Compile error because MYSQL_PORT definition is missing If it is not defined, it will add MYSQL_PORT definition. After some research on MySQL/MariaDB development tree, I couldn't find any reference to MYSQL_PORT definition in include files. ASTERISK-27782 #close Change-Id: Ieee56c836fc2e8bd021c456145bba04c6068bb77 2018-04-09 20:00 +0000 [0747ac893b] Chris-Savinovich * res_pjsip_session: Rewrite o= with external_media_address. It now appends the external IP address on the o= line of the SDP packet. The decision was made to write the numeric IP address as opposed to the RFC that states the FQDN should be used if and when available. We believe the usage of literal IP address will help avoid potential problems. ASTERISK-27614 #close Change-Id: I84f3360f3606b8c4e8d161edb228799ec0b8a302 2018-02-22 12:18 +0000 [1cd704de36] Nathan Bruning * res_pjsip_notify.c: enable in-dialog NOTIFY This patch adds support to send in-dialog SIP NOTIFY commands on chan_pjsip channels, similar to the functionality recently added for chan_sip (ASTERISK_27461). This extends res_pjsip_notify to allow for in-dialog messages. ASTERISK-27697 Change-Id: If7f3151a6d633e414d5dc319d5efc1443c43dd29 2018-03-22 13:35 +0000 [7157dcf83b] Richard Mudgett * pjsip_scheduler.c: Fix ao2 usage errors. * Removed several invalid uses of OBJ_NOLOCK. These uses resulted in the 'tasks' container being accessed without a lock in a multi-threaded environment. A recipe for crashes. * Removed needlessly obtaining schtd object references. If the caller providing you a pointer to an object doesn't have a valid reference then you cannot safely get one from it. * Getting a ref to 'tasks' when you aren't copying the pointer into another location is useless. The 'tasks' container pointer is global. * Removed many unnecessary uses of RAII_VAR. * Make ast_sip_schedule_task() name parameter const. ASTERISK_26806 Change-Id: I5c62488e651314e2a1dbc01f5b078a15512d73db 2018-03-23 06:49 +0000 [879e592baf] Corey Farrell * Build System: Enable python3 compatibility. * Consistently use spaces in rest-api-templates/asterisk_processor.py. * Exclude third-party from docs/full-en_US.xml. * Add docs/full-en_US.xml to .gitignore. * Use list() to convert python3 view. * Use python3 print function. * Replace cmp() with equivalent equation. * Replace reference to out of scope subtype variable with name parameter. * Use unescaping triple bracket notation in mustache templates where needed. This causes behavior of Python2 to be maintained when using Python3. * Fix references to has_websocket / is_websocket in res_ari_resource.c.mustache. * Update calculation of has_websocket to use any(). * Use unicode mode for writing output file in transform.py. * Replace 'from swagger_model import *' with explicit import of required symbols. I have not tested spandspflow2pcap.py or voicemailpwcheck.py, only the print syntax has been fixed. Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33 2018-04-05 18:33 +0000 [0c03eab962] Richard Mudgett * res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge There is a problem when an INVITE-with-Replaces transfer targets a channel in a ConfBridge. The transfer will unconditionally swap out the ConfBridge channel. Unfortunately, the ConfBridge state will not be aware of this change. Unexpected behavior will happen as a result since ConfBridge channels currently can only be replaced by a masquerade and not normal bridge channel moves. * We just need to pretend that the channel isn't in a bridge (like other transfer methods already do) so the transfer channel will masquerade into the ConfBridge channel. Change-Id: I209beb0e748fa4f4b92a576f36afa8f495ba4c82 2018-03-28 07:27 +0000 [c7bd554094] Joshua Colp * pjsip / res_rtp_asterisk: Add support for sending REMB This change allows chan_pjsip to be given an AST_FRAME_RTCP containing REMB feedback and pass it to res_rtp_asterisk. Once res_rtp_asterisk receives the frame a REMB RTCP feedback packet is constructed with the appropriate contents and sent to the remote endpoint. ASTERISK-27776 Change-Id: Ic53f821c1560d8924907ad82c4d9c0bc322b38cd 2018-04-05 20:02 +0000 [39016e3582] Joshua Colp * res_rtp_asterisk: Fix minimum block word length for REMB. The minimum block word length is actually 4, not 5. Change-Id: I878542218225aed72c72bdf1b856fc822cd2d649 2018-04-05 18:48 +0000 [8a602f18db] Joshua Colp * res_rtp_asterisk: Queue video update on picture loss indication. The previous payload specific feedback handling was very single minded in that it just assumed everything should trigger a video update. This was changed but the handling of picture loss indication was not added. The result was that video may not flow. This change adds it explicitly in. Change-Id: I1894be02e39ee10a0af841b5a1dca5f0ec7d60b6 2018-04-05 17:40 +0000 [d72a2966da] Richard Mudgett * chan_sip.c: Fix INVITE with replaces channel ref leak. Given the below call scenario: A -> Ast1 -> B C <- Ast2 <- B 1) A calls B through Ast1 2) B calls C through Ast2 3) B transfers A to C When party B transfers A to C, B sends a REFER to Ast1 causing Ast1 to send an INVITE with replaces to Ast2. Ast2 then leaks a channel ref of the channel between Ast1 and Ast2. Channel ref leaks are easily seen in the CLI "core show channels" output. The leaked channels appear in the output but you can do nothing with them and they never go away unless you restart Asterisk. * Properly account for the channel refs when imparting a channel into a bridge when handling an INVITE with replaces in handle_invite_replaces(). The ast_bridge_impart() function steals a channel ref but the code didn't account for how many refs were held by the code at the time and which ref was stolen. * Eliminated RAII_VAR in handle_invite_replaces(). ASTERISK-27740 Change-Id: I7edbed774314b55acf0067b2762bfe984ecaa9a4 2018-03-21 19:40 +0000 [71a67a98c4] Richard Mudgett * res_pjsip: Update authenticate_qualify documentation. Change-Id: I3811de0014b1ffe96d4a3b49cddd5d4ca02ee5d4 2018-04-02 16:49 +0000 [6774913e82] Richard Mudgett * app_agent_pool.c: Fix off nominal ref leak. Change-Id: Ib427ffc2c802620eaafb08b1c2a17dddd8fb8eb6 2018-04-04 10:02 +0000 [e40fd7a232] Corey Farrell * Build System: Strip '-std=c99' from CFLAGS provided by libraries. Asterisk requires GNU C extensions. On some systems certain libraries may incorrectly push -std=c99 into CFLAGS, thus breaking the build. This change causes that flag to be stripped so the Asterisk build is not broken by those libraries. This change is made for both pkgconfig and tool based libraries. ASTERISK-27629 #close Change-Id: I13389613b194abbac77becf90cd950dc168704db 2018-04-03 14:39 +0000 [66f13ed694] Corey Farrell * Build System: Fixes for configure script. * Replace all 'else if' statements with 'elif'. * Use loop to detect versioned lua headers and libraries. The loop for detecting lua fixes a bug where LUA_INCLUDE would be appended with the directory of every lua version after the first one is found. Change-Id: I3276f9aee955014108345be6092f51c932b43a0f 2018-04-02 08:53 +0000 [0f6431e8e4] Joshua Colp * app_confbridge / bridge_softmix: Add ability to configure REMB interval. This change adds a configuration option to app_confbridge which can be used to set the interval at which we will send a combined REMB (remote estimated maximum bitrate) frame to sources of video. The bridging API has also been extended slightly to allow setting this so bridge_softmix can use it. ASTERISK-27786 Change-Id: I0e49eae60f369c86434414f3cb8278709c793c82 2018-01-02 07:54 +0000 [f91263cf46] George Joseph * res_pjsip: Correct usages of pjproject's timer heap Fix some timer heap initializations and cancels to try and prevent crashes and timer heap issues. Change-Id: I64885d190fa22097d1b55987091375541e57a7ee 2018-03-25 13:35 +0000 [48720e7def] George Joseph * pjroject_bundled: Add already-destroyed check to tsx_timer_callback There have been cases that when the transaction timer callback is called the tsx is already destroyed. This causes a crash. We now check the tsx state and return if the tsx is already destroyed. Change-Id: If93acd5e48d9ca5bb553f2405d5afc836842fe1c 2018-03-25 13:25 +0000 [7c03b2713e] George Joseph * pjproject_bundled: timer: Clean up usage of timer heap Added a new pj_timer_entry_reset function that resets a timer_entry for re-use. Changed direct settings of timer_entry fields to use pj_timer_entry_init and pj_timer_entry_reset. Fixed issues where timers were being rescheduled incorrectly. Change-Id: I5b624bfbc5c1429117484b9b24567293002148e6 2018-03-29 17:07 +0000 [97cc67b12f] Richard Mudgett * res_pjsip: Fix deadlock on reliable transport shutdown. A deadlock can happen when the PJSIP monitor thread is shutting down a connection oriented transport (TCP/TLS) used by a subscription at the same time as another thread tries to send something for that subscription. The deadlock is between the pjsip monitor thread attempting to get the dialog lock and another thread sending something for that dialog when it tries to get the transport manager lock. * res_pjsip_pubsub.c: Avoid the deadlock by pushing the subscription removal to the subscription serializer. * res_pjsip_registrar.c: Pushed off incoming registration contact removals to a default serializer as a precaution. Removing the contacts involves sorcery access which in this case will involve database access. Depending upon the setup, the database may not be on the same machine and could take awhile. We don't want to hold up the pjsip monitor thread with potentially long access times. ASTERISK-27706 Change-Id: I56b647aea565f24dba33e9e5ebeed4cd3f31f8c4 2018-03-07 06:15 +0000 [f65488f546] Ross Beer * pjsip_transport_events.c: Fix crash using stale transport pointer. Apparently it is possible for the transport to be destroyed without triggering the transport callback logic. As a result the transport gets destroyed and we have a stale pointer in the active_transports container. * Invoke the transport monitor callback checks when the transport is destroyed in addition to when it is disconnected and shutdown. ASTERISK-27688 Change-Id: Ia9b5469fea8f2b3f2d8476fae6b748a4d23e7261 2018-03-19 09:36 +0000 [879743ab8f] Ben Ford * test_data_buffer.c: Add unit tests for data buffer API. Added unit tests for the data buffer API. These tests include creating a data buffer, putting payloads into the buffer, resizing the buffer, and the nominal case for data buffer usage, which consists of adding the max number of payloads to the buffer, checking to see if the correct payloads are present, then adding more payloads and checking again to see if the previous payloads were replaced or not. For more information, refer to the wiki page: https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements Change-Id: Id5b599aa15a5e61d0ec080f97cd0c57bd07e6f8f 2018-02-23 13:49 +0000 [138e0eff4e] Ben Ford * Add data buffer API to store packets. Adds a data buffer with a configurable size that can store different kinds of packets (like RTP packets for retransmission). Given a number it will store a data packet at that position relative to the others. Given a number it will retrieve the given data packet if it is present. This is purposely a storage of arbitrary things so it can be used not just for RTP packets but also Asterisk frames in the future if needed. The API does not internally use a lock, so it will be up to the user of the API to properly protect the data buffer. For more information, refer to the wiki page: https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements Change-Id: Iff13c5d4795d52356959fe2a57360cd57dfade07 2018-03-25 13:12 +0000 [a87141ddfd] George Joseph * pjproject_bundled: Add patch for pj_atomic crashes There have been some crashes in the past where something attempts to use a pj_atomic after it's already been destroyed. This patch tries to prevent it by making sure that pj_atomic_destroy sets its mutex to NULL when it's done. The pj_mutex functions already check for a NULL mutex and just return PJ_EINVAL. Teluu also added some checks to the win32 implementation as well. Change-Id: Id25f70b79fdedf44ead6e6e1763a4417d3b3f825 2018-03-21 08:52 +0000 [e14b0e960d] Joshua Colp * res_rtp_asterisk: Add support for raising additional RTCP messages. This change extends the existing AST_FRAME_RTCP frame type to be able to contain additional RTCP message types, such as feedback messages. The payload type is contained in the subclass which allows knowing what is in the frame itself. The RTCP feedback message type is now handled and REMB[1] messages are raised with their containing information. This also fixes a bug where all feedback messages were triggering video updates instead of just FIR and FUR. Finally RTCP frames are now passed up through the Asterisk core to what is handling the channel, mapped appropriately in the case of bridging, and written to an outgoing stream. Since RTCP frames are on a per-stream basis this is only done on multistream capable channels. [1] https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03 ASTERISK-27758 ASTERISK-26366 Change-Id: I680da0ad8d5059d5e9655d896fb9d92e9da8491e 2018-03-27 08:27 +0000 [455cee99ae] Florian Floimair * main: Update copyright notice with year 2018 Change-Id: I2d80bc5edf940fab914cba3d8a0fa0b5eb2a3148 2018-03-26 07:42 +0000 [48190c7f93] Guido Falsi * core: fix getopt(3) usage Setting optind = 0 is forced to 1 in glibc implementation, but causes option parsing to be flawed in other implementations, for example on FreeBSD. ASTERISK-27773 #close Change-Id: Ia548e69f8302e9754dbbedb6bc451c0700c66f61 2018-03-23 13:15 +0000 [07cf6b1437] Alexander Traud * install_prereq: Add Slackware (somehow). ASTERISK-27770 Change-Id: Ib87e0483c785542238cfe34c1e884d5a31edfaab 2018-03-23 09:13 +0000 [307a295d00] Alexander Traud * install_prereq: Add Gentoo Linux. ASTERISK-27769 Change-Id: Ieb13293cd67481f3a33f58f6f7c8c3ee1e338e7a 2018-03-17 01:02 +0000 [318bf45928] Corey Farrell * main/indications: Use ast_cli_completion_add for all completions. Change-Id: I371be01f178fb542a9fbe8d97e7ae21aa4d82c36 2018-03-21 14:54 +0000 [75715b95b4] Russell Bryant * app_originate: Add async option. Add an option to make app_originate not wait for the created channel to answer. Change-Id: I7fc2facd77079abc6321f44e8bcd4e39298de2ae Requested-by: Frederic Steinfels Signed-off-by: Russell Bryant 2018-03-22 07:27 +0000 [4f33f56a72] Alexander Traud * BuildSystem: pjsip_evsub_set_uas_timeout was not used (part 2). The previous change was not complete. ASTERISK-27435 Change-Id: I11082c14c0ef9c6af8c995084a6851337ea2a90f 2018-03-22 05:43 +0000 [d6fda173a4] Alexander Traud * BuildSystem: With external editline, do not require libs for internal editline. ASTERISK-27761 Change-Id: Ib17a7415297a210cfcdbf149e4df9b6edadbfab6 2018-03-21 22:00 +0000 [a6d58c518a] Corey Farrell * core: Create main/options.c. This creates a separate source to 'own' symbols related to options.h and paths.h. This significantly reduces the number of exports created by main/asterisk.o. This change is required to eventually be able to link unmodified Asterisk sources to utilities and/or stand-alone tests. ASTERISK~26245 Change-Id: I5cf184f4757f9363b80c9e678bdc35c477122380 2018-03-21 19:25 +0000 [745b5134cd] George Joseph * Revert "BuildSystem: In NetBSD, the Python Programming Language is python-X.Y." Something is causing a python2/python3 mismatch on Fedora27. PYTHON='/usr/bin/python2' PYTHONDEV_CFLAGS='-I/usr/include/python3.6m ' PYTHONDEV_INCLUDE='-I/usr/include/python3.6m ' PYTHONDEV_LIB='-lpython3.6m ' PYTHONDEV_LIBS='-lpython3.6m ' This reverts commit be0e9920b64e3b07501b299d131309b58f9b0ddf. Change-Id: I86dd102eb3ead199fe89178cdbadb36b4e2cfd1b 2018-02-08 13:23 +0000 [411915af28] Corey Farrell * loader: Reserve space for additional pointers in ast_module_info. This creates 4 reserved pointers in case we need additional dependency management fields. Change-Id: If991ec99b779df1b2dfbd38ce1a0cd79f9e01821 2018-03-20 15:28 +0000 [cf73a4203f] Kevin Harwell * bridge_softmix: Clear "talking" when a channel is put on hold This patch clears the talking flag from the channel (if already set), and notifies listeners when that channel is put on hold. Note however, if the endpoint continues to send audio frames and these are received by the bridge then that channel will be put back into a "talking" state even though they are on hold. ASTERISK-27755 #close Change-Id: I930e16c4662810f9f02043d69062f88173c5e2ef 2018-03-20 11:53 +0000 [bfefde5b07] Alexander Traud * BuildSystem: For consistency, avoid extra libs to be empty. AST_EXT_LIB_CHECK has several optional parameters. When an optional parameter is left empty, [] is used to indicate this. However, this is done in the script ./configure only then, when a further parameter is not empty. For example, when no extra libraries are needed to test the checked library, parameter 5 is not mentioned. Except parameter 6 and higher are used, then parameter 5 must be empty. However, this general rule was broken * four times for parameter 5 (extra libs) and * three times for parameter 4 (header) as found via the Regular Expression \[\]\). In case of parameter 5, all cases were changed, because that happened for no reason. In case of parameter 4, an [] improves readability actually. Therefore for parameter 4, the only case which did not do it was changed. All this aims to create more consistency: Only do something different if there is a reason to do so. Change-Id: I037ef170cf1ad94497151a9ea5071a31c656cafe 2018-03-20 09:58 +0000 [8bd5980e14] Ivan Poddubny * func_channel: Delete dead CHANNEL_TRACE code The functions behind the flag and the flag itself were removed from Asterisk 12 as incompatible with the new architecture. Change-Id: I058493ef7a53ee290fd225bbcbb07bf46b623ccf 2018-03-17 21:26 +0000 [040bb21771] Corey Farrell * core: Remove additional symbols. Remove symbols that are depreacated and replaced: * ast_channel_datastore_alloc * ast_channel_datastore_free * ast_channel_cmpwhentohangup * ast_channel_setwhentohangup * config_text_file_save * devstate2str * ast_device_state_changed * ast_device_state_changed_literal * ast_verbose_get_by_module Remove unused symbols: * channelreloadreason2txt (last used in Asterisk 12). Remove unused ast_options flags: * AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN / ast_opt_end_cdr_before_h_exten * AST_OPT_FLAG_VERBOSE_MODULE / ast_opt_verb_module * AST_OPT_FLAG_INITIATED_SECONDS Change-Id: I841255995d195f8efc1ed47af9c7a2f131c08645 2018-03-17 20:03 +0000 [de77cf8698] Corey Farrell * core: Remove dead symbols from asterisk.exports.in. * dahdi_chan_name * dahdi_chan_name_len * dahdi_chan_mode * __manager_event * dialed_interface_info Added comment about __progname and environ being needed for FreeBSD to prevent accidental removal in the future. Change-Id: I3ae026bc541cd9cb572be2ffa95fc359547642b5 2018-03-17 01:39 +0000 [201762f161] Corey Farrell * named_acl: Use ast_cli_completion_add. Change-Id: I317a82de976bbdbfe4352c243e32a7bb8f66c377 2018-03-17 01:58 +0000 [645203a422] Corey Farrell * main/sounds: Use ast_cli_completion_add. Change-Id: I140e1137906bbfcdb61c0c6304159be459ad873e 2018-03-16 10:19 +0000 [5d097f8236] George Joseph * channel.c: Allow generic plc then channel formats are equal If the two formats on a channel are equal, we don't transcode and since the generic plc needs slin to work, it doesn't get invoked. * A new configuration option "genericplc_on_equal_codecs" was added to the "plc" section of codecs.conf to allow generic packet loss concealment even if no transcoding was originally needed. Transcoding via SLIN is forced in this case. ASTERISK-27743 Change-Id: I0577026a179dea34232e63123254b4e0508378f4 2018-03-17 01:09 +0000 [8d01ec572d] Corey Farrell * manager: Use ast_cli_completion_add for completion generators. Change-Id: I658141c6ec490a3e866b02d2afea757928ceaabf 2018-03-17 02:16 +0000 [2c1ad2f510] Corey Farrell * main/test: Use ast_cli_completion_add. Change-Id: I5133ff2ba4e030f9733fb3d050c863d72a22ae6b 2018-03-18 10:16 +0000 [115939caeb] Joshua Colp * rtp: Add REMB RTP property and set it on PJSIP video RTP. This change adds a property to RTP instances to indicate that REMB support is enabled and that sending/receiving should be passed through. This also enables it on video RTP instances in PJSIP if WebRTC support is enabled. Finally the goog-remb extension is added to the SDP using the rtcp-fb attribute to indicate our support for it. Details about REMB can be found on the draft document for it: https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03 Change-Id: I1902dda1c0882bd1a0d71b2f120684b44b97e789 2018-03-17 04:31 +0000 [8c25a72d57] Corey Farrell * main/bridge: Use ast_cli_completion_add. Change-Id: I3775a696d6a57139fdf09651ecb786bcf1774509 2018-03-17 16:41 +0000 [5b40441197] Corey Farrell * core: Minor cleanup of ast_el_read_char. * Define CHAR_T_LIBEDIT and CHAR_TO_LIBEDIT based on HAVE_LIBEDIT_IS_UNICODE. This avoids needing to repeatedly use conditional blocks, eliminates having multiple function prototypes. * Remove parenthesis from return values. * Add missing code block brackets {}. * Reduce use of 'else' conditional statements where possible. Change-Id: I4315328ebea2f62641faf6881de2ac20a9f9d08e 2018-03-17 10:49 +0000 [e61b50b67a] Alexander Traud * BuildSystem: Check for header file of OGG. Asterisk uses various symbols of the shared library libogg within the module format_ogg_vorbis. However, the source code of that module did not include the header file of libogg explicitly but implicitly. Because that header was not included before Asterisk 14, the script ./configure was told not to check for it. Anyway, even Asterisk 13 LTS uses symbols of libogg. Therefore, that header should be included explicitly. Therefore, ./configure should check for that header. Change-Id: I98c50d56311b68880d1084fcc62c35ab2f8692db 2018-03-09 06:26 +0000 [f697025ae5] Alexander Traud * BuildSystem: When no download utility is available, display the explanation. ./configure --with-pjproject-bundled did not display an explanation, when no download utility like wget, curl, or fetch was installed beforehand, although an explanation existed in code. This happened because the code expected the variable DOWNLOAD_TO_STDOUT to be empty. However, the script ./configure set that variable always. Change-Id: I64c99b76a03525c69471e5055bf124b36a51bbd4 2018-03-17 05:00 +0000 [10a978829e] Alexander Traud * BuildSystem: Remove unused dependency on libltdl. Asterisk does not need the development package of libltdl, because it does not use any symbol of -lltdl directly. Instead, it uses the runtime package via the shared library -lodbc. On the supported platforms, that shared library declares its dependency on -lltdl correctly, otherwise AST_EXT_LIB_CHECK would have failed. ASTERISK-27745 Change-Id: Icd315809b8e7978203431f3afb66240dd3a040ba 2018-03-17 02:25 +0000 [1136a22a1e] Corey Farrell * main/translate: Use ast_cli_completion_add. Change-Id: I0e2402660e54d91f74ab0804c62a5b1925577413 2018-03-17 02:00 +0000 [91ac95993e] Corey Farrell * main/taskprocessor: Use ast_cli_completion_add. Change-Id: Ie5f812a988ed811fd11967151932de62bc131b48 2018-03-15 15:06 +0000 [3ad56aa929] Corey Farrell * main/config: Use ast_cli_completion_add for reload completion. Change-Id: Ia3fa4c03f2285a1ec8814bbe7f4624ead9111ad1 2018-03-17 00:51 +0000 [9e335f22e7] Corey Farrell * aco: Use ast_cli_completion_add for 'config show help'. In addition this removes: * RAII_VAR usage * Duplicate check of pos * Unneeded arguments. Change-Id: I2da8eac2670d1d8d6474c04037129804f55ebf39 2018-03-14 04:27 +0000 [4d1c9d8711] Corey Farrell * core: Stop using AST_INLINE_API for allocator functions. This replaces AST_INLINE_API allocators in utils.h with real functions implemented in astmm.c. Associated macro's are also moved from utils.h to astmm.h. Remove menuselect conflicts between MALLOC_DEBUG and DEBUG_CHAOS as they can now be combined. This has multiple benefits: * Simplifies asterisk/utils.h by removing inline functions and use of the logger. * Removal of these inline functions decreases size of Asterisk and module binaries by 1% or more. * Puts memory management functions together with and without MALLOC_DEBUG enabled, simplifying management of the code. * Enables DEBUG_CHAOS for ASTMM_REDIRECT and bundled pjproject. Change-Id: If9df4377f74bdbb627461b27a473123e05525887 2018-02-27 03:01 +0000 [ecc846b26b] Florian Floimair * app_dial: Enable early-media video Certain applications (e.g. door-phone) require that also video is transmitted before a call is accepted. Change-Id: I9842e1dc2f6e1c2c49dc33fe615255007d2f821e 2018-03-05 06:50 +0000 [be0e9920b6] Alexander Traud * BuildSystem: In NetBSD, the Python Programming Language is python-X.Y. ASTERISK-27717 Change-Id: If90ddf9c396c32e7402a894f42dce215c30049d1 2018-03-16 09:53 +0000 [02fa145a1b] Alexander Traud * BuildSystem: Avoid an extra case for OpenBSD. Nine years ago with Mantis 13639 (now ASTERISK-12841) an extra case for OpenBSD was introduced: Vorbis required Ogg to be specified manually, because the shared library libvorbis.so did not specify its required dependency on -logg itself. Today with OpenBSD 6.2, all libvorbis*.so declare their dependencies correctly. Therefore, an extra case is not required anymore. Change-Id: Ifd04e0994ce9f1e4ad29c3948a0398b91d1e97bc 2018-03-05 10:10 +0000 [00789174f6] Alexander Traud * BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD. In the script ./configure, AST_EXT_LIB_CHECK checks for external libraries. Some libraries do not specify all their dependencies and require additional shared libraries. In AST_EXT_LIB_CHECK, this is the fifth parameter. However, if a library is specified there, it must exist on the platform, because ./configure tries to compile/link/execute a small app using those statements. For example, the library libdl.so is Linux specific and does not exist on BSD-like platforms. Furthermore, no supported platform/version was found, which still (ever?) requires those additional libraries. Therefore, they were simply removed. Finally, this change adds the error code ESTRPIPE to the channel driver chan_alsa for those platforms which lack it, again for example NetBSD. ASTERISK-27720 Change-Id: I3b21f2135f6cbfac7590ccdc2df753257f426e0b 2018-03-16 09:02 +0000 [4d1e3fef6b] George Joseph * app_voicemail: Fix json blob errors When app_voicemail calls ast_test_suite_notify with the results of a user keypress, it formats the keypress as '%c'. If the user hung up or some other error occurrs, the result of the keypress is a non printable character. This ultimately causes json_vpack_ex to think it's being passed a non utf-8 string and return an error. * Keypress results passed to ast_test_suite_notify are now checked with isprint() and a '?' is substituted if the check fails. Change-Id: I78ee188916bbac840f3d03f40201b692347ea865 2018-03-15 09:32 +0000 [ebe957c5e9] Corey Farrell * main/cdr: Use ast_cli_completion_add for CDR channel completion. Change-Id: Ie81830647a23aad61c1162583b6d50adbe6e7822 2018-03-12 10:20 +0000 [dbf5ff6ed0] Alexander Traud * install_prereq: Add Arch Linux. ASTERISK-27738 Change-Id: I7ca620e3c4dfb4b064a19382c4915aeb42a2a09f 2018-03-15 08:19 +0000 [89ba4d4e3d] Corey Farrell * main/ccss: Use ast_cli_completion_add for core id. Change-Id: I44b25d6d24c7d9bc1bb38a50774b38883162f98f 2018-03-15 07:29 +0000 [aa0d95c730] Corey Farrell * astobj2_container: Use ast_cli_completion_add for container names. Change-Id: I4f0fc09e820eb8d8da2354a177dbcf503c56ddd1 2017-12-09 04:52 +0000 [b929a7fb8d] Corey Farrell * main/channel: Use ast_cli_completion_add for channeltypes. Change-Id: Ia845fae6a84801cc7d9996767b99efb2753cbb48 2018-03-14 12:38 +0000 [b45bb476bb] Corey Farrell * cli: Enable ast_cli_completion_add on public completion generators. * ast_cli_complete * ast_complete_channels * ast_complete_applications These generators will now use ast_cli_completion_add if state == -1. Change-Id: I7ff311f0873099be0e43a3dc5415c0cd06d15756 2018-03-14 11:17 +0000 [92158b7f37] Ross Beer * res_pjsip_rfc3326.c: Account for more than one 'Reason' header ASTERISK-27741 Change-Id: I0aa59a54735c6d20b95c54db1bd095dbf93e7adf 2018-03-12 08:05 +0000 [b0fff03bb5] Alexander Traud * install_prereq: Add SUSE. ASTERISK-27736 Change-Id: I4cafc8973349d50a7cb7919ddf0bb1aaef4bfc3e 2018-02-16 21:11 +0000 [572a508ef2] Corey Farrell * loader: Convert reload_classes to built-in modules. * acl (named_acl.c) * cdr * cel * ccss * dnsmgr * dsp * enum * extconfig (config.c) * features * http * indications * logger * manager * plc * sounds * udptl These modules are now loaded at appropriate time by the module loader. Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so the module loader will abort startup on failure of these modules. Some of these modules are still initialized or shutdown from outside the module loader. logger.c is initialized very early and shutdown very late, manager.c is initialized by the module loader but is shutdown by the Asterisk core (too much uses it without holding references). Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f 2018-03-13 16:39 +0000 [9e488dd482] Corey Farrell * core: Remove incorrect usage of attribute_malloc. GCC documentation states that when __attribute__((malloc)) is used it should not return storage which contains any valid pointers. It specifically mentions that realloc functions should not have the malloc attribute, but this also means that complex initializers which could contain initialized pointers should not use this attribute. Change-Id: If507f33ffb3ca3b83b702196eb0e8215d27fc7d2 2018-03-12 05:19 +0000 [d9776870e8] Alexander Traud * BuildSystem: Enable IMAP storage on openSUSE and Arch Linux. ASTERISK-27734 Change-Id: I8d6e6a1c08c031649764f5277fbbb85e57c3a9d4 2018-02-23 07:41 +0000 [ea9768ff07] Corey Farrell * stringfields: Remove MALLOC_DEBUG fields from struct ast_string_field_mgr. This causes MALLOC_DEBUG reporting to be slightly different, calls which cause additional memory pools to be allocated now report the callers location rather than the location which originally allocated the string field structure. This reduces storage needed by string fields and allows MALLOC_DEBUG to identify the source of additional allocations rather than obscuring it by reporting the original allocation caller. Change-Id: Idd18e6639a87ab862079b580c114d90361412289 2018-03-10 03:33 +0000 [fee929c8ac] Corey Farrell * core: Remove non-critical cleanup from startup aborts. When built-in components of Asterisk fail to start they cause the Asterisk startup to abort. In these cases only the most critical cleanup should be performed - closing databases and terminating proceses. These cleanups are registered using ast_register_atexit, all other cleanups should not be run during startup abort. The main reason for this change is that these cleanup procedures are untestable from the partially initialized states, if they fail it could prevent us from ever running the critical cleanup with ast_run_atexits. Create separate initialization for dns_core.c to be run unconditionally during startup instead of being initialized by the first dns resolver to be registered. This ensures that 'sched' is initialized before it can be potentially used. Replace ast_register_atexit with ast_register_cleanup in media_cache.c. There is no reason for this cleanup to happen unconditionally. Change-Id: Iecc2df98008b21509925ff16740bd5fa29527db3 2018-03-12 06:40 +0000 [ea3b8bb080] Alexander Traud * install_prereq: Update FreeBSD libraries. Because the code review system Gerrit creates merge conflicts even when one line apart another change happened, the previous update to the FreeBSD libraries had to be rebased via Git. Because of a break for training of the original contributor, this rebase was done by another contributor and the variant for Asterisk 13 was cherry-picked to all branches. By this, dependencies for new features added in newer Asterisk version got lost. This can be seen, when not the original path set but a previous patch set is compared. This change here fixes this by adding those (optional) dependencies for Asterisk 15 and newer (again). ASTERISK-27686 Change-Id: I6638a3d0dc37ad4ff5f94be15463e3dd8a2bfe74 2018-03-12 04:11 +0000 [9164be19d2] Alexander Traud * res_srtp: Add support for libsrtp2.x on openSUSE. Since ASTERISK-27253, no symbols from the header srtp2/crypto_types.h are used anymore. Therefore, its include statement can be removed. This allows to compile Asterisk on platforms which do not offer this private header, like openSUSE. ASTERISK-27733 Change-Id: I25c5cb8fa966043d1506ebef449e5a724412b4b6 2018-03-08 09:14 +0000 [5b525c9781] Alexander Traud * BuildSystem: Add NetBSD. Headers, libraries, and rpath. ASTERISK-27728 ASTERISK-11015 Reported by: Curt Sampson Change-Id: I50aa5fcd095937df32a2e33307caac7e79a8b5b7 2018-03-09 03:13 +0000 [c5f2332953] Alexander Traud * BuildSystem: For consistency, avoid double-checking via if clauses. In the script ./configure, AST_EXT_LIB_CHECK and AST_PKG_CONFIG_CHECK first test whether parameter 1 was already found. Consequently, an if-test on PBX_ just a line below is redundant, if exactly the same parameter 1 is used again. No performance gain is expected by this change. However, because this strategy is used all over in ./configure except for two places, this change aims to create more consistency: Only do something different if there is a reason to do so. Change-Id: I4a6f48127b7af3a48168c917e888be1f70625027 2018-03-09 02:44 +0000 [36c8885c66] Alexander Traud * BuildSystem: Enable dladdr on non-Linux platforms like FreeBSD. ASTERISK-27641 Change-Id: I587e8ba0123c70fc10cfd8b0ac3299551f61d84b 2018-03-08 13:53 +0000 [e6738b79b3] Richard Mudgett * Complete deprecating legacy modules. The menuselect comment was updated to deprecate these modules but the AST_MODULE_INFO block at the end of file was missed. ASTERISK-27671 Change-Id: I63070b5c4d4f08af010c6034acd4793c1bcef839 2018-03-07 13:50 +0000 [7f4354c10f] Richard Mudgett * res_pjproject.c: Upgrade bundled PJPROJECT to 2.7.2 Update patches included in bundled PJPROJECT for the new version. ASTERISK-27730 Change-Id: Id3c8c8ad82126846bcd9768bc3d0a18d89be8944 2018-03-08 12:02 +0000 [9ff95e46e3] Alexander Traud * install_prereq: Add NetBSD. ASTERISK-27729 Change-Id: I7a706d51375d54cf5e36d32397bfe09a48670804 2018-03-08 09:04 +0000 [75cebc3e71] Alexander Traud * BuildSystem: Re-check for another UUID library only when previous check failed. As a side-effect, this avoids the ambiguous output: checking for uuid_generate_random... no which was printed always previously. ASTERISK-25586 Reported by: John Nemeth Change-Id: I6d541dfcf453932a9856c5e251aa22e0e6c233c9 2018-03-08 05:28 +0000 [fc64a0e2b3] Alexander Traud * BuildSystem: Instead of $PJPROJECT_LIBS with s, use $PJPROJECT_LIB everywhere. In the script ./configure, xyz_LIB is set by AST_PKG_CONFIG_CHECK and xyz_LIBS is set by PKG_CHECK_MODULES within AST_PKG_CONFIG_CHECK. Both are the same. In Asterisk normally the former and only three times the latter was used. Let us use xyz_LIB without s, for consistency with AST_EXT_LIB_CHECK. That eases understanding because now readers do not have to know that xyz_LIB equals xyz_LIBS. Change-Id: I7359860a5d730cdc784c2c48e501a082196434d3 2018-03-06 06:28 +0000 [16f6e94033] Alexander Traud * BuildSystem: Enable PortAudio in NetBSD. In NetBSD, PortAudio 1 is still the default version. PortAudio 2 can be installed side by side but gets placed in a 'portaudio2' subdirectory. To find PortAudio 2 even in a subdirectory, the tool pkg-config is queried via AST_PKG_CONFIG_CHECK. For those platforms, which do not list PowerAudio 2 via pkg-config, the previous check remains and is executed thereafter. ASTERISK-27721 Change-Id: I4175500126909ad1b181fff8e11bb4a3a6ae4fa9 2018-03-07 14:36 +0000 [c8a521b6c8] Corey Farrell * Replace direct checks of option_debug with DEBUG_ATLEAST macro. Checking option_debug directly is incorrect as it ignores file/module specific debug settings. This system-wide change replaces nearly all direct checks for option_debug with the DEBUG_ATLEAST macro. Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0 2018-03-07 13:13 +0000 [1fe913f7bd] Richard Mudgett * BuildSystem regression: Fix errors reported by clean targets. Doing a 'make clean', 'make distclean', or 'make dist-clean' gets errors about an invalid shell option: "/bin/sh: 0: Illegal option -". The clean targets do not include the makeopts file which defines GREP and LDCONFIG because the file may not exist and the distclean/dist-clean targets will delete it anyway. ASTERISK-27715 Change-Id: I33d40acdb03862bc89aeb6fb1ff497894a8ea7f5 2018-03-06 13:31 +0000 [88cef40f6e] Ross Beer * res_pjsip_rfc3326: Order of 'Reason' headers break many endpoints ASTERISK-27554 Change-Id: If61c7faab7d2fa1031c056ed6268fe928e2391cf 2018-03-06 08:14 +0000 [961dd9fe52] Sungtae Kim * voicemail: Fixed wrong voicemail message count Fixed wrong voicemail mailbox reference for Action: VoicemailUsersList. ASTERISK-27703 Change-Id: Ie6578ad80bba2bfaf34b84f0be978f59045ce6cd 2018-03-07 09:32 +0000 [58f44f225a] Alexander Traud * utils: In Solaris, avoid a warning about an unused variable. When HAVE_GETHOSTBYNAME_R_5 was set by the script ./configure, GCC 7.3.0 found an unused variable. Actually, the variable was used (set to a dummy value) but the compiler optimization might have removed that. Instead, this change ensures that the variable 'res' is only used when it is really required. Change-Id: Ic3ea23ccf84ac4bc2d501b514985b989030abab5 2018-03-07 01:45 +0000 [add03e207c] Corey Farrell * app_osplookup: Move header defines into the app. astosp.h is leftover from when logic was split between app_osplookup and res_osp. All logic was moved into app_osplookup by 109737eb1c in 2006, but astosp.h remained. This moves the remaining defines into app_osplookup and deletes astosp.h. Change-Id: I0a6c4debd7c9543b608520b1765abfa4fab7b2fd 2018-02-14 07:33 +0000 [75a35ee5e8] Jean Aunis * chan_sip: Fix improper RTP framing on outgoing calls The "ptime" SDP parameter received in a SIP response was not honoured. Moreover, in the abscence of this "ptime" parameter, locally configured framing was lost during response processing. This patch systematically stores the framing information in the ast_rtp_codecs structure, taking it from the response or from the configuration as appropriate. ASTERISK-27674 Change-Id: I828a6a98d27a45a8afd07236a2bd0aa3cbd3fb2c 2018-02-20 11:48 +0000 [3fb26df4ac] lvl * res_pjsip_session: properly handle SDP from a forked call with early media In handle_negotiated_sdp(), use session->active_media_state when session->pending_media_state is empty. The 200's SDP should be fed into handle_negotiated_sdp_session_media() together with the already negotiated state, which is now in session->active_media_state instead. Only if both the session's pending and active media are empty should handle_negotiated_sdp() abort. ASTERISK-27441 Change-Id: If0d5150ffe6f38d8a854831fef37942258d4629c 2018-03-05 08:01 +0000 [ef79e583ec] Alexander Traud * BuildSystem: Enable Lua in NetBSD. luaL_openlib got removed with Lua 5.2. luaL_newstate is available in all versions. ASTERISK-27718 Change-Id: I9c8c8880315ee36ab740d7c40153306c0bfd6f71 2018-03-06 07:33 +0000 [162fc4fba6] Alexander Traud * BuildSystem: Depend not implicitly but explicitly on external libraries. ASTERISK-27722 Change-Id: Ie7b8c30d86cb00a54d6ac4e09e6f28f42d2bd52c 2018-03-05 08:15 +0000 [99b6a14737] Alexander Traud * res_http_post: Enable GMime in NetBSD. ASTERISK-27719 Change-Id: I230c5f9f316b2e9465c093c13580f72ebbaf67a7 2018-03-05 04:16 +0000 [7e9734a858] Alexander Traud * BuildSystem: Enable autotools in NetBSD. ASTERISK-27716 Change-Id: I52525e35e1620341272219911d054a1e3d3ec01e 2018-03-05 03:42 +0000 [b97905aaf2] Alexander Traud * BuildSystem: AC_PATH_PROG sets to colon character when not found. ASTERISK-27715 Reported by: Corey Farrell Change-Id: I0d6d9572d1352dc7ad30c9917173f1e980d8c938 2018-03-03 09:06 +0000 [aabbb49e33] Alexander Traud * chan_unistim: NetBSD has an incompatible struct in_pktinfo. ASTERISK-27714 Reported by: John Nemeth Change-Id: I1b84a89315a5f61222123d21bf35c59224da8990 2018-03-03 08:30 +0000 [5d19762b5f] Alexander Traud * BuildSystem: Cast any intptr_t explicitly to its proposed type. ASTERISK-27713 Change-Id: I90c769e3c7f8c26de8a3af11335862cec15a1b22 2018-03-03 06:56 +0000 [9749524520] Alexander Traud * BuildSystem: Detect whether uselocale(.) is available. ASTERISK-27712 Reported by: Joerg Sonnenberger, D'Arcy Cain Change-Id: Idf1c9d43617a3e13028b95b313415903d80ef807 2018-03-03 03:53 +0000 [f7b845ff41] Alexander Traud * BuildSystem: Avoid re-defining of pthread_* on NetBSD. ASTERISK-27711 Change-Id: Idc9194035b2958b99f6b01eb5b438d45a074565b 2018-03-02 07:05 +0000 [313a9fe255] Alexander Traud * BuildSystem: Install init scripts on openSUSE Tumbleweed. ASTERISK-27710 Change-Id: I4c777e41b31d4415bbe21cb435ad47b43ebb5467 2018-03-02 05:12 +0000 [a9c02e484a] Alexander Traud * BuildSystem: Avoid == for comparison in ./configure. ASTERISK-27709 Reported by: John Nemeth Change-Id: I11b1ae8fd404c04066f1458f5d71f9536359d58d 2018-02-19 19:55 +0000 [c711e4076a] Richard Mudgett * core: Remove ABI effects of MALLOC_DEBUG. This allows asterisk to be compiled with MALLOC_DEBUG to load modules built without MALLOC_DEBUG. Now pre-compiled third-party modules will still work regardless of MALLOC_DEBUG being enabled or not. Change-Id: Ic07ad80b2c2df894db984cf27b16a69383ce0e10 2018-02-27 15:40 +0000 [1a36a452bd] Richard Mudgett * pjproject: Add cache_pools debugging option. The pool cache gets in the way of finding use after free errors of memory pool contents. Tools like valgrind and MALLOC_DEBUG don't know when a pool is released because it gets put into the cache instead of being freed. * Added the "cache_pools" option to pjproject.conf. Disabling the option helps track down pool content mismanagement when using valgrind or MALLOC_DEBUG. The cache gets in the way of determining if the pool contents are used after free and who freed it. To disable the pool caching simply disable the cache_pools option in pjproject.conf and restart Asterisk. Sample pjproject.conf setting: [startup] cache_pools=no * Made current users of the caching pool factory initialization and destruction calls call common routines to create and destroy cached pools. ASTERISK-27704 Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828 2018-01-31 11:48 +0000 [eacee03f0e] Corey Farrell * gitreview: Reorder and add padding. Change-Id: I459dc320a8c9452a01eed6f403d786741587c890 2018-02-23 21:24 +0000 [7b01236028] Michael Cargile * apps/app_amd.c: Fixed total time and silence calculations Between Asterisk 11 and Asterisk 13 there was a significant increase in the number of AST_FRAME_NULL frames being processed by app_amd.c's main loop. Each AST_FRAME_NULL frame was being counted as 100ms towards the total time and silence. This may have been accurate when app_amd.c was orginally added, but it is not in Asterisk 13. As such the total analysis time and silence calculations were way off effectively breaking app_amd.c * Additional debug messages were added * AST_FRAME_NULL are now ignored ASTERISK-27610 Change-Id: I18aca01af98f87c1e168e6ae0d85c136d1df5ea9 2018-02-23 14:58 +0000 [7e2128c8e6] George Joseph * ast_coredumper: Minor fixes * Fix --tarball-config so the option doesn't cause an error. * Allow for missing /etc/os-release. * Add a sleep between tarballing the coredump and removing the output directory to allow the filesystem to settle. Change-Id: I73e03b13087978bcc7f6bc9f45753990f82d9d77 2018-02-22 14:27 +0000 [0be1c388e4] Ben Ford * Add extended properties to rtp_engine for RTP retransmission support. A couple of additional properties are needed in rtp_engine to enable support for packet retransmission: AST_RTP_PROPERTY_RETRANS_RECV and AST_RTP_PROPERTY_RETRANS_SEND. These will both be enabled automatically if an endpoint has the webrtc option enabled. While this adds no functionality currently, it will serve as a building block for future changes for RTP retransmission support. For more information, refer to the wiki page: https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements Change-Id: Ic598acd042a045f9d10e5bdccb66f4efc9e587cc 2018-02-23 10:09 +0000 [a7927471ad] Corey Farrell * core: Fix handling of maximum length lines in config files. When a line is the maximum length "\n" is found at sizeof(buf) - 2 since the last character is actually the null terminator. In addition if a line was exactly 8190 plus a multiple of 8192 characters long the config parser would skip the following line. Additionally fix comment in voicemail.conf sample config. It previously stated that emailbody can only contain up to 512 characters which is always wrong. The buffer is normally 8192 characters unless LOW_MEMORY is enabled then it is 512 characters. The updated comment states that the line can be up to 8190 or 510 characters since the line feed and NULL terminator each use a character. ASTERISK-26688 #close Change-Id: I80864a0d40d2e2d8cd79d72af52a8f0a3a99c015 2018-02-22 13:53 +0000 [bb9c1938a0] Richard Mudgett * res_pjsip_refer.c: Fix attended transfer race condition crash. The transferrer's session channel was destroyed by the transferrer's serializer thread in a race condition with the transfer target's serializer thread during an attended transfer. The transfer target's serializer was attempting to clean up a deferred end status on behalf of the transferrer's channel when it should have passed the action to the transferrer's serializer. When the transfer target's serializer lost the race then both threads wind up trying to end the transferrer's session. * Push the ast_sip_session_end_if_deferred() call onto the transferrer's serializer to avoid a race condition that results in a crash. The session_end() function that could be called by ast_sip_session_end_if_deferred() really must be executed by the transferrer's serializer to avoid this kind of crash. ASTERISK-27568 Change-Id: Iacda724e7cb24d7520e49b2fd7e504aa398d7238 2018-02-17 03:28 +0000 [c4c5d00528] Alexander Traud * install_prereq: Update FreeBSD libraries. deleted autoconf gcc libsamplerate sqlite changed binutils to libbfd freetds-devel to freetds gmime2 to gmime26 mysql55-client to mysql57-client added alsa-lib bison bzip2 cclient corosync doxygen libedit flex graphviz libhoard libical libilbc libltdl lua neon newt net-snmp openldap-client openssl patch pkgconf portaudio postgresql10-client python radcli speexdsp subversion uriparser xmlstarlet libzip ASTERISK-27686 Change-Id: Ibe88c9b26e59c30d26cdb313a3ef01c9f37ac80d 2018-02-22 10:54 +0000 [50d9af101e] Sean Bright * func_audiohookinherit: Remove deprecated module. Change-Id: Id52f719078a65c4b2eee7ab99d761eba6b6aed94 2018-02-21 12:52 +0000 [f083edc43c] Richard Mudgett * manager.c: Fix lseek() parameter order. ASTERISK-27659 Change-Id: I04a2705d2cb7df250769967bc59e2b397a49b797 2018-02-20 13:11 +0000 [39f733406d] Richard Mudgett * bridge_simple.c: Fix stream topology handling. The handling of stream topologies was not protected by channel locks in simple_bridge_request_stream_topology_change(). * Fixed topology handling to be protected by channel locks where needed in simple_bridge_request_stream_topology_change(). ASTERISK-27692 Change-Id: Ica5d78a6c7ecf4f0b95fb16de28d3889b32c4776 2018-02-05 16:46 +0000 [6436137959] Sean Bright * AST-2018-006: Properly handle WebSocket frames with 0 length payload. In ast_websocket_read() we were not adequately checking that the payload_len was non-zero before passing it to ws_safe_read(). Calling ws_safe_read with a len argument of 0 will result in a busy loop until the underlying socket is closed. ASTERISK-27658 #close Change-Id: I9d59f83bc563f711df1a6197c57de473f6b0663a 2018-01-31 13:37 +0000 [880c69f00f] Kevin Harwell * AST-2018-003: Crash with an invalid SDP fmtp attribute pjproject's fmtp retrieval function failed to catch invalid fmtp attributes. Because of this Asterisk would crash if given an SDP with an invalid fmtp attribute. When retrieving the format this patch now makes sure the fmtp attribute is available. If not available it now returns an error status. ASTERISK-27583 #close Change-Id: I5cebe000ce2d846cae3af33b6d72c416e51caf2f 2018-01-31 13:33 +0000 [d3a398cf90] Kevin Harwell * AST-2018-002: Crash with an invalid SDP media format description pjproject's media format parsing algorithm failed to catch invalid values. Because of this Asterisk would crash if given an SDP with a invalid media format description. When parsing the media format description this patch now properly parses the value and returns an error status if it can't successfully parse/convert the value. ASTERISK-27582 #close Change-Id: I883b3a4ef85b6972397f7b56bf46c5779c55fdd6 2018-02-06 12:07 +0000 [758409de56] George Joseph * AST-2018-005: res_pjsip_transport_management: Move to core Since res_pjsip_transport_management provides several attack mitigation features, its functionality moved to res_pjsip and this module has been removed. This way the features will always be available if res_pjsip is loaded. ASTERISK-27618 Reported By: Sandro Gauci Change-Id: I21a2d33d9dda001452ea040d350d7a075f9acf0d 2018-02-06 11:28 +0000 [de871515ba] George Joseph * AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2) pjsip_distributor: authenticate() creates a tdata and uses it to send a challenge or failure response. When pjsip_endpt_send_response2() succeeds, it automatically decrements the tdata ref count but when it fails, it doesn't. Since we weren't checking for a return status, we weren't decrementing the count ourselves on error and were therefore leaking tdatas. res_pjsip_session: session_reinvite_on_rx_request wasn't decrementing the ref count if an error happened while sending a 491 response. pre_session_setup wasn't decrementing the ref count if while sending an error after a pjsip_inv_verify_request failure. res_pjsip: ast_sip_send_response wasn't decrementing the ref count on error. ASTERISK-27618 Reported By: Sandro Gauci Change-Id: Iab33a6c7b6fba96148ed465b690ba8534ac961bf 2018-02-06 11:21 +0000 [c53d8dcb68] George Joseph * AST-2018-005: Add a check for NULL tdata in ast_sip_failover_request It was discovered that there are some corner cases where a pjsip tsx might have no last_tx so calling ast_sip_failover_request with a NULL last_tx as its tdata would cause a crash. ASTERISK-27618 Reported By: Sandro Gauci Change-Id: Ic2b63f6d4ae617c4c19dcdec2a7a6156b54fd15b 2018-02-07 08:09 +0000 [d424850d58] Joshua Colp * AST-2018-004: Restrict the number of Accept headers in a SUBSCRIBE. When receiving a SUBSCRIBE request the Accept headers from it are stored locally. This operation has a fixed limit of 32 Accept headers but this limit was not enforced. As a result it was possible for memory outside of the allocated space to get written to resulting in a crash. This change enforces the limit so only 32 Accept headers are processed. ASTERISK-27640 Reported By: Sandro Gauci Change-Id: I99a814b10b554b13a6021ccf41111e5bc95e7301 2018-01-13 08:04 +0000 [e70c4ec84d] Joshua Colp * AST-2018-001: rtp / channel: Don't allow an unnegotiated format to be passed up. When an RTP packet is received by an RTP engine it has to map the payload into the Asterisk format. The code was incorrectly checking our own static list for ALL payloads if it couldn't find a negotiated one. This included dynamic payloads. If the payload mapped to a format of a different type (for example receiving a video packet on an audio RTP instance) then the core stream code could cause a crash if a legacy channel driver was in use as no stream would be present. To provide further protection the core stream code will no longer assume that a video or audio frame will always have a stream for legacy channel drivers. If no stream is present the frame is dropped. ASTERISK-27488 Change-Id: I022556f524ad8379ee73f14037040af17ea3316a 2018-02-20 13:11 +0000 [e2f98fbd63] Richard Mudgett * channel.c: Fix typo. Change-Id: I4eeedf89085697e81c354eb92d546686c67b0b5b 2018-02-20 10:33 +0000 [259c80675e] Joshua Colp * chan_sip: Emit a second ringing event to ensure channel is found. When constructing a dialog-info+xml NOTIFY message a ringing channel is found if the state is ringing and further information is placed into the message. Due to the migration to the Stasis message bus this did not always work as expected. This change raises a second ringing event in such a way to guarantee that the event is received by chan_sip and another lookup is done to find the ringing channel. ASTERISK-24488 Change-Id: I547a458fc59721c918cb48be060cbfc3c88bcf9c 2018-02-20 04:31 +0000 [0ad13949c1] Corey Farrell * doc/lang/language-criteria.txt: Link to wiki. This document is out of date and is superseded by content on the Asterisk wiki. ASTERISK-24386 #close Change-Id: Idbf95b27b096c205251e1bbb560c79224ba81822 2018-02-19 04:21 +0000 [4b555d7147] Thomas Guebels * res_rtp_asterisk: Fix ICE candidate nomination If the ICE role is not set right away, we might have a role conflict that stays undetected and ICE finishing with successful tests and no candidate nominated. This was introduced by ASTERISK-27088. To avoid this, we set the role as soon as before but only if the ICE state permits it: still checking and not yet nominating candidates or completed. ASTERISK-27646 Change-Id: I5dbc69ad63cacbb067922850fbb113d479bd729c 2018-02-18 10:27 +0000 [8b18247af6] Sean Bright * res_http_websocket: Don't leak memory on read failure Change-Id: Ic449ea832bc81a1671c0e910c5fbe8c683e3da89 2018-02-19 03:57 +0000 [97c21e9cb3] Corey Farrell * core: Rename sounds_index.c to sounds.c. This will make the source filename match the 'module reload sounds' command. This will allow conversion to a built-in module in Asterisk 16 without needing to redefine AST_MODULE. Change-Id: Ifb8e489575b27eb33d8c0b6a531f266670557f6e 2018-02-19 02:49 +0000 [e03f0f9572] Corey Farrell * config: Fix locking for extconfig reload. Expand locking to include full reload process for extconfig to ensure nothing can read the config mappings between clearing and reloading. Change-Id: I378316bad04f1b599ea82d0fef62b8978a644b92 2018-02-15 14:09 +0000 [e4a5c9ccf4] Sean Bright * res_pjsip_header_funcs: Various cleanups * Prefer strcasecmp() over stricmp() * Use a list with no lock since we never actually lock * Minor cleanups to error messages Change-Id: I8446f44795ee8f3072e1c1f9193c6912dfc0c42b 2018-02-17 08:49 +0000 [a70c92121d] Alexander Traud * rtp_engine: Load format name / mime type in uppercase again. This reverts a previous change partly. ASTERISK-27689 Change-Id: Ia3d2f282db6995be8c1c253b5d52f6038761e8af 2018-02-16 17:58 +0000 [525c0251c0] Corey Farrell * BuildSystem: Use single bootstrap.sh for Asterisk and menuselect. This causes the root bootstrap.sh script to generate configure scripts for both Asterisk and menuselect. This ensures that both configure scripts are generated with the same version of autotools and avoids situations where shared autoconf macros get modified without regenerating the menuselect script. Change-Id: I2bfd8537bbb63b3d46b11efabbb15eaaf9ef731a 2018-02-16 13:33 +0000 [65a4084060] Sean Bright * res_pjsip: Endpoint destruction does not free DTLS configuration ASTERISK-27679 #close Reported by: Mak Dee Change-Id: I89a2783a11be0763bf123d1619ed176b6225cf42 2018-02-16 12:42 +0000 [a7e7302ab6] Alexander Traud * install_prereq: Update OpenBSD libraries. deleted jack sqlite renamed freetds-0.63p1-msdblib to freetds mysql-client to mariadb-client added bison bzip2 c-client doxygen e2fsprogs graphviz gsm libical jansson libltdl lua neon net-snmp libsrtp portaudio-svn postgresql-client python speexdsp subversion uriparser xmlstarlet fftw3 libsndfile ASTERISK-27684 Change-Id: I26bdcb0a1d0e484a8dad1052da97f194aefd3370 2018-02-16 12:30 +0000 [14796f529e] Alexander Traud * BuildSystem: Allow newer autotools on OpenBSD. ASTERISK-27683 Change-Id: I5ec9dafbb0c16b6f2740c641980bc2eaaf995624 2017-10-16 07:36 +0000 [976afd26ab] Torrey Searle * contrib/script/sip_to_pjsip: add support for realtime Add a new script that can read from legacy realtime peers & generate an sql file for populating pjsip endpoints, identify, and aor records. ASTERISK-27348 #close Change-Id: Idd3d7968a3c9c3ee7936d21acbdaf001b429bf65 2018-02-16 07:52 +0000 [dda73c5018] Alexander Traud * BuildSystem: Fix a typo related to ./configure --prefix= on OpenBSD. Reported by: Stuart Henderson Change-Id: Ieae8624f48b6ae78cf29930b9a45a3c842c7a764 2018-02-16 05:58 +0000 [5fd59014a5] Alexander Traud * res_calendar: Specialized calendars depend on symbols of general calendar. ASTERISK-27680 Change-Id: Ifb77912e424fe3710a025c18526fada673ec0b79 2018-02-16 06:41 +0000 [c674efa996] Alexander Traud * BuildSystem: Enable IMAP storage on OpenBSD. ASTERISK-27681 Reported by: Stuart Henderson Change-Id: Ifb6b614acb251b695b9417d76510e73eb335b679 2018-02-16 04:50 +0000 [2c814afb86] Alexander Traud * BuildSystem: Enable system provided libedit on OpenBSD. ASTERISK-27677 Change-Id: I0854e3616d1361ae9b6907d3d3444a02784ac62b 2018-02-15 14:30 +0000 [af2dd3a678] Sean Bright * bridge_roles: Use a non-locking linked list where appropriate Also explicitly initialize with the AST_LIST_HEAD_NOLOCK_INIT macro for clarity. Change-Id: I4bc39ec33bc3ff77e1a971a01ace87deb965be3f 2018-02-15 13:29 +0000 [303e43f8a6] Sean Bright * res_pjsip: Use pjsip_sip_uri.user_param instead of other_param There is a dedicated slot in the pjsip_sip_uri for the 'user' parameter, so use that instead of adding to the list of generic URI parameters. Change-Id: I0a0ce8a60ecee27489735bf56fd707719d8c2ed6 2018-02-12 07:37 +0000 [8ac198aff3] Alexander Traud * BuildSystem: Remove chan_h323 leftovers. ASTERISK-27670 Change-Id: I07a8ef8bbd6001e25711fa1bff152eb6c9efa729 2018-01-17 08:17 +0000 [6b6b3ffa5b] Alexander Traud * BuildSystem: Invoke ldconfig with previous path. On OpenBSD, gmake uninstall{-all} registered only libraries from /usr/lib and lost those from /usr/local/lib. Instead, invoke ldconfig on a path. ASTERISK-27595 Change-Id: I4aa2c0b5e07119d1a556f8ff6349eaf09e986888 2017-12-22 15:27 +0000 [9f74afbdcf] Corey Farrell * Deprecate legacy modules. * app_fax (replaced by res_fax). * res_config_sqlite (replaced by res_config_sqlite3). * res_monitor (replaced by app_mixmonitor). This is related to ASTERISK~23657 but does not resolve that ticket. Resolving that ticket would require complete removal of res_monitor. ASTERISK-27671 #close Change-Id: I16a3edd61fc1abd4a7b2e9357693ed663f62dd49 2018-01-28 03:02 +0000 [f9ba31bb21] Alexander Traud * BuildSystem: Do not warn when bash is not installed. ASTERISK-27631 Change-Id: Iefdf268b0b98c3e7d8089ba87cf78136ac1d785b 2018-02-12 22:15 +0000 [9e45d3f893] Corey Farrell * main/asterisk.c: Remove silly usage of RAII_VAR. Change-Id: I7e2996397fbd3c3a6a69dd805c38448ddfc34ae9 2017-12-25 19:32 +0000 [02ee296f81] Corey Farrell * optional_api: Refactor to use vector's and standard allocators. * Replace ad-hoc array management with macro's from vector.h. * Remove redundent logger messages. * Use normal Asterisk allocators instead of directly using libc allocators. * Free memory when an API has no implementation or users. Change-Id: Ic6ecb31798d4a78e7df39ece86a68b60eac05bf5 2018-02-11 15:27 +0000 [8372138cce] Richard Mudgett * chan_sip.c: Fix crash processing CANCEL. Check if initreq data string exists before using it when processing a CANCEL request. ASTERISK-27666 Change-Id: Id1d0f0fa4ec94e81b332b2973d93e5a14bb4cc97 2018-02-06 14:27 +0000 [cb4cfb8c43] Sungtae Kim * manager: Add AMI event Load/Unload Add an AMI events Load and Unload for notify when the module has been loaded and unloaded. ASTERISK-27661 Change-Id: Ib916c41eddd63651952998f2f49c57c42ef87a64 2018-01-30 20:31 +0000 [04490fb1d8] Corey Farrell * json: Add conditionals to avoid locking if Jansson is thread safe. Jansson is thread safe for all read-only functions and reference counting starting v2.11. This allows simplification of our code and removal of locking around reference counting and dumping. Change-Id: Id985cb3ffa6681f9ac765642e20fcd187bd4aeee 2018-02-12 06:16 +0000 [b21915bd1c] Alexander Traud * pjproject_bundled: Disable G.729 from Belledonne Communications. When is installed, PJProject tries to link that. Support for this bcg729 was added with PJProject 2.7. The issue happens, because Teluu enabled that new feature on default. ASTERISK-27584 Reported by: Stuart Henderson Change-Id: I88b6b18ad777bcfe2d8201187b4b90eec0a172a6 2018-02-12 05:38 +0000 [97f45d5816] Alexander Traud * codecs: Add support for WebRTC iLBC 2.0. When the latest version of that library was installed, Asterisk did not build. ASTERISK-27669 Reported by: Николай Михо Change-Id: I27e09bb875fdd56423bd9fae1be85fddb428eb96 2018-02-12 01:26 +0000 [9fddc8b4dc] Corey Farrell * core: Remove embedded editline. This removes the embedded copy of editline from the Asterisk source tree, making a system copy of libedit mandatory in Asterisk 16+. ASTERISK-27634 #close Change-Id: Iedb64ad92acb78419f3caefedaa2bb7cd2a1a33f 2018-01-30 09:58 +0000 [32e610d9e6] Alexander Traud * backtrace: Avoid potential spurious output. clang 4.0 found this via -Wlogical-not-parentheses. ASTERISK-27642 Change-Id: I9ec3e144d425a976c02811bd23cd0c533d2eca4e 2018-02-10 05:39 +0000 [971378bbdb] Alexander Traud * install_prereq: Update Debian/Ubuntu libraries. ASTERISK-27555 Change-Id: Idc36e91db30c0163c560d04c5a82bca5d6ce92a8 2018-02-09 12:06 +0000 [b2fcb30d38] Richard Mudgett * cdr.c: Fix runtime leak of CDR records. Need to remove all CDR's listed by a CDR object from the active_cdrs_all container including the root/master record. ASTERISK-27656 Change-Id: I48b4970663fea98baa262593d2204ef304aaf80e 2018-01-31 17:48 +0000 [67cd90f10d] Richard Mudgett * app_confbridge: ConfbridgeList event has standard channel shapshot headers. * Made the AMI ConfbridgeList action's ConfbridgeList events output all the standard channel snapshot headers instead of a few hand-coded channel snapshot headers. The benefit is that the CallerIDName gets disruptive characters like CR, LF, Tab, and a few others escaped. However, an empty CallerIDName is now output as "" instead of "". ASTERISK-27651 Change-Id: Iaf7d54a9d40194c2db060bc9b4979fab6720d977 2018-01-31 15:45 +0000 [f4b161440b] Richard Mudgett * app_confbridge: Add the Muted header to ConfbridgeJoin AMI event. ASTERISK-27651 Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34 2017-12-19 02:52 +0000 [5b8fea93d1] Oron Peled * chan_console: don't read and write at the same time It seems that the ALSA backend of PortAudio doesn't know how to both read and write at the same time by adding a per-device mutex. FIXME: currently only a draft version. Need to either auto-detect we work with the ALSA backend or add an extra configuration option to use this mutex. ASTERISK-27426 #close Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb 2018-02-02 17:35 +0000 [1017db107c] Richard Mudgett * endpoint identifiers: Some code cleanup. res_pjsip_endpoint_identifier_user.c: * Fix copy/paste error in find_endpoint(). We were using a constant "anonymous" string instead of the passed in endpoint_name when checking the transport domain for an endpoint match. * Eliminate RAII_VAR in find_endpoint(). * Remove always true check in find_transport_state_in_use(). * Remove useless CMD_STOP in find_transport_state_in_use(). res_pjsip_endpoint_identifier_anonymous.c: * Eliminate RAII_VAR in anonymous_identify(). * Remove always true check in find_transport_state_in_use(). * Remove useless CMD_STOP in find_transport_state_in_use(). Change-Id: I86924c31db5bd225ca0c1219c761b668c6f91189 2018-02-02 17:20 +0000 [b71e469d68] Richard Mudgett * res_pjsip/config_domain_aliases.c: Add check for missing domain. What is the point of defining an alias and not saying what is being aliased? Change-Id: I98a892016ed61dcf5efeb6619fd748925103f0be 2018-02-02 15:11 +0000 [0960de71ae] Richard Mudgett * res_pjsip.c: Fix documentation typos. Change-Id: I82ae0b92bfa2ece84a5c684efd9eefdc83ebd068 2018-02-02 15:43 +0000 [bef49d90c1] Richard Mudgett * res_sorcery_realtime.c: Fix ref leak if object failed to apply. Change-Id: I3c7106ff77009754725cee790eadf5da44154ab6 2018-01-24 19:58 +0000 [7e32adf044] Sungtae Kim * manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event * Changed to create ami_event string only when the given blob is not json_null(). * Fixed bad expression. ASTERISK-27621 Change-Id: Ice58c16361f9d9e8648261c9ed5d6c8245fb0d8f 2018-02-01 13:01 +0000 [73f92c2c52] Joshua Elson * res_pjsip_mwi.c: Fix null pointer crash ASTERISK-27652 #close Change-Id: I78a0d38bfd8d0d82830f3d53da04872d6b67284d 2018-02-01 15:03 +0000 [fc98843d4b] Sean Bright * appdocsxml.xslt: Add Language to channel snapshot transformation Change-Id: I8f494b0c895a69b8bc94656d0c6ceebecb0394d8 2018-01-31 15:40 +0000 [3419a048b9] Richard Mudgett * manager.c: Fix potential memory leak and corruption. ast_str_append_event_header() could potentially leak and corrupt memory if the ast_str needed to expand to add the AMI event header. * Fixed to return error if the ast_str_append() failed. Change-Id: I92f36b855540743b208d76e274152ee2d758176d 2018-01-31 17:27 +0000 [bcfe172f8d] Richard Mudgett * manager_channels.c: Reordered ast_manager_build_channel_state_string_prefix() * Made not allocate memory if the channel snapshot is an internal channel. * Free memory earlier when no longer needed. Change-Id: Ia06e0c065f1bd095781aa3f4a626d58fa4d28b38 2018-01-31 12:44 +0000 [4e4428ef3c] Corey Farrell * res_pjsip_registrar_expire: Delete empty module. Verified nothing in the testsuite lists this module as a dependency. Change-Id: I90c7d52c7e15e85fde3389d5eaccb05b97848813 2018-01-30 19:22 +0000 [1ccac0be0e] Richard Mudgett * bridge_softmix.c: Report not talking immediately when muted. Currently in app_confbridge if someone mutes a channel while that channel is talking, the talk detection code is suspended while the channel is muted. As far an an external observer is concerned, the muted channel's talk status is still "talking" even though the channel is not contributing audio to the conference bridge. When the channel is later unmuted, it takes the usual 'dsp_silence_threshold' option time to clear the talking status even though the channel may have stopped talking while the channel was muted. * In bridge_softmix.c, clear the talking status and report talking stopped if the channel was talking when the channel is muted. When the channel is unmuted and the channel is still talking then report the channel as talking since it is contributing audio to the bridge again. ASTERISK-27647 Change-Id: Ie4fdbc05a0bc7343c2972bab012e2567917b3d4e 2018-01-30 15:00 +0000 [b9024197ab] Richard Mudgett * app_confbridge: Update dsp_silence_threshold and dsp_talking_threshold docs. The dsp_talking_threshold does not represent time in milliseconds. It represents the average magnitude per sample in the audio packets. This is what the DSP uses to determine if a packet is silence or talking/noise. Change-Id: If6f939c100eb92a5ac6c21236559018eeaf58443 2018-01-31 11:00 +0000 [6c5e3226ec] Richard Mudgett * res_pjsip_registrar.c: Fix compiler error. Need to include signal.h to define pthread_kill() and SIGURG. Change-Id: I10ae3aa4bf8e7386ac29ade78c0f2caed8e674fa 2018-01-30 23:05 +0000 [60701b3252] Corey Farrell * res_pjsip_session: Prevent crash during shutdown. pjproject does not have a function to reverse pjsip_inv_usage_init. This means we need to ignore any calls to the functions once shutdown is final. ASTERISK-27571 #close Change-Id: Ia550fcba563e2328f03162d79fb185f16b7c9b9d 2018-01-27 13:03 +0000 [720dbb5745] Corey Farrell * core: Create ast_atomic macro's. Create ast_atomic macro's to provide a consistent interface to the common functionality of __atomic and __sync built-in functions. ASTERISK-27619 Change-Id: Ieba3f81832a0e25c5725ea067e5d6f742d33eb5b 2018-01-28 10:10 +0000 [2b9aa6b5bb] George Joseph * res_pjsip_pubsub: Prune subs with reliable transports at startup In an earlier release, inbound registrations on a reliable transport were pruned on Asterisk restart since the TCP connection would have been torn down and become unusable when Asterisk stopped. This same process is now also applied to inbound subscriptions. Also fixed issues in res_pjsip_registrar where it wasn't handling the monitoring correctly when multiple registrations came in over the same transport. To accomplish this, the pjsip_transport_event feature needed to be refactored to allow multiple monitors (multiple subcriptions or registrations from the same endpoint) to exist on the same transport. Since this changed the API, any external modules that may have used the transport monitor feature (highly unlikey) will need to be changed. ASTERISK-27612 Reported by: Ross Beer Change-Id: Iee87cf4eb9b7b2b93d5739a72af52d6ca8fbbe36 2018-01-29 13:46 +0000 [81db0aca0f] George Joseph * res_pjsip_registrar_expire: Refactor into res_pjsip_register res_pjsip_registrar_expire remains as an empty module for now. Change-Id: Ib93698938bae548d2199cb542f3692d1a171239f 2018-01-29 07:51 +0000 [cf21e9fc97] Corey Farrell * Sample modules.conf: comment out example load statement. The sample modules.conf explicitly loaded res_musiconhold.so. This is redundent as autoload=yes is already set. It causes warnings if res_musiconhold.so was not installed and results in an unexpected load if the admin disables autoload without remembering to remove the res_musiconhold load statement. Also remove reference to unknown module pbx_gtkconsole. Change-Id: Ib01888994d9f1364b14d3c9fb6ff96774a6e580a 2018-01-29 10:20 +0000 [913773cd75] Alexander Traud * BuildSystem: Enable autotools in FreeBSD. In the current versions of FreeBSD, the apps of GNU autotools do not need to be called with a version anymore. The latest version can be invoked directly. Additionally, the script ./bootstrap.sh asked for autoconf 2.62 and automake 1.9, versions which are not available as port anymore. ASTERISK-27637 Change-Id: Id7b94b80e78cc943a40ba79b697e3f70019820a7 2018-01-29 10:00 +0000 [156b12340e] Alexander Traud * app_voicemail: Avoid always true when using pointer address. clang 4.0 warned about this. ASTERISK-27635 Change-Id: I213f230607d7fbe97c0f5f2d60da9cbf5a2d8231 2018-01-19 05:13 +0000 [e7f8ef1935] Alexander Traud * install_prereq: Update RHEL/CentOS/Fedora libraries. deleted automake git ncurses-devel pjproject-devel sqlite2-devel libsqlite3x-devel renamed radiusclient-ng-devel to radcli-devel gmime22-devel to gmime-dev added alsa-lib-devel bash binutils-devel bison doxygen flex hoard make pkgconfig speexdsp-devel uriparser-devel uw-imap-devel wget xmlstarlet zlib-devel codec2-devel fftw-devel libsndfile-devel unbound-devel ASTERISK-27599 Reported by: Said Masoud Change-Id: I05bb0af98ae532b2d5f37478e38b8f0762b1c035 2018-01-28 05:20 +0000 [aaf14670b5] Alexander Traud * BuildSystem: Remove unused variables. Because of a copy-and-paste from the script build_tools/download_externals, the script build_tools/list_valid_installed_externals got its local variables. However in the latter, three variables were not used actually. Change-Id: I252de5a98c17ea54459174875357c22c2eebe8d5 2018-01-25 12:06 +0000 [84a6365164] Corey Farrell * loader: Use ast_cli_completion_add for 'module load' completion. This addresses all performance issues with 'module load' completion. In addition to using ast_cli_completion_add we stop using libedit's filename_completion_function, instead using ast_file_read_dir. This ensures all results are produced from a single call to opendir. Change-Id: I8bf51ffaa7ef1606f3bd1b5bb13f1905d72c6134 2018-01-27 09:44 +0000 [d9e42f27b9] Alexander Traud * core: Fix unused variable error in handle_show_sysinfo. The previous fix broke the case HAVE_SYSINFO = no HAVE_SYSCTL = yes HAVE_SWAPCTL = no which occurs on FreeBSD 11.1 for example. ASTERISK-26563 Change-Id: If77c39bc75f0b83a6c8a24ecb2fa69be8846160a 2018-01-27 08:54 +0000 [3c26eec043] Alexander Traud * editline: Avoid shifting a negative signed value. clang 4.0 warned about this. ASTERISK-27630 Change-Id: Ie2725048c661c1792d8b1d498575144350b6e9ba 2018-01-27 03:25 +0000 [c38da18ec6] Alexander Traud * headers: Consistent use of typeof and/or __typeof__. Because of a copy-and-paste error, the Asterisk project was using __typeof instead of typeof. It works because typeof, __typeof, and __typeof__ are supported by GCC, but here the escaped variant was not intended. Therefore, for consistence, we change this to typeof. Change-Id: I2a962c3e596e882f691a19345445b14571a5f07c 2018-01-24 18:25 +0000 [5d320d2d4b] Richard Mudgett * Update sounds release to fix siren7 and siren14 files. ASTERISK-16172 Change-Id: I2fb564258cd4db0f35952ad48b8687355c2dcad3 2018-01-15 11:08 +0000 [6da970bfb9] Alexander Traud * BuildSystem: Raise autoconf version requirement to 2.60a. AC_COMPUTE_INT requires at least autoconf 2.60a. This affects only those who contribute to Asterisk, only those who had to use the script ./bootstrap.sh. Furthermore, this change just makes sure nobody is using a too old autoconf. ASTERISK-16951 Change-Id: Ibca850e2fe0e77d935207bd959bacf7197d7f637 2018-01-26 06:48 +0000 [0afff31ed0] Alexander Traud * install_prereq: Download latest Jansson. ASTERISK-27603 Change-Id: I65c587534c0ae364f063d68da1bed40bb3d5e8aa 2018-01-01 15:59 +0000 [39fcecad59] Corey Farrell * core: Tweak startup order. Move initialization of units which do not require configuration to occur before preload modules. This leaves only units which load config between module preload and regular load stages. Change-Id: I1d15384acad16a22c3498124421af474fa517478 2018-01-25 01:37 +0000 [23381d2c5e] Corey Farrell * Build System: Require __sync or __atomic functions. This change causes the configure script to throw an error if neither __sync nor __atomic builtin functions are available. ASTERISK-27619 Change-Id: Ie01a281e0f5c41dfeeb5f250c1ccea8752f56ef9 2018-01-24 22:44 +0000 [a164b7ccfb] Corey Farrell * loader: Correct overly strict startup checks. The code which handled loading modules had too many situations which would result in halting Asterisk startup. Treat most errors as declines instead of failures. The exception is when the module load function returns AST_MODULE_LOAD_FAILURE or an invalid code. Clear the missingdeps vector when appropriate to ensure the next loop starts clean. ASTERISK-27620 Change-Id: I45547d9641fd45bd86d80250224417625631ad84 2018-01-24 18:49 +0000 [6fbd855228] Corey Farrell * Build System: Add support for __atomic built-in operators. Add a check to configure.ac for __atomic_fetch_add support. If found use the __atomic built-in operators for ast_atomic_dec_and_test and ast_atomic_fetchadd_int. ASTERISK~27619 Change-Id: I65b4feb02bae368904ed0fb03f585c05f50a690e 2017-12-29 02:57 +0000 [527cf5a570] Corey Farrell * Remove redundant module checks and references. This removes references that are no longer needed due to automatic references created by module dependencies. In addition this removes most calls to ast_module_check as they were checking modules which are listed as dependencies. Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e 2018-01-24 10:30 +0000 [b9e35bf6d3] Richard Mudgett * CHANGES: Add AMI action 'PJSIPShowContacts' note. ASTERISK-27581 Change-Id: If6af275764741a11030f0a4fd324fa29b376d74e 2018-01-14 12:33 +0000 [5b8e71ab9f] Sungtae Kim * res_pjsip: Add AMI action 'PJSIPShowContacts' Add an AMI action which provides information on all configured Contacts. ASTERISK-27581 Change-Id: I2eed42c74bbc725fad26b8b33b1a5b3161950c73 2018-01-18 20:19 +0000 [2f78dc2bfa] Richard Mudgett * pbx_variables.c: Misc fixes in variable substitution. * Copy more than one character at a time when there is nothing to substitute. * Fix off by one error if a '}' or ']' is missing. * Eliminated the requirement that the "used" parameter had to point to a variable. The current callers were always declaring a variable to meet the requirement and discarding the value put into that variable. Now it can be NULL. * In ast_str_substitute_variables_full() fixed using the bogus channel to evaluate a function. We were not using the bogus channel we just created to help evaluate a subexpression. Change-Id: Ia83d99f4f16abe47f329eb39b6ff2013ae7c9854 2018-01-18 09:01 +0000 [679fa5fb34] Corey Farrell * Add missing OPTIONAL_API and ARI dependences. I've audited all modules that include any header which includes asterisk/optional_api.h. All modules which use OPTIONAL_API now declare those dependencies in AST_MODULE_INFO using requires or optional_modules as appropriate. In addition ARI dependency declarations have been reworked. Instead of declaring additional required modules in res/ari/resource_*.c we now add them to an optional array "requiresModules" in api-docs for each module. This allows the AST_MODULE_INFO dependencies to include those missing modules. Change-Id: Ia0c70571f5566784f63605e78e1ceccb4f79c606 2018-01-22 09:18 +0000 [140f937c7e] Alexander Traud * res_config_mysql: Avoid the header mysql_version.h. ASTERISK-27607 Change-Id: I23d00ded955c4afd5f2c3c9dc96dcb48b3f74eec 2018-01-05 14:46 +0000 [fd557ad041] Alexander Traud * install_prereq: For PJProject, point users to configure script. The installation script and the new configure option --with-pjproject-bundled aimed to accomplish the same. However, the installation script was out of date. Users should go for the maintained configure option, or the Wiki. ASTERISK-24598 Change-Id: Icbf4b562f81f7c05bd24a3805bd46c0beb4ebd44 2018-01-20 12:58 +0000 [d427bb84a2] Alexander Traud * BuildSystem: Remove AC_CONFIG_AUX_DIR. ASTERISK-27602 Change-Id: I9f4d3d2bc1481748e39ad1e2b0a364d38e38978b 2018-01-19 12:21 +0000 [693e509566] Alexander Traud * BuildSystem: Remove orphaned .PHONY targets. Change-Id: Ic44d75141b9bf99e7d72fcc82ee111b5cf6989d2 2018-01-19 12:14 +0000 [70137794e9] Alexander Traud * BuildSystem: Allow make clean all again. ASTERISK-27600 Reported by: Hamid R. Hashmi Change-Id: I683d14d024650be04074b037b6300464519409f4 2018-01-19 06:16 +0000 [93471373f6] Alexander Traud * install_prereq: Update Debian/Ubuntu libraries. ASTERISK-27555 Change-Id: Ieb41b0cbf968af12882b39454b819ebb48b9ea46 2018-01-19 04:46 +0000 [4c511c1a4d] Alexander Traud * install_prereq: Support package manager DNF and yum option strict=1. This re-enables the script ./contrib/scripts/install_prereq on Fedora 22 and newer, and on RHEL/CentOS when the option strict=1 was set for yum install. ASTERISK-27598 Reported by: Hunter Stevens, Said Masoud Change-Id: I40f9517122aaa6906e8fc0962b4b8008dfddb368 2018-01-09 11:29 +0000 [77f2814d01] Benoît Dereck-Tricot * pbx: Reduce verbosity while loading extensions Each time the dial plan is reloaded, a lot of logs like these are generated: "Added extension 'XXXXX' priority 1 to YYYYYYYYYYY" This patch changes the log level for those logs. ASTERISK-27084 Change-Id: I5662902161c50890997ddc56835d4cafb456c529 2018-01-18 14:55 +0000 [5964061a21] Sean Bright * res_pjsip: Document tlsv1_1 and tlsv1_2 methods Change-Id: I67ed9039bf3f132fb20ee7a750e0aef0f704d7d3 2018-01-08 23:50 +0000 [33d5ab3e69] Igor Goncharovsky * chan_unistim: Fix hold function ability to lock/crash asterisk This patch fix chan_unistim hold functions to correctly support hold function in different states possible in case of multiple lines established on the phone ASTERISK-26596 #close Change-Id: Ib1e04e482e7c8939607a42d7fddacc07e26e14d4 2017-10-29 22:00 +0000 [25cb1ab05b] Corey Farrell * loader: Add support for built-in modules. * Add SRC_EMBEDDED variable to main/Makefile. Built-in module sources must be listed in this variable to ensure they get the correct CFLAGS. Change-Id: I920852bc17513a9c2627061a4ad40511e3a20499 2017-12-09 00:03 +0000 [e6142a1282] Corey Farrell * loader: Rework load_resource_list. Use a single loop in a loop to scan the resource list attempting to dlopen each module. The inner loop is repeated until it doesn't do any work, then it is run one more time to allow printing of error messages. Change-Id: I60c15cd57ff9680b62e2a94c7519401fa4a38e45 2017-12-08 23:30 +0000 [a80cbb046e] Corey Farrell * loader: Remove global symbol only startup phase. Dependency loader is now in place so we no longer need a separate loader phase for global symbols only. This simplifies the loader and allows us to minimize calls to dlopen. Change-Id: I33e3174d67f3b4552d3d536326dcaf0ebabb097d 2017-11-21 23:39 +0000 [3b73ed28c5] Corey Farrell * loader: Process module dependencies. * Add string vectors for requires, optional_apis and enhances. * Add reffed_deps module vector for holding references to dependencies. * Initialize string vectors after final dlopen of each module. * Free string vectors and clear references from reffed_deps in module_destroy. * Create functions necessary to process module dependencies and enforce load order. Module dependencies result in automatic references being managed by the module loader. This enforces unload order. Change-Id: I9be08d1dd331aceadc1dcba00b804d71360b2fbb 2017-12-27 17:44 +0000 [86b484dec7] Graham Mainwaring * app_followme: Add a prompt to be read when a call is connected This patch adds the ability to configure a prompt which will be read to the "winner" who pressed 1 (or the configured value) and received the call. ASTERISK-24372 #close Change-Id: I6ec1c6c883347f7d1e1f597189544993c8d65272 2018-01-17 00:28 +0000 [4fd303b630] Corey Farrell * loader: Miscellaneous fixes. * Remove comment about lazy load. * Improve message about module already being loaded and running. * Handle allocation error in add_to_load_order. * Dead code elimination from modules_shutdown. Change-Id: I22261599c46d0f416e568910ec9502f45143197f 2018-01-17 08:36 +0000 [2a1b52cc67] Alexander Traud * BuildSystem: Use the detected name for MD5 everywhere. Affacted the (automatic) download script for external modules: ./build_tools/download_externals ASTERISK-27596 Change-Id: If4c3176f7bf58df32fec6e02a659f1a78d57cf4b 2018-01-17 07:11 +0000 [4cd3f5c162] Alexander Traud * BuildSystem: Invoke install not in GNU but POSIX style. ASTERISK-27594 Change-Id: Iaaa6a19d2fe031dffcba441d0502a7ea65c93cb3 2018-01-17 06:47 +0000 [7e7a20642c] Alexander Traud * BuildSystem: In OpenBSD, xmlstarlet is xml. ASTERISK-27593 Change-Id: I1c7087f7f7582e40b3312c690d912c9a86466805 2018-01-17 02:51 +0000 [8f31b70246] Alexander Traud * BuildSystem: Detect external library Lua in version 5.3. On some platforms, you decide to go for one specific version of Lua, for example in OpenBSD. On other platforms, you are able to install several versions side-by-side, for example in Ubuntu and Fedora. Asterisk already works with Lua 5.3. Asterisk failed to detect Lua 5.3 on those platforms which allow several versions. ASTERISK-27592 Change-Id: If7a4b395d844a464e9a1f4f626c5bff4ee67eed8 2017-12-22 19:50 +0000 [8494e78010] Richard Mudgett * res_pjsip: Split type=identify to IP address and SIP header matching priorities The type=identify endpoint identification method can match by IP address and by SIP header. However, the SIP header matching has limited usefulness because you cannot specify the SIP header matching priority relative to the IP address matching. All the matching happens at the same priority and the order of evaluating the identify sections is indeterminate. e.g., If you had two type=identify sections where one matches by IP address for endpoint alice and the other matches by SIP header for endpoint bob then you couldn't predict which endpoint is matched when a request comes in that matches both. * Extract the SIP header matching criteria into its own "header" endpoint identification method so the user can specify the relative priority of the SIP header and the IP address matching criteria in the global endpoint_identifier_order option. The "ip" endpoint identification method now only matches by IP address. ASTERISK-27491 Change-Id: I9df142a575b7e1e3471b7cda5d3ea156cef08095 2018-01-16 08:32 +0000 [7ed7d525fb] Richard Mudgett * taskprocessor.c: Increase the number of tps_singletons container buckets. Since v12 the number of taskprocessors in the system has increased a lot. Small systems can easily have over a hundred and larger systems can have thousands. Most uses of the tps_singletons container deal with creating and destroying the taskprocessors. However, the pjsip distributor looks up taskprocessors/serializers by name frequently. It needs to find the serializer for incoming SIP responses to distribute them to the appropriate serializer. Change-Id: Ice0603606614ba49f7c0c316c524735c064e7e43 2018-01-16 08:20 +0000 [f0a3c977d6] George Joseph * pjproject_bundled: Prevent crash on bad outgoing header We still need to figure out how a bad header is getting into the outgoing message but this patch to pjproject prevents attempting to print that header and causing a crash. For several users, this crash happens when sending 183 progress messages. ASTERISK-26832 Reported by: Ross Beer, Jan Rozhon Change-Id: Ie5c5a921c890c843587763e7f33f987dfe66bd16 2018-01-16 06:34 +0000 [a046305fae] Alexander Traud * BuildSystem: Avoid $EUID and use id -u instead. Makefile included a call to ${EUID} which requires the shell bash. To keep compatibility with other shells like dash or ksh, use id -u instead. ASTERISK-27589 Change-Id: Ia6e74f5bc9aab4e6dc62b7439f647b7964e6f657 2018-01-15 18:03 +0000 [6fbe315f77] Richard Mudgett * cel_odbc.c: Fix menuslect module description display. Asterisk's makefile for menuselect has a very simple source file parsing script that looks for AST_MODULE_INFO lines to extract the quoted string as a module description. If it does not find a quoted string it uses the whole line as the description. Change-Id: I80f13a63818e4e28d683639a94a4dfaea405c1d5 2017-11-19 16:30 +0000 [9cfdb81e91] Corey Farrell * loader: Add dependency fields to module structures. * Declare 'requires' and 'enhances' text fields on module info structure. * Rename 'nonoptreq' to 'optional_modules'. * Update doxygen comments. Still need to investigate dependencies among modules I cannot compile. Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf 2017-11-19 20:10 +0000 [35ae99c712] Corey Farrell * vector: Additional string vector definitions. ast_vector_string_split: This function will add items to an ast_vector_string by splitting values of a string buffer. Items are appended to the vector in the order they are found. ast_vector_const_string: A vector of 'const char *'. Change-Id: I1bf02a1efeb2baeea11c59c557d39dd1197494d7 2018-01-15 10:57 +0000 [645297614e] Alexander Traud * BuildSystem: Resolve resolv.h not via Generic but Particular Header-Check. ASTERISK-27585 Change-Id: I27c67563788e6f67eeda5fb51a741823a50a95e2 2018-01-13 13:49 +0000 [cabe80631b] George Joseph * config_transport: Enable TCP_NODELAY on TLS transports We did this for TCP transports already but I'm not sure why we didn't do it for TLS transports. ASTERISK_27474 #not_final_fix Change-Id: I5b1ef4b882f7b859e718236686b7898751dbb262 2018-01-12 18:37 +0000 [de7f2a6cb4] Corey Farrell * res_stasis_recording: Allow symbolic links in configured recordings dir. If any component of ast_config_AST_RECORDING_DIR is a symbolic link we would incorrectly assume the ARI user was trying to escape the recording path. Create additional check to check the recording directory's realpath, only deny access if both do not match. This is needed by the testsuite when run by 'run-local'. Change-Id: I9145e841865edadcb5f75cead3471ad06bbb56c0 2018-01-12 12:00 +0000 [99535b0497] Corey Farrell * menuselect: Remove unused dev-mode option TRACE_FRAMES. ASTERISK-27575 #close Change-Id: Ica3a522892afed7a96816a5ecf140e1671f46ad4 2018-01-12 03:50 +0000 [eb9b85baec] Alexander Traud * res_config_pgsql: Avoid typecasting an int to unsigned char. clang 5.0 warned about this. ASTERISK-27576 Change-Id: If41f400a51973c06cdb9b75462e535b616bfe385 2018-01-12 03:17 +0000 [cff3add680] Alexander Traud * BuildSystem: Really do not pass unknown-warning options to the compiler. When an older GCC version is called with a too new warning option, GCC exited with an error and Asterisk was not built. Therefore, the configure script tests the installed compiler whether it supports that warning option. If not, Asterisk does not pass it to the installed compiler. However, some compilers (like clang) do not exit (error) but give just a warning in such a case. Because the compiler did not exit, Asterisk passed the unknown-warning option. ASTERISK-27560 Change-Id: Ia9d148e689c173df4e91699113605dab2de36038 2018-01-12 04:27 +0000 [685bab254c] Alexander Traud * app_osplookup.c: Avoid two format truncations. GCC 7 warned about this. ASTERISK-27578 Change-Id: I4a00458dbe9b575ef04338b6a7852272745e1552 2018-01-12 04:03 +0000 [797747afa7] Alexander Traud * chan_ooh323: Avoid typecasting an int to unsigned short. clang 5.0 warned about this. ASTERISK-27577 Change-Id: I898fe4255023138a9e8b579fe4482fcf582f2b78 2018-01-05 15:13 +0000 [b9e2b72de6] Alexander Traud * install_prereq: Update Debian/Ubuntu libraries. ASTERISK-27555 Change-Id: I0818b6e42631be1b69237e2b41d3415275693e53 2018-01-11 12:05 +0000 [6d5f4768a4] Joshua Colp * chan_sip: Check that an iostream exists before accessing. Before getting the file descriptor for an iostream check that it is present. ASTERISK-27534 Change-Id: Ie0aa1394007a37c30e337ea1176a6fb3a63bc99c 2018-01-11 08:09 +0000 [30b5ec023f] Tzafrir Cohen * Ignore quilt .pc directory, used in deb packaging Debian packaging uses quilt to manage patches. Book-keeping for them is done using quilt (either directly, or in a compatible format), and tracked in the directory .pc . Change-Id: I22c90f3d7ab8918e6216e7b686de6fa0e1fdaa7b Signed-off-by: Tzafrir Cohen 2018-01-09 11:23 +0000 [f0eb00d1e7] Corey Farrell * stasis: Remove silly usage of RAII_VAR. Change-Id: Ib11193531e797bcb16bba560a408eab155f706d1 2018-01-09 11:09 +0000 [a383e1ddb1] Corey Farrell * stasis_cache_pattern: Remove silly usage of RAII_VAR. Change-Id: Ic98a51f555062cd863b6db3f8d76065943a9dea3 2018-01-09 16:23 +0000 [9e2fcb82ed] Sean Bright * cdr_syslog: Deprecate unmaintained module There has been an open issue against cdr_syslog (ASTERISK~14441) about a race condition for 7.5 years that has never been addressed. Because this module is effectively unmaintained and currently broken, there is no sense in keeping it around. If logging CDRs to syslog is a desirable feature, it would probably be better to write the logs directly to the syslog server via socket instead of using the facilities provided by openlog/syslog/closelog. Doing so would address the race condition referenced in the associated issue. Change-Id: Ic77b94cd97f355a9cf5b1d3f3444964a6e0ba5dc 2018-01-09 11:16 +0000 [0de004dd85] Corey Farrell * stasis_bridges: Remove silly usage of RAII_VAR. Change-Id: I0fa7ab05454f183dc4ff10e26d18776d2b0fcf1f 2018-01-09 11:10 +0000 [01127e1664] Corey Farrell * stasis_cache: Remove silly usage of RAII_VAR. Change-Id: Ifa95e5801c949df296c7e4376347730fb0ed52ef 2018-01-09 10:57 +0000 [175a9ef873] Corey Farrell * stasis_endpoints: Remove silly usage of RAII_VAR. Change-Id: Ic099dc552f36c353c89783a4bcfd09f010432733 2018-01-09 10:55 +0000 [4b655184b0] Corey Farrell * stasis_message_router: Remove silly usage of RAII_VAR. Change-Id: I50d6ae230920e0b878ed9cc8f79eef746e06701d 2018-01-09 10:53 +0000 [3074c4165c] Corey Farrell * stasis_system: Remove silly usage of RAII_VAR. Change-Id: Iedbe5656cee68cd3a96a953558764aa02d4a0c3b 2018-01-03 17:26 +0000 [8f3167c5f1] Richard Mudgett * res_pjsip.c: Update the endpoint identification documentation. * Endpoint identify_by documentation. * IP/Header endpoint identifier documentation. Change-Id: Id92f00b495acca7be945daf749d2abd7f76a0b5a 2018-01-03 15:20 +0000 [42a61d9db6] Richard Mudgett * res_pjsip_endpoint_identifier_ip.c: Remove unnecessary requirement. The requirement that "ip" must be in the endpoint identify_by list to allow the type=identify method to identify the endpoint is not necessary. The "ip" identifier method can match one and only one endpoint. To even work, the "ip" identifier method configuration must explicitly specify the identified endpoint. Therefore, why bother configuring the type=identify identifier in the first place? The requirement only adds the potential for configuration errors for no benefit. Even worse, those configuration errors cannot be detected when the configuration loads. The requirement was introduced with the ASTERISK_27206 patch. * Remove the code change that enforces the requiremnt. Listing the "ip" method in the identify_by value is simply documentation. Change-Id: Ia057f92a33fb5d9f51dc5d5692e3d5ee1a6f2c11 2018-01-05 19:03 +0000 [a7bbb18e5c] Richard Mudgett * res_pjsip.c: Fix ident_to_str() and refactor ident_handler(). * Extracted sip_endpoint_identifier_type2str() and sip_endpoint_identifier_str2type() to simplify the calling functions. * Fixed pjsip_configuration.c:ident_to_str() building the endpoint's identify_by value string. Change-Id: Ide876768a8d5d828b12052e2a75008b0563fc509 2018-01-04 17:04 +0000 [be488eb14a] Richard Mudgett * res_pjsip_endpoint_identifier_ip.c: Allow multiple IdentifyDetail AMI events. The AMI PJSIPShowEndpoint action could only list one IdentifyDetail AMI event per endpoint. However, there is no reason that multiple type=identify sections cannot identify the same endpoint. * Reworked format_ami_endpoint_identify() to generate as many IdentifyDetail AMI events as there are matching identifiers. Change-Id: Ie146792aef72d78e05416ab5b27bc552a30399db 2018-01-05 05:51 +0000 [3a7d917256] Alexander Traud * translate: Avoid absolute value on unsigned substraction. ast_format_get_sample_rate(.) returns an unsigned type. The difference of a substraction between two unsigned types does not get implicitly converted to a signed type. Therefore, using abs(.) did not make sense. ASTERISK-27549 Change-Id: Ib904d9ee0d46b6fdd1476fbc464fbbf813304017 2018-01-09 08:22 +0000 [25022de875] Sean Bright * Revert "codec_opus: Make libcurl a dependency in menuselect" This reverts commit 028f4320de60a204e457ad606ab0a3318493b431. Change-Id: Ieb91f825cb55202a937f5361c01d356e7662b70c 2018-01-08 10:54 +0000 [a21841bf40] Joshua Colp * res_pjsip_session: Always bundle streams if WebRTC is enabled. Some WebRTC clients can't handle renegotiation with the addition of streams that include an offer to bundle. They instead expect the newly added streams to already be bundled. This change does such a thing if WebRTC support is enabled on an endpoint. ASTERISK-27566 Change-Id: I7fe9b7ac35a2798627d9c2c8369129f407af6461 2018-01-08 20:25 +0000 [d46cbe788a] Corey Farrell * bridge_softmix: Fix sfu_append_source_streams test. * validate_stream: zero result from ast_format_cap_identical indicates they are not identical, rather than non-zero indicating an error. * validate_original_streams: use num_streams instead of ARRAY_LEN(params). * Fix declaration of alice_dest_stream and bob_dest_stream. Change-Id: I6b1dd8bed10439d3c7406f033eb1896b6c419147 2018-01-08 18:47 +0000 [5380fb9978] Corey Farrell * app_confbridge: Fix NULL check in action_kick_last. The check for last_user == NULL needs to happen before we dereference the variable, previously it was possible for us to check flags of a NULL last_user. Change-Id: I274f737aa8af9d2d53e4a78cdd7ad57561003945 2018-01-06 02:17 +0000 [55a540272f] Corey Farrell * res_stasis: Reduce RAII_VAR usage. In addition to being a micro-optimization (RAII_VAR has overhead), this change improves output of REF_DEBUG. Unfortunately when RAII_VAR calls ao2_cleanup it does so from a generated _dtor_varname function. For example this caused _dtor_app to release a reference instead of __stasis_app_unregister. Change-Id: I4ce67120583a446babf9adeec678b71d37fcd9e5 2018-01-04 18:47 +0000 [faeb9e1b26] Sungtae Kim * res_pjsip: Add AMI action 'PJSIPShowAuths' Add an AMI action which provides information on all configured Auths. ASTERISK-27547 Change-Id: I1a88a75b38a2b1dd9d1de6c0307b20a3f584c817 2018-01-07 21:38 +0000 [8b3083cac5] Corey Farrell * res_stasis: Fix dial bridge unload. If the dial bridge has been created it must be released by calling ast_bridge_destroy, simply releasing the ao2 reference is not enough. Also move stasis_app_control_shutdown earlier in unload to ensure the bridge cannot be created or grabbed after the app_bridges container is released. Change-Id: I372302de94ca63876069e2585a049c5060e5e767 2018-01-07 20:21 +0000 [6870ba5f26] Corey Farrell * res_stasis: Fix app_is_subscribed_bridge_id. Instead of searching for bridge_id provided in an argument this function always searched for BRIDGE_ALL first. Rewrite this function to work like the similar functions for channel and endpoint functions. Change-Id: Ib5caca69e11727c5c8a7284a1d00621f40f1e60a 2018-01-05 07:44 +0000 [7e9781c25e] Alexander Traud * General: Silence modules on (un)load. Some (normally optional) modules created notices, warnings, and even errors in normal situations like (un)load. This cluttered the command-line interface (CLI) on start and while stopping gracefully. However, when an user went for the script './contrib/scripts/install_prereq', those modules get compiled-in because their prerequisites were met at compile time. Furthermore, because of ASTERISK_27475, the former talkative module 'res_curl' is built as side-effect. ASTERISK-27553 Change-Id: I9f105f46d72553994e820679bfde3478a551b281 2018-01-06 15:40 +0000 [512286e3c8] Alexander Traud * BuildSystem: Really do not pass unknown-warning options to the compiler. When an older GCC version is called with a too new warning option, GCC exited with an error and Asterisk was not built. Therefore, the configure script tests the installed compiler whether it supports that warning option. If not, Asterisk does not pass it to the installed compiler. However, some compilers (like clang) do not exit (error) but give just a warning in such a case. Because the compiler did not exit, Asterisk passed the unknown-warning option. ASTERISK-27560 Change-Id: Ia9b7747f649b27ff5e9f75c3db3fee4fe7a29621 2018-01-06 01:25 +0000 [f84fcc1fc1] Alexander Traud * General: Avoid implicit conversion to char when changes value to negative. clang 5.0 warned about this. ASTERISK-27557 Change-Id: I7cceaa88e147cbdf81a3a7beec5c1c20210fa41e 2018-01-05 06:06 +0000 [b12c8cffad] Alexander Traud * bridge_softmix: Removed unused parameter from check_binaural_position_change(.). Found as a result of the function being passed an uninitalized variable by clang. ASTERISK-27550 Change-Id: I8af3bd84656b685a956d498459f8db3613f68954 2018-01-06 06:45 +0000 [ad3252ccef] Alexander Traud * editline: Avoid comparison between pointer and zero character constant. gcc 7.2 warned about this. ASTERISK-27559 Change-Id: I48960dda9cf0a11b6a9426f775e632363f8caa74 2018-01-06 05:01 +0000 [ef68df9111] Alexander Traud * codec_gsm: Avoid shifting a negative signed value. clang 5.0 warned about this. ASTERISK-27558 Change-Id: Icc452ecb0d86bbeba78dae768cc472ec540699df 2018-01-04 12:23 +0000 [b20b5758d9] Richard Mudgett * res_pjsip_endpoint_identifier_ip.c: Fix apply identify validation. The ip_identify_apply() did not validate the configuration for simple static configuration errors or deal well with address resolution errors. * Added missing configuration validation checks. * Fixed address resolution error handling. * Demoted an error message to a warning since it does not fail applying the identify object configuration. Change-Id: I8b519607263fe88e8ce964f526a45359fd362b6e 2018-01-04 17:42 +0000 [705e6c04b3] Richard Mudgett * res_pjsip.c: Fix endpoint identifier registration name search. If an endpoint identifier name in the endpoint_identifier_order list is a prefix to the identifier we are registering, we could install it in the wrong position of the list. Assuming endpoint_identifier_order=username,ip,anonymous then registering the "ip_only" identifier would put the identifier in the wrong position of the priority list. * Fix incorrect strncmp() string prefix matching. Change-Id: Ib8819ec4b811da8a27419fd93528c54d34f01484 2018-01-05 03:33 +0000 [af064eaf13] Alexander Traud * BuildSystem: Find ptlib-config on Debian/Ubuntu. The current configure script requires that tool when libpt-dev is installed. libpt-dev was installed by libopenh323-dev, bacause you wanted to go for H.323 based channel drivers. ASTERISK-25329 Change-Id: I9c6ab78b7246c21536e1d252dcbffe682f63f83d 2018-01-05 06:42 +0000 [f0c8f04c73] Alexander Traud * chan_ooh323: Limit outgoinglimit to positive values as intended. ASTERISK-27552 Change-Id: Ifbf9d51e7374ca2e8b27ec568f6770050fc1a854 2018-01-05 06:19 +0000 [09f339bda5] Alexander Traud * ooh323cDriver: Fix typo in header guard. ASTERISK-27551 Change-Id: I39ff66031e3373e895e2bc47b23a5e860ea4e012 2018-01-05 03:36 +0000 [bc1b4f4d43] Alexander Traud * BuildSystem: Avoid obsolete warning with HELP_STRING on autoconf. ASTERISK-26046 Change-Id: I48f05698c235f709225b92bec5aa260fb57d69d1 2018-01-04 15:37 +0000 [cfb88f3ac1] Corey Farrell * pbx: Prevent execution of NULL pointer. pbx_extension_helper has a check for q->swo.exec == NULL but it doesn't actually return so we would still run the function. Fix the return. Move the 'int res' variable into the only scope which uses it. Also fix a copy-paste error in ast_pbx_init which could result in a crash on allocation failure (we exit with a normal error instead). Change-Id: I0693af921fdc7f56b6a72a21fb816ed08b960a69 2018-01-04 10:50 +0000 [82cf585fb5] Corey Farrell * translators: Don't use ast_module_running_ref. Translators are run during module load before the module is actually running, so it cannot use ast_module_running_ref. ASTERISK-20346 Change-Id: Iaa0e75da99c696e38000f1a41e340abbd7a88f56 2018-01-04 09:39 +0000 [da365affbd] Corey Farrell * rtp_engine: Add missing unlock. Change-Id: I380c31a255e060309f4916da11176e0d00813215 2018-01-04 09:30 +0000 [73bf5035b8] Corey Farrell * res_pjsip_history: Add missing unlock to CLI command. Change-Id: I872060a30543776a176a316309602d924a23eb29 2018-01-04 09:27 +0000 [aaed0b8b3a] Corey Farrell * aco: Fix NULL dereference in error path. Change-Id: Id505167cf0f9414a3c144fa2c1e181a2cf288694 2018-01-03 19:07 +0000 [e3c9314a2e] Corey Farrell * func_odbc: Add missing unlock's to acf_odbc_read. Change-Id: I828329ecbd252ae8f27a369a046d2b03102b07c6 2017-12-29 18:24 +0000 [55f1d69c43] Corey Farrell * loader: Create ast_module_running_ref. This function returns NULL if the module in question is not running. I did not change ast_module_ref as most callers do not check the result and they always call ast_module_unref. Make use of this function when running registered items from: * app_stack API's * bridge technologies * CLI commands * File formats * Manager Actions * RTP engines * Sorcery Wizards * Timing Interfaces * Translators * AGI Commands * Fax Technologies ASTERISK-20346 #close Change-Id: Ia16fd28e188b2fc0b9d18b8a5d9cacc31df73fcc 2018-01-03 10:41 +0000 [62f862e2cd] Kevin Harwell * res_pjsip_session: Check if sequence header is missing The pjsip_msg_find_hdr function can return NULL. This patch adds a check when searching for the sequence header to make sure a NULL pointer is never de-referenced. Change-Id: I19af23aeeded65be016be92360e8cb7ffe51fad2 2018-01-02 07:36 +0000 [9b5d1454b4] Tzafrir Cohen * cdr: submit: fix logic of test for batch mode ASTERISK-27539 #close Change-Id: I33cdf329d2bb4486dcae975c450f6aae94c515f7 2017-12-29 23:14 +0000 [ffbf5be116] Sungtae Kim * res_pjsip: Add AMI action 'PJSIPShowAors' Add an AMI action which provides information on all configured AORs. ASTERISK-27537 Change-Id: If8b990a00909e5b6c0f04a3b8dccd9903dc445eb 2018-01-02 00:26 +0000 [f298178583] Corey Farrell * aco: Add missing aco_option_type_string for OPT_TIMELEN_T. ASTERISK-27117 Change-Id: I8f6c34bb30830be9f7a40823723eb4dcaaa91c61 2017-12-31 10:26 +0000 [15f8b9b8bf] Sean Bright * ice: Increase foundation buffer size Per RFC 5245, the foundation specified with an ICE candidate can be up to 32 characters but we are only allowing for 31. ASTERISK-27498 #close Reported by: Michele Prà Change-Id: I05ce7a5952721a76a2b4c90366168022558dc7cf 2017-12-29 22:03 +0000 [b32d6d5e2d] Corey Farrell * astobj2: Create case-insensitive variants of container function macros. * AO2_STRING_FIELD_CASE_HASH_FN * AO2_STRING_FIELD_CASE_CMP_FN * AO2_STRING_FIELD_CASE_SORT_FN Change-Id: I11af8c6a0c43380a42732553f519c667abb842cf 2017-12-29 22:59 +0000 [bc73337e07] Corey Farrell * core: Use macros to generate ao2_container callbacks where possible. This uses AO2_STRING_FIELD_HASH_FN and AO2_STRING_FIELD_CMP_FN where possible in the Asterisk core. This removes CMP_STOP from the result of CMP_FN callbacks for the following structure types: * ast_bucket_metadata * ast_bucket_scheme * generic_monitor_instance_list (ccss.c) * ast_bucket_file (media_cache.c) * named_acl Change-Id: Ide4c1449a894bce70dea1fef664dade9b57578f1 2017-12-29 14:50 +0000 [0fe7df641a] Corey Farrell * datastore: Add automatic module references. Add a reference to the calling module when it is active to protect access to datastore->info. Remove module references done by func_periodic_hook as the datastore now handles it. ASTERISK-25128 #close Change-Id: I8357a3711e77591d0d1dd8ab4211a7eedd782c89 2017-12-28 13:27 +0000 [2dde5bef47] Richard Mudgett * stasis_channels.c: Misc cleanup. * Use current OBJ_SEARCH_xxx defines instead of the deprecated versions. * Fix hash_cb and cmp_cb container functions to correctly use the OBJ_SEARCH_xxx values. * Remove incorrect usage of CMP_STOP. Most uses in the system have no effect. This allows the collapse of channel_role_single_cmp_cb() and channel_role_multi_cmp_cb() into channel_role_cmp_cb(). * Remove unnecessary usage of RAII_VAR(). Change-Id: I02c405518cab22aa2a082b61e2353bf7cd629a70 2017-12-13 15:43 +0000 [898b3b080a] Sean Bright * cdr_mysql: Make sure connection charset is always set When the MYSQL_OPT_RECONNECT option is enabled, the MySQL client API will transparently reconnect when it needs to. Ideally this simplifies our code, but when this reconnection occurs all connection state is lost. Because we are not notified that this has happened, we don't know to set our character set again (with "SET NAMES 'xyz'"). Rather than calling SET NAMES, we instead set the MYSQL_SET_CHARSET_NAME option which will do it for us under the hood on each connect. This option has been present in the MySQL C API for at least 15 years, so it should be safe for most installations. I also snuck a few other changes into this patch: * Default the MySQL port to MYSQL_PORT (3306) instead of 0 if it's not defined. * Fix some erroneous and/or silly checks on the contents of the configuration ast_str values. ASTERISK-27366 #close Reported by: Halil İbrahim YILDIZ Change-Id: I36bf8dc5d5f83584e803b3b1a151dea9396ab8f5 2017-12-27 20:48 +0000 [d69b7c6c6d] Richard Mudgett * manager.c: Update AMI Status event documentation The AMI Status event had linkedid listed twice and was missing the effective connected line name and number headers. NOTE: The linkedid and other standard channel snapshot fields in the XML documentation are part of the XML template defined in doc/appdocsxml.xslt. Change-Id: I004c4c4f9e7b40ef55035c831702721bec82496c 2017-12-27 22:36 +0000 [fa36f9c01b] Richard Mudgett * bridge_native_rtp.c: Fix reentrancy framehook crash. If two channels enter different native rtp bridges at the same time it is possible that the framehook interface data pointer can be corrupted because the struct variable was declared static. * Fixed the reentrancy corruption by changing the framehook interface struct static variable to a stack local variable. * Moved the hook.data assignment outside of the channel lock. It did not need the lock's protection. It probably was giving a false sense of security. The testsuite channels/pjsip/basic_calls/two_parties/nominal/alice_initiated/bob_hangs_up test caught this with MALLOC_DEBUG and DO_CRASH enabled. Change-Id: If9e35b97d19209b0f984941c1d8eb5f7c55eea91 2017-12-27 20:22 +0000 [1d3dc9aea2] Richard Mudgett * func_channel.c: Update MASTER_CHANNEL documentation Be more explicit in what is meant by the master channel to eliminate misunderstanding. ASTERISK-23133 Change-Id: I453bcaf4b99404a5a3e345dbf093ac6c1afcfc72 2017-12-27 19:27 +0000 [6338a03ce9] Corey Farrell * menuselect: Fix check for running configure. menuselect/Makefile checks that autoconfig.h and makeopts were newer than the '.in' files. Unfortunately running ./configure does not touch autoconfig.h unless the contents will change. Instead of looking at autoconfig.h we just need to ensure that makeopts is newer than configure. Also make change to configure.ac so bootstrap.sh doesn't re-add the extra trailing line-feed. Change-Id: Ief1f831d6717007f9cebb668c14e92782cd2b794 2017-12-21 23:56 +0000 [94eb12ca56] Corey Farrell * cdr: Missing NULL check and unlock. * handle_dial_message: Missing a check for NULL peer. * cdr_generic_register: Missing unlock on allocation failure. cdr_generic_register is fixed by reordering so the new structure is allocated and initialized before locking the list. Change-Id: I5799b99270d1a7a716a555c31ac85f4b00ce8686 2017-12-23 22:51 +0000 [23aa20bf20] Corey Farrell * loader: Add volatile to resource_being_loaded. Some compiler optimizers seem to assume that dlopen will not use __attribute__((constructor)) functions to call back to the program. This was causing resource_being_loaded to be optimized away completely. ASTERISK-27531 #close Tested By: abelbeck Change-Id: If17a3b889e06811a0e7119f0539d052494d6ece9 2017-12-20 16:17 +0000 [553306548c] Kevin Harwell * AST-2017-014: res_pjsip - Missing contact header can cause crash Those SIP messages that create dialogs require a contact header to be present. If the contact header was missing from the message it could cause Asterisk to crash. This patch checks to make sure SIP messages that create a dialog contain the contact header. If the message does not and it is required Asterisk now returns a "400 Missing Contact header" response. Also added NULL checks when retrieving the contact header that were missing as a "just in case". ASTERISK-27480 #close Change-Id: I1810db87683fc637a9e3e1384a746037fec20afe 2017-12-22 14:00 +0000 [c2529a352c] Corey Farrell * astobj.h: Remove from Asterisk core. This is the old ASTOBJ macro's which are no longer used except by the deprecated netsock.c. Move it to the chan_iax2 include folder so it does not get used elsewhere. Change-Id: I7e4ae96678b36b9f41d3cae14b167f110eb5d349 2017-12-22 08:23 +0000 [fd0ca1c3f9] Sean Bright * Remove as much trailing whitespace as possible. Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0 2017-12-21 09:51 +0000 [a1a179c09d] Sean Bright * Fix some invalid Unicode characters configs/samples/minivm.conf.sample contains invalid UTF-8, but that appears to be intentional. Change-Id: I7b1e0d332f3380fd0425962a3c9c55f9b200c8cc 2017-12-20 21:11 +0000 [f2f51ff4ea] Corey Farrell * app_voicemail: Fix file copy error handling. Fix error where input/output file descriptors would be closed multiple times. Change-Id: Iba5140b60cb7de79e3d5d92be3c256947aa99da9 2017-12-20 14:54 +0000 [9415ec2877] Sean Bright * docs: Remove old API changes documentation Change-Id: I1bc7957121cc7ae27dca04acc3613f4e1858476a 2017-12-20 11:14 +0000 [1b80ffa495] Corey Farrell * Fix Common Typo's. Fix instances of: * Retreive * Recieve * other then * different then * Repeated words ("the the", "an an", "and and", etc). * othterwise, teh ASTERISK-24198 #close Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31 2017-12-20 11:30 +0000 [3625e91586] Richard Mudgett * manager.h: Bump AMI version Change-Id: I62e6ddeb261ef012687e1fb6734c554e2499b6bf 2017-12-20 10:23 +0000 [aaa3884d4a] Corey Farrell * bridge: Old channel video source not set to NULL after unref. The bridge holds onto the old channel video source after it's been released. This can lead to use after free errors. ASTERISK-27229 #close Change-Id: Ib2dab61677dd8a21f7ad53cdc9b8ca93297838b3 2017-12-20 10:13 +0000 [c2850bfebc] Corey Farrell * core: Fix unused variable error in handle_show_sysinfo. Apparently in OSX it's possible for OSX to HAVE_SYSCTL but not HAVE_SYSINFO or HAVE_SWAPCTL. In this case freeswap caused an unused variable error. ASTERISK-26563 #close Change-Id: I8ec5b1897b786cc1abaf62264aa75039eea05510 2017-12-20 00:53 +0000 [fff7782cf5] Corey Farrell * app_festival: Fix fd leak on connection failure. Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f 2017-12-18 20:12 +0000 [d51837a1b9] Corey Farrell * CLI: Address multiple issues. * listen uses the variable `s` for the result from ast_poll() then overwrites it with the result of accept(). Create a separate variable poll_result to avoid confusion since ast_poll does not return a file descriptor. * Resolve fd leak that would occur if setsockopt failed in listen. * Reserve an extra byte while processing completion results from remote daemon. This fixes a bug where completion processing used strstr() on a string that was not '\0' terminated. This was no risk to the Asterisk daemon, the bug was only reachable the remote console process. * Resolve leak in handle_showchan when the channel is not found. * Multiple leaks and a deadlock in pbx_config CLI completion. * Fix leaks in "manager show command". Change-Id: I8f633ceb1714867ae30ef4e421858f77c14485a9 2017-12-18 22:48 +0000 [b8f54f742f] Corey Farrell * dns_core: Protect against array index violation. Add a check to allocate_dns_record to prevent calling a pointer retrieved from beyond dns_alloc_table. ASTERISK-27495 #close Change-Id: Ie2f6e4991cea46baa12e837bd64cc22b44d322bb 2017-12-18 18:59 +0000 [3c037ef972] Corey Farrell * chan_sip: Fix memory leaks. In change_redirecting_information variables we use ast_strlen_zero to see if a value should be saved. In the case where the value is not NULL but is a zero length string we leaked. handle_response_subscribe leaked a reference to the ccss monitor instance. Change-Id: Ib11444de69c3d5b2360a88ba2feb54d2c2e9f05f 2017-12-16 07:51 +0000 [3b99a0332c] Ivan Poddubny * bridge: Stop music on hold on adding an arbitrary channel to a bridge When a channel that is on hold gets added to a bridge by the Bridge AMI action or the dialplan application of the same name, music continues to play, causing "robotic sound". This commit adds a call to ast_moh_stop to stop the music. Also, it makes the AMI Park action use the right MOH class when the channel gets parked. Reported by: Zane Conkle ASTERISK-25079 #close Change-Id: I4b129c5a20c15e63968842460ac5a1a85903cf9f 2017-12-18 15:36 +0000 [b3e839debd] Corey Farrell * Remove constant conditionals (dead-code). Some variables are set and never changed, making them constant. This means that code in the 'false' block of the conditional is unreachable. In chan_skinny and res_config_ldap I used preprocessor directive `#if 0` as I'm unsure if the unreachable code could be enabled in the future. Change-Id: I62e2aac353d739fb3c983cf768933120f5fba059 2017-12-19 02:50 +0000 [c02e256407] Oron Peled * chan_console: Use correct parameter for 'set active' chan_console supports multiple devices but the CLI only works on a single device. 'console set active' selects this device. Sadly that CLI picks the wrong command-line parameter and will only work for a device called 'active'. ASTERISK-27490 #close Change-Id: I2f0e5fe63db19845bee862575b739360797dc73d 2017-12-18 23:17 +0000 [bf33a09c37] Corey Farrell * core: Fix multiple trivial issues in the core. * Fix small leaks in from error conditions in sdp.c and translate.c. * Check new file descriptor is less than 0, not less than or equal. Change-Id: Id7782775486175c739e0c4bf3ea5e17e3f452a99 2017-12-18 06:14 +0000 [81474dfb23] Aaron An * res_rtp_asterisk: Avoid close the rtp/rtcp fd twice. When RTCP-MUX enabled. rtp->s is the same as rtcp->s, check this before close the file descriptor. Close the FD twice will hangs the asterisk under heavy load. ASTERISK-27299 #close Reported-by: Aaron An Tested-by: AaronAn Change-Id: I870a072d73fd207463ac116ef97100addbc0820a 2017-12-18 19:47 +0000 [8dfc973d64] Corey Farrell * main/app: Fix leaks. * ast_linear_stream would leak a file descriptor if it failed to allocate lin. * ast_control_tone leaked zone and ts if ast_playtones_start failed. Additionally added whitespace to ast_linear_stream, pulled assignments out of conditionals for improved readability. Change-Id: I6d1a10cf9161b1529d939b9b2d63ea36d395b657 2017-12-18 19:19 +0000 [a790ced2e8] Corey Farrell * func_callerid: Initialize app argument structures. This module uses AST_DEFINE_APP_ARGS_TYPE to define struct's instead of directly using AST_DECLARE_APP_ARGS. Initialize the variables declared in this way. Change-Id: If97fbdd8d63a204e2efd498a192effc14e90fb31 2017-08-11 17:02 +0000 [4c04e13783] Richard Mudgett * bridge_softmix.c: Change remove_destination_streams() return meaning. The return value of remove_destination_streams() now means we removed a stream from the topology by making it a dead stream. Now we won't try to request a topology change if we didn't remove any streams. Change-Id: Icd91571d856a1d04299a24c411e325c1d9d5c61d 2017-08-11 16:57 +0000 [ea4179599f] Richard Mudgett * bridge_softmix.c: Don't match dead streams. * Made is_video_source() and is_video_dest() not match dead streams. * Optimized is_video_dest() to reduce duplicated code. Change-Id: I4e7ab762c7ee98395e78e6516399f57a2609b9a1 2017-12-18 18:40 +0000 [91d9eae79b] Corey Farrell * bridge_softmix: Fix memory leaks. Change-Id: Ifaf3e93b398595d21d07f535330fef77ff15a80c 2015-11-11 17:20 +0000 [f6393b59af] Richard Mudgett * ast_json_pack(): Use safer json ref mechanism. Change-Id: I49204db2e57ae96eee43909c18ed007c09ac817e 2017-12-18 18:04 +0000 [dc04d1ec93] Corey Farrell * app_voicemail: Fix memory management issues. * mwi_sub_event_cb: mwist leaked on separate_mailbox failure. * add_email_attachment: A reference to sox_gain_tmpdir was used after the storage was out of scope. Change-Id: I6282c542ff7b82fa091177a912d11234a8b00a30 2015-11-11 16:52 +0000 [7054fb8756] Richard Mudgett * rtp_engine.c: Eliminate rtcp_report_to_json() RAII_VAR usage. Change-Id: I58a22c2ca82e91d7537409b7b3af2d735827a54d 2017-12-06 20:35 +0000 [5335ad117d] Rodrigo Ramírez Norambuena * app_queue: Add feature to set wrapuptime on the queue member This patch adds the ability to set the wrapuptime on the queue member config. When the option is set the wrapuptime on the queue member is used instead of the queue's wrapuptime. ASTERISK-27483 #close Change-Id: I11c85809537f974eb44dc5bbf82bcedd8a458902 2017-12-18 14:00 +0000 [064c74e4af] Corey Farrell * netsock: Remove from Asterisk core. This moves netsock.c / netsock.h to the chan_iax2 module. netsock.h has been marked deprecated since 13.0.0, chan_iax2 is the only remaining user. Change-Id: I28c6578043bac18de5ea608e136acec4f83d5dd3 2017-12-18 12:23 +0000 [731a23fba7] Corey Farrell * CLI: Fix 'core set debug channel' completion bug. The completion generator is missing a return so typing "core set debug all off " causes the command to actually execute. Change-Id: Ibf6462088a74eee66967732b50445783ebefc20b 2017-12-18 08:25 +0000 [1769d4a5c6] Joshua Colp * confbridge: Clarify mute sound documentation. The mute/unmute sounds are only played when the action is initiated using the DTMF menu. ASTERISK-24756 Change-Id: I55b3dd5bc166096bf5e2f547ddd0ce355f36e3dc 2017-12-18 06:36 +0000 [b40c00c97b] Joshua Colp * app_transfer: Remove LOCAL from documentation. The Local channel has never supported app_transfer from what I can see so remove it from the documentation. ASTERISK-25649 Change-Id: Icbcfe297f6f866285a26b3e9fd5c6d00fa22e0e9 2017-12-15 19:01 +0000 [4a461bcde4] Richard Mudgett * chan_pjsip.c: Improve ast_request() diagnostic msgs. Attempting to dial PJSIP/endpoint when the endpoint doesn't exist and disable_multi_domain=no results in a misleading empty endpoint name message. The message should say the endpoint was not found. * Added missing endpoint not found message. * Added more information to the empty endpoint name msgs if available. * Eliminated RAII_VAR in request(). Change-Id: I21da85ebd62dcc32115b2ffcb5157416ebae51e4 2016-10-06 01:29 +0000 [6f8b34f9c1] Corey Farrell * chan_sip: Add security event for calls to invalid extension. Log a message to security events when an INVITE is received to an invalid extension. ASTERISK-25869 #close Change-Id: I0da40cd7c2206c825c2f0d4e172275df331fcc8f 2017-12-15 10:26 +0000 [e6768c0f81] Corey Farrell * cdr: Minor optimizations. * bridge_candidate_process: remove SCOPED_AO2LOCK and return value. * handle_standard_bridge_enter_message: replace recursive call with goto statement. ASTERISK-24297 Change-Id: Id2eaa0822fb8dc799f63422bb3aa89de9d4ee2a2 2017-12-12 12:55 +0000 [bf2d35931d] Corey Farrell * aco: Minimize use of regex. Remove nearly all use of regex from ACO users. Still remaining: * app_confbridge has a legitamate use of option name regex. * ast_sorcery_object_fields_register is implemented with regex, all callers use simple prefix based regex. I haven't decided the best way to fix this in both 13/15 and master. Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b 2017-12-12 12:36 +0000 [a455e18320] Corey Farrell * aco: Create ways to minimize use of regex. ACO uses regex in many situations where it is completely unneeded. In some cases this doubles the total processing performed by aco_process_config. * Create ACO_IGNORE category type for use in place of skip_category regex source string. * Create additional aco_category_op values to allow specifying category filter using either a single plain string or a NULL terminated array of plain strings. * Create ACO_PREFIX to allow matching option names to case insensitive prefixes. Change-Id: I66a920dcd8e2b0301f73f968016440a985e72821 2017-12-15 07:56 +0000 [03c25a869f] Corey Farrell * res_smdi: Fix shutdown ref. When adding shutdown refs for OPTIONAL_API components I accidentally added it to the unload_module function in res_smdi. Move it to load_module. Change-Id: I2b9da38fbc11ef78ea23dbb2df92b684be7f647c 2017-12-11 17:07 +0000 [9d5797616c] Corey Farrell * loader: Use vector to build apha sorted module lists. Change-Id: I9c519f4dec3cda98b2f34d314255a31d49a6a467 2017-11-21 00:28 +0000 [7b54903313] Corey Farrell * loader: Replace priority heap with vector. This is needed for future changes which will require being able to process the load priority out of order. Change-Id: Ia23421197f09789940510b03ebbbf3bf24d51bea 2017-12-14 18:55 +0000 [9755eff46f] Sean Bright * res_hep: hepv3_is_loaded() should check if we are enabled res_hep_pjsip.so and res_hep_rtcp.so will still load and do a lot of unnecessary work even if 'enabled' is set to 'no' in hep.conf. Change-Id: I3eddfeea09c6b5bc7c641952ee0ae487fd09b64b 2017-11-20 23:10 +0000 [3505cc88e8] Corey Farrell * loader: Rework of load_dynamic_module. * Split off load_dlopen to perform actual dlopen, check results and log warnings when needed. * Always use RTLD_NOW. * Use flags which minimize number of calls to dlopen required. First attempt always uses RTLD_GLOBAL when global_symbols_only is enabled, RTLD_LOCAL when it is not. This patch significantly reduces the number of dlopen's performed. With 299 modules my system ran dlopen 857 times before this patch, 655 times after this patch. Change-Id: Ib2c9903cfddcc01aed3e01c1e7fe4a3fb9af0f8b 2017-11-21 20:34 +0000 [80bf0ee99a] Corey Farrell * loader: Minor fix to module registration. This protects the module loader itself against crashing if dlopen is called on a module from outside loader.c. * Expand scope of lock inside ast_module_register to include reading of resource_being_loaded. * NULL check resource_being_loaded. * Set resource_being_loaded NULL as soon as dlopen returns. This fixes some error paths where it was not NULL'ed. * Create module_destroy function to deduplicate code from ast_module_unregister and modules_shutdown. * Resolve leak that occured if a module did not successfully register. * Simplify checking for successful registration. Change-Id: I40f07a315e55b92df4fc7faf525ed6d4f396e7d2 2017-12-14 15:27 +0000 [a8aa209901] Corey Farrell * res_clialiases: Fix completion pass-through. Never ignore contents of line when generating completion options. Change-Id: I74389efdfea154019d3b56a9f381610614c044c8 2017-12-11 18:20 +0000 [98f7e9251f] Richard Mudgett * res_rtp_asterisk.c: Disable packet flood detection for video streams. We should not do flood detection on video RTP streams. Video RTP streams are very bursty by nature. They send out a burst of packets to update the video frame then wait for the next video frame update. Really only audio streams can be checked for flooding. The others are either bursty or don't have a set rate. * Added code to selectively disable packet flood detection for video RTP streams. ASTERISK-27440 Change-Id: I78031491a6e75c2d4b1e9c2462dc498fe9880a70 2017-12-14 14:05 +0000 [283d2df680] George Joseph * res_pjsip_sdp_rtp: Add NULL check in add_crypto_to_stream add_crypto_to_stream wasn't checking for a NULL session->inv_session->neg before calling pjmedia_sdp_neg_get_state. This was causing a crash if the negotiation hadn't already been completed and asterisk was compiled with --enable-dev-mode. Change-Id: I57c6229954a38145da9810fc18657bfcc4d9d0c9 2017-12-14 12:14 +0000 [c387beb456] Sean Bright * res_musiconhold: Start playlist after initial announcement Reset the samples counter to zero when we are done playing an announcement so that we don't skip into the middle of the first file in the playlist. Also add the selected annoucement to the output of 'moh show classes.' ASTERISK-24329 #close Reported by: Thomas Frederiksen Change-Id: I2a5f986a31279c981592f49391409ebf38d6f6d0 2017-12-14 10:51 +0000 [7a8a187a56] Sean Bright * coverity: Fix warnings in res_smdi ASTERISK-19657 #close Reported by: Matt Jordan III, Esq. Change-Id: I59a5e6ef3e7d9e848bec1f4b40cb73321bc7956a 2017-12-14 10:22 +0000 [dac5e3a0df] Sean Bright * configs: Comment out and change IP of iax.conf [demo] This no longer appears to exist, so no sense in causing confusion. ASTERISK-27175 #close Reported by: Tzafrir Cohen Change-Id: Idde967924c69f6a741dc9a5ab7dacb44d22cf100 2017-12-13 14:26 +0000 [a51bfe5a79] George Joseph * README: Remove outdated references to tex docs Added links to the wiki to replace references to outdated tex docs. ASTERISK-27430 Reported by: Corey Farrell Change-Id: I5007e732b30bc7b63d124c530ae8857c89991209 2017-12-13 09:50 +0000 [5f6a3c4399] Corey Farrell * CLI: Remove special handling of 'core set verbose' from rasterisk. rasterisk does not need to handle setting verbose levels locally, it should just tell the daemon what it wants and print what it is given. Just max out the verbose level on the local client so all filtering happens on the daemon. ASTERISK-20281 #close Change-Id: Ia305f75f1fc424a9169bfa30ef70d626ace2c8a8 2017-12-08 06:48 +0000 [daa3a3009a] sungtae kim * Add new AMI action for app_voicemail Currently, to figure out specified voicemail's status, there's only one way to do it, which is use a VoicemailUserEntry AMI message. But it consumed it too much resource(it check everything). So, added new AMI action. ASTERISK-27470 Change-Id: Ie4eba1424a142e5fbd1d9fb1821a3fc1a1e238b7 2017-11-30 10:12 +0000 [62f2860c39] Joshua Colp * AST-2017-012: Place single RTCP report block at beginning of report. When the RTCP code was transitioned over to Stasis a code change was made to keep track of how many reports are present. This count controlled where report blocks were placed in the RTCP report. If a compound RTCP packet was received this logic would incorrectly place a report block in the wrong location resulting in a write to an invalid location. This change removes this counting logic and always places the report block at the first position. If in the future multiple reports are supported the logic can be extended but for now keeping a count serves no purpose. ASTERISK-27382 ASTERISK-27429 Change-Id: Iad6c8a9985c4b608ef493e19c421211615485116 2017-12-13 06:54 +0000 [3370cd21df] Joshua Colp * res_pjsip_session: Reinvite using active stream topology if none requested. When a connected line update is sent to an endpoint we do not request a specific stream topology to be used. Previously this resulted in the configured stream topology being used which may actually differ from the currently negotiated topology. PJSIP is helpful in this regard in that it will fill in any missing streams with removed ones. This results in our own state not matching the SDP, though, and we do not apply the negotiated SDP. This change tweaks the code to use the actively negotiated stream topology if it is present with a fallback to the configured one. This results in the SDP and the state having matching information and the world is happy. ASTERISK*27397 Change-Id: I7a57117f0183479e6884b7bf3a53bb8c7464f604 2017-12-06 08:24 +0000 [0b532367bd] Joshua Colp * pjsip: Ignore state changes from old transactions. When we fail over to a new target we create a new transaction and it becomes the current INVITE transaction. This does not prevent the previous transaction from raising state changes and causing the session to be prematurely disconnected if a transport error occurs immediately. This change backports a fix from PJSIP that eliminates the incorrect state change and reduces when they would be raised in the first place. ASTERISK-27408 Change-Id: Id22d087591782eee31311753d11e7eca4b95ef34 2017-12-12 22:42 +0000 [cb249b2419] Yasuhiko Kamata * chan_sip: 3PCC patch for AMI "SIPnotify" A patch for sending in-dialog SIP NOTIFY message with "SIPnotify" AMI action. ASTERISK-27461 Change-Id: I5797ded4752acd966db6b13971284db684cc5ab4 2017-12-12 15:38 +0000 [c7f94e570e] Ivan Poddubny * app_queue: Fix extension state subscriptions removed on dialplan reload The approach with having a single global subscription to all extension state changes has one issue: dynamically created hints don't have any watchers and are therefore garbage collected on the first dialplan reload. This change creates a state subscription for every queue member with a hint as state_interface, thus increasing the count of watches for hints, so they are not destroyed prematurely anymore. There are 2 side effects: 1. The state change callback in app_queue is not executed when there are no members referring to the extension. 2. The callback is called multiple times for the same hint if it's associated with more than one queue member. Reported by: Steven T. Wheeler ASTERISK-18411 #close Change-Id: I4956af2136ea2a7f110ac9272eae5f6e676d8f89 2017-12-12 15:28 +0000 [0c9cc7e975] Sean Bright * chan_sip: Don't send trailing \0 on keep alive packets This is a partial fix for ASTERISK~25817 but does not address the comments regarding RFC 5626. Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420 2017-12-12 15:19 +0000 [5039b5741c] Dwayne Hubbard * chan_sip: Don't crash in Dial on invalid destination Stripping the DNID in a SIP dial string can result in attempting to call the argument parsing macros on an empty string, causing a crash. ASTERISK-26131 #close Reported by: Dwayne Hubbard Patches: dw-asterisk-master-dnid-crash.patch (license #6257) patch uploaded by Dwayne Hubbard Change-Id: Ib84c1f740a9ec0539d582b09d847fc85ddca1c5e 2017-12-12 15:16 +0000 [6a67828b46] Corey Farrell * menuselect: Tweak check for recently run configure. Recently menuselect has randomly produced an error stating that configure was just run and make had to be restarted. I believe this is due to an incorrect menuselect/Makefile rule. The original rule produced an error if makeopts or autoconfig.h were older than makeopts.in or autoconfig.h.in. I believe this can create an issue if makeopts is older than autoconfig.h.in or if autoconfig.h is older than makeopts.in. The new rules compare files independently. Change-Id: Ibca155035fa1392c95e33cbf25f257902abba17b 2017-12-07 17:51 +0000 [22810fc635] Richard Mudgett * chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri) This patch does three things associated with the initial incoming INVITE request URI. 1) Add access to the full initial incoming INVITE request URI. 2) We were not setting DNID on incoming PJSIP channels. The DNID is the user portion of the initial incoming INVITE Request-URI. The value is accessed by reading CALLERID(dnid). 3) Fix CHANNEL(pjsip,target_uri) documentation. * The initial incoming INVITE request URI is now available using CHANNEL(pjsip,request_uri). * Set the DNID on PJSIP channel creation so CALLERID(dnid) can return the initial incoming INVITE request URI user portion. * CHANNEL(pjsip,target_uri) now correctly documents that the target URI is the contact URI. * Refactored print_escaped_uri() out of channel_read_pjsip() to handle pjsip_uri_print() error condition when the buffer is too small. ASTERISK-27478 Change-Id: I512e60d1f162395c946451becb37af3333337b33 2017-12-12 09:28 +0000 [ec1f4bf48d] Sean Bright * res_pjsip: Add TLSv1.1 and TLSv1.2 support Support for these protocols was added in the same commit as the 'proto' field, so we can safely use the same ./configure check. For reference: https://trac.pjsip.org/repos/changeset/4968 Change-Id: Icf4975d785d6bfb8f30ac7ffa695a0adf9382dac 2017-12-12 08:06 +0000 [0b9d2135a9] Sean Bright * res_pjsip: Assign support levels to a few modules Change-Id: I51f6945c4023cb93fc7b87be5ab4c50e9e6ee27d 2017-12-09 00:35 +0000 [c01ba7437e] Corey Farrell * CLI: Fix 'core show sysinfo' function ordering. Handle CLI initialization before any processing occurs. Change-Id: I598b911d2e409214bbdfd0ba0882be1d602d221c 2017-12-11 15:27 +0000 [b088cddc03] Kevin Harwell * pjsip_options: wrongly applied "UNKNOWN" status A couple of places were setting the status to "UNKNOWN" when qualifies were being disabled. Instead this should be set to the "CREATED" status that represents when a contact is given (uri available), but the qualify frequency is set to zero so we don't know the status. This patch updates the relevant places with "CREATED". It also updates the "CREATED" status description (value shown in CLI/AMI/ARI output) to a value of "NonQualified"/"NonQual" as this description is hopefully less confusing. ASTERISK-27467 Change-Id: Id67509d25df92a72eb3683720ad2a95a27b50c89 2017-12-08 12:04 +0000 [c2ec82bf36] Richard Mudgett * stasis_channels.c: Don't set channel snapshot caller_dnid twice. Change-Id: Ib8d45bbdfbda81e65045f6dff874d189b74e5471 2017-12-11 09:45 +0000 [00578fae0a] Sean Bright * codec_opus: Make libcurl a dependency in menuselect ASTERISK-27475 #close Change-Id: If7384bc6ed002ef140dec69798d14c52b7cfd800 2017-12-08 12:48 +0000 [521f741b04] Sean Bright * pjsip: Improve CLI completion performance Use the new ast_cli_completion_add() function to improve completion performance for commands like 'pjsip show endpoint.' Change-Id: I76d802294d2ac1766110dc75f7d117c8541ce348 2017-12-07 14:19 +0000 [9a9edc6c9e] Sean Bright * astdb: Improve prefix searches in astdb Using the LIKE operator requires a full table scan of 'astdb', whereas a comparison operation is able to use the primary key index. This patch adds a new function to the AstDB API for quick prefix matches and updates res_sorcery_astdb to utilize it. This showed substantial performance improvement in my test environment. Related to ASTERISK~26806, but does not completely resolve it. Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1 2017-12-08 18:19 +0000 [d2e87b8e14] Corey Farrell * loader: Refactor resource_name_match. Optimize resource_name_match. This change eliminates use of ast_strdupa, instead verifying that both basename's are the same length, then using strncasecmp. Change-Id: I477275c0e954c99d74be5abfc8bb6545b04e5a3d 2017-12-08 14:58 +0000 [dbb376f166] Sean Bright * pjsip_configuration: Add correct file header Change-Id: I25348c386a222bb704aff07f54375108a6402906 2017-12-07 09:52 +0000 [2ffe52a116] Sean Bright * utils: Add convenience function for setting fd flags There are many places in the code base where we ignore the return value of fcntl() when getting/setting file descriptior flags. This patch introduces a convenience function that allows setting or clearing file descriptor flags and will also log an error on failure for later analysis. Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7 2017-12-07 19:33 +0000 [e2dbc26376] Corey Farrell * res_stasis and res_speech: Fix load order. res_stasis was missing AST_MODFLAG_LOAD_ORDER. Set res_stasis and res_speech to start at (AST_MODPRI_APP_DEPEND - 1) so they are ready for dependent modules. Change-Id: I27f4f3810a95b6be8a5bfbf62be2ace6bfab6ff3 2017-12-07 18:22 +0000 [0e4d31eb9c] Kevin Harwell * pjsip_options: contacts sometimes not being updated on reload For both dynamic and static contacts it was possible that potential AOR changes were not being applied to all contacts. This was because the qualify and schedule code was only retrieving AOR's, and contacts with frequencies greater than zero. For instance the following could happen: and AOR/contact has a frequency of 5, it then gets set to 0, and then a reload occurs. All scheduled OPTIONS are stopped, a list of AOR's is retrieved with frequency > 0, but none are selected since in this scenario all are 0. The contact for the one previously set to 5 though does not get updated, so it's status remains "AVAILABLE". This patch makes it so all contacts (static and dynamic) are selected, and appropriately updated if need be. ASTERISK-27467 #close Change-Id: I7a920170f89c683af9505d4723a44fc6841decdb 2017-12-07 18:18 +0000 [bd2218ce63] Kevin Harwell * pjsip_options: dynamic contact's fields not updated on reload Dynamic contacts were not being properly updated on reload. As a matter of fact any changes to the AOR that a dynamic contact was associated with were not being applied. On reload, this patch makes it so for each dynamic contact, the associated AOR is now retrieved and the AOR's fields are applied to the contact. ASTERISK-27467 Change-Id: I8e3165dc6a745218c1c9db837f77fafa0516985d 2017-12-06 23:35 +0000 [c2c9995830] Corey Farrell * translate: Skip matrix_rebuild during shutdown. Change-Id: I1e5eef4029cba56e33d786c5a5ade8091e531a1e 2017-12-06 14:49 +0000 [ab191e9782] Corey Farrell * sounds_index: Avoid repeatedly reindexing. The sounds index is rebuilt each time a format is registered or unregistered. This causes the index to be repeatedly rebuilt during startup and shutdown. This patch significantly reduces the work done by delaying sound index initialization until after modules are loaded. This way a reindex only occurs if a format module is loaded after startup. We also skip reindexing when format modules are unloaded during shutdown. Change-Id: I585fd6ee04200612ab1490dc804f76805f89cf0a 2017-12-05 18:04 +0000 [3078b7adc2] Richard Mudgett * CDR: Fix deadlock setting some CDR values. Setting channel variables with the AMI Originate action caused a deadlock when you set CDR(amaflags) or CDR(accountcode). This path has the channel locked when the CDR function is called. The CDR function then synchronously passes the job to a stasis thread. The stasis handling function then attempts to lock the channel. Deadlock results. * Avoid deadlock by making the CDR function handle setting amaflags and accountcode directly on the channel rather than passing it off to the CDR processing code under a stasis thread to do it. * Made the CHANNEL function and the CDR function process amaflags the same way. * Fixed referencing the wrong message type in cdr_prop_write(). ASTERISK-27460 Change-Id: I5eacb47586bc0b8f8ff76a19bd92d1dc38b75e8f 2017-12-06 12:42 +0000 [2af59ebb3a] Corey Farrell * media_index: Improve startup. This eliminates some wasteful operations in media_index startup. * Replace statically set string-fields with char[0]. * Eliminate pointless RAII_VAR's. * alloc_variant: Avoid pointless ao2_find on new info->variant. * Stop trying find_variant before alloc_variant. * process_media_file: replace ast_str with ast_asprintf. This avoids reallocation of file_id_str. Overall sounds_index.c is about 27% of Asterisk startup time when using sample configs. This patch reduces it to 20%. This is a half-fix. The real problem is that the media_index is regenerated repeatedly - 68 times in my test. Change-Id: Ia50b752f8efb356f852b05c4be495a6631af8652 2017-12-06 07:36 +0000 [e97e41552e] Richard Mudgett * bridge_basic.c: Update transfer diagnostic messages addendum. * Added start DTMF transfer verbose messages. * Made associated transfer messages use a similar message format. * Adjusted message verbose level as requested by initial reporter. ASTERISK-27449 Change-Id: I2045714586414b3c5ef1f3cc56c1c4af4b31f551 2017-11-29 06:21 +0000 [9d00583164] Niklas Larsson * bridge_basic.c: Update transfer diagnostic messages. * Add the channel name to diagnostic messages so you will know which channel failed to transfer. * Promoted some debug messages to verbose 4 messages. ASTERISK-27449 #close Change-Id: Idac66b7628c99379cc9269158377fd87dc97a880 2017-12-01 13:54 +0000 [8536a09b86] Richard Mudgett * security-events: Fix SuccessfulAuth using_password declaration. The SuccessfulAuth using_password field was declared as a pointer to a uint32_t when the field was later read as a uint32_t value. This resulted in unnecessary casts and a non-portable field value reinterpret in main/security_events.c:add_json_object(). i.e., It would work on a 32 bit architecture but not on a 64 bit big endian architecture. Change-Id: Ia08bc797613a62f07e5473425f9ccd8d77c80935 2017-11-30 12:50 +0000 [ab63448fa6] Richard Mudgett * res_rtp_asterisk.c: Increase strictrtp learning timeout time. More complicated direct media reinvite negotiations can result in longer delays before direct media flows. The strictrtp learning timeout time was too short. One log showed that the first RTP packet came in just after three seconds. * Increase the strictrtp learning timeout time from 1.5 to 5 seconds. ASTERISK-27453 Change-Id: Ic5e711164cbb91b4d1c1e40c83697755640f138c 2017-12-04 08:33 +0000 [e0354bbe82] Alexander Traud * res_rtp_asterisk: Correct default in sample configuration file. With Asterisk 12 (commit 866d968), the default of "icesupport" changed to - "yes" in the module "res_rtp_asterisk" and - "no" in the module "chan_sip". The latter was reflected in the sample configuration file for "sip.conf". The former did not make it into "rtp.conf.sample". ASTERISK-20643 Change-Id: I2a2e0a900455d0767a99ea576e30adc6d7608a36 2017-12-04 05:27 +0000 [b2c4e8660a] Alexander Traud * chan_sip: Peers with distinct source ports don't match, regardless of transport. Previously, peers connected via TCP (or TLS) were matched by ignoring their source port. One cannot say anything when protocol:IP:port match, yes (see ). However, when the ports do not match, the peers do not match as well. This change allows two peers connected to an Asterisk server via TCP (or TLS) behind a NAT (= same source IP address) to be differentiated via their port as well. ASTERISK-27457 Reported by: Stephane Chazelas Change-Id: Id190428bf1d931f2dbfd4b293f53ff8f20d98efa 2017-12-04 03:40 +0000 [0611fe581c] Sungtae Kim * Add new object for VoicemailUserEntry Currently, when the app_voicemail sending VoicemailUserEntry AMI event, there's no OldMessageCount info for default. To check the OldMessageCount info, it required IMAP_STORAGE define, but this is not correct. Added OldMessageCount item as a default. ASTERISK-27456 Change-Id: I5c71521c2d1daf8b7b161e31c34d28cca6aea4c7 2017-12-03 18:49 +0000 [e2715d2cd4] Joshua Colp * pjproject: Clean up disabling of WebRTC support. The definition in config_site.h and the argument to the configure script are not necessary to disable WebRTC support. The correct argument, --disable-libwebrtc, is already passed. ASTERISK-26980 Change-Id: I27da2c894f87914956a72710222e17462d8a44bc 2017-12-02 15:55 +0000 [39939cecfa] Corey Farrell * autoconf: Remove use of m4_ifblank. The m4_ifblank macro is not available on CentOS 6, reverse conditionals to allow use of m4_ifval instead. ./bootstrap.sh was run but this patch does not result in any difference to the generated configure script. Change-Id: I280785deb872ed8d3339d99cce63a2b54d5f1438 2017-11-30 14:38 +0000 [075faac2fd] George Joseph * AST-2017-013: chan_skinny: Call pthread_detach when sess threads end chan_skinny creates a new thread for each new session. In trying to be a good cleanup citizen, the threads are joinable and the unload_module function does a pthread_cancel() and a pthread_join() on any sessions that are active at that time. This has an unintended side effect though. Since you can call pthread_join on a thread that's already terminated, pthreads keeps the thread's storage around until you explicitly call pthread_join (or pthread_detach()). Since only the module_unload function was calling pthread_join, and even then only on the ones active at the tme, the storage for every thread/session ever created sticks around until asterisk exits. * A thread can detach itself so the session_destroy() function now calls pthread_detach() just before it frees the session memory allocation. The module_unload function still takes care of the ones that are still active should the module be unloaded. ASTERISK-27452 Reported by: Juan Sacco Change-Id: I9af7268eba14bf76960566f891320f97b974e6dd (cherry picked from commit 8f5dff543e457ee3450d21e741901609af0cd779) 2017-12-01 10:01 +0000 [d9fdeae6a4] Sean Bright * config: Speed up config template lookup ast_category_get() has an (undocumented) implementation detail where it tries to match the category name first by an explicit pointer comparison and if that fails falls back to a normal match. When initially building an ast_config during ast_config_load, this pointer comparison can never succeed, but we will end up iterating all categories twice. As the number of categories using a template increases, this dual looping becomes quite expensive. So we pass a flag to category_get_sep() indicating if a pointer match is even possible before trying to do so, saving us a full pass over the list of current categories. In my tests, loading a file with 3 template categories and 12000 additional categories that use those 3 templates (this file configures 4000 PJSIP endpoints with AOR & Auth) takes 1.2 seconds. After this change, that drops to 22ms. Change-Id: I59b95f288e11eb6bb34f31ce4cc772136b275e4a 2017-12-01 08:29 +0000 [1ad0fbc80e] Sean Bright * config: Speed up ACO & sorcery initialization When starting Asterisk in the foreground, there is a perceptible delay when loading modules that use the ACO and sorcery config frameworks. For example, a lightly configured res_pjsip took 853ms to load on my VM. I tracked down the slowness to the XPath queries used to associate the relevant documentation with the config options. One improvement was adding a call to xmlXPathOrderDocElems after loading an XML document. From the libxml2 docs: Call this routine to speed up XPath computation on static documents. The second change was to remove recursive descent and wildcard operators from the XPath queries. After these changes, res_pjsip takes 85ms to load on my VM and there is no longer a perceptible delay when starting Asterisk in the foreground. Change-Id: I45d457f1580e26bf5a2b0dab16e8e9ae46dcbd82 2017-12-01 06:07 +0000 [892df22ccd] Joshua Colp * res_http_post: Not all versions of gmime have GMIME_MAJOR_VERSION. This change makes the presence of the GMIME_MAJOR_VERSION definition optional, as not all versions of gmime actually define it. ASTERISK-27454 Change-Id: I01d99590045971ed6787899147170a5954077238 2017-11-30 21:24 +0000 [35a7036a0d] Corey Farrell * README-SERIOUSLY.bestpractices.txt: Convert to markdown Follow-up to conversion of README.md. Change-Id: I17ee7cf25bc027ece844efa2c1dfe613aff1e35b 2017-11-17 10:38 +0000 [ce5cfc8ffb] Corey Farrell * autoconf: Use m4 conditionals where possible. Change-Id: I530c0a72f965437acef6a9a4fbfe5c487f078b65 2017-11-17 09:15 +0000 [87a57e8d46] Corey Farrell * autoconf: Fix call to AC_CONFIG_AUX_DIR. The `pwd` parameter to AC_CONFIG_AUX_DIR is unnecessary, the default value is $srcdir. Additionally remove the AC_REVISION call. It only added a comment and is pointless without SVN tag replacements. Change-Id: I99299a3217f095bddcb2edefb3b9af0ab147bc29 2017-11-20 16:58 +0000 [d12a2ab400] Corey Farrell * CLI: Remove compatibility code. Previous commits maintained compatibility with older remote console clients as well as maintaining all API's. Remove the following compatibility code: * ast_cli_generatornummatches. * Remote command "_command nummatches". * Sorting / duplicate removal by remote console. Change-Id: I59e6ce94fa57ae564888442049695f7e46746437 2017-11-26 11:47 +0000 [58115e9c21] Alexander Traud * translate: Transcode siren14, speex32, silk24, and silk12 via slin16. When a format has no pre-recorded sound files, Asterisk has to transcode between formats. For this, Asterisk has a fixed translation table. If the pre-recorded sound files are not available in the same sample rate, Asterisk has not only to transcode but also to resample. Asterisk has pre-recorded files for SLN (8000 kHz) and SLN16 (16000 kHz). However before this change, Asterisk did not take the sample rate into account, because the translation paths to SLN and SLN16 got the same score/weight in the table. Consequently, you might have got narrow-band audio with siren14, speex32, silk24, and silk12 although those are (ultra) wide-band audio codecs. With this change, the distance in sample-rates is taken into account. Now on the Command-Line interface (CLI) 'core show channels', you should see: (slin@16000)->(slin@32000)->(speex@32000). ASTERISK-23735 Reported by: Richard Kenner Change-Id: I9448295c1978be26f8633b6066395e7bbbe2e213 2017-11-26 09:44 +0000 [55c4d8e008] Richard Mudgett * res_ari: Fix inverted test giving wrong error message. The patch for ASTERISK_24560 inverted a test checking if the bridge name is being updated to a different name. * Fix the test to return "Changing bridge name is not implemented" when someone attempts to change the bridge name. ASTERISK-27445 Change-Id: I4b70bf08b0e02e016108b077ff75b345dec12fc9 2017-11-25 04:09 +0000 [74e7005a74] Alexander Traud * translate: Show sample rate for silk, speex, and slin in translation table. ASTERISK-24662 Change-Id: I3822956984292c99c48bca8e97807e498ccc0e88 2017-11-23 13:27 +0000 [02a9952709] Richard Mudgett * features.conf.sample: Clarify ActivatedBy documentation wording. Change-Id: Id2899331fe05d1909a862ea879742879d086bc64 2017-11-22 18:37 +0000 [4b1262c94b] Corey Farrell * Add defaultbranch to .gitreview. Although the default value of defaultbranch is master I'm adding it anyways. This way when new major branches are being created the value can be updated instead of having to remember the name of the key. Change-Id: I3db009217c5ae399fb84bee95076f4dbb7fa52d2 2017-11-22 18:43 +0000 [fcd9ba2b87] Alexander Anikin * add cmd connection creation on creation ooh323 call data structure ASTERISK-27353 #close Reported by: Marco Giordani Change-Id: I455096bd7da016b871afe09af86067c2c7c9f33f 2017-11-22 10:42 +0000 [db21f7f2e1] Kevin Harwell * pjsip: 183 without To tag does not negotiate media If a 183 with sdp response is receive without a To tag the sdp is not negotiated. According to RFC 3261 section 12.1.2 while a To tag is required, the client needs to still be able to handle the missing tag case for backwards compatibility. This patch, accepted by and applied to pjproject, makes it so if an incoming 180/183 with SDP comes in without a To tag it gets appropriately handled. ASTERISK-27442 #close Change-Id: Ic9d6b01e05e8f4874eebbd7adfe05d932025d203 2017-11-21 06:39 +0000 [1a349d832d] Alexander Traud * res_rtp_asterisk: ICE server-reflexive candidates (srflx) with Dual-Stack. Previously, Asterisk sent srflx only when configured exclusively for IPv4. Now, srflx is gathered and sent via SDP, even when Asterisk is enabled for Dual Stack (IPv4+IPv6) and an IPv4 interface is available/used. ASTERISK-27437 Change-Id: Ie07d8e2bfa7b6fe06fcdc73d390a7a9a4d8c0bc1 2017-11-20 13:05 +0000 [8e1506154f] Corey Farrell * res_parking: Set load_pri more appropriately. res_parking had an inplicit load_pri of 0 meaning it was one of the very first modules loaded after modules with global symbols. Set it to AST_MODPRI_DEVSTATE_PROVIDER as it provides device state for parking lots. Change-Id: I297b6fb3ff6993ec004e667b22a74f5925906259 2017-11-17 21:33 +0000 [90f9885f73] Corey Farrell * README: Convert to README.md. Convert the README file to markdown format, remove the old README. This causes websites like github to display the README in a much nicer format with live links. The raw file is still very readable from plain text editors and terminals. Change-Id: I7d13131764a9a9026e5f8a6ddb245a01bbd788e7 2017-11-20 16:48 +0000 [b79d04f8f8] Corey Farrell * CLI: Finish conversion of completion handling to vectors. Change-Id: Ib81318f4ee52a5e73b003316e13fe9be1dd897a1 2017-11-07 15:34 +0000 [fbb8c0d3e4] Corey Farrell * CLI: Refactor cli_complete. * Stop using "_COMMAND NUMMATCHES" on remote consoles. Using this command had doubled the amount of work needed from the Asterisk daemon for each completion request. * Fix code formatting. * Remove static buffer used to send the command, use the same buffer that will receive the results. * Move sort from ast_cli_display_match_list. Change-Id: Ie2211b519a3d4bec45bf46e0095bdd01d384cb69 2017-11-07 14:13 +0000 [1cd24cd726] Corey Farrell * CLI: Rewrite ast_el_strtoarr to use vector's internally. This rewrites ast_el_strtoarr to use vector's internally, but still return the original NULL terminated array of strings. Change-Id: Ibfe776cbe14f750effa9ca360930acaccc02e957 2017-11-07 14:47 +0000 [9c0a2110f0] Corey Farrell * CLI: Refactor ast_cli_display_match_list. * Stop estimating line count, just print until we run out of matches. * Stop freeing entries, the caller does that anyways. * Stop calculating / returning numoutput, it was ignored. Change-Id: I7f92afa8bea92241a95227587367424c8c32a5cb 2017-11-08 23:42 +0000 [9587a61f4c] Corey Farrell * CLI: Create ast_cli_completion_add function. Some completion generators are very inefficent due to the way CLI requests matches one at a time. ast_cli_completion_add can be called multiple times during one invokation of a CLI generator to add all results without having to reinitialize the search state for each match. Change-Id: I73d26d270bbbe1e3e6390799cfc1b639e39cceec 2017-11-09 00:39 +0000 [a02cbc2ef3] Corey Farrell * CLI: Remove calls to ast_cli_generator. The ability to add to localized storage cannot be supported by ast_cli_generator. The only calls to ast_cli_generator should be by functions that need to proxy the CLI generator, for example 'cli check permissions' or 'core show help'. * ast_cli_generatornummatches now retrieves the vector of matches and reports the number of elements (not including 'best' match). * test_substitution retrieves and iterates the vector. Change-Id: I8cd6b93905363cf7a33a2d2b0e2a8f8446d9f248 2017-11-20 09:13 +0000 [491e2eba0d] Alexander Traud * chan_sip: ICE contained square brackets around IPv6 addresses. ASTERISK-27434 Change-Id: Iaeed89b4fa05d94c5f0ec2d3b7cd6e93d2d5a8f7 2017-11-19 21:23 +0000 [10b4b5d200] Corey Farrell * loader: Fix comments in struct ast_module. Make the comments follow doxygen format, move comments to the line before each field they describe. Change-Id: Ic445468398b5e88f13910f7c2f70bd15aad33a27 2017-11-16 17:25 +0000 [9ae805c900] Corey Farrell * cli: Remove silly usage of RAII_VAR. Change-Id: I81aacfee7cd26e4fc5eef07bca582700c2975bd7 2017-11-16 13:19 +0000 [89ccab95c2] Corey Farrell * ccss: Remove silly usage of RAII_VAR. Change-Id: I5ce40035e0a940e4e56f6322c1dcd47fbd509b98 2017-11-16 12:51 +0000 [5e99c334d1] Corey Farrell * app: Remove silly usage of RAII_VAR. Change-Id: Ideb594f7aae134974fb78d5477ba0853b97b8625 2017-11-16 12:19 +0000 [abdd9fa1a8] Corey Farrell * aoc: Remove silly usage of RAII_VAR. Change-Id: I07907f833b81aeb0128bc9442a2abb52679c7511 2017-11-16 12:55 +0000 [48e1b39b28] Corey Farrell * abstract_jb: Remove silly usage of RAII_VAR. Change-Id: I9d56175369363d1dc735504cf78a3a5577069f49 2017-11-20 13:08 +0000 [d6bbcec571] Corey Farrell * res_mwi_external_ami: Remove incorrect load priority. res_mwi_external_ami specified AST_MODFLAG_LOAD_ORDER but didn't set load_pri, resulting in an actual load priority of 0. This module only provides AMI actions so it has no reason to load early. Change-Id: I82987fcf10d3ea42716b2f9df915b16687fd5839 2017-11-20 12:54 +0000 [58fa3885cc] Corey Farrell * Loader: Remove unneeded load_pri declarations. Instead of specifying AST_MODFLAG_LOAD_ORDER with load_pri AST_MODPRI_DEFAULT just use AST_MODFLAG_DEFAULT. Change-Id: I0123258eafce324249433a69df15a85cc16e509f 2017-11-20 09:49 +0000 [7397961b02] Alexander Traud * BuildSystem: pjsip_evsub_set_uas_timeout was not used. ASTERISK-27435 Change-Id: Id318a7ae6d7d69b53f911d30bf3eece64852f15c 2017-11-19 09:57 +0000 [b4f7f8250f] Corey Farrell * Build: Fix OSX build issues. OSX does not support 'readlink -f' or 'sed -r'. Replace readlink with the GNU make macro 'realpath'. Replace sed with grep in one place, cut in the other. ASTERISK-27332 Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748 2017-11-19 13:52 +0000 [999e0c17d7] Corey Farrell * Build: Fix issues building without SSL. * Fix conditional in libasteriskssl. * Use variables produced by configure to link the SSL and uuid libraries into libasteriskpj.so instead of hard-coding them. ASTERISK-27431 Change-Id: I3977931fd3ef8c4e4376349ccddb354eb839b58d 2017-11-19 13:28 +0000 [53f42cc052] Corey Farrell * res_pjsip: Fix warning by deferring implicit type cast. Mac doesn't like the comparison of -1 to an enum, so store the result of ast_sip_str_to_dtmf to an int so we can check for the negative return value. ast_sip_str_to_dtmf returns an int so this is only delaying the implicit type cast. Change-Id: I0c262c1719ee951aae1f437d733a301cf5f8ad29 2017-11-18 21:13 +0000 [75cb403775] Corey Farrell * tests: Fix warnings found on Mac. test_pbx used raise without explicitly including signal.h. On Mac for some reason nothing else includes it. test_logger checked if an unsigned int was negative. Switch the variable to 'int' so that error check can be effective. Change-Id: Ie1db5dd1818ac25cc2ae41b644f848b5865b1362 2017-11-18 20:25 +0000 [83a2c4d2ae] Corey Farrell * res_snmp: Declare RONLY if net-snmp headers do not. Some net-snmp builds do not provide the RONLY declare, only NETSNMP_OLDAPI_RONLY. Map RONLY to NETSNMP_OLDAPI_RONLY to get around this error. Change-Id: Ida5c7ad9406515825485c4d3b4a34fd6ad0da577 2017-11-18 20:02 +0000 [5a899fc503] Corey Farrell * res_fax: Remove checks for unsigned values being >= 0. It's impossible for gwtimeout or fdtimeout to be less than 0 because they are unsigned int's. Remove checks and unreachable branches. Change-Id: Ib2286960621e6ee245e40013c84986143302bc78 2017-11-18 19:50 +0000 [b4862e463c] Corey Farrell * iostream: Fix ast_iostream_printf declaration. This adds the printf attribute and changes 'fmt' from 'const void *' to 'const char *'. This resolves a warning from some compiler for vsnprintf needing a literal string for format. Change-Id: I71c33a8262590042ee451e1146760c10bb22fb78 2017-11-18 19:29 +0000 [2fab3aacd6] Corey Farrell * app_minivm: Fix possible uninitialized return value. Declare 'res' initialized to -1 to deal with earlier error paths that could cause 'res' to be returned uninitialized. Change-Id: I8ac2a5755bf4174d89ef893e924c940f702b104e 2017-11-16 02:47 +0000 [0ca406c202] Pirmin Walthert * res_rtp_asterisk.c: Fix rtp source address learning for broken clients Some clients do not send rtp packets every ptime ms. This can lead to situations in which the rtp source learning algorithm will never learn the address of the client. This has been discovered on a Mac mini with a pjsip based softphone after updating to Sierra: as soon as USB headsets are involved, the softphone will send the second packet 30ms after the first, the third 30ms after the second and the fourth 1ms after the third. So in the old implmentation the rtp source learning algorithm was repeatedly reset on the fourth packet. The patch changes the algorithm in a way that doesn't take the arrival time between two consecutive packets into account but the time between the first and the last packet of a learning sequence. The patch also fixes a second problem: when a user was using a wrong value for the probation setting there was a LOG_WARNING output stating that the value had been set to the default value instead. However the code for setting the value back to defaults was missing. ASTERISK-27421 #close Change-Id: If778fe07678a6fd2041eaca7cd78267d0ef4fc6c 2017-11-17 19:36 +0000 [9316a064fd] Corey Farrell * README: Send people to secure websites where available. We should be sending people to secure web URL's where available. Update README's and docs. Change-Id: Id5b1e049b0b18b49a784f1254605aefa244ce19a 2017-11-17 19:54 +0000 [5d0529c4d9] Corey Farrell * doxygen: Remove obsolete contents. Remove doxygen contents that have nothing to do with the current state of Asterisk. Change-Id: Ic072cc8641f9533a202990ccf275ce87e3efd95c 2017-11-17 09:57 +0000 [1b6e4c1175] Sean Bright * res_pjsip: Use reasonable buffer lengths for endpoint identification Domains themselves can be up to 255 characters long (per RFC 1035), so our current buffer sizes are wholly inadequate for many use cases. Change-Id: If3f30a68307f1365a1fe06bc4b854c62842c9292 2017-11-11 10:09 +0000 [b9f4bb5988] Corey Farrell * menuselect: Remove ineffective weak attribute detection. menuselect detects compiler support for multiple styles of weak functions. This is a remnant from 2013 when OPTIONAL_API required weak functions. It is no longer correct for menuselect to switch dependencies from optional to required based on lack of weak function support. Note an issue remains - dependencies should switch from optional to required based on OPTIONAL_API being enabled or disabled. I don't think this is possible. menuselect needs to know at startup if OPTIONAL_API is enabled or disabled, so the only way to fix this is to remove OPTIONAL_API from menuselect and create a configure option. I've left the code that switches in place but it's preprocessed out. Additionally removed: - WEAKREF variable from Asterisk makeopts.in. - Related disabled code from test_utils. - Pointless AC_REVISION call from menuselect/configure.ac. Change-Id: Ifa702e5f98eb45f338b2f131a93354632a8fb389 2017-11-16 09:48 +0000 [c4f11911ea] Corey Farrell * acl: Fix allocation related issues. Add checks for allocation errors, cleanup and report failure when they occur. * ast_duplicate_acl_list: Replace log warnings with errors, add missing line-feed. * ast_append_acl: Add missing line-feed to logger message. * ast_append_ha: Avoid ast_strdupa in loop by moving debug message to separate function. * ast_ha_join: Use two separate calls to ast_str_append to avoid using ast_strdupa in a loop. Change-Id: Ia19eaaeb0b139ff7ce7b971c7550e85c8b78ab76 2017-11-16 09:04 +0000 [781a520b73] Joshua Colp * bridge_basic: Ignore answer from transfer target when they've timed out. This is a fun one. Given the following attended transfer scenario: 1. Transfer target is called 2. Transferer hangs up 3. Transfer target call attempt reaches timeout 4. Transfer target is told to hang up 5. Transfer target answers before channel is hung up 6. Transferer recall target is called A crash would occur. This is because the transfer target call attempt, despite being told to hang up, would raise a recall target answer before the recall target had been answered. As it had not answered there would be no recall target channel and it would implode. This change makes it so that if the transfer target has been hung up we don't tell the attended transfer code that it has answered. We also clear out the stimulus that the recall target has been answered after telling the transfer target to hang up, in case it was able to raise the information before we told it to hangup. ASTERISK-27361 Change-Id: Ifb8b255a9c4d2c5c1b8ad77bf54f659ed286df99 2017-11-16 19:39 +0000 [a95f2994c6] Corey Farrell * aoc: Fix memory management issues. aoc_publish_blob failed to check for msg allocation error and never released msg. Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5 2017-11-16 16:18 +0000 [7a735d45e2] Sean Bright * res_pjsip_transport_websocket: Give transport a meaningful description We were not \0 terminating this string, so any attempt to print it would in the best case show an empty string and in the worst case potentially crash. Change-Id: I63d96ef8f7516ac02a0f91e22dfa8acdc615042c 2017-11-16 15:00 +0000 [6c53fb5d21] Sean Bright * res_pjsip: Use sorcery prefix operation for contact lookup This improves performance for registrations assuming that res_config_astdb is not in use. Change-Id: I86f37aa9ef07a4fe63448cb881bbadd996834bb1 2017-10-19 14:44 +0000 [d995064fb7] Nir Simionovich * This patch adds a beanstalk CEL backend. Beanstalkd is a simple to use job queue. It provides a means to create multiple job queues called "tubes". Each tube can store multiple jobs, with varying priorities with the queue. Queue processing is available via a simple TCP socket or via well defined libraries, avaialble at https://github.com/kr/beanstalkd/wiki/client-libraries This module is based upon the beanstalk-client library, available for download at: https://github.com/deepfryed/beanstalk-client This module currently doesn't support user defined events. Change-Id: Ic3a087faeeac045d69a2a018e60e29831ddb95ab 2017-11-09 19:58 +0000 [e793501084] Richard Mudgett * chan_pjsip.c: Improve answer failure log messages. * Balanced the session->inv_session refs on answer failure. Change-Id: I33542d639d37e692cb46550b972a5fcfc3b804b8 2017-11-14 18:00 +0000 [b7b800b689] Richard Mudgett * audiohook.c: Fix freeing a frame and still using it. Memory corruption happened to the media frame caches when an audio hook freed a frame when it shouldn't. I think the freed frame was because a jitter buffer interpolated a missing frame and the audio hook unconditionally freed it. * Made audiohook.c:audio_audiohook_write_list() not free an interpolated frame if it is the same frame as what was passed into the routine. * Made plc.c:normalise_history() use memmove() instead of memcpy() on a memory block that could overlap. Found by valgrind investigating this issue. ASTERISK-27238 ASTERISK-27412 Change-Id: I548d86894281fc4529aefeb9f161f2131ecc6fde 2017-11-15 12:10 +0000 [f512707362] George Joseph * app_record: Don't set RECORD_STATUS chan var until file is closed We've been calling pbx_builtin_setvar_helper to set the RECORD_STATUS variable before actually closing the recorded file. If a client is watching VarSet events and tries to do something with the file when a RECORD_STATUS event is seen, they might attempt to do so while the file it's still open. We now delay calling pbx_builtin_setvar_helper until after we close the file. ASTERISK-27423 Change-Id: I7fe9de99953e46b4bafa2b38cf151fe8f6488254 2017-11-07 08:25 +0000 [cf1cb3345e] George Joseph * ast_coredumper: Add ability to use directory other than /tmp The OUTPUTDIR environment variable can now be set either in the environment itself or in ast_debug_tools.conf. If set, it's used for all work products instead of /tmp. Also added the --tarball-config option that includes the contents of /etc/asterisk when either --tarball-coredumps or --tarball-results are used. Change-Id: I66b2553319df61caea5b313d084f51978f730b4c 2017-11-13 07:14 +0000 [29e0add14f] Joshua Colp * pjsip / hep: Provide correct local address for Websockets. Previously for PJSIP the local address of WebSocket connections was set to the remote address. For logging purposes this is not particularly useful. The WebSocket API has been extended to allow the local address to be queried and this is used in PJSIP to set the local address to the correct value. The PJSIP HEP support has also been tweaked so that reliable transports always use the local address on the transport and do not try to (wrongly) guess. As they are connection based it is impossible for the source to be anything else. ASTERISK-26758 ASTERISK-27363 Change-Id: Icd305fd038ad755e2682ab2786e381f6bf29e8ca 2017-11-13 17:47 +0000 [14253f9535] Corey Farrell * alertpipe: Correct documented return of ast_alertpipe_write. Change-Id: I4ea49c441890a81384144479dc93ab5a3989486d 2017-11-09 19:47 +0000 [edd1016dd8] Corey Farrell * core: Use ast_alertpipe for Asterisk signal monitoring thread. Reduce the signal monitoring thread file descriptor use from two to one on systems that support eventfd. Change-Id: Id4041a237d481ff699639e153ea6982fee14a462 2017-11-13 16:20 +0000 [cdaaa14a5f] Corey Farrell * core: Fix configuration of remote console socket path. The remote console socket path is the combination of asterisk.conf settings astrundir from [directories] and astctl from [files]. Unconditionally combine the two strings after processing all values to ensure we end up with the correct socket path. ASTERISK-27415 Change-Id: Ib1e2805d55d6b0955c6430a1a2a93acbf9b091e8 2017-11-10 10:37 +0000 [f6ebd16bb8] George Joseph * bundled_pjproject: sip_parser: Fix return code in pjsip_find_msg The default return code for pjsip_find_msg was PJ_SUCCESS so if a Content-Length header wasn't found at all, pjsip_find_msg was returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR. Also added the volatile keyword to a few variables that are used both inside and outside the PJ_TRY/PJ_CATCH block. Partial fix for ASTERISK_27408 Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a 2017-11-13 14:35 +0000 [2e7f6cd31b] Ben Ford * bundled_pjproject: Update to 2.7.1 Update from 2.7 to 2.7.1 for bundled pjproject. Changed version and removed patch files included in the update. Change-Id: I55cea8e734b318c2df9daf86aa0802c559ec8357 2017-11-09 08:21 +0000 [ffccce76d9] Sean Bright * sorcery: Add ast_sorcery_retrieve_by_prefix() Some consumers of the sorcery API use ast_sorcery_retrieve_by_regex only so that they can anchor the potential match as a prefix and not because they truly need regular expressions. Rather than using regular expressions for simple prefix lookups, add a new operation - ast_sorcery_retrieve_by_prefix - that does them. Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79 2017-11-07 17:07 +0000 [14d60cee0c] Corey Farrell * CLI: Create ast_cli_completion_vector. This is a rewrite of ast_cli_completion_matches using a vector to build the list. The original function calls the vector version, NULL terminates the vector and extracts the elements array. One change in behavior the results are now sorted and deduplicated. This will solve bugs where some duplicate checking was done before the list was sorted. Change-Id: Iede20c5b4d965fa5ec71fda136ce9425eeb69519 2017-11-07 14:00 +0000 [4930404715] Corey Farrell * vectors: Add new macro and a string vector definition. * AST_VECTOR_STEAL_ELEMENTS - steal the array of elements for use with non-vector code. * struct ast_vector_string - a vector of 'char *'. Change-Id: I104d1b204be03fccf67e02a195596adcb5ab1e42 2017-11-11 13:01 +0000 [90bb0a3e10] Richard Mudgett * core: Add cache_media_frames debugging option. The media frame cache gets in the way of finding use after free errors of media frames. Tools like valgrind and MALLOC_DEBUG don't know when a frame is released because it gets put into the cache instead of being freed. * Added the "cache_media_frames" option to asterisk.conf. Disabling the option helps track down media frame mismanagement when using valgrind or MALLOC_DEBUG. The cache gets in the way of determining if the frame is used after free and who freed it. NOTE: This option has no effect when Asterisk is compiled with the LOW_MEMORY compile time option enabled because the cache code does not exist. To disable the media frame cache simply disable the cache_media_frames option in asterisk.conf and restart Asterisk. Sample asterisk.conf setting: [options] cache_media_frames=no ASTERISK-27413 Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00 2017-11-11 09:42 +0000 [b865d29f1c] Richard Mudgett * frame.c: Make ast_frame_free()/ast_frfree() NULL tolerant Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793 2017-11-10 22:04 +0000 [96987737b9] Corey Farrell * menuselect: Delete and ignore aclocal.m4. This file is temporary output from the bootstrap.sh command, it does not need to be committed. Change-Id: Ie0fd113aff6eac44924c0bd0c900833c6c86a6d9 2017-10-30 22:09 +0000 [e9f8b317c3] Corey Farrell * Build: Make function constructor/destructor attributes mandatory. This change causes the configure script to fail if the C compiler does not support both function attributes constructor and destructor. These were already required as modules cannot function without these attributes and Asterisk requires modules. This also has AST_GCC_ATTRIBUTE set a variable ax_cv_have_func_attribute_$1. This is the same variable name used by autoconf-archive's AX_GCC_FUNC_ATTRIBUTE, used for the same purpose. Change-Id: Id68e8a1447f2a6d707c54b56350e7bfdb33fb663 2017-11-10 07:06 +0000 [96f2ee865e] Joshua Colp * pjsip: Add patch to allow all transports to be destroyed. If a transport is created with the same transport type, source IP address, and source port as one that already exists the old transport is moved into a linked list called "tp_list". If this old transport is later shutdown it will not be destroyed as the process checks whether the transport is valid or not. This check does not look at the "tp_list" when making the determination causing the transport to not be destroyed. This change updates the logic to query not just the main storage method for transports but also the "tp_list". Upstream issue https://trac.pjsip.org/repos/ticket/2061 ASTERISK-27411 Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429 2017-11-09 20:34 +0000 [bb77666620] Corey Farrell * core: Remove disabled code. handle_quit has been disabled since 2003, remove it. Change-Id: Idc3aaa6c81676160547078f9b71e8aa43de2db18 2017-11-09 13:24 +0000 [23b0ef3e9b] Corey Farrell * Build System: Disable parallel make in the root Makefile. This ensures that the root Makefile runs only a single target at a time. SUBMAKE will still honor requested parallelism, so 'make -j8' will build one directory at a time but allow 8 jobs at once when building a sub directory. This will fix some display glitches related to rebuild of XML documentation. It will also prevent some edge case errors where bundled pjproject needs to be rebuild before other parts of Asterisk. Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e 2017-03-29 20:46 +0000 [12010fc5c0] Richard Mudgett * chan_pjsip.c: Fix uninitialized cause value on failure. Change-Id: I3f9dd3c31bd582e54a30381500077de2319d8cc3 2017-11-08 01:40 +0000 [0bda39c668] Corey Farrell * DEBUG_FD_LEAKS: Add missing FD creators. This adds FD tracking for the following functions: * eventfd * timerfd_create * socketpair * accept ASTERISK-27404 Change-Id: Id6848fe904ade2d34eb39d2a20bd6b223e1111fc 2017-11-07 11:49 +0000 [05f557820b] Corey Farrell * bridge_softmix: Note why ast_stream_topology_set_stream cannot fail. This appeared in my audit o