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