diff --git a/app/src/main/assets/config b/app/src/main/assets/config index b24f8e26..372ab0ec 100644 --- a/app/src/main/assets/config +++ b/app/src/main/assets/config @@ -10,6 +10,10 @@ audio_alert opensles,nil audio_srate 8000-48000 audio_channels 1-2 audio_level no +ausrc_format s16 +auenc_format s16 +auplay_format s16 +audec_format s16 rtp_tos 184 rtcp_mux no jitter_buffer_delay 5-10 @@ -19,6 +23,8 @@ dns_server [2001:4860:4860::8888]:53 prefer_ipv6 no module opus.so module g711.so +module g7221.so +module webrtc_aec.so module opensles.so module stun.so module turn.so diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 31d28db8..880feedd 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -1,23 +1,6 @@ -# -# Copyright (C) The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - cmake_minimum_required(VERSION 3.4.1) -# configure import libs set(distribution_DIR ${CMAKE_SOURCE_DIR}/../../../../distribution) add_library(lib_crypto STATIC IMPORTED) @@ -40,6 +23,14 @@ add_library(lib_opus STATIC IMPORTED) set_target_properties(lib_opus PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/opus/lib/${ANDROID_ABI}/libopus.a) +add_library(lib_g722_1 STATIC IMPORTED) +set_target_properties(lib_g722_1 PROPERTIES IMPORTED_LOCATION + ${distribution_DIR}/g7221/lib/${ANDROID_ABI}/libg722_1.a) + +add_library(lib_webrtc STATIC IMPORTED) +set_target_properties(lib_webrtc PROPERTIES IMPORTED_LOCATION + ${distribution_DIR}/webrtc/lib/${ANDROID_ABI}/libwebrtc.a) + add_library(lib_bn STATIC IMPORTED) set_target_properties(lib_bn PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/bn/lib/${ANDROID_ABI}/libbn.a) @@ -61,15 +52,17 @@ target_include_directories(baresip PRIVATE ${distribution_DIR}/baresip/include) target_link_libraries(baresip - android - OpenSLES - lib_baresip - lib_rem - lib_re - lib_ssl - lib_crypto - lib_opus - lib_zrtp - lib_bn - z - log) + android + OpenSLES + lib_baresip + lib_rem + lib_re + lib_ssl + lib_crypto + lib_opus + lib_g722_1 + lib_webrtc + lib_zrtp + lib_bn + z + log) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index c2b8f828..3976af8f 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -367,10 +367,8 @@ class BaresipService: Service() { rejectIntent.putExtra("callp", callp) val rejectPendingIntent = PendingIntent.getService(this, REJECT_REQ_CODE, rejectIntent, PendingIntent.FLAG_UPDATE_CURRENT) - nb.addAction(R.drawable.ic_stat, getString(R.string.answer), - answerPendingIntent) - nb.addAction(R.drawable.ic_stat, getString(R.string.reject), - rejectPendingIntent) + nb.addAction(R.drawable.ic_stat, getString(R.string.answer), answerPendingIntent) + nb.addAction(R.drawable.ic_stat, getString(R.string.reject), rejectPendingIntent) nm.notify(CALL_NOTIFICATION_ID, nb.build()) return } @@ -609,13 +607,11 @@ class BaresipService: Service() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val defaultChannel = NotificationChannel(DEFAULT_CHANNEL_ID, "Default", NotificationManager.IMPORTANCE_LOW) - defaultChannel.description = "Tells that baresip is running" - defaultChannel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC + defaultChannel.lockscreenVisibility = VISIBILITY_PUBLIC nm.createNotificationChannel(defaultChannel) val highChannel = NotificationChannel(HIGH_CHANNEL_ID, "High", NotificationManager.IMPORTANCE_HIGH) - highChannel.description = "Tells about incoming call or message" - highChannel.lockscreenVisibility = Notification.VISIBILITY_PRIVATE + highChannel.lockscreenVisibility = VISIBILITY_PUBLIC highChannel.enableVibration(true) nm.createNotificationChannel(highChannel) } diff --git a/app/src/main/kotlin/com/tutpro/baresip/Config.kt b/app/src/main/kotlin/com/tutpro/baresip/Config.kt index 8d8b5cd1..858c009b 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/Config.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/Config.kt @@ -15,6 +15,14 @@ object Config { config = "${config}zrtp_hash yes\n" write = true } + if (!config.contains(Regex("module[ ]+webrtc_aec.so"))) { + config = "${config}ausrc_format s16\nauplay_format s16\nauenc_format s16\naudec_format s16\nmodule webrtc_aec.so\n" + write = true + } + if (!config.contains(Regex("module[ ]+g7221.so"))) { + config = "${config}module g7221.so\n" + write = true + } if (config.contains(Regex("#module_app[ ]+mwi.so"))) { config = config.replace(Regex("#module_app[ ]+mwi.so"), "module_app mwi.so") diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index b7d49168..22c8f57d 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -15,7 +15,8 @@ viestejä ja kontakteja.\n • Voit soittaa edellisen puhelun uudelleen painamalla virheää luuria silloin, kun puhelun kohde on tyhjä.\n - • Jos et puhelun aikana kuule, mitä toinen sanoo, yritä kasvattaa media-volyymia.\n + • Jos et puhelun aikana kuule, mitä toinen sanoo, yritä kasvattaa median volyymia.\n + • Kaiun poisto ei ole tällä hetkellä tuettu, jos puhelu on Opus-koodattu.\n diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 874934da..f74e5a98 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -16,6 +16,7 @@ • Long clicks can also be used to remove calls, chats, messages, and contacts.\n • Call click when callee has not been given can be used for re-dial.\n • If you cannot hear the other party of a call, try to increase Media volume.\n + • Audio echo cancellation is currently not supported when call uses Opus codec.\n