- Added support for G7221 codec.

- Added support for WebRTC based audio echo cancellation.
- Minor call notification modifications.
This commit is contained in:
Juha Heinanen
2019-05-20 08:26:12 +03:00
parent 22747552e4
commit 97455d7ec8
6 changed files with 43 additions and 38 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)
}

View File

@ -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")

View File

@ -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
</string>
<!-- Account Activity -->

View File

@ -16,6 +16,7 @@
&#8226; Long clicks can also be used to remove calls, chats, messages, and contacts.\n
&#8226; Call click when callee has not been given can be used for re-dial.\n
&#8226; If you cannot hear the other party of a call, try to increase Media volume.\n
&#8226; Audio echo cancellation is currently not supported when call uses Opus codec.\n
</string>
<!-- Account Activity -->