|
|
|
@ -12,6 +12,7 @@ use NGCP::Rtpengine;
|
|
|
|
my %options = ('proxy-address' => 'localhost', 'proxy-port' => 2223);
|
|
|
|
my %options = ('proxy-address' => 'localhost', 'proxy-port' => 2223);
|
|
|
|
|
|
|
|
|
|
|
|
GetOptions(
|
|
|
|
GetOptions(
|
|
|
|
|
|
|
|
'json' => \$options{'json'},
|
|
|
|
'proxy-address=s' => \$options{'proxy-address'},
|
|
|
|
'proxy-address=s' => \$options{'proxy-address'},
|
|
|
|
'proxy-port=s' => \$options{'proxy-port'},
|
|
|
|
'proxy-port=s' => \$options{'proxy-port'},
|
|
|
|
'from-tag=s' => \$options{'from-tag'},
|
|
|
|
'from-tag=s' => \$options{'from-tag'},
|
|
|
|
@ -109,7 +110,14 @@ my $cmd = shift(@ARGV) or die;
|
|
|
|
my %packet = (command => $cmd);
|
|
|
|
my %packet = (command => $cmd);
|
|
|
|
|
|
|
|
|
|
|
|
for my $x (split(/,/, 'from-tag,to-tag,call-id,transport protocol,media address,ICE,address family,DTLS,via-branch,media address,ptime,xmlrpc-callback,metadata,address,file,db-id,code,DTLS-fingerprint,ICE-lite,media echo,label,set-label,from-label,to-label')) {
|
|
|
|
for my $x (split(/,/, 'from-tag,to-tag,call-id,transport protocol,media address,ICE,address family,DTLS,via-branch,media address,ptime,xmlrpc-callback,metadata,address,file,db-id,code,DTLS-fingerprint,ICE-lite,media echo,label,set-label,from-label,to-label')) {
|
|
|
|
defined($options{$x}) and $packet{$x} = \$options{$x};
|
|
|
|
if (defined($options{$x})) {
|
|
|
|
|
|
|
|
if (!$options{json}) {
|
|
|
|
|
|
|
|
$packet{$x} = \$options{$x};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$packet{$x} = $options{$x};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for my $x (split(/,/, 'TOS,delete-delay')) {
|
|
|
|
for my $x (split(/,/, 'TOS,delete-delay')) {
|
|
|
|
defined($options{$x}) and $packet{$x} = $options{$x};
|
|
|
|
defined($options{$x}) and $packet{$x} = $options{$x};
|
|
|
|
@ -190,6 +198,7 @@ if (defined($packet{sdp})) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
my $engine = NGCP::Rtpengine->new($options{'proxy-address'}, $options{'proxy-port'});
|
|
|
|
my $engine = NGCP::Rtpengine->new($options{'proxy-address'}, $options{'proxy-port'});
|
|
|
|
|
|
|
|
$engine->{json} = $options{json};
|
|
|
|
my $resp = $engine->req(\%packet);
|
|
|
|
my $resp = $engine->req(\%packet);
|
|
|
|
|
|
|
|
|
|
|
|
#print Dumper $resp;
|
|
|
|
#print Dumper $resp;
|
|
|
|
|