r7735 - in /branches/upstream/libnet-sip-perl/current: Changes MANIFEST META.yml README THANKS TODO lib/Net/SIP.pm lib/Net/SIP/Simple/Call.pm samples/README samples/bench/ samples/bench/README samples/bench/call.pl samples/bench/listen.pl

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Wed Sep 19 06:42:39 UTC 2007


Author: dmn
Date: Wed Sep 19 06:42:39 2007
New Revision: 7735

URL: http://svn.debian.org/wsvn/?sc=1&rev=7735
Log:
[svn-upgrade] Integrating new upstream version, libnet-sip-perl (0.35)

Added:
    branches/upstream/libnet-sip-perl/current/samples/README
    branches/upstream/libnet-sip-perl/current/samples/bench/
    branches/upstream/libnet-sip-perl/current/samples/bench/README
    branches/upstream/libnet-sip-perl/current/samples/bench/call.pl   (with props)
    branches/upstream/libnet-sip-perl/current/samples/bench/listen.pl   (with props)
Modified:
    branches/upstream/libnet-sip-perl/current/Changes
    branches/upstream/libnet-sip-perl/current/MANIFEST
    branches/upstream/libnet-sip-perl/current/META.yml
    branches/upstream/libnet-sip-perl/current/README
    branches/upstream/libnet-sip-perl/current/THANKS
    branches/upstream/libnet-sip-perl/current/TODO
    branches/upstream/libnet-sip-perl/current/lib/Net/SIP.pm
    branches/upstream/libnet-sip-perl/current/lib/Net/SIP/Simple/Call.pm

Modified: branches/upstream/libnet-sip-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/Changes?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/Changes (original)
+++ branches/upstream/libnet-sip-perl/current/Changes Wed Sep 19 06:42:39 2007
@@ -1,4 +1,12 @@
 Revision history for Net::SIP
+
+0.35
+  - Net::SIP::Simple::Call - close call context in $call->cleanup,
+    otherwise it could leak file descriptors if the call wasn't
+    closed clean (with BYE or CANCEL).
+  - new test applications for simple benchmarks in samples/bench
+  - documentation: new file samples/README describes the files in 
+    samples/
 
 0.34
   - Net::SIP::Simple: handle OPTIONS requests. These are for 

Modified: branches/upstream/libnet-sip-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/MANIFEST?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-sip-perl/current/MANIFEST Wed Sep 19 06:42:39 2007
@@ -63,10 +63,14 @@
 t/07_call_on_hold.pl
 t/08_register_with_auth.pl
 t/testlib.pl
+samples/README
 samples/invite_and_recv.pl
 samples/invite_and_send.pl
 samples/test_registrar_and_proxy.pl
 samples/3pcc.pl
+samples/bench/README
+samples/bench/call.pl
+samples/bench/listen.pl
 bin/nathelper.pl
 bin/stateless_proxy.pl
 bin/answer_machine.pl

Modified: branches/upstream/libnet-sip-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/META.yml?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/META.yml (original)
+++ branches/upstream/libnet-sip-perl/current/META.yml Wed Sep 19 06:42:39 2007
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Net-SIP
-version:      0.34
+version:      0.35
 version_from: lib/Net/SIP.pm
 installdirs:  site
 requires:

Modified: branches/upstream/libnet-sip-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/README?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/README (original)
+++ branches/upstream/libnet-sip-perl/current/README Wed Sep 19 06:42:39 2007
@@ -24,5 +24,7 @@
 See TODO for a list what still need to be done and BUGS for
 known bugs.
 
+See THANKS for contributors, bug reporters and sponsors.
+
 See samples/ for small examples.
 See bin/ for usable applications.

Modified: branches/upstream/libnet-sip-perl/current/THANKS
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/THANKS?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/THANKS (original)
+++ branches/upstream/libnet-sip-perl/current/THANKS Wed Sep 19 06:42:39 2007
@@ -5,4 +5,4 @@
 <mtve1927[AT]gmail[DOT]com>
 cpan:POLETTIX
 <karme[AT]berlios[DOT]de>
-
+<t-cpan.org[AT]tobias[DOT]org>

Modified: branches/upstream/libnet-sip-perl/current/TODO
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/TODO?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/TODO (original)
+++ branches/upstream/libnet-sip-perl/current/TODO Wed Sep 19 06:42:39 2007
@@ -27,4 +27,3 @@
 
 - implementation
   * full support for TCP
-  * maybe add Contact header by default for Endpoint?

Modified: branches/upstream/libnet-sip-perl/current/lib/Net/SIP.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/lib/Net/SIP.pm?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/lib/Net/SIP.pm (original)
+++ branches/upstream/libnet-sip-perl/current/lib/Net/SIP.pm Wed Sep 19 06:42:39 2007
@@ -4,7 +4,7 @@
 require 5.008;
 
 package Net::SIP;
-our $VERSION = '0.34';
+our $VERSION = '0.35';
 
 # this includes nearly everything else
 use Net::SIP::Simple ();

Modified: branches/upstream/libnet-sip-perl/current/lib/Net/SIP/Simple/Call.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/lib/Net/SIP/Simple/Call.pm?rev=7735&op=diff
==============================================================================
--- branches/upstream/libnet-sip-perl/current/lib/Net/SIP/Simple/Call.pm (original)
+++ branches/upstream/libnet-sip-perl/current/lib/Net/SIP/Simple/Call.pm Wed Sep 19 06:42:39 2007
@@ -91,6 +91,9 @@
 	while ( my $cb = shift @{ $self->{call_cleanup} } ) {
 		invoke_callback($cb,$self)
 	}
+	if ( my $ctx = $self->{ctx} ) {
+		$self->{endpoint}->close_context( $ctx );
+	}
 	%$self = ();
 	DEBUG( 100,"done" );
 }

Added: branches/upstream/libnet-sip-perl/current/samples/README
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/samples/README?rev=7735&op=file
==============================================================================
--- branches/upstream/libnet-sip-perl/current/samples/README (added)
+++ branches/upstream/libnet-sip-perl/current/samples/README Wed Sep 19 06:42:39 2007
@@ -1,0 +1,25 @@
+This directory contains some examples for using Net::SIP.
+
+invite_and_recv.pl
+- invite peer, recv RTP data and store them inside file
+- can register
+- can deal with upstream proxy
+- can handle authorization against proxy/registrar
+- see -h|--help for more information
+
+invite_and_send.pl
+- similar to invite_and_recv, but does send files to other party
+- can handle multiple files by using re-INVITEs
+- see -h|--help for more information
+
+test_registrar_and_proxy.pl
+- simple application which works as a registrar and proxy
+- see comments on top of the short file for more information
+
+3pcc.pl
+- third party call control, e.g. invites 1st party w/o sending SDP
+  body, invites 2nd party with SDP body from 1st and then re-INVITES
+  1st party with SDP from 2nd
+
+bench/*
+- programs for benchmarking, see bench/README

Added: branches/upstream/libnet-sip-perl/current/samples/bench/README
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/samples/bench/README?rev=7735&op=file
==============================================================================
--- branches/upstream/libnet-sip-perl/current/samples/bench/README (added)
+++ branches/upstream/libnet-sip-perl/current/samples/bench/README Wed Sep 19 06:42:39 2007
@@ -1,0 +1,15 @@
+These are programs to conduct simple benchmarks.
+See usage() in files (option -h|--help) for more information.
+
+listen.pl 
+- listen for incoming connection
+- echo RTP back
+- can handle multiple connections in parallel
+
+call.pl
+- create muliple parallel calls and send special crafted RTP traffic
+  The RTP are not real voice data, but sequence and timestamps inside
+  an RTP frame.
+- expect the RTP to be echod back, analyse the response and report
+  delays, lost packets etc
+- 

Added: branches/upstream/libnet-sip-perl/current/samples/bench/call.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/samples/bench/call.pl?rev=7735&op=file
==============================================================================
--- branches/upstream/libnet-sip-perl/current/samples/bench/call.pl (added)
+++ branches/upstream/libnet-sip-perl/current/samples/bench/call.pl Wed Sep 19 06:42:39 2007
@@ -1,0 +1,132 @@
+use strict;
+use Net::SIP qw(:all);
+use Time::HiRes 'gettimeofday';
+use Getopt::Long qw(:config posix_default bundling);
+
+my $debug;
+my $from = 'sip:me at one.example.com';
+my $outgoing_proxy = '127.0.0.1:5070';
+my $stat_timer = 2;
+my $ncalls = 10;
+my $to = 'sip:me at two.example.com';
+
+GetOptions(
+	'd|debug:i' => \$debug,
+	'h|help' => sub { usage() },
+	'F|from=s' => \$from,
+	'T|to=s' => \$to,
+	'P|proxy=s' => \$outgoing_proxy,
+	'S|stat-timer=i' => \$stat_timer,
+	'N|parallel=i' => \$ncalls,
+) || usage( 'bad options' );
+Debug->level( $debug || 1 ) if defined $debug;
+
+sub usage {
+	print STDERR "ERROR: @_\n" if @_;
+	print STDERR <<USAGE;
+
+
+Makes N parallel calls from FROM to TO and writes statistics about received, lost
+packets and delays. Does not send real RTP, but hides non-RTP data within RTP frames
+to compute statistics.
+Usage: $0 options
+Options:
+ -h|--help      This usage
+ -d|--debug     Switch on debugging with optional level
+ -F|--from      local address, default $from
+ -T|--to        peer address, default $to
+ -P|--proxy     Adress of target or proxy on path to target, default $outgoing_proxy
+ -N|--parallel  Number of parallel calls, default $ncalls
+ -S|--stat-timer  How often to print statistics, default every $stat_timer seconds
+
+The statistics look like this:
+
+ 28 pkt=1005/0/0 delay(ms)=5.68/1.08/41.79
+ |       |   | |            |    |    |
+ |       |   | |            ---------------- avg/min/max delay in ms
+ |       |   | |---------------------------- ignored packets (retransmits..)
+ |       |   |------------------------------ lost packets (or received out of order)
+ |       |---------------------------------- good packets received
+ |------------------------------------------ seconds since start
+
+USAGE
+	exit(2);
+}
+
+
+my $ua = Simple->new(
+	from => $from,
+	outgoing_proxy => $outgoing_proxy,
+);
+
+my (@connected,$start_bench,$min_delay,$max_delay);
+my $ignored = my $ok = my $lost = my $sum_delay = 0;
+for my $call (1..$ncalls) {
+	my $connected;
+	my $send_seq = 1;
+	my $recv_seq = 0;
+	$ua->invite( $to,
+		cb_final => \$connected,
+		init_media => $ua->rtp( 'send_recv', 
+			[ \&send_rtp, \$send_seq ],
+			0,
+			[ \&recv_rtp, \$recv_seq ]
+		),
+	);
+	push @connected,\$connected
+}
+
+$ua->loop( @connected );
+print STDERR "All $ncalls calls connected....\n";
+
+$start_bench = 1;
+my $start = time();
+$ua->add_timer( $stat_timer, \&stat_timer, 2 );
+$ua->loop;
+
+sub stat_timer {
+	if ( $ok ) {
+		printf "%5d pkt=%d/%d/%d delay(ms)=%.2f/%.2f/%.2f\n",
+			time() - $start,
+			$ok,$lost,$ignored,
+			$sum_delay/$ok*1000, $min_delay*1000,$max_delay*1000;
+	} else {
+		printf "%5d pkt=%d/%d/%d\n",
+			time() - $start,
+			$ok,$lost,$ignored;
+	}
+	$sum_delay = $ok = $lost = $ignored = 0;
+	$min_delay = $max_delay = undef;
+}
+
+sub send_rtp {
+	my $rseq = shift;
+	my ($sec,$msec) = gettimeofday();
+	my $seq = $start_bench ? $$rseq++ : 0;
+	return pack( "NNN",$seq,$sec,$msec ) . ( ' ' x 148 );
+}
+
+sub recv_rtp {
+	my ($rseq,$payload) = @_;
+	my ($seq,$sec,$msec) = unpack( "NNN",$payload );
+	#print STDERR "seq=$seq\n";
+	return if ! $seq; # initial data
+
+	my $diff = $seq - $$rseq;
+	if ( $diff <= 0 || $diff > 10000 ) {
+		# bogus, retransmits?
+		$ignored++;
+		return;
+	} 
+
+	$lost += $diff-1;
+	$$rseq = $seq;
+	$ok++;
+	my $now = gettimeofday();
+	my $then = $sec + $msec/10**6;
+	my $delay = $now - $then;
+	die "now=".localtime($now)." then=".localtime($then) if $delay<0;
+	$sum_delay += $delay;
+	$min_delay = $delay if ! defined $min_delay || $min_delay > $delay;
+	$max_delay = $delay if ! defined $max_delay || $max_delay < $delay;
+}

Propchange: branches/upstream/libnet-sip-perl/current/samples/bench/call.pl
------------------------------------------------------------------------------
    svn:keywords = Id

Added: branches/upstream/libnet-sip-perl/current/samples/bench/listen.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libnet-sip-perl/current/samples/bench/listen.pl?rev=7735&op=file
==============================================================================
--- branches/upstream/libnet-sip-perl/current/samples/bench/listen.pl (added)
+++ branches/upstream/libnet-sip-perl/current/samples/bench/listen.pl Wed Sep 19 06:42:39 2007
@@ -1,0 +1,55 @@
+use strict;
+use Net::SIP qw(:all);
+use Getopt::Long qw(:config posix_default bundling);
+
+my $debug;
+my $from = 'sip:me at two.example.com';
+my $leg = '127.0.0.1:5070';
+my $registrar;
+
+GetOptions(
+	'd|debug:i' => \$debug,
+	'h|help' => sub { usage() },
+	'F|from=s' => \$from,
+	'L|leg=s' => \$leg,
+	'R|registrar=s' => \$registrar,
+) || usage( 'bad options' );
+Debug->level( $debug || 1 ) if defined $debug;
+
+my $ua = Simple->new(
+	from => $from,
+	leg => $leg,
+	registrar => $registrar,
+);
+if ( $registrar ) {
+	die "Registration failed\n" if ! $ua->register;
+	print STDERR "Registered\n";
+}
+
+
+$ua->listen(
+	# echo everything back
+	init_media => $ua->rtp( 'recv_echo' ),
+);
+print "Listening...\n";
+$ua->loop;
+
+
+sub usage {
+	print STDERR "ERROR: @_\n" if @_;
+	print STDERR <<USAGE;
+
+Listen on given address and receive calls, echo RTP back.
+Handles multiple calls in parallel.
+Usage: $0 options
+Options:
+ -h|--help    This usage
+ -d|--debug   Switch on debugging with optional level
+ -F|--from    senders address, default $from
+ -L|--leg     Leg to listen on, default $leg
+ -R|--registrar   Optional Registrar
+
+USAGE
+	exit(2);
+}
+

Propchange: branches/upstream/libnet-sip-perl/current/samples/bench/listen.pl
------------------------------------------------------------------------------
    svn:keywords = Id




More information about the Pkg-perl-cvs-commits mailing list