MT#55283 add tester rtpe_raw_req

Change-Id: Id59d23e9e3b8dc9021003a2fb8f10ce275b28229
(cherry picked from commit 18f1077548)
rfuchs/2095
Richard Fuchs 10 months ago
parent 4a90f1d6fa
commit cb104327b9

@ -22,7 +22,7 @@ BEGIN {
@ISA = qw(Exporter);
our @EXPORT = qw(autotest_start new_call 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);
};
@ -114,16 +114,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;

Loading…
Cancel
Save