From 0dab317cb720ea85a5bd6dfc6b1b8acba6e65819 Mon Sep 17 00:00:00 2001 From: Ystinia Zalatova <94921687+ystinia@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:23:49 +0300 Subject: [PATCH] Update Baresip package (#1498) --- general/package/baresip-openipc/Config.in | 2 +- .../baresip-openipc/baresip-openipc.mk | 36 +++++- .../package/baresip-openipc/files/S97baresip | 47 ++++++++ .../package/baresip-openipc/files/accounts | 3 + general/package/baresip-openipc/files/config | 108 ++++++++++++++++++ .../package/baresip-openipc/files/contacts | 3 + .../package/baresip-openipc/files/dtmf_0.sh | 4 + 7 files changed, 199 insertions(+), 4 deletions(-) create mode 100755 general/package/baresip-openipc/files/S97baresip create mode 100644 general/package/baresip-openipc/files/accounts create mode 100644 general/package/baresip-openipc/files/config create mode 100644 general/package/baresip-openipc/files/contacts create mode 100755 general/package/baresip-openipc/files/dtmf_0.sh diff --git a/general/package/baresip-openipc/Config.in b/general/package/baresip-openipc/Config.in index d6c4f22b..3e975b49 100644 --- a/general/package/baresip-openipc/Config.in +++ b/general/package/baresip-openipc/Config.in @@ -2,7 +2,7 @@ config BR2_PACKAGE_BARESIP_OPENIPC bool "baresip-openipc" help Baresip is a portable and modular SIP User-Agent with audio - and video support. Copyright (c) 2010 - 2022 Alfred E. Heggestad + and video support. Copyright (c) 2010 - 2024 Alfred E. Heggestad and Contributors Distributed under BSD license. https://github.com/baresip/baresip diff --git a/general/package/baresip-openipc/baresip-openipc.mk b/general/package/baresip-openipc/baresip-openipc.mk index 163f8c7a..b5dd9a1e 100644 --- a/general/package/baresip-openipc/baresip-openipc.mk +++ b/general/package/baresip-openipc/baresip-openipc.mk @@ -5,13 +5,43 @@ ############################################################# BARESIP_OPENIPC_SITE = $(call github,baresip,baresip,$(BARESIP_OPENIPC_VERSION)) -BARESIP_OPENIPC_VERSION = v3.12.0 +BARESIP_OPENIPC_VERSION = v3.14.0 -BARESIP_OPENIPC_DEPENDENCIES = libre-openipc +BARESIP_OPENIPC_DEPENDENCIES = libre-openipc webrtc-audio-processing-openipc mosquitto BARESIP_OPENIPC_CONF_OPTS = \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -s" \ - -DUSE_MBEDTLS=ON + -DUSE_MBEDTLS=ON \ + -DWEBRTC_AEC_INCLUDE_DIR=$(WEBRTC_AUDIO_PROCESSING_OPENIPC_DIR) \ + -DMOSQUITTO_INCLUDE_DIR=$(MOSQUITTO_DIR) + +define BARESIP_OPENIPC_INSTALL_CONF + $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d + $(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(BARESIP_OPENIPC_PKGDIR)/files/S97baresip + +# $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/baresip +# $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/baresip $(BARESIP_OPENIPC_PKGDIR)/files/accounts +# $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/baresip $(BARESIP_OPENIPC_PKGDIR)/files/config +# $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/baresip $(BARESIP_OPENIPC_PKGDIR)/files/contacts + + cp $(@D)/docs/examples/accounts $(TARGET_DIR)/etc/baresip/accounts.orig + cp $(@D)/docs/examples/config $(TARGET_DIR)/etc/baresip/config.orig + cp $(@D)/docs/examples/contacts $(TARGET_DIR)/etc/baresip/contacts.orig + + $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin + $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(BARESIP_OPENIPC_PKGDIR)/files/dtmf_0.sh + ln -sf dtmf_0.sh $(TARGET_DIR)/usr/bin/dtmf_1.sh + ln -sf dtmf_0.sh $(TARGET_DIR)/usr/bin/dtmf_2.sh + ln -sf dtmf_0.sh $(TARGET_DIR)/usr/bin/dtmf_3.sh + +# $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/lib/sounds +# $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/sounds $(BARESIP_OPENIPC_PKGDIR)/files/ok_8k.pcm + + $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/share/baresip + cp $(@D)/share/*.wav $(TARGET_DIR)/usr/share/baresip +endef + +BARESIP_OPENIPC_POST_INSTALL_TARGET_HOOKS += BARESIP_OPENIPC_INSTALL_CONF $(eval $(cmake-package)) diff --git a/general/package/baresip-openipc/files/S97baresip b/general/package/baresip-openipc/files/S97baresip new file mode 100755 index 00000000..6cef742d --- /dev/null +++ b/general/package/baresip-openipc/files/S97baresip @@ -0,0 +1,47 @@ +#!/bin/sh + +DAEMON="baresip" +PIDFILE="/var/run/$DAEMON.pid" + +DAEMON_ARGS="-f /etc/baresip" + +start() { + printf 'Starting %s: ' "$DAEMON" + start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart) + "$1";; + reload) + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/general/package/baresip-openipc/files/accounts b/general/package/baresip-openipc/files/accounts new file mode 100644 index 00000000..89fa2608 --- /dev/null +++ b/general/package/baresip-openipc/files/accounts @@ -0,0 +1,3 @@ +# +#;auth_pass=MyPass;answermode=auto +# diff --git a/general/package/baresip-openipc/files/config b/general/package/baresip-openipc/files/config new file mode 100644 index 00000000..bd76ebe0 --- /dev/null +++ b/general/package/baresip-openipc/files/config @@ -0,0 +1,108 @@ +# Core +poll_method epoll # poll, select, epoll .. + +# SIP +sip_listen 0.0.0.0:5060 +#sip_certificate cert.pem +sip_cafile /etc/ssl/certs/ca-certificates.crt +#sip_transports udp,tcp,tls,ws,wss +#sip_trans_def udp +#sip_verify_server yes +sip_tos 160 + +# Call +call_local_timeout 120 +call_max_calls 1 +call_hold_other_calls yes + +# Audio +#audio_path /usr/share/baresip +#audio_player none +#audio_source none +#audio_alert alsa,default +#ausrc_srate 48000 +#auplay_srate 48000 +#ausrc_channels 0 +#auplay_channels 0 +#audio_txmode poll # poll, thread +audio_level no +ausrc_format s16 # s16, float, .. +auplay_format s16 # s16, float, .. +auenc_format s16 # s16, float, .. +audec_format s16 # s16, float, .. +audio_buffer 20-160 # ms +audio_telev_pt 101 # payload type for telephone-event + +# Video +#video_source v4l2,/dev/video0 +#video_source fakevideo,nil +#video_display x11,nil +video_size 640x480 +video_bitrate 1000000 +video_fps 30.00 +video_fullscreen no +videnc_format yuv420p + +# AVT - Audio/Video Transport +rtp_tos 184 +rtp_video_tos 136 +#rtp_ports 10000-20000 +#rtp_bandwidth 512-1024 # [kbit/s] +rtcp_mux no +audio_itter_buffer_type fixed # off, fixed, adaptive +audio_jitter_buffer_delay 5-10 # frames +#jitter_buffer_wish 6 # frames for start +rtp_stats no +rtp_timeout 4 + +module_path /usr/lib/baresip/modules + +# UI Modules +module stdio.so +module g711.so +#module avformat.so + +module_app account.so +module_app contact.so +module_app debug_cmd.so +module_app syslog.so +module_app ctrl_tcp.so +# +module_app menu.so +#module_app mwi.so +#module_app presence.so +#module_app serreg.so +module_app netroam.so + +# UI Modules parameters +cons_listen 0.0.0.0:3000 # cons - Console UI UDP/TCP sockets + +ctrl_tcp_listen 0.0.0.0:2000 # ctrl_tcp - TCP interface JSON + +evdev_device /dev/input/event0 + +# Opus codec parameters +opus_bitrate 28000 # 6000-510000 + +vumeter_stderr yes + +# Selfview +video_selfview window # {window,pip} +#selfview_size 64x64 + + +############################################################ + +# WebControl +module_app httpd.so +http_listen 0.0.0.0:5500 + +# OpenIPC integration +module openipc_audio.so +module openipc_video.so +module_app relay.so + +# Other UI Modules +module webrtc_aec.so +module fakevideo.so +# module mqtt.so diff --git a/general/package/baresip-openipc/files/contacts b/general/package/baresip-openipc/files/contacts new file mode 100644 index 00000000..be9d9cc0 --- /dev/null +++ b/general/package/baresip-openipc/files/contacts @@ -0,0 +1,3 @@ +# +"OpenIPC Support" ;access=allow +# diff --git a/general/package/baresip-openipc/files/dtmf_0.sh b/general/package/baresip-openipc/files/dtmf_0.sh new file mode 100755 index 00000000..400f2d4c --- /dev/null +++ b/general/package/baresip-openipc/files/dtmf_0.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# timeout 2 curl -s --data-binary @/usr/lib/sounds/dog-many_48k.pcm http://localhost/play_audio +