Browse Source

additioanl tests and flags

Change-Id: I61a94139261e94aae04ce9af6f883e75d177e2f4
changes/34/5834/1
Richard Fuchs 10 years ago
parent
commit
af788f159a
2 changed files with 27 additions and 2 deletions
  1. +5
    -2
      perl/Rtpengine/Test.pm
  2. +22
    -0
      utils/test-unidirectional.pl

+ 5
- 2
perl/Rtpengine/Test.pm View File

@ -19,7 +19,7 @@ use RTP;
use Rtpengine;
sub new {
my ($class) = @_;
my ($class, %args) = @_;
my $self = {};
bless $self, $class;
@ -53,7 +53,7 @@ sub new {
$self->{timers} = [];
$self->{clients} = [];
$self->{control} = Rtpengine->new('localhost', 2223);
$self->{control} = Rtpengine->new($args{host} // 'localhost', $args{port} // 2223);
$self->{callid} = rand();
return $self;
@ -262,6 +262,9 @@ sub _default_req_args {
for my $cp (qw(sdp from-tag to-tag ICE transport-protocol address-family)) {
$args{$cp} and $req->{$cp} = $args{$cp};
}
for my $cp (@{$args{flags}}) {
push(@{$req->{flags}}, $cp);
}
return $req;
}


+ 22
- 0
utils/test-unidirectional.pl View File

@ -0,0 +1,22 @@
#!/usr/bin/perl
use strict;
use warnings;
use Rtpengine::Test;
use IO::Socket;
my $r = Rtpengine::Test->new(host => '192.168.1.128');
my ($a, $b) = $r->client_pair(
{sockdomain => &Socket::AF_INET},
{sockdomain => &Socket::AF_INET}
);
$r->timer_once(3, sub { $b->answer($a, ICE => 'remove', flags => ['unidirectional']); });
$r->timer_once(10, sub { $r->stop(); });
$a->offer($b, ICE => 'remove', flags => ['unidirectional']);
$b->start_rtp();
$r->run();
$a->delete();

Loading…
Cancel
Save