From 57e095eb43258bbf38054bf638410346309a8631 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 25 Mar 2025 15:39:55 +0100 Subject: [PATCH] MT#62272 auto-daemon-tests-moh: use text config Instead of start-up options just use the text file for configuring things, easier and simpler to keep. Additionally: introduced config options: - `moh-attr-name = rtpengine-hold` - `moh-prevent-double-hold = false` Fix tests accordingly. Change-Id: I128b531af6a21623105e5933f8b0b572fdc5620a --- t/auto-daemon-tests-moh.pl | 10 +++++++--- t/test5.conf | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 t/test5.conf diff --git a/t/auto-daemon-tests-moh.pl b/t/auto-daemon-tests-moh.pl index 22f47543e..6f81994cd 100644 --- a/t/auto-daemon-tests-moh.pl +++ b/t/auto-daemon-tests-moh.pl @@ -9,9 +9,7 @@ use Test::More; use NGCP::Rtpclient::ICE; use POSIX; -autotest_start(qw(--config-file=none -t -1 -i 203.0.113.1 -i 2001:db8:4321::1 - -i foo/203.0.113.7 -i bar/203.0.113.8 - -n 2223 -c 12345 -f -L 7 -E -u 2222 --silence-detect=1 --log-level-internals=7)) +autotest_start(qw(--config-file=test5.conf)) or die; my ($sock_a, $sock_b, $seq, $ts, $ssrc); @@ -85,6 +83,7 @@ v=0 o=- 1545997028 1 IN IP4 198.51.100.1 s=tester t=0 0 +a=rtpengine-hold m=audio PORT RTP/AVP 8 c=IN IP4 203.0.113.1 a=rtpmap:8 PCMA/8000 @@ -220,6 +219,7 @@ v=0 o=- 1545997028 1 IN IP4 198.51.100.1 s=tester t=0 0 +a=rtpengine-hold m=audio PORT RTP/AVP 8 c=IN IP4 0.0.0.0 a=rtpmap:8 PCMA/8000 @@ -355,6 +355,7 @@ v=0 o=- 1545997028 1 IN IP4 198.51.100.1 s=tester t=0 0 +a=rtpengine-hold m=audio PORT RTP/AVP 8 c=IN IP4 203.0.113.1 a=rtpmap:8 PCMA/8000 @@ -490,6 +491,7 @@ v=0 o=- 1545997028 1 IN IP4 198.51.100.1 s=tester t=0 0 +a=rtpengine-hold m=audio PORT RTP/AVP 8 c=IN IP4 0.0.0.0 a=rtpmap:8 PCMA/8000 @@ -627,6 +629,7 @@ v=0 o=- 1545997028 1 IN IP4 198.51.100.1 s=tester t=0 0 +a=rtpengine-hold m=audio PORT RTP/AVP 8 c=IN IP4 203.0.113.1 a=rtpmap:8 PCMA/8000 @@ -765,6 +768,7 @@ v=0 o=- 1545997028 1 IN IP4 198.51.100.1 s=tester t=0 0 +a=rtpengine-hold m=audio PORT RTP/AVP 8 c=IN IP4 203.0.113.1 a=rtpmap:8 PCMA/8000 diff --git a/t/test5.conf b/t/test5.conf new file mode 100644 index 000000000..f686fa0ba --- /dev/null +++ b/t/test5.conf @@ -0,0 +1,18 @@ +[rtpengine] +table = -1 +interface = 203.0.113.1 ; 2001:db8:4321::1 ; foo/203.0.113.7 ; bar/203.0.113.8 +listen-ng = 2223 +listen-cli = 12345 +listen-udp = 2222 +foreground = true +log-level = 7 +log-stderr = true +silence-detect = 1 + +# controls the value to be added to the session level of SDP +# whenever MoH is triggered. If not defined, then not in use. +moh-attr-name = rtpengine-hold + +# protects against double MoH played +# (e.g. when inadvertently two rtpengine instances try to trigger MoH) +moh-prevent-double-hold = true