From 18f10775482bb40bf25c3bda686b2d6ac81a01ed Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 20 Jun 2025 08:23:48 -0400 Subject: [PATCH] MT#55283 add tester rtpe_raw_req Change-Id: Id59d23e9e3b8dc9021003a2fb8f10ce275b28229 --- perl/NGCP/Rtpengine/AutoTest.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/perl/NGCP/Rtpengine/AutoTest.pm b/perl/NGCP/Rtpengine/AutoTest.pm index 7c364ec51..40db967f4 100644 --- a/perl/NGCP/Rtpengine/AutoTest.pm +++ b/perl/NGCP/Rtpengine/AutoTest.pm @@ -24,7 +24,7 @@ BEGIN { @ISA = qw(Exporter); our @EXPORT = qw(autotest_start new_call new_call_nc offer answer ft tt cid snd srtp_snd rtp rcv srtp_rcv rcv_no rcv_maybe srtp_dec escape rtpm rtpmre reverse_tags new_ft new_tt crlf sdp_split rtpe_req offer_answer - autotest_init subscribe_request subscribe_answer publish use_json); + autotest_init subscribe_request subscribe_answer publish use_json rtpe_raw_req); }; @@ -131,16 +131,21 @@ sub sdp_split { my ($s) = @_; return split(/--------*\n/, $s); } -sub rtpe_req { - my ($cmd, $name, $req) = @_; - $req->{command} = $cmd; - $req->{'call-id'} //= $cid; +sub rtpe_raw_req { + my ($req) = @_; my $resp; eval { alarm(3); $resp = $c->req($req); alarm(0); }; + return $resp || $@; +} +sub rtpe_req { + my ($cmd, $name, $req) = @_; + $req->{command} = $cmd; + $req->{'call-id'} //= $cid; + my $resp = rtpe_raw_req($req); terminate("'$cmd' request failed ($@)") if $@; is $resp->{result}, 'ok', "$name - '$cmd' status"; return $resp;