2020-04-30 13:30 +0000 Asterisk Development Team * asterisk certified/16.8-cert1 Released. 2020-04-20 11:14 +0000 [fe3dc091b5] Joshua Colp * Revert "res_rtp_asterisk: Free payload when error on insertion to data buffer" This reverts commit fef8a04aadf759bf08f12827de18f970ae7e3e8c. Reason for revert: Waiting for future release. Change-Id: I67e9837a352b252f8a75ebaa9a5fb7e5b35d41f7 2020-04-20 11:14 +0000 [a75317ce24] Joshua Colp * Revert "res_rtp_asterisk: Resolve loop when receive buffer is flushed" This reverts commit 22bc8a71680e4099ffd3ccff7b3fe33d26291c36. Reason for revert: Waiting for future release. Change-Id: If924f0b7fa02a72b52c708aa80addc361a87b490 2020-04-14 10:48 +0000 [22bc8a7168] 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-14 10:31 +0000 [fef8a04aad] 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-06 14:56 +0000 [81d34554ab] Asterisk Development Team * Update for certified/16.8-cert1-rc5 2020-04-01 04:00 +0000 [25e2274e48] 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-16 05:11 +0000 [2af88e7ca2] 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 (cherry picked from commit 33b2c7f79b33693be502e4707c936f8dba392b5f) 2020-03-31 12:52 +0000 [3297df5a61] 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-26 11:48 +0000 [3d317239d5] Asterisk Development Team * Update for certified/16.8-cert1-rc4 2020-03-26 11:46 +0000 [096db19662] Asterisk Development Team * Update CHANGES and UPGRADE.txt for certified/16.8-cert1-rc4 2020-03-26 11:42 +0000 [c9cd681261] Joshua C. Colp * CHANGES: Change md file extension to txt. Change-Id: I168e2d3a65d444fb0961bd228257441fe718f6a7 2020-03-23 05:49 +0000 [bdf4d159fd] 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 [3d22ecb1e2] Joshua C. Colp * res_rtp_asterisk: Ensure sufficient space for worst case NACK. ASTERISK-28790 Change-Id: I10df52f98b19ed62575f25dab36e82d136dccd99 2020-03-17 15:54 +0000 [904f6b7c2f] 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-19 08:48 +0000 [aa04c3f49b] 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-04 15:45 +0000 [7ecbcdf22f] 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-04 09:43 +0000 [d1bb76a27d] Asterisk Development Team * Update for certified/16.8-cert1-rc3 2020-03-04 09:41 +0000 [b922e387d1] Asterisk Development Team * Update CHANGES and UPGRADE.txt for certified/16.8-cert1 2020-02-20 11:33 +0000 [4458b7a52a] 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-10 05:04 +0000 [d515dea9c6] 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 (cherry picked from commit b438d1d9adc8c5200214e41876e9abc02c5b5288) 2020-01-04 18:11 +0000 [5fccf6d1c6] 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-02-19 08:24 +0000 [7b8157645f] Asterisk Development Team * Update for certified/16.8-cert1-rc2 2020-02-13 13:39 +0000 [bb19e7feb5] 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-02-13 15:08 +0000 [43ca35b831] 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-07 14:42 +0000 [476bbcf3a3] Asterisk Development Team * Update for certified/16.8-cert1-rc1 2020-02-07 14:22 +0000 [b3a0387fc0] Asterisk Development Team * Update CHANGES and UPGRADE.txt for certified/16.8-cert1 2020-02-07 13:44 +0000 [7416703f04] 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 2020-02-05 10:37 +0000 [443230f5d5] George Joseph * Asterisk Certified 16.8 Preparation * Updated .gitreview default branch to certified/16.8 * Updated .version to certified/16.8 * Set all extended support modules to be disabled by default Change-Id: I11c9b5f33865fb541192a786dc25dddf8558e09b 2020-02-04 08:18 +0000 [40e331ff90] 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 [8b0922a101] 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 (cherry picked from commit bfe9e1b2e7a489b7eb49a98d290f2e3a68a34dca) 2020-02-04 09:03 +0000 [d436f56858] Asterisk Development Team * Update for 16.8.0 2020-02-04 07:35 +0000 [126beb3e6c] Joshua Colp * REVERT: Add option to suppress the Message channel AMI and ARI events This reverts commit bfe9e1b2e7a489b7eb49a98d290f2e3a68a34dca. Reason for revert: Per discussion on IRC we're sticking to policy. Change-Id: I61691a9ffa1bc30807cbe618a4a72b4d214481aa 2020-02-03 10:24 +0000 [bfe9e1b2e7] 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-30 10:36 +0000 [c92e2bb09f] Asterisk Development Team * Update for 16.8.0-rc2 2020-01-27 11:44 +0000 [1627e8eddc] 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 (cherry picked from commit dc9875815c441bcb78370cbf0d331ec46e7abb1d) 2020-01-27 12:01 +0000 [42c51263b9] 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 (cherry picked from commit e103339f02f0445b8c77b1c3c6f7d1c80e37f675) 2020-01-28 09:18 +0000 [939e18d63e] 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 (cherry picked from commit 4d32f5747c2db25d63005bbb94ee9d27e09059c2) 2020-01-23 10:40 +0000 [b7b813eb34] Asterisk Development Team * Update for 16.8.0-rc1 2020-01-23 10:12 +0000 [eb1ec0498d] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.8.0 2020-01-22 12:56 +0000 [1b452ebb51] 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 [a2a4e1026c] 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 [9895e94dba] 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 13:53 +0000 [efecc9d139] 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 [a7aaca9eaa] Sean Bright * func_odbc.conf.sample: Add example lookup Change-Id: Ia05aab1f579597963d2ea23920d2210cfcb97c84 2020-01-20 11:18 +0000 [04c81f9748] Sean Bright * res_statsd: Document that res_statsd does nothing on its own ASTERISK-24484 #close Reported by: Dan Jenkins Change-Id: I05f298904511d6739aefb1486b6fcbee27efa9ec 2016-09-30 21:56 +0000 [f49517efb9] Rodrigo Ramírez Norambuena * queue_log: Add alembic script for generate db table for queue_log Change-Id: I35b928a6251f9da9a1742b2cd14c63a00c3d0f0c 2020-01-16 13:47 +0000 [13fa33588f] 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 [f5a1e8b04d] 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 [31027f33db] 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 [293600724d] 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 [e379fe48e1] 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-11 07:29 +0000 [5fded77e7f] 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-13 16:37 +0000 [fbe18165d5] 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 2020-01-10 13:30 +0000 [f69da94fab] 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-10 15:13 +0000 [8d87fef5a1] 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 [0a56edca4d] 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 [b92b0469ff] 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 [0c07a7ee00] 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 [de078debab] 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 [4cf32f2578] 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 [8318b05f25] 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 [f8b0c2c933] 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 [64692a3c72] 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 [a7692ce2f4] 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 [dd82ebecd3] 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-29 22:38 +0000 [144b774b85] 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 [2780be334d] 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 [11753d94d8] 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 [00e745066c] Richard Mudgett * app_chanspy.c: Reduce log message level from notice to verbose. Change-Id: Ica5f38ccd8cdc077aef14d0c50425e0b29ac7e0a 2019-12-29 17:31 +0000 [198f4cbdbf] 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 [992dcdf780] 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 [60fd1322d7] 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 [47ba42f4a0] 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-12-17 18:20 +0000 [b9b50774f5] 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-08-28 05:07 +0000 [e54299cd3e] 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-12-03 05:58 +0000 [82a870c8c7] 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-12-27 17:29 +0000 [efa13eb0a0] 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 [a78758d0a2] Sean Bright * config.c: Skip UTF-8 BOMs if present when reading config files ASTERISK-28667 #close Change-Id: I4767ed365c98f3e1587b7653321048a31d8a53b2 2019-12-17 07:38 +0000 [b8e635916f] Pascal Cadotte Michaud * sip_to_pjsip.py: Fix trustrpid typo ASTERISK-28664 #close Change-Id: I6c28b1002fd7075ae0ed36f026f8c1855c9418a6 2019-12-16 06:35 +0000 [7167fd6d46] 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 [5622df0a94] 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 [186c4e9b36] 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 [d17bbcb9f1] 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-11-27 11:34 +0000 [aa06c6ea29] 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-12 05:03 +0000 [9240fcd8bb] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.7.0 2019-12-04 02:35 +0000 [77941efad9] 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 [2d2b28bfa4] 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 [9c29c3fb3e] Joshua Colp * Revert "PJSIP_CONTACT: add missing argument documentation" This reverts commit 174e6426aa8a8c26d83c5e06cfbc77277c2f5934. 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: I2c9656fb40b2d2f56f54caa35c8be02cc92babd0 2019-12-04 15:01 +0000 [8af0dea0c7] 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 [055737d645] 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 [63b8664bfa] 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 [68ce999351] 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 [5c20cc4c3a] 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-04 03:33 +0000 [161e762742] 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 [fbc80db350] 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 [43d4c0e3c9] 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 [80199cd67f] George Joseph * CI: Turn off shallow cloning altogether Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196 2019-11-27 12:11 +0000 [31173f6586] 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-11-25 06:55 +0000 [c91b28c72d] 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 [bd3cb1b300] 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 2019-11-21 15:11 +0000 [9eb86a8110] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.6.2 2019-11-15 11:34 +0000 [efef44985d] 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-11-21 12:48 +0000 [e013f502b1] 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-10-21 14:55 +0000 [8cdaa93e65] 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 [7574be5110] 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 [174e6426aa] 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 [3cd57aaff2] Kevin Harwell * res_pjsip_outbound_registration: add support for SRV failover ASTERISK-28624 Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561 2019-11-19 12:11 +0000 [d075d8913b] George Joseph * CI: Fix missing script block in jenkinsfiles Change-Id: I9f44a3d5085ea7880fad1a3883a4820907e29ea3 (cherry picked from commit 95213b01d2d5e72e38b40c30fa5d0c8cf4b37b16) 2019-11-19 11:40 +0000 [ce8a23fdf9] George Joseph * CI: Fix missing script block in jenkinsfiles Change-Id: Ib4b6e4887695f230ea7a5b0c879b29fc5a13be4f (cherry picked from commit d60f23ecbdb748b188da424c92335152941c7673) 2019-11-19 08:51 +0000 [919bc0c7be] 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 [61a3e7e79b] 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 [cf5b7f3a0b] 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 [faf353e931] 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 [8894a56452] lvl * app_senddtmf: Add receive mode to AMI Action PlayDTMF ASTERISK-28614 Change-Id: I183501297ae1dc294ae56b34acac9b0343eb2664 2019-11-14 04:19 +0000 [eb54e381fd] 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 [e39ddb1cb1] 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 [3891a953cf] 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 [30c0af7257] 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 [37dcdd485a] 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 [b9bbf39449] Joshua Colp * parking: Fix case where we can't get the parker. ASTERISK-28616 Change-Id: Iabe31ae38d01604284fcc5c2438d44e29a32ea4d 2019-11-12 05:00 +0000 [e7320bbbf0] 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 [6f0a69c51a] 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-06 05:47 +0000 [40c49ec64f] 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-07 10:56 +0000 [6be18dfb72] 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-10-29 08:35 +0000 [be4c6f3f35] George Joseph * cdr_mysql: Fix missing use of 'my_bool' with MySql >= 8.0.1 MySql 8.0.1 replaced the "my_bool" type with "bool" so an #if was added to use "bool" with MYSQL_VERSION_ID >= 80001. ASTERISK-28604 Change-Id: I66a28d8f0011e33774edee13a6f8efd2302bb920 2019-10-25 06:46 +0000 [95bc698b85] 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 [ccaf735d1f] 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 [6e22e1213e] 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 [e627db7928] 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 [bfd0e05e59] 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 03:13 +0000 [c73aaa2760] 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: Ib7c7f39996d942984394782296bb99aae67862e5 2019-10-17 05:50 +0000 [ef2eb064b2] 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 [2666a5e111] Sean Bright * README-SERIOUSLY.bestpractices.md: Speling correetions. ASTERISK-28586 #close Change-Id: I43dc4e8bd9dc685b17695b215a5360314074734f 2019-09-26 19:24 +0000 [b41a8fd0f3] 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 [ed12715cbe] 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 [6c54bd704e] 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 [17e71b6abe] 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 [867c8b2879] 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 [cb6e0d36ae] 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 [a66848c92f] 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-02 11:37 +0000 [3f12cd7711] 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 11:24 +0000 [afc10c25ac] 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 11:34 +0000 [931ef77e21] 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 [495bc77a6a] 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 [ce1e0714ba] 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-10-01 06:29 +0000 [19565e0b90] lvl * chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel ASTERISK-28086 #close Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea 2019-09-19 03:56 +0000 [9a933c3adc] 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-27 09:54 +0000 [1f10ca76da] Sean Bright * res_pjsip_transport_websocket: Don't put brackets around local_name if IPv6 ASTERISK-28544 #close Change-Id: I8e62c444d107674c298f472e3545661de8a80dce 2019-09-24 14:18 +0000 [04f7d136d8] 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-26 10:35 +0000 [d146ec7e83] Asterisk Team * Revert "Update CHANGES and UPGRADE.txt for 16.6.0-rc2" This reverts commit a0844a9b9bbe313c524bca82550e7ec1ed2fe928. Correcting/reverting accidental upgrade on release process. Change-Id: I08746eda578effa6e64054690fad48a17d2f42e7 2015-03-27 17:34 +0000 [85c7326d08] Jonathan Rose * basic-pbx: Bring forward queue configuration from 13 Original commit: cfbf5fbe918bc34f3d600760fc0b6f13a3a9a0ed Change-Id: I34a841d73c429ca8d944481f8dccb756ee231c9c 2019-09-25 11:01 +0000 [0514559005] 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 [827dd754b2] 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-25 12:53 +0000 [a0844a9b9b] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.6.0-rc2 2019-09-24 17:43 +0000 [41cd1ff454] 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-24 11:21 +0000 [9ff11c2f00] 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-22 21:04 +0000 [cd51f5b876] 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-24 09:40 +0000 [5ea667e03a] 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 [789c51ac8a] 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 [fec6e1bd87] 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 [bd96a0b79d] 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 [9c5a8066a6] 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-20 08:29 +0000 [5b8c1ed0d3] 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 11:06 +0000 [76d4a42ae1] Corey Farrell * res_pjsip_mwi: Remove inappropriate topic unreference. ast_mwi_topic() returns a borrowed reference which should not be unreferenced, doing so leads to a FRACK. This was hidden by the fact that stasis_cache.c leaked the result of cache_remove in caching_topic_exec. Change-Id: I51101bf7d07b8dc8ce8fc46b6cb31fbbd213fbc7 2019-09-19 10:53 +0000 [256db889f2] Corey Farrell * app_voicemail: Fix module unload leak. Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a 2019-09-06 08:18 +0000 [6647be69ac] 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-09-18 06:56 +0000 [9f304170f6] 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-15 14:35 +0000 [49e1346185] 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-09-14 10:05 +0000 [448b8c9bc2] 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-03 12:20 +0000 [a95cef7140] 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-12 16:04 +0000 [688908fe7a] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.6.0 2019-09-11 15:58 +0000 [518b6bfb5c] 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-22 07:44 +0000 [f85631cf82] 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-08-27 17:44 +0000 [b478f46d59] 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 [922d3e02df] 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-08-05 06:59 +0000 [d566314e38] 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-08 10:38 +0000 [bf527810ef] Sean Bright * codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary ASTERISK-28511 Change-Id: If0d58598ce14aad3c786a1c0127b5f7b200b737d 2019-09-05 10:52 +0000 [c6b17b5212] 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-09-05 11:09 +0000 [c8cf3ad389] 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-08-26 07:53 +0000 [2691ee7e10] 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 [965df3c228] 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 [a321225fa4] 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 [92261d60c8] 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 16:24 +0000 [7db5f5df6a] 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 [78d00c277c] 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 [821b7561f8] 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 [cdbb9800e3] Sean Bright * codec_resample: Upgrade speex_resample to fix up-sampling bug ASTERISK-28511 #close Change-Id: Idd07bf341e89ac999c7f5701d9b72b8a9cb11e82 2019-08-22 13:19 +0000 [aaaa1695ca] Alexei Gradinari * Fix misname 'res_external_mwi' to 'res_mwi_external' in comments. Change-Id: Ic784be8500e5cb75dcb34bae9f03cfd93b6b34fb 2019-08-21 13:29 +0000 [c00a010fe8] 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 [6407ccd2d9] 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 [c8cc530726] 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-07-30 12:08 +0000 [fb984eda40] 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-20 13:04 +0000 [f82d0b74fd] 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 [51fd43206b] 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-08-14 14:52 +0000 [ff180a5bfc] 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 [8399211eaf] 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 [92066b8746] George Joseph * CI: Escape backslashes in printenv/sort/tr Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94 (cherry picked from commit c6558e09af3ac15b31377de735cc96d8df0275a7) 2019-08-07 17:54 +0000 [d4766a82a2] 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 [db9684ad1e] 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 [6350f4e278] 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 [2641081caa] 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 [6bb14150c4] 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 [9718376902] Sean Bright * res_musiconhold: Use a vector instead of custom array allocation Change-Id: Ic476a56608b1820ca93dcf68d10cd76fc0b94141 2019-08-01 05:07 +0000 [c2b135729c] 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 [83390327b2] 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 [0ebfc4a19d] 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 10:04 +0000 [d6af1acb8c] Sean Bright * res_musiconhold: Use ast_pipe_nonblock() wrapper Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2 2019-07-29 08:31 +0000 [05cf9c9912] 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-24 15:15 +0000 [06780d2bc4] 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 [28654308ef] 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 [3814faf848] Leonid Fainshtein * openr2(6/6): Set hangup cause Change-Id: I94dc38920e6e77cc73062648f62fdd613d0d1452 Signed-off-by: Oron Peled 2019-04-22 14:14 +0000 [06515707df] 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 [93a093f6c4] 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 [a45cfefb77] 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 [ec6e88592a] 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 [7b6df814a6] 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-19 11:20 +0000 [356f4256cc] 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-04-02 14:42 +0000 [f4896703b9] 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-07-04 19:46 +0000 [9d69469203] Rodrigo Ramírez Norambuena * README.md: Update year Change-Id: I746fb94d112c7d797e206bca0fd1e13fcd26bae3 2019-07-19 08:38 +0000 [c86c0973ff] 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-18 06:07 +0000 [cb831a18d1] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.5.0 2019-07-17 08:06 +0000 [64d25d36fb] 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 08:15 +0000 [f62d9013c1] George Joseph * Build: Add separate header install/uninstall targets Two new Makefile targets have been added... "install-headers" and "uninstall-headers" to separately control header installation. The existing behavior has not changed so "make install" and "make uninstall" will continue to also install/uninstall the headers. The new targets were added for forward compatibility with Asterisk 17 in which the headers are no longer installed/uninstalled with the "install" and "uninstall" targets. Also corrects an issue where /usr/include/asterisk.h was never being removed at all. Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643 2019-07-09 14:42 +0000 [88ea395c33] 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 [1756029237] 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 [2126dc3021] 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 [6c59df17a5] 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-07-01 16:57 +0000 [da1db4f842] 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 [83aba363fe] 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-27 15:04 +0000 [0dc61e41fa] 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 [2db5173b88] 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-06-24 08:30 +0000 [31d755e805] George Joseph * sig_pri: Address gcc9 issues A few more format truncation issues addressed. Change-Id: I047f373169caaca0eec4889d3c0e5e10f130017a 2019-05-21 01:38 +0000 [52a3d4a761] 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-06-19 11:58 +0000 [01712bbdc9] 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-17 12:11 +0000 [1ee2f01f62] 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-14 15:45 +0000 [8b77318a2c] 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-10 16:58 +0000 [ccc92b6ecb] 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 [694097ee68] 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 [82789aafd6] 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-06-06 07:48 +0000 [72f26aa8eb] 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-01-08 00:14 +0000 [a1c84709b8] 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 [c2621aa190] 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-21 14:12 +0000 [86cd77ec0a] 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-05-29 17:54 +0000 [6321b559b9] 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-05-30 12:08 +0000 [d2c07aceca] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 16.4.0 2019-05-28 17:15 +0000 [e77704f45c] 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-28 15:35 +0000 [e0a574253e] 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-24 09:01 +0000 [ec74fd56a7] 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 [86fb72c4d0] 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-21 11:29 +0000 [9351aa3f0e] 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-21 14:53 +0000 [db5bc0fabf] 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-05-17 17:45 +0000 [9516fb64c9] 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-20 12:45 +0000 [33ed2e1bb8] 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 [79b15d0b30] 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 [de82bdd746] 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 [e7734476c6] 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 [ece29db9bd] 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 [941dead08d] 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 [edc3e0df1a] 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 [9a0fa51443] 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 [543d487746] 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 [5002169d6a] 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 [39c5188bec] 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 [f599ebd29e] 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 [d861ebdca8] 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 [5023f02b2d] 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 [1d214a3623] 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-23 09:47 +0000 [8d35a30a3f] 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 [d6b37e2926] 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 13:48 +0000 [e3a758975d] 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-22 11:12 +0000 [e281911667] George Joseph * ARI: Bump non-breaking version number to 4.0.2 main/json.c: Added app_name, app_data to channel type res/res_ari: Added ARI resource /ari/channels/{channelId}/rtp_statistics res/res_ari: Added timestamp as a requirement for all ARI events Change-Id: I6363f2a3e757cfd59b2ee5d056388ec47659a0c9 2019-04-07 11:36 +0000 [4dcfa8d127] 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 [daed593cfa] 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 [7487fc88d2] 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 [eca8c440d2] 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-16 10:58 +0000 [022e784b7a] 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 [18fe583d12] 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 [d0a8334e4f] 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 [9b7a64cbf0] 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 [34b9b65098] 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 [898765d919] 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 [116dc9c9b3] 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 [ea3109beaa] 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 [71c7864d1d] 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 [f91262272e] 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 [eec16b8e99] 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 [acfbfef8ad] 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 14:57 +0000 [ef404fef91] 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 [85bbb7a3e8] 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 [7e5b4b8616] 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-03-21 18:09 +0000 [d5a318f148] 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-04-02 15:49 +0000 [8ec4de7501] 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 [1464a6b80f] 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 [8961d9ca8b] 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 [94eeba6147] 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-27 14:30 +0000 [ae1aeb930e] 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-01-26 15:51 +0000 [5815597a21] 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-02 05:37 +0000 [bbc13b1f1f] 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-26 13:07 +0000 [d4cd2a9706] Sean Bright * pjproject: Add timer patch from pjproject r5934 ASTERISK-28161 #close Reported by: Ross Beer Change-Id: I65331d554695753005eaa66c1d5d4807fe9009c8 2019-12-23 20:15 +0000 Asterisk Development Team * asterisk certified/16.3-cert1 Released. 2019-12-04 15:01 +0000 [3f770e50d6] 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-11 18:03 +0000 [b6572d35e4] 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-11-22 10:39 +0000 [f9b6586020] 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-11-25 06:55 +0000 [bafd5f9908] Joshua Colp * parking: Fall back to parker channel name even if it matches parkee. ASTERISK-28631 Change-Id: Ia74d084799fbb9bee3403e30d2391aacd46243cc 2019-11-22 09:40 +0000 [e4b024ec11] Ben Ford * gitreview: Point to correct branch. Change-Id: I6f709a45a0d4ebadf8d51f64bd3509b1382d0496 2019-10-21 14:55 +0000 [e989cb4590] 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 [4e80a32ebd] 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-20 12:56 +0000 [c551fd3ec9] Kevin Harwell * res_pjsip_outbound_registration: add support for SRV failover ASTERISK-28624 Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561 2019-11-15 04:46 +0000 [de568ddcd4] Joshua Colp * parking: Fix case where we can't get the parker. ASTERISK-28616 Change-Id: Iabe31ae38d01604284fcc5c2438d44e29a32ea4d 2019-11-12 05:00 +0000 [728a1ba77a] 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-09-24 11:21 +0000 [a801a7dae2] 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-23 11:01 +0000 [d811289498] 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-15 14:35 +0000 [38c4d43820] 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-20 15:05 +0000 [93736ffc7f] 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 (cherry picked from commit 965df3c228d49bcde3503e0482f3c831dcbf6c77) 2019-09-04 16:19 +0000 [eac6f2b0a2] 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-08 12:10 +0000 [e5b33bb979] George Joseph * CI: Escape backslashes in printenv/sort/tr Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94 2019-08-08 07:12 +0000 [a9aa952e0f] 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-06 10:40 +0000 [475a8214fe] 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-07-26 08:40 +0000 [0a9a04338d] George Joseph * .gitreview: Update defaultbranch for certified Change-Id: I3dc35bdd6df92595f6941e92257986943fb50c2e 2019-07-24 15:15 +0000 [e6622f6697] 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-06-12 13:03 +0000 [e3180a9ef0] 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 [f087d70ed0] 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-05-17 18:44 +0000 [3489fd015e] 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-20 12:45 +0000 [b62f3acd83] 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-21 12:26 +0000 [43e1757b10] George Joseph * Prepare certified/16.3 * Update all extended and deprecated modules to set defaultenabled = no * Change .version to certified/16.3 Change-Id: Idc92d5c797678fba755536fe4a27297d959f67e9 2019-04-04 09:49 +0000 [60a3800ed2] Asterisk Development Team * Update for 16.3.0 2019-04-03 10:24 +0000 [c4027dbf2d] 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-04-01 09:55 +0000 [481e41a537] Asterisk Development Team * Update for 16.3.0-rc1 2019-03-29 08:07 +0000 [6f5a6072ab] 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 [64279e5992] 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-03-27 11:03 +0000 [636e301f91] 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-26 16:55 +0000 [3e5b26ae0a] 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-25 06:34 +0000 [4d8cd2efbe] 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 18:05 +0000 [e51bd0726b] 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-06 16:21 +0000 [6d455487d9] 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-25 14:31 +0000 [d905602a04] 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 [634314c727] 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 [ce5bed44e4] 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 [7bdde83f2c] 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 [9e36707dca] 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 [057c7380be] 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 [0426e0fede] 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 [f5f977baec] 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-09 08:39 +0000 [342550e0ea] 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 [03c0d19cc8] Joshua Colp * stasis: Allow empty application arguments to move. Change-Id: I1e4d37415f3034abe36496dc30209c2303e6af5c 2019-03-12 15:54 +0000 [6a435723f7] Kevin Harwell * AMI/ARI: Bump non-breaking version numbers Increasing the non-breaking AMI and ARI version numbers due to changes and additions in those API's. Note, some changes may be forthcoming (will be added between now and the next release of Asterisk), thus not listed here. As well a few changes listed below may have been released in a previous release of Asterisk, but the API version numbers were not increased at that time, so including here. AMI: * app_queue: set the wrapuptime from AddQueueMember application - e806990 * res_pjsip: option for ContactStatus event updates - 7f22c9f ARI: * bridging: Add creation timestamps - 0d70120 * res_stasis: Add ability to switch applications - 50a4b61 * ARI event type filtering - 1c5def4 * Added ARI resource /ari/asterisk/ping - 19fc99a ASTERISK-28314 Change-Id: Iebc813840f8230afa6b20579772e15549064b787 2019-03-12 13:25 +0000 [a71ae3dc44] 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-07 13:48 +0000 [47c853f8e1] 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 [b886fef66e] 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-03 09:20 +0000 [ca8f254f0f] 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-05 08:15 +0000 [c9459b1875] 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-08 14:12 +0000 [8ca74d73f1] Sean Bright * res_musiconhold: Remove redundant option parsing Change-Id: I481fabd8eaf2e4e7ffb5c8285b294742826e7d12 2019-03-04 01:50 +0000 [4ca41caf38] 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 [641b6041c7] 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 [5b5aa05bd9] 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 [4860954540] Sean Bright * Replace calls to strtok() with strtok_r() strtok() uses a static buffer, making it not thread safe. Change-Id: Icce265153e1e65adafa8849334438ab6d190e541 2019-03-07 16:05 +0000 [90f06ad169] Sean Bright * samples: Fix comment typo in pjsip.conf.sample Change-Id: I84a45c3d9fd26ca61aca99927eec83b57f1de857 2019-03-07 07:41 +0000 [50a4b618fc] 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-06 07:20 +0000 [e7dd4bd4a9] 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-04 16:05 +0000 [88681ba9bb] 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 [0cfafb89b5] 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 [6a714c0e9f] 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 [0d7012044a] 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-03-01 15:17 +0000 [63a3321c46] Rodrigo Ramírez Norambuena * CHANGES: Document addition of 'wrapuptime' argument to AddQueueMember() Change-Id: Ieb332d018ae3f2fc82b9465381fde0f299af1611 2019-02-28 10:01 +0000 [ffe07772e6] 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-02-28 15:36 +0000 [625af27a28] 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-01-30 13:25 +0000 [61585af9bd] 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 [6f1c0e787c] 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 [fe694de299] 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-27 19:09 +0000 [edf31624a2] 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-02-20 11:03 +0000 [b3ebb51086] 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 [6e8cba39a4] 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 [8402189892] 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 [5b8db4e422] 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 [cab8a76ae3] 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 [9905cccb7b] 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 [0896e4cdc6] 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 [a1391aa26b] 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 [bb8903b00e] 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 [4b6c60b362] 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 [2f8def1453] 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:21 +0000 [1c5def4b18] 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 2018-12-11 08:15 +0000 [e806990be2] 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-14 17:09 +0000 [08ba504e99] 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 [3fe40c0c05] 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-19 10:06 +0000 [3a2db0ee04] 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:12 +0000 [e85f92f37a] 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 2019-02-12 03:50 +0000 [01b781b4dc] 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 10:54 +0000 [b327b0bbda] Chris Savinovich * Revert "Test_cel: Fails when DONT_OPTIMIZE is off" This reverts commit 05b79d16ab93b038b39412e2570a21205eb499c4. Change-Id: I2e64fc22c33b10cfd592681732fc67ae0669a301 2019-02-07 09:52 +0000 [1084b6e1a1] 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 [2cf3931379] 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 [44254d548b] 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 [e3e3027092] 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 [419db481d1] 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-01-28 17:21 +0000 [19fc99a2fb] 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-02-04 13:55 +0000 [f29da72969] Sean Bright * sounds: Sort 'core show sounds' output Change-Id: Ib39052a745040f75eb635f15a042da15b20e22ab 2019-01-29 10:48 +0000 [1051e1dd18] 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 [70fa6e6955] 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-15 17:20 +0000 [9c3b4dcf80] 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 [603143bd5a] 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 [f6452f9656] 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 [c1da2e94a3] 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 07:59 +0000 [d3a6714158] 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-23 04:45 +0000 [907d71b551] 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 2018-12-16 06:43 +0000 [f6cf837aed] 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-22 15:03 +0000 [735bd4d185] 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 [05b79d16ab] 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 [dbef559e0b] 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 [f1fb249132] 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 [9c11399be3] 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 2019-01-18 16:11 +0000 [fb6e0df173] 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 [6506c5b1d4] 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 [fcd07c34fb] 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 [011e46d5a6] Sean Bright * sched: Make sched_settime() return void because it cannot fail Change-Id: I66b8b2b2778f186919d73ae9bf592104b8fb1cd5 2019-01-08 01:38 +0000 [21a1feece2] 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-04 17:14 +0000 [44a862fb57] 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-07 12:04 +0000 [4b24da607e] 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: Ied0451f378a3f2a36acc8c0984959a69895efa17 2019-01-05 11:14 +0000 [d2c182b6ab] 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 2018-12-18 13:47 +0000 [7f22c9f4b7] 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 [c6271155fb] 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-04 09:57 +0000 [c0e57e458b] 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 [92298434bd] 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 [2d9482695d] 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 [f196078705] 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 12:30 +0000 [44a7faca21] Corey Farrell * stasis: Fix ABI between DEVMODE and non-DEVMODE. Create compatibility stubs for maximum ABI compatibility. ASTERISK-28212 #close Change-Id: I872c04842ab6b61e9dd6d37e4166bc619aa20626 2018-12-26 10:24 +0000 [ff2ed4eeee] George Joseph * Revert "stasis_cache: Stop caching stasis subscription change messages" This commit caused issues with polling when combined with the revert commit "Revert "app_voicemail: Remove need to subscribe to stasis" This reverts commit 17d6d9e1e7d0db04ebd8d2e0cd9e087ec5462e2f. ASTERISK-28222 Reported by: abelbeck Change-Id: Ib6a16cbe2c0b74c76c64264f525ab647959c1483 2018-12-24 11:42 +0000 [3efe5061d5] 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 [59717b5e85] 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 [aebb822d1f] 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 [970805180e] 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 [f60afac587] 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 [640aac768b] 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 [2610379605] 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 [68ec7d93e8] 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 [9febdba05b] Sean Bright * Use non-blocking socket() and pipe() wrappers Change-Id: I050ceffe5a133d5add2dab46687209813d58f597 2018-12-11 09:06 +0000 [16ae8330d2] 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 [9c9519796b] 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 [df0b59564e] George Joseph * Revert "RTP: reset DTMF last seqno/timestamp on voice packet with marker bit" This reverts commit 331c906c4811df17612efa5c31e19df7186b1c81. Pending resolution of ASTERISK_28200 Change-Id: Ie7172707b603c1da3f200613bd4473335af75128 2018-12-06 11:23 +0000 [59cf552dd3] 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 [8a18fb81c1] 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 [79899db740] 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-04 18:00 +0000 [6071ad77f5] 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 15:28 +0000 [1657508ddd] 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-05 09:37 +0000 [a6c2662404] 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 [12a30c71d8] Kevin Harwell * pjsip_add_use_callerid_contact: fixed alembic script Change-Id: I413f1583c797fb79651786cd8d0b003599f8ed10 2018-12-03 16:41 +0000 [27806fd04d] 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 [1f09c61804] 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-30 14:00 +0000 [60e548ffa5] 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 [5de36abd5a] 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 [a2a8a41db3] 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-10-22 07:47 +0000 [aa004295f9] 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-26 16:18 +0000 [a5e77e9c37] 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-11-26 06:09 +0000 [606304eb54] 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 [331c906c48] 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 [ed7a5664b6] Corey Farrell * astobj2: Eliminate usage of legacy ao2_container_alloc routine. Replace usage of ao2_container_alloc with ao2_container_alloc_hash or ao2_container_alloc_list. ao2_container_alloc is now restricted to modules only and is being removed from Asterisk 17. Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088 2018-11-14 05:02 +0000 [0d2b39065f] 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-11 10:29 +0000 [1b6df87816] 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-11-16 14:45 +0000 [72e532136c] 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 [729967e99c] 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-18 17:53 +0000 [d05c219aad] 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-19 07:00 +0000 [f9b9bdd0b0] 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 [41eab5b3b8] 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-16 20:33 +0000 [cb83350230] 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-13 09:28 +0000 [e6005f1227] 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 [8d436a95e7] 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 [dd0a3c0bba] George Joseph * CI: Add tmpfs to all jenkinsfiles Change-Id: Ida29d70d48d5f39aabf0b25c66b51f79324a8cba 2018-11-17 15:40 +0000 [77e9c877b5] 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 [0552bc2a94] 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-15 11:41 +0000 [7ba8f32632] 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 [699dfa9401] 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 [3bdf6ac918] 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 [2a76489eba] 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 [7b2282c890] 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 [a36cd6960c] 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 [009d67cd28] 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 [89d97da8a4] 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 [df703c1853] 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 [05c79fdf06] 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 [3cde7e30ba] 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 [1c008c6de5] 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 [07a59b783e] 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 [9c9bc5acca] 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 [03efafbd4d] 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 [3e3f3bfb07] 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 [27897a850d] 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 [7f6ac5dc2f] 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 [a6d1723727] 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 [9c5e75acb0] Joshua Colp * res_pjsip: Add XML documentation for "use_callerid_contact" ASTERISK-28087 Change-Id: I69d48813ec514f5ef06c6de994cba52630e0a3b4 2018-10-30 10:52 +0000 [719daf3299] Richard Mudgett * alembic: Fix use_callerid_contact option add script. ASTERISK-28087 Change-Id: I046d018015427d0916fab571b5a4f5367476f729 2018-10-12 16:46 +0000 [5cbe77cc46] 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-26 16:18 +0000 [fbee505611] 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-27 09:59 +0000 [6c2f9b730e] 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-02 07:31 +0000 [3ba66b8a9d] 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-17 19:34 +0000 [fbb577577c] 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 [190b3d7412] 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 [11427a9665] Richard Mudgett * modules.conf.sample: Update preload usage documentation. Change-Id: Id449d4435c38148b56ac4cfd61ae4d90ac66bb90 2018-10-16 07:02 +0000 [fec66b8f01] 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-16 14:06 +0000 [dee1165d31] Corey Farrell * astobj2: Eliminate usage of 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 still available for use but only in modules. Only ao2_container_alloc remains due to it's use in over 100 places. Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a 2018-09-28 13:31 +0000 [90887af808] 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 [00284352b3] 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 [495a1e7e5c] 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 12:32 +0000 [2384d6eb87] 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 [718ccd51a3] 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 [7687630074] Richard Mudgett * modules: Add missing run time module support levels. Change-Id: I29b9dbfa4bbfc49f21eba356858e38b1d3041824 2018-10-14 07:58 +0000 [abee4fd072] 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 [3fe9c41342] 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 [35f44be460] 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 [0f53930c05] 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 [08e5bbfec0] 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 [a5023d4f75] 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-10 06:38 +0000 [5ea517f80e] Corey Farrell * chan_sip: Tell module loader that chan_sip is extended support. Change-Id: I33508c134b1be888b8884f5dcfee19087634e415 2018-10-09 16:18 +0000 [c001974f4f] 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 [e0496fe062] 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 [c6ee3cf639] 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 [77f151d927] 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 [bc335ceda8] 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 [6fd21a6af6] George Joseph * CI: Fix missing () in gates.jenkinsfile Change-Id: I2f252e0f8c7f1a6328438fbd2be5d6574b7dfa5b 2018-10-04 10:13 +0000 [1598c7a306] George Joseph * CI: Add timestamps and timeouts to jenkinsfiles Change-Id: Ide83574dc957bc1df28e30a69079140050dfc35f 2018-10-03 17:02 +0000 [b2f96fdcfe] Sean Bright * ast_coredumper: Remove .gdbinit file on exit Change-Id: I1297de78628773ca368e687c6f148bf74857cae9 2018-10-03 09:33 +0000 [d0a1237c19] Sean Bright * CI: Look up configured kernel.core_pattern sysctl Change-Id: I8246a0147df8d821fbbcabc1db1887104b8bedc4 2018-10-03 15:51 +0000 [48bb4543d9] 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 [d027d193b8] George Joseph * ast_coredumper: Don't use "declare -n" Change-Id: I7ddfed4cd6549a0cd458e4d5cf9ac95d784de6cb 2018-10-02 16:15 +0000 [7eda6263c2] 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 [5b72bb0278] 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 [fa9cd68589] 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 [8b3b504b79] 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 [5f7350d68b] Sean Bright * CI: Use bindport instead of port in test http.conf Change-Id: Ife9a6879da63a56e5b8348a2024eeed4e7b1615b 2018-10-03 07:56 +0000 [2b4752911f] 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-01 22:12 +0000 [3b2310332d] 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-10-02 13:29 +0000 [c2e6efa63d] 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-09-13 13:03 +0000 [326574d4fc] Corey Farrell * Resolve warning about duplicate 'dialplan' CLI. Change-Id: I029db1b4a32ccfb38374d6fe944dc430866f4b30 2018-10-02 01:33 +0000 [65f06a4505] 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 [f066dbc353] 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 [406c5bef0a] 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 [693e00eee6] 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 [5a9230eacb] Corey Farrell * app_page: Add dependency against app_confbridge. Change-Id: I1946509f518961d23fb21229d91676ee3e441921 2018-09-28 13:55 +0000 [a2554d5e5a] 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:07 +0000 [266ed3d68b] Corey Farrell * Append CHANGES/UPGRADE.txt for module loader changes. Change-Id: Ib8db4e14187f5c11ecbff532df17d30c5d36fa3e 2018-09-25 17:33 +0000 [ab90479642] 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 [3337fe85c5] Corey Farrell * jansson-bundled: Add patches to improve json_pack error reporting. Change-Id: I045e420d5e73e60639079246e810da6ae21ae22b 2018-09-27 19:32 +0000 [b3b95c8d36] 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 [b4ab26e72f] 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 [33455f8d6f] 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 [d1698b4e0b] 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 [0fe08c5e79] 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 [958727cece] 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 [1f68614f3c] 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 [67e1e49e08] 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 [e04c49b517] 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 [227d9719da] 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 [681e115ff1] 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 [cc8e0dfabd] 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 [7c49ea7cff] 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 [ede59966d9] 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 [7b0dbda936] 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-17 15:35 +0000 [755febe497] 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 [ba91c73f8e] 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 [0a1a96d331] 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 [7a7b21f3a0] 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 [880905e7eb] 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 10:15 +0000 [fa1b836374] 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-08-16 10:45 +0000 [339bf0cf7b] 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-20 09:41 +0000 [1a9c69d729] 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-09-03 09:55 +0000 [8811ab1803] 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 [2f38bcdfc0] 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 [f6695249a5] 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 [c008c27c85] Richard Mudgett * pjproject: Update initial 2.8 patches to apply cleanly. ASTERISK-28059 Change-Id: I027472f2753391646dde594a709a75f14422db93 2018-09-14 15:48 +0000 [192f71b7de] 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 [60258b4ec1] 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 [3e48c34f14] 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 [29115e2384] 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 [6e79e6b097] 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-17 10:38 +0000 [b0a0b975c5] Sean Bright * autoconf: Check for srtp_get_version_string() before using it Change-Id: Id2a916ff9448706090e72ff2c7fb3f5ba24a05df 2018-09-17 07:10 +0000 [4a309839eb] George Joseph * CI: Fix typo in testsuite git checkout Change-Id: I30024515e5b00a5044fd39fbff27d818f016b719 2018-09-16 06:08 +0000 [55ca51af21] Sean Bright * res_srtp.c: Show linked version of libsrtp on module init Change-Id: Ib0a645d6985de5757cc4399ed2524b2d02c4f342 2018-09-07 09:40 +0000 [887a315e17] 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 [3f9544c1f5] 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 [17d6d9e1e7] 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 [5842741689] 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 [78453e65fd] 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 [f4bffe2326] 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 [e5739c494c] 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 [ecb3b23b07] 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 [ccfd2e0f5d] 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 [af6a3d02e1] 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 [034a3d8b86] 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 [3134fd95a9] 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 [9fb166cf3b] 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 [8879a62c1c] 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 [cfb854e241] 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 [4fcdcfaa37] 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 [f6a165208b] 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 [4dd8b5bbb4] Richard Mudgett * res_pjsip: Fix mwi_subscribe_replaces_unsolicited type mismatch ASTERISK-27988 Change-Id: Iccafdd0552ea8aaed647620fb14499f1bf341843 2018-08-16 09:04 +0000 [1edd9eb309] 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-29 05:18 +0000 [390d0b42ca] 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 [245fb462d6] 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 [1b1f47bef6] 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 [aa2755cbb3] 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 [46442aa9e5] 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 [d84de695ed] 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-22 10:50 +0000 [4188e7d6dd] 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 (cherry picked from commit c8bacd45f17d2ae6f6d05c8cff538dd651f683a6) 2018-08-23 06:57 +0000 [595e358761] 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: I6c55013bafe79f7e7a1fb6722d2558f553709f2e 2018-08-21 13:50 +0000 [4b88cb383d] 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 [fb2f242c49] Richard Mudgett * AMI: Remove docs for nonexistent AMI ContactStatus event headers Change-Id: I5736965c64c44338f7330e85a24bb46818607f19 2018-08-06 06:22 +0000 [b9cd4c6d92] 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 [236826a111] 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 [19298141cf] 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 [f6c1d94d91] 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 [4e43823d19] 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 [857926d197] Richard Mudgett * pbx_dundi.c: Handle thread shutdown better. Change-Id: Id52f99bd6a948fe6dd82acc0a28b2447a224fe87 2018-08-15 18:14 +0000 [111e73678e] 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 [a7ace944ae] Richard Mudgett * pbx_dundi: Update sample config documentation. Change-Id: I33d0ad0611c2124ca3440f0f811fa0f45e4e2849 2018-08-15 14:44 +0000 [0874d5b316] 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 [df78227e4a] George Joseph * CI: Fixup for non-13 branches Change-Id: I5e1d4a09e58b92b541bc8ed6f9e10e54c4e5101f 2018-08-16 13:28 +0000 [4ca959c72c] George Joseph * CI: Final version of setting correct gerrit creds Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3 2018-08-16 12:08 +0000 [33a5b8ccaf] 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-09 02:34 +0000 [0d4bde84d1] 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 [167efe3a47] Corey Farrell * res_resolver_unbound: Fix leak of config nameserver strings. Change-Id: I3f396316bb40d1ae6e91f5f688042420f1a540ed 2018-08-15 13:51 +0000 [72dbc9fb70] Corey Farrell * res_pjsip: Resolve transport management leak at shutdown. Cleanup idle check scheduled events at shutdown. Change-Id: I61bfbb56bac69fe840c3242927d31ff3593be461 2018-08-15 11:12 +0000 [6e0f4a2127] 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-15 11:31 +0000 [b370482786] 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-07-31 23:54 +0000 [d61a8791b5] 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-08-14 11:55 +0000 [0e4f5f5189] Richard Mudgett * contrib/scripts: Make astgenkey executable Change-Id: I11641d65592536dea9cbca5aa94a24c25d24dd5f 2018-08-14 07:29 +0000 [56c1285b8a] 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-07-19 22:28 +0000 [3bf968470b] 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-07 10:57 +0000 [a46fcaca7b] 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 [fce68efbbe] 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 [661273a078] 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-08-06 12:19 +0000 [eb87a98a1a] Richard Mudgett * res_pjsip.h: Fix doxygen comments. Change-Id: I9cf97bdc756012d1f552ab007f4aa85e0ddb4e62 2018-08-06 06:36 +0000 [5030756bfa] 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 [04974a0ca2] 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 [99a0586ec1] 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 [523b7b2ffc] 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 [e9d41572b3] 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 [1e837e13f5] 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 [e818925a58] 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 11:24 +0000 [20b53b5cee] 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 [914b9e1934] George Joseph * CI: Add optional uninstall step before installing asterisk Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7 2018-07-28 11:49 +0000 [93d1c34efe] 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 [ee9794d741] Joshua Colp * res_pjsip_pubsub: Use ast_true for "prune_on_boot". Change-Id: Iedec4e7390b3e821987681da24d0298632b9873d 2018-07-28 07:39 +0000 [c10b3ccd5f] 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 [32ce8e5cf3] 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 [59f53514ce] 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 [8da81a208f] 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 [e097dca4d7] George Joseph * CI: Fix placement of job summary statments Change-Id: Iace19e718f4e8fb48eb7dc9f98af53b115cc45f3 2018-07-26 12:52 +0000 [e5de8a70f8] 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 [d3809d61cb] 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 [798f049e82] George Joseph * CI: Add docker info to job summary Change-Id: I45d52005a9b692ad303c11792f226ace1e449901 2018-07-23 13:49 +0000 [7578881b3d] 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 [8ea13d62cd] 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 [e5c0ac6a64] 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 [93997f9698] George Joseph * CI: Explicitly pass BRANCH_NAME to buildAsterisk and installAsterisk Change-Id: I652f4a0ea5107c778e27a78bccb67b18b0c4e087 2018-07-24 13:29 +0000 [0baf660bde] George Joseph * CI: Add options to initialize and cleanup database to runTestsuite.sh Change-Id: I352333233bab5377723bf37d490ba84fc55bc853 2018-07-25 09:07 +0000 [74cbeabb97] Corey Farrell * CI: Do not `mkdir 2`. Change-Id: Ib7377d26a6c98b38bad463f47c84f1875ac84eb7 2018-07-25 07:34 +0000 [adf3c569a2] Corey Farrell * Build System: Silence build of bundled jansson. Change-Id: I7392c79c0173057f5378010bf1fe65e300e8fc56 2018-07-25 07:13 +0000 [e4b0f09bcc] George Joseph * CI: RefDebug: Fix reference to testsuite URL Change-Id: I0ee41d95a87f0d97b01f2757012b846bcfe6443d 2018-07-24 14:28 +0000 [5537048d60] 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 [9f3620a578] 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 [1f46e2e91c] 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 [8550fad21a] George Joseph * CI: Add --privileged flag to docker options Change-Id: If92d55f15306e55dd7091ac3c47b13ebbbb03488 2018-07-24 05:22 +0000 [f2580d037f] George Joseph * CI: Set correct user:group when publishing docs Change-Id: Ibabeb9ac730d9755cf54318d0da74771c939b86b 2018-07-23 12:21 +0000 [35d06e46ae] 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 [09b258fd69] 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 [460ef41f7a] 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 [fd1f74af40] Corey Farrell * CI: Fix mkdir CACHE_DIR. Change-Id: Ic9f9a61e230047836c836206731f8ff7eb3538c9 2018-07-21 11:22 +0000 [9b3267641f] 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 [0f999a834f] 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 [aea0a0294d] Richard Mudgett * asterisk.c: Update displayed copyright year for v16 release. Change-Id: I60622731d928ee9506b1d28934095f0dc3e5306e 2018-07-16 15:08 +0000 [d2dace81d4] Corey Farrell * Enable bundling of jansson, require 2.11. Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd 2018-07-20 09:25 +0000 [c8bd8f6ce9] Corey Farrell * CI: Fix logger.conf for unit tests. Change-Id: Idea59d60eab20105de50b34f0f0d506e6ef55d5c 2018-07-19 10:34 +0000 [0f82db82cb] George Joseph * CI: Add wiki doc publish to periodics Change-Id: I29ba26134e5083bc6788ede235f1a5d4383c148a 2018-07-20 06:54 +0000 [a2a3ad2438] 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 [dbffcdc561] Richard Mudgett * res_pjsip: Update endpoint transport option documentation. Change-Id: I5394fdff6a296efc8e1695a156e616acd932ae52 2018-07-19 13:27 +0000 [709b795cb0] 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 [c40412bd13] 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:19 +0000 [0b3bc4852f] 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 of ast_stream_topology_set_stream callers not checking for errors but in this situation the call cannot fail. Add comment so this can be ignored in the future. Change-Id: I91d25704859efbe50b8b82cfe1cd3c40ba177c9f 2017-10-19 13:35 +0000 [dd1a914495] Kevin Harwell * AST-2017-011 - res_pjsip_session: session leak when a call is rejected A previous commit made it so when an invite session transitioned into a disconnected state destruction of the Asterisk pjsip session object was postponed until either a transport error occurred or the event timer expired. However, if a call was rejected (for instance a 488) before the session was fully established the event timer may not have been initiated, or it was canceled without triggering either of the session finalizing states mentioned above. Really the only time destruction of the session should be delayed is when a BYE is being transacted. This is because it's possible in some cases for the session to be disconnected, but the BYE is still transacting. This patch makes it so the session object always gets released (no more memory leak) when the pjsip session is in a disconnected state. Except when the method is a BYE. Then it waits until a transport error occurs or an event timeout. ASTERISK-27345 #close Reported by: Corey Farrell Change-Id: I1e724737b758c20ac76d19d3611e3d2876ae10ed 2017-10-03 16:19 +0000 [b358e441cd] Richard Mudgett * AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun cdr_object_update_party_b_userfield_cb() could overrun the fixed buffer if the supplied string is too long. The long string could be supplied by external means using the CDR(userfield) function. This may seem reminiscent to AST-2017-001 (ASTERISK_26897) and it is. The earlier patch fixed the buffer overrun for Party A's userfield while this patch fixes the same thing for Party B's userfield. ASTERISK-27337 Change-Id: I0fa767f65ecec7e676ca465306ff9e0edbf3b652 2017-10-19 13:53 +0000 [74432f51f9] George Joseph * AST-2017-009: pjproject: Add validation of numeric header values Parsing the numeric header fields like cseq, ttl, port, etc. all had the potential to overflow, either causing unintended values to be captured or, if the values were subsequently converted back to strings, a buffer overrun. To address this, new "strto" functions have been created that do range checking and those functions are used wherever possible in the parser. * Created pjlib/include/limits.h and pjlib/include/compat/limits.h to either include the system limits.h or define common numeric limits if there is no system limits.h. * Created strto*_validate functions in sip_parser that take bounds and on failure call the on_str_parse_error function which prints an error message and calls PJ_THROW. * Updated sip_parser to validate the numeric fields. * Fixed an issue in sip_transport that prevented error messages from being properly displayed. * Added "volatile" to some variables referenced in PJ_CATCH blocks as the optimizer was sometimes optimizing them away. * Fixed length calculation in sip_transaction/create_tsx_key_2543 to account for signed ints being 11 characters, not 9. ASTERISK-27319 Reported by: Youngsung Kim at LINE Corporation Change-Id: I48de2e4ccf196990906304e8d7061f4ffdd772ff 2017-11-06 17:58 +0000 [2c4db2a3d5] Corey Farrell * res_pjsip_pubsub: Fix multiple leaks on failure to append vectors. Change-Id: I68ece0073ea79667ca41eb10405f516f1d30d482 2017-11-06 18:12 +0000 [48e96aba6a] Corey Farrell * res_pjsip_history: Fix multiple leaks on vector append failure. Change-Id: I41e8d5183ace284095cc721f3b1fb32ade3f940f 2017-11-06 18:01 +0000 [ecb81ae4de] Corey Farrell * res_pjsip_session: Fix multiple leaks. * Pre-initialize cloned media state vectors to final size to ensure vector errors cannot happen later in the clone initialization. * Release session_media on vector replace failure in ast_sip_session_media_state_add. * Release clone and media_state in ast_sip_session_refresh if we fail to append to the stream topology, return an error. Change-Id: Ib5ffc9b198683fa7e9bf166d74d30c1334c23acb 2017-11-07 12:03 +0000 [9b3db9a7fd] Corey Farrell * main/sdp_state: Check for errors from ast_stream_topology_set_stream. Change-Id: I84a83ae69daba5d185cc1d939b133a4c23565497 2017-11-06 16:37 +0000 [0cfc3cbf02] Richard Mudgett * res_pjsip_registrar.c: Fix AOR and pjproject group deadlock. One of the patches for ASTERISK_27147 introduced a deadlock regression. When the connection oriented transport shut down, the code attempted to remove the associated contact. However, that same transport had just requested a registration that we hadn't responded to yet. Depending upon timing we could deadlock. * Made send the REGISTER response after we completed processing the request contacts and released the AOR lock to avoid the deadlock. ASTERISK-27391 Change-Id: I89a90f87cb7a02facbafb44c75d8845f93417364 2017-11-07 11:40 +0000 [eba1179795] Corey Farrell * res_pjsip_session: Check for errors from ast_stream_topology_set_stream. Free memory and return error if ast_stream_topology_set_stream fails. Change-Id: I9f4dbf44bed627243d2f1dd8aea2eab6c38a028d 2017-11-07 11:34 +0000 [4ac6dd4e95] Corey Farrell * res_pjsip_t38: Better error checking for t38_create_media_state. Change-Id: I81b2587427c6982aa3e2a3f9ad69cce8d316eb10 2017-11-06 15:38 +0000 [fb18895108] Corey Farrell * stream: Return error from ast_stream_topology_set_stream. ast_stream_topology_set_stream had suppressed error codes from AST_VECTOR_APPEND. The result of AST_VECTOR_APPEND needs to be returned to the caller so they can take appropriate action on the stream. Change-Id: I6c0d12755743eadba1357f6153526cc055592856 2017-11-06 17:21 +0000 [801094da7b] Corey Farrell * res_stasis: Fix multiple leaks. * res/stasis/app.c JSON passed to app_send needs to be released. * res/stasis_message.c: objects leak if vector append fails. Change-Id: I8dd5385b9f50a5cadf2b1d16efecffd6ddb4db4a 2017-11-07 06:56 +0000 [02329b9a34] Richard Mudgett * res_pjproject.c: Fix ast_strdup() alloc failure. Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead 2017-11-05 22:06 +0000 [a36d8cc533] Aaron An * res_pjsip: Avoid crash when contact uri is empty string Asterisk will crash if contact uri is invalid, so contact_apply_handler should check if the uri is NULL or empty. ASTERISK-27393 #close Reported-by: Aaron An Tested-by: AaronAn Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5 2017-11-06 17:55 +0000 [7ef38d399a] Corey Farrell * res_pjsip_outbound_registration: Fix leak on vector add failure. Change-Id: I774b88b3c9da41edd4dc8d78f095481f52f2bd46 2017-11-06 17:48 +0000 [8684219f79] Corey Farrell * res_pjsip_exten_state: Check for vector append failure. Release reference to publisher if we fail to add it to the vector. Change-Id: I64dff3f481b67b9884f37cadba7a5ccf23d084f3 2017-11-06 17:44 +0000 [f899368cd6] Corey Farrell * res_pjsip_config_wizard: Fix leaks and add check for malloc failure. wizard_apply_handler(): - Free host if we fail to add it to the vector. wizard_mapped_observer(): - Check for otw allocation failure. - Free otw if we fail to add it to the vector. Change-Id: Ib5d3bcabbd9c24dd8a3c9cc692a794a5f60243ad 2017-11-06 17:38 +0000 [4016884ef3] Corey Farrell * res_stasis_playback: Check for failure to append vector. Free resources and return error if we fail to append the vector in stasis_app_control_play_uri. Change-Id: I22c4a90dd859b253f2850c6511de48b25609422b 2017-11-06 17:33 +0000 [24b9751aaa] Corey Farrell * test_sorcery_memory_cache_thrash: Handle error from vector append. Cleanup resources when we fail to append the vector and report test failure. Change-Id: I6eb41586fd11dee8c0dfe35e91cb465a4cab7298 2017-11-06 17:28 +0000 [29205e7adc] Corey Farrell * res_pjsip: Fix leak on error in ast_sip_auth_vector_init. Change-Id: Ib0fc7a18f3135ca8990c3984c9e15f6d26e556e8 2017-11-06 17:17 +0000 [70fcc043bb] Corey Farrell * res_pjproject: Handle error from adding to the buildopts vector. Change-Id: I076c7bd207c7989a23005395ce1735392657be65 2017-11-06 17:11 +0000 [5247ba4b88] Corey Farrell * res_ari_events: Fix use after free / double-free of JSON message. When stasis_app_message_handler needs to queue a message for a later connection it needs to bump the message reference so it doesn't get freed when the caller releases it's reference. Change-Id: I82696df8fe723b3365c15c3f7089501da8daa892 2017-11-06 15:33 +0000 [adb4fdcb7b] Corey Farrell * stasis: Release object if vector append fails. Change-Id: I3e5cc669169aab6175ddfaf7486edeaeb4fdcfb1 2017-11-06 15:20 +0000 [2f4f216026] Corey Farrell * RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE. Check for errors from AST_VECTOR_REPLACE and clean memory if needed. Change-Id: I124d15cc1d645f85a72a1279f623c1993b304b0b 2017-11-06 15:16 +0000 [5762f72425] Corey Farrell * PBX: Handle errors from AST_VECTOR_APPEND. This resolves potentials leaks on AST_VECTOR_APPEND error in: * ast_context_add_include2 * ast_context_add_switch2 * ast_context_add_ignorepat2 Change-Id: Ib60e95c4f622fa3b832d87227c0523a695d736b6 2017-11-06 15:10 +0000 [714026b32e] Corey Farrell * Messaging: Report error on failure to register tech or handler. Message tech and handler registrations use a vector which could fail to expand. If it does log and error and return error. Change-Id: I593a8de81a07fb0452e9b0efd5d4018b77bca6f4 2017-11-06 15:07 +0000 [e43c8af77c] Corey Farrell * format_cap: Fix leak on AST_VECTOR_APPEND error. format_cap_framed_init can fail on AST_VECTOR_APPEND. This should report failure to the caller and clean the newly allocated frame. Change-Id: Ica0661235bf09497bf23d844ceb01f21b41a55b0 2017-11-06 14:23 +0000 [64bcb65a78] Corey Farrell * stasis: Remove silly use of RAII_VAR in stasis_forward_all. Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65 2017-11-06 12:51 +0000 [b7e1034009] Corey Farrell * CLI: Remove unused internal command. The internal CLI command "_command complete" was last used by Asterisk 0.2.0. Since then we've been using "_command nummatches" and "_command matchesarray". Change-Id: I682fe1e21a24a3bb5bd04146e639f1c5866bcfce 2017-11-03 18:08 +0000 [923424019b] Richard Mudgett * stasis_bridges.c: Fix off-nominal json memory leaks. Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8 2017-11-03 17:43 +0000 [f81970d3fc] Richard Mudgett * stasis_channels.c: Remove a very silly RAII_VAR(). Change-Id: I28b458b3c1a442c4ef0be7b4986a95ea4149e14f 2017-11-06 10:29 +0000 [36fedea8c1] Joshua Colp * res_pjsip_pubsub: Ensure remote URI contains URI only. This change makes it so that any user of the pubsub API that requests the remote URI receives only the URI. Previously the entire string was returned, which could contain a display name. ASTERISK-27290 Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017 2017-11-03 16:14 +0000 [9771f089f5] Richard Mudgett * stasis/app.c: Optimize stasis_app_get_debug_by_name() * Eliminate RAII_VAR() * Short circuit application name lookup if global debug enabled. Change-Id: I5f78b7bd6ca7fd2c3b07cbbe036c6a93b4681123 2017-11-02 18:40 +0000 [ee08f10d06] Richard Mudgett * Fix ast_(v)asprintf() malloc failure usage conditions. When (v)asprintf() fails, the state of the allocated buffer is undefined. The library had better not leave an allocated buffer as a result or no one will know to free it. The most likely way it can return failure is for an allocation failure. If the printf conversion fails then you actually have a threading problem which is much worse because another thread modified the parameter values. * Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL on failure. That is much more useful than either an uninitialized pointer or a pointer that has already been freed. Many uses won't have to check for failure to ensure that the buffer won't be double freed or prevent an attempt to free an uninitialized pointer. * stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by ast_asprintf(). * ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to the wrong thing which is now not needed even if assigning to the right thing. Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23 2017-11-06 08:05 +0000 [ca4e6b568f] Sean Bright * res_pjsip: Ignore empty TLS configuration When using realtime, fields that are not explicitly set by an administrator are still presented to sorcery as empty strings. Handle this case explicitly. In this particular case, if any of these fields are required for TLS support, their existence should be validated in the 'apply' handler once we have a complete transport definition. ASTERISK-27032 #close Reported by: seanchann.zhou Change-Id: Ie3b5fb421977ccdb33e415d4ec52c3fd192601b7 2017-09-29 09:50 +0000 [04d3785a79] Sean Bright * dtls: Add support for ephemeral DTLS certificates. This mimics the behavior of Chrome and Firefox and creates an ephemeral X.509 certificate for each DTLS session. Currently, the only supported key type is ECDSA because of its faster generation time, but other key types can be added in the future as necessary. ASTERISK-27395 Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4 2017-11-06 03:21 +0000 [4013bfa52b] Corey Farrell * configure: Add autoconf check for libopusfile. This check is being added to make it easier for end-users of third party open source Opus modules. This was removed by ASTERISK-26426 but only the module needed to be removed. Change-Id: I62b9cd0c4fa8a77596ab0e042948a643a1152677 2017-11-06 03:18 +0000 [19332e6968] Alexander Traud * tcptls: Print notice when TLS is enabled but not configured. Asterisk can be compiled without a SSL/TLS library, without the Development Headers of OpenSSL. However, if TLS (SIP) or Secure-WebSockets (WebRTC) was enabled in a configuration file, Asterisk did not notice the user. Asterisk failed silently, only the corresponding TCP ports were not open. ASTERISK-27394 Reported-by: mossley74 Change-Id: Ib8b7539a5b2af8154c22e5f7a40fc68f95d95b93 2017-11-04 06:05 +0000 [2ebea5aa03] Alexander Traud * install_prereq: Checkout of libSRTP 2.x. Since Asterisk 13.17, libSRTP 2.x is supported. Therefore, its latest version is installed again via the script install_prereq. ASTERISK-27356 Change-Id: I13125839a79052356469e41edacbebff0a937d39 2017-11-01 17:47 +0000 [79ddcdbc70] Richard Mudgett * Stasis/ARI: Fix off-nominal path json memory leaks. Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb 2017-11-02 11:38 +0000 [229790ea3d] Richard Mudgett * AOC: Fix AOC-S json memory leak. Change-Id: I3a1d40a41a8a7d00fa4a187de6a343a79155d3ef 2017-11-01 18:04 +0000 [de4a4796d0] Richard Mudgett * res_stasis_device_state.c: Optimize stasis_app_device_states_to_json() * Eliminate RAII_VAR() * Replace looped alloca with a char[] since that is how it is used anyway. Change-Id: Ia27e64a884afa0f50b9ffdb1cf23da6bfa51ffdf 2017-11-01 18:58 +0000 [103b05bb4b] Richard Mudgett * res_stasis_mailbox.c: Fix leak of mailbox container. Change-Id: I7d33c1635713047e7d1597c9d882f7dc006d94b4 2017-11-03 10:35 +0000 [290bad22c9] Corey Farrell * Build System: Fix build failure caused by recent CLI improvements. We use the editline library to help with filename completion in our CLI interface. Some systems failed to find the header when included from loader.c. This is fixed by setting the proper CFLAGS for the build of loader.o. ASTERISK-27378 Change-Id: Ib7fd496f1d7ed48141a2eadd5dd61cab2f2308be 2017-11-01 11:12 +0000 [f8e0f9be22] Ben Ford * res_pjsip: Add to list of valid characters for from_user. Fixes a regression where some characters were unable to be used in the from_user field of an endpoint. Additionally, the backtick was removed from the list of valid characters, since it is not valid, and it was replaced with a single quote, which is a valid character. ASTERISK-27387 Change-Id: Id80c10a644508365c87b3182e99ea49da11b0281 2017-11-02 05:34 +0000 [8701479386] Joshua Colp * core: Don't attempt to write to a stream that does not exist. When a frame is provided to ast_write ensure that a multistream capable channel has a stream for it before attempting to give it to the channel driver. In some cases (such as a deferred SDP negotiation) the stream may not yet exist. ASTERISK-27364 Change-Id: Icf84ca982a67cdd6e9a71851eb7eb1bd0e865276 2017-11-02 01:57 +0000 [606ae3484a] Corey Farrell * Add missing menuselect dependencies. This adds menuselect dependencies for modules that use symbols of other modules. ASTERISK-27390 Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385 2017-11-01 22:57 +0000 [b616b7e4a9] Corey Farrell * res/ari/resource_bridges.h: Update from 'make ari-stubs'. A comment was updated when I ran 'make ari-stubs'. Change-Id: Ib5154ae3ad72aff53374c28ead540fe349c42175 2017-11-01 19:46 +0000 [79f111e1f3] Corey Farrell * Prevent unload of modules which implement an Optional API. Once an Optional API module is loaded it should stay loaded. Unloading an optional API module runs the risk of a crash if something else is using it. This patch causes all optional API providers to tell the module loader not to unload except at shutdown. ASTERISK-27389 Change-Id: Ia07786fe655681aec49cc8d3d96e06483b11f5e6 2017-10-30 17:30 +0000 [b9f457eac0] Corey Farrell * Modules: Additional improvements to CLI completion. Replace 'needsreload' argument with a 'type' argument to specify which type of modules you want completion. This provides more accurate CLI completion for load and unload commands. * 'module unload' now excludes modules that have active references or are not running. * 'module load' now excludes modules that are already running. * 'core set debug [atleast] [module]' shows running modules only. ASTERISK-27378 Change-Id: Iea3e00054461484196c46f688f02635cc886bad1 2017-11-01 13:58 +0000 [1bfd1cf640] Sean Bright * pjsip_message_filter: Only do interface lookup for wildcard addresses. Change-Id: Ie083987e69dc43b6861671c218cacacc11b2072f 2017-10-31 15:08 +0000 [1e70011710] Kevin Harwell * features: Bridge application's BRIDGERESULT not appropriately set The dialplan application "Bridge" was not setting the BRIDGERESULT to failure when a failure did occur. Even worse if it did fail to join the bridge it would still report success. This patch now sets the BRIDGERESULT variable to an appropriate value for a given condition state. Also, removed the value INCOMPATIBLE as a valid result type since it is no longer used. ASTERISK-27369 #close Change-Id: I22588e7125a765edf35cff28c98ca143e9927554 2017-10-31 13:18 +0000 [f2175c5a39] Corey Farrell * res_ari_channels: Fix reference leak in channel_state_invalid. channel_state_invalid leaked a reference to the channel snapshot any time it was aquired. ASTERISK-27067 #close Change-Id: I8c653f00416b39978513c5605c4be0f03b1df29a 2017-10-25 17:31 +0000 [4c535f5c30] Joshua Colp * core / pjsip: Add support for grouping streams together. In WebRTC streams (or media tracks in their world) can be grouped together using the mslabel. This informs the browser that each should be synchronized with each other. This change extends the stream API so this information can be stored with streams. The PJSIP support has been extended to use the mslabel to determine grouped streams and store this association on the streams. Finally when creating the SDP the group information is used to cause each media stream to use the same mslabel. ASTERISK-27379 Change-Id: Id6299aa031efe46254edbdc7973c534d54d641ad 2017-10-30 09:20 +0000 [022de525be] Tzafrir Cohen * ast_coredumper: allow setting asterisk binary explicitly Adds an extra option, --asterisk-bin= to ast_coredumper. If provided, the binary given to gdb will be the parameter, rather than asterisk from the PATH. ASTERISK-27380 #close Change-Id: I25f5b91eb75059b0fb2f142e468c26b283b0a9f3 2017-10-25 01:10 +0000 [3052b56423] Florian Floimair * alembic: Add bundle column in ps_endpoints table The ps_endpoints table was missing the bundle column introduced with the bundle feature in commit 065c3005ad92. ASTERISK-27374 #close Change-Id: Ic900f4f2c20f64b99ea898d50f5c0a7117472d46 2017-10-30 00:32 +0000 [e82b921c35] Corey Farrell * Modules: Fix issues with CLI completion. * Stop using ast_module_helper to check if a module is loaded, use ast_module_check instead (app_confbridge and app_meetme). * Stop ast_module_helper from listing reload classes when needsreload was not requested. ASTERISK-27378 Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239 2017-10-28 19:18 +0000 [9bad4c74cc] Igor Goncharovskiy * app_agent_spool: Fix typo in dtmf features usage desctiption Fix typo, that specify usage wrong option 'dtmf-features' for CHANNEL() function instead of correct 'dtmf_features' ASTERISK-27377 #close Change-Id: I15ecc829c1035b359584673e12cdb5c9291ac930 2017-10-27 13:41 +0000 [0991874430] Corey Farrell * res_pjsip_pubsub: Resolve potential crash in allocate_subscription. When allocate_subscription fails to initialize fields of the new sub it calls destroy_subscription. Change-Id: I5b79c915ec216dc00c13c1e4172137864a4bec85 2017-10-26 12:18 +0000 [26607e4e3b] Richard Mudgett * app_voicemail.c: Fix compiler warning with IMAP build. ASTERISK-27181 Change-Id: Ic4468b49860bd7f67e922baf4c9e96828c184d17 2017-10-25 14:38 +0000 [2ca3dbb197] Richard Mudgett * codec.c: Defensively check the returned samples. Earlier versions of the codec_opus samples_count callback can return negative error values on undecodable frames. This resulted in a divide by zero exception. * Added a defensive check in ast_codec_samples_count() for a "negative" samples count return value. Log the event and set the count to zero. ASTERISK-27194 Change-Id: Icf69350307ecbbc80a3d74de46af9bd80ea17819 2017-10-24 10:33 +0000 [9e1fbab382] Joshua Colp * res_pjsip: Add 'ip' as a valid option to 'identify_by' on endpoint. When the identify_by option on an endpoint is set to ip it will only be identified using the res_pjsip_endpoint_identifier_ip module. This ensures that it is not mistakenly matched using the username of the From header. To ensure behavior has not changed the default has been changed to "username,ip" for the identify_by option. ASTERISK-27206 Change-Id: I2170b86a7f7e221b4f00bf14aa1ef1ac5b050bbd 2017-10-25 12:26 +0000 [4aec70690d] George Joseph * ast_coredumper: Add gzipping of binaries and display of signal info The --tarball-coredump option now creates a gzipped tarball of coredumps processed, their results txt files and copies of /etc/os-release, /usr/sbin/asterisk, /usr/lib(64)/libasterisk* and /usr/lib(64)/asterisk as those files are needed to properly examine the coredump. The file will be named /tmp/asterisk..coredumps.tar.gz or /tmp/asterisk-.coredumps.tar.gz if --tarball-uniqueid was specified. Added dumps of *_siginfo to the top of the txt files so you can tell what signal was invoked. Change-Id: Ib9ee6d83592d4b1bc90cb3419a05376a88d1ded9 2017-10-25 09:23 +0000 [3821be1c68] Ben Ford * http.c: Fix http header send content. Currently ast_http_send barricades a portion of the content that needs to be sent in order to establish a connection for things like the ARI client. The conditional and contents have been changed to ensure that everything that needs to be sent, will be sent. ASTERISK-27372 Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d 2017-03-30 09:51 +0000 [5553adb8ba] Corey Farrell * Build System: Fix --disable-xmldoc option. The configure option to disable XML documentation does not currently work. This patch makes it effective, but also causes an ABI change by removing the ast_xmldoc_* symbols. Disabling xmldoc also prevents docs from being automatically generated, but they can still be manually generated with 'make doc/core-en_US.xml'. ASTERISK-26639 Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44 2017-10-23 00:55 +0000 [569e9a8391] Corey Farrell * Single API for ast_store_lock_info and ast_remove_lock_info. This makes the 'bt' parameter unconditional for ast_store_lock_info and ast_remove_lock_info. The 'bt' parameter is unused when HAVE_BKTR is undefined. Change-Id: Ieced0e920928b735a39c3b5952b806c473d67453 2017-10-24 09:43 +0000 [6474de5f72] Corey Farrell * chan_sip: Fix SUBSCRIBE with missing "Expires" header. When chan_sip receives a SUBSCRIBE request with no "Expires" header it processes the request as an unsubscribe. This is incorrect, per RFC3264 when the "Expires" header is missing a default expiry should be used. ASTERISK-18140 Change-Id: Ibf6dcd4fdd07a32c2bc38be1dd557981f08188b5 2017-10-24 07:24 +0000 [7126520b3e] Alexander Traud * lpc10: Avoid compiler warning when DONT_OPTIMIZE/COMPILE_DOUBLE. ASTERISK-23556 Reported by: Marcello Ceschia Change-Id: Ic27e88e0336a0d83877dc857938659dc5560b93c 2017-10-07 12:14 +0000 [841ac3ded6] Corey Farrell * hashtab: Use ast_free. A few places in hashtab use free instead of ast_free, remove declaration of ASTMM_LIBC from hashtab.c as it's no longer needed. Change-Id: I2ff089bad71640c03c3ce97f1b00fc962ef79427 2017-10-23 01:02 +0000 [fb585cf185] Corey Farrell * Bundled pjproject: Enable pj_assert when dev-mode is enabled. ASTERISK-27359 Change-Id: Ib01fb6c01f9bb87129374a51cb9318c474147517 2017-10-23 13:44 +0000 [ee21076151] Corey Farrell * main/Makefile: Remove rule for non-existant testexpr2. Change-Id: Ibb3e47f27a395d74d8c5263db015b05434f5969b 2017-10-23 12:42 +0000 [a9e9608982] Corey Farrell * test_config: Fix failure and segfault when config_hook is run twice. On second run the config_hook test was unexpectedly failing to load test_config.conf because it was still unmodified since the last load. This is fixed by not passing CONFIG_FLAG_FILEUNCHANGED for the initial loads, only using it when we are tested that a reload of unmodified files do not initiate the hook. ASTERISK-25960 Change-Id: Ifd679509a23ed163e5cc647490bf7df4ae3cd856 2017-10-23 12:23 +0000 [6f0431798e] George Joseph * res_pjsip_sdp_rtp: Fix setting of address type for rtp_ipv6 create_outgoing_sdp_stream was setting "addr_type = STR_IP6" only when an ipv6 media_address was specified on the endpoint. If rtp_ipv6 was set and ast_sip_get_host_ip_string returned an ipv6 address, we were leaving the addr_type set at the default of STR_IP4. This caused the address type to be set incorrectly on the "o" and "c" SDP attributes even though the address was set correctly. Some clients don't like the mismatch. * Removed the test for endpoint/media_address and now check all addresses for ipv6. ASTERISK-27198 Reported by: Martin Cisárik Change-Id: I5214fc31b728117842243807e7927a319cf77592 2017-10-23 07:53 +0000 [488f98310f] Richard Mudgett * app_agent_pool.c: Fix online documentation typo. Change-Id: Ib0bc95fd0ec288c78c313823254d7a84ebfc4429 2017-10-22 17:32 +0000 [252353e0a9] Joshua Colp * res_xmpp: Ensure the connection filter is available. Users of the API that res_xmpp provides expect that a filter be available on the client at all times. When OAuth authentication support was added this requirement was not maintained. This change merely moves the OAuth authentication to after the filter is created, ensuring users of res_xmpp can add things to the filter as needed. ASTERISK-27346 Change-Id: I4ac474afe220e833288ff574e32e2b9a23394886 2017-10-21 03:44 +0000 [840e08716b] Alexander Traud * chan_sip: Crypto attribute not last but first on SDP media level. This matches the behavior of the other SIP channel driver, chan_pjsip. ASTERISK-27365 Change-Id: I8f23a51290a58b75816da2999ed1965441dfc5d6 2017-10-17 10:53 +0000 [e41561fc2a] Richard Mudgett * res_pjproject.c: Upgrade bundled PJPROJECT to 2.7 Update patches included in bundled PJPROJECT for the new version. ASTERISK-27355 Change-Id: I9ac5dbbffaadca25ad24fac8b9ab615e5ace6083 2017-10-16 16:46 +0000 [4559cd0e28] Nir Simionovich * This patch adds a beanstalk CDR 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 Change-Id: I5fe4089a34ab3b39230786d9bbfddafa56715f48 2017-10-18 13:41 +0000 [4760b2445c] Corey Farrell * res_pjsip_pubsub: Prevent unload except during shutdown. Prevent unload of the module as certain pjsip initialization functions cannot be reversed. This required a reorder of the module_load so that the non-reversable pjsip functions are not called until all potential errors have been ruled out. ASTERISK-24483 Change-Id: Iee900f20bdd6ee1bfe23efdec0d87765eadce8a7 2017-10-18 13:37 +0000 [449ee66a11] Corey Farrell * res_pjsip_refer: Prevent unload except during shutdown. Prevent unload of the module as certain pjsip initialization functions cannot be reversed. ASTERISK-24483 Change-Id: I94597ec8b8491f5af9c57bf66dbc3b078fe2d49d 2017-10-18 12:04 +0000 [c9e19b31f5] Corey Farrell * chan_sip: Fix output of 'sip set debug off'. When sip.conf contains 'sipdebug=yes' it is impossible to disable it using CLI 'sip set debug off'. This corrects the output of that CLI command to instruct the user to turn sipdebug off in the configuration file. ASTERISK-23462 #close Change-Id: I1cceade9caa9578e1b060feb832e3495ef5ad318 2017-10-16 10:53 +0000 [955a891a84] Corey Farrell * app_macro deprecation. * Mark the module deprecated. * Disable the module by default. * Produce a warning the first time a macro is used. * Note deprecation related options in app_dial and app_queue. ASTERISK-27350 Change-Id: I560ea043bacdbc5534a17d97854273d52c2f1bdc 2017-10-18 03:30 +0000 [95b45d1c46] Alexander Traud * res_srtp: Add support for libsrtp2 with AES-GCM. Beside allowing AES-GCM again, this adds AES-192 again. ASTERISK-27356 Change-Id: Ia97a435faf26300335d9552fa676b5d17e5f7233 2017-10-14 14:41 +0000 [5d8c517960] Joshua Colp * bridge_softmix: Reduce topology cloning and improve renegotiation. As channels join and leave an SFU the bridge_softmix module needs to renegotiate to add and remove their streams from the other participants. Previously this was done by constructing the ideal stream topology every time but in the case of leave this was incomplete. This change makes it so bridge_softmix keeps an ideal stream topology for each channel and uses it when making changes. This ensures that when we request a renegotiation we are always certain that we are aiming for the best stream topology possible. In the case of a channel leaving this ensures that we try to have an existing participant fill their place if a participant has a fixed limit on the maximum number of video streams they allow. ASTERISK-27354 Change-Id: I58070f421ddeadd2844a33b869b052630cf2e514 2017-10-06 15:55 +0000 [73164d0d7f] Richard Mudgett * cdr.c: Rename the Party A CDR container. * Rename the Party A CDR container from active_cdrs_by_channel to active_cdrs_master. * Renamed the support functions associated with active_cdrs_master appropriately. ASTERISK-27335 Change-Id: I6104bb3edc3a0b7243ce502e45e8832b0cff14f7 2017-10-02 17:42 +0000 [fe1120cf88] Richard Mudgett * cdr.c: Add container to key off of Party B channel names. The CDR performance gets worse the further it gets behind in processing stasis messages. One of the reasons is because of a n*m loop used when processing Party B information. * Added a new CDR container that is keyed to Party B so we don't need such a large loop when processing Party B information. NOTE: To reduce the size of the patch I deferred to another patch the renaming of the Party A active_cdrs_by_channel container to active_cdrs_master and renaming the container's hash and cmp functions appropriately. ASTERISK-27335 Change-Id: I0bf66e8868f8adaa4b5dcf9e682e34951c350249 2017-10-11 06:04 +0000 [da24d425eb] Torrey Searle * contrib/script/sip_to_pjsip: implement 'all' for allow/disallow when 'all' is specified in an allow or disallow section, it should erase all values from the inverse section in the default config. E.G. allow=all should erase any deny values from default config & vice-versa ASTERISK-27333 #close Change-Id: I99219478fb98f08751d769daaee0b7795118a5a6 2017-10-14 04:11 +0000 [c4f40b778a] Guido Falsi * chan_dahdi: wrap include file which is not present on BSD systems in #ifdef The sys/sysmacros.h include file does not exist in BSD systems and is not required to build this module there. Since an "#if defined(__NetBSD__) || defined(__FreeBSD__)" section already exist I moved that include line inside it's #else branch. ASTERISK-27343 #close Change-Id: Ibfb64f4e9a0ce8b6eda7a7695cfe57916f175dc1 2017-10-13 09:43 +0000 [8f65d91dfd] Alexander Traud * res_pjsip_session: Rewrite o= with external_media_address. PJSIP allows a domain name as external_media_address. This allows chan_pjsip to be used behind a NAT with changing IP addresses. The IP address of that domain is resolved to the c= line already. This change sets also the o= line to that domain. ASTERISK-27341 #close Change-Id: I690163b6e762042ec38b3995aa5c9bea909d8ec4 2017-10-12 12:03 +0000 [7d51a79beb] Joshua Colp * bridge_simple: Improve renegotiation success rate. When making channels compatible the bridge_simple module will renegotiate one to better match the other. Some endpoints incorrectly terminate the call if this process fails. To better handle this scenario the audio streams present on the new requested topology will include any existing negotiated formats that happen to exist on the first valid audio stream. This ensures formats are persent that are known to be acceptable to the remote endpoint. ASTERISK-27259 Change-Id: I8fc0cc03e8bcfd0be8302f13b9f32d8268977f43 2017-10-13 08:51 +0000 [ee65d5ac7c] Corey Farrell * ast_bt_get_symbols: Prevent double-free. It's possible for bfdobj to be created but syms not created. If syms was not allocated in the current loop iteration but was allocated in the previous iteration it would crash. ASTERISK-27340 Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363 2017-10-13 08:12 +0000 [44d9446eb5] Alexander Traud * tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it. This avoids a crash on stopping a chan_sip which failed to start its TLS server. ASTERISK-27339 #close Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5 2017-09-29 14:26 +0000 [f369be21a8] Richard Mudgett * cdr.c: Eliminated many calls to ao2_global_obj_ref(). The CDR performance gets worse the further it gets behind in processing stasis messages. One of the reasons is we were getting the global config to determine if we needed to log a debugging message. * Many calls to ao2_global_obj_ref() were just so we could determine if debug mode is enabled. Made a global flag to check instead. * Eliminated many RAII_VAR() usages associated with the remaining ao2_global_obj_ref() calls. * Added missing NULL checks for the returned ao2_global_obj_ref() value. ASTERISK-27335 Change-Id: Iceaad93172862f610cad0188956634187bfcc7cd 2017-10-06 13:45 +0000 [2eea087401] Richard Mudgett * cdr.c: Defer getting ao2_global_obj_ref() until needed. The CDR performance gets worse the further it gets behind in processing stasis messages. One of the reasons is we were getting the global config even if we didn't need it. * Most uses of the global config were only needed on off nominal code paths so it makes sense to not get it until absolutely needed. ASTERISK-27335 Change-Id: I00c63b7ec233e5bfffd5d976f05568613d3c2365 2017-10-05 18:08 +0000 [7c7a917874] Richard Mudgett * cdr.c: Set stringfields only if they are different. The CDR performance gets worse the further it gets behind in processing stasis messages. One of the reasons is we were repeatedly setting string fields to potentially the same string in base_process_party_a(). Setting a string field involves allocating room for the new string out of a memory pool which may have to allocate even more memory. * Check to see if the string field is already set to the desired string. ASTERISK-27335 Change-Id: I3ccb7e23f1488417e08cafe477755033eed65a7c 2017-10-05 18:03 +0000 [c80c8f2ab9] Richard Mudgett * cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr The string comparisons for setting these CDR variables was inverted. We were repeatedly setting these CDR variables only if the channel snapshots had the same value. ASTERISK-27335 Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea 2017-08-25 08:19 +0000 [21c0283b78] Thomas Sevestre * features, manager : Add CancelAtxfer AMI action Add action to cancel feature attended transfer with AMI interface ASTERISK-27215 #close Change-Id: Iab8a81362b5a1757e2608f70b014ef863200cb42 2017-10-06 04:55 +0000 [6576e4320a] Daniel Tryba * res_pjsip_session: Prevent user=phone being added to anonimized URIs. Move ast_sip_add_usereqphone to be called after anonymization of URIs, to prevent the user_eq_phone adding "user=phone" to URIs containing a username that is not a phonenumber (RFC3261 19.1.1). An extra call to ast_sip_add_usereqphone on the saved version before anonymization is added to add user=phone" to the PAI. ASTERISK-27047 #close Change-Id: Ie5644bc66341b86dc08b1f7442210de2e6acdec6 2017-10-06 05:14 +0000 [a56316423f] Daniel Tryba * res_pjsip: Prevent "user=phone" being added multiple times to header ast_sip_add_usereqphone adds "user=phone" to the header every time is is called without checking whether the param already exists. Preventing this by searching to string representation of header for "user=phone". ASTERISK-26988 #close Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6 2017-10-05 18:12 +0000 [e5b9eb0460] Richard Mudgett * cdr.c: Defer misc checks. Try to defer some checks until needed in case there is an early exit. Change-Id: Ibc6b34c38a4f60ad4f9b67984b7d070a07257064 2017-10-06 20:48 +0000 [e8bde6916a] Seán C McCord * ari/bridge: Add mute, dtmf suppression controls Add bridge_features structure to bridge creation. Specifically, this implements mute and DTMF suppression, but others should be able to be easily added to the same structure. ASTERISK-27322 #close Reported by: Darren Sessions Sponsored by: AVOXI Change-Id: Id4002adfb65c9a8027ee9e1a5f477e0f01cf9d61 2017-10-11 07:03 +0000 [ab4d36533c] George Joseph * chan_vpb: Fix a gcc 7 out-of-bounds complaint chan_vpb was trying to use sizeof(*p->play_dtmf), where p->play_dtmf is defined as char[16], to get the length of the array but since p->play_dtmf is an actual array, sizeof(*p->play_dtmf) returns the size of the first array element, which is 1. gcc7 validly complains because the context in which it's used could cause an out-of-bounds condition. Change-Id: If9c4bfdb6b02fa72d39e0c09bf88900663c000ba 2017-10-06 02:39 +0000 [be7da57546] Nathan Bruning * app_queue.c: clear moh field in init_queue ASTERISK-27301 #close Change-Id: Ic31361f34e2de3b6470e68fc37205a7711082eba 2017-10-09 21:00 +0000 [b8dadccbe1] Corey Farrell * sorcery: Use ao2_weakproxy to hold list of instances. * Store weak proxy objects in instances container. * Remove special unreference function and replace with macro that calls ao2_cleanup. * Add REF_DEBUG information to ast_sorcery_open. Change-Id: I5a150a4e13cee319d46b5a4654f95a4623a978f8 2017-10-09 21:55 +0000 [7774623804] Corey Farrell * named_locks: Use ao2_weakproxy_find. Change-Id: I0ce8a1b7101b6caac6a19f83a89f00eaba1e9d9c 2017-10-09 17:51 +0000 [b058f8673a] Corey Farrell * astobj2: Add ao2_weakproxy_find function. This function finds a weak proxy in an ao2_container and returns the real object associated with it. Change-Id: I9da822049747275f5961b5c0a7f14e87157d65d8 2017-10-10 15:09 +0000 [fd3101e8ad] Corey Farrell * astobj2: Run weakproxy callbacks outside of lock. Copy the list of weakproxy callbacks to temporary memory so they can be run without holding the weakproxy lock. Change-Id: Ib167622a8a0f873fd73938f7611b2a5914308047 2017-10-10 12:01 +0000 [3ad7d2f36c] Sean Bright * app_originate: Set ORIGINATE_STATUS correctly on failure We were ignoring the return value from ast_pbx_outgoing_exten() and ast_pbx_outgoing_app() which could fail before setting the reason code. This resulted in failures being reported as success. ASTERISK-25266 #close Reported by: Allen Ford Change-Id: Idf16237b7e41b527d2c69c865829128686beeb3b 2017-10-03 15:16 +0000 [b1d9fc87bc] Torrey Searle * contrib/thirdparty/sip_to_pjsip: add additional flag mappings add mappings for udptl redundancy, rtptimeout, and debug flags Change-Id: Ie73cf5c83c05dee01eb9624ede76c1a30225d73a 2017-10-02 16:46 +0000 [b0408d05c0] Richard Mudgett * cdr.c: Eliminated simple RAII_VAR usages. Change-Id: I150505db307249a962987e7b941bdd369bb91f35 2017-10-10 09:49 +0000 [11cefdf621] Tzafrir Cohen * cdr_mysql: avoid releasing a config string Fixes a memory corruption issue after a reload of cdr_mysql. Issue was accidentally included in 747beb1ed159f89a3b58742e4257740b3d6d6bba . ASTERISK-27270 #close Change-Id: I90b6a9d18710c0f9009466370bd5f4bac5d5d12e 2017-10-10 07:42 +0000 [b228f5c5e6] Tzafrir Cohen * declare optional openssl dependencies in moduleinfo Declare optional openssl dependencies in: * res_rtp_asterisk.c * tcptls.c ASTERISK-27328 #close Change-Id: I2636f1c05b8104b4fe6f36cce0ebd9a98b9c78ab 2017-10-09 22:51 +0000 [fae09c6676] Corey Farrell * res_pjproject: Fix cleanup of buildopts vector. ASTERISK-27306 Change-Id: I3bed0edf3f55b1d4adcbabb25ec14f11dc766c72 2017-10-03 16:09 +0000 [fdf9aacca3] Richard Mudgett * cdr.c: Replace redundant check with an ast_assert() The only caller of cdr_object_fn_table.process_party_b() explicitly does the check before calling. Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618 2017-10-02 17:41 +0000 [2e4b5fadbd] Richard Mudgett * cdr.c: Replace inlined code with ao2_t_replace() Change-Id: I9f424f5282ca7d833592f958d95f1b2bafb549b0 2017-09-29 12:07 +0000 [62980eedc3] Richard Mudgett * cdr.c: Use current ao2 flag names Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e 2017-09-29 12:31 +0000 [e769846f11] Richard Mudgett * cdr.h: Fix doxygen comments. * Also some misc formatting in cdr.c. Change-Id: Ied89a28802a662c37c43326a1aafdce596e0df4a 2017-09-20 18:36 +0000 [fb19799b62] Richard Mudgett * res_pjsip_registrar.c: Update remove_existing AOR contact handling. When "rewrite_contact" is enabled, the "max_contacts" count option can block re-registrations because the source port from the endpoint can be random. When the re-registration is blocked, the endpoint may give up re-registering and require manual intervention. * The "remove_existing" option now allows a registration to succeed by displacing any existing contacts that now exceed the "max_contacts" count. Any removed contacts are the next to expire. The behaviour change is beneficial when "rewrite_contact" is enabled and "max_contacts" is greater than one. The removed contact is likely the old contact created by "rewrite_contact" that the device is refreshing. ASTERISK-27192 Change-Id: I64c107a10b70db1697d17136051ae6bf22b5314b 2017-10-09 08:15 +0000 [ad38a55a2d] Sean Bright * res_config_sqlite: Don't enable SQLite CDRs when running 'make samples' Change-Id: I65a5190b2732b2246d67472db70dd37db64ddad4 2017-10-08 14:05 +0000 [a0a1f95abf] David Hajek * res/res_ari.c Fix: Memory leaks in ARI when using Content-Type: application/json ASTERISK-27305 Reported by: David Hajek Tested by: David Hajek Change-Id: Ife3e289062e6cf7d0e7d342dbf79ed96feff441e 2017-10-08 09:11 +0000 [feeb0974eb] Alexander Traud * tcptls: Do not re-bind to wildcard on client creation. Since ASTERISK-26922, this issue affected only those chan_sip which were * enabled for dual-stack (bindaddr=::), and * enabled for TCP (tcpenable=yes) and/or TLS (tlsenable=yes), and * tried to register and/or invite a IPv4-only service, * via TCP and/or TLS. Now, ast_tcptls_client_create does not re-bind to [::] anymore. ASTERISK-27324 #close Change-Id: I4b242837bdeb1ec7130dc82505c6180a946fd9b5 2017-10-07 15:47 +0000 [eb224fea5e] Corey Farrell * res_pjsip_session: Fix format_cap leak. ASTERISK-27306 Change-Id: I2c8d3fc148f9f53715c958314e1146f9611741f3 2017-10-06 10:51 +0000 [f4798faacc] Matt Jordan * res_corosync: Fix linking issue with Corosync 2.x At some point in time in the history of Corosync (certainly within the 2.x branch), the corosync_cfg_state_track function was removed. Unfortunately, the cfg library is only linked if this function is present. Without the cfg library being linked to res_corosync, loading of res_corosync will fail. This patch makes it so that detecting corosync's core libraries, determined by the COROSYNC external library checks, links both the cpg and cfg libraries with res_corosync. Change-Id: I674e9e1c8fea11c3bf81154aaa7c1fd43f945465 2017-10-05 16:26 +0000 [a68a91f722] Corey Farrell * res_pjsip: Fix leak of persistent endpoint references. Do not manually call sip_endpoint_apply_handler from load_all_endpoints. This is not necessary and causes memory leaks. Additionally reinitialize persistent->aors when we reuse a persistent object with a new endpoint. ASTERISK-27306 Change-Id: I59bbfc8da8a14d5f4af8c5bb1e71f8592ae823eb 2017-10-05 17:59 +0000 [3bd00c4a7e] Corey Farrell * vector: multiple evaluation of elem in AST_VECTOR_ADD_SORTED. Use temporary variable to prevent multiple evaluations of elem argument. This resolves a memory leak in res_pjproject startup. ASTERISK-27317 #close Change-Id: Ib960d7f5576f9e1a3c478ecb48995582a574e06d 2017-10-05 15:54 +0000 [b35ac9e566] Corey Farrell * res_pjsip: Fix leak of fake_auth references. pjsip_distributor leaks references to fake_auth when the default realm has not changed. ASTERISK-27306 Change-Id: I3fcf103b3680ad2d1d4610dcd6738eeaebf4d202 2017-10-05 20:23 +0000 [0f3e725503] Corey Farrell * main/strings: Fix uninitialized value. ast_strings_match uses sscanf and checks for non-zero return to verify a token was parsed. This is incorrect as sscanf returns EOF (-1) for errors. ASTERISK-27318 #close Change-Id: Ifcece92605f58116eff24c5a0a3b0ee08b3c87b1 2017-10-05 19:55 +0000 [0b6be1b2d4] Corey Farrell * res_sdp_translator_pjmedia: Fix test unregistration. ASTERISK-27306 Change-Id: Ib3ed47167cb697ab7bd0a56cab589893f491651b 2017-10-02 07:48 +0000 [59b6e8467a] Daniel Tryba * res_pjsip_caller_id chan_sip: Comply to RFC 3323 values for privacy Currently privacy requests are only granted if the Privacy header value is exactly "id" (defined in RFC 3325). It ignores any other possible value (or a combination there of). This patch reverses the logic from testing for "id" to grant privacy, to testing for "none" and granting privacy for any other value. "none" must not be used in combination with any other value (RFC 3323 section 4.2). ASTERISK-27284 #close Change-Id: If438a21f31a962da32d7a33ff33bdeb1e776fe56 2017-10-04 10:59 +0000 [65399a5eda] Corey Farrell * res_pjsip: Add REF_DEBUG info to module references. This provides better information to REF_DEBUG log for troubleshooting when the system is unable to unload res_pjsip.so during shutdown due to module references. ASTERISK-27306 Change-Id: I63197ad33d1aebe60d12e0a6561718bdc54e4612 2017-10-04 10:46 +0000 [7d04544986] Corey Farrell * res_pjsip: Fix issues that prevented shutdown of modules. res_pjsip and res_pjsip_session had circular references, preventing both modules from shutting down. * Move session supplement registration to res_pjsip. * Use create internal functions for use by pjsip_message_filter.c. ASTERISK-27306 Change-Id: Ifbd5c19ec848010111afeab2436f9699da06ba6b 2017-09-28 02:56 +0000 [2301447a20] Benoît Dereck-Tricot * res_calendar_icalendar: Filter out occurrences superceded by another VEVENT When we are loading the calendars, we call libical's icalcomponent_foreach_recurrence method for each VEVENT component that we have in our calendar. That method has no knowledge concerning the existence of the other VEVENT components and will feed our callback with all ocurrences matching the requested time span. The occurrences generated by icalcomponent_foreach_recurrence while expanding a recurring VEVENT's RRULE and RDATE properties can be superceded by an other VEVENT sharing the same UID. I use an external iterator (in libical terminology) to avoid messing with the internal ones from the calling function, and search for VEVENTS which could supersede the current occurrence. The event which can invalidate this occurence needs to have: - the same UID as our recurrent component (comp) - a RECURRENCE-ID property, which represents the start time of this occurrence If one component is found, just clean and return. ASTERISK-27296 #close Reported by: Benoît Dereck-Tricot Change-Id: I8587ae3eaa765af7cb21eda3b6bf84e8a1c87af8 2017-09-28 17:37 +0000 [b2dbfe23ef] Richard Mudgett * app_queue.c: Fix announcements when announce-to-first-user not enabled. The previous patch for ASTERISK-27216 made it so you wouldn't get any position or periodic announcements unless you had announce-to-first-user enabled. The announce-to-first-user feature was added by ASTERISK_21782 as a result of the patch which introduced the redundant announcements that ASTERISK-27216 removes. * By noting that the makeannouncement variable is used to suppresses the first user announcement, we set its initial value to the announce-to-first-user enable setting. ASTERISK-27216 Change-Id: Ieaeb7dbea8ae7073086b775fbafe0625b000b10a 2017-09-21 14:43 +0000 [80097676e7] Richard Mudgett * heap.c: No need to calloc heap pointer array. Change-Id: I5ae2f316229f336eb90d99c7af7ed07a33097e68 2017-09-27 13:45 +0000 [d1de7948fe] George Joseph * logger: Bring back ability to turn debug on by source file Somewhere along the way we lost the ability to debug individual source files. For modules, this wasn't a big deal but all the source files in ./main are in the one "core" module so debugging individual core capabilities was almost impossible. * Added a test to DEBUG_ATLEAST that also checks __FILE__ instead of just module name. Any source file will work even if it's in a module subdirectory. Change-Id: Icc0af41837f3b1679dec7af21fa32cd1f7469f6e 2017-09-28 05:33 +0000 [f21408c866] Joshua Colp * res_stasis: Add 'video_sfu' as a requested bridge type. This change adds 'video_sfu' as a requested bridge type when creating a bridge. By specifying this a mixing type bridge is created that exchanges video in an SFU fashion. Change-Id: I2ada47cf5f3fc176518b647c0b4aa39d55339606 2017-09-27 11:16 +0000 [a6dc0527a2] Richard Mudgett * res_pjsip_outbound_publish.c: Fix misplaced parenthesis. The pjsip_publishc_init() call was referenced with a misplaced parentheses. As a result, outbound publication messages went out with an expiration of 1 second. ASTERISK-27298 Change-Id: I93622eabc8ee83e7a22e98c107f921284c605a08 2017-09-26 11:01 +0000 [61ea872233] George Joseph * pjsip_message_filter: Fix regression causing bad contact address The "res_pjsip: Filter out non SIP(S) requests" commit moved the filtering of messages to pjproject's PJSIP_MOD_PRIORITY_TRANSPORT_LAYER in order to filter out incoming bad uri schemes as early as possible. Since the change affected outgoing messages as well and the TRANSPORT layer is the last to be run on outgoing messages, we were overwriting the setting of external_signaling_address (which is set earlier by res_pjsip_nat) with an internal address. * pjsip_message_filter now registers itself as a pjproject module twice. Once in the TSX layer for the outgoing messages (as it was originally), then a second time in the TRANSPORT layer for the incoming messages to catch the invalid uri schemes. ASTERISK-27295 Reported by: Sean Bright Change-Id: I2c90190c43370f8a9d1c4693a19fd65840689c8c 2017-09-13 21:31 +0000 [9d65057cdf] Richard Mudgett * res_rtp_asterisk.c: Fix bridge_p2p_rtp_write() reentrancy potential. The bridge_p2p_rtp_write() has potential reentrancy problems. * Accessing the bridged RTP members must be done with the instance1 lock held. The DTMF and asymmetric codec checks must be split to be done with the correct RTP instance struct locked. i.e., They must be done when working on the appropriate side of the point to point bridge. * Forcing the RTP mark bit was referencing the wrong side of the point to point bridge. The set mark bit is used everywhere else to set the mark bit when sending not receiving. The patches for ASTERISK_26745 and ASTERISK_27158 did not take into account that not everything carried by RTP uses a codec. The telephony DTMF events are not exchanged with a codec. As a result when RFC2833/RFC4733 sent digits you would crash if "core set debug 1" is enabled, the DTMF digits would always get passed to the core even though the local native RTP bridge is active, and the DTMF digits would go out using the wrong SSRC id. * Add protection for non-format payload types like DTMF when updating the lastrxformat and lasttxformat. Also protect against non-format payload types when checking for asymmetric codecs. ASTERISK-27292 Change-Id: I6344ab7de21e26f84503c4d1fca1a41579364186 2017-09-26 10:55 +0000 [c9e972a26a] Sean Bright * res_rtp_asterisk: Trim trailing byte off of SDES packet This could have been fixed by subtracting 1 from the final value of 'len' but the way the packet was being constructed was confusing so I took the opportunity to (I think) make it more clear. We were sending 1 extra byte at the end of the SDES RTCP packet which caused Chrome to complain (in its debug log): Too little data (1 byte) remaining in buffer to parse RTCP header (4 bytes). We now send the correct number of bytes. Change-Id: I9dcf087cdaf97da0374ae0acb7d379746a71e81b 2017-09-25 13:00 +0000 [721947ebae] Sean Bright * webrtc: Allow 'webrtc' to be set on endpoints without dtls_ca_file If using a legitimate certificate from a trusted certificate authority, you don't need to provide CA file. Change-Id: I8623973b4209b44889243716d7880274caed8a6d 2017-09-25 13:09 +0000 [0cbeaa5589] Sean Bright * pjproject: Patch to correct STUN FINGERPRINT usage Change-Id: I0e453253dff1388b0186b36c754457c1d0d12db6 2017-09-25 12:30 +0000 [b74cbadd05] Kevin Harwell * res_pjsip_session: outgoing call did not offer all configured codecs For some scenarios when an outgoing call was made only a subset of the configured codecs were offered. If the codecs being offered happened to not have a codec supported by the phone then the call would fail. For instance Alice and Bob both are configured in Asterisk for g722 and ulaw( allow=!all,g722,ulaw). Alice's endpoint however only supports g722 while Bob's only supports ulaw. When Alice calls Bob, Alice negotiates g722 fine with Asterisk. But when Asterisk sends the outgoing offer to Bob it only contains g722 and not both g722 and ulaw, so the call ends. This patch makes it so all the audio codecs configured on the endpoint always get sent, and not just a subset. However priority is given to those codecs that are compatible with the "other side". ASTERISK-27259 #close Change-Id: Iffabc373bd94cd1dc700925dcfe406e12918c696 2017-09-25 10:59 +0000 [08e67f814b] Richard Mudgett * channel.c: Fix invalid reference in conditionaled out code. ASTERISK-27289 Change-Id: I7a415948116493050614d9f4fa91ffbe0c21ec4c 2017-09-25 07:25 +0000 [4275ca16a1] George Joseph * build: A few gcc 7 error fixes Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec 2017-09-15 02:59 +0000 [c3c73b3511] Stefan Engström * app_queue: Only do announcement logic between ringing cycles This patch reverts the change by patch 2263 from old reviewboard. Note that reverting that 2263-patch still preserves the behaviour that the commit log of the 2263-patch claimed to add. The reason for this is: The function wait_for_answer is only called from try_calling which in turn is only called from the main for loop in queue_exec, and earlier in that loop we already check the things that's removed by this patch. There's no need to check those things twice each loop iteration, and I think the proper place to check it is before each ringing cycle. By checking it in wait_for_answer, you allow the issue explained in the jira - that the head caller hears announcements while the agents' sip phones are actively ringing. Reported-by: Stefan Engström Tested-by: Stefan Engström ASTERISK-27216 #close Change-Id: Ic4290dc75256f9743900c6762ee1bb915f672db0 2017-09-23 12:32 +0000 [0fad11f21c] Sean Bright * app_stream_echo: Don't echo declined streams Discovered while experimenting with Cyber Mega Phone 2K Ultimate Dynamic Edition after accepting the audio request but declining the video one. Change-Id: Iaa86d41fccfbc1b559a30ccf740d78a3b5f8a98c 2017-09-22 17:49 +0000 [601e0c563f] Joshua Colp * res_pjsip_session: Reduce (and improve) SDP renegotiation. When pruning a request to change the topology of a channel be more intelligent about the resulting topology that is actually used for SDP renegotiation. In a case where a stream has not already been negotiated we don't need to renegotiate and offer a declined stream. This can occur if something in Asterisk (such as ConfBridge) requests to add video to a PJSIP channel that has no video codecs configured. In this case since the stream did not already exist we can safely remove the stream from the requested topology, resulting in no renegotiation occurring. In a case where a renegotiation is requested with a codec that is not supported we can reuse the formats of the existing stream if it exists to ensure that the stream continues to flow, instead of removing it. Change-Id: I636540798d55922377318fe619c510fb6ed125fb 2017-09-22 15:29 +0000 [36690c26f8] Kevin Harwell * res_pjsip_session: Don't end session when receiving a 500 on a reinvite During a reinvite, if a remote endpoint error occurs and it returns a 500 the session would end. This patch makes it so the session is not terminated, but continues as it was. The reason for this is because some endpoints may send non session terminating "server errors" like a failed codec negotiation. So in this case instead of ending the call it can hopefully continue. In the case of a real server error the session is already "doomed", will be known soon enough and appropriately ended by Asterisk later. Change-Id: Ifeedae86b8cb44b92d52c79046522ec5f0aff1d5 2017-09-22 10:02 +0000 [ebd0a4bebf] Sean Bright * res_pjsip: Use ast_sip_is_content_type() where appropriate Change-Id: If3ab0d73d79ac4623308bd48508af2bfd554937d 2017-09-21 09:47 +0000 [6c0e13da22] George Joseph * res_pjsip_session/BUNDLE: Handle no audio codecs on endpoint When an INVITE came in with both audio and video streams but there were no audio codecs defined for the endpoint, we weren't declining the audio stream. Since it's usually the first/transport stream, when the video stream was processed and tried to use the transport, it was empty and caused a crash. We now decline the the stream if there are no matching codecs so when the video stream is processed, it's now the first/transport stream and processes normally. Change-Id: Ic854eda54c95031e66b076ecfae3041d34daa692 2017-09-19 14:28 +0000 [7c93982e9d] Richard Mudgett * res_rtp_asterisk.c: Fix bundled SSRC handling. Assertions in the v15+ AST-2017-008 patches found that we were not handling the case if the incoming SDP did not specify the required SSRC attributes for bundled to work. * Be strict on matching SSRC for bundled instances including the parent instance. If the SSRC doesn't match then discard the packet. Bundled has to tell us in the SDP signaling what SSRC to expect. Otherwise, we will not know how to find the bundled instance structure. Change-Id: I152830bbff71c662408909042068fada39e617f9 2017-09-16 09:19 +0000 [f2985e3106] Joshua Colp * bridge: Change participant SFU streams when source streams change. Some endpoints do not like a stream being reused for a new media stream. The frame/jitterbuffer can rely on underlying attributes of the media stream in order to order the packets. When a new stream takes its place without any notice the buffer can get confused and the media ends up getting dropped. This change uses the SSRC change to determine that a new source is reusing an existing stream and then bridge_softmix renegotiates each participant such that they see a new media stream. This causes the frame/jitterbuffer to start fresh and work as expected. ASTERISK-27277 Change-Id: I30ccbdba16ca073d7f31e0e59ab778c153afae07 2017-09-20 10:45 +0000 [971548405b] George Joseph * res_pjsip_session: Change some asserts to warning/debug messages There was an issue reported where an SDP received on a 183 Session Progress message caused a crash because the pending streams had already been processed when the OK was received. In that case the pending topology was legitimately NULL. There was an assert for an incorrect number of streams in the topology but not one for topology being NULL. In any case, if you're not in dev-mode the asserts don't do anything and since the scenario is legit, the asserts weren't appropriate anyway. * Changed several asserts to warning or debug messages and return codes as appropriate. ASTERISK-27264 Reported by: Daniel Heckl Change-Id: I58daaa9d2938fa980857ab3ec41925ab5ff9c848 2017-09-19 05:22 +0000 [cad68137a7] Rodrigo Ramírez Norambuena * res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1 In PostgreSQL 9.1 the backslash are string literals and not the escape of characters. In previous issue ASTERISK_26057 was fixed the use of escape LIKE but the support for old version of Postgresql than 9.1 was dropped. The sentence before make was "ESCAPE '\'" but in version before than 9.1 need it to be as follow "ESCAPE '\\'". ASTERISK-27283 Change-Id: I96d9ee1ed7693ab17503cb36a9cd72847165f949 2017-09-15 09:43 +0000 [e666051d79] Ben Ford * res_pjsip_session: Check for removed stream state. When a sip session is refreshed, the stream topology is looped through, checking each stream for compatible formats. This would cause a crash if the stream state was AST_STREAM_STATE_REMOVED, since the formats would never be set for this stream, causing a NULL value to be returned from ast_stream_get_formats. This commit adds a check for streams with removed states. Also removed a stray semicolon. Change-Id: Ic86f8b65a4a26a60885b28b8b1a0b22e1b471d42 2017-09-19 05:44 +0000 [b6aa728a58] George Joseph * chan_pjsip: Ignore AST_CONTROL_STREAM_TOPOLOGY_CHANGED for now chan_pjsip_indicate was missing a case for the recently added AST_CONTROL_STREAM_TOPOLOGY_CHANGED condition and was returning an error and causing the call to be hung up instead of just ignoring it. ASTERISK-27260 Reported by: Daniel Heckl Change-Id: I4fecbb00a0b8a853da85155065c1a6bddf235e80 2017-09-07 04:41 +0000 [6b7d5671d1] Jean Aunis * bridge : Fix one-way direct-media when early bridging with native_rtp When two channels were early bridged in a native_rtp bridge, the RTP description on one side was not updated when the other side answered. This patch forbids non-answered channels to enter a native_rtp bridge, and triggers a bridge reconfiguration when an ANSWER frame is received. ASTERISK-27257 Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df 2017-09-18 09:51 +0000 [1e4c1cec7f] Alexander Traud * res_srtp: lower log level of auth failures Previously, sRTP authentication failures were reported on log level WARNING. When such failures happen, each RT(C)P packet is affected, spamming the log. Now, those failures are reported at log level VERBOSE 2. Furthermore, the amount is further reduced (previously all two seconds, now all three seconds). Additionally, the new log entry informs whether media (RTP) or statistics (RTCP) are affected. ASTERISK-16898 #close Change-Id: I6c98d46b711f56e08655abeb01c951ab8e8d7fa0 2017-09-19 10:38 +0000 [b748038230] George Joseph * res_pjsip_pubsub: Check for Content-Type header in rx_notify_request pubsub_on_rx_notify_request wasn't checking for a null Content-Type header before checking that it was application/simple-message-summary. ASTERISK-27279 Reported by: Ross Beer Change-Id: Iec2a6c4d2e74af37ff779ecc9fd35644c5c4ea52 2017-09-19 09:34 +0000 [a5f1d58fe1] David J. Pryke * chan_sip: Expose read-only access to the full SIP INVITE Request-URI Provide a way to get the contents of the the Request URI from the initial SIP INVITE in dial plan function call. (In this case "${CHANNEL(ruri)}") ASTERISK-27278 Reported by: David J. Pryke Tested by: David J. Pryke Change-Id: I1dd4d6988eed1b6c98a9701e0e833a15ef0dac3e 2017-09-19 07:53 +0000 [6fd3db51e8] Joshua Colp * app_confbridge: Only create a channel that records audio. This change makes it so that the conference recorder channel that is created only contains audio formats and an audio stream. This is because the underlying application used by ConfBridge to record, MixMonitor, only allows recording audio. Having additional streams (and in particular a video stream) can result in clients needlessly renegotiating to add a video stream that will never receive video. Change-Id: I89d38aedc9205eca7741d5435e73e73bb9de97a0 2017-09-19 06:34 +0000 [56f0d5fc0f] Rodrigo Ramírez Norambuena * res_config_pgsql: Add missing \n in debug log and update copyright year Change-Id: I4ba338ecbdecc6a814a902eddc4121c8ef3cda58 2017-09-13 14:14 +0000 [55567ee1d8] Sean Bright * res_calendar: Plug memory leak and micro-optimization ast_variables_destroy is NULL safe, so there is no need to check its argument before passing it. ASTERISK-25524 #close Reported by: Jesper Change-Id: Ib0f8057642e9d471960f1a79fd42e5a3ce587d3b 2017-09-13 03:46 +0000 [1199927fc0] alex * cdr_mysql.c: Apply cdrzone to start and answer Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0 2017-08-25 17:01 +0000 [087f667ab1] Richard Mudgett * AST-2017-008: Improve RTP and RTCP packet processing. Validate RTCP packets before processing them. * Validate that the received packet is of a minimum length and apply the RFC3550 RTCP packet validation checks. * Fixed potentially reading garbage beyond the received RTCP record data. * Fixed rtp->themssrc only being set once when the remote could change the SSRC. We would effectively stop handling the RTCP statistic records. * Fixed rtp->themssrc to not treat a zero value as special by adding rtp->themssrc_valid to indicate if rtp->themssrc is available. ASTERISK-27274 Make strict RTP learning more flexible. Direct media can cause strict RTP to attempt to learn a remote address again before it has had a chance to learn the remote address the first time. Because of the rapid relearn requests, strict RTP could latch onto the first remote address and fail to latch onto the direct media remote address. As a result, you have one way audio until the call is placed on and off hold. The new algorithm learns remote addresses for a set time (1.5 seconds) before locking the remote address. In addition, we must see a configured number of remote packets from the same address in a row before switching. * Fixed strict RTP learning from always accepting the first new address packet as the new stream. * Fixed strict RTP to initialize the expected sequence number with the last received sequence number instead of the last transmitted sequence number. * Fixed the predicted next sequence number calculation in rtp_learning_rtp_seq_update() to handle overflow. ASTERISK-27252 Change-Id: Ia2d3aa6e0f22906c25971e74f10027d96525f31c 2017-09-13 16:23 +0000 [d178f497d2] George Joseph * res_pjsip: Filter out non SIP(S) requests Incoming requests with non sip(s) URIs in the Request, To, From or Contact URIs are now rejected with PJSIP_SC_UNSUPPORTED_URI_SCHEME (416). This is performed in pjsip_message_filter (formerly pjsip_message_ip_updater) and is done at pjproject's "TRANSPORT" layer before a request can even reach the distributor. URIs read by res_pjsip_outbound_publish from pjsip.conf are now also checked for both length and sip(s) scheme. Those URIs read by outbound registration and aor were already being checked for scheme but their error messages needed to be updated to include scheme failure as well as length failure. Change-Id: Ibb2f9f1d2dc7549da562af4cbd9156c44ffdd460 2017-09-14 07:54 +0000 [01f2220bec] Joshua Colp * tcptls: Change error message to debug. The Websocket implementation will steal the underlying stream of TCP/TLS sessions. This results in an error message being output about a stream not being present when in reality this is actually fine. This change moves it to a debug message instead. Change-Id: I66cc639080b4b4599beadb4faa7d313f2721d094 2017-09-13 14:08 +0000 [d8112cd98b] Sean Bright * res_calendar: Various fixes * The way that we were looking at XML elements for CalDAV was extremely fragile, so use SAX2 for increased robustness. * Don't complain about a 'channel' not be specified if autoreminder is not set. Assume that if 'channel' is not set, we don't want to be notified. * Fix some truncated CLI output in 'calendar show calendar' and make the 'Autoreminder' description a bit more clear ASTERISK-24588 #close Reported by: Stefan Gofferje ASTERISK-25523 #close Reported by: Jesper Change-Id: I200d11afca6a47e7d97888f286977e2e69874b2c 2017-09-13 09:38 +0000 [eec0396395] Sean Bright * chan_rtp: Use μ-law by default instead of signed linear Multicast/Unicast RTP do not use SDP so we need to use a format that cleanly maps to one of the static RTP payload types. Without this change, an Originate to a Multicast or Unicast channel without a format specified would produce no audio on the receiving device. ASTERISK-21399 #close Reported by: Tzafrir Cohen Change-Id: I97e332b566e85da04b0004b9b0daae746cfca0e3 2017-09-11 05:46 +0000 [446d48fd49] George Joseph * res_pjsip: Add handling for incoming unsolicited MWI NOTIFY A new endpoint parameter "incoming_mwi_mailbox" allows Asterisk to receive unsolicited MWI NOTIFY requests and make them available to other modules via the stasis message bus. res_pjsip_pubsub has a new handler "pubsub_on_rx_mwi_notify_request" that parses a simple-message-summary body and, if endpoint->incoming_mwi_account is set, calls ast_publish_mwi_state with the voice-message counts from the message. Change-Id: I08bae3d16e77af48fcccc2c936acce8fc0ef0f3c 2017-09-08 21:41 +0000 [4889574ff5] Richard Mudgett * res_rtp_asterisk.c: Add doxygen to RTCP payload types. Change-Id: I3f20ce428777cc4ce9c13b2f808d29ff8c873998 2017-09-11 05:52 +0000 [f9bad3bd61] George Joseph * alembic: Fix typo in add_auto_info_to_endpoint_dtmf_mode The downgrade function was missing "_v2" at the end of the alter column type. Change-Id: Iaa9bcef48d6f3590ce07a61342d8e66f00263d8e 2017-09-10 06:17 +0000 [680aba21ec] Walter Doekes * res/res_pjsip: Fix localnet checks in pjsip, part 2. In 45744fc53, I mistakenly broke SDP media address rewriting by misinterpreting which address was checked in the localnet comparison. Instead of checking the remote peer address to decide whether we need media address rewriting, we check our local media address: if it's local, then we rewrite. This feels awkward, but works and even made directmedia work properly if you set local_net. (For the record: for local peers, the SDP media rewrite code is not called, so the comparison does no harm there.) ASTERISK-27248 #close Change-Id: I566be1c33f4d0a689567d451ed46bab9c3861d4f 2017-09-08 21:19 +0000 [c8d53a1638] Rodrigo Ramírez Norambuena * cdr_pgsql: Refactor magic number by definition for version Change-Id: I43f25976aa3069793ddbe0086833965a6fb0a518 2017-09-05 11:13 +0000 [e9a81157ac] Florian Floimair * alembic: Add support for MS-SQL MS-SQL has no native Enum-type support and therefore needs to work with constraints. Since these constraints need unique names the suggested approach referenced in the following alembic documentation has been applied: http://bit.ly/2x9r8pb ASTERISK-27255 #close Change-Id: I8b579750dae0c549f1103ee50172644afb9b2f95 2017-09-05 07:31 +0000 [525f84bb35] Jacek Konieczny * func_cdr: honour 'u' flag on dummy channel Fixes ${CDR(...,u)} when used in cdr_custom.conf ASTERISK-27165 #close Change-Id: Ia4e0b6ba93e03d27886354c279737790e2cd6a83 2017-09-06 10:50 +0000 [2b3f903e6f] Sean Bright * app_waitforsilence: Cleanup & don't treat missing frames as 'noise' * WaitForSilence completes successfully if it receives no media in the specified timeout, but when acting as WaitForNoise that logic needs to be reversed. * Use standard argument parsing macros and add some error checking for invalid values. * The documentation indicated that the first argument to both WaitForSilence and WaitForNoise was required when it was not. Update the documentation to reflect that. * Wrap up some behavior in structs to avoid boolean checks all over the place. ASTERISK-24066 #close Reported by: M vd S Change-Id: I01d40adc5b63342bb5018a1bea2081a0aa191ef9 2017-09-06 16:05 +0000 [5553644284] Scott Griepentrog * chan_sip: when getting sip pvt return failure if not found In handle_request_invite, when processing a pickup, a call is made to get_sip_pvt_from_replaces to locate the pvt for the subscription. The pvt is assumed to be valid when zero is returned indicating no error, and is dereferenced which can cause a crash if it was not found. This change checks the not found case and returns -1 which allows the calling code to fail appropriately. ASTERISK-27217 #close Reported-by: Bryan Walters Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612 2017-09-06 13:38 +0000 [23571f31ac] Richard Mudgett * stasis/control.c: Fix set_interval_hook() ref leak. Change-Id: Ia0edb7dc0dbbb879c079ff7000f1b722d86ce7dc 2017-09-01 05:17 +0000 [94091c7b96] George Joseph * stasis/control: Fix possible deadlock with swap channel If an error occurs during a bridge impart it's possible that the "bridge_after" callback might try to run before control_swap_channel_in_bridge has been signalled to continue. Since control_swap_channel_in_bridge is holding the control lock and the callback needs it, a deadlock will occur. * control_swap_channel_in_bridge now only holds the control lock while it's actually modifying the control structure and releases it while the bridge impart is running. * bridge_after_cb is now tolerant of impart failures. Change-Id: Ifd239aa93955b3eb475521f61e284fcb0da2c3b3 2017-09-06 05:23 +0000 [67a2ca31f5] Vitezslav Novy * chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITE If directmedia=yes is configured, when call is answered, Asterisk sends reINVITE to both parties to set up media path directly between the endpoints. In this reINVITE msg SDP origin line (o=) contains IP address of endpoint instead of IP of asterisk. This behavior violates RFC3264, sec 8: "When issuing an offer that modifies the session, the "o=" line of the new SDP MUST be identical to that in the previous SDP, except that the version in the origin field MUST increment by one from the previous SDP." This patch assures IP address of Asterisk is always sent in SDP origin line. ASTERISK-17540 Reported by: saghul Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e 2017-09-06 07:54 +0000 [0cbb17ce8f] George Joseph * alembic: Fix enum creation for dtls_fingerprint Change-Id: Ic061c5066a146616a68376881c7e4cf6d6e7e7db 2017-09-05 11:08 +0000 [a133c5cc53] Florian Floimair * alembic: fix erroneous commit for add_prune_on_boot Added include for postgresql ENUM type and redefined values in the same way as in the other migration scripts. ASTERISK-27254 #close Change-Id: Id667304cdf3891b1c2f7d35fab3e2a84026159fa 2017-09-06 03:02 +0000 [2d395793b7] Alexander Traud * res_srtp: Add support for libsrtp2.1. Asterisk is able to use libSRTP 2.0.x. However since libSRTP 2.1.x, the macro SRTP_AES_ICM got renamed to SRTP_AES_ICM_128. Beside to still compile with previous versions of libSRTP, this change allows libSRTP 2.1.x as well. ASTERISK-27253 #close Change-Id: I2e6eb3c3bc844fee8a624060a2eb6f182dc70315 2017-09-05 09:35 +0000 [bfc29de3ea] Ben Ford * chan_pjsip: Suppress frame warnings. When rtp_keepalive is on for a PJSIP endpoint dialing to another Asterisk instance also using PJSIP, Asterisk will continue to print warning messages about not being able to send frames of a certain type. This suppresses that warning message. Change-Id: I0332a05519d7bda9cacfa26d433909ff1909be67 2017-09-05 10:05 +0000 [c3a6c8fd2d] Sean Bright * formats: Restore previous fread() behavior Some formats are able to handle short reads while others are not, so restore the previous behavior for the format modules so that we don't have spurious errors when playing back files. ASTERISK-27232 #close Reported by: Jens T. Change-Id: Iab7f52b25a394f277566c8a2a4b15a692280a300 2017-09-05 09:16 +0000 [f856d9b42b] Walter Doekes * res/res_pjsip: Standardize/fix localnet checks across pjsip. In 2dee95cc (ASTERISK-27024) and 776ffd77 (ASTERISK-26879) there was confusion about whether the transport_state->localnet ACL has ALLOW or DENY semantics. For the record: the localnet has DENY semantics, meaning that "not in the list" means ALLOW, and the local nets are in the list. Therefore, checks like this look wrong, but are right: /* See if where we are sending this request is local or not, and if not that we can get a Contact URI to modify */ if (ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW) { ast_debug(5, "Request is being sent to local address, " "skipping NAT manipulation\n"); (In the list == localnet == DENY == skip NAT manipulation.) And conversely, other checks that looked right, were wrong. This change adds two macro's to reduce the confusion and uses those instead: ast_sip_transport_is_nonlocal(transport_state, addr) ast_sip_transport_is_local(transport_state, addr) ASTERISK-27248 #close Change-Id: Ie7767519eb5a822c4848e531a53c0fd054fae934 2017-09-05 08:39 +0000 [68bcfccd52] Joshua Colp * res_pjsip_session: Preserve stream name during renegotiation. Stream names within Asterisk can have meaning so when an externally initiated renegotiation occurs we need to preserve the name of the stream if it already exists. Change-Id: I29f50d0cc7f3238287d6d647777e76e1bdf8c596 2017-09-05 07:50 +0000 [0ec95515f3] George Joseph * res_calendar*, res_smdi: Move to "extended" support Change-Id: I31eee8be30c6b0fc3dadb31111dd47742da8892d 2017-09-05 05:23 +0000 [9b3f6d26bd] George Joseph * res_pjsip_t38: Make t38_reinvite_response_cb tolerant of NULL channel t38_reinvite_response_cb can get called by res_pjsip_session's session_inv_on_tsx_state_changed in situations where session->channel is NULL. If it is, the ast_log warning segfaults because it tries to get the channel name from a NULL channel. * Check session->channel and print "unknown channel" when it's NULL. ASTERISK-27236 Reported by: Ross Beer Change-Id: I4326e288d36327f6c79ab52226d54905cdc87dc7 2017-09-01 16:17 +0000 [60b44d1e38] Sean Bright * rtp_engine: Prevent possible double free with DTLS config ASTERISK-27225 #close Reported by: Richard Kenner Change-Id: I097b81734ef730f8603c0b972909d212a3a5cf89 2017-09-01 13:15 +0000 [ef8eb9d11b] Sean Bright * chan_ooh323: Fix confusing indentation warning ASTERISK-27177 #close Reported by: Tzafrir Cohen Change-Id: I40311c404edb2302a7543ad5ca7a06b2a38f2d97 2017-09-01 09:51 +0000 [1bdbefbe76] Sean Bright * app_directory: Handle a NULL mailbox without crashing ASTERISK-27241 #close Reported by: David Moore Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6 2017-07-24 10:48 +0000 [f78f5278ff] George Joseph * pjsip_message_ip_updater: Fix issue handling "tel" URIs sanitize_tdata was assuming all URIs were SIP URIs so when a non SIP uri was in the From, To or Contact headers, the unconditional cast of a non-pjsip_sip_uri structure to pjsip_sip_uri caused a segfault when trying to access uri->other_param. * Added PJSIP_URI_SCHEME_IS_SIP(uri) || PJSIP_URI_SCHEME_IS_SIPS(uri) checks before attempting to cast or use the returned uri. ASTERISK-27152 Reported-by: Ross Beer Change-Id: Id380df790e6622c8058a96035f8b8f4aa0b8551f 2017-07-01 19:24 +0000 [1bf3dfffd7] Corey Farrell * AST-2017-006: Fix app_minivm application MinivmNotify command injection An admin can configure app_minivm with an externnotify program to be run when a voicemail is received. The app_minivm application MinivmNotify uses ast_safe_system() for this purpose which is vulnerable to command injection since the Caller-ID name and number values given to externnotify can come from an external untrusted source. * Add ast_safe_execvp() function. This gives modules the ability to run external commands with greater safety compared to ast_safe_system(). Specifically when some parameters are filled by untrusted sources the new function does not allow malicious input to break argument encoding. This may be of particular concern where CALLERID(name) or CALLERID(num) may be used as a parameter to a script run by ast_safe_system() which could potentially allow arbitrary command execution. * Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp() instead of ast_safe_system() to avoid command injection. * Document code injection potential from untrusted data sources for other shell commands that are under user control. ASTERISK-27103 Change-Id: I7552472247a84cde24e1358aaf64af160107aef1 2017-05-22 10:36 +0000 [7f2a60fb38] Joshua Colp * res_rtp_asterisk: Only learn a new source in learn state. This change moves the logic which learns a new source address for RTP so it only occurs in the learning state. The learning state is entered on initial allocation of RTP or if we are told that the remote address for the media has changed. While in the learning state if we continue to receive media from the original source we restart the learning process. It is only once we receive a sufficient number of RTP packets from the new source that we will switch to it. Once this is done the closed state is entered where all packets that do not originate from the expected source are dropped. The learning process has also been improved to take into account the time between received packets so a flood of them while in the learning state does not cause media to be switched. Finally RTCP now drops packets which are not for the learned SSRC if strict RTP is enabled. ASTERISK-27013 Change-Id: I56a96e993700906355e79bc880ad9d4ad3ab129c 2017-08-30 07:28 +0000 [5ba82cedc6] Joshua Colp * res_rtp_asterisk: Allow remote SSRC to change on an RTP instance. When SDP renegotiation occurs it is possible for an RTP instance to be reused for a new stream, resulting in the remote SSRC changing if it is part of a bundle group. This change allows this and updates its mapping in the current bundle group. ASTERISK-27231 Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490 2017-08-25 21:06 +0000 [71be8d5bbe] Andre Nazario * chan_pjsip: Add tag info in CHANNEL function Create local_tag and remote_tag in CHANNEL info to get tag from From and To headers of a SIP dialog. ASTERISK-27220 Change-Id: I59b16c4b928896fcbde02ad88f0e98922b15d524 2017-08-29 14:22 +0000 [4650fc477a] Richard Mudgett * bridge_native_rtp.c: Fixup native_rtp_framehook() * Fix framehook to test frame type for control frame. * Made framehook exit early if frame type is not a control frame. * Eliminated RAII_VAR in framehook. * Use switch instead of else-if ladder for control frame handling. Change-Id: Ia555fc3600bd85470e3c0141147dbe3ad07c1d18 2017-08-29 09:26 +0000 [06cc5ae9ff] Sean Bright * confbridge: Handle user hangup during name recording This prevents orphaned CBAnn channels from getting stuck in the bridge. ASTERISK-26994 #close Reported by: James Terhune Change-Id: I5e43e832a9507ec3f2c59752cd900b41dab80457 2017-08-24 11:45 +0000 [9a9589e8e1] Joshua Colp * core: Reduce video update queueing. A video update frame is used to indicate that a channel with video negotiated should provide a full frame so the decoder decoding the stream is able to do so. In situations where a queue is used to store frames it makes no sense for the queue to contain multiple video update frames. One is sufficient to have a full frame be sent. ASTERISK-27222 Change-Id: Id3f40a6f51b740ae4704003a1800185c0c658ee7 2017-08-25 13:44 +0000 [da13cdb9e7] Sean Bright * voicemail: Fix various abuses of mkstemp mkstemp() returns a unique filename, but appending an extension to that filename does not guarantee uniqueness. Instead, use mkdtemp() and we can put whatever extension we want on the files that we create inside the directory. In the case of app_minivm, we also now properly clean up any temporary files that we create. ASTERISK-20858 #close Reported by: Walter Doekes Change-Id: I30ad04f0e115f0b11693ff678ba5184d8b938e43 2017-08-25 12:20 +0000 [43670e471f] Sean Bright * app_record: Resolve some absolute vs. relative filename bugs If the Record() application is called with a relative filename that includes directories, we were not properly creating the intermediate directories and Record() would fail. Secondarily, updated the documentation for RECORDED_FILE to mention that it does not include a filename extension. Finally, rewrote the '%d' functionality to be a bit more straight forward and less noisy. ASTERISK-16777 #close Reported by: klaus3000 Change-Id: Ibc2640cba3a8c7f17d97b02f76b7608b1e7ffde2 2017-08-23 10:01 +0000 [2ee644aacf] Florian Floimair * alembic: Add dtls_fingerprint column in ps_endpoints table The ps_endpoints table was missing the dtls_fingerprint column introduced with commit adba2a8d7fd. ASTERISK-27168 #close Change-Id: I9cb5006f7f50718b5239919562773adabb334cfd 2017-08-21 04:28 +0000 [33a648d4c6] Torrey Searle * res/res_pjsip_session: allow SDP answer to be regenerated If an SDP answer hasn't been sent yet, it's legal to change it. This is required for PJSIP_DTMF_MODE to work correctly, and can also have use in the future for updating codecs too. ASTERISK-27209 #close Change-Id: Idbbfb7cb3f72fbd96c94d10d93540f69bd51e7a1 2017-08-24 09:42 +0000 [02f95d290f] Sean Bright * app_queue: Evaluate realtime queues when running dialplan functions ASTERISK-19103 #close Reported by: Jim Van Meggelen Change-Id: I4bd32a9d1fcebb8ac56bff0e084d4f53e31b692b 2017-08-23 09:19 +0000 [b1097be134] Eelco Brolman (License 6442) * app_voicemail: Honor escape digits in "greeting only" mode ASTERISK-21241 #close Reported by: Eelco Brolman Patches: Patch uploaded by Eelco Brolman (License 6442) Change-Id: Icbe39b5c82a49b46cf1d168dc17766f3d84f54fe 2017-08-24 08:35 +0000 [7937d5b8b3] Sean Bright * res_smdi: Clean up memory leak Change-Id: I1e33290929e1aa7c5b9cb513f8254f2884974de8 2017-08-18 17:37 +0000 [f2c14f00b8] Richard Mudgett * res_pjsip_session.c: Fix crash when declining an active stream. If a previously active stream is declined we could crash because the channel's thread is still using the stream while we are updating the topology in the serializer thread. * Defer removing any declined stream's handler until we have blocked the channel's thread with the channel lock. ASTERISK-27212 Change-Id: I50e1d3ef26f8e41948f4c411ee329aa3b960a420 2017-08-16 17:50 +0000 [17976d1b4e] Richard Mudgett * bridge_channel.c: Fix FRACK when mapping frames to the bridge. * Add protection checks when mapping streams to the bridge. The channel and bridge may be in the process of updating the stream mapping when a media frame comes in so we may not be able to map the frame at the time. * We need to map the streams to the bridge's stream numbers right before they are written into the bridge. That way we don't have to keep locking/unlocking the bridge and we won't have any synchronization problems before the frames actually go into the bridge. * Protect the deferred queue with the bridge_channel lock. ASTERISK-27212 Change-Id: Id6860dd61b594b90c8395f6e2c0150219094c21a 2017-08-11 16:31 +0000 [9c70c88369] Richard Mudgett * channel: Fix topology API locking. * ast_channel_request_stream_topology_change() must not be called with any channel locks held. * ast_channel_stream_topology_changed() must be called with only the passed channel lock held. ASTERISK-27212 Change-Id: I843de7956d9f1cc7cc02025aea3463d8fe19c691 2017-08-16 15:22 +0000 [6ad8249233] Richard Mudgett * bridge: Fix softmix bridge deadlock. * Fix deadlock in bridge_softmix.c:softmix_bridge_stream_topology_changed() between bridge_channel and channel locks. * The new bridge technology topology change callbacks must be called with the bridge locked. The callback references the bridge channel list, the bridge technology could change, and the bridge stream mapping is updated. ASTERISK-27212 Change-Id: Ide4360ab853607e738ad471721af3f561ddd83be 2017-08-14 12:20 +0000 [850a3fd017] Richard Mudgett * chan_pjsip.c: Fix topology refresh response code accuracy. There are other 1xx and 2xx codes than 100 and 200 respectively. Change-Id: I680db0997343256add1478714f5bf5b5569aee17 2017-08-11 17:06 +0000 [87c7a1c79c] Richard Mudgett * bridge_softmix.c: Restored softmix_bridge_leave() shortcut exit. Change-Id: I13026cd90954e0265eab94a0faf635a3e11f0e35 2017-08-17 17:07 +0000 [5bbf7b2aad] Richard Mudgett * app_confbridge: Document sfu video_mode value. Change-Id: I26e17df2c93f3933b23f78070603adbcc84ba204 2017-08-17 17:06 +0000 [f96536b1ea] Richard Mudgett * confbridge.h: Fix doxygen comments. Change-Id: I16133166a85fdb557c66ffcbfe8128d0b4725b0e 2017-08-11 11:40 +0000 [946ef2d711] Richard Mudgett * bridge_softmix.c: Remove always true test. Change-Id: I26238df2ff0d0f6dfe95c3aa35da588f1ee71727 2017-08-17 16:46 +0000 [22af5e3784] Sungtae Kim * app_queue: Fix initial hold time queue statistic Fixed to use correct initial value and fixed to use the correct queue info to check the first value. ASTERISK-27204 Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73 2017-08-20 08:15 +0000 [83b81d1f8d] Michael Kuron * res_xmpp: fix inverted return code check in OAuth fetch_access_token calls func_curl via ast_func_read. The latter returns 0 upon success and -1 if the function is not available. This commit inverts the return code check so that an error is printed if the module is not loaded and not if it is loaded. ASTERISK-27207 #close Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb 2017-08-17 12:00 +0000 [667986d875] Sean Bright * res_calendar_icalendar: Properly handle recurring events When looking for recurring events, use the correct end time based on the configured 'timeframe.' ASTERISK-27174 #close Reported by: Mark Thompson Change-Id: Id90c3cfc79d561a5521d79be176683e225f2edef 2017-08-16 15:43 +0000 [0e777258be] George Joseph * Fix downloader not working with curl The codec/dpma downloader wasn't handling curl correctly. The logic that transforms makeopts into a bash-sourceable file wasn't handling the make 'or' command in DOWNLOAD_TIMEOUT so bash was looking for an 'or' command. That logic has been eliminated. Instead of trying to transform and source makeopts, the downloader now calls a make scriptlet to print the value of a specific variable. This way, make handles the ors (or any other make construct that happens to creep into that file). ASTERISK-27202 Reported by: Sean McCord Change-Id: Iadfb6693528e4d4da7b8bb201fa66da2c71c7f99 2017-08-15 13:12 +0000 [e4e2e53c8a] Kevin Harwell * manager: hook event is not being raised When the iostream code went in it introduced a conditional that made it so the hook event was not being raised even if a hook is present. This patch adds a check to see if a hook is present in astman_append. If so then call into the send_string function, which in turn raises the even for specified hook. Also updated the ami hooks unit test, so the test could be automated. ASTERISK-27200 #close Change-Id: Iff37f02f9708195d8f23e68f959d6eab720e1e36 2017-08-15 15:15 +0000 [c049d1c3b2] Richard Mudgett * configure: Check cache for valid pjproject tarball before downloading. On a fresh Asterisk source directory, the bundled pjproject tarball is unconditionally downloaded even if the tarball is already in a specified cache directory. * Made check if the pjproject tarball is valid in the cache directory before downloading the tarball on a fresh source directory. Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5 2017-08-15 11:14 +0000 [9e2b2a9837] Richard Mudgett * res_pjsip: Fix prune_on_boot to remove only contacts for the host. * Check that the contact's reg_server matches the host's name before deleting any prune_on_boot contacts. We don't want to delete reliable transport contacts made with other servers if the ps_contacts database table is shared with other servers. Thanks to Ross Beer for pointing out that the original prune logic would delete reliable transport contacts from other servers. ASTERISK-27147 Change-Id: I8e439d0d1c266ffdfd7b73d1e5e466180a689bd0 2017-08-04 09:25 +0000 [15fbcc74d8] Andrey Egorov * res_xmpp: Google OAuth 2.0 protocol support for XMPP / Motif Add ability to use tokens instead of passwords according to Google OAuth 2.0 protocol. ASTERISK-27169 Reported by: Andrey Egorov Tested by: Andrey Egorov Change-Id: I07f7052a502457ab55010a4d3686653b60f4c8db 2017-08-10 14:18 +0000 [bd28a9bbd8] Richard Mudgett * STUN/netsock2: Fix some valgrind uninitialized memory findings. * netsock2.c: Test the addr->len member first as it may be the only member initialized in the struct. * stun.c:ast_stun_handle_packet(): The combinded[] local array could get used uninitialized by ast_stun_request(). The uninitialized string gets copied to another location and could overflow the destination memory buffer. These valgrind findings were found for ASTERISK_27150 but are not necessarily a fix for the issue. Change-Id: I55f8687ba4ffc0f69578fd850af006a56cbc9a57 2017-08-02 18:44 +0000 [1bec781cce] Richard Mudgett * res_pjsip_outbound_registration.c: Re-REGISTER on transport shutdown. The fix for the issue is broken up into three parts. This is part three which handles the client side of REGISTER requests. The registered contact may no longer be valid on the server when the transport used is reliable and the connection is broken. * Re-REGISTER our contact if the reliable transport is broken after registration completes. We attempt to re-REGISTER immediately to minimize the time we are unreachable. Time may have already passed between the connection being broken and the loss being detected. * Reorder sip_outbound_registration_state_alloc() so the STATSD_GUAGE's are still correct if an allocation failure happens. ASTERISK-27147 Change-Id: I3668405b1ee75dfefb07c0d637826176f741ce83 2017-07-31 14:21 +0000 [82f4ade959] Richard Mudgett * res_pjsip: Remove ephemeral registered contacts on transport shutdown. The fix for the issue is broken up into three parts. This is part two which handles the server side of REGISTER requests when rewrite_contact is enabled. Any registered reliable transport contact becomes invalid when the transport connection becomes disconnected. * Monitor the rewrite_contact's reliable transport REGISTER contact for shutdown. If it is shutdown then the contact must be removed because it is no longer valid. Otherwise, when the client attempts to re-REGISTER it may be blocked because the invalid contact is there. Also if we try to send a call to the endpoint using the invalid contact then the endpoint is not likely to see the request. The endpoint either won't be listening on that port for new connections or a NAT/firewall will block it. * Prune any rewrite_contact's registered reliable transport contacts on boot. The reliable transport no longer exists so the contact is invalid. * Websockets always rewrite the REGISTER contact address and the transport needs to be monitored for shutdown. * Made the websocket transport set a unique name since that is what we use as the ao2 container key. Otherwise, we would not know which transport we find when one of them shuts down. The names are also used for PJPROJECT debug logging. * Made the websocket transport post the PJSIP_TP_STATE_CONNECTED state event. Now the global keep_alive_interval option, initially idle shutdown timer, and the server REGISTER contact monitor can work on wetsocket transports. * Made the websocket transport set the PJSIP_TP_DIR_INCOMING direction. Now initially idle websockets will automatically shutdown. ASTERISK-27147 Change-Id: I397a5e7d18476830f7ffe1726adf9ee6c15964f4 2017-07-28 18:26 +0000 [1dcb92bba8] Richard Mudgett * res_pjsip: PJSIP Transport state monitor refactor. The fix for the issue is broken up into three parts. This is part one which refactors the transport state monitor code to allow more modules to be able to monitor transports. * Pull the management of PJPROJECT's transport state callback code from res_pjsip_transport_management.c into res_pjsip. Now other modules can dynamically add and remove themselves from transport monitoring without worrying about breaking PJPROJECT's callback chain. * Add the ability for other modules to get a callback whenever a specific transport is shutdown. ASTERISK-27147 Change-Id: I7d9a31371eb1487c9b7050cf82a9af5180a57912 2017-07-27 15:36 +0000 [ee5edfb050] Richard Mudgett * res_pjsip_transport_management.c: Rename some variables. * Use monitored instead of the misleading keepalive name. Change-Id: I9e5bcbb4ab2b82d49bcd0f06dfe85d15e0b552b6 2017-08-09 15:24 +0000 [ecd1f87edf] Richard Mudgett * UPGRADE notes: Prepare for the eventual 16 branch. Change-Id: I4ca2f07ed62d77f1fdd10c3b216f6a28dd75720c 2017-08-10 09:09 +0000 [4ed2733dde] Scott Griepentrog * res_pjsip_messaging: IPv6 receive address needs brackets When handling an incoming SIP MESSAGE, PJSIP attaches the IP address that the message was received from to the message in the variable PJSIP_RECVADDR. When the IP address is IPv6 the :PORT appended results in an unparseable mess. By using an additional bit flag on the pj_sockaddr_print call, the conventional use of brackets around the address is achieved. ASTERISK-27193 #close Change-Id: I12342521f2ce87a5b6e4883d480a3fd957aa9fd9 2017-07-26 09:17 +0000 [d430f718f5] Torrey Searle * res_rtp_asterisk: enable rtcp & QOS stats on native bridge Asterisk wasn't generating or forwarding RTCP packets when native bridge was activated. Also the stats weren't available via CHANNEL(qos). Now the RTCP stats are always calculated. ASTERISK-27158 #close Change-Id: I46fb8f61c95e836b9d2dda6054b0cf205c16037b 2017-07-28 07:53 +0000 [a2dde59154] Torrey Searle * res_rtp_asterisk: Make P2P bridge Asymmetric codec aware Introduce a new property to rtp-engine to make it aware of the desire for assymetric codecs or not. If asymmetric codecs is not allowed, the bridge will compare read/write formats and shut down the p2p bridge if needed ASTERISK-26745 #close Change-Id: I0d9c83e5356df81661e58d40a8db565833501a6f 2017-08-08 13:33 +0000 [305bd0d99f] George Joseph * Make --with-pjproject-bundled the default for Asterisk 15 '--with-pjproject-bundled' is now the default when running ./configure. It can be disabled with '--without-pjproject-bundled'. To make building without an internet connection easier, a new ./configure option '--with-download-cache' was added that sets the cache for externals (like pjproject, the codecs and the DPMA), AND the sounds files. It can also be specified as an environment variable named "AST_DOWNLOAD_CACHE". The existing '--with-sounds-cache' option / SOUNDS_CACHE_DIR env variable and '--with-externals-cache' option / EXTERNALS_CACHE_DIR env variable remain and if specified, will override '--with-downloads-cache'. ASTERISK-27189 Change-Id: Ifa9783fddf44aafadb060c9feba713dfa81d38ce 2017-08-05 06:36 +0000 [62092bc114] Joshua Colp * res_pjsip_session: Release media resources on session end quicker. A change was made long ago where the session was kept around until the underlying INVITE session had been destroyed. This had the side effect of also keeping the underlying media resources around for this time as well. This change ensures that when we are told to terminate the session we immediately release any media sessions associated with it. ASTERISK-27110 Change-Id: I643e431d5c3bf05cda220c1d39e824a505a29b82 2017-07-29 20:03 +0000 [4b58609c33] Kirill Katsnelson * chan_sip: Access incoming REFER headers in dialplan This adds a way to access information passed along with SIP headers in a REFER message that initiates a transfer. Headers matching a dialplan variable GET_TRANSFERRER_DATA in the transferrer channel are added to a HASH object TRANSFER_DATA to be accessed with functions HASHKEY and HASH. The variable GET_TRANSFERRER_DATA is interpreted to be a prefix for headers that should be put into the hash. If not set, no headers are included. If set to a string (perhaps 'X-' in a typical case), all headers starting this string are added. Empty string matches all headers. If there are multiple of the same header, only the latest occurrence in the REFER message is available in the hash. Obviously, the variable GET_TRANSFERRER_DATA must be inherited by the referrer channel, and should be set with the '_' or '__' prefix. I avoided a specific reference to SIP or REFER, as in my mind the mechanism can be generalized to other channel techs. ASTERISK-27162 Change-Id: I73d7a1e95981693bc59aa0d5093c074b555f708e 2017-08-06 11:15 +0000 [88c65f7cb6] Joshua Colp * bridge: Fix stream topology/participant locking and video misrouting. This change fixes a few locking issues and some video misrouting. 1. When accessing the stream topology of a channel the channel lock must be held to guarantee the topology remains valid. 2. When a channel was joined to a bridge the bridge specific implementation for stream mapping was not invoked, causing video to be misrouted for a brief period of time. ASTERISK-27182 Change-Id: I5d2f779248b84d41c5bb3896bf22ba324b336b03 2017-08-05 14:43 +0000 [16cfc3a954] Corey Farrell * channel: Fix leak on successful call to chan->tech->requester. joint_cap needs to be released unconditionally as chan->tech->requester does not steal the reference even on success. ASTERISK-27180 #close Change-Id: I647728992559bdb0a9c7357c20be1b36400d68b6 2017-08-04 16:47 +0000 [104a8047a5] Kevin Harwell * res_pjsip_session/_sdp_rtp: Handling of 'msid' is incorrect Currently, the handling of the msid attribute is not quite right. According to the spec the msid's between the offer/answer are not dependent upon one another. Meaning the same msid's given in an offer do not have to be returned in the answer for a given stream. And they probably shouldn't be (copied/reused) since this can potentially cause some browser side confusion. This patch generates new msids when both an offer and answer are sent from Asterisk. However, Asterisk does reuse the original msid it sent out for a reinvite. Also audio+video streams are paired together by sharing the same stream id, but a different track id. ASTERISK-27179 #close Change-Id: Ifaec06dc7e65ad841633a24ebec8c8a9302d6643 2017-08-03 20:58 +0000 [7f8f3ca4dd] Corey Farrell * Correct some leaks in unit tests. * chan_sip: channel in test_sip_rtpqos_1. * test_config: config hook, config info and global config holder. * test_core_format: format in format_attribute_set_without_interface. * test_stream: unneeded frame duplication. * test_taskprocessor: task_data. Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31 2017-07-26 17:49 +0000 [842e1414d0] Richard Mudgett * res_pjsip_transport_websocket.c: Fix serializer ref leak. Change-Id: Ib5a19bfd597f63d9021baeb645fc11153b3afa57 2017-08-02 18:41 +0000 [615b6a200a] Richard Mudgett * res_pjsip_outbound_registration.c: Misc fixes. * Remove unnecessary CMP_STOP. * In handle_client_registration() use DEBUG_ATLEAST() to only do work needed for the debug log message when the debug log message is needed. * In sip_outbound_registration_state_destroy() check state->registration for NULL. Change-Id: I656d0fa11dda0b00048103efb1558e67a426fd80 2017-07-31 20:20 +0000 [564927c5ed] Richard Mudgett * res_pjsip_nat.c: Remove unnecessary CMP_STOP. Change-Id: I6279b0d723bc3b75b8d65e81e02da9ea9bc0c3da 2017-07-31 14:20 +0000 [5655cded78] Richard Mudgett * res_pjsip_registrar.c: Remove unnecessary CMP_STOP. Most uses of CMP_STOP are superfluous and are only respected when OBJ_MULTIPLE is used to search the container. Change-Id: I20571a202ec0aa1098bb2749eeba18de7ca110b8 2017-08-03 13:13 +0000 [123c93a77c] Tzafrir Cohen * Support GMIME 3.0 Support building the Asterisk httpd with version 3.0 of gmime as well as earlier versions of that library. ASTERISK-27173 Change-Id: I7e13dd05a3083ccb0df2dabf83110223f6a9fa8f 2017-08-02 09:43 +0000 [521b6fed12] Kevin Harwell * alembic/res_pjsip: Add "webrtc" configuration option When the "webrtc" option was added in res_pjsip it was not added to the alembic scripts. This patch adds the option for alembic. Also, changed the sorcery configuration type to an OPT_YESNO_T value instead of an OPT_BOOL_T so if this field is ever written to a database it will write out the correct value. ASTERISK-27119 #close Change-Id: I3e199f060aea25e193c439fc5cf96be4d3ed1c7b 2017-07-30 01:17 +0000 [4c0798e91d] Kirill Katsnelson * chan_sip: Add dialplan function SIP_HEADERS Syntax: SIP_HEADERS([prefix]) If the argument is specified, only the headers matching the given prefix are returned. The function returns a comma-separated list of SIP header names from an incoming INVITE message. Multiple headers with the same name are included in the list only once. The returned list can be iterated over using the functions POP() and SIP_HEADER(). For example, '${SIP_HEADERS(Co)}' might return the string 'Contact,Content-Length,Content-Type'. Practical use is rather '${SIP_HEADERS(X-)}' to enumerate optional extended headers sent by a peer. ASTERISK-27163 Change-Id: I2076d3893d03a2f82429f393b5b46db6cf68a267 2017-08-02 14:16 +0000 [4b03eb5c38] Corey Farrell * Fix compile error for old versions of GCC. Use -Wno-format-truncation only if supported by compiler. ASTERISK-27171 #close Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6 2017-08-02 16:08 +0000 [148cf2e0f7] Corey Farrell * app_privacy: remove unused header asterisk/image.h Change-Id: I56ed530633a642633b18383821069e806c92ae82 2017-07-26 08:48 +0000 [2be8d91c0f] snuffy (license 5024) * res_pjsip_pidf_eyebeam_body_supplement: Correct status presentation This change fixes PIDF content generation when the underlying device state is considered in use. Previously it was incorrectly marked as closed meaning they were offline/unavailable. The code now correctly marks them as open. Additionally: * Generate an XML element for our activity instead of a using a text node. * Consider every extension state other than "unavailable" to be 'open' status. * Update the XML namespaces and structure to reflect those documented in RFC 4480 * Use 'on-the-phone' (defined in RFC 4880) instead of 'busy' as the "in use" activity. This change results in eyeBeam using the appropriate icon for the watched user. This was tested on eyeBeam 1.5.20.2 build 59030 on Windows. ASTERISK-26659 #close Reported by: Abraham Liebsch patches: ASTERISK-26659.diff submitted by snuffy (license 5024) Change-Id: I6e5ad450f91106029fb30517b8c0ea0c2058c810 2017-07-23 18:34 +0000 [2a4283f3e7] Joshua Colp * res_pjsip: Add support for dnsmgr to external_media_address. The "external_media_address" option on transports is now resolved using dnsmgr. This allows it to be automatically refreshed regularly if refreshes are enabled in dnsmgr. If the system is using a dynamic IP address a dynamic DNS hostname can be provided to keep the IP address up to date. Change-Id: Ia54771720dff0105bde55d5bbb81a3ba437e05b2 2017-07-27 20:58 +0000 [58d032112b] Corey Farrell * Fix compiler warnings on Fedora 26 / GCC 7. GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88 2017-07-26 09:27 +0000 [3f98488279] Sean Bright * app_queue: Add announce-position-only-up option Setting this option will cause the Queue application to only announce the caller's position if it has improved since the last time that we announced it. Change-Id: I173a124121422209485b043e2bf784f54242fce6 2017-07-27 06:35 +0000 [ac6d98b28d] Ian Gilmour (license 6889) * bundled_pjproject: Improve SSL/TLS error handling OpenSSL has 2 levels or error processing. It's possible for the top layer to return SSL_ERROR_SYSCALL but the lower layer return no error, in which case processing should continue. Only the top layer was being examined though so connections were being torn down when they didn't need to be. This patch adds the examination of the lower level codes, and if they return no errors, allows processing to continue. ASTERISK-27001 Reported-by: Ian Gilmour patches: pjproject-2.6.patch submitted by Ian Gilmour (license 6889) Updated-by: George Joseph and Sauw Ming (Teluu) Merged to upstream pjproject on 7/27/2017 (commit 5631) Change-Id: I23844ca0c68ef1ee550f14d46f6dae57d33b7bd2 2017-06-26 07:52 +0000 [65c560894d] Torrey Searle * chan_pjsip: add a new function PJSIP_DTMF_MODE This function is a replica of SIPDtmfMode, allowing the DTMF mode of a PJSIP call to be modified on a per-call basis ASTERISK-27085 #close Change-Id: I20eef5da3e5d1d3e58b304416bc79683f87e7612 2017-07-25 15:17 +0000 [b3914df10b] Sean Bright * res_rtp_asterisk: Fix mapping of pjsip's ICE roles to ours Change-Id: Ia578ede1a55b21014581793992a429441903278b 2017-07-20 08:08 +0000 [4f4936fd72] Sergej Kasumovic * res_stasis_device_state: Unsubscribe should remove old subscriptions Case scenario with Applications ARI: * Once you subscribe to deviceState with Applications REST API, it will be added into subscription pool. * When you unsubscribe it will remove from the device_state_subscription hash table but not from the subscription pool. * When you subscribe again, it will add it to pool again. * Now you will have two subscriptions and you will receive same event twice. This fix should now remove deviceState subscription from pool and it should fix unsubscribe on deviceState. ASTERISK-27130 #close Change-Id: I718b70d770a086e39b4ddba4f69a3c616d4476c4 2017-07-24 13:30 +0000 [a6eb9ee7d2] Joshua Colp * core: Add VP9 passthrough support. This change adds VP9 as a known codec and creates a cached "vp9" media format for use. Change-Id: I025a93ed05cf96153d66f36db1839109cc24c5cc 2017-07-19 18:11 +0000 [922930753c] Richard Mudgett * app_voicemail.c: Allow mailbox entry on authentication retry prompt. The following testsuite voicemail tests were failing to re-enter the mailbox after the first login attempt. tests/apps/voicemail/authenticate_invalid_mailbox tests/apps/voicemail/authenticate_invalid_password The tests were noting the start of the vm-incorrect-mailbox prompt and immediately sending the mailbox for the next login attempt. Since the invalid message playback had to complete before the digits were recognized, the test passed for the wrong reason and added approximately 20 seconds to the test times. * Allow the vm-incorrect-mailbox prompt to get interrupted by the mailbox digits like the initial vm-login prompt so the tests are able to enter the intended mailbox. Change-Id: I1dc53fe917bfe03a4587b2c4cd24c94696a69df8 2017-07-21 15:57 +0000 [2697e45157] Matthew Fredrickson * format.h: Fix a few minor errors in comments. A few minor problems were found in comments in format.h. This patch fixes them. Change-Id: I07f0bdb47b93359b361c4c3d8ecc87cd3199dd94 2017-07-14 13:47 +0000 [19b080b547] Rusty Newton * say.c: Fix file locations for second, seconds, minute, minutes files The seconds and minutes files have always existed in the base language directory of the Core package. So say.c has always been calling the wrong location (under digits/) for those two files and in the case of second and minute they didn't exist in the Core packages at all. The 1.6 sounds release moves the second and minute files into Core from Extra for the languages that already had them. A future release will include the second and minute files for languages that didn't already have them. This patch just changes all the target locations for second, seconds, minute, and minutes that were under the digits subdir to be under the root of sounds instead. Which is where the sounds will be for some languages after 1.6 sounds and for all languages after a future release. ASTERISK-25810 #close Change-Id: I05d9d4bee6a7237030530a46e7eb3df15f13f702 Reported-by: Nicolas Riendeau 2017-07-21 14:20 +0000 [a2f6028a51] Rusty Newton * Sounds: Update Makefile for Extra sounds 1.5.1 release Incrementing version for the Extra sounds release. 1.5.1 Extra sounds removes two prompts that were moved into the Core packages in the 1.6 Core sounds release. ASTERISK-27142 #close Change-Id: I82f017812b0ea9599e19dd4635afd55611f13ee7 2017-07-21 11:17 +0000 [063c9a935f] George Joseph * Update make_ari_stubs in master to make the version 16 Ready for next major version Change-Id: If9dc99b3b78768529e69a297d8f87e23582ca6d0 2017-07-21 11:24 +0000 [ba52a36ff2] George Joseph * Restore the incorrectly deleted spandspflow2pcap.log Change-Id: Iafe78cf0fb1e7064223d4dea279eeb776c8fa8e5 2017-07-20 10:52 +0000 [3e8d628c0e] George Joseph * Update AMI and ARI versions for master/15 and update UPDATE.txt AMI goes from 3.2.0 to 4.0.0 ARI goes from 2.0.0 to 3.0.0 Copied UPGRADE.txt -> UPGRADE-15.txt Created new UPGRADE.txt Removed a log file that was accidentally checked in a while ago Change-Id: I1c794f910038459b13e16f9c3a12c44e56f142f7 2017-07-20 09:57 +0000 [25c9464325] Sean Bright * corosync: Fix corosync library name in configure.ac Also add new corosync packages to install_prereq. Reported by Travis Ryan in #asterisk-dev Change-Id: Ib861c95ba630fed62dc54e56784ad8446ed9d2db 2017-07-17 11:01 +0000 [680c491a62] Joshua Colp * bridge_softmix / res_rtp_asterisk: Fix packet loss and renegotiation issues. This change does a few things to improve packet loss and renegotiation: 1. On outgoing RTP streams we will now properly reflect out of order packets and packet loss in the sequence number. This allows the remote jitterbuffer to better reorder things. 2. Video updates can now be discarded for a period of time after one has been sent to prevent flooding of clients. 3. For declined and removed streams we will now release any media session resources associated with them. This was not previously done and caused an issue where old state was being used for a new stream. 4. RTP bundling was not actually removing bundled RTP instances from the parent. This has been resolved by removing based on the RTP instance itself and not the SSRC. 5. The code did not properly handle explicitly unbundling an RTP instance from its parent. This now works as expected. ASTERISK-27143 Change-Id: Ibd91362f0e4990b6129638e712bc8adf0899fd45 2017-07-18 15:04 +0000 [e7d9e42616] Benjamin Keith Ford * pjsip: Increase maximum packet size. The maximum packet size for PJSIP has been increased to handle the multiple streams being added for WebRTC. Change-Id: I9ea1e8d02668c544acadcb1c6200e1cc1bd588b3 2017-07-17 07:19 +0000 [bcd3f65174] Joshua Colp * bridge_softmix: Don't reorder streams on participant leaving. When a participant leaves a bridge while operating in SFU mode their respective stream on every other participant needs to be removed. Leaving the stream out of the new topology results in every stream after it being moved and reordered. This causes problems with clients. Instead simply mark the stream as removed which leaves it in place in the SDP and doesn't reorder or touch any other streams. ASTERISK-27136 Change-Id: I4b3f840adcdf69b83842b0d8a737665ba0ef9cb1 2017-07-16 12:31 +0000 [f48695ce5b] Joshua Colp * bridge_softmix: Use removed stream spots when renegotiating. Streams are never truly removed in SDP, they still occupy a location within the SDP. This location can be reused by another stream if it so chooses. This change takes advantage of this such that if a new stream is needing to be added for a new participant any removed streams are instead replaced first. This reduces the size of the SDP and the number of streams. ASTERISK-27134 Change-Id: I95cdcfd55cf47e02ea52abb5d94008db3fb68b1d 2017-07-16 12:18 +0000 [942ee54b53] Joshua Colp * res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use. This change makes it so that if an RTCP packet is being sent the RTP ICE component is used for sending if RTCP-MUX is in use. ASTERISK-27133 Change-Id: I6200f611ede709602ee9b89501720c29545ed68b 2017-07-14 01:25 +0000 [26f149ab0a] Sergej Kasumovic * app_confbridge: Make sure name recordings are always removed from the filesystem This commit fixes two possible scenarios: * When recording name and if during recording you hangup, file is never removed. This is due to the fact file location is nulled. * When recording name and if you hangup during thank-you prompt, file is never removed. ASTERISK-27123 #close Change-Id: I39b7271408b4b54ce880c5111a886aa8f28c2625 2017-07-14 01:11 +0000 [d3f5b265c7] Sergej Kasumovic * chan_iax2: On reload make sure to check for existing MWI subscription On every reload of chan_iax2 module, MWI subscription was added, which results in additional taskprocessors being accumulated over time. This commit fixes it by making sure we check for existing subscription first. This was verified with 'core show taskprocessors' CLI command. ASTERISK-27122 #close Change-Id: Ie2ef528fd5ca01b933eeb88188cc10967899cfb9 2017-07-10 18:17 +0000 [7da6ddda30] Kevin Harwell * res_pjsip: Add "webrtc" configuration option This patch creates a new configuration option called "webrtc". When enabled it defaults and enables the following options that are needed in order for webrtc to work in Asterisk: rtcp-mux, use_avpf, ice_support, and use_received_transport=enabled media_encryption=dtls dtls_verify=fingerprint dtls_setup=actpass When "webrtc" is enabled, this patch also parses the "msid" media level attribute from an SDP. It will also appropriately add it onto the outgoing session when applicable. Lastly, when "webrtc" is enabled h264 RTCP FIR feedback frames are now sent. ASTERISK-27119 #close Change-Id: I5ec02e07c5d5b9ad86a34fdf31bf2f9da9aac6fd 2017-07-13 15:43 +0000 [3fbb4a0a08] Rusty Newton * Sounds: Update for core sounds 1.6 release Added necessary lines to make the en_NZ language set selectable and to get core sounds 1.6 pulled down. ASTERISK-26807 #close ASTERISK-25816 #close ASTERISK-26274 #close Change-Id: I84e4dd4696568cc1ba318d12ac4b075461d6eed4 2017-07-10 14:04 +0000 [78a50b0343] Corey Farrell * core: Add PARSE_TIMELEN support to ast_parse_arg and ACO. This adds support for parsing timelen values from config files. This includes support for all flags which apply to PARSE_INT32. Support for this parser is added to ACO via the OPT_TIMELEN_T option type. Fixes an issue where extra characters provided to ast_app_parse_timelen were ignored, they now cause an error. Testing is included. ASTERISK-27117 #close Change-Id: I6b333feca7e3f83b4ef5bf2636fc0fd613742554 2017-06-30 13:55 +0000 [065c3005ad] Joshua Colp * res_rtp_asterisk / res_pjsip: Add support for BUNDLE. BUNDLE is a specification used in WebRTC to allow multiple streams to use the same underlying transport. This reduces the number of ICE and DTLS negotiations that has to occur to 1 normally. This change implements this by adding support for it to the RTP SDP module in PJSIP. BUNDLE can be turned on using the "bundle" option and on an offer we will offer to bundle streams together. On an answer we will accept any bundle groups provided. Once accepted each stream is bundled to another RTP instance for transport. For the res_rtp_asterisk changes the ability to bundle an RTP instance to another based on the SSRC received from the remote side has been added. For outgoing traffic if an RTP instance is bundled to another we will use the other RTP instance for any transport related things. For incoming traffic received from the transport instance we look up the correct instance based on the SSRC and use it for any non-transport related data. ASTERISK-27118 Change-Id: I96c0920b9f9aca7382256484765a239017973c11 2017-07-11 09:55 +0000 [8b535a406b] Torrey Searle * res/res_stasis_snoop: generate silence when audiohook returns null Currently when rtp is paused, no packets are written to the recorded audio file, causing the silence to be skipped and recording not properly time aligned. The read handler as been adapted to return a silence frame of the correct size. ASTERISK-27128 #close Change-Id: I2d7f60650457860b9c70907b14426756b058a844 2017-06-22 07:47 +0000 [d42a9cc9dc] Torrey Searle * res/res_pjsip_t38 ensure t38 requests get rejected quickly arm the t38 webhook always, so we can correctly reject a T38 negotiation request when t38 is disabled on a channel Change-Id: Ib1ffe35aee145d4e0fe61dd012580be11aae079d 2017-07-12 13:24 +0000 [6b138046e7] Corey Farrell * core: Add digit filtering to ast_waitfordigit_full This adds a parameter to ast_waitfordigit_full which can be used to only stop waiting when certain expected digits are received. Any unexpected DTMF digits are simply ignored. This also creates a new dialplan application WaitDigit. ASTERISK-27129 #close Change-Id: Id233935ea3d13e71c75a0861834c5936c3700ef9 2017-07-11 04:48 +0000 [b54eb167b4] Holger Hans Peter Freyther * app_playback.c: Use the timezonename parameter In say_date_generic the timezonename parameter is passed but never used. Fix it by passing it to the ast_localtime function. ASTERISK-27124 Change-Id: I63106b8db10426d417d7275f22554a616e92fae4 2017-07-12 15:07 +0000 [e83b9d141a] Sean Bright * basic-pbx: Remove res_pjsip_multihomed from sample config ASTERISK-27127 #close Reported by: HZMI8gkCvPpom0tM Change-Id: I2b0c54570d58156e37166ac536728af3b6c01789 2017-07-11 14:33 +0000 [7f09fd2c2f] Joshua Colp * bridge/core_unreal: Fix SFU bugs with forwarding frames. This change fixes a few things uncovered during SFU testing. 1. Unreal channels incorrectly forwarded video frames when no video stream was present on them. This caused a crash when they were read as the core requires a stream to exist for the underlying media type. The Unreal channel will now ensure a stream exists for the media type before forwarding the frame and if no stream exists then the frame is dropped. 2. Mapping of frames during bridging from the stream number of the underlying channel to the stream number of the bridge was done in the wrong location. This resulted in the frame getting dropped. This mapping now occurs on reading of the frame from the channel. 3. Bridging was using the wrong ast_read function resulting in it living in a non-multistream world. 4. In bridge_softmix when adding new streams to existing channels the wrong stream topology was copied resulting in no streams being added. Change-Id: Ib7445722c3219951d6740802a0feddf2908c18c8 2017-07-11 07:26 +0000 [b7a875778a] George Joseph * res_musiconhold: Add kill_escalation_delay, kill_method to class By default, when res_musiconhold reloads or unloads, it sends a HUP signal to custom applications (and all descendants), waits 100ms, then sends a TERM signal, waits 100ms, then finally sends a KILL signal. An application which is interacting with an external device and/or spawns children of its own may not be able to exit cleanly in the default times, expecially if sent a KILL signal, or if it's children are getting signals directly from res_musiconhoild. * To allow extra time, the 'kill_escalation_delay' class option can be used to set the number of milliseconds res_musiconhold waits before escalating kill signals, with the default being the current 100ms. * To control to whom the signals are sent, the "kill_method" class option can be set to "process_group" (the default, existing behavior), which sends signals to the application and its descendants directly, or "process" which sends signals only to the application itself. Change-Id: Iff70a1a9405685a9021a68416830c0db5158603b 2017-07-05 12:44 +0000 [5d86da61a6] Benjamin Keith Ford * manager: Remove AMI "Queues" action. When performing the "Queues" action via AMI, it outputs the same text that the Asterisk CLI outputs when running a "queue show" command, which does not conform with the AMI spec. "QueueStatus" already does what the "Queues" action should do, so instead of correcting the output, the "Queues" action will be removed and "QueueStatus" should be used instead. ASTERISK-27073 #close Reported by: Brian Change-Id: Id11743859758255b69cc3a557750d7a56c6d16f8 2017-07-03 07:30 +0000 [d58ef31acd] Tzafrir Cohen * Avoid setting maxfiles for a remote asterisk Setting maxfiles (maximum number of open files) has no practical effect on a remote asterisk (rasterisk, rasterisk -x). It has an ill effect of printing an extra message, which may be annoying in case of -x. ASTERISK-27105 #close Change-Id: Iaf9eb344e4b4b517df91b736b27ec55f6a6921a2 2017-07-05 15:31 +0000 [303f935a50] George Joseph * http.c: Reduce log spam Messages like "fwrite() failed: Connection reset by peer" are no help whatsoever, especially since they can be caused simply by a client disconnecting. * Make those WARNINGs DEBUGs. * Check the return from ast_iostream_printf of headers. Change-Id: I17bd5f3621514152a7b2b263c801324c5e96568b 2017-07-07 11:19 +0000 [8f72128e66] Benjamin Keith Ford * res_pjsip: Fix crash with from_user containing invalid characters. If the from_user field contains certain characters (like @, {, ^, etc.), PJSIP will return a null value for the URI when attempting to parse it. This causes a crash when trying to dial out through a trunk that contains these invalid characters in its from_user field. This change checks the configuration and ensures that an endpoint will not be created if the from_user contains an invalid character. It also adds a null check to the PJSIP URI parsing as a backup. ASTERISK-27036 #close Reported by: Maxim Vasilev Change-Id: I0396fdb5080604e0bdf1277464d5c8a85db913d0 2017-06-27 19:27 +0000 [03ae8b0105] Richard Mudgett * json.c: Add backtrace log to find 'Invalid UTF-8 string' errors Change-Id: I9020ff9f2b3749904317c0c173f47a1bbed6f929 2017-07-05 13:39 +0000 [9cd8a1df79] Michael Walton (modified) * res_rtp_asterisk.c: Fix TURN deadlock by using ICE session group lock. When a message is received on the TURN socket, the code processing the message needs to call into the ICE/STUN session for further processing. This code path locks the TURN group lock then the ICE/STUN group lock. In another thread an ICE/STUN timer can fire off to send a keep alive message over the TURN socket. In this code path, the ICE/STUN group lock is obtained then the TURN group lock is obtained to send the packet. A classic deadlock case if the group locks are not the same. * Made TURN get created using the ICE/STUN session's group lock. NOTE: I was originally concerned that the ICE/STUN session can get recreated by ice_reset_session() for an event like RTCP multiplexing causing a change during SDP negotiation. In this case the TURN group lock would become different. However, TURN is also recreated as part of the ICE/STUN recreation in ice_create() when all known ICE candidates are added to the new ICE session. While the ICE/STUN and TURN sessions are being recreated there is a period where the group locks could be different. ASTERISK-27023 #close Patches: res_rtp_asterisk-turn-deadlock-fix.patch (license #6502) patch uploaded by Michael Walton (modified) Change-Id: Ic870edb99ce4988a8c8eb6e678ca7f19da1432b9 2017-07-06 05:55 +0000 [7a4f577eb7] George Joseph * Fix alembic branches Change-Id: I04f607f084bda9b1b7f626e8e9735c37dc751187 2017-06-23 11:17 +0000 [1028f64be4] Richard Mudgett * bridge_native_rtp.c: Fix direct media video RTP instance ACL check. The video stream was using the audio stream RTP instance addresses to check if the video RTP gets directed to an allowed direct media Access Control List (ACL) address. There is no guarantee that the video RTP instance uses the same addresses as the audio RTP instance. This looks like it has been a bug since v11 when direct media ACL was first added to chan_sip and then faithfully reproduced through a couple code refactorings into the new bridging architecture. Change-Id: I8ddd56320e0eea769f3ceed3fa5b6bdfb51d681a 2017-07-05 10:29 +0000 [325eeced6a] Sean Bright * core: Remove 'Data Retrieval API' This API was not actively maintained, was not added to new modules (such as res_pjsip), and there exist better alternatives to acquire the same information, such as the ARI. Change-Id: I4b2185a83aeb74798b4ad43ff8f89f971096aa83 2017-06-19 11:22 +0000 [d556c67f9f] Rodrigo Ramírez Norambuena * app_queue: Add change priority of call This patch include a feature to change the priority a caller in a queue by CLI and AMI. Change-Id: I55d520d71cc1cefe9a9b81fefaefc14679e96133 2017-07-03 10:59 +0000 [910c05455d] Alexander Traud * chan_sip: Only when different, add TCP|TLS in autodomain (SIP Domain Support). When sip.conf contained tcpenable=yes and autodomain=yes, the TCP domain was added in any case, because of a local Boolean-negation error of the return value of ast_sockaddr_cmp. After fixing this error for TCP and TLS, the TLS domain was still always added with tlsenable=yes, because the domains were not compared just on the address but also on the port – and TLS is always on a different port than UDP/TCP. ASTERISK-27106 Change-Id: I14fe9e319e238320b094016980445ef3a5b3337c 2017-07-03 10:38 +0000 [4398aa8fa4] Alexander Traud * chan_sip: Fix a typo for tlsbindaddr in autodomain (SIP Domain Support). Because of a copy-and-paste error when the struct ast_sockaddr changed, tlsbindaddr was not added, when sip.conf contained autodomain=yes; see "show sip domains" on the command-line interface (CLI) of Asterisk. ASTERISK-27106 Change-Id: I3d0957150017c223136968ef1266f275d0d6695e 2017-06-29 13:58 +0000 [950b39a4f5] Sean Bright * app_voicemail: Cleanup ODBC connection handling The primary focus of this patch is adding a missing call to ast_odbc_release_obj(), but is also a general cleanup of the ODBC related code in app_voicemail. ASTERISK-27093 #close Change-Id: I8e285142eaeb3146b4287a928276b70db76c902b 2017-06-30 23:57 +0000 [50ddb56dad] Corey Farrell * channel: Clear channel flag in error branch. Clear channel flag AST_FLAG_END_DTMF_ONLY in ast_waitfordigit_full when ast_read returns NULL. ASTERISK-27100 #close Change-Id: Id3039e9a4e74e0cb359f636c9fd0c9740ebf7d9d 2017-06-29 18:27 +0000 [b485f6c59c] Richard Mudgett * pjsip_distributor.c: Fix deadlock with TCP type transports. When a SIP message comes in on a transport, pjproject obtains the lock on the transport and pulls the data out of the socket. Unlike UDP, the TCP transport does not allow concurrent access. Without concurrency the transport lock is not released when the transport's message complete callback is called. The processing continues and eventually Asterisk starts processing the SIP message. The first thing Asterisk tries to do is determine the associated dialog of the message to determine the associated serializer. To get the associated serializer safely requires us to get the dialog lock. To send a request or response message for a dialog, pjproject obtains the dialog lock and then obtains the transport lock. Deadlock can result because of the opposite order the locks are obtained. * Fix the deadlock by obtaining the serializer associated with the dialog another way that doesn't involve obtaining the dialog lock. In this case, we use an ao2 container to hold the associated endpoint and serializer. The new locks are held a brief time and won't overlap other existing lock times. ASTERISK-27090 #close Change-Id: I9ed63f4da9649e9db6ed4be29c360968917a89bd 2017-06-29 18:22 +0000 [65a5ac0168] Richard Mudgett * pjsip_distributor.c: Fix unidentified_requests hash functions. The OBJ_SEARCH_xxx defines should not be used as if they were individual bits. They represent a multi-bit enumeration value field. Change-Id: I32abc9a475396dab02402a7014357dd94284e17b 2017-06-29 15:06 +0000 [e7d41050e0] Kevin Harwell * app_stream_echo: misc bug fixes Fixed the following bugs: * calls to stream_echo_write had the last two parameters swapped * ast_read should have been ast_read_stream * added a null check on the frame's subclass format This also resets the update_sent flag upon receiving SRRCHANGE control frame. This will then force a video update. ASTERISK-26997 Change-Id: I6ad7c8253559b800800433c52339e7f5aa583566 2017-06-29 14:56 +0000 [7df7b8a90c] Kevin Harwell * res_rtp_asterisk: trigger source change control frame when dtls is established There needed to be a way to notify handlers upstream that DTLS had been established. This patch makes it so once DTLS has been estalished a source change control frame is put into the read queue. Any handlers can then watch for that frame and trigger off of it. ASTERISK-27096 #close Change-Id: I27ff344f5a8c691a1890dfe3254a4b1a49e7f4a0 2017-06-30 08:31 +0000 [f573e599c0] George Joseph * pjproject_bundled: Allow passing configure options to bundled There wasn't any good way to pass options like --host or --build down to the pjproject configure which makes cross-compiling difficult. * Added a new PJPROJECT_CONFIGURE_OPTS environment variable which can be used to pass arbitrary options to pjproject configure. * Automatically set the pjproject configure --host and --build options to match those supplied for the asterisk configure. ASTERISK-27097 #close Reported-by: Kinsey Moore Change-Id: I5fa776e110262851173002a26ffe1172e4c35b2e 2017-06-29 14:50 +0000 [c0c99c7618] George Joseph * chan_pjsip: Fix ability to send UPDATE on COLP When connected_line_method is "invite", we're supposed to determine if the client can support UPDATE and if it can, send UPDATE instead of INVITE to avoid the SDP renegotiation. Not only was pjproject not setting the PJSIP_INV_SUPPORT_UPDATE flag, we were testing that invite_tsx wasn't NULL which isn't always the case. * Updated chan_pjsip/update_connected_line_information to drop the requirement that invite_tsx isn't NULL. * Submitted patch to pjproject sip_inv.c that sets the PJSIP_INV_SUPPORT_UPDATE flag correctly. * Updated pjsip.conf.sample to clarify what happens when "invite" is specified. ASTERISK-27095 Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560 2017-06-15 03:12 +0000 [fb7247c57c] Torrey Searle * res_pjsip: Add DTMF INFO Failback mode The existing auto dtmf mode reverts to inband if 4733 fails to be negotiated. This patch adds a new mode auto_info which will switch to INFO instead of inband if 4733 is not available. ASTERISK-27066 #close Change-Id: Id185b11e84afd9191a2f269e8443019047765e91 2017-06-29 03:47 +0000 [ab7d99e62d] Niklas Larsson * app_queue: Add priority to AMI QueueStatus Add priority to callers in AMI QueueStatus response ASTERISK-27092 #close Change-Id: I8d1f737a72c7c38f4cfe1a4ee3ecc0a4f85bd199 2017-05-30 09:12 +0000 [45df25a579] Mark Michelson * chan_pjsip: Add support for multiple streams of the same type. The stream topology (list of streams and order) is now stored with the configured PJSIP endpoints and used during the negotiation process. Media negotiation state information has been changed to be stored in a separate object. Two of these objects exist at any one time on a session. The active media state information is what was previously negotiated and the pending media state information is what the media state will become if negotiation succeeds. Streams and other state information is stored in this object using the index (or position) of each individual stream for easy lookup. The ability for a media type handler to specify a callback for writing has been added as well as the ability to add file descriptors with a callback which is invoked when data is available to be read on them. This allows media logic to live outside of the chan_pjsip module. Direct media has been changed so that only the first audio and video stream are directly connected. In the future once the RTP engine glue API has been updated to know about streams each individual stream can be directly connected as appropriate. Media negotiation itself will currently answer all the provided streams on an offer within configured limits and on an offer will use the topology created as a result of the disallow/allow codec lines. If a stream has been removed or declined we will now mark it as such within the resulting SDP. Applications can now also request that the stream topology change. If we are told to do so we will limit any provided formats to the ones configured on the endpoint and send a re-invite with the new topology. Two new configuration options have also been added to PJSIP endpoints: max_audio_streams: determines the maximum number of audio streams to offer/accept from an endpoint. Defaults to 1. max_video_streams: determines the maximum number of video streams to offer/accept from an endpoint. Defaults to 1. ASTERISK-27076 Change-Id: I8afd8dd2eb538806a39b887af0abd046266e14c7 2017-06-28 09:03 +0000 [642f8356ab] Joshua Colp * res_rtp_asterisk: Fix issues with ICE renegotiation. When re-inviting to add more streams it is possible for the role of existing ICE sessions to be changed to the incorrect value. This results in subsequent refreshes within the sessions getting a role conflict and the ICE session breaking down. This change only sets the role to be the new value if an ICE renegotiation is actually going to happen, otherwise the existing role is preserved. As well if we encounter a situation where a unidirectional ICE negotiation happens and the other side does not send us candidates we will not store any information for sending traffic, even though we know where they are reachable. This change fixes this by using the source of the ICE traffic itself as the target if no candidates are known and we receive some ICE traffic. ASTERISK-27088 Change-Id: I71228181e358917fcefc3100fad21b2fc02a59a9 2017-06-27 10:46 +0000 [a48d3e4d31] Torrey Searle * res/res_pjsip_t38: fix incorrect increment of media_count The T38 sdp callback incorrectly has a side effect of incrementing the media_count. This can lead to core dumps. Change-Id: I7bb2f4987de4046ec52cfc34e5ea0662dae32af8 2017-06-08 22:50 +0000 [80e11bd79b] George Joseph * bridge_native_rtp: Keep rtp instance refs on bridge_channel There have been reports of deadlocks caused by an attempt to send a frame to a channel's rtp instance after the channel has left the native bridge and been destroyed. This patch effectively causes the bridge channel to keep a reference to the glue and both the audio and video rtp instances so what gets started will get stopped. ASTERISK-26978 #close Reported-by: Ross Beer Change-Id: I9e1ac49fa4af68d64826ccccd152593cf8cdb21a 2017-06-27 04:37 +0000 [7827755570] Ivan Poddubny * app_queue: Fix returning to dialplan when a queue is empty The fix for ASTERISK-25665 introduced a regression. The return value of queue_exec used to be 0 in case of leavewhenempty but it was changed to -1 (returned from wait_our_turn and passed transparently by queue_exec), thus leading to hangup instead of returning back to dialplan. This commit resets the value back to 0 in this case, restoring original behavior. ASTERISK-27065 #close Reported by: Marek Cervenka Change-Id: Id9c83b75aeda463250155e88c5004be52bbca5ac 2017-06-19 17:21 +0000 [0cef7b9d4e] Alexei Gradinari * app_voicemail: IMAP connection control A new global option "imap_poll_logout" was added to specify whether need to disconnect from the IMAP server after polling of mailboxes. ASTERISK-27068 #close Closing IMAP connection after loading mailbox from voicemail.conf ASTERISK-24052 #close Change-Id: Ib7558ba04516240a32b65f42e9be64372a0ae12a 2017-06-21 17:57 +0000 [975e271b01] Richard Mudgett * res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3 2017-06-16 18:08 +0000 [34db4c3993] Alexei Gradinari * res_pjsip_mwi: update unsolicited MWI subscriptions on updating contact Do not need to unsubscribe/subscribe on creating the ednpoint's contact. The modified function create_mwi_subscriptions_for_endpoint adds the subscription only if it does not exist. The subscriptions aren't added for active contacts which are retrieved on startup from realtime if mwi_disable_initial_unsolicited=yes. Because the mwi_contact_added is not called. So the subscriptions also should be created on updating contact. ASTERISK-26230 #close Change-Id: I47e265af9296ca09aa42a316fdacac104148cee4 2017-06-20 16:05 +0000 [27dae55fb6] Kevin Harwell * core_local: local channel data not being properly unref'ed and unlocked In an earlier version of Asterisk a local channel [un]lock all functions were added in order to keep a crash from occurring when a channel hung up too early during an attended transfer. Unfortunately, when a transfer failure occurs and depending on the timing, the local channels sometime do not get properly unlocked and deref'ed after being locked and ref'ed. This happens because the underlying local channel structure gets NULLed out before unlocking. This patch reworks those [un]lock functions and makes sure the values that get locked and ref'ed later get unlocked and deref'ed. ASTERISK-27074 #close Change-Id: Ice96653e29bd9d6674ed5f95feb6b448ab148b09 2017-06-20 16:01 +0000 [45a1f4e2ae] Kevin Harwell * bridge: stuck channel(s) after failed attended transfer If an attended transfer failed it was possible for some of the channels involved to get "stuck" because Asterisk was not hanging up the transfer target. This patch ensures Asterisk hangs up the transfer target when an attended transfer failure occurs. ASTERISK-27075 #close Change-Id: I98a6ecd92d3461ab98c36f0d9451d23adaf3e5f9 2017-05-19 23:28 +0000 [d2fbbdd692] Richard Mudgett * SDP: Create declined m= SDP lines using remote SDP if applicable. * Update SDP unit tests to test negotiating with declined streams. Generation of declined m= lines created and responded tested. Change-Id: I5cb99f5010994ab0c7d9cf2d395eca23fab37b98 2017-05-02 18:51 +0000 [3a18a09030] Richard Mudgett * SDP: Rework SDP offer/answer model and update capabilities merges. The SDP offer/answer model requires an answer to an offer before a new SDP can be processed. This allows our local SDP creation to be deferred until we know that we need to create an offer or an answer SDP. Once the local SDP is created it won't change until the SDP negotiation is restarted. An offer SDP in an initial SIP INVITE can receive more than one answer SDP. In this case, we need to merge each answer SDP with our original offer capabilities to get the currently negotiated capabilities. To satisfy this requirement means that we cannot update our proposed capabilities until the negotiations are restarted. Local topology updates from ast_sdp_state_update_local_topology() are merged together until the next offer SDP is created. These accumulated updates are then merged with the current negotiated capabilities to create the new proposed capabilities that the offer SDP is built. Local topology updates are merged in several passes to attempt to be smart about how streams from the system are matched with the previously negotiated stream slots. To allow for T.38 support when merging, type matching considers audio and image types to be equivalent. First streams are matched by stream name and type. Then streams are matched by stream type only. Any remaining unmatched existing streams are declined. Any new active streams are either backfilled into pre-merge declined slots or appended onto the end of the merged topology. Any excess new streams above the maximum supported number of streams are simply discarded. Remote topology negotiation merges depend if the topology is an offer or answer. An offer remote topology negotiation dictates the stream slot ordering and new streams can be added. A remote offer can do anything to the previously negotiated streams except reduce the number of stream slots. An answer remote topology negotiation is limited to what our offer requested. The answer can only decline streams, pick codecs from the offered list, or indicate the remote's stream hold state. I had originally kept the RTP instance if the remote offer SDP changed a stream type between audio and video since they both use RTP. However, I later removed this support in favor of simply creating a new RTP instance since the stream's purpose has to be changing anyway. Any RTP packets from the old stream type might cause mischief for the bridged peer. * Added ast_sdp_state_restart_negotiations() to restart the SDP offer/answer negotiations. We will thus know to create a new local SDP when it is time to create an offer or answer. * Removed ast_sdp_state_reset(). Save the current topology before starting T.38. To recover from T.38 simply update the local topology to the saved topology and restart the SDP negotiations to get the offer SDP renegotiating the previous configuration. * Allow initial topology for ast_sdp_state_alloc() to be NULL so an initial remote offer SDP can dictate the streams we start with. We can always update the local topology later if it turns out we need to offer SDP first because the remote chose to defer sending us a SDP. * Made the ast_sdp_state_alloc() initial topology limit to max_streams, limit to configured codecs, handle declined streams, and discard unsupported types. * Convert struct ast_sdp to ao2 object. Needed to easily save off a remote SDP to refer to later for various reasons such as generating declined m= lines in the local SDP. * Improve converting remote SDP streams to a topology including stream state. A stream state of AST_STREAM_STATE_REMOVED indicates the stream is declined/dead. * Improve merging streams to take into account the stream state. * Added query for remote hold state. * Added maximum streams allowed SDP config option. * Added ability to create new streams as needed. New streams are created with configured default audio, video, or image codecs depending on stream type. * Added global locally_held state along with a per stream local hold state. Historically, Asterisk only has a global locally held state because when the we put the remote on hold we do it for all active streams. * Added queries for a rejected offer and current SDP negotiation role. The rejected query allows the using module to know how to respond to a failed remote SDP set. Should the using module respond with a 488 Not Acceptable Here or 500 Internal Error to the offer SDP? * Moved sdp_state_capabilities.connection_address to ast_sdp_state. There seems no reason to keep it in the sdp_state_capabilities struct since it was only used by the ast_sdp_state.proposed_capabilities instance. * Callbacks are now available to allow the using module some customization of negotiated streams and to complete setting up streams for use. See the typedef doxygen for each callback for what is allowable and when they are called. * Added topology answerer modify callback. * Added topology pre and post apply callbacks. * Added topology offerer modify callback. * Added topology offerer configure callback. * Had to rework the unit tests because I changed how SDP topologies are merged. Replaced several unit tests with new negotiation tests. Change-Id: If07fe6d79fbdce33968a9401d41d908385043a06 2017-06-18 19:24 +0000 [70d2ccb9da] Corey Farrell * Core: Add support for systemd socket activation. This change adds support for socket activation of certain SOCK_STREAM listeners in Asterisk: * AMI / AMI over TLS * CLI * HTTP / HTTPS Example systemd units are provided. This support extends to any socket which is initialized using ast_tcptls_server_start, so any unknown modules using this function will support socket activation. Asterisk continues to function as normal if socket activation is not enabled or if systemd development headers are not available during build. ASTERISK-27063 #close Change-Id: Id814ee6a892f4b80d018365c8ad8d89063474f4d 2017-06-19 11:28 +0000 [a7488f8a70] Rodrigo Ramírez Norambuena * cdr: fix mistake spelling of a word for Unanswered. Change-Id: I7a610bef369924523a445c7e849ee88cc45dc5df 2017-06-12 16:17 +0000 [d7b6e06abb] Alexei Gradinari * res_pjsip_mwi: unsubscribe unsolicited MWI on deleting endpoint last contact If the endpoint's last contact is deleted unsolicited MWI has to be unsubscribed. ASTERISK-27051 #close Change-Id: I33e174e0b9dba0998927d16d6d100fda5c7254e0 2017-06-16 09:31 +0000 [854a6de819] George Joseph * res_stasis: Plug reference leak on stolen channels When a stasis channel is stolen by another app, the control structure is unreffed but never unlinked from the app_controls container. This causes the channel reference to leak. Added OBJ_UNLINK to the callback in channel_stolen_cb. Also added some additional channel lifecycle debug messages to channel.c. ASTERISK-27059 #close Repoorted-by: George Joseph Change-Id: Ib820936cd49453f20156971785e7f4f182c56e14 2017-06-16 14:56 +0000 [e33bd96638] Matthew Fredrickson * formats/format_g729: Fix typo in comment There was a typo in a comment. This commit is to fix the typo. ASTERISK-27060 #close Change-Id: Ic2699f8dbeaacd58ccb6ec3203e853e1babe3235 2017-06-08 12:28 +0000 [0ad95bc8a0] Frederic LE FOLL * Core/PBX: Deadlock between dialplan execution and application unregistration. Not easy to reproduce, but we have noticed deadlocks when unloading a module while dialplan is handling a request. The deadlock is between : 1) Dialplan execution: pbx_extension_helper() first taking conlock, then pbx_findapp() [when called] asking for lock on apps list. 2) Application unregistration: ast_unregister_application() first taking lock on apps list, then unreference_cached_app() [when called] asking for conlock. As a protection, I suggest to modify ast_unregister_application(), so that it anticipates the need of conlock, before taking the lock on apps list. The side effect is a longer unavailability of conlock when unregistering an application. ASTERISK-27041 Change-Id: I0db0f1eb320da6a5758cce3a47d765be1face8e2 2017-06-12 09:23 +0000 [7a46309d3d] Alexei Gradinari * res_pjsip: New endpoint option "notify_early_inuse_ringing" This option was added to control whether to notify dialog-info state 'early' or 'confirmed' on Ringing when already INUSE. The value "yes" is useful for some SIP phones (Cisco SPA) to be able to indicate and pick up ringing devices. ASTERISK-26919 #close Change-Id: Ie050bc30023543c7dfb4365c5be3ce58c738c711 2017-06-15 13:48 +0000 [53b7df82f4] Alexei Gradinari * app_voicemail: IMAP logout on reload/unload Closing IMAP connection on module reload or unload. ASTERISK-24052 #close Change-Id: I2a40182aa9ef249fa6865d33570430e9ada68525 2017-03-30 09:33 +0000 [9aeab4aced] Jan Friesse * res_corosync: Change thread stack size In Corosync 2.x libraries were changed to use LibQB IPC. Sadly LibQB IPC doesn't support copy-free access to received buffer, so Corosync libraries were rewritten to use stack as buffer. Mostly the needed stack size is quite small, but for all *_dispatch functions, 1MiB is needed. Asterisk function ast_pthread_create_background set stack size for new thread to much smaller AST_BACKGROUND_STACKSIZE (~500KiB). This results in Asterisk crash when running with Corosync 2.x. Patch solves this issue by creating it's own version of ast_pthread_create_background which sets stack size to much higher value (actually it's AST_BACKGROUND_STACKSIZE + 3MiB). Another problem may appear when "corosync show members" netconsole command is executed. It is also executed in thread and also has only 500KiB stack size. Sadly it calls corosync_cfg_get_node_addrs which again needs at least 1MiB stack. Solution is to use HAVE_COROSYNC_CFG_STATE_TRACK as a discriminator between Corosync 1.x and 2.x. If 1.x is found, nothing changes. If 2.x is found, NodeID is displayed instead of IP address. ASTERISK-25370 #close Reported by: mdu113 Change-Id: Id95b0d21ab6e708e7d74ad8786c587211676fa08 2017-06-13 11:33 +0000 [1ac0096512] George Joseph * res_ari: Add "module loaded" check to ari stubs The recent change to make the use of LOAD_DECLINE more consistent caused res_ari to unload itself before declining if the ari.conf file wasn't found. The ari stubs though still tried to use the configuration resulting in segfaults. This patch creates a new CHECK_ARI_MODULE_LOADED macro which tests to see if res_ari is actually loaded and causes the stubs to also decline if it isn't. The macro was then added to the mustache template's "load_module" function. ASTERISK-27026 #close Reported-by: Ronald Raikes Change-Id: I263d56efa628ee3c411bdcd16d49af6260c6c91d 2017-06-15 12:33 +0000 [11ec2945c7] Richard Mudgett * chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read. The construction of the returned string assumed incorrectly that the supplied buffer would always be initialized as an empty string. If it is not an empty string we could overrun the supplied buffer by the length of the non-empty buffer string plus one. It is also theoreticaly possible for the supplied buffer to be overrun by a string terminator during a read operation even if the supplied buffer is an empty string. * Fix the assumption that the supplied buffer would already be an empty string. The buffer is not guaranteed to contain an empty string by all possible callers. * Fix string terminator buffer overrun potential. Change-Id: If6a0806806527678c8554b1dcb34fd7808aa95c9 2017-06-08 11:38 +0000 [e563a1920e] Richard Mudgett * SDP: Add get/set option calls for RTP sched context per type. Change-Id: I82dc75c63c48904e9e5a49e2205dcc06e88487e4 2017-05-11 18:49 +0000 [716abaf33d] Richard Mudgett * SDP: Search for the ice-lite attribute in the right place. * Pulled finding the rtcp-mux attribute flag out of the ICE candidate for loop. Also ordered the RTCP ICE candidate skip test to fail earlier. Change-Id: I8905d9c68563027a46cd3ae14dbcc27e9c814809 2017-05-11 18:46 +0000 [a95584d079] Richard Mudgett * SDP: Set the remote c= line in RTP instance. Change-Id: I23b646392082deab65bedeb19b12dcbcb9216d0c 2017-06-09 19:03 +0000 [06265b8c8a] Richard Mudgett * stream: Add ast_stream_topology_del_stream() and unit test. Change-Id: If07e3c716a2e3ff85ae905c17572ea6ec3cdc1f9 2017-05-11 14:09 +0000 [0fdb99c268] Richard Mudgett * SDP: Add t= line in sdp_create_from_state() Change-Id: I4060391328a893101ed87d0d9bacbbab4fd8b141 2017-06-14 13:07 +0000 [4797a8bb81] Richard Mudgett * stream: Ignore declined streams for some topology calls. * Made ast_format_cap_from_stream_topology() not include any formats from declined streams. * Made ast_stream_topology_get_first_stream_by_type() ignore declined streams to return the first active stream of the type. * Updated unit tests to check these changes have the expected effect. Change-Id: Iabbc6a3e8edf263a25fd3056c3c614407c7897df 2017-06-15 07:32 +0000 [bd16c3c524] Joshua Colp * channel: Fix reference counting in ast_channel_suppress. The ast_channel_suppress function wrongly decremented the reference count of the underlying structure used to keep track of what should be suppressed on a channel if the function was called multiple times on the same channel. This change cleans up the reference counting a bit so this no longer occurs. ASTERISK-27016 Change-Id: I2eed4077cb4916e6626f9f120b63b963acc5c136 2017-06-14 12:34 +0000 [b8b0b61a24] Richard Mudgett * app_voicemail.c: Fix compile error when IMAP enabled. Change-Id: I2703f15b4099b4210c68eccf293105d1975c1fc1 2017-06-12 17:55 +0000 [023eede265] Alexei Gradinari * app_voicemail: IMAP logout on MWI unsubscribe Closing IMAP connection on MWI unsubscribe. ASTERISK-24052 #close Change-Id: I4ff964026002b2817b48c20fb4239f0a880228fd 2017-06-14 11:12 +0000 [65ed2ea311] George Joseph * res_pjsip_pubsub: Fix reference to released endpoint destroy_subscription was attempting to get the id of the subscription tree's endpoint after we'd already called ao2_cleanup on it causing a segfault. Moved the cleanup until after the debug statement and since endpoint could also be NULL at this point, check for that as well. ASTERISK-27057 #close Reported-by: Ryan Smith Change-Id: Ice0a7727f560cf204d870a774c6df71e159b1678 2017-06-14 08:29 +0000 [ea3f8c6889] Florian Floimair (license 6892) * res_pjsip_session: Correct inverted test in session_outgoing_nat_hook There was a typo introduced in commit 776ffd77 which was preventing the transport's external media address from being used. ASTERISK-27024 #close Reported-by: Christopher van de Sande patches: patch.diff submitted by Florian Floimair (license 6892) Change-Id: I7ec617171eaa2d86d2680b00cf37d5088adafc27 2017-06-14 08:54 +0000 [88f18faf2a] George Joseph * res_rtp_asterisk: Fix ssrc change for rtcp srtp It looks like there was a copy/paste error in ast_rtp_change_source where if there was a rtcp srtp instance, instead of updating its ssrc we were updating the srtp instance ssrc twice. ASTERISK-27022 #close Reported-by: Michael Walton Change-Id: Ic88f3aee7227b401c58745ac265ff92c19620095 2017-06-08 14:38 +0000 [d6386a8f0c] Joshua Colp * bridge: Add a deferred queue. This change adds a deferred queue to bridging. If a bridge technology determines that a frame can not be written and should be deferred it can indicate back to bridging to do so. Bridging will then requeue any deferred frames upon a new channel joining the bridge. This change has been leveraged for T.38 request negotiate control frames. Without the deferred queue there is a race condition between the bridge receiving the T.38 request negotiate and the second channel joining and being in the bridge. If the channel is not yet in the bridge then the T.38 negotiation fails. A unit test has also been added that confirms that a T.38 request negotiate control frame is deferred when no other channel is in the bridge and that it is requeued when a new channel joins the bridge. ASTERISK-26923 Change-Id: Ie05b08523f399eae579130f4a5f562a344d2e415 2017-06-13 14:17 +0000 [9e53c30610] Kevin Harwell * res_pjsip_refer/session: Calls dropped during transfer When doing an attended transfer it's possible for the transferer, after receiving an accepted response from Asterisk, to send a BYE to Asterisk, which can then be processed before Asterisk has time to start and/or complete the transfer process. This of course causes the transfer to not complete successfully, thus dropping the call. This patch makes it so any BYEs received from the transferer, after the REFER, that initiate a session end are deferred until the transfer is complete. This allows the channel that would have otherwise been hung up by Asterisk to remain available throughout the transfer process. ASTERISK-27053 #close Change-Id: I43586db79079457d92d71f1fd993be9a3b409d5a 2017-06-13 10:47 +0000 [b2fd7e5069] George Joseph * pjproject_bundled: Use the asterisk github mirror for download We now mirror the pjproject tarball and md5 at https://github.com/asterisk/third-party/tree/master/pjproject To improve download reliability, we now get the tarball from our mirror instead of from pjsip.org. ASTERISK-27052 #close Reported-by: 'alex' Change-Id: I60236587a8935bfa71fcc391f4e2ecb31918c08a 2017-06-12 09:57 +0000 [42f738e052] Alexei Gradinari * res_pjsip_mwi: don't create mwi subscriptions if initial unsolicited disabled If sending unsolicited mwi to all endpoints on startup is disabled (mwi_disable_initial_unsolicited=yes) do not need to create subscriptions. If there are many (thousands) realtime endpoints configured with unsolicited mwi and Vociemail Storage configured as ODBC or IMAP there will be huge number of DB/IMAP requests on startup. ASTERISK-26230 #close Change-Id: I50ae909639e3ee298b931a54def4b2b9e0fb86c5 2017-06-11 12:06 +0000 [847087a4ff] Sean Bright * codecs.conf.sample: Fix max_bandwidth speling error Reported by Sylvain Boily via asterisk-dev mailing list. Change-Id: Idc7623f335aea3e144dd369ba383b9a757480a9d 2017-06-08 17:31 +0000 [8d1f54b92e] Jørgen H * res_pjsip_transport_websocket: Add NULL check in get_write_timeout Added check for NULL return value when calling ast_sorcery_retrieve_by_id in function get_write_timeout ASTERISK-27046 Change-Id: I9357717278da631c3a1cb502c412693929b0cb41 2017-06-08 10:54 +0000 [d27168d36f] Guido Falsi * BuildSystem: Add patches to allow building with recent LibreSSL Add some #if defined checks which allow building against LibreSSL. These patchess come from OpenBSD ports: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/telephony/asterisk/patches/ ASTERISK-27043 #close Reported by: OpenBSD ports Change-Id: I2f6c08a5840b85ad4d2b75370b947ddde7a9a572 2017-06-06 14:54 +0000 [fcb1a0d7e8] David M. Lee * CFLAGS for BIND8 support Some systems (like macOS) require BIND_8_COMPAT to be defined so that the nameser libraries are, well, BIND8 compatible. Change-Id: If79fc27a64f90de1835b5aa3aadfa9be22bd16b0 2017-06-08 10:36 +0000 [7b668297f3] Guido Falsi * BuildSystem: Fix build on FreeBSD due to missing crypt.h FreeBSD does not include a crypt.h include file. Definitions for crypt() and crypt_r() are in unistd.h ASTERISK-27042 #close Change-Id: Ib307ee5e384870c6af50efa89fb73722dd0c3a7e 2017-06-07 15:19 +0000 [5b80496b42] Joshua Colp * chan_pjsip: Update device state when in early media. The chan_pjsip module uses a calculation approach for determining device state. This means that in situations where we would expect device state to change we need to tell the core to query. A scenario that was missed is when early media was signaled. This change adds the notification for the core to query device state when we are told that early media is being provided. ASTERISK-27039 Change-Id: Iafebfd152894966344ff2e950a3cee9f59a3eb6f 2017-06-07 14:32 +0000 [e497a76d24] Sean Bright * eventfd: Disable during cross compilation Reported by Lonnie Abelbeck via private e-mail. Change-Id: Icc80f12b8d8d591e14a8e0ed9f1c02cbd193a89b 2017-06-07 11:21 +0000 [19da99df2f] Alexei Gradinari * CHANGES: correct version for a new option 'refer_blind_progress' Change-Id: If4817d26a8974610827624fb8a4e56d681d6bf97 2017-06-06 07:04 +0000 [d3e951edf5] Joshua Colp * pjsip: Extend 'asymmetric_rtp_codec' option to include us changing. PJSIP support in Asterisk differs from chan_sip in that it allows media to be sent as-is without transcoding provided the codecs were negotiated in the SDP. This is allowed according to the RFC. Support for this differs quite a lot though and some endpoints do not handle it well. This change extends the 'asymmetric_rtp_codec' option to also cover this case. When set to no (the default) the code behaves as chan_sip does - the best codec is selected and we will only ever send that, unless we change what we are sending if the remote side changes. When set to yes we will send media as-is without transcoding if the codec has been negotiated in the SDP. ASTERISK-26996 Change-Id: Ib1647f6902a0843e8c435946f831c2159e8d1d51 2017-06-06 10:04 +0000 [b3ca24d216] Sean Bright * res_rtp_multicast: Use consistent timestamps when possible When a frame destined for a MulticastRTP channel does not have timing information (such as when an 'originate' is done), we generate the RTP timestamps ourselves without regard to the number of samples we are about to send. Instead, use the same method as res_rtp_asterisk and 'predict' a timestamp given the number of samples. If the difference between the timestamp that we generate and the one we predict is within a specific threshold, use the predicted timestamp so that we end up with timestamps that are consistent with the number of samples we are actually sending. Change-Id: I2bf0db3541b1573043330421cbb114ff0f22ec1f 2017-05-31 10:41 +0000 [861984eac0] Joshua Colp * res_pjsip: Add support for returning only reachable contacts and use it. This introduces the ability for PJSIP code to specify filtering flags when retrieving PJSIP contacts. The first flag for use causes the query code to only retrieve contacts that are not unreachable. This change has been leveraged by both the Dial() process and the PJSIP_DIAL_CONTACTS dialplan function so they will now only attempt calls to contacts which are not unreachable. ASTERISK-26281 Change-Id: I8233b4faa21ba3db114f5a42e946e4b191446f6c 2017-06-05 11:27 +0000 [d8802a6a0f] Kevin Harwell * channel: ast_write frame wrongly freed after call to audiohooks ASTERISK-26419 introduced a bug when calling ast_audiohook_write_list in ast_write. It would free the frame given to ast_write if the frame returned by ast_audiohook_write_list was different than the given one. The frame give to ast_write should never be freed within that function. It is the caller's resposibility to free the frame after writing (or when it its done with it). By freeing it within ast_write this of course led to some memory corruption problems. This patch makes it so the frame given to ast_write is no longer freed within the function. The frame returned by ast_audiohook_write_list is now subsequently used in ast_write and is freed later. It is freed either after translate if the frame returned by translate is different, or near the end of ast_write prior to function exit. ASTERISK-26973 #close Change-Id: Ic9085ba5f555eeed12f6e565a638c3649695988b 2017-05-31 11:45 +0000 [001f4ddda4] Sean Bright * pbx_builtin: Properly handle hangup during Background Before this patch, when a user hung up during a Background, we would stuff 0xff into a char and attempt a dialplan lookup of it. This caused problems for some realtime engines which interpreted the value as the beginning of an invalid UTF-8 sequence. ASTERISK-19291 #close Reported by: Andrew Nowrot Change-Id: I8ca6da93252d61c76ebdb46a4aa65e73ca985358 2017-05-31 04:25 +0000 [f6eeaaafd5] Joshua Colp * channel / app_meetme: Fix parentheses. ASTERISK-27025 Change-Id: Id736b0aa4ec6b6b0f04663d64fa8d151f81fdbed 2017-05-30 16:07 +0000 [9dce4a947b] Sean Bright * stasis_recording: Correct ast_asprintf error checking ASTERISK-27021 #close Reported by: Tim Morgan Change-Id: I0ac061f040093e806c3b1f4e2340864f3ce4dd75 2017-05-28 15:43 +0000 [5c27fe2187] Sean Bright * format: Reintroduce smoother flags In review 4843 (ASTERISK-24858), we added a hack that forced a smoother creation when sending signed linear so that the byte order was adjusted during transmission. This was needed because smoother flags were lost during the new format work that was done in Asterisk 13. Rather than rolling that same hack into res_rtp_multicast, re-introduce smoother flags so that formats can dictate their own options. Change-Id: I77b835fba0e539c6ce50014a984766f63cab2c16 2017-05-24 10:09 +0000 [39d14834f8] Mark Michelson * Confbridge: Add "sfu" video mode to bridge profile options. A previous commit added plumbing to bridge_softmix to allow for an SFU experience with Asterisk. This commit adds an option to app_confbridge that allows for a confbridge to actually make use of the SFU video mode. SFU mode is implemented in a "set it and forget it" kind of way. That is, when the bridge is created, if SFU mode is enabled, then the video mode gets set to SFU and cannot be changed. Future improvements may allow for a hybrid experience (e.g. forward multiple video streams, specifically those of the most recent talkers), but for this addition, no such capability is present. Change-Id: I87bbcb63dec6dbbb42488f894871b86f112b2020 2017-05-05 11:56 +0000 [2da869408a] Mark Michelson * Add primitive SFU support to bridge_softmix. This sets up the "plumbing" in bridge_softmix to be able to accommodate Asterisk asking as an SFU (selective forwarding unit) for conferences. The way this works is that whenever a channel enters or leaves a conference, all participants in the bridge get sent a stream topology change request. The topologies consist of the channels' original topology, along with video destination streams corresponding to each participants' source video streams. So for instance, if Alice, Bob, and Carol are in the conference, and each supplies one video stream, then the topologies for each would look like so: Alice: Audio, Source video(Alice), Destination Video(Bob), Destination video (Carol) Bob: Audio, Source video(Bob) Destination Video(Alice), Destination video (Carol) Carol: Audio, Source video(Carol) Destination Video(Alice), Destination video (Bob) This way, video that arrives from a source video stream can then be copied out to the destination video streams on the other participants' channels. Once the bridge gets told that a topology on a channel has changed, the bridge constructs a map in order to get the video frames routed to the proper destination streams. This is done using the bridge channel's stream_map. This change is bare-bones with regards to SFU support. Some key features are missing at this point: * Stream limits. This commit makes no effort to limit the number of streams on a specific channel. This means that if there were 50 video callers in a conference, bridge_softmix will happily send out topology change requests to every channel in the bridge, requesting 50+ streams. * Configuration. The plumbing has been added to bridge_softmix, but there has been nothing added as of yet to app_confbridge to enable SFU video mode. * Testing. Some functions included here have unit tests. However, the functionality as a whole has only been verified by hand-tracing the code. * Selectivenss. For a "selective" forwarding unit, this does not currently have any means of being selective. * Features. Presumably, someone might wish to only receive video from specific sources. There are no external-facing functions at the moment that allow for users to select who they receive video from. * Efficiency. The current scheme treats all video streams as being unidirectional. We could be re-using a source video stream as a desetnation, too. But to simplify things on this first round, I did it this way. Change-Id: I7c44a829cc63acf8b596a337b2dc3c13898a6c4d 2017-05-30 09:34 +0000 [045d7b8cb7] Sean Bright * format_mp3: Re-work menuselect/build issues Rather than removing format_mp3 from ALL_C_MODS (which caused format_mp3 to not show up in menuselect), use .PHONY targets when the necessary source files are not present. ASTERISK-23951 Reported by: Tzafrir Cohen Change-Id: I0a7512c51acc9e86043671795020b0de725bd9e8 2017-05-30 09:43 +0000 [80206cdc65] George Joseph * test_json: Fix test names with reserved words Some of the test names were actually reserved words (true, false, int, null, string, bool). When the jenkins test results analyzer does its thing it tries to create a map using the test names as keys and fails because they're reserved words. Added "type_" to those test names. Change-Id: I90d809f46969c78a1c605b736ff0635196a2cf1b 2017-05-26 11:41 +0000 [9c4f63263c] Joshua Colp * manager: Clear the flag on the other channel. During the channel flag audit an incorrect change was done. The flag should be cleared on the second channel. ASTERISK-26469 Change-Id: I770c5a389550a2fb5a6ade942fccbb2e1d9199c8 2017-05-26 11:15 +0000 [1f136fe885] Sean Bright * res_srtp: Add support for libsrtp2 ASTERISK-25294 #close Reported by: Tzafrir Cohen ASTERISK-26976 #close Reported by: Alex Change-Id: I789b1c3d1ed31365bbd9339fa58ef36f48833c40 2017-05-25 11:10 +0000 [59348aa182] Sean Bright * format_mp3: Don't try to build format_mp3 if we don't have sources ASTERISK-23951 #close Reported by: Tzafrir Cohen Change-Id: Iebf181d44bb735787fde4b5be863c4d7e2478a30 2017-05-23 11:07 +0000 [44c5a144ce] Martin Tomec * Sqlite3: make busy_timeout configurable. Enables runtime configuration of busy_timeout for sqlite databases. Default timeout remains 1000ms. ASTERISK-27014 #close Change-Id: I8921a3aac3c335843be4cb17d2dd0a5c157a36da 2017-05-24 15:50 +0000 [08edd54c1b] George Joseph * unittests: Add a unit test that causes a SEGV and... ...that can only be run by explicitly calling it with 'test execute category /DO_NOT_RUN/ name RAISE_SEGV' This allows us to more easily test CI and debugging tools that should do certain things when asterisk coredumps. To allow this a new member was added to the ast_test_info structure named 'explicit_only'. If set by a test, the test will be skipped during a 'test execute all' or 'test execute category ...'. Change-Id: Ia3a11856aae4887df9a02b6b081cc777b36eb6ed 2017-05-23 15:42 +0000 [d847fe6585] Sean Bright * res_agi: Allow configuration of audio format of EAGI pipe This change allows the format of the EAGI audio pipe to be changed by setting the dialplan variable 'EAGI_AUDIO_FORMAT' to the name of one of the loaded formats. ASTERISK-26124 #close Change-Id: I7a10fad401ad2a21c68c2e7246fa357d5cee5bbd 2017-05-23 13:33 +0000 [e2e6baa8d8] Sean Bright * res_agi: Clarify 'RECORD FILE' documentation Documented the 'beep' option in both the parameters list and the command description. ASTERISK-23839 #close Change-Id: I4970395c922dbdce3f7cf0f56d5b065ec9aa53ea 2017-05-23 13:06 +0000 [3dcb3c88aa] Sean Bright * res_agi: Prevent crash when SET VARIABLE called without arguments Explicitly check that the appropriate number of arguments were passed to SET VARIABLE before attempting to reference them. Also initialize the arguments array to zeroes before populating it. ASTERISK-22432 #close Change-Id: I5143607d80a2724f749c1674f3126b04ed32ea97 2017-05-23 12:35 +0000 [e490aa3176] Sean Bright * res_agi: Fix malformed AGI usage response If the generated XML documentation for a command does not end with a \n, the postamble of the usage message does not appear on its own line. ASTERISK-25662 #close Change-Id: If190f1e9e37fe215fed95897d78d4a6e142b0020 2017-05-23 10:06 +0000 [8ae0227cf3] Sean Bright * res_format_attr_h26x: Trim blanks in fmtp attributes Some devices separate format attributes with a semicolon followed by a space, so trim blanks before trying to match them. ASTERISK-27008 #close Change-Id: Ia44cb2e4fef5c73dc541a29da79cb0e19c22d9cc 2017-05-15 15:03 +0000 [faab058014] Joshua Colp * app_queue: Fix members showing as being in call when not. A change was done which added an 'in_call' flag to queue members that was set to true while talking to an agent. Unfortunately in practice this does not accurately reflect whether they are talking to an agent or not. If a Local channel is involved and a transfer is performed then the app_queue application would incorrectly think the agent was still in a call with the caller. This was done to fix a race condition between an agent becoming available by device state and the checking of the last call information for the wrapup time. There was a small window where the last call information would be the previous value instead of the new one. This change goes about fixing the original issue in a different way by considering the call completed if device state is received which would make the agent available and if they are currently in a call. If this occurs the last call information is updated before the agent becomes available ensuring that old information is not present when checking if the member should be called. This also improves the transfer situation by actually updating and enforcing the wrapup time. ASTERISK-26399 ASTERISK-26400 ASTERISK-26715 ASTERISK-26975 Change-Id: Ife1cb686e3173b3a6d368601adef9aff69d4beea 2017-05-23 05:45 +0000 [36e90952ec] Robert Mordec * app_confbridge: Race between removing and playing name recording while leaving When user leaves a conference, its channel calls async_play_sound_file() in order to play the name announcement and then unlinks the sound file. The async_play_sound_file() function adds a task to conference playback queue, which then runs playback_common() function in a different thread. It leads to a race condition when, in some cases, channel thread may unlink the sound file before playback_common() had a chance to open it. This patch creates a file deletion task, that is queued after playback. ASTERISK-27012 #close Change-Id: I412f7922d412004b80917d4e892546c15bd70dd3 2017-05-22 13:51 +0000 [440ff38c08] Kevin Harwell * res_rtp_asterisk: rtcp mux using the wrong srtp unprotecting algorithm When using rtcp mux if an rtcp payload came in it would still use the srtp unprotect algorithm instead of the srtp unprotect rtcp method. Since rtcp data was being passed to the rtp unprotect method this would result in an error. This patch ensures that the correct unprotect method is chosen by making sure the passed in rtcp flag is appropriately set when rtcp mux is enabled and an rtcp payload is received. ASTERISK-26979 #close Change-Id: Ic5409f9d1a267f1d4785fc5aed867daaecca6241 2017-05-19 10:05 +0000 [0f487978a9] Sean Bright * chan_sip: Better ICE handling for RTCP-MUX If we are offered or are offering RTCP-MUX, don't consider RTCP ICE candidates. This confuses certain browsers (current Firefox for example) and causes intial audio setup delays. ASTERISK-26982 #close Change-Id: Ifeaf47e83972fe8dbe58b7fb3d6d1823400cfb91 2017-05-12 10:38 +0000 [be4beff3e4] Steve Davies * app_queue: Add QUEUE_RAISE_PENALTY feature Additional variable to work alongside QUEUE_MAX_PENALTY and QUEUE_MIN_PENALTY, including an extra parameter in queuerules.conf. This value causes lower Agent penalty values to "raise up" so that they can join higher penalty agents and be treated equally after a period of time. ASTERISK-26995 #close Change-Id: If1c6421a983667a5ac4c359f6dac25b212b4c459 2017-04-13 17:17 +0000 [7c0466092c] Mark Michelson * AST-2017-003: Handle zero-length body parts correctly. ASTERISK-26939 #close Change-Id: I7ea235ab39833a187db4e078f0788bd0af0a24fd 2017-04-13 11:14 +0000 [949e9147bf] George Joseph * AST-2017-004: chan_skinny: Add EOF check in skinny_session The while(1) loop in skinny_session wasn't checking for EOF so a packet that was longer than a header but still truncated would spin the while loop infinitely. Not only does this permanently tie up a thread and drive a core to 100% utilization, the call of ast_log() in such a tight loop eats all available process memory. Added poll with timeout to top of read loop ASTERISK-26940 #close Reported-by: Sandro Gauci Change-Id: I2ce65f3c5cb24b4943a9f75b64d545a1e2cd2898 2017-04-13 17:16 +0000 [2bb98d8fac] Mark Michelson * AST-2017-002: Ensure transaction key buffer is large enough. ASTERISK-26938 #close Change-Id: I266490792fd8896a23be7cb92f316b7e69356413 2017-05-18 16:35 +0000 [4141748e85] Sean Bright * res_hep_rtcp: Add support level to module info Change-Id: I5661478f9cf12d431f730e42be79323b62831e92 2017-05-15 13:26 +0000 [a60d1f3974] Kevin Harwell * app_stream_echo: Added a multi-stream echo application If the channel does not have multi-stream support then this application acts just like app_echo. If it does have multi-stream support then each stream is echoed back to itself (one-to-one). If a "num" is specified, then a new topology is made that contains clones (from the channel's topology) of all media types that are not equal to the given "type". If the media type differs then the first stream matching the "type" is cloned into the new topology and then up to "num" - 1 of the same stream are also cloned into it. Any additional streams from the original topology matching the "type" are subsequently ignored (i.e. not added to the new topology). For this same case when a frame is read from a stream that frame is still echoed back like before, but now that frame is also echoed out to the additional streams that matched on the specified "type". ASTERISK-26997 #close Change-Id: I254144486734178e196c7f590a26ffc13543ff2c 2017-05-15 13:25 +0000 [51375686f7] Kevin Harwell * core/conversions: Added string to unsigned integer and long conversions Added functions that convert a string to an unsigned integer or unsigned long. A couple of unit test were also created to test the routines. The reasons for adding these conversion utilities (and hopefully eventually more) are as follows: * Conversion routines are functionally contained with consistent and better error checking * The function names offer a better description of what is happening * It encourages code reuse for easier bug fixing at a single source * It's simpler to use * It's unit testable For instance, currently in a lot of places when converting to an integer or similar the "sscanf" function is used. When using "sscanf" it may not be immediately clear what's happening as it lacks semantic naming. Limited error checking is usually done as well. For example, most of the time a check is done to make sure the value converted, but does not check for overflows or negative valued conversions when converting unsigned numbers. Why use/wrap "strtoul" and not "sscanf" then? Primarily, it lacks some of the built in error handling that "strtoul" has. For instance "strtoul" contains overflow checks. Less so, but can still factor as reasons, "sscanf" is slightly more complex in its use. And maybe a bit controversial, but it may be ("big if") potentially slower than "strtoul" in some cases. Change-Id: If7eaca4a48f8c7b89cc8b5a1f4bed2852fca82bb 2017-05-13 11:40 +0000 [5a7af00e80] Joshua Colp * asterisk: Audit locking of channel when manipulating flags. When manipulating flags on a channel the channel has to be locked to guarantee that nothing else is also manipulating the flags. This change introduces locking where necessary to guarantee this. It also adds helper functions that manipulate channel flags and lock to reduce repeated code. ASTERISK-26789 Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10 2017-05-12 21:04 +0000 [30fbed65f1] Richard Mudgett * res_pjsip_session.c: Process initial INVITE sooner. (key exists) Retransmissions of an initial INVITE could be queued in the serializer before we have processed the first INVITE message. If the first INVITE message doesn't get completely processed before the retransmissions are seen then we could try to setup the same call from the retransmissions. A symptom of this is seeing a (key exists) message associated with an INVITE. An earlier change attempted to address this kind of problem by calculating a distributor serializer to use for unassociated messages. Part of that change also made incoming calls keep using that distributor serializer. (ASTERISK-26088) However, some leftover code was still deferring the INVITE processing to the session's serializer even though we were already in that serializer. This not only is unnecessary but would cause the same call resetup problem. * Removed the code to defer processing the initial INVITE to the session's serializer because we are already running in that serializer. ASTERISK-26998 #close Change-Id: I1e822d82dcc650e508bc2d40d545d5de4f3421f6 2017-05-14 00:37 +0000 [6e7b78414f] Rodrigo Ramírez Norambuena * Fix spelling queues.conf.sample file Change-Id: Ie1c2d83af66f27a449da09a68d987e0992627fee 2017-05-08 13:40 +0000 [93b7f84c1a] Vitezslav Novy * chan_sip: Change sip_get_codec() to return correct codec list Return cahnnel nativeformats to fix bridge technology selection process. Same approach as in pjsip module. ASTERISK-26143 Reported-by: Henning Holtschneider Change-Id: I64e863753954d6ad67a9e722df2ebc328705ad48 2017-05-08 15:56 +0000 [808f299808] Alexei Gradinari * res_pjsip: New endpoint option "refer_blind_progress" This option was added to turn off notifying the progress details on Blind Transfer. If this option is not set then the chan_pjsip will send NOTIFY "200 OK" immediately after "202 Accepted". Some SIP phones like Mitel/Aastra or Snom keep the line busy until receive "200 OK". ASTERISK-26333 #close Change-Id: Id606fbff2e02e967c02138457badc399144720f2 2017-05-11 00:25 +0000 [045dbcc2d6] Ivan Poddubny * app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON There are 2 places in app_queue.c that log EXITEMPTY event: one in wait_our_turn, and another one in queue_exec in the loop trying to call an agent after wait_our_turn. In most cases it leads to logging EXITEMPTY twice. ABANDON is also logged on two places, and in the rare case when an agent and caller hang up simultaneously it's also possible to get duplicates in queue_log. This commit changes wait_our_turn to return -1 ("the caller should exit the queue") instead of 0 ("the caller's turn has arrived") in case of leaving when empty, so queue_exec skips the agent calling loop. Also, leave_queue is now executed only once in this case, because 2nd time is just a noop when the queue entry has already been removed. Also, it sets qe->handled to -1 to indicate that the call was not answered by an agent, but the necessary handling has already been done in order to avoid logging an extra ABANDON entry. ASTERISK-25665 #close Reported by: Ove Aursand Change-Id: I4578dd383bf2ac41589cf167865e8aaebcd4c11e 2017-04-27 19:37 +0000 [b8659be9b0] Richard Mudgett * SDP: Make process possible multiple fmtp attributes per rtpmap. Change-Id: Ie7511008d82b59590e0eb520a21b5e1da4bd7349 2017-04-28 11:53 +0000 [c2906dfa05] Richard Mudgett * SDP: Remove sdp_state.remote_capabilities The sdp_state.remote_capabilities was only used inside merge_sdps() and subsequent calls to merge_sdps() by re-INVITE's would leak them. Change-Id: I0ceb7838ea044cc913e8ad4a255c39c9740ae0ce 2017-05-05 14:30 +0000 [16785c0908] Richard Mudgett * SDP: Add interface_address to specify our address to use. When we optionally set the interface_address we are forcing the media to go out a specific interface address. This allows us to optionally have the media go out the interface that SIP signalling came in on or if we are configured to have the media always go out a specific address. Change-Id: I160d9fac322a075bd2557b430632544178196189 2017-05-05 14:49 +0000 [367042bd3e] Richard Mudgett * SDP: Explicitly stop a RTP instance before destoying it. * Made sdp_add_m_from_rtp_stream() and sdp_add_m_from_udptl_stream() handle generating disabled/declined streams. * Added /main/sdp/sdp_merge_asymmetric unit test. It currently does not check the offerer side negotiated SDP because that isn't the purpose of this patch and there is much to be done to handle declined/dummy streams. * Added T.38 image streams to the /main/sdp/sdp_merge_symmetric and /main/sdp/sdp_merge_crisscross unit tests. Change-Id: Ib4dcb3ca4f9a9133b376f4e3302f9a1f963f2b31 2017-04-28 19:48 +0000 [be5809fac8] Richard Mudgett * SDP: Rework merge_capabilities(). * Tried to give better variable names. * Made our SDP answer use the offer's RTP payload types as the SDP RFC says we SHOULD. * Updating the local topology now takes the stream format caps. We are likely preparing to send an offer. Change-Id: I34d3be8e3036402a8575ffcae3eebc5ce348d7c0 2017-04-28 12:30 +0000 [ae7689f093] Richard Mudgett * SDP: Update ast_get_topology_from_sdp() to keep RTP map. * Add failure exits to ast_get_topology_from_sdp(). Change-Id: I4cc85c1ede8d712766ed20f544dbcef04c8c1049 2017-05-09 10:34 +0000 [cbbd119c21] Joshua Colp * tcptls: Improve error messages for TLS connections. This change uses the functions provided by OpenSSL to query and better construct error messages for situations where the connection encounters a problem. ASTERISK-26606 Change-Id: I7ae40ce88c0dc4e185c4df1ceb3a6ccc198f075b 2017-05-04 17:28 +0000 [10a4439ac9] Joshua Elson * Prevent Undefined Capath Crash It is possible to initialize a valid config without a capath or cafile definition. This will cause a crash on a reload. This fix ensures capath is always allocated. ASTERISK-26983 #close Change-Id: I63ff715d9d9023427543a5b8a4ba7b0d82533c12 2017-05-05 11:33 +0000 [1a1c86239d] George Joseph * cel_odbc: Fix timestamp processing for microseconds When a column is of type timestamp, the fraction part of the event field's seconds was frequently parsed incorrectly especially if there were leading zeros. For instance "2017-05-23 23:55:03.023" would be parsed into an int as "23" then when the timestamp was formatted again to be inserted into the database column it'd be "2017-05-23 23:55:03.23" which is now 230 milliseconds instead of 23 milliseconds. "03.000001" would be transformed to "03.1", etc. * If the event field is 'eventtime' and the db column is timestamp, then existing processing has already correctly formatted the timestamp so now we simply use it rather than parsing it and re-printing it. This is the most common use case anyway. * If the event field is other than 'eventtime' and the db column is timestamp, we now parse the seconds, including the fractional part into a double rather than 2 ints. This preserves the magnitude and precision of the fractional part. When we print it, we now print it as a "%09.6lf" which correctly represents the input. To be honest, why we parse the string timestamp into components, test the components, then print the components back into a string timestamp is beyond me. We should use parse it, test it, then if it passes, use the original string representation in the database call. Maybe someone thought that some implementations wouldn't take a partial timestamp string like "2017-05-06" and decided to always produce a full timestamp string even if an abbreviated one was supplied. Anyway, I'm leaving it as it is. ASTERISK-25032 #close Reported-by: Etienne Lessard Change-Id: Id407e6221f79a5c1120e1a70bc7e893bbcaf1938 2017-05-09 05:25 +0000 [3c36c29c81] Joshua Colp * res_hep_rtcp: Provide chan_sip Call-ID for RTCP messages. This change adds the required logic to allow the SIP Call-ID to be placed into the HEP RTCP traffic if the chan_sip module is used. In cases where the option is enabled but the channel is not either SIP or PJSIP then the code will fallback to the channel name as done previously. Based on the change on Nir's branch at: team/nirs/hep-chan-sip-support ASTERISK-26427 Change-Id: I09ffa5f6e2fdfd99ee999650ba4e0a7aad6dc40d 2017-05-08 16:11 +0000 [201346fb7d] George Joseph * logger: Added logger_queue_limit to the configuration options. All log messages go to a queue serviced by a single thread which does all the IO. This setting controls how big that queue can get (and therefore how much memory is allocated) before new messages are discarded. The default is 1000. Should something go bezerk and log tons of messages in a tight loop, this will prevent memory escalation. When the limit is reached, a WARNING is logged to that effect and messages are discarded until the queue is empty again. At that time another WARNING will be logged with the count of discarded messages. There's no "low water mark" for this queue because the logger thread empties the entire queue and processes it in 1 batch before going back and waiting on the queue again. Implementing a low water mark would mean additional locking as the thread processes each message and it's not worth it. A "test" was added to test_logger.c but since the outcome is non-deterministic, it's really just a cli command, not a unit test. Change-Id: Ib4520c95e1ca5325dbf584c7989ce391649836d1 2017-05-02 18:05 +0000 [56c5c51076] Richard Mudgett * stream: ast_stream_clone() cannot copy the opaque user data. ast_stream_clone() cannot copy the opaque user data stored on a stream. We don't know how to clone the data so it isn't copied into the clone. Change-Id: Ia51321bf38ecbfdcc53787ca77ea5fd2cabdf367 2017-05-04 17:32 +0000 [924628812b] Richard Mudgett * netsock2.c: Made get/set addr port avoid potential uninitialized memory. Change-Id: I532052bd7cd95a4b3565485fc01e2a1ea07ee647 2017-05-05 08:48 +0000 [4146facfec] Joshua Colp * func_cdr: Allow empty value for CDR dialplan function. A regression was introduced in 12 where passing an empty value to the CDR dialplan function was not longer allowed. This change returns to the behavior of 11 where it is permitted. ASTERISK-26173 Change-Id: I3f148203b54ec088007e29e30005a5de122e51c5 2017-05-04 16:04 +0000 [0001834157] George Joseph * app_confbridge: Fix reference to cfg in menu_template_handler menu_template_handler wasn't properly accounting for the fact that it might be called both during a load/reload (which isn't really valid but not prevented) and by a dialplan function. In both cases it was attempting to use the "pending" config which wasn't valid in the latter case. aco_process_config is also partly to blame because it wasn't properly cleaning "pending" up when a reload was done and no changes were made. Both of these contributed to a crash if CONFBRIDGE(menu,template) was called in a dialplan after a reload. * aco_process_config now sets info->internal->pending to NULL after it unrefs it although this isn't strictly necessary in the context of this fix. * menu_template_handler now uses the "current" config and silently ignores any attempt to be called as a result of someone uses the "template" parameter in the conf file. Luckily there's no other place in the codebase where aco_pending_config is used outside of aco_process_config. ASTERISK-25506 #close Reported-by: Frederic LE FOLL Change-Id: Ib349a17d3d088f092480b19addd7122fcaac21a7 2017-04-30 16:40 +0000 [c90d81ef51] Joshua Colp * bridge: Fix returning to dialplan when executing Bridge() from AMI. When using the Bridge AMI action on the same channel multiple times it was possible for the channel to return to the wrong location in the dialplan if the other party hung up. This happened because the priority of the channel was not preserved across each action invocation and it would fail to move on to the next priority in other cases. This change makes it so that the priority of a channel is preserved when taking control of it from another thread and it is incremented as appropriate such that the priority reflects where the channel should next be executed in the dialplan, not where it may or may not currently be. The Bridge AMI action was also changed to ensure that it too starts the channels at the next location in the dialplan. ASTERISK-24529 Change-Id: I52406669cf64208aef7252a65b63ade31fbf7a5a 2017-04-25 11:49 +0000 [7b0e3b92fd] Kevin Harwell * bridge_simple: Added support for streams This patch is the first cut at adding stream support to the bridging framework. Changes were made to the framework that allows mapping of stream topologies to a bridge's supported media types. The first channel to enter a bridge initially defines the media types for a bridge (i.e. a one to one mapping is created between the bridge and the first channel). Subsequently added channels merge their media types into the bridge's adding to it when necessary. This allows channels with different sized topologies to map correctly to each other according to media type. The bridge drops any frame that does not have a matching index into a given write stream. For now though, bridge_simple will align its two channels according to size or first to join. Once both channels join the bridge the one with the most streams will indicate to the other channel to update its streams to be the same as that of the other. If both channels have the same number of streams then the first channel to join is chosen as the stream base. A topology change source was also added to a channel when a stream toplogy change request is made. This allows subsystems to know whether or not they initiated a change request. Thus avoiding potential recursive situations. ASTERISK-26966 #close Change-Id: I1eb5987921dd80c3cdcf52accc136393ca2d4163 2017-05-01 13:04 +0000 [008e25def9] Kevin Harwell * res_rtp_asterisk: Clearing the remote RTCP address causes RTCP failures When a call gets put on hold RTP is temporarily stopped and Asterisk was setting the remote RTCP address to NULL. Then when RTCP data was received from the remote endpoint, Asterisk would be missing this information when publishing the rtcp_message stasis event. Consequently, message subscribers (in this case res_hep_rtcp) trying to parse the "from" field output the following error: "ast_sockaddr_split_hostport: Port missing in (null)" This patch makes it so the remote RTCP address is no longer set to NULL when stopping RTP. There was only one place that appeared to check if the remote RTCP address was NULL as a way to tell if RTCP was running. This patch added an additional check on the RTCP schedid for that case to make sure RTCP was truly not running. ASTERISK-26860 #close Change-Id: I6be200fb20db647e48b5138ea4b81dfa7962974b 2017-05-02 11:34 +0000 [675e058e77] Sean Bright * cleanup: Change severity of fread short-read warning Many sound files don't have a full frame's worth of data at EOF, so the warning messages were a bit too noisy. So we demote them to debug messages. Change-Id: I6b617467d687658adca39170a81797a11cc766f6 2017-04-26 16:22 +0000 [cd272da7a8] Richard Mudgett * SDP: Replace SDP telephone_event option with dtmf option The telephone_event option was used as a flag and a bit mapped value in different places when it is a boolean. It is also inadequate to configure the DTMF operation of the RTP instance created for the stream. Change-Id: Ib1addeaf0ce86f07039f2f979cab29405dc5239b 2017-04-29 16:11 +0000 [52e4f02b1a] Richard Mudgett * res_pjsip_t38.c: Fix deadlock in T.38 framehook. A deadlock can happen between a channel lock and a pjsip session media container lock. One thread is processing a reINVITE's SDP and walking through the session's media container when it waits for the channel lock to put the determined format capabilities onto the channel. The other thread is writing a frame to the channel and processing the T.38 frame hook. The T.38 frame hook then waits for the pjsip session's media container lock. The two threads are now deadlocked. * Made the T.38 frame hook release the channel lock before searching the session's media container. This fix has been done to several other frame hooks to fix deadlocks. ASTERISK-26974 #close Change-Id: Ie984a76ce00bef6ec9aa239010e51e8dd74c8186 2017-04-28 10:56 +0000 [8170793be6] George Joseph * res_pjsip_outbound_authenticator_digest: Add context to log messages There was no context info in this module's log messages so it was impossible to toubleshoot. Added endpoint or host to all messages and added the realms in the challenge for the "No auth credentials for any realm" message. Change-Id: Ifeed2786f35fbea7d141237ae15625e472acff9b 2017-04-27 16:46 +0000 [48566b8c66] Richard Mudgett * res_sdp_translator_pjmedia.c: Add TODO notes. Change-Id: If27ca61f79accc882c3376d2e876d2b44aa1347b 2017-04-24 18:13 +0000 [ede90e4aa5] Richard Mudgett * SDP: Make SDP translation to/from internal representation more const. Change-Id: I473a174b869728604b37c60853896b0c458bc504 2017-04-20 19:25 +0000 [5c1851cbc0] Richard Mudgett * stream: Make ast_stream_topology_create_from_format_cap() allow NULL cap. Change-Id: Ie29760c49c25d7022ba2124698283181a0dd5d08 2017-04-24 16:55 +0000 [d71c6e3bfd] Richard Mudgett * SDP: Make ast_sdp_state_set_remote_sdp() return error. Change-Id: I7707c9d872c476d897ff459008652b35142a35e1 2017-04-14 11:52 +0000 [176123e76c] Richard Mudgett * SDP: Misc cleanups (Mostly memory leaks) Change-Id: I74431b385da333f2c5f5a6d7c55e70b69a4f05d2 2017-04-27 18:15 +0000 [bad091b317] Richard Mudgett * chan_vpb.cc: Fix compile error. Change-Id: I6d9edd34d8b2474222c86f44e379ead61e57a54f 2017-04-26 16:14 +0000 [d6535c0080] Mark Michelson * SDP API: Add SSRC-level attributes RFC 5576 defines how SSRC-level attributes may be added to SDP media descriptions. In general, this is useful for grouping related SSRCes, indicating SSRC-level format attributes, and resolving collisions in RTP SSRC values. These attributes are used widely by browsers during WebRTC communications, including attributes defined by documents outside of RFC 5576. This commit introduces the addition of SSRC-level attributes into SDPs generated by Asterisk. Since Asterisk does not tend to use multiple SSRCs on a media stream, the initial support is minimal. Asterisk includes an SSRC-level CNAME attribute if configured to do so. This at least gives browsers (and possibly others) the ability to resolve SSRC collisions at offer-answer time. In order to facilitate this, the RTP engine API has been enhanced to be able to retrieve the SSRC and CNAME on a given RTP instance. res_rtp_asterisk currently does not provide meaningful CNAME values in its RTCP SDES items, and therefore it currently will always return an empty string as the CNAME value. A task in the near future will result in res_rtp_asterisk generating more meaningful CNAMEs. Change-Id: I29e7f23e7db77524f82a3b6e8531b1195ff57789 2017-04-27 08:02 +0000 [d6b2a58736] George Joseph * res_pjsip_session: Add cleanup to ast_sip_session_terminate If you use ast_request to create a PJSIP channel but then hang it up without causing a transaction to be sent, the session will never be destroyed. This is due ot the fact that it's pjproject that triggers the session cleanup when the transaction ends. app_chanisavail was doing this to get more granular channel state and it's also possible for this to happen via ARI. * ast_sip_session_terminate was modified to explicitly call the cleanup tasks and unreference session if the invite state is NULL AND invite_tsx is NULL (meaning we never sent a transaction). * chan_pjsip/hangup was modified to bump session before it calls ast_sip_session_terminate to insure that session stays valid while it does its own cleanup. * Added test events to session_destructor for a future testsuite test. ASTERISK-26908 #close Reported-by: Richard Mudgett Change-Id: I52daf6f757184e5544c261f64f6fe9602c4680a9 2017-04-24 10:59 +0000 [2b22c3c84b] Joshua Colp * channel: Add ability to request an outgoing channel with stream topology. This change extends the ast_request functionality by adding another function and callback to create an outgoing channel with a requested stream topology. Fallback is provided by either converting the requested stream topology into a format capabilities structure if the channel driver does not support streams or by converting the requested format capabilities into a stream topology if the channel driver does support streams. The Dial application has also been updated to request an outgoing channel with the stream topology of the calling channel. ASTERISK-26959 Change-Id: Ifa9037a672ac21d42dd7125aa09816dc879a70e6 2017-04-26 14:20 +0000 [c6b757fa05] Kevin Harwell * res_pjsip/res_pjsip_callerid: NULL check on caller id name string It's possible for a name in a party id structure to be marked as valid, but the name string itself be NULL (for instance this is possible to do by using the dialplan CALLERID function). There were a couple of places where the name was validated, but the string itself was not checked before passing it to functions like 'strlen'. This of course caused a crashed. This patch adds in a NULL check before attempting to pass it into a function that is not NULL tolerant. ASTERISK-25823 #close Change-Id: Iaa6ffe9d92f598fe9e3c8ae373fadbe3dfbf1d4a 2017-04-25 11:43 +0000 [cf3429b934] Kevin Harwell * vector: defaults and indexes Added an pre-defined integer vector declaration. This makes integer vectors easier to declare and pass around. Also, added the ability to default a vector up to a given size with a default value. Lastly, added functionality that returns the "nth" index of a matching value. Also, updated a unit test to test these changes. Change-Id: Iaf4b51b2540eda57cb43f67aa59cf1d96cdbcaa5 2017-04-26 05:38 +0000 [985a5fd7aa] Joshua Colp * frame: Better handle interpolated frames. Interpolated frames are frames which contain a number of samples but have no actual data. Audiohooks did not handle this case when translating an incoming frame into signed linear. It assumed that a frame would always contain media when it may not. If this occurs audiohooks will now immediately return and not act on the frame. As well for users of ast_trans_frameout the function has been changed to be a bit more sane and ensure that the data pointer on a frame is set to NULL if no data is actually on the frame. This allows the various spots in Asterisk that check for an interpolated frame based on the presence of a data pointer to work as expected. ASTERISK-26926 Change-Id: I7fa22f631fa28d540722ed789ce28e84c7f8662b 2017-04-26 09:22 +0000 [99dea9ba84] Yasin CANER * res_pjsip_session : fixed wrong From Header number On Re-invite ASTERISK-26964 #close Change-Id: I55a9caa7dc90e6c4c219cb09b5c2ec08af84a302 2017-04-26 08:45 +0000 [858ed60446] George Joseph * pjproject_bundled: Add --disable-libwebrtc to configure Without the disable, pjproject tries to build it's internal webrtc implementation which requires sse2. This fails on platforms without sse2. ASTERISK-26930 #close Reported-by: abelbeck Change-Id: I07231f9160c35cfa42b194d3aad4e7d51fd9a410 2017-04-26 07:58 +0000 [585f9405b1] Thierry Magnien * channels/chan_sip.c: use binding IP address for outgoing TCP SIP connections For outgoing TCP connections, Asterisk uses the first IP address of the interface instead of the IP address we asked him to bind to. ASTERISK-26922 #close Reported-by: Ksenia Change-Id: I43c71ca89211dbf1838e5bcdb9be8d06d98e54eb 2017-04-21 12:04 +0000 [f5b67871df] Sean Bright * cleanup: Fix fread() and fwrite() error handling Cleaned up some of the incorrect uses of fread() and fwrite(), mostly in the format modules. Neither of these functions will ever return a value less than 0, which we were checking for in some cases. I've introduced a fair amount of duplication in the format modules, but I plan to change how format modules work internally in a subsequent patch set, so this is simply a stop-gap. Change-Id: I8ca1cd47c20b2c0b72088bd13b9046f6977aa872 2017-04-25 07:52 +0000 [199d4776c0] Joshua Colp * alembic: Add table for 'resource_list' PJSIP RLS type. This change adds an Alembic migration which adds a ps_resource_list table that can contain resource_list RLS configuration objects. ASTERISK-26929 Change-Id: I7c888fafc67b3e87012de974f71ca7a5b8b1ec05 2017-04-14 05:21 +0000 [19a79ae12c] Joshua Colp * sdp: Add support for T.38 This change adds a T.38 format which can be used in a stream topology to specify that a UDPTL stream needs to be created. The SDP API has been changed to understand T.38 and create the UDPTL session, add the attributes, and parse the attributes. This change does not change the boundary of the T.38 state machine. It is still up to the channel driver to implement and act on it (such as queueing control frames or reacting to them). ASTERISK-26949 Change-Id: If28956762ccb8ead562ac6c03d162d3d6014f2c7 2017-03-21 15:44 +0000 [32b3e36c68] Mark Michelson * SDP: Ensure SDPs "merge" properly. The gist of this work ensures that when a remote SDP is received, it is merged properly with the local capabilities. The remote SDP is converted into a stream topology. That topology is then merged with the current local topology on the SDP state. That new merged topology is then used to create an SDP. Finally, adjustments are made to RTP instances based on knowledge gained from the remote SDP. There are also a battery of tests in this commit that ensure that some basic SDP merges work as expected. While this may not sound like a big change, it has the property that it caused lots of ancillary changes. * The remote SDP is no longer stored on the SDP state. Biggest reason: there's no need for it. The remote SDP is used at the time it is being set and nowhere else. * Some new SDP APIs were added in order to find attributes and convert generic SDP attributes into rtpmap structures. * Writing tests made me realize that retrieving a value from an SDP options structure, the SDP options needs to be made const. * The SDP state machine was essentially gutted by a previous commit. Initially, I attempted to reinstate it, but I found that as it had been defined, it was not all that useful. What was more useful was knowing the role we play in SDP negotiation, so the SDP state machine has been transformed into an indicator of role. * Rather than storing separate local and joint stream state capabilities, it makes more sense to keep track of current stream state and update it as things change. Change-Id: I5938c2be3c6f0a003aa88a39a59e0880f8b2df3d 2017-04-24 13:16 +0000 [0611f2ca17] Sean Bright * res_hep: Add additional config initialization and validation * Initialize hepv3_runtime_data.sockfd to -1 so that our ao2 destructor does not close fd 0 * Add logging output when the required option - capture_address - is not specified. * Remove a no longer relevant #define and correct related documentation * Pass appropriate flags to aco_option_register so that capture_address cannot be the empty string. ASTERISK-26953 #close Change-Id: Ief08441bc6596d6f1718fa810e54a5048124f076 2017-04-17 19:06 +0000 [59203c51cc] Sean Bright * core: Use eventfd for alert pipes on Linux when possible The primary win of switching to eventfd when possible is that it only uses a single file descriptor while pipe() will use two. This means for each bridge channel we're reducing the number of required file descriptors by 1, and - if you're using timerfd - we also now have 1 less file descriptor per Asterisk channel. The API is not ideal (passing int arrays), but this is the cleanest approach I could come up with to maintain API/ABI. I've also removed what I believe to be an erroneous code block that checked the non-blocking flag on the pipe ends for each read. If the file descriptor is 'losing' its non-blocking mode, it is because of a bug somewhere else in our code. In my testing I haven't seen any measurable difference in performance. Change-Id: Iff0fb1573e7f7a187d5211ddc60aa8f3da3edb1d 2017-04-21 12:33 +0000 [f1d20c84a1] Richard Mudgett * res_pjsip_session.c: Send 100 Trying out earlier to prevent retransmissions. If ICE is enabled and a STUN server does not respond then we will block until we give up on the STUN response. This will take nine seconds. In the mean time the peer that sent the INVITE will send retransmissions. * Restructure res_pjsip_session.c:new_invite() to send a 100 Trying out earlier to prevent these retransmissions. ASTERISK-26890 Change-Id: Ie3fc611e53a0eff6586ad55e4aacad81cf6319a8 2017-04-21 12:07 +0000 [835c209445] Richard Mudgett * res_pjsip_session.c: Restructure ast_sip_session_alloc() * Restructure ast_sip_session_alloc() to need less cleanup on off nominal error paths. * Made ast_sip_session_alloc() and ast_sip_session_create_outgoing() avoid unnecessary ref manipulation to return a session. This is faster than calling a function. That function may do logging of the ref changes with REF_DEBUG enabled. Change-Id: I2a0affc4be51013d3f0485782c96b8fee3ddb00a 2017-04-20 02:13 +0000 [b4b1943c5d] Jean Aunis * chan_sip: Trigger reinvite if the SDP answer is included in the SIP ACK Some equipments may send a re-INVITE containing an SDP in the final ACK request. If this happens in the context of direct media, the remote end should be updated with a re-INVITE. This patch queues an "update RTP peer" frame to trigger the re-INVITE, instead of the "source change" frame wich was used previously. ASTERISK-26951 Change-Id: I3644d2025f20e086ea9f8f62b486172c52b5b2e6 2017-04-19 15:08 +0000 [c47b3e74d2] Sean Bright * pbx: Use same thread if AST_OUTGOING_WAIT_COMPLETE specified Both ast_pbx_outgoing_app() and ast_pbx_outgoing_exten() cause the core to spawn a new thread to perform the dial. When AST_OUTGOING_WAIT_COMPLETE is passed to these functions, the calling thread will be blocked until the newly created channel has been hung up. After this patch, we run the dial on the current thread rather than spawning a new one. The only in-tree code that passes AST_OUTGOING_WAIT_COMPLETE is pbx_spool, so you should see reduced thread usage if you are using .call files. Change-Id: I512735d243f0a9da2bcc128f7a96dece71f2d913 2017-04-19 13:23 +0000 [afad2ffd9f] Richard Mudgett * res_rtp_asterisk.c: Fix crash in RTCP DTLS operation. Occasionally a crash happens when processing the RTCP DTLS timeout handler. The RTCP DTLS timeout timer could be left running if we have not completed the DTLS handshake before we place the call on hold or we attempt direct media. * Made ast_rtp_prop_set() stop the RTCP DTLS timer when disabling RTCP. * Made some sanity tweaks to ast_rtp_prop_set() when switching from standard RTCP mode to RTCP multiplexed mode. ASTERISK-26692 #close Change-Id: If6c64c79129961acfa4b3d63a864e8f6b664acc0 2017-03-22 16:05 +0000 [d165079cbc] Richard Mudgett * rtp_engine/res_rtp_asterisk: Fix RTP struct reentrancy crashes. The struct ast_rtp_instance has historically been indirectly protected from reentrancy issues by the channel lock because early channel drivers held the lock for really long times. Holding the channel lock for such a long time has caused many deadlock problems in the past. Along comes chan_pjsip/res_pjsip which doesn't necessarily hold the channel lock because sometimes there may not be an associated channel created yet or the channel pointer isn't available. In the case of ASTERISK-26835 a pjsip serializer thread was processing a message's SDP body while another thread was reading a RTP packet from the socket. Both threads wound up changing the rtp->rtcp->local_addr_str string and interfering with each other. The classic reentrancy problem resulted in a crash. In the case of ASTERISK-26853 a pjsip serializer thread was processing a message's SDP body while another thread was reading a RTP packet from the socket. Both threads wound up processing ICE candidates in PJPROJECT and interfering with each other. The classic reentrancy problem resulted in a crash. * rtp_engine.c: Make the ast_rtp_instance_xxx() calls lock the RTP instance struct. * rtp_engine.c: Make ICE and DTLS wrapper functions to lock the RTP instance struct for the API call. * res_rtp_asterisk.c: Lock the RTP instance to prevent a reentrancy problem with rtp->rtcp->local_addr_str in the scheduler thread running ast_rtcp_write(). * res_rtp_asterisk.c: Avoid deadlock when local RTP bridging in bridge_p2p_rtp_write() because there are two RTP instance structs involved. * res_rtp_asterisk.c: Avoid deadlock when trying to stop scheduler callbacks. We cannot hold the instance lock when trying to stop a scheduler callback. * res_rtp_asterisk.c: Remove the lock in struct dtls_details and use the struct ast_rtp_instance ao2 object lock instead. The lock was used to synchronize two threads to prevent a race condition between starting and stopping a timeout timer. The race condition is no longer present between dtls_perform_handshake() and __rtp_recvfrom() because the instance lock prevents these functions from overlapping each other with regards to the timeout timer. * res_rtp_asterisk.c: Remove the lock in struct ast_rtp and use the struct ast_rtp_instance ao2 object lock instead. The lock was used to synchronize two threads using a condition signal to know when TURN negotiations complete. * res_rtp_asterisk.c: Avoid deadlock when trying to stop the TURN ioqueue_worker_thread(). We cannot hold the instance lock when trying to create or shut down the worker thread without a risk of deadlock. This patch exposed a race condition between a PJSIP serializer thread setting up an ICE session in ice_create() and another thread reading RTP packets. * res_rtp_asterisk.c:ice_create(): Set the new rtp->ice pointer after we have re-locked the RTP instance to prevent the other thread from trying to process ICE packets on an incomplete ICE session setup. A similar race condition is between a PJSIP serializer thread resetting up an ICE session in ice_create() and the timer_worker_thread() processing the completion of the previous ICE session. * res_rtp_asterisk.c:ast_rtp_on_ice_complete(): Protect against an uninitialized/null remote_address after calling update_address_with_ice_candidate(). * res_rtp_asterisk.c: Eliminate the chance of ice_reset_session() destroying and setting the rtp->ice pointer to NULL while other threads are using it by adding an ao2 wrapper around the PJPROJECT ice pointer. Now when we have to unlock the RTP instance object to call a PJPROJECT ICE function we will hold a ref to the wrapper. Also added some rtp->ice NULL checks after we relock the RTP instance and have to do something with the ICE structure. ASTERISK-26835 #close ASTERISK-26853 #close Change-Id: I780b39ec935dcefcce880d50c1a7261744f1d1b4 2017-04-19 08:39 +0000 [b8b3380944] Sean Bright * build: Update config.guess and config.sub Change-Id: Id078a1df07a771808775e1053cdfe1d99c8fb172 2017-04-14 13:52 +0000 [6c0ab9afa7] Sean Bright * format_wav: Read 16khz wav samples properly When opening a PCM wave file for reading, we aren't tracking the frequency of the opened file, so we treat 16khz files as 8khz and do half reads. This patch also cleans up some of the data types and an unnecessarily complex `if` expression. ASTERISK-26613 #close Reported by: Vitaly K Change-Id: I05f8b263058dc573ea8ffe0c62e7964506e11815 2017-04-16 19:59 +0000 [b55d21ad91] George Joseph * make ari-stubs so doc periodic jobs can run The periodic doc job does a make ari-stubs and checks that there are no changes before generating the docs. Since I changed the mustache template (and the generated code directly) recently and forgot to regenerate the stubs, the doc job thinks they're out of date. Change-Id: I94b97035311eccf52b0101b8590223265a7881d4 2017-04-14 12:51 +0000 [4fb9f5d60e] Sean Bright * format_ogg_vorbis: Clear ogg/vorbis data structures on close On filestream close, we need to clear out the ogg & vorbis data structures to prevent a memory leak. ASTERISK-26169 #close Reported by: Ivan Myalkin Change-Id: Iee94c5a5d5bdafbf8b181c5c064d15d90ace8274 2017-04-14 17:32 +0000 [a3e623dd70] Richard Mudgett * Revert "bridging: Ensure successful T.38 negotation" This reverts commit 7819f95791fe0ca0e0cdc417e2687a5900444053. Change-Id: Ib91a7e6c9856f5f41329e42f40ba2394fee861a4 2017-04-14 16:50 +0000 [f6600f2c2e] Sean Bright * res_stun_monitor: Don't fail to load if DNS resolution fails res_stun_monitor will fail to load if DNS resolution of the STUN server fails. Instead, we continue without the STUN server being resolved and we will re-attempt the resolution on the STUN refresh interval. ASTERISK-21856 #close Reported by: Jeremy Kister Change-Id: I6334c54a1cc798f8a836b4b47948e0bb4ef59254 2017-04-14 14:36 +0000 [be71be7ed2] Roman S. * format_pcm: Track actual header size of .au files Sun's Au file format has a minimum data offset 24 bytes, but this offset is encoded in each .au file. Instead of assuming the minimum, read the actual value and store it for later use. ASTERISK-20984 #close Reported by: Roman S. Patches: asterisk-1.8.20.0-au-clicks-2.diff (license #6474) patch uploaded by Roman S. Change-Id: I524022fb19ff2fd5af2cc2d669d27a780ab2057c 2017-04-12 07:50 +0000 [2e6075c51f] George Joseph * modules: change module LOAD_FAILUREs to LOAD_DECLINES (master) Change-Id: Iac40ecb20e10513d67bf0eaf61807f306067b258 2017-04-10 05:13 +0000 [72c5f3b0ba] Alexander Traud * res_pjsip_sdp_rtp: No rtpmap for static RTP payload IDs in SDP. This saves around 100 bytes when G.711, G.722, G.729, and GSM are advertised in SDP. This reduces the chance to hit the MTU bearer of 1300 bytes for SIP over UDP, if many codecs are allowed in Asterisk. This new feature is enabled together with the optional feature compact_headers=yes via the file pjsip.conf. ASTERISK-26932 #close Change-Id: Iaa556ab4c8325cd34c334387ab2847fab07b1689 2017-04-12 07:47 +0000 [6db0939b96] George Joseph * modules: change module LOAD_FAILUREs to LOAD_DECLINES (14) Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e 2017-04-11 11:07 +0000 [747beb1ed1] George Joseph * modules: change module LOAD_FAILUREs to LOAD_DECLINES In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25 2017-04-05 06:41 +0000 [7819f95791] Torrey Searle * bridging: Ensure successful T.38 negotation When a T.38 happens immediatly after call establishment, the control frame can be lost because the other leg is not yet in the bridge. This patch detects this case an makes sure T.38 negotation happens when the 2nd leg is being made compatible with the negotating first leg ASTERISK-26923 #close Change-Id: If334125ee61ed63550d242fc9efe7987e37e1d94 2017-04-07 08:58 +0000 [7901225261] Torrey Searle * strings.h: Avoid overflows in the string hash functions On 2's compliment machines abs(INT_MIN) behavior is undefined and results in a negative value still being returnd. This results in negative hash codes that can result in crashes. ASTERISK-26528 #close Change-Id: Idff550145ca2133792a61a2e212b4a3e82c6517b 2017-04-07 16:14 +0000 [7312cbe803] Richard Mudgett * res_rtp_asterisk.c: Add stun_blacklist option Added the stun_blacklist option to rtp.conf. Some multihomed servers have IP interfaces that cannot reach the STUN server specified by stunaddr. Blacklist those interface subnets from trying to send a STUN packet to find the external IP address. Attempting to send the STUN packet needlessly delays processing incoming and outgoing SIP INVITEs because we will wait for a response that can never come until we give up on the response. Multiple subnets may be listed. ASTERISK-26890 #close Change-Id: I3ff4f729e787f00c3e6e670fe6435acce38be342 2017-04-06 17:31 +0000 [7c37365f03] Richard Mudgett * stun.c: Fix ast_stun_request() erratic timeout. If ast_stun_request() receives packets other than a STUN response then we could conceivably never exit if we continue to receive packets with less than three seconds between them. * Fix poll timeout to keep track of the time when we sent the STUN request. We will now send a STUN request every three seconds regardless of how many other packets we receive while waiting for a response until we have completed three STUN request transmission cycles. Change-Id: Ib606cb08585e06eb50877f67b8d3bd385a85c266 2017-04-06 18:30 +0000 [8d323c74fa] Richard Mudgett * sorcery.c: Speed up ast_sorcery_retrieve_by_id() Return early if ast_sorcery_retrieve_by_id() is not passed an id to find. Also eliminated the RAII_VAR() usage in the function. Change-Id: I871dbe162a301b5ced8b4393cec27180c7c6b218 2017-04-10 11:30 +0000 [5b4e2ec267] Richard Mudgett * res_pjsip: Fix pointer use after unref. Change-Id: I4b6e1b0070563eeaee223cb58326f1b962ed5bc1 2017-04-06 18:18 +0000 [6f793ac149] Richard Mudgett * res_pjsip_sdp_rtp.c: Don't use deprecated transport struct member. * create_rtp(): Eliminate use of deprecated transport struct member. That member and several others in the transport structure were deprecated because of an infinite loop created when using realtime configuration. See 2451d4e4550336197ee2e482750cc53f30afa352 ASTERISK-26851 Change-Id: I0533aa13c9ce3c6cc394e0fd2b5bf1cd1b2ef3bc 2017-04-10 17:45 +0000 [d76bc0565c] Richard Mudgett * tcptls.c: Cleanup TCP/TLS listener thread on abnormal exit. Temporarily running out of file descriptors should not terminate the listener thread. Otherwise, when there becomes more file descriptors available, nothing is listening. * Added EMFILE exception to abnormal thread exit. * Added an abnormal TCP/TLS listener exit error message. * Closed the TCP/TLS listener socket on abnormal exit so Asterisk does not appear dead if something tries to connect to the socket. ASTERISK-26903 #close Change-Id: I10f2f784065136277f271159f0925927194581b5 2017-04-08 03:05 +0000 [2b8dbc9e00] Walter Doekes * samples: Undo removal of include from canonicalize-app-names commit. This include was accidentally removed in changeset Ia79aea64de89531362e993e34230c2044a70aa93. My bad. Change-Id: I1d716c7f9590b4e97909fb8bca1f2ed9bd0e4082 2017-04-07 08:35 +0000 [270b485f04] Joshua Colp * pjsip: Add Alembic for PUBLISH support. This change adds database tables for the PUBLISH support so it can be configured using realtime. A minor fix to the res_pjsip_publish_asterisk module was done so that it read the sorcery configuration from the correct section. Finally the sample configuration files have been updated. ASTERISK-26928 Change-Id: I81991ae5c75af98d247f7eacd1c0b0a763675952 2017-04-07 08:06 +0000 [7a46cd7433] Alexander Traud * pjproject_bundled: Crash on pj_ssl_get_info() while ioqueue_on_read_complete(). When the Asterisk channel driver res_pjsip offers SIP-over-TLS, sometimes, not reproducible, Asterisk crashed in pj_ssl_sock_get_info() because a NULL pointer was read. This change avoids this crash. ASTERISK-26927 #close Change-Id: I24a6011b44d1426d159742ff4421cf806a52938b 2017-04-05 09:10 +0000 [e6ae3651b8] Walter Doekes * samples: Canonicalize app names in extensions.conf.sample. This takes care of warnings by ossobv/asterisklint. Change-Id: Ia79aea64de89531362e993e34230c2044a70aa93 2017-04-04 16:20 +0000 [01e9eaf3a6] George Joseph * pjproject_bundled: Add 3 upstream patches 0035-r5572-svn-backport-dialog-transaction-deadlock.patch 0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch 0037-r5576-svn-backport-session-timer-crash.patch Also removed the progress bar from wget download to stdout. ASTERISK-26905 #close Reported-by: Ross Beer Change-Id: I268fb3cf71a3bb24283ff0d24bd8b03239d81256 2017-04-04 11:44 +0000 [fac5115c43] Troy Bowman * app_queue: Log reason for PAUSEALL/UNPAUSEALL We needed the reason for our reporting when agents pause/unpause all of their queues at once. This is a small, simple patch that adds a reason for PAUSEALL and UNPAUSEALL. I have been using it in production for years. ASTERISK-26920 #close Change-Id: Ifb3f0d1a0abd5194253d9794023546e1395baf3d 2017-04-05 14:50 +0000 [40e9d5e8b7] George Joseph * sample_config: Add samples for pubsub to pjsip.conf.sample Added: * outbound-publish * resource_list * inbound-publication * asterisk-publication Change-Id: I65043a896c35483f30a92d30b5b118359af7ba5a 2017-04-03 15:38 +0000 [f2ee8ac21e] Richard Mudgett * res_pjsip_sdp_rtp.c: Don't alter global addr variable. * create_rtp(): Fix unexpected alteration of global address_rtp if a transport is bound to an address. * create_rtp(): Fix use of uninitialized memory if the endpoint RTP media address is invalid or the transport has an invalid address. ASTERISK-26851 Change-Id: Icde42e65164a88913cb5c2601b285eebcff397b7 2017-03-27 09:03 +0000 [380973cc47] Corey Farrell * CDR: Protect from data overflow in ast_cdr_setuserfield. ast_cdr_setuserfield wrote to a fixed length field using strcpy. This could result in a buffer overrun when called from chan_sip or func_cdr. This patch adds a maximum bytes written to the field by using ast_copy_string instead. ASTERISK-26897 #close patches: 0001-CDR-Protect-from-data-overflow-in-ast_cdr_setuserfie.patch submitted by Corey Farrell (license #5909) Change-Id: Ib23ca77e9b9e2803a450e1206af45df2d2fdf65c 2017-03-25 19:01 +0000 [6c3ae397cb] Daniel Journo * Unused realtime MOH classes not purged on 'moh reload' Purge Realtime MOH classes on 'moh reload' even when musiconhold.conf hasn't changed. ASTERISK-25974 #close Change-Id: I42c78ea76528473a656f204595956c9eedcf3246 2017-03-31 12:09 +0000 [8e36064109] Corey Farrell * core: Improve/simplify handling of required headers. * Report failures if configure finds a required header is missing. * Deduplicate includes between asterisk.h, astmm.h and compat.h. * Unconditionally include headers in compat.h if required elsewhere. Change-Id: Ie67d0185ca71fbfb81c9bdfaebe46a49e3c56dc5 2017-04-03 13:56 +0000 [a889621b14] Richard Mudgett * res_pjsip: Fix transport ref leak. We were leaking a transport ref in multihomed_on_rx_message() which resulted in the FRACK about excessive ref counts. ASTERISK-26916 #close Change-Id: I7a96658a9614a060565bb9ad51cb1c9c11ee145f 2017-04-03 02:30 +0000 [4fc22c7673] Alexander Traud * chan_sip: Session Timers required but refused wrongly. SIP user-agents indicate which protocol extensions are allowed in headers like Supported and Required. Such protocol extensions are Session Timers (RFC 4028) for example. Session Timers are supported since Mantis-10665. Since ASTERISK-21721, not only the first but multiple Supported/Required headers in a message are parsed. In that change, an existing variable was re-used within a newly added do-loop. Currently, at the end of that loop, that variable is an empty string always. Previously, that variable was used within log output. However, the log output was not changed. ASTERISK-26915 #close Change-Id: I09315f31b4d78fb214bb2a9fb6c0f5e143eae990 2017-03-31 16:31 +0000 [48be02c5d8] Joshua Colp * res_pjsip_session: Allow BYE to be sent on disconnected session. It is perfectly acceptable for a BYE to be sent on a disconnected session. This occurs when we respond to a challenge to the BYE for authentication credentials. ASTERISK-26363 Change-Id: I6ef0ddece812fea6665a1dd2549ef44fb9d90045 2017-03-31 13:14 +0000 [e8b1bb3041] Richard Mudgett * chan_vpb.cc: Fix compiler error. Added missing channel technology read/write stream callback initialization. Change-Id: I829043a327d987e0d964485dd3d27964bebbd623 2017-03-30 18:28 +0000 [f9695dc057] Corey Farrell * Forward declare 'struct ast_json' in asterisk.h The ast_json structure is used in many Asterisk headers and is often the only part of json.h used. This adds a forward declaration to asterisk.h and removes the include of json.h from many headers. The declaration has been left in endpoints.h and stasis.h to avoid problems with source files that use ast_json functions without directly including json.h. ari.h continues to include json.h as it uses enum ast_json_encoding_format. Change-Id: Id766aabce6bed56626d27e8d29f559b5e687b769 2017-03-30 08:11 +0000 [c537f99488] Sean Bright * cdr_pgsql: Fix buffer overflow calling libpq Implement the same buffer size checking done in cel_pgsql. ASTERISK-26896 #close Reported by: twisted Change-Id: Iaacfa1f1de7cb1e9414d121850d2d8c2888f3f48 2017-03-28 13:01 +0000 [a7d94f504f] Walter Doekes * build: Fix deb build issues with fakeroot If DESTDIR is set, don't call ldconfig. Assume that DESTDIR is used to create a binary archive. The ldconfig call should be delegated to the archive postinst script. This fixes the case where fakeroot wraps 'make install' causing $EUID to be 0 even though it doesn't have permission to call ldconfig. The previous logic in configure.ac to detect and correct libdir has been removed as it was not completely accurate. CentOS 64-bit users should again specifiy --libdir=/usr/lib64 when configuring to prevent install to /usr/lib. Updated Makefile:check-old-libdir to check for orphans in lib64 when installing to lib as well as orphans in lib when installing to lib64. Updated Makefile and main/Makefile uninstall targets to remove the orphans using the new logic. ASTERISK-26705 Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51 2017-03-27 15:32 +0000 [f3290d6b66] Joshua Colp * sdp: Add support for setting connection address and clean up state. This change cleans up state management for media streams by moving RTP instances into their own session structure and adding additional details that are not relevant to the core (such as connection address). These can live either in the local capabilities or joint capabilities. The ability to set explicit connection address information for the purposes of direct media and NAT has also been added at the global and stream specific level. ASTERISK-26900 Change-Id: If7e5307239a9534420732de11c451a2705b6b681 2017-03-29 10:11 +0000 [5c1ea3ebbd] Sean Bright * astobj2: Prevent potential deadlocks with ao2_global_obj_release The ao2_global_obj_release() function holds an exclusive lock on the global object while it is being dereferenced. Any destructors that run during this time that call ao2_global_obj_ref() will deadlock because a read lock is required. Instead, we make the global object inaccessible inside of the write lock and only dereference it once we have released the lock. This allows the affected destructors to fail gracefully. While this doesn't completely solve the referenced issue (the error message about not being able to create an IQ continues to be shown) it does solve the backtrace spew that accompanied it. ASTERISK-21009 #close Reported by: Marcello Ceschia Change-Id: Idf40ae136b5070dba22cb576ea8414fbc9939385 2017-03-30 10:18 +0000 [4e5cc70fb4] Corey Farrell * CEL: Remove header declarations of non-existant functions. ast_cel_alloc and ast_cel_destroy do not exist in code, remove them from the headers. Change-Id: I99ce848e2e109e7d61771559f559b9e57973e45c 2017-03-27 11:49 +0000 [f66edcb8b0] Josh Roberson * cel_pgsql.c: Fix buffer overflow calling libpq PQEscapeStringConn() expects the buffer passed in to be an adequitely sized buffer to write out the escaped SQL value string into. It is possible, for large values (such as large values to Dial with a lot of devices) to have more than our 512+1 byte allocation and thus cause libpq to create a buffer overrun. glibc will nicely ABRT asterisk for you, citing a stack smash. Let's only allocate it to be as large as needed: If we have a value, then (strlen(value) * 2) + 1 (as recommended by libpq), and if we have none, just one byte to hold our null will do. ASTERISK-26896 #close Change-Id: If611c734292618ed68dde17816d09dd16667dea2 2017-03-29 08:04 +0000 [e76cc51d5e] Alexander Traud * srtp: Allow zero as tag value for a sRTP Crypto Suite. ASTERISK-25490 #close Change-Id: I1c5fc0942c33c96d62b24203aad0f1e1a1a0131f 2017-03-28 13:10 +0000 [2fe52174de] George Joseph * res_pjsip_config_wizard: Add 2 new parameters to help with proxy config Two new parameters have been added to the pjsip config wizard. * Setting 'sends_line_with_registrations' to true will cause the wizard to skip the creation of an identify object to match incoming request to the endpoint and instead add the line and endpoint parameters to the outbound registration object. * Setting 'outbound_proxy' is a shortcut for adding individual endpoint/outbound_proxy, aor/outbound_proxy and registration/outbound_proxy parameters. Change-Id: I678e5f80765734c056620528a6d40d82736ceeb0 (cherry picked from commit a827892ff77cd37912b528d9c45b446be091bbc0) (cherry picked from commit 27344675be1941d30508c6e6bd684acdd0791e1a) 2017-03-28 09:29 +0000 [7c0b12dc41] Sean Bright * alembic: Turn off execute bit on non-executable python scripts Change-Id: I744c986da4a38aeff8c00837eb89de7841fbc86c 2017-03-27 12:37 +0000 [3d8899bacf] Richard Mudgett * Add DTLS sanity check. Change-Id: Ib32612cf6c7ce9213a11b9cba82f630f8cd3564b 2017-03-08 07:24 +0000 [5d938045d4] Joshua Colp * channel: Remove old epoll support and fixed max number of file descriptors. This change removes the old epoll support which has not been used or maintained in quite some time. The fixed number of file descriptors on a channel has also been removed. File descriptors are now contained in a growable vector. This can be used like before by specifying a specific position to store a file descriptor at or using a new API call, ast_channel_fd_add, which adds a file descriptor to the channel and returns its position. Tests have been added which cover the growing behavior of the vector and the new API call. ASTERISK-26885 Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928 2017-03-27 09:35 +0000 [fd204d5c65] Sean Bright * res_musiconhold: Document the 'format' option ASTERISK-26086 #close Reported by: Jens Bürger Change-Id: I6aab666c0bf01fd0c64d7a5bcb22fa7f5d41335e 2017-03-24 07:43 +0000 [cf6a6226ab] Sean Bright * core: Remove embedded module support This has not worked for some time and is no longer actively maintained. Change-Id: I5110b0db69c152761b58fa025cb0a53b0e544d99 2017-03-27 08:58 +0000 [d22c678999] Sean Bright * res_musiconhold: Don't chdir() when scanning MoH files There doesn't appear to be any reason that we are chdir'ing in moh_scan_files, and in the event of an Asterisk crash, the core files may not get written because we have changed into a read-only directory. ASTERISK-23996 #close Reported by: Walter Doekes Change-Id: Iac806dce01b3335963fbd62d4b4da9a65c614354 2017-03-23 09:48 +0000 [d5a8799c4b] Sean Bright * res_xmpp: Use incremental backoff when a read error occurs If a read error occurs, we immediately attempt a reconnect without any delay. Instead, let's sleep and backoff up to 60 seconds before we try again. ASTERISK-24712 #close Reported by: Matthias Urlichs Change-Id: I6fe10ef4734837727437beab715e336777f13f48 2017-03-24 11:29 +0000 [d08c69a9e2] Sean Bright * res_pjsip_sdp_rtp: Set hangup cause for RTP timeouts chan_sip sets the hangup cause code to AST_CAUSE_REQUESTED_CHAN_UNAVAIL (44) when a channel is hung up due to an RTP timeout. So do the same when it happens with PJSIP for parity. Change-Id: I3546ebbde6460c22a27c9da1bf321711b5961ab8 2017-03-23 14:01 +0000 [d2f2cdf476] Kevin Harwell * AMI: Updated version Updated the AMI version for the following reason (see CHANGES for more details): The 'PJSIPShowEndpoint' command's response event of 'IdentifyDetail' now contains a new optional parameter, 'MatchHeader'. Change-Id: Ie206913ef1dcfa6a2ebe3282da2387e52d6f05b9 2017-03-23 12:07 +0000 [12dde3b568] Kevin Harwell * pjproject_bundled: raise timeout value used when downloading After configuring Asterisk with '--with-pjproject-bundled' the configure/build process attempts to download pjproject from its download site. Currently, a timeout of 10 seconds is used that will stop the download process if pjproject has not been fully downloaded in that time. For some systems this was not enough time and the process was timing out too early. This patch raises the download timeout value to '60'. Also, this patch fixes another bug where the DOWNLOAD_TIMEOUT variable was not being properly exported due to a naming error. DOWNLOAD_MAX_TIMEOUT is now properly renamed to DOWNLOAD_TIMEOUT. ASTERISK-26814 #close Change-Id: Ia56e4e8a3d39db76bc8a1852b2cf07ec10b39842 2017-03-22 20:33 +0000 [98a88e9ffa] Sean Bright * res_xmpp: Correct implementation of JABBER_STATUS & JabberStatus The documentation for JABBER_STATUS (and the deprecated JabberStatus app) indicate that a return value of 7 indicates that the specified buddy was not in the roster. It also indicates that you can specify a "bare" JID (one without a resource). Unfortunately the actual behavior does not match the documented behavior. Assuming that our roster includes the buddy online and available "valid@example.org/Valid" and does *not* include the buddy "invalid@example.org", the JABBER_STATUS() function returns the following before this patch: +------------------------------+------------+--------------------------+ | Buddy | Status | Result | +------------------------------+------------+--------------------------+ | valid@example.org | Online | 7 (Not in roster) | | valid@example.org/Valid | Online | 1 (Online) | | valid@example.org/Invalid | N/A | 7 (Not in roster) | | invalid@example.org | N/A | Error logged, no return | | invalid@example.org/Valid | N/A | Error logged, no return | +------------------------------+------------+--------------------------+ And after this patch: +------------------------------+------------+--------------------------+ | Buddy | Status | Result | +------------------------------+------------+--------------------------+ | valid@example.org | Online | 1 (Online) | | valid@example.org/Valid | Online | 1 (Online) | | valid@example.org/Invalid | N/A | 6 (Offline) | | invalid@example.org | N/A | 7 (Not in roster) | | invalid@example.org/Valid | N/A | 7 (Not in roster) | +------------------------------+------------+--------------------------+ This brings the behavior in line with the documentation. ASTERISK-23510 #close Reported by: Anthony Critelli Change-Id: I9c3241035363ef4a6bdc21fabfd8ffcd9ec657bf 2017-03-23 09:45 +0000 [be94105d6d] Sean Bright * res_xmpp: Try to provide useful errors messages from OpenSSL If any errors occur during the TLS connection setup, we currently dump a fairly generic error message. So instead we try to pull in something useful from OpenSSL to report instead. ASTERISK-24712 Reported by: Matthias Urlichs Change-Id: I288500991a9681f447d92913b11fedaf426087f4 2017-03-23 05:19 +0000 [ee81ee1f14] Sean Bright * res_xmpp: Fix ref counting issue The only remaining reference to the endpoint is in the endpoints container, and because it is unlinked in ast_endpoint_shutdown, we don't have to explicitly cleanup the endpoint ourselves. Change-Id: I912a2692e52d3e2ed445b32d8ae3f9004bc2f2e8 2017-03-23 09:30 +0000 [9493981419] Sean Bright * res_xmpp: Correctly check return value of SSL_connect SSL_connect returns non-zero for both success and some error conditions so simply negating is inadequate. Change-Id: Ifbf882896e598703b6c615407fa456d3199f95b1 2017-03-22 17:32 +0000 [7657c279b5] Sean Bright * res_xmpp: Don't crash when trying to send a message without a connection If we never establish a connection to our Jabber server, iksemel never sets up its internal transport pointer, so attempting to send a message dereferences a NULL pointer and causes a crash. ASTERISK-21855 #close Reported by: Jeremy Kister Change-Id: I204a568894e4a53ab929783ecc594a000f04d79c 2017-03-22 15:40 +0000 [0136ec12a3] Sean Bright * res_xmpp: Include client name in connection related error messages ASTERISK-25622 #close Reported by: Sean Darcy Change-Id: I8472cb7bfb58d411a3cfbd482da98cae2d94d1e9 2017-03-20 13:27 +0000 [9b103e7bea] Joshua C. Colp * rtp_engine: allocate RTP dynamic payloads per session Dynamic payload types were statically defined in Asterisk. This unfortunately limited the number of dynamic payloads that could be registered. With this patch dynamic payload type numbers are now assigned dynamically and per RTP instance. However, in order to limit any issues where some clients expect the old statically defined value this patch makes it so the value Asterisk used to pre- designate is used for the dynamic assignment if available. An option, "rtp_use_dynamic", has also been added (can be set in asterisk.conf) that turns the new dynamic behavior on or off. When off it reverts back to using statically defined payload values. This option defaults to "yes" in Asterisk 15. ASTERISK-26515 #close patches: ASTERISK-26515.diff submitted by jcolp (license 5000 Change-Id: I7653465c5ebeaf968f1a1cc8f3f4f5c4321da7fc 2017-03-21 12:32 +0000 [bb2936f3e4] Sebastian Gutierrez * cdr: Allow setting of user field from 'h' extension The CDR code previously did not allow the user field to be set from the 'h' extension in the dialplan. This change removes that limitation and allows it to be set. ASTERISK-26818 Change-Id: I0fed8a79b5e408bac4e30542b8f33a61c5ed9aa6 2017-03-14 16:45 +0000 [6b7697ed48] Richard Begg * res_pjsip_session: Enable RFC3578 overlap dialing support. Support for RFC3578 overlap dialling (i.e. 484 Response to partially matched destinations) as currently provided by chan_sip is missing from res_pjsip. This patch adds a new endpoint attribute (allow_overlap) [defaults to yes] which when set to yes enables 484 responses to partial destination matches rather than the current 404. ASTERISK-26864 Change-Id: Iea444da3ee7c7d4f1fde1d01d138a3d7b0fe40f6 2017-03-21 06:59 +0000 [d4fcf196a2] Sean Bright * res_hep: Capture actual transport type in use Rather than hard-coding UDP, allow consumers of the HEP API to specify which protocol is in use. Update the PJSIP provider to pass in the current protocol type. ASTERISK-26850 #close Change-Id: I54bbb0a001cfe4c6a87ad4b6f2014af233349978 2017-03-21 09:57 +0000 [1bf839d44b] Sean Bright * Revert "app_queue: Handle the caller being redirected out of a queue bridge" This reverts commit 163e9e53dc7d84dd42721e733b7706c8147bdd27. Change-Id: Ief28479c77a298879dfe2c56be7ee92dc465da4b 2017-03-21 08:26 +0000 [6b4b87787c] Sean Bright * res_pjsip_messaging: Check URI type before dereferencing We aren't validating that the URI we just parsed is a SIP/SIPS one before trying to access the user, host, and port members of a possibly uninitialized structure. Also update the MessageSend documentation to indicate what 'from' formats are accepted. ASTERISK-26484 #close Reported by: Vinod Dharashive Change-Id: I476b5cc5f18a7713d0ee945374f2a1c164857d30 2017-03-13 15:21 +0000 [65ad554c98] Joshua Elson * pjsip: prevent memory corruption on creation of xml bodies ASTERISK-26776 #close Change-Id: I884b6f4e8233a355d0be687ec78d41bc0e4d3fd2 2017-03-20 16:27 +0000 [fc794de756] Sean Bright * bridge_softmix: Ignore non-voice frames from translator Some codecs - codec_speex specifically - take voice frames and return other types of frames, like CNG. If we subsequently treat those as voice frames, we'll run into trouble when destroying the frame because of the requirement that each voice frame have an associated format. ASTERISK-26880 #close Reported by: Kirsty Tyerman Change-Id: I43f8450c48fb276ad8b99db8512be82949c1ca7c 2017-03-14 23:49 +0000 [25016a74f8] Aaron An * audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor. Fixed a bug in function "ast_audiohook_write_frame" that checked the variable other_factory_samples and only flushed the factories, so they would be in sync, when other_factory_samples > 0. When there is not any rtp incoming the variable other_factory_samples will be 0, and although the result of "our_factory_ms - other_factory_ms" may be very large, this led to the record file not syncing. ASTERISK-26875 #close Reported-by: Aaron An Tested-by: Aaron An Change-Id: Ia4d890fb8fc1636a7188502bab35f555685aea22 2017-03-18 12:30 +0000 [fc71c18a9b] Sean Bright * thread safety: Don't use getprotobyname() POSIX does not require getprotobyname() to be thread safe and some implementations use static memory which causes issues when multiple threads are used. Further, our usage of it today is just to ultimately get IPPROTO_TCP for calls to setsockopt(). So instead we just use IPPROTO_TCP directly. Change-Id: I2e14e58674808f7ce99b2f5e900d0f90d0d8da48 2017-03-19 13:26 +0000 [516e028b44] Sean Bright * res_rtp_asterisk: Pass correct data length to ast_rtcp_interpret We are currently passing in the capacity of the read buffer instead of the number of bytes that we actually read off the wire. Change-Id: I60465049727d955c7f9a5e529e6f2aaff04cda36 2017-03-14 09:27 +0000 [79069f8ccb] Robert Mordec * app_queue: Member stuck as pending after forwarding previous call from queue Queue member will get stuck in pending_members if queue calls a device that is different from the one observed for state changes. This patch removes members from pending_members as a result of channel stasis events such as blind or attended transfers and hangup. ASTERISK-26862 #close Change-Id: I8bf6df487b9bb35726c08049ff25cdad5e357727 2017-02-22 23:26 +0000 [8cb4f9cea1] Richard Mudgett * CHANNEL(callid): Give dialplan access to the callid. * Added CHANNEL(callid) to retrieve the call identifier log tag associated with the channel. Dialplan now has access to the call log search key associated with the channel so it can be saved in case there is a problem with the call. ASTERISK-26878 Change-Id: I2c97ebd928b6f3c5bc80c5729e4d3c07f453049f 2017-03-16 08:42 +0000 [c13ea6080e] Sean Bright * app_queue: Fix locking behavior in stasis message handlers The queue_stasis_data structure contains various mutable fields that require appropriate locking. Specifically, the 'dying,' 'member_uniqueid,' and 'caller_uniqueid' fields need to be locked when read from or written to. Change-Id: I246b7dbff8447acc957a1299f6ad0ebd0fd39088 2017-03-07 19:28 +0000 [15aa3c0a23] Sean Bright * chan_sip: Add rtcp-mux support ASTERISK-26846 #close Change-Id: I541a1602ff55ab73684e9f8002edb9e0e745d639 2017-03-16 16:50 +0000 [57656e2b5b] Richard Mudgett * app_confbridge: Fix ConfbridgeTalking AMI event description. Thanks to Chris Howard for pointing this out on the wiki. Change-Id: I18e56de09a70e736b5d04719d45ef29cf0636705 2017-03-16 16:37 +0000 [82982a191c] Richard Mudgett * res_pjsip_asterisk.c: Fix compile error if libsrtp is not installed. struct ast_rtcp does not define the dtls member if SRTP is not enabled. ASTERISK-26732 Change-Id: Id15ea212e04490e012f2cf4a56818b4dd948875e 2017-03-16 15:45 +0000 [49b1f1ca16] Richard Mudgett * res_pjsip_sdp_rtp.c: Fix cut-n-paste error We were inadvertenly referencing the cos_video option to determine if we should set the tos_audio and cos_audio value on the RTP instance. Change-Id: Ia7964f486801d39dc6f5dae570baff079e1595b0 2017-03-16 10:39 +0000 [e6dc28b78f] Matt Jordan * res/res_pjsip_session: Only check localnet if it is defined If local_net is not defined on a transport, transport_state->localnet will be NULL. ast_apply_ha will, be default, return AST_SENSE_ALLOW in this case, causing the external_media_address, if set, to be skipped. This patch causes us to only check if we are sending within a network if local_net is defined. ASTERISK-26879 #close Change-Id: Ib661c31a954cabc9c99f1f25c9c9a5c5b82cbbfb 2017-03-14 16:22 +0000 [44568fc712] Richard Begg * res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit transport Currently a wildcard address is used for the local RTP socket, which will not always result in the same address as used by the SIP socket (e.g. if explicit transport addresses are configured). Use the transport's host address when binding new local RTP sockets if available. ASTERISK-26851 Change-Id: I098c29c9d1f79a4f970d72ba894874ac75954f1a 2017-03-07 08:33 +0000 [5013d8f5d3] George Joseph * res_pjsip: Symmetric transports A new transport parameter 'symmetric_transport' has been added. When a request from a dynamic contact comes in on a transport with this option set to 'yes', the transport name will be saved and used for subsequent outgoing requests like OPTIONS, NOTIFY and INVITE. It's saved as a contact uri parameter named 'x-ast-txp' and will display with the contact uri in CLI, AMI, and ARI output. On the outgoing request, if a transport wasn't explicitly set on the endpoint AND the request URI is not a hostname, the saved transport will be used and the 'x-ast-txp' parameter stripped from the outgoing packet. * config_transport was modified to accept and store the new parameter. * config_transport/transport_apply was updated to store the transport name in the pjsip_transport->info field using the pjsip_transport->pool on UDP transports. * A 'multihomed_on_rx_message' function was added to pjsip_message_ip_updater that, for incoming requests, retrieves the transport name from pjsip_transport->info and retrieves the transport. If transport->symmetric_transport is set, an 'x-ast-txp' uri parameter containing the transport name is added to the incoming Contact header. * An 'ast_sip_get_transport_name' function was added to res_pjsip. It takes an ast_sip_endpoint and a pjsip_sip_uri and returns a transport name if endpoint->transport is set or if there's an 'x-ast-txp' parameter on the uri and the uri host is an ipv4 or ipv6 address. Otherwise it returns NULL. * An 'ast_sip_dlg_set_transport' function was added to res_pjsip which takes an ast_sip_endpoint, a pjsip_dialog, and an optional pjsip_tpselector. It calls ast_sip_get_transport_name() and if a non-NULL is returned, sets the selector and sets the transport on the dialog. If a selector was passed in, it's updated. * res_pjsip/ast_sip_create_dialog_uac and ast_sip_create_dialog_uas were modified to call ast_sip_dlg_set_transport() instead of their original logic. * res_pjsip/create_out_of_dialog_request was modified to call ast_sip_get_transport_name() and pjsip_tx_data_set_transport() instead of its original logic. * Existing transport logic was removed from endpt_send_request since that can only be called after a create_out_of_dialog_request. * res_pjsip/ast_sip_create_rdata was converted to a wrapper around a new 'ast_sip_create_rdata_with_contact' function which allows a contact_uri to be specified in addition to the existing parameters. (See below) * res_pjsip_pubsub/internal_pjsip_evsub_send_request was eliminated since all it did was transport selection and that is now done in ast_sip_create_dialog_uac and ast_sip_create_dialog_uas. * 'contact_uri' was added to subscription_persistence. This was necessary because although the parsed rdata contact header has the x-ast-txp parameter added (if appropriate), subscription_persistence_update stores the raw packet which doesn't have it. subscription_persistence_recreate was then updated to call ast_sip_create_rdata_with_contact with the persisted contact_uri so the recreated subscription has the correct transport info to send the NOTIFYs. * res_pjsip_session/internal_pjsip_inv_send_msg was eliminated since all it did was transport selection and that is now done in ast_sip_create_dialog_uac. * pjsip_message_ip_updater/multihomed_on_tx_message was updated to remove all traces of the x-ast-txp parameter from the outgoing headers. NOTE: This change does NOT modify the behavior of permanent contacts specified on an aor. To do so would require that the permanent contact's contact uri be updated with the x-ast-txp parameter and the aor sorcery object updated. If we need to persue this, we need to think about cloning permanent contacts into the same store as the dynamic ones on an aor load so they can be updated without disturbing the originally configured value. You CAN add the x-ast-txp parameter to a permanent contact's uri but it would be much simpler to just set endpoint->transport. Change-Id: I4ee1f51473da32ca54b877cd158523efcef9655f 2017-03-16 09:07 +0000 [68749a9fa7] Joshua Colp * res_rtp_asterisk: Fix crash when RTCP is not present when DTLS is stopped. This change removes an assumption that when DTLS is stopped an RTCP session will be present on the RTP session. This is not always the case. ASTERISK-26732 Change-Id: Ib9f7c09ce0b005efe362dbcc8795202b18f94611 2017-03-15 13:24 +0000 [c87e7dd9ec] Richard Mudgett * autochan/mixmonitor/chanspy: Fix unsafe channel locking and references. Dereferencing struct ast_autochan.chan without first calling ast_autochan_channel_lock() is unsafe because the pointer could change at any time due to a masquerade. Unfortunately, ast_autochan_channel_lock() itself uses struct ast_autochan.chan unsafely and can result in a deadlock if the original channel happens to get destroyed after a masquerade in addition to the pointer getting changed. The problem is more likely to happen with v11 and earlier because masquerades are used to optimize out local channels on those versions. However, it could still happen on newer versions if the channel is executing a dialplan application when the channel is transferred or redirected. In this situation a masquerade still must be used. * Added a lock to struct ast_autochan to safely be able to use ast_autochan.chan while trying to get the channel lock in ast_autochan_channel_lock(). The locking order is the channel lock then the autochan lock. Locking in the other direction requires deadlock avoidance. * Fix unsafe ast_autochan.chan usages in app_mixmonitor.c. * Fix unsafe ast_autochan.chan usages in app_chanspy.c. * app_chanspy.c: Removed unused autochan parameter from next_channel(). ASTERISK-26867 Change-Id: Id29dd22bc0f369b44e23ca423d2f3657187cc592 2017-03-07 14:13 +0000 [10fa49e327] Mark Michelson * Add rtcp-mux support This commit adds support for RFC 5761: Multiplexing RTP Data and Control Packets on a Single Port. Specifically, it enables the feature when using chan_pjsip. A new option, "rtcp_mux" has been added to endpoint configuration in pjsip.conf. If set, then Asterisk will attempt to use rtcp-mux with whatever it communicates with. Asterisk follows the rules set forth in RFC 5761 with regards to falling back to standard RTCP behavior if the far end does not indicate support for rtcp-mux. The lion's share of the changes in this commit are in res_rtp_asterisk.c. This is because it was pretty much hard wired to have an RTP and an RTCP transport. The strategy used here is that when rtcp-mux is enabled, the current RTCP transport and its trappings (such as DTLS SSL session) are freed, and the RTCP session instead just mooches off the RTP session. This leads to a lot of specialized if statements throughout. ASTERISK-26732 #close Reported by Dan Jenkins Change-Id: If46a93ba1282418d2803e3fd7869374da8b77ab5 2017-03-14 08:49 +0000 [dc4cdafd42] Torrey Searle * res/res_pjsip_refer: call xfer w/o extension When transfering to a URI without an extension, ensure that the s extension of the dialplan is entered ASTERISK-26869 #close Change-Id: I07403df66cf93f09e00a40ab5b41bfc6f72b1525 2017-03-09 11:05 +0000 [982d6173c5] Sean Bright * app_queue: Handle the caller being redirected out of a queue bridge A caller can leave the Queue() application after being bridged with a member in a few ways: * Caller or member hangup * Caller is transferred somewhere else (blind or atx) * Caller is externally redirected elsewhere The first 2 scenarios are currently handled by subscribing to stasis messages, but the 3rd is not explicitly covered. If a caller is redirected away from the Queue() application, the member who was last bridged with that caller will remain in an "In use" state until the caller hangs up. This patch adds handling of the caller leaving the queue via redirection. We monitor the caller-member bridge, and if the caller is the one that leaves, we treat it the same as we would a caller hangup. ASTERISK-26400 #close Reported by: Etienne Lessard Change-Id: Iba160907770de5a6c9efeffc9df5a13e9ea75334 2017-03-15 08:44 +0000 [0b8a57af6d] Joshua Colp * res_pjsip_endpoint_identifier_ip: Don't output error if no header_match. This change ensures that if no header_match option is set on an identify an error message is not output stating the option is set to an invalid value. ASTERISK-26863 Change-Id: I239bc6d2319dd3da24ba96a38d4d6e9b5526d62a 2017-03-14 07:50 +0000 [1475604eff] Matt Jordan * res_pjsip_endpoint_identifier_ip: Add an option to match requests by header This patch adds a new features to the endpoint identifier module, 'match_header'. When set, inbound requests are matched by a provided SIP header: value pair. This option works in conjunction with the existing 'match' configuration option, such that if any 'match*' attribute matches an inbound request, the request is associated with the specified endpoint. Since this module now identifies by more than just IP address, appropriate renaming of the module and/or variables can be done in a non-release branch. ASTERISK-26863 #close Change-Id: Icfc14835c962f92e35e67bbdb235cf0589de5453 (cherry picked from commit 30f52d79d7fc9ab0b628bef2b61ea515413795a2) 2017-03-14 16:16 +0000 [f997090877] Richard Mudgett * pbx.c: Fix crash from malformed exten pattern. Forgetting to indicate an exten is a pattern can cause a crash if the "pattern" has a character set range. e.g., "9999[3-5]" The crash is due to a buffer overwrite because the '-' exten eye-candy wasn't removed as expected and overran the allocated space. The buffer overwrite is fixed two ways in this patch. 1) Fix ext_strncpy() to distinguish between pattern and non-pattern extens. Now '-' characters are removed when they are eye-candy and not when they are part of a pattern character set. Since the function is private to pbx.c, the return value now returns the number of bytes written to the destination buffer instead of the strlen() of the final buffer so the callers that care don't need to add one. 2) Fix callers to ext_strncpy() to supply the correct available buffer size of the destination buffer. ASTERISK-26668 Change-Id: I555d97411140e47e0522684062d174fbe32aa84a 2017-03-14 16:51 +0000 [0dc007e94d] Richard Begg * chan_iax2: Reload of iax peer results in loss of host address/port When using a non-dynamic peer address, build_peer() invalidates the peer address structure by setting the address family to unspecified. However, if dnsmgr is enabled, the subsequent call to ast_dnsmgr_lookup() will not amend the peer address if the cache is still valid, resulting in peer connectivity failures. To fix this, we call ast_dnsmgr_refresh() instead. ASTERISK-26865 Change-Id: Id8a89a2f771ebbaf32255a35fe596a6dcb97a082 2017-03-14 15:12 +0000 [59130260e7] Matt Jordan * configure: Don't use the progress bar with curl when downloading to stdout In some scenarios, such as when there may not be a terminal (such as inside a Docker container), curl will apparently direct the progress bar to stdout. This can cause extra data to be appended to a file curl'd down to stdout, resulting in md5 verification failures. This patch removes the progress bar, and tells curl to download the file silently. ASTERISK-26872 #close Change-Id: Ie860b020f627d4372b3e7ce9453de5faafeebe6c 2017-03-02 17:11 +0000 [8470c2bdea] George Joseph * RFC sdp: Initial SDP creation * Added additional fields to ast_sdp_options. * Re-organized ast_sdp. * Updated field names to correspond to RFC4566 terminology. * Created allocs/frees for SDP children. * Created getters/setters for SDP children where appropriate. * Added ast_sdp_create_from_state. * Refactored res_sdp_translator_pjmedia for changes. Change-Id: Iefbd877af7f5a4d3c74deead1bff8802661b0d48 2017-03-14 09:55 +0000 [05713c36ea] Matt Jordan * configs/samples/hep.conf.sample: Clarify how the HEP stack works This patch updates the documenation in hep.conf.sample to better specify how the various HEP modules interact. ASTERISK-26717 #close Change-Id: I337fb742a89e3ec5edc7fc7a7a0295218d841124 2017-03-14 09:59 +0000 [0ded269bfa] Roman Bedros (License 6842) * funcs/func_devstate: Remove new line in Device field of during module load During module loading of func_devstate, Asterisk emits the current device state of all Custom device states currently stored in the AstDB. This was erroneously including a new line character ('\n') to the end of the device state, causing two new lines to be emitted in DeviceStateChange AMI events. Note that this only happened for those device state changes that occurred during startup. Regular device state changes for Custom device states are handled elsewhere, and did not have the newline. ASTERISK-26643 #close Reported by: Roman Bedros Tested by: Matt Jordan patches: ami_devstate.diff uploaded by Roman Bedros (License 6842) Change-Id: I1f4c02fc79c448d43bf725f5039c83d9611d7d93 2017-03-14 09:37 +0000 [b03b72717f] Matt Jordan * main/stasis_cache: Demote the ERROR message when removing a nonexistent item This patch demotes the ERROR message that is displayed when a nonexistent item is removed from the Stasis cache. The genesis of this demotion is due to chan_sip's realtime peers and their interaction with Asterisk's core ast_endpoint code, but ostensibly it could happen from other channel drivers as well. Since Mark Michelson already did an excellent job of explaining on this issue, it is quoted here for posterity: "Internally, when a realtime peer is retrieved, Asterisk creates an ast_endpoint structure. When that peer is destroyed, the ast_endpoint is destroyed as well. Part of the destruction of the ast_endpoint involves clearing the Stasis cache of all information about that endpoint. The problem here is that the act of creating the ast_endpoint is not enough to actually put any information in the Stasis cache. Instead, something has to happen, such as a state change, in order for the Stasis cache to have any information about that endpoint. When a device registers, chan_sip creates an ast_endpoint structure, processes the REGISTER, and then destroys the ast_endpoint. When the ast_endpoint is destroyed, there is nothing to destroy in the Stasis cache, so an error message is emitted. When you use rtcachefriends, ast_endpoint structures persist for the lifetime of the module and so you do not see this error message." ASTERISK-25237 #close Change-Id: I53cebc6b4a897a1ab9564182b75c177780feff70 2017-03-08 12:39 +0000 [2d7e68c075] Matt Jordan * res_pjsip_endpoint_identifier_ip: Clean up a spaces/tabs issue Tabs > spaces. Always. Change-Id: I899ff662361c7ab0327173bd7851a67b53dd65f1 2017-03-12 09:21 +0000 [12460b05c1] Joshua Colp * chan_pjsip: Don't assume a session will have a channel. When querying for PJSIP specific information using the dialplan function CHANNEL() it is possible that the underlying session will no longer have a channel associated with it. This is most likely to occur when the RTCP HEP module attempts to get the channel name. If this happens then a crash will occur. This change just adds a check that the channel exists on the session before querying it. ASTERISK-26857 Change-Id: I113479cffff6ae64cf8ed089e9e1565223426f01 2017-03-10 20:29 +0000 [d1ef127084] George Joseph * pjproject_bundled: Reduce the need for rebuilds Bundled pjproject should now only rebuild if one of the menuselect "Compiler Flags" options changes. Change-Id: If114a2e16b9e77af371a600d6a5e197bbf28fe43 2017-03-05 15:26 +0000 [36fed72614] Daniel Journo * pjsip/cli_commands: pjsip show channelstats shows wrong codec * cli_commands.c Fixed CLI output ASTERISK-26822 #close Change-Id: I3889ef6a8f6738fc312fab42db5efacd6e452b01 2017-03-08 14:29 +0000 [b14724adb3] Daniel Journo * res_musiconhold: moh general section is a class and issues warning * res_musiconhold.c: Ensure the general section is not treated as a moh class. ASTERISK-26353 #close Change-Id: Ia3dbd11ea2b43ab3e6c820a9827811dd24bea82d 2017-03-08 17:08 +0000 [35cfd2c0cc] Sean Bright * media_cache: Prefer ast_file_is_readable() over access() Change-Id: Icc0dc6e61b2e68d5cdcb74b016b2726a388c7def 2017-03-07 06:25 +0000 [bc2c66b594] Sean Bright * pbx_spool: Set AST_OUTGOING_ATTEMPT variable on channel Set a variable on the channel that indicates which attempt number we are currently performing to allow for attempt-specific behavior. ASTERISK-26568 #close Reported by: Roman Shubovich Change-Id: Iacd7e8d43b0ed5b6cb021c62f41f1a1f5733dd89 2017-03-07 07:37 +0000 [4e3b0cedba] Joshua Colp * res_pjsip_transport_websocket: Add support for IPv6. This change adds a PJSIP patch (which has been contributed upstream) to allow the registration of IPv6 transport types. Using this the res_pjsip_transport_websocket module now registers an IPv6 Websocket transport and uses it for the corresponding traffic. ASTERISK-26685 Change-Id: Id1f9126f995b31dc38db8fdb58afd289b4ad1647 2017-03-08 08:16 +0000 [60998371e3] Daniel Journo * app_voicemail: Cannot set fromstring on a per-mailbox basis * apps/app_voicemail.c fromstring field added to mailbox which will override the global fromstring if set. ASTERISK-24562 #close Change-Id: I5e90e3a1ec2b2d5340b49a0db825e4bbb158b2fe 2017-03-07 13:38 +0000 [5d0371d743] Mark Michelson * res_http_websocket: Fix faulty read logic. When doing some WebRTC testing, I found that the websocket would disconnect whenever I attempted to place a call into Asterisk. After looking into it, I pinpointed the problem to be due to the iostreams change being merged in. Under certain circumstances, a call to ast_iostream_read() can return a negative value. However, in this circumstance, the websocket code was treating this negative return as if it were a partial read from the websocket. The expected length would get adjusted by this negative value, resulting in the expected length being too large. This patch simply adds an if check to be sure that we are only updating the expected length of a read when the return from a read is positive. ASTERISK-26842 #close Reported by Mark Michelson Change-Id: Ib4423239828a013d27d7bc477d317d2f02db61ab 2017-03-07 08:12 +0000 [d51ca4b406] Jean Aunis * chan_sip: Call not cancelled after receiving a 422 response When receiving a 422 response, the invitestate variable must be reset to INV_CALLING. ASTERISK-26841 Change-Id: Ia0502d6b02192664cefa4e75bafdd2645ce56099 2017-03-07 05:22 +0000 [3ed05badb9] Joshua Colp * core: Add stream topology changing primitives with tests. This change adds a few things to facilitate stream topology changing: 1. Control frame types have been added for use by the channel driver to notify the application that the channel wants to change the stream topology or that a stream topology change has been accepted. They are also used by the indicate interface to the channel that the application uses to indicate it wants to do the same. 2. Legacy behavior has been adopted in ast_read() such that if a channel requests a stream topology change it is denied automatically and the current stream topology is preserved if the application is not capable of handling streams. Tests have also been written which confirm the multistream and non-multistream behavior. ASTERISK-26839 Change-Id: Ia68ef22bca8e8457265ca4f0f9de600cbcc10bc9 2017-03-06 15:54 +0000 [272259a2c6] Daniel Journo * Saynumber is trying to get "and" from "digits/" subfolder * say.c Changed 'digits/and' to 'vm-and' for en_GB ASTERISK-26598 #close Change-Id: If1b713e5daea6f952b339f139178d292a6c4fcfe 2017-03-06 13:15 +0000 [5a74abc53b] Sean Bright * pbx_spool: Gracefully handle long lines in call files Per the linked issue, we aren't checking the buffer filled by fgets() to determine if it contains a newline, so we will fail to correctly parse the trailing portion of a long line. This patch increases the buffer size from 256 to 1024, and skips any line that exceeds that length, logging a warning in the process. ASTERISK-17067 #close Reported by: Dave Olszewski Change-Id: I51bcf270c1b4347ba05b43f18dc2094c76f5d7b0 2017-03-02 21:27 +0000 [c9296b23d1] Richard Mudgett * core: Cleanup ast_get_hint() usage. * manager.c:manager_state_cb() Fix potential use of uninitialized hint[] if a hint does not exist for the requested extension. Ran into this when developing a testsuite test. The AMI event ExtensionStatus came out with the hint header value containing garbage. The AMI event PresenceStatus also had the same issue. * manager.c:action_extensionstate() no need to completely initialize the hint[]. Only initialize the first element. * pbx.c:ast_add_hint() Remove unnecessary assignment. * chan_sip.c: Eliminate an unneeded hint[] local variable. We only care about the return value of ast_get_hint() there. Change-Id: Ia9a8786f01f93f1f917200f0a50bead0319af97b 2017-02-16 04:22 +0000 [7922f26cb0] Jørgen H * res_pjsip WebRTC/websockets: Fix usage of WS vs WSS. According to the RFC[1] WSS should only be used in the Via header for secure Websockets. * Use WSS in Via for secure transport. * Only register one transport with the WS name because it would be ambiguous. Outgoing requests may try to find the transport by name and pjproject only finds the first one registered. This may mess up unsecure websockets but the impact should be minimal. Firefox and Chrome do not support anything other than secure websockets anymore. * Added and updated some debug messages concerning websockets. * security_events.c: Relax case restriction when determining security transport type. * The res_pjsip_nat module has been updated to not touch the transport on Websocket originating messages. [1] https://tools.ietf.org/html/rfc7118 ASTERISK-26796 #close Change-Id: Ie3a0fb1a41101a4c1e49d875a8aa87b189e7ab12 2017-02-24 15:30 +0000 [0560c32375] George Joseph * stream: Unit tests for stream read and tweaks framework * Removed the AST_CHAN_TP_MULTISTREAM tech property. We now rely on read_stream being set to indicate a multi stream channel. * Added ast_channel_is_multistream convenience function. * Fixed issue where stream and default_stream weren't being set on a frame retrieved from the queue. * Now testing for NULL being returned from the driver's read or read_stream callback. * Fixed issue where the dropnondefault code was crashing on a NULL f. * Now enforcing that if either read_stream or write_stream are set when ast_channel_tech_set is called that BOTH are set. * Added the unit tests. ASTERISK-26816 Change-Id: If7792b20d782e71e823dabd3124572cf0a4caab2 2017-03-01 07:23 +0000 [1dacf317f3] Sean Bright * res_config_pgsql: Make 'require' return consistent with other backends res_config_pgsql should match the behavior of other realtime backend drivers so that queue_log can disable adaptive logging. ASTERISK-25628 #close Reported by: Dmitry Wagin Change-Id: Ic1fb1600c7ce10fdfb1bcdc43c5576b7e0014372 2017-02-22 15:11 +0000 [9c55a71798] Mark Michelson * SDP: Add initial SDP state machine. This introduces and documents the various states in the state machine. This also introduces API functions that induce state changes, and places TODO comments telling what needs to be done in addition to what is already there. Those TODOs will be replaced with real code in upcoming changes. Change-Id: I871c0eb480b4c84d83e91ac5628e7a673e8b89ed 2017-02-28 13:48 +0000 [60e9e4fcc0] Sean Bright * media_cache: Mark cache entry stale if cache file is removed In the event that a cache file is removed out from under us, we should treat the cache entry as stale and force a refresh. ASTERISK-26774 #close Reported by: Igor Gamayunov Change-Id: I3b1bd0c999d59d18664ef73a29823bc5b431dc52 2017-02-28 09:41 +0000 [e5b44c26b4] Sean Bright * res_config_pgsql: Release table locks where appropriate The find_table() functions NULL or a locked table pointer. We are not consistently calling release_table() in failure paths. Change-Id: I6f665b455799c84b036e5b34904b82b05eab9544 2017-02-28 05:41 +0000 [6ebdcfe27d] Tzafrir Cohen * pjsip.conf.sample: user_agent: not a specific version Use the description of useragent from sip.conf here. ASTERISK-26825 #close Change-Id: I5b33a4aaa0ae1d793289d05e3bc09521affbf755 2017-02-27 20:07 +0000 [fb68db87b1] George Joseph * res_pjsip_pubsub: Remove unneeded endpoint unref When a subscription was being recreated and the endpoint wasn't found, we were trying to unref the endpoint. This was causing FRACKs. Removed the unref. ASTERISK-26823 #close Change-Id: If86d2aecff8fe853c7f38a1bfde721fcef3cd164 2017-02-16 04:16 +0000 [ee0a123f43] Jørgen H * res_pjsip: Fix crash when contact has no status This change fixes an assumption in res_pjsip that a contact will always have a status. There is a race condition where this is not true and would crash. The status will now be unknown when this situation occurs. ASTERISK-26623 #close Change-Id: Id52d3ca4d788562d236da49990a319118f8d22b5 2017-02-21 18:06 +0000 [22242fef5d] George Joseph * res_pjsip_outbound_registration: Subscribe to network change events Outbound registration now subscribes to network change events published by res_stun_monitor and refreshes all registrations when an event happens. The 'pjsip send (un)register' CLI commands were updated to accept '*all' as an argument to operate on all registrations. The 'PJSIP(Un)Register' AMI commands were also updated to accept '*all'. ASTERISK-26808 #close Change-Id: Iad58a9e0aa5d340477fca200bf293187a6ca5a25 2017-02-27 12:25 +0000 [4692a32ed7] George Joseph * build: Warn if asterisk is installed in both 32 and 64 bit sys dirs ... and clean them both up on uninstall. We've fixed the issue where 'make install' was installing to /usr/lib on 64-bit systems that use /usr/lib64. Now we need to clean up the remnants in /usr/lib. * 'make install' now prints a warning if DESTDIR/ASTLIBDIR contains 'lib64' and libasterisk* shared libraries or modules are also found in DESTDIR/ASTLIBDIR with 'lib64' transformed to 'lib'. * 'make uninstall' ALWAYS cleans up both DESTDIR/ASTLIBDIR and DESTDIR/ASTLIBDIR with 'lib64' transformed to 'lib'. ASTERISK-26705 Change-Id: I6edddeb3c07a51e7c7ba7cac3c05e4bf3ec3f01f 2017-02-27 07:02 +0000 [ff2b4308d1] Joshua Colp * bridge_native_rtp: Handle case where channel joins already suspended. The bridge_native_rtp module did not properly handle the case where a smart bridge operation occurs while a channel is suspended. In this scenario the module would incorrectly set up local or remote RTP bridging despite the media having to flow through Asterisk. The remote endpoint would see two media streams and experience wonky audio. The module has been changed so that it ensures both channels are not suspended when performing the native RTP bridging and this requirement has been documented in the bridge technology. ASTERISK-26781 Change-Id: Id4022d73ace837d4a293106445e3ade10dbc7c7c 2016-08-12 11:23 +0000 [5b1796f59d] frahaase * Binaural synthesis (confbridge): DTMF conference management. DTMF configuration options for the binaural softmix bridge: toggle binaural rendering (per channel). ASTERISK-26292 Change-Id: Ibfe708b9fe26097c1798fcbfcc4dc461267d8af8 2017-02-24 11:49 +0000 [2046743938] Joshua Colp * config: Improve documentation and behavior of outbound_proxy option. This change updates the documentation for the outbound_proxy option to ensure it is consistently stated that a full SIP URI must be provided for the option. The res_pjsip_outbound_registration module has also been changed so that the provided outbound_proxy value is checked to ensure it is a URI and if not an error is output stating so. ASTERISK-26782 Change-Id: I6c239a32274846fd44e65b44ad9bf6373479b593 2017-02-23 13:03 +0000 [c07c6714f2] Joshua Colp * channel: Add ast_read_stream function for reading frames from all streams. This change introduces an ast_read_stream function and callback in the channel technology which allows reading frames from all streams and not just the default streams. The stream number has also been added to frames. This is to allow the case where frames are queued onto the channel instead of being read directly from the driver. This change does impose a restriction on reading though: a chain of frames can only contain frames from the same stream. ASTERISK-26816 Change-Id: I5d7dc35e86694df91fd025126f6cfe0453aa38ce 2017-02-09 18:05 +0000 [a537dae6d0] George Joseph * pjproject_bundled: Update for pjproject 2.6 * Removed all 2.5.5 functional patches. * Updated usages of pj_release_pool to be "safe". * Updated configure options to disable webrtc. * Updated config_site.h to disable webrtc in pjmedia. * Added Richard Mudgett's recent resolver patches. Change-Id: Ib400cc4dfca68b3d07ce14d314e829bfddc252c7 2017-02-23 15:49 +0000 [b0067bcf2c] George Joseph * build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982 2017-02-23 14:48 +0000 [0f4b349d37] Sean Bright * res_config_pgsql: Fix thread safety problems * A missing AST_LIST_UNLOCK() in find_table() * The ESCAPE_STRING() macro uses pgsqlConn under the hood and we were not consistently locking before calling it. * There were a handful of other places where pgsqlConn was accessed directly without appropriate locking. Change-Id: Iea63f0728f76985a01e95b9912c3c5c6065836ed 2017-02-22 05:00 +0000 [6cc890b880] Joshua Colp * channel: Add support for writing to a specific stream. This change adds an ast_write_stream function which allows writing a frame to a specific media stream. It also moves ast_write() to using this underneath by writing media frames provided to it to the default streams of the channel. Existing functionality (such as audiohooks, framehooks, etc) are limited to being applied to the default stream only. Unit tests have also been added which test the behavior of both non-multistream and multistream channels to confirm that the write() and write_stream() callbacks are invoked appropriately. ASTERISK-26793 Change-Id: I4df20d1b65bd4d787fce0b4b478e19d2dfea245c 2016-08-12 11:23 +0000 [094c26aa68] frahaase * Binaural synthesis (confbridge): Adds binaural synthesis to bridge_softmix. Adds binaural synthesis to bridge_softmix (via convolution using libfftw3). Binaural synthesis is conducted at 48kHz. For a conference, only one spatial representation is rendered. The default rendering is applied for mono-capable channels. ASTERISK-26292 Change-Id: Iecdb381b6adc17c961049658678f6219adae1ddf 2017-02-22 08:53 +0000 [e57961db84] Sean Bright * res_config_ldap: Various code improvements The initial motivation for this patch was to properly handle memory allocation failures - we weren't checking the return values from the various LDAP library allocation functions. In the process, because update_ldap() and update2_ldap() were substantially the same code, they've been consolidated. Change-Id: Iebcfe404177cc6860ee5087976fe97812221b822 2017-02-22 13:08 +0000 [66a35e2451] Michael L. Young * build_tools: Fix download_externals to allow the use of curl or wget Not sure if this is really a bug versus an improvement. I can see it being viewed as a bug though by some. The current build_tools/download_externals file depends on wget in order to download external modules. The current build system is able to discover which tool to use for fetching remote files - either wget or curl. This patch takes advantage of this capability by modifying the two calls to the wget binary to instead use what was discovered by the build system. ASTERISK-26812 #close Change-Id: If9411a2554f009274d377445613ae91192d948a1 2017-02-22 11:12 +0000 [ced73d5b79] Joshua Colp * Revert "build: Execute ldconfig to build cache." This reverts commit 28c8e4f58f0f38792c7c79a05bd07788ebf15332. Change-Id: Ie2e1aaf61fd49045994974a4581545ac8348fe4c 2017-02-21 10:47 +0000 [15ed7af027] Sean Bright * pbx_realtime: Prevent premature extension matching The patterns provided by pbx_realtime were checked in the order in which they were returned from the realtime backend. If there was overlap between multiple patterns, the first one to correctly match was chosen even though it may not have been the best match. We now sort the patterns descending by their length and compare in that order. There may be cases where this still results in a sub-optimal match, but this patch should improve the overall behavior. ASTERISK-18271 #close Reported by: Charlie Smurthwaite Change-Id: I56d9ac15810eb1775966b669c3028e32cc7bd809 2017-02-22 08:32 +0000 [f58aefba5b] Joshua Colp * core: Show streams in "core show channel". The "core show channel" CLI command will now output the streams present on the channel with their details. ASTERISK-26811 Change-Id: I9c95b57aa09415005f0677a1949a0feb07e4987a 2017-02-21 15:09 +0000 [fc70ca9499] Peter Racz * pbx_dundi: DUNDi weight parameter not processed correctly The DUNDi weight field is not always converted from network byte order to host byte order. This can result in incorrect weight values and incorrect selection of DUNDi destinations. ASTERISK-18731 #close Reported by: Peter Racz Patches: dundi_weight.patch (license #6290) patch uploaded by Peter Racz Change-Id: Iba3e1a700ff539db57211a7bbc26f7b22ea9a1be 2017-02-15 14:43 +0000 [a738772edd] Mark Michelson * Add initial SDP state code. This establishes the basic allocation/destruction of an SDP state object, plus some of the simpler getter methods involved. Subsequent tasks will deal with adding a state machine, creating SDPs from capabilities and options, and merging SDPs into a joint SDP. Change-Id: Ie3757ce186f04b65e9d1883f5aace53f24e53709 2017-02-21 10:47 +0000 [ab04a018e4] Sean Bright * realtime: Fix ast_load_realtime_multientry handling ast_load_realtime_multientry() returns an ast_config structure whose ast_categorys are keyed with the empty strings. Several modules were giving semantic meaning to the category names causing problems at runtime. * app_directory: Treated the category name as the mailbox name, and would fail to direct calls to the appropriate extension after an entry was chosen. * app_queue: Queues, queue members, and queue rules were all affected and needed to be updated. * pbx_realtime: Pattern matching would never succeed because the extension entered by the user was always compared to the empty string. Change-Id: Ie7e44986344b0b76ea8f6ddb5879f5040c6ca8a7 2017-02-21 08:56 +0000 [6e6c96d713] Sean Bright * realtime: Centralize some common realtime backend code All of the realtime backends create artificial ast_categorys to pass back into the core as query results. These categories have no filename or line number information associated with them and the backends differ slightly on how they create them. So create a couple helper macros to help make things more consistent. Also updated the call sites to remove redundant error messages about memory allocation failure. Note that res_config_ldap sets the category filename to the 'table name' but that is not read by anything in the core, so I've dropped it. Change-Id: I3a1fd91e0c807dea1ce3b643b0a6fe5be9002897 2017-02-16 10:30 +0000 [28c8e4f58f] Joshua Colp * build: Execute ldconfig to build cache. On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. This change does the minimally invasive thing and executes ldconfig so that the libraries in the lib directory are found and their location cached. By doing so Asterisk starts up fine. If DESTDIR is specified, however, the old logic is executed as the install process may not have permission to alter the ldconfig cache. ASTERISK-26705 Change-Id: If4eca46ac510c6fea5568256280ffdb3888d7bb4 2017-01-08 20:32 +0000 [6f15500ced] Richard Mudgett * res_pjsip_authenticator_digest.c: Fix sorcery's immutable contract violation. The inbound authentication object is supposed to be immutable when it is stored in sorcery. However, the immutable property is violated if the authentication object does not have a realm set. The immutable contract violation has a different effect depending upon what sorcery back end is used. If it is the config file back end you would get the same object back until res_pjsip is reloaded. If it is the real-time or AstDB back end you would get a new object on each query. If it is cached you would get the same object back until it is refreshed from the database. Once an inbound authentication object has its realm set it may or may not get updated again if the default_realm changes. If the same authentication object is used for inbound and outbound authentication then the immutable violation can make it very hard to determine why the outbound authentication now fails. The only diagnostic message is a complaint about no realms matching when it had worked earlier. It fails because of the difference in behaviour for an empty realm setting between inbound and outbound authentication objects. * Fixed the sorcery object immutable violation by creating a new object and setting the default_realm on it instead. The new object is a shallow copy for speed. * The auth_store thread storage no longer holds an auth ref. It interferes with the shallow copy and never needed a ref anyway. ASTERISK-26799 #close Change-Id: I2328a52f61b78ed5fbba38180b7f183ee7e08956 2017-02-04 20:17 +0000 [6400f5f309] Richard Mudgett * res_pjsip: Update artificial auth whenever default_realm changes. There was code attempting to update the artificial authentication object whenever the default_realm changed. However, once the artificial authentication object was created it would never get updated. The artificial authentication object would require a system restart for a change to the default_realm to take effect. ASTERISK-26799 Change-Id: Id59036e9529c2d3ed728af2ed904dc36e7094802 2017-01-01 08:02 +0000 [0b660c9989] Richard Mudgett * res_pjsip: Update authentication realm documentation. Using the same auth section for inbound and outbound authentication is not recommended. There is a difference in meaning for an empty realm setting between inbound and outbound authentication uses. An empty inbound auth realm represents the global section's default_realm value when the authentication object is used to challenge an incoming request. An empty outgoing auth realm is treated as a don't care wildcard when the authentication object is used to respond to an incoming authentication challenge. ASTERISK-26799 Change-Id: Id3952f7cfa1b6683b9954f2c5d2352d2f11059ce 2017-02-13 17:11 +0000 [7f83bcd63d] Richard Mudgett * pjproject: Fixes to resolve DNS SRV crashes. * Re #1945 (misc): Don't trigger SRV complete callback when there is a parse error. * srv_resolver.c: Don't try to send query if already considered resolved. ** In resolve_hostnames() don't try to resolve a query that is already considered resolved. ** In resolve_hostnames() fix DNS typo in comments. ** In build_server_entries() move a common expression assigning to cnt earlier. * sip_transport.c: Fix tdata object name to actually contain the pointer. It helps if the logs referencing a tdata object buffer actually have a name that includes the correct pointer as part of the name. Also since the tdata has its own pool it helps if any logs referencing the pool have the same name as the tdata object. This change brings tdata logging in line with how tsx objects are named. ASTERISK-26669 #close ASTERISK-26738 #close Change-Id: I56af2ded25476b3e870ca586ee69ed6954ef75af 2017-02-20 13:38 +0000 [bf78c3c9c3] Richard Mudgett * pjproject: Increase SENDER_WIDTH column size for 64-bit system logs. ASTERISK-26669 ASTERISK-26738 Change-Id: Ibae6fc8cae69a1f04df0c577c4c11200499d6fe0 2017-02-06 14:26 +0000 [54812f18b5] Richard Mudgett * pjsip_distributor.c: Update some debug messages to get transaction name. * Removed overloaded unmatched response ignore. We obviously sent the request so we shouldn't ignore it because it isn't new work. ASTERISK-26669 ASTERISK-26738 Change-Id: I55fb5cadc83a8e6699b347c6dc7fa32c5a617d37 2017-02-20 06:28 +0000 [b18f1bfb13] Sean Bright * app_voicemail: vm_authenticate accesses uninitialized memory vm_authenticate doesn't always set the passed ast_vm_user argument, so we initialize to 0 before passing it in. ASTERISK-25893 #close Reported by: Filip Jenicek Change-Id: Ia3cc0128f93d352ed9add8d5c2f0f7232c2cbe4a 2017-02-20 11:19 +0000 [7739b0b3ae] Joshua Colp * Revert "build: Execute ldconfig to build cache." This reverts commit 8851c3e0885cb704a5a6159a51768ea5297e9b10. Change-Id: I124380be5e3bd57da978428a2a93604336ccd0db 2017-02-20 08:04 +0000 [ffa7d69766] George Joseph * pjproject cli: Add object count after object lists When listing a container, we now print the number of objects in the container at the end of the list. Change-Id: I791cbc3ee9da9a2af9adc655164b5d32953df812 2017-02-20 05:53 +0000 [e84353b8a8] Sean Bright * res_config_ldap: Don't try to delete non-existent attributes OpenLDAP will raise an error when we try to delete an LDAP attribute that doesn't exist. We need to filter out LDAP_MOD_DELETE requests based on which attributes the current LDAP entry actually has. There is of course a small window of opportunity for this to still fail, but it is much less likely now. Change-Id: I3fe1b04472733e43151563aaf9f8b49980273e6b 2017-02-20 05:49 +0000 [9f392574f9] Sean Bright * res_config_ldap: Remove extraneous line numbers from log messages Extraneous line numbers were being output in many log messages. These have been removed. Change-Id: Ice9efa3d252ee87f37fa8f5ea852fda482675431 2017-02-20 05:45 +0000 [ef0944395e] Sean Bright * res_config_ldap: Make memory allocation more consistent The code in update_ldap() and update2_ldap() was using both Asterisk's memory allocation routines as well as OpenLDAP's. I've changed it so that everything that is passed to OpenLDAP's functions are allocated with their routines. Change-Id: Iafec9c1fd8ea49ccc496d6316769a6a426daa804 2017-02-20 05:30 +0000 [dd3efdf525] Sean Bright * res_config_ldap: Fix configuration inheritance from _general The "_general" configuration section allows administrators to provide both general configuration options (host, port, url, etc.) as well as a global realtime-to-LDAP-attribute mapping that is a fallback if one of the later sections do not override it. This neglected to exclude the general configuration options from the mapping. As an example, during my testing, chan_sip requested 'port' from realtime, and because I did not have it defined, it pulled in the 'port' configuration option from "_general." We now filter those out explicitly. Change-Id: I1fc61560bf96b8ba623063cfb7e0a49c4690d778 2017-02-20 05:27 +0000 [d6d86f1c09] Sean Bright * res_config_ldap: Fix erroneous LDAP_MOD_REPLACE in LDAP modify We always treat the first change of our modification batch as a replacement when it sometimes is actually a delete. So we have to pass the correct arguments to the OpenLDAP library. ASTERISK-26580 #close Reported by: Nicholas John Koch Patches: res_config_ldap.c-11.24.1.patch (license #6833) patch uploaded by Nicholas John Koch Change-Id: I0741d25de07c9539f1edc6eff3696165dfb64fbe 2017-02-15 11:55 +0000 [44abe214d2] Sean Bright * res_config_sqlite3: Fix crash when loading with invalid config When ast_config_load() fails with CONFIG_STATUS_FILEINVALID, it has already destroyed the ast_config struct for us. Trying to do it again results in a crash. Change-Id: If6a5c0ca718ad428e01a1fb25beb209a9ac18bc6 2017-02-17 17:06 +0000 [51e3b11989] Sean Bright * pjproject-bundled: Fix checksum verification when using cURL ASTERISK-26802 #close Reported by: Michael L. Young Change-Id: Iad293080f55d4d69ab615717a15211d916eed613 2017-02-17 16:57 +0000 [0b427f9b59] Richard Mudgett * tcptls.c: Add some missing allocation failure checks. * Fix tcptls_session ref and fd leak in ast_tcptls_server_root(). Change-Id: I0ddf01cd3c10d3b6666d7bf68d4e206a37f4fbdb 2017-02-17 14:58 +0000 [dbc3598014] Mark Michelson * Remove extra ast_iostream_close() calls. When AMI encounters an error at the beginning of a session, it would explicitly call ast_iostream_close() on its tcptls session's iostream. It then would jump to a label where it would shut down the tcptls session instance. The tcptls session instance would again attempt to close the iostream. Under normal circumstances, this might go by unnoticed. However, when MALLOC_DEBUG is enabled, all fields on the iostream get set to 0xdeaddead when the iostream is freed. Thus a second call to ast_iostream_close() after the iostream has been freed would reslt in an attempt to call SSL_shutdown on 0xdeaddead, which would crash and burn horribly. The fix here is to not directly close the iostream from the dangerous scenarios. The specific scenarios are: * Exceeding the configured authlimit * Failing to build a mansession on a new connection Change-Id: I908f98d516afd5a263bd36b072221008a4731acd 2017-02-14 09:54 +0000 [5a130b2e17] Mark Michelson * Add SDP translator and PJMEDIA implementation. This creates the following: * Asterisk's internal representation of an SDP * An API for translating SDPs from one format to another * An implementation of a translator for PJMEDIA Change-Id: Ie2ecd3cbebe76756577be9b133e84d2ee356d46b 2017-02-07 09:50 +0000 [8af6342555] Mark Michelson * Add initial SDP options. This is step one of adding an SDP API: defining some configurable settings for SDPs. This is based on options that are currently supported in Asterisk. Change-Id: I1ede91aafed403b12a9ccdfb91a88389baa7e5d7 2017-02-16 10:30 +0000 [8851c3e088] Joshua Colp * build: Execute ldconfig to build cache. On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. This change does the minimally invasive thing and executes ldconfig so that the libraries in the lib directory are found and their location cached. By doing so Asterisk starts up fine. ASTERISK-26705 Change-Id: I6d30b6427e9d5e69470e11327c7ff203fa7da519 2017-02-16 08:38 +0000 [e93f2a5142] Sean Bright * realtime: Fix LIKE escaping in SQL backends The realtime framework allows for components to look up values using a LIKE clause with similar syntax to SQL's. pbx_realtime uses this functionality to search for pattern matching extensions that start with an underscore (_). When passing an underscore to SQL's LIKE clause, it will be interpreted as a wildcard matching a single character and therefore needs to be escaped. It is (for better or for worse) the responsibility of the component that is querying realtime to escape it with a backslash before passing it in. Some RDBMs support escape characters by default, but the SQL92 standard explicitly says that there are no escape characters unless they are specified with an ESCAPE clause, e.g. SELECT * FROM table WHERE column LIKE '\_%' ESCAPE '\' This patch instructs 3 backends - res_config_mysql, res_config_pgsql, and res_config_sqlite3 - to use the ESCAPE clause where appropriate. Looking through documentation and source tarballs, I was able to determine that the ESCAPE clause is supported in: MySQL 5.0.15 (released 2005-10-22 - earliest version available from archives) PostgreSQL 7.1 (released 2001-04-13) SQLite 3.1.0 (released 2005-01-21) The versions of the relevant libraries that we depend on to access MySQL and PostgreSQL will not work on versions that old, and I've added an explicit check in res_config_sqlite3 to only use the ESCAPE clause when we have a sufficiently new version of SQLite3. res_config_odbc already handles the escape characters appropriately, so no changes were required there. ASTERISK-15858 #close Reported by: Humberto Figuera ASTERISK-26057 #close Reported by: Stepan Change-Id: I93117fbb874189ae819f4a31222df7c82cd20efa 2017-02-16 08:28 +0000 [f8f513d363] George Joseph * stream: Rename creates/destroys to allocs/frees To be consistent with sdp implementation. Change-Id: I714e300939b4188f58ca66ce9d1e84b287009500 2017-02-16 05:46 +0000 [30aaeec5a1] Sean Bright * res_config_sqlite3: Properly create missing columns when necessary There were two specific issues resolved here: 1) The code that iterated over the required fields (via ast_realtime_require) was broken for the RQ_INTEGER1 field type. Iteration would stop when the first RQ_INTEGER1 (0) field was encountered. 2) sqlite3_changes() was used to try and count the number of rows returned by a SELECT statement. sqlite3_changes() only counts affected rows, so this was always returning the value from the most recent data modification statement. We now separate read-only queries from data modification queries and count rows appropriately in both cases. ASTERISK-23457 #close Reported by: Scott Griepentrog Change-Id: I91ed20494efc3fcfbc2a96ac7646999a49814884 2017-02-15 14:44 +0000 [ac7a34c531] Joshua Elson * http: Ensure capath is defined on all http creations ASTERISK-26794 #close Change-Id: I9cbc3b6b6a8aab590f5ccde9c262a98e4d5253a1 2017-02-15 23:09 +0000 [135bea931c] Igor Goncharovsky * chan_unistim: fix char type to have consistent behavior on ARM There is difference exists in behaviour of char type on x86 and ARM. On x86 by default char variable type means signed char, but in ARM unsigned char used. This make binary calculations and negative values works wrong on ARM. This patch change type of char variables used for store negative values and binary calculations to signed char. ASTERISK-26714 Change-Id: Id78716dee9568a58419d4ef63c038affc3dfc7ab 2017-02-07 13:17 +0000 [4bdf5d329f] George Joseph * res_pjsip_pubsub: Correctly implement persisted subscriptions This patch fixes 2 original issues and more that those 2 exposed. * When we send a NOTIFY, and the client either doesn't respond or responds with a non OK, pjproject only calls our pubsub_on_evsub_state callback, no others. Since pubsub_on_evsub_state (which does the sub_tree cleanup) does not expect to be called back without the other callbacks being called first, it just returns leaving the sub_tree orphaned. Now pubsub_on_evsub_state checks the event for PJSIP_EVENT_TSX_STATE which is what pjproject will set to tell us that it was the transaction that timed out or failed and not the subscription itself timing our or being terminated by the client. If is TSX_STATE, pubsub_on_evsub_state now does the proper cleanup regardless of the state of the subscription. * When a client renews a subscription, we don't update the persisted subscription with the new expires timestamp. This causes subscription_persistence_recreate to prune the subscription if/when asterisk restarts. Now, pubsub_on_rx_refresh calls subscription_persistence_update to apply the new expires timestamp. This exposed other issues however... * When creating a dialog from rdata (which sub_persistence_recreate does from the packet buffer) there must NOT be a tag on the To header (which there will be when a client refreshes a subscription). If there is one, pjsip_dlg_create_uas will fail. To address this, subscription_persistence_update now accepts a flag that indicates that the original packet buffer must not be updated. New subscribes don't set the flag and renews do. This makes sure that when the rdata is recreated on asterisk startup, it's done from the original subscribe packet which won't have the tag on To. * When creating a dialog from rdata, we were setting the dialog's remote (SUBSCRIBE) cseq to be the same as the local (NOTIFY) cseq. When the client tried to resubscribe after a restart with the correct cseq, we'd reject the request with an Invalid CSeq error. * The acts of creating a dialog and evsub by themselves when recreating a subscription does NOT restart pjproject's subscription timer. The result was that even if we did correctly recreate the subscription, we never removed it if the client happened to go away or send a non-OK response to a NOTIFY. However, there is no pjproject function exposed to just set the timer on an evsub that wasn't created by an incoming subscribe request. To address this, we create our own timer using ast_sip_schedule_task. This timer is used only for re-establishing subscriptions after a restart. An earlier approach was to add support for setting pjproject's timer (via a pjproject patch) and while that patch is still included here, we don't use that call at the moment. While addressing these issues, additional debugging was added and some existing messages made more useful. A few formatting changes were also made to 'pjsip show scheduled tasks' to make displaying the subscription timers a little more friendly. ASTERISK-26696 ASTERISK-26756 Change-Id: I8c605fc1e3923f466a74db087d5ab6f90abce68e 2017-02-15 11:03 +0000 [11886dea82] Sean Bright * res_rtp_asterisk: Use PJ_ICE_MAX_CAND instead of hard-coding 16 pjsip limits the total number of ICE candidates to PJ_ICE_MAX_CAND, which is a compile-time constant. Instead of hard-coding 16 when we enumerate local interfaces, use PJ_ICE_MAX_CAND so that we can potentially collect more interfaces if the compile time options are changed. Tangentially related to ASTERISK~24464 Change-Id: I1b85509e39e33b1fed63c86261fc229ba14bbabd 2016-12-22 09:42 +0000 [b58de2fab7] Dennis Guse * Binaural synthesis (confbridge): Adds utils/conf_bridge_binaural_hrir_importer Adds the import tool for converting a HRIR database to hrirs.h ASTERISK-26292 Change-Id: I51eb31b54c23ffd9b544bdc6a09d20c112c8a547 2017-02-14 12:33 +0000 [a9c15a0e4c] Joshua Colp * stream: Add unit tests for channel stream usage. This change adds unit tests cover the following: 1. That retrieving the first media stream of a specific media type from a stream topology retrieves the expected media stream. 2. That setting the native formats of a channel which does not support streams results in the creation of streams on its behalf according to the formats of the channel. 3. That setting a stream topology on a channel which supports streams sets the topology to the provided one. ASTERISK-26790 Change-Id: Ic53176dd3e4532e8c3e97d9e22f8a4b66a2bb755 2017-02-13 16:50 +0000 [275f469a4d] Sean Bright * app_voicemail: Allow 'Comedian Mail' branding to be overriden Original patch by John Covert, slight modifications by me. ASTERISK-17428 #close Reported by: John Covert Patches: app_voicemail.c.patch (license #5512) patch uploaded by John Covert Change-Id: Ic3361b0782e5a5397a19ab18eb8550923a9bd6a6 2017-02-13 11:50 +0000 [bf2f091bbb] George Joseph * stream: Add stream topology to channel Adds topology set and get to channel. ASTERISK-26790 Change-Id: Ic379ea82a9486fc79dbd8c4d95c29fa3b46424f4 2017-01-25 16:25 +0000 [2b245b12d9] Ryan Rittgarn * app_voicemail: VoiceMailPlayMsg did not play database stored messages When attempting to use VoiceMailPlayMsg with a realtime data backend the message is located, but never retrieved. This patch adds the required RETRIEVE and DISPOSE calls that will fetch the message from the database (and IMAP storage as well for that matter). Also, removed extraneous make_file call. ASTERISK-26723 #close Change-Id: I1e122dd53c0f3d7faa10f3c2b7e7e76a47d51b8c 2017-02-14 08:12 +0000 [662c9e69fa] var * app_record: Add option to prevent silence from being truncated When using Record() with the silence detection feature, the stream is written out to the given file. However, if only 'silence' is detected, this file is then truncated to the first second of the recording. This patch adds the 'u' option to Record() to override that behavior. ASTERISK-18286 #close Reported by: var Patches: app_record-1.8.7.1.diff (license #6184) patch uploaded by var Change-Id: Ia1cd163483235efe2db05e52f39054288553b957 2017-02-07 11:13 +0000 [9f394d074a] Sebastian Gutierrez * app_queue: reset abandoned in sl for sl2 calculations ASTERISK-26775 #close Change-Id: I86de4b1a699d6edc77fea9b70d839440e4088284 2017-02-13 11:00 +0000 [6c4657e28e] Joshua Colp * stream: Add stream topology unit tests and fix uncovered bugs. This change adds unit tests for the various API calls relating to stream topologies. This includes creation, destruction, inspection, and manipulation. Through this a few bugs were uncovered in the implementation: 1. Creating a topology using a format capabilities would fail as the code considered a return value of 0 from the append stream function to indicate an error which is incorrect. 2. Not all functions which placed a stream into a topology set the position on the stream itself. 3. Appending a stream would cause a frack if the position provided was the last one. This occurred because the existing stream was queried but the index was outside of what the vector was currently at for size. ASTERISK-26786 Change-Id: Id5590e87c8a605deea1a89e53169a9c011d66fa0 2017-02-11 09:57 +0000 [3f94373778] Sean Bright * cli: Fix various CLI documentation and completion issues * app_minivm: Use built-in completion facilities to complete optional arguments. * app_voicemail: Use built-in completion facilities to complete optional arguments. * app_confbridge: Add missing colons after 'Usage' text. * chan_alsa: Use built-in completion facilities to complete optional arguments. * chan_sip: Use built-in completion facilities to complete optional arguments. Add completions for 'load' for 'sip show user', 'sip show peer', and 'sip qualify peer.' * chan_skinny: Correct and extend completions for 'skinny reset' and 'skinny show line.' * func_odbc: Correct completions for 'odbc read' and 'odbc write' * main/astmm: Use built-in completion facilities to complete arguments for 'memory' commands. * main/bridge: Correct completions for 'bridge kick.' * main/ccss: Use built-in completion facilities to complete arguments for 'cc cancel' command. * main/cli: Add 'all' completion for 'channel request hangup.' Correct completions for 'core set debug channel.' Correct completions for 'core show calls.' * main/pbx_app: Remove redundant completions for 'core show applications.' * main/pbx_hangup_handler: Remove unused completions for 'core show hanguphandlers all.' * res_sorcery_memory_cache: Add completion for 'reload' argument of 'sorcery memory cache stale' and properly implement. Change-Id: Iee58c7392f6fec34ad9d596109117af87697bbca 2017-02-10 15:45 +0000 [8b72ec312b] George Joseph * stream: Add media stream topology definition and API This change adds the media stream topology definition and API for accessing and using it. Some refactoring of the stream was also done. ASTERISK-26786 Change-Id: Ic930232d24d5ad66dcabc14e9b359e0ff8e7f568 2017-01-13 11:21 +0000 [75f8167e66] Norbert Varga * chan_pjsip: Multidomain endpoint finding on call When PJSIP tries to call an endpoint with a domain (e.g. 1000@test.com), the user part is stripped down as it would be a trunk with a specified user, and only the host part is called as a PJSIP endpoint and can't be found. This is not correct in the case of a multidomain SIP account, so the stripping after the @ sign is done only if the whole endpoint (in multidomain case 1000@test.com) can't be found. ASTERISK-26248 Change-Id: I3a2dd6f57f3bd042df46b961eccd81d31ab202e6 2017-02-13 05:05 +0000 [89871576b9] Joshua Colp * channel: Protect flags in ast_waitfor_nandfds operation. The ast_waitfor_nandfds operation will manipulate the flags of channels passed in. This was previously done without the channel lock being held. This could result in incorrect values existing for the flags if another thread manipulated the flags at the same time. This change locks the channel during flag manipulation. ASTERISK-26788 Change-Id: I2c5c8edec17c9bdad4a93291576838cb552ca5ed 2017-02-11 11:25 +0000 [07abb39d6a] Richard Mudgett * res_pjsip.c: Fix inconsistency between warning and action. The original return value corresponded to AST_SIP_AUTHENTICATION_CHALLENGE but we have no authenticator registered to create the challenge. Change-Id: I62368180d774b497411b80fbaabd0c80841f8512 2017-02-11 11:26 +0000 [ce810a892b] Richard Mudgett * pjsip_distributor.c: Fix off-nominal tdata ref leak. Change-Id: I571f371d0956a8039b197b4dbd8af6b18843598d 2017-02-09 10:01 +0000 [0910773077] Sean Bright * manager: Restore Originate failure behavior from Asterisk 11 In Asterisk 11, if the 'Originate' AMI command failed to connect the provided Channel while in extension mode, a 'failed' extension would be looked up and run. This was, I believe, unintentionally removed in 51b6c49. This patch restores that behavior. This also adds an enum for the various 'synchronous' modes in an attempt to make them meaningful. ASTERISK-26115 #close Reported by: Nasir Iqbal Change-Id: I8afbd06725e99610e02adb529137d4800c05345d 2017-02-08 14:27 +0000 [16fdb11bc3] Richard Mudgett * core: Cleanup some channel snapshot staging anomalies. We shouldn't unlock the channel after starting a snapshot staging because another thread may interfere and do its own snapshot staging. * app_dial.c:dial_exec_full() made hold the channel lock while setting up the outgoing channel staging. Made hold the channel lock after the called party answers while updating the caller channel staging. * chan_sip.c:sip_new() completed the channel staging on off-nominal exit. Also we need to use ast_hangup() instead of ast_channel_unref() at that location. * channel.c:__ast_channel_alloc_ap() added a comment about not needing to complete the channel snapshot staging on off-nominal exit paths. * rtp_engine.c:ast_rtp_instance_set_stats_vars() made hold the channel locks while staging the channels for the stats channel variables. Change-Id: Iefb6336893163f6447bad65568722ad5d5d8212a 2017-02-07 06:56 +0000 [bab4885f1e] Joshua Colp * stream: Add media stream definition and API with unit tests. This change adds the media stream definition and API for accessing and using it. Unit tests have also been written which exercise aspects of the API. ASTERISK-26773 Change-Id: I3dbe54065b55aaa51f467e1a3bafd67fb48cac87 2017-02-10 09:35 +0000 [648d181d2f] George Joseph * configs/samples: Fix placement of 'identify' entry in sorcery.conf The entry for 'identify' was incorrectly placed in the res_pjsip section when it should be in res_pjsip_endpoint_identifier_ip. ASTERISK-26785 #close Change-Id: Ia1372b12a952bfe2df6b1b1e0e725ca306a5d41a 2017-02-08 11:50 +0000 [46147a8f30] Mark Michelson * Revert "Update qualifies when AOR configuration changes." This reverts commit 6492e91392b8fd394193e411c6eb64b45486093f. The change in question was intended to prevent the need to reload in order to update qualifies on contacts when an AOR changes. However, this ended up causing a deadlock instead. Change-Id: I1a835c90a5bb65b6dc3a1e94cddc12a4afc3d71e 2017-02-07 12:01 +0000 [5422ec140c] nappsoft (license 6822) * srv: Fix crash when ast_srv_lookup is used and 0 records are returned. When performing an SRV lookup using the ast_srv_lookup function it did not properly handle the situation where 0 records are returned. If this happened it would wrongly assume that at least one record was present. This change fixes the code so it will exit early if an error occurs or if 0 records are returned. ASTERISK-26772 patches: srv_lookup.patch submitted by nappsoft (license 6822) Change-Id: I09b19081c74e0ad11c12bf54a257243b1bcb2351 2017-02-06 11:40 +0000 [b79cc62057] Joshua Colp * res_stasis_device_state: Protect the adding/removing of subscriptions. The adding and removing of device state subscriptions did not protect fully against simultaneous manipulation. In particular the subscribe case allowed a small window where two subscriptions could be added for the same device state instead of just one. This change makes the code hold the subscriptions lock for the entirety of each operation to ensure that two are not occurring at the same time. ASTERISK-26770 Change-Id: I3e7f8eb9d09de440c9024d2dd52029f6f20e725b 2017-02-01 17:56 +0000 [b47cf1a7d6] Richard Mudgett * res_pjsip: Fix some off nominal tdata leaks. Change-Id: I243a4be5e7fbfe604923764969c4ee04eee89b9d 2017-02-03 15:26 +0000 [7b280e7ccf] Sebastien Duthil * res_ari: fix memory leak for channelvars In ari.conf, when setting the option channelvars, every Stasis channel snapshot would create a list of variable/value that would not be freed when the snapshot is freed, resulting in a often-recurring memory leak. ASTERISK-26767 #close Change-Id: Ia37dd9d68063d7f879193df02ede293e5ded716d 2017-02-03 02:25 +0000 [c6c7f17206] Tzafrir Cohen * libasteriskssl: do nothing with OpenSSL >= 1.1 OpenSSL 1.1 requires no explicit initialization. The hacks in the library are not needed. They also happen to fail running Asterisk. Change-Id: I3b3efd5d80234a4c45a8ee58dcfe25b15d9ad100 2017-01-20 23:59 +0000 [bc041ca14a] Tzafrir Cohen * tcptls: use TLS_client_method with OpenSSL 1.1 OpenSSL 1.1 introduced TLS_client_method() and deprecated the previous version-specific methods (such as TLSv1_client_method(). Other than being simpler to use and more correct (gain support for TLS newer that TLS1, in our case), the older ones produce a deprecation warning that fails the build in dev-mode. Change-Id: I257b1c8afd09dcb0d96cda3a41cb9f7a15d0ba07 2017-01-20 23:57 +0000 [2c8d0764de] Tzafrir Cohen * openssl 1.1 support: use OPENSSL_VERSION_NUMBER Use OPENSSL_VERSION_NUMBER instead of OPENSSL_API_COMPAT to detect the openssl 1.1 API. Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458 2017-01-31 18:28 +0000 [50029f585e] Richard Mudgett * channel.c: Fix unbalanced read queue deadlocking local channels. Using the timerfd timing module can cause channel freezing, lingering, or deadlock issues. The problem is because this is the only timing module that uses an associated alert-pipe. When the alert-pipe becomes unbalanced with respect to the number of frames in the read queue bad things can happen. If the alert-pipe has fewer alerts queued than the read queue then nothing might wake up the thread to handle received frames from the channel driver. For local channels this is the only way to wake up the thread to handle received frames. Being unbalanced in the other direction is less of an issue as it will cause unnecessary reads into the channel driver. ASTERISK-26716 is an example of this deadlock which was indirectly fixed by the change that found the need for this patch. * In channel.c:__ast_queue_frame(): Adding frame lists to the read queue did not add the same number of alerts to the alert-pipe. Correspondingly, when there is an exceptionally long queue event, any removed frames did not also remove the corresponding number of alerts from the alert-pipe. ASTERISK-26632 #close Change-Id: Ia98137c5bf6e9d6d202ce0eb36441851875863f6 2017-01-31 16:38 +0000 [97c308471d] Richard Mudgett * res_agi: Prevent an AGI from eating frames it should not. (Re-do) A dialplan intercept routine is equivalent to an interrupt routine. As such, the routine must be done quickly and you do not have access to the media stream. These restrictions are necessary because the media stream is the responsibility of some other code and interfering with or delaying that processing is bad. A possible future dialplan processing architecture change may allow the interception routine to run in a different thread from the main thread handling the media and remove the execution time restriction. * Made res_agi.c:run_agi() running an AGI in an interception routine run in DeadAGI mode. No touchy channel frames. ASTERISK-25951 ASTERISK-26343 ASTERISK-26716 Change-Id: I638f147ca7a7f2590d7194a8ef4090eb191e4e43 2017-01-31 16:32 +0000 [72e3fc5845] Richard Mudgett * Frame deferral: Revert API refactoring. There are several issues with deferring frames that are caused by the refactoring. 1) The code deferring frames mishandles adding a deferred frame to the deferred queue. As a result the deferred queue can only be one frame long. 2) Deferrable frames can come directly from the channel driver as well as the read queue. These frames need to be added to the deferred queue. 3) Whoever is deferring frames is really only doing the __ast_read() to collect deferred frames and doesn't care about the returned frames except to detect a hangup event. When frame deferral is completed we must make the normal frame processing see the hangup as a frame anyway. As such, there is no need to have varying hangup frame deferral methods. We also need to be aware of the AST_SOFTHANGUP_ASYNCGOTO hangup that isn't real. That fake hangup is to cause the PBX thread to break out of loops to go execute a new dialplan location. 4) To properly deal with deferrable frames from the channel driver as pointed out by (2) above, means that it is possible to process a dialplan interception routine while frames are deferred because of the AST_CONTROL_READ_ACTION control frame. Deferring frames is not implemented as a re-entrant operation so you could have the unsupported case of two sections of code thinking they have control of the media stream. A worse problem is because of the bad implementation of the AMI PlayDTMF action. It can cause two threads to be deferring frames on the same channel at the same time. (ASTERISK_25940) * Rather than fix all these problems simply revert the API refactoring as there is going to be only autoservice and safe_sleep deferring frames anyway. ASTERISK-26343 ASTERISK-26716 #close Change-Id: I45069c779aa3a35b6c863f65245a6df2c7865496 2017-02-02 11:26 +0000 [4c51ad158d] Sean Bright * res_odbc: Remove deprecated settings from sample configuration file ASTERISK-26704 #close Reported by: Anthony Messina Change-Id: I976a1f94cf79c5f31e76174c61f5c6a65fd6354f 2017-02-01 17:14 +0000 [7d9b50a7b2] Richard Mudgett * res_resolver_unbound.c: Fix frequent ref leak caught by excessive ref trap. ASTERISK-26765 Change-Id: I27eb97df7f8d7e624b0b9a61c0fcee4718c86d8d 2017-02-01 15:56 +0000 [2849b726b6] Sean Bright * audiohooks: Muting a hook can mute underlying frames If an audiohook is placed on a channel that does not require transcoding, muting that hook will cause the underlying frames to be muted as well. The original patch is from David Woolley but I have modified slightly. ASTERISK-21094 #close Reported by: David Woolley Patches: ASTERISK-21094-Patch-1.8-1.txt (license #5737) patch uploaded by David Woolley Change-Id: Ib2b68c6283e227cbeb5fa478b2d0f625dae338ed 2017-02-01 13:54 +0000 [bbed75c3ba] Mark Michelson * Update qualifies when AOR configuration changes. Prior to this change, qualifies would only update in the following cases: * A reload of res_pjsip.so was issued. * A dynamic contact was re-registered after its AOR's qualify_frequency had been changed This does not work well if you are using realtime for your AORs. You can update your database to have a new qualify_frequency, but the permanent contacts on that AOR will not have their qualifies updated. And the dynamic contacts on that AOR will not have their qualifies updated until the next registration, which could be a long time. This change seeks to fix this problem by making it so that whenever AOR configuration is applied, the contacts pertaining to that AOR have their qualifies updated. Additions from this patch: * AOR sorcery objects now have an apply handler that calls into a newly added function in the OPTIONS code. This causes all contacts associated with that AOR to re-schedule qualifies. * When it is time to qualify a contact, the OPTIONS code checks to see if the AOR can still be retrieved. If not, then qualification is canceled on the contact. Alterations from this patch: * The registrar code no longer updates contact's qualify_frequence and qualify_timeout. There is no point to this since those values already get updated when the AOR changes. * Reloading res_pjsip.so no longer calls the OPTIONS initialization function. Reloading res_pjsip.so results in re-loading AORs, which results in re-scheduling qualifies. Change-Id: I2e7c3316da28f389c45954f24c4e9389abac1121 2017-01-31 11:17 +0000 [aeea634bc0] Joshua Colp * res_pjsip: Handle invocation of callback on outgoing request when error occurs. There are some error cases in PJSIP when sending a request that will result in the callback for the request being invoked. The code did not handle this case and assumed on every error case that the callback was not invoked. The code has been changed to check whether the callback has been invoked and if so to absorb the error and treat it as a success. ASTERISK-26679 ASTERISK-26699 Change-Id: I563982ba204da5aa1428989a11c06dd9087fea91 2017-01-30 09:02 +0000 [7a16524a83] Sean Bright * res_rtp_asterisk: Swap byte-order when sending signed linear Before Asterisk 13, signed linear was converted into network byte order by a smoother before being sent over the network. We restore this behavior by forcing the creation of a smoother when slinear is in use and setting the appropriate flags so that the byte order conversion is always done. ASTERISK-24858 #close Reported-by: Frankie Chin Change-Id: I868449617d1a7819578f218c8c6b2111ad84f5a9 2017-01-31 12:46 +0000 [e252aff9ad] George Joseph * debug_utilities: Install ast_logescalator to /var/lib/asterisk/scripts Forgot to install it with the original patch Change-Id: I8bdb540a6694971ae5fe21f48d532332c6482e4c 2017-01-25 06:50 +0000 [ef4deb8ecd] George Joseph * debug_utilities: Add ast_logescalator The escalator works by creating a set of startup commands in cli.conf that set up logger channels and issue the debug commands for the subsystems specified. If asterisk is running when it is executed, the same commands will be issued to the running instance. The original cli.conf is saved before any changes are made and can be restored by executing '$prog --reset'. The log output will be stored in... $astlogdir/message.$uniqueid $astlogdir/debug.$uniqueid $astlogdir/dtmf.$uniqueid $astlogdir/fax.$uniqueid $astlogdir/security.$uniqueid $astlogdir/pjsip_history.$uniqueid $astlogdir/sip_history.$uniqueid Some minor tweaks were made to chan_sip, and res_pjsip_history so their history output could be send to a log channel as packets are captured. A minor tweak was also made to manager so events are output to verbose when "manager set debug on" is issued. Change-Id: I799f8e5013b86dc5282961b27383d134bf09e543 2017-01-23 09:35 +0000 [178b90af02] Torrey Searle * libastssl/pj: libastssl/pj should have an so_version Issue introduced in b59956a87. In the non-darwin case libastssl/pj should be versioned. This causes the symbol file for this lib to not be generated. Change-Id: Ib07ae8c40252813c488e2c1ac6204fd42816dd4c (cherry picked from commit 54b027916a71f2b83b2050cef5ef704ea5de39b2) 2017-01-24 19:51 +0000 [138cd8d019] Kirill Katsnelson * make_build_h: handle backslashes in external strings LikewiseOpen creates user names with a backslash in them. A gentle massage with sed(1) allows such strings to be inserted into build.h properly quoted. I am also adding the same for host name and other strings used in the script that are more or less user-controlled. ASTERISK-26754 Change-Id: Iac5ef2b67a68ee58f35ddbf86bb818ba6eabecae 2017-01-24 22:31 +0000 [8270d2436d] Kirill Katsnelson * app_queue: Fix queues randomly disappearing on reload With 500+ queues and a reload every minute, a random queue disappears upon reload. The cause is mususe of the 'dead' flag. Namely, all queues were marked dead up front, and then "resurrected" by dropping this flag for those found in the configuration. But a queue marked dead can be removed also when control leaves the app entry point on a PBX thread. With this change, the queue is marked only not found, and at the end of reload only the queues that are still not found are actually marked as dead, so the dead flag is never reset, and set only on positively dead queues. ASTERISK-26755 Change-Id: I3a4537aec9eb8d8aeeaa0193407e3523feb004bf 2017-01-26 07:57 +0000 [7fa3de7ae9] Joshua Colp * res_pjsip_endpoint_identifier_ip: Fix memory leak of hosts when resolving. This change adds a missing unreference of the hostname when resolving and also cleans up the iterator. ASTERISK-26735 Change-Id: Ic012ebaf3d89e714eec340b7b0c5e63c66af857a 2017-01-25 15:26 +0000 [d32bd63860] Mark Michelson * Add reload options to CLI/AMI stale object commands. Marking an object as stale in a memory cache is supposed to prime the cache so that the next time the item is retrieved, the stale item is deleted from the cache and a background task is run to re-populate the cache with a fresh version of the object. The problem is, there are some object types out there for which there is no natural reason that they would be retrieved from the backend with any regularity. Outbound PJSIP registrations are a good example of this. At startup, they are read, and an object-specific state is created that refers to the initially-retrieved object for all time. Adding the "reload" option to the CLI/AMI commands gives the cache the opportunity to manually re-retrieve the object from the backend, both storing the new object in the cache and applying the new object's configuration to the module that uses that object. Change-Id: Ieb1fe7270ceed491f057ec5cbf0e097bde96c5c8 2017-01-10 17:39 +0000 [20aed30d9a] Richard Mudgett * T.140: Fix format ref and memory leaks. * channel.c:ast_sendtext(): Fix T.140 SendText memory leak. * format_compatibility.c: T.140 RED and T.140 were swapped. * res_rtp_asterisk.c:rtp_red_init(): Fix ast_format_t140_red ref leak. * res_rtp_asterisk.c:rtp_red_init(): Fix data race after starting periodic scheduled red_write(). * res_rtp_asterisk.c: Some other minor misc tweaks. Change-Id: Ifa27a2e0f8a966b1cf628607c86fc4374b0b88cb 2017-01-24 15:39 +0000 [ee2b0f2eef] Joshua Colp * res_pjsip_endpoint_identifier_ip: Ensure error defaults to 0. When configuring a match using a netmask the error variable was not defaulting to 0. For some people this would cause the code to think an error occurred when adding the match when in reality it added perfectly fine. ASTERISK-26693 Change-Id: I850c250813742bddde65c84e739093c9e01dfe56 2017-01-10 17:37 +0000 [930a24a730] Richard Mudgett * astobj2.c: Add excessive ref count trap. Change-Id: I32e6a589cf9009450e4ff7cb85c07c9d9ef7fe4a 2017-01-10 13:11 +0000 [de28c1b9f1] Richard Mudgett * main/app.c: Memory corruption from early format destruction. * make_silence() created a malloced silence slin frame without adding a slin format ref. When the frame is destroyed it will unref the slin format that never had a ref added. Memory corruption is expected to follow. * Simplified and fixed counting the number of samples in a frame list for make_silence(). * Eliminated an unnecessary RAII_VAR associated with the make_silence() frame. Change-Id: I47de3f9b92635b7f8b4d72309444d6c0aee6f747 2017-01-11 14:59 +0000 [2039eb8edf] Richard Mudgett * frame.c: Fix off-nominal format ref leaks. * ast_frisolate() could leak frame format refs on allocation failures. * Similified code in ast_frisolate() and code used by ast_frisolate(). Change-Id: I79566d4d36b3d7801bf0c8294fcd3e9a86a2ed6d 2017-01-13 19:08 +0000 [e922979d49] Richard Mudgett * stasis_bridge.c: Fix off-nominal stasis control ref leak. Change-Id: Ib17218343a6596832060180e19386da9df150ac8 2017-01-10 12:30 +0000 [56854f22d2] Richard Mudgett * res_musiconhold.c: Fix format ref leak when parsing MOH config class. Change-Id: Ica8e8e2ce7604c2c61ec55bef07dc675361d2ea5 2017-01-10 14:03 +0000 [d87f81ddb1] Richard Mudgett * chan_oss.c: Fix format ref leak in oss_read(). Change-Id: I0a5d56c7dcf327d60f86a4c25a23571733709fd0 2017-01-10 17:48 +0000 [36bdd7c1a0] Richard Mudgett * Add notes about embedded ast_frame structs holding a format ref. mod_format.h: Note ast_filestream.fr holds a format ref. translate.h: Note ast_trans_pvt.f holds a format ref. Change-Id: I86bda354d725207b41e08920355d7c31b2d7f749 2017-01-20 21:13 +0000 [6f3e8c8e01] Richard Mudgett * PJPROJECT logging: Fix detection of max supported log level. The mechanism used for detecting the maximum log level compiled into the linked pjproject did not work. The API call simply stores the requested level into an integer and does no range checking. Asterisk was assuming that there was range checking and limited the new value to the allowable range. To get the actual maximum log level compiled into the linked pjproject we need to get and save off the initial set log level from pjproject. This is the maximum log level supported. * Get and save off the initial log level setting before altering it to the desired level on startup. This has to be done by a macro rather than calling a core function to avoid incorrectly linking pjproject. * Split the initial log level warning messages to warn if the linked pjproject cannot support the requested startup level and if it is too low to get the pjproject buildopts for "pjproject show buildopts". * Adjust the CLI "pjproject set log level" to check the saved max log level and to generate normal output messages instead of a warning message. ASTERISK-26743 #close Change-Id: I40aa76653e2a1dece66c3f8734594b4f0471cfb4 2017-01-05 13:21 +0000 [0ea3c371c5] Richard Mudgett * res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands. ASTERISK-23828 #close Change-Id: Ifb8a3b61f447aedc58a8e6b36a810f7566018567 2017-01-23 16:18 +0000 [4bfeda6ee4] Mark Michelson * Free endpoint ACLs when destroying PJSIP endpoints. If endpoint ACLs were specified, they were not being freed when endpoints were destroyed. On systems with realtime endpoints, this could add up quickly since each DB lookup would allocate the ACL without freeing it. ASTERISK-26731 #close Reported by Ustinov Artem Change-Id: Ie1f8bf5b7a0de628c975beba01e69c56893331ad 2017-01-19 09:05 +0000 [6691606723] George Joseph * ari: Implement 'debug all' and request/response logging The 'ari set debug' command has been enhanced to accept 'all' as an application name. This allows dumping of all apps even if an app hasn't registered yet. To accomplish this, a new global_debug global variable was added to res/stasis/app.c and new APIs were added to set and query the value. 'ari set debug' now displays requests and responses as well as events. This required refactoring the existing debug code. * The implementation for 'ari set debug' was moved from stasis/cli.{c,h} to ari/cli.{c,h}, and stasis/cli.{c,h} were deleted. * In order to print the body of incoming requests even if a request failed, the consumption of the body was moved from the ari stubs to ast_ari_callback in res_ari.c and the moustache templates were then regenerated. The body is now passed to ast_ari_invoke and then on to the handlers. This results in code savings since that template was inserted multiple times into all the stubs. An additional change was made to the ao2_str_container implementation to add partial key searching and a sort function. The existing cli code assumed it was already there when it wasn't so the tab completion was never working. Change-Id: Ief936f747ce47f1fb14035fbe61152cf766406bf (cherry picked from commit 1d890874f39a5a81b20da44358143ed9b54ab0fe) 2017-01-20 23:41 +0000 [f3f9175df0] Tzafrir Cohen * test_voicemail_api: order of params to VERIFY macros Fix order of parameters in calls to VM_API_INT_VERIFY and VM_API_STRING_VERIFY ASTERISK-26739 #close Change-Id: I30dc6b36893aadad6012be3f16f93aa5720870d6 Note: status: builds. Not tested any further. 2017-01-23 09:10 +0000 [96e7291cbd] George Joseph * pjproject_bundled: Fix setting max log level An earlier attempt to prevent pjsua from spitting out an extra 6795 lines of debug output every time the testsuite called it was also turning off the ability for asterisk to output debug info when it needed to. This patch reverts the earlier fix and instead adds a pjproject patch that sets the startup log level to 1 for pjsua pjsystest and the pjsua python binding. This is an asterisk-only patch that does not affect pjproject functionality and will not be submitted upstream. Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8 2017-01-23 10:08 +0000 [23690c1b35] Joshua Colp * res_pjsip_endpoint_identifier_ip: Read settings before resolving. An option has been added, srv_lookups, which controls whether SRV lookups are performed on the provided match hosts or not. It was possible for this option to be applied after resolution had already happened. This change makes it so hosts are stored away, settings are read and applied, and then resolution is done. This ensures that no matter the ordering the srv_lookups option is in effect. ASTERISK-26735 Change-Id: I750378cb277be0140f8c5539450270afbfc43388 2016-11-29 09:31 +0000 [1061539b75] Lorenzo Miniero * media: Add experimental support for RTCP feedback. This change adds experimental support for providing RTCP feedback information to codec modules so they can dynamically change themselves based on conditions. ASTERISK-26584 Change-Id: Ifd6aa77fb4a7ff546c6025900fc2baf332c31857 2017-01-22 17:25 +0000 [cfe72c39cf] Richard Mudgett * LISTFILTER: Remove outdated ERROR message. Feeding LISTFILTER an empty variable results in an invalid ERROR message. Earlier changes made the message useless because we can no longer tell if the variable is empty or does not exist. It is valid to try to remove a value from an empty list just as it is valid to try to remove a value that is not in a non-empty list. * Removed the outdated ERROR message. * Added more test cases to the LISTFILTER unit test. Change-Id: Ided9040e6359c44a335ef54e02ef5950a1863134 2017-01-21 14:43 +0000 [dbb9c8141d] Tzafrir Cohen * tests: use datadir for sound files Some (voicemail-related) tests API symlinks beep.gsm and other files from ast_config_AST_VAR_DIR. It should use ast_config_AST_DATA_DIR. ASTERISK-26740 #close Change-Id: Id49c56fb9e16df64b1a2b829693ca7601252df89 2017-01-05 15:11 +0000 [ef9164b9ca] Richard Mudgett * res_pjsip_pubsub.c: Fix AMI event list counts. Fix the AMI PJSIPShowSubscriptionsInbound, PJSIPShowSubscriptionsOutbound, and PJSIPShowResourceLists actions event counts. The reported counts may not necessarily be accurate depending on what happens. The subscriptions count would be wrong if Asterisk ever has outbound subscriptions. The resource list count could be wrong if a list were added or removed during the AMI action being processed. Change-Id: I4344301827523fa174960a42c413fd19abe4aed5 2017-01-05 13:02 +0000 [ab858295a2] Richard Mudgett * res_pjsip_pubsub.c: Fix incorrect message string wrapping. Change-Id: Id771e6fe56d89ce365ddcbb423f820af97211120 2017-01-05 13:01 +0000 [6d648185bc] Richard Mudgett * res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage. Change-Id: Ie0b69a830385452042fa19e7d267c6790ec6b6be 2017-01-05 12:58 +0000 [90f3b1270c] Richard Mudgett * res_pjsip: alloca can never fail. Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1 2017-01-13 11:03 +0000 [d16b3a9917] George Joseph * debug_utilities: Create ast_loggrabber ast_loggrabber gathers log files from customizable search patterns, optionally converts POSIX timestamps to a readable format and tarballs the results. Also a few tweaks were made to ast_coredumper. Change-Id: I8bfe1468ada24c1344ce4abab7b002a59a659495 (cherry picked from commit c70915287837704090d75f181525765de7a17221) 2017-01-01 03:47 +0000 [48730ae65e] Richard Mudgett * res_pjsip_outbound_authenticator_digest.c: Fix spacing in warning messages. Change-Id: I573f0343c0c63a785cd4da60d57cc9f8b9ce7f49 2016-12-22 04:07 +0000 [40b9766a31] Martin Tomec * app_queue: add RINGCANCELED log event on caller hang up QueueLog did not log ringnoanswer when the caller abandoned call before first timeout. It was impossible to get agent membername and ringing duration for this short calls. After some discusions it seems that the best way is to add new event RINGCANCELED, which is generated after caller hangup during ringing. ASTERISK-26665 Change-Id: Ic70f7b0f32fc95c9378e5bcf63865519014805d3 2017-01-12 15:58 +0000 [283c16c6b6] Kevin Harwell * abstract/fixed/adpative jitter buffer: disallow frame re-inserts It was possible for a frame to be re-inserted into a jitter buffer after it had been removed from it. A case when this happened was if a frame was read out of the jitterbuffer, passed to the translation core, and then multiple frames were returned from said translation core. Upon multiple frames being returned the first is passed on, but sebsequently "chained" frames are put back into the read queue. Thus it was possible for a frame to go back into the jitter buffer where this would cause problems. This patch adds a flag to frames that are inserted into the channel's read queue after translation. The abstract jitter buffer code then checks for this flag and ignores any frames marked as such. Change-Id: I276c44edc9dcff61e606242f71274265c7779587 2016-11-06 06:30 +0000 [8cc1cd5df7] Sebastian Gutierrez * app_queue: Add QueueUpdate application. Add an application that allows tracking outbound calls using app_queue. ASTERISK-19862 Change-Id: Ia0ab64aed934c25b2a25022adcc7c0624224346e 2017-01-13 21:23 +0000 [f4e77a5678] Richard Mudgett * taskprocessor.c: Change when high water warning logged. The task processor queue reached X scheduled tasks message was originally intended to get logged only once per task processor to prevent spamming the log. This is no longer necessary since high and low water thresholds can better control when the message is logged. It is beneficial to generate the warning each time a task processor reaches the high water level because PJSIP stops processing new requests while any high water alert is active. Without this change you would have to enable at least debug level 3 logging to know about a repeated alert trigger. * Made generate the warning message whenever a task is pushed into the task processor that triggers the high water alert. * Appended 'again' to the warning for a repeated high water alert trigger. Change-Id: Iabf75a004f7edaf1e5e8c323099418e667cac999 2017-01-10 05:54 +0000 [e0e502d9d2] Aaron An * res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt) Function CHANNEL(rtcp,all_rtt) CHANNEL(rtcp,all_loss) CHANNEL(rtcp,all_jitter) always return 0.0 due to wrong define of macro "AST_RTP_SATA_SET" and "AST_RTP_STAT_STRCPY". It should compare "combined" with "stat" not "current_stat". ASTERISK-26710 #close Reported-by: Aaron An Tested-by: AaronAn Change-Id: Id4140fafbf92e2db689dac5b17d9caa009028a15 2017-01-10 18:10 +0000 [0d53c91fba] George Joseph * debug_utilities: Create the ast_coredumper utility This utility allows easy manipulation of asterisk coredumps. * Configurable search paths and patterns for existing coredumps * Can generate a consistent coredump from the running instance * Can dump the lock_infos table from a coredump * Dumps backtraces to separate files... - thread apply 1 bt full -> .thread1.txt - thread apply all bt -> .brief.txt - thread apply all bt full -> .full.txt - lock_infos table -> .locks.txt * Can tarball corefiles and optionally delete them after processing * Can tarball results files and optionally delete them after processing * Converts ':' in coredump and results file names '-' to facilitate uploading. Jira for instance, won't accept file names with colons in them. Tested on Fedora24+, Ubuntu14+, Debian6+, CentOS6+ and FreeBSD9+[1]. [1] For *BSDs, the "devel/gdb" package might have to be installed to get a recent gdb. The utility will check all instances of gdb it finds in $PATH and if one isn't found that can run python, it prints a friendly error. Change-Id: I935d37ab9db85ef923f32b05579897f0893d33cd (cherry picked from commit cb47b4556053cd50d9102eef913671ad0306062d) 2017-01-08 10:29 +0000 [e54c8aec34] George Joseph * pjproject_bundled: Fix compilation with MALLOC_DEBUG When MALLOC_DEBUG was specified, make was failing. Immediately remaking would work. The issues was in the ordering of the make dependencies. Change-Id: If6030b54fc693f3179f32bfd20c6b5d5f1b3f7cd 2017-01-05 06:11 +0000 [a7d856cd96] Joshua Colp * res_pjsip_endpoint_identifier_ip: Add support for SRV lookups. This change implements SRV support for the IP based endpoint identifier module. All possible addresses through SRV are looked up and added as matches. If no SRV records are available a fallback to normal host resolution is done. If an IP address is provided then no SRV lookup occurs. This is configured using the "srv_lookups" option on the identify section and defaults to "yes". ASTERISK-26693 Change-Id: I6b641e275bf96629320efa8b479737062aed82ac 2016-11-06 06:37 +0000 [740ca862e4] Sebastian Gutierrez * app_queue: add new Service Level calculation Adds a new formula for SL2 and documentation ASTERISK-26559 Change-Id: I0970c620460507cd9d45b0d43600779c8915e770 2016-12-19 15:03 +0000 [d96e350256] Jonathan R. Rose * core/pbx: dialplan show - display filename/line# Adds the ability for extensions to be registered to include filename and line number so that dialplan show output can show the filename and line number of a config file responsible for generating a given extension. This only affects config modules that are written to use the new extension registering functions. In this patch, that only includes pbx_config, so extensions registered in extensions.conf and any included extension will be shown in this manner. Extensions registered in this manner will show the filename and line number *instead* of the registrar. ASTERISK-26658 #close Reported by: Jonathan R. Rose Change-Id: Ieccc6abccdff34ed5c7da3511fd24972b8f2dd30 2016-12-22 09:13 +0000 [aea2285865] Alexander Traud * res_pjsip_session: Access SIPDOMAIN via Dialplan. This feature was available in the SIP channel driver chan_sip. For example, Asterisk is the outbound proxy and has to handle all SIP-URIs, even domains not local to Asterisk. In that case, SIPDOMAIN is used in the Dialplan, to detect and dial remote SIP-URIs. This change here sets the SIP destination domain of an inbound call (SIPDOMAIN) in the SIP channel driver res_pjsip as well. ASTERISK-26670 #close Change-Id: I27c880dc404a3c1c6792e1ba3545475339577243 2017-01-04 05:50 +0000 [e220c11bec] Alexander Traud * chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND. After a SIP_CODEC_INBOUND in the dialplan, do not continue with cached formats but remember the joint format. Cached formats contain default parameters, often create an empty fmtp line. However, a joint format might have passed format_get_joint(.) in a res_format_attr_* module (like Opus Codec) and contain the resulting format parameters from a SDP negotiation. ASTERISK-26691 #close Change-Id: I35712d98a793d4c3efdd156cec57deab9014b1dc 2017-01-03 15:14 +0000 [ceb9dae566] George Joseph * pjproject_bundled: Compile pjsua with max log level = 2 A while back, we changed config_site.h to set PJ_LOG_MAX_LEVEL = 6. This allowed us to control the log level better from inside Asterisk. An unfortunate side effect of this was that the pjsua binary and python bindings were also compiled with log level set to 6 so whenever a testsuite test that uses pjsua runs, it spits out 6795 lines of debug in an instant even before the test starts. I believe this overruns the Jenkins capture buffer and prevents the test from properly terminating. In turn, this results in the testsuite just hanging until the job is killed. It's more frequent on the higher end agents because they can spit out the messages faster. Unfortunately, the messages are all spit out before we have control of the python pj.Lib instance where we can set logging levels so the only alternative was to actually compile pjsua and _pjsua.so with an overridden PJ_LOG_MAX_LEVEL. Although defining a lower max level was done in the Makefile, the define in config_site.h had to be wrapped with "#ifndef" so the change would take effect. Change-Id: I2af9e7d48dde1927279c586c9c725d868fe6f3ff 2016-12-22 16:00 +0000 [ae57652983] Joshua Colp * chan_pjsip: Use session for retrieving CHANNEL() information. The CHANNEL() dialplan function implementation for PJSIP allows querying of PJSIP specific information. This used the channel passed in to get the PJSIP session and associated information. It is possible for this channel to be masqueraded and end up as a different channel type by the time the information request is actually acted upon. This change retrieves the PJSIP session safely and accesses data from it (including channel). This provides a guarantee that the session and channel will not be altered when the request is being acted upon. ASTERISK-26673 Change-Id: I335e12b89e1820cafdd92b3e7526b8ba649eb7e6 2016-12-31 19:56 +0000 [386e3a01b3] Joshua Elson * res_pjsip: Fix known compact header issues ASTERISK-26684 #close Change-Id: Ifd7e401c45015119dd5e8421dbfe3afa6381744a 2016-12-30 06:59 +0000 [aad29b9bca] Martin Tomec * res_calendar: delete old calendars after reload When "fetch_again_at_reload" is set in config, we create now new object and thread for each reloaded calendar (with new configuration). Old calendar should be then unlinked, so the old thread can exit and free memory. ASTERISK-26683 Change-Id: Ic17fba9371c5a8b26a6bc54ea4957c13a32a343e 2016-12-30 09:10 +0000 [5a5953f98c] JoshE (license 6075) * res_pjsip_refer: Handle compact Refer-To header. refer_incoming_refer_request needed to look for the "r" header as well as the "Refer-To" header. ASTERISK-26655 #close patches: refer_compact_fix.diff submitted by JoshE (license 6075) Change-Id: I610410a99b02427ea5db887aeb454d5f12c2259f 2016-12-23 12:11 +0000 [ac04e63ac2] Richard Mudgett * bridge_native_rtp.c: Minor code cleanups. In native_rtp_bridge_compatible_check() * Made one variable declaration per line. * Extracted if test assignment to make the test easier to see. * Made long if tests easier to see the combinatorial logic. * Added bridge id to a couple debug messages. Change-Id: I65bc5732aa7c9a2537f062f106fbea711cf2daad 2016-12-23 12:10 +0000 [da6f40c9ff] Richard Mudgett * bridge_native_rtp.c: Fix native rtp bridge data race. native_rtp_bridge_compatible() didn't lock the bridge channels before checking the channels for native bridging ability. As a result, one of the channel's native format capabilities structure got replaced out from under the native bridge check. Use of a stale pointer to freed memory causes bad things to happen. MALLOC_DEBUG, DO_CRASH, and the tests/channels/pjsip/transfers/blind_transfer/caller_direct_media testsuite test caught this. * Add missing channel locking in native_rtp_bridge_compatible(). Change-Id: If25fdb3ac8e85563c4857fb8216b3d9dc3d0fa53 2016-12-21 16:28 +0000 [b576b58d74] Richard Mudgett * res_rtp_asterisk.c: Fix uninitialized memory crash. ast_rtp_remote_address_set() could pass an uninitialized 'us' parameter to ast_ouraddrfor(). If ast_ouraddrfor() returns an error then the 'us' parameter may not get initialized. Thus when the code tries to save the 'us' parameter to the local address we could try to copy a ridiculous sized memory buffer and segfault. * Made pass an initialized 'us' parameter to ast_ouraddrfor(). * Optimized out the 'us' struct variable. ASTERISK-26672 #close Change-Id: I4acea5dcdf0813da2c7d3e11c2d6067d160d17dc 2016-12-21 16:25 +0000 [67cc8499a2] Richard Mudgett * acl.c: Improve ast_ouraddrfor() diagnostic messages. * Made not generate strings unless they will actually be used. ASTERISK-26672 Change-Id: I155fbe7fdff5ce47dfe5326f3baf5446849702c3 2016-12-21 17:54 +0000 [67b47191e9] Richard Mudgett * chan_rtp.c: Fix uninitialized memory crash. unicast_rtp_request() could pass an uninitialized 'us' parameter to ast_ouraddrfor(). If ast_ouraddrfor() returns an error then the 'us' parameter may not get initialized. Thus when the code tries to save the 'us' parameter to the local address we could try to copy a ridiculous sized memory buffer and segfault. * Made pass an initialized 'us' parameter to ast_ouraddrfor() and abort the UnicastRTP channel request if it fails. ASTERISK-26672 Change-Id: I1ef7a7c09f4da4f15dcb6de660d2bcac5f2a95c0 2016-12-21 17:55 +0000 [2fc65173e5] Richard Mudgett * res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip(). We access uninitialized memory when the 'ourip' parameter does not have an initial guess to our IP address. ASTERISK-26672 Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15 2016-12-07 15:23 +0000 [8b7d252987] Richard Mudgett * res_rtp_asterisk.c: Fix off nominal memory leak. Change-Id: I95b1088d11244a2edae6607c12fbf33b38658a75 2016-12-14 02:21 +0000 [bab253ac9f] Tzafrir Cohen * Fixes to various issues reported by pyflakes Pyflake is a python (2) source checker. This patch fixes various (mostly trivial) errors and warnings it reports. Change-Id: Ia35c5ac61751b927814cf693994c632c412386ea 2016-12-09 12:23 +0000 [f461f65dea] Martin Tomec * app_queue: Ensure member is removed from pending when hanging up. In some cases member is added to pending_members, and the channel is hung up before any extension state change. So the member would stay in pending_members forever. So when we call do_hang, we should also remove member from pending. ASTERISK-26621 #close Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54 2016-12-18 15:23 +0000 [d29eb3b99d] George Joseph * pjproject_bundled: Make build single threaded There were just too many issues in various environments with multi threaded building of pjproject. It doesn't really speed things up anyway since asterisk is already being compiled in parallel. Change-Id: Ie5648fb91bb89b4224b6bf43a0daa1af793c4ce1 2016-12-08 20:00 +0000 [8fbb384ea2] Corey Farrell * chan_sip: Reorder unload_module to deal with stuck TCP threads. In some situations TCP threads may become frozen. This creates the possibility that Asterisk could segfault if they become unfrozen after chan_sip has been dlclose'd. This reorders the unload_module process to allow abort if threads do not exit within 5 seconds. High level order as follows: 1) Unregister from the core to stop new requests. 2) Signal threads to stop 3) Clear config based tables (but do not free the table itself). 4) Verify that threads have shutdown, cancel unload if not. 5) Clean all remaining resources. ASTERISK-26586 Change-Id: Ie23692041d838fbd35ece61868f4c640960ff882 2016-12-16 01:32 +0000 [147b8e636e] David M. Lee * configure: fix with-pjproject-bundled The AC_ARG_WITH macro's shell variable is withval; not enableval. Purely coincidentally, the option would work when --enable-dev-mode is given. Also fixed a portability problem with bootstrap.sh, since -printf is not a portable option for find. Change-Id: I0f0e5b1a934b5af5737713834361e9c95b96b376 2016-12-15 13:25 +0000 [d27dee3cca] Richard Mudgett * autosupport: Add 'pjproject show buildopts' Change-Id: I8aa55a7c3fb175235ddc7f85e9457d5102d06fa7 2016-12-14 14:21 +0000 [9404efa6f4] Richard Mudgett * chan_dahdi.c: Fix bounds check regression. Caused by ASTERISK-25494 Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb 2016-12-13 14:34 +0000 [45a5e2abc6] Richard Mudgett * res_pjsip: Add/update ERROR msg if invalid URI. ASTERISK-24499 Change-Id: Ie305153e47e922233b2ff24715e0e326e5fa3a6c 2016-12-12 18:38 +0000 [44e72c9d44] Richard Mudgett * MESSAGE: Flush Message/ast_msg_queue channel alert pipe. ASTERISK-25083 Change-Id: Id54baa57a8dbca84e29f28bcd2ffc0a5ac12d8b2 2016-12-13 14:06 +0000 [19328de2ab] George Joseph * res_sorcery_memory_cache: Change an error to a debug message When a sorcery user calls ast_sorcery_delete on an object that may have already expired from the cache, res_sorcery_memory_cache spits out an ERROR. Since this can happen frequently and validly when an inbound registration expires after the cache entry expired, the errors are unnecessary and misleading. Changed to a debug/1. Change-Id: Idf3a67038c16e3da814cf612ff4d6d18ad29ecd7 2016-12-09 08:14 +0000 [31268e0a28] George Joseph * pjproject_bundled: Retry download if previously saved tarball is bad If a tarball is corrupted during download, the makefile will attempt to download it again. If the tarball somehow gets corrupted after it's downloaded however, the makefile was just failing. We now retry the download. ASTERISK-26653 #close Change-Id: I1b24d454852d80186f60c5a65dc4624ea8a1c359 2016-12-08 12:43 +0000 [4c6ba1dbba] Badalyan Vyacheslav * Fix typo in chan_sip The conditional expressions of the 'if' operators situated alongside each other are identical. Change-Id: I652b6dcddb3be007e669a6aa8107edb31a1ddafb 2016-12-08 12:30 +0000 [934aa2c768] Badalyan Vyacheslav * res_pjsip: Fix 'A = B != C' kind. Consider reviewing the expression of the 'A = B != C' kind. The expression is calculated as following: 'A = (B != C)' Change-Id: Ibaa637dfda47d51a20e26069d3103e05ce80003d 2016-12-08 12:54 +0000 [51118e7d70] Badalyan Vyacheslav * chan_sip: Delete unneeded check P is always true. We check it before Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb 2016-12-08 12:58 +0000 [fe5be81821] Badalyan Vyacheslav * Small code cleanup in chan_sip The conditional expressions of the 'if' operators situated alongside each other are identical. Change-Id: I2cf7c317b106ec14440c7f1b5dcfbf03639f748a 2016-12-08 12:34 +0000 [149d8db96c] Badalyan Vyacheslav * Fix IO conversion bug Expression 'rlen < 0' is always false. Unsigned type value is never < 0. Change-Id: Id9f393ff25b009a6c4a6e40b95f561a9369e4585 2016-11-30 09:31 +0000 [c796f00c35] Walter Doekes * chan_sip: Do not allow non-SP/HTAB between header key and colon. RFC says SIP headers look like: HCOLON = *( SP / HTAB ) ":" SWS SWS = [LWS] ; sep whitespace LWS = [*WSP CRLF] 1*WSP ; linear whitespace WSP = SP / HTAB ; from rfc2234 chan_sip implemented this: HCOLON = *( LOWCTL / SP ) ":" SWS LOWCTL = %x00-1F ; CTL without DEL This discrepancy meant that SIP proxies in front of Asterisk with chan_sip could pass on unknown headers with \x00-\x1F in them, which would be treated by Asterisk as a different (known) header. For example, the "To\x01:" header would gladly be forwarded by some proxies as irrelevant, but chan_sip would treat it as the relevant "To:" header. Those relying on a SIP proxy to scrub certain headers could mistakenly get unexpected and unvalidated data fed to Asterisk. This change fixes so chan_sip only considers SP/HTAB as valid tokens before the colon, making it agree on the headers with other speakers of SIP. ASTERISK-26433 #close AST-2016-009 Change-Id: I78086fbc524ac733b8f7f78cb423c91075fd489b 2016-11-14 18:18 +0000 [5c89604a32] Joshua Colp * res_format_attr_opus: Fix crash when fmtp contains spaces. When an opus offer or answer was received that contained an fmtp line with spaces between the attributes the module would fail to properly parse it and crash due to recursion. This change makes the module handle the space properly and also removes the recursion requirement. ASTERISK-26579 Change-Id: I01f53e5d9fa9f1925a7365f8d25071b5b3ac2dc3 2016-12-06 14:54 +0000 [79b09b5f18] George Joseph * res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command The PJSIPShowRegistrationsInbound AMI command was just dumping out all AORs which was pretty useless and resource heavy since it had to get all endpoints, then all aors for each endpoint, then all contacts for each aor. PJSIPShowRegistrationInboundContactStatuses sends ContactStatusDetail events which meets the intended purpose of the other command and has significantly less overhead. Also, some additional fields that were added to Contact since the original creation of the ContactStatusDetail event have been added to the end of the event. For compatibility purposes, PJSIPShowRegistrationsInbound is left intact. ASTERISK-26644 #close Change-Id: I326f12c9ecb52bf37ba03f0748749de4da01490a 2016-12-07 14:22 +0000 [3b6e6cd01c] snuffy * tests_dns: Make DNS tests older nameser.h compatible Fix the tests for DNS to use older style nameser.h as in ASTERISK-26608. Tested on: OpenBSD 6.0, Debian 8 ASTERISK-26647 #close Change-Id: I285913c44202537c04b3ed09c015efa6e5f9052d 2016-12-06 16:45 +0000 [76d52dc228] Richard Mudgett * Bundled pjproject: Fix finding SIP transactions. Occasionally SIP message transactions are not found when they should be. In the particular case an incoming INVITE transaction is CANCELed but the INVITE transaction cannot be found so a 481 response is returned for the CANCEL. The problematic calls have a '_' character in the Via branch parameter. The problem is in the pjproject PJ_HASH_USE_OWN_TOLOWER feature's code. The problem with the "own tolower" code is that it does not calculate the same hash value as when the pj_tolower() function is used. The "own tolower" code will erroneously modify the ASCII characters '@', '[', '\\', ']', '^', and '_'. Calls to pj_hash_calc_tolower() can use the PJ_HASH_USE_OWN_TOLOWER substitute algorithm when enabled. Calls to pj_hash_get_lower(), pj_hash_set_lower(), and pj_hash_set_np_lower() call find_entry() which never uses the PJ_HASH_USE_OWN_TOLOWER algorithm. As a result you may not be able to find a hash tabled entry because the calculated hash values would differ. * Simply disable PJ_HASH_USE_OWN_TOLOWER. ASTERISK-26490 #close Change-Id: If89bfdb5f301b8b685881a9a2a6e0c3c5af32253 2016-12-01 16:49 +0000 [503006123a] Mark Michelson * http: Send headers and body in one write. This is a semi-regression caused by the iostreams change. Prior to iostreams, HTTP headers were written to a FILE handle using fprintf. Then the body was written using a call to fwrite(). Because of internal buffering, the result was that the HTTP headers and body would be sent out in a single write to the socket. With the change to iostreams, the HTTP headers are written using ast_iostream_printf(), which under the hood calls write(). The HTTP body calls ast_iostream_write(), which also calls write() under the hood. This results in two separate writes to the socket. Most HTTP client libraries out there will handle this change just fine. However, a few of our testsuite tests started failing because of the change. As a result, in order to reduce frustration for users, this change alters the HTTP code to write the headers and body in a single write operation. ASTERISK-26629 #close Reported by Joshua Colp Change-Id: Idc2d2fb3d9b3db14b8631a1e302244fa18b0e518 2016-12-06 10:56 +0000 [bf6423a336] Mark Michelson * Iostreams: Correct off-by-one error. ast_iostream_printf() attempts first to use a fixed-size buffer to perform its printf-like operation. If the fixed-size buffer is too small, then a heap allocation is used instead. The heap allocation in this case was exactly the length of the string to print. The issue here is that the ensuing call to vsnprintf() will print a NULL byte in the final space of the string. This meant that the final character was being chopped off the string and replaced with a NULL byte. For HTTP in particular, this caused problems because HTTP publishes the expected Contact-Length. This meant HTTP was publishing a length one character larger than what was actually present in the message. This patch corrects the issue by adding one to the allocation length. ASTERISK-26629 Reported by Joshua Colp Change-Id: Ib3c5f41e96833d0415cf000656ac368168add639 2016-12-06 12:06 +0000 [fe9f070885] George Joseph * pjproject_bundled: Fix missing inclusion of symbols Added back in a -g3, and an -O3 when DONT_OPTIMIZE is not set, to the CFLAGS. Not sure how they went missing. Also fixed an uninstall problem where we weren't removing the symlink from libasteriskpj.so.2 to libasteriskpj.so. While I was there, I fixed it for libasteriskssl as well. Change-Id: I9e00873b1e9082d05b5549d974534b48a2142556 2016-11-30 18:25 +0000 [4b3d3fc741] Richard Mudgett * res_pjsip_outbound_registration.c: Filter redundant statsd reporting. Increasing the testsuite shutdown timeout before forcibly killing Asterisk allowed more events to be sent out. Some tests failed as a result. The tests/channels/pjsip/statsd/registrations failed because we now get the statsd events that a comment in the test configuration stated couldn't be intercepted. Unfortunately, we get a variable number of events because of internal status state transition races generating redundant statsd events. We were reporting redundant statsd PJSIP.registrations.state changes for internal state changes that equated to the same thing publicly. * Made update_client_state_status() filter out redundant statsd updates. ASTERISK-26527 Change-Id: If851c7d514bb530d9226e4941ba97dcf52000646 2016-06-28 16:26 +0000 [26c8552fff] Tzafrir Cohen * OpenSSL 1.1.0 support OpenSSL 1.1.0 includes some major changes in the interface. See https://wiki.openssl.org/index.php/1.1_API_Changes . Status: Right now there are still a few deprecation notes with OpenSSL 1.1.0. But it's a start. Changes: * CRYPTO_LOCK is no longer available. Replace it with its value for now. I don't completely understand what it is used for there. * Remove several functions from libasteriskssl that seem to no longer be needed. * Structures have become opaque and are accesses with accessors. * ERR_remove_thread_state() no longer needed. * SSLv2 code now could no longer be used in 1.1. ASTERISK-26109 #close Change-Id: I5e29d477d486ca29b6aae0dc2f5dff960c1cb82b 2016-11-22 11:20 +0000 [75230f4c01] Guido Falsi * res_rtp: Fix regression when IPv6 is not available. The latest Release candidate fails to create RTP streams when IPv6 is not available. Due to the changes made in September the ast_sockaddr structure passed around to create these streams is always of AF_INET6 type, causing failure when used for IPv4. This patch adds a utility function to check for availability of IPv6 and applies such check at startup to determine how to create the ast_sockaddr structures. ASTERISK-26617 #close Change-Id: I627a4e91795e821111e1cda523f083a40d0e0c3e 2016-11-23 18:27 +0000 [1dfa11b65c] Richard Mudgett * PJPROJECT logging: Made easier to get available logging levels. Use of the new logging is as simple as issuing the new CLI command or setting the new pjproject.conf option. Other options that can affect the logging are how you have the pjproject log levels mapped to Asterisk log types in pjproject.conf and if you have configured Asterisk to log the DEBUG type messages. Altering the pjproject.conf level mapping shouldn't be necessary for most installations as the default mapping is sensible. Configuring Asterisk to log the DEBUG message type is standard practice for collecting debug information. * Added CLI "pjproject set log level" command to dynamically adjust the maximum pjproject log message level. * Added CLI "pjproject show log level" command to see the currently set maximum pjproject log message level. * Added pjproject.conf startup section "log_level" option to set the initial maximum pjproject log message level so all messages could be captured from initialization. * Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into bundled pjproject. Pjproject will use the currently set run time log level to determine if a log message is generated just like Asterisk verbose and debug logging levels. * In log_forwarder(), made always log enabled and mapped pjproject log messages. DEBUG mapped log messages are no longer gated by the current Asterisk debug logging level. * Removed RAII_VAR() from res_pjproject.c:get_log_level(). ASTERISK-26630 #close Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389 2016-11-30 10:48 +0000 [621d886ca7] Mark Michelson * Frame deferral: Re-queue deferred frames one-at-a-time. The recent change that made frame deferral into an API had a behavior change to it. When frame deferral was completed, we would take all of the deferred frames and queue them all onto the channel in one call to ast_queue_frame_head(). Before frame deferral was API-ized, places that performed manual frame deferral would actually take each deferred frame and queue them onto the channel. This change in behavior caused the confbridge_recording test to start failing consistently. Without going too crazily deep into the details, a channel was getting "stuck" in an ast_safe_sleep(). An AMI redirect was attempting to break it out of the sleep, but because there were more frames in the channel read queue than expected, the channel ended up being unable to break from its sleep loop. By restoring the behavior of individual frame queuing after deferral, the test starts passing again. Note, this points to a potential underlying issue pointing to an "unbalance" that can occur when queuing multiple frames at once, and so a follow-up issue is being created to investigate that possibility. Change-Id: Ied5dacacda06d343dea751ed5814a03364fe5a7d 2016-11-15 15:01 +0000 [e5e887be53] Alexei Gradinari * chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no The sending codec is switched to the receiving codec and then is switched back to the best native codec on EVERY receiving RTP packets. This is because after call of ast_channel_set_rawwriteformat there is call of ast_set_write_format which calls set_format which sets rawwriteformat to the best native format. This patch adds a new function ast_set_write_format_path which set specific write path on channel and uses this function to switch the sending codec. ASTERISK-26603 #close Change-Id: I5b7d098f8b254ce8f45546e6c36e5d324737f71d 2016-11-21 15:43 +0000 [ddc951060a] David Kerr * app_originate: Add option to execute gosub prior to dial Issue/patch ASTERISK-26587 was inspired by issue ASTERISK-22992 that requested ability to add callerid into app_originate. Comments in that issue suggested that it was better solved by adding an option to gosub prior to originating the call. The attached patch implements this much like app_dial with two options one to gosub on the originating channel and one to gosub on the newly created channel and behaves just like app_dial. I have tested this patch by adding callerid info to the new channel and also SIPAddHeader (to e.g. add header to force auto answer) and confirmed it works. Have also tested both 'exten' and 'app' versions of app_originate. Opened by: dkerr Patch by: dkerr Change-Id: I36abc39b58567ffcab4a636ea196ef48be234c57 2016-11-28 19:43 +0000 [0e214c4932] Eduardo S. Libardi * res_calendar_caldav: Add support reading gmail calendar The response from gmail calendar includes the string name "caldav:calendar-data". res_calendar_caldav implements the example included in RFC 4791: string "C:calendar-data". When reading the calendar, res_calendar_caldav compare the string and if does not match just discards the event. This commit compares the response to both strings, successfully loading gmail calendar events. Writing to gmail calendar is working prior to this fix. ASTERISK-26624 Reported by: Eduardo S. Libardi Change-Id: Ia1eef10552ae616efb645d390f5ffe81260d7d4a 2016-11-28 15:12 +0000 [a3f48be0da] Matt Jordan * res/res_pjsip: Fix documentation whitespace issues Tabs > Spaces. Change-Id: If1e43a71822615a898e958e0f8b2e882606f0bd0 2016-11-22 10:27 +0000 [0e15760795] Matt Jordan * res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter Per RFC 7118 5.2, the SIP URI 'transport' parameter should advertise 'ws' when WebSockets are to be used as the transport. This applies to both secure and insecure WebSockets. There were two bugs in Asterisk with respect to this: (1) The most egregious occurs in res_pjsip. There, we advertise 'ws' for insecure websockets and 'wss' for secure websockets. While this would seem to make sense - since 'WS' and 'WSS' are used for the Via Transport parameter - this is not the case for the SIP URI. This patch corrects that by registering the secure websockets with pjproject using the shorthand 'WS', and by returning 'ws' when asked for the transport parameter. Note that in pjproject, it is perfectly valid to have multiple transports use the same shorthand. (2) In chan_sip, we return an upper-case version of the transport 'WS' instead of 'ws'. Since we should be strict in what we send and liberal in what we accept (within reason), this patch lower-cases the transport before appending it to the parameter. ASTERISK-24330 #close Reported by: cervajs, Inaki Baz Castillo Change-Id: Iff77b645f8cc3b7cd35168a6676c26b147f22f42 2016-11-28 11:03 +0000 [8a68289766] George Joseph * build_tools: Fix download_externals to handle certified branches download_externals wasn't handling the "certified/13.x" version correctly. Change-Id: I124d195bb117ca36f