r17728 - in /trunk/libnet-sip-perl: ./ debian/ lib/Net/ lib/Net/SIP/ lib/Net/SIP/Simple/ t/

tincho-guest at users.alioth.debian.org tincho-guest at users.alioth.debian.org
Mon Mar 17 03:29:05 UTC 2008


Author: tincho-guest
Date: Mon Mar 17 03:29:04 2008
New Revision: 17728

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=17728
Log:
* Three new upstream releases.
* debian/copyright: new format.
* debian/control: add myself to Uploaders.
* debian/rules: prettify a little
* debian/watch: s/_/./g.

Modified:
    trunk/libnet-sip-perl/Changes
    trunk/libnet-sip-perl/META.yml
    trunk/libnet-sip-perl/debian/changelog
    trunk/libnet-sip-perl/debian/control
    trunk/libnet-sip-perl/debian/copyright
    trunk/libnet-sip-perl/debian/rules
    trunk/libnet-sip-perl/debian/watch
    trunk/libnet-sip-perl/lib/Net/SIP.pm
    trunk/libnet-sip-perl/lib/Net/SIP/Endpoint.pm
    trunk/libnet-sip-perl/lib/Net/SIP/Leg.pm
    trunk/libnet-sip-perl/lib/Net/SIP/Packet.pm
    trunk/libnet-sip-perl/lib/Net/SIP/Simple/Call.pm
    trunk/libnet-sip-perl/t/05_call_with_stateless_proxy.t
    trunk/libnet-sip-perl/t/09_fdleak.t
    trunk/libnet-sip-perl/t/10_fdleak.t

Modified: trunk/libnet-sip-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/Changes?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/Changes (original)
+++ trunk/libnet-sip-perl/Changes Mon Mar 17 03:29:04 2008
@@ -1,4 +1,27 @@
 Revision history for Net::SIP
+
+0.44_1
+   - Net::SIP::Packet::sdp_body - content type is case insensitive,
+     accept application/SDP etc
+
+0.44
+   - Net::SIP::Packet::get_header: if called in scalar to get the only
+     one value and we have multiple values try if they are all the same
+     and in this case return the uniq value instead of croaking
+     Works around bug in proxy which issued two content-length headers
+     with the same length as reported in
+     http://rt.cpan.org/Ticket/Display.html?id=33592
+   - fix test skip in t/*fdleak.t 
+
+0.43
+   - enforce codec 0 PCMU/8000 in outgoing SDP generated based on
+     incoming SDP, don't just accept all codecs the other party offers
+     because Net::SIP::Simple can only PCMU/8000
+   - make header names per default ucfirst (Via not via)
+   - add default allow and supported headers to INVITE requests and
+     2xx responses if none where given
+   - fix bug indroduced in 0.42, where contact from incoming INVITE
+     was not used as URI for outgoing BYE for the call
 
 0.42
    - on 2xx responses set the URI of the dialog to the contact given

Modified: trunk/libnet-sip-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/META.yml?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/META.yml (original)
+++ trunk/libnet-sip-perl/META.yml Mon Mar 17 03:29:04 2008
@@ -1,11 +1,11 @@
 # 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.42
+version:      0.44_1
 version_from: lib/Net/SIP.pm
 installdirs:  site
 requires:
     Net::DNS:                      0.56
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+generated_by: ExtUtils::MakeMaker version 6.17

Modified: trunk/libnet-sip-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/debian/changelog?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/debian/changelog (original)
+++ trunk/libnet-sip-perl/debian/changelog Mon Mar 17 03:29:04 2008
@@ -1,3 +1,13 @@
+libnet-sip-perl (0.44.1-1) unstable; urgency=low
+
+  * Three new upstream releases.
+  * debian/copyright: new format.
+  * debian/control: add myself to Uploaders.
+  * debian/rules: prettify a little
+  * debian/watch: s/_/./g.
+
+ -- Martín Ferrari <martin.ferrari at gmail.com>  Mon, 17 Mar 2008 00:26:26 -0300
+
 libnet-sip-perl (0.42-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libnet-sip-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/debian/control?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/debian/control (original)
+++ trunk/libnet-sip-perl/debian/control Mon Mar 17 03:29:04 2008
@@ -4,7 +4,8 @@
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Damyan Ivanov <dmn at debian.org>,
  Rene Mayorga <rmayorga at debian.org.sv>,
- gregor herrmann <gregor+debian at comodo.priv.at>
+ gregor herrmann <gregor+debian at comodo.priv.at>,
+ Martín Ferrari <martin.ferrari at gmail.com>
 Build-Depends: debhelper (>= 6)
 Build-Depends-Indep: perl (>= 5.8.1), libnet-dns-perl, net-tools, netbase
 Standards-Version: 3.7.3
@@ -12,10 +13,9 @@
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/
 Homepage: http://search.cpan.org/dist/Net-SIP/
 
-
 Package: libnet-sip-perl
 Architecture: all
 Depends: ${perl:Depends}, ${misc:Depends}, libnet-dns-perl
 Description: SIP handler Perl module
- Net::SIP module provides a tool to  write SIP endpoints (e.g
- phones, answer machines), SIP proxies and registrars.
+ Net::SIP module provides a tool to write SIP endpoints (e.g phones, answer
+ machines), SIP proxies and registrars.

Modified: trunk/libnet-sip-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/debian/copyright?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/debian/copyright (original)
+++ trunk/libnet-sip-perl/debian/copyright Mon Mar 17 03:29:04 2008
@@ -1,18 +1,25 @@
 This package was debianized by Rene Mayorga <rmayorga at debian.org.sv> on
-Fri, 13 Jul 2007 00:32:54 -0600, and is Maintaining by the 
+Fri, 13 Jul 2007 00:32:54 -0600, and is Maintainined by the 
 Debian Perl Group (pkg-perl) 
 
 It was downloaded from http://search.cpan.org/dist/Net-SIP/
 
-Upstream Author:
+Upstream Author: Steffen Ullrich <Steffen_Ullrich at genua.de>
 
-    Steffen Ullrich <Steffen_Ullrich at genua.de>
+Files: *
+Copyright: © 2006-2007, Steffen Ullrich
+License: GPL-1+ | Artistic
+ These modules are free software. They may be used, redistributed
+ and/or modified under the same terms as Perl itsel.
 
-    Copyright (c) 2006-2007, Steffen Ullrich
-    These modules are free software. They may be used, redistributed
-    and/or modified under the same terms as Perl itsel.
+Files: debian/*
+Copyright: © 2008 Debian Perl Group
+                  <pkg-perl-maintainers at lists.alioth.debian.org>
+           © 2007-2008 Rene Mayorga <rmayorga at debian.org.sv>
+           © 2007-2008 Damyan Ivanov <dmn at debian.org>
+License: GPL-1+
 
-Perl license is:
+The Perl license is:
     This program is free software; you can redistribute it and/or modify
     it under the terms of either:
 
@@ -26,9 +33,3 @@
 License can be found in `/usr/share/common-licenses/GPL' and the Artistic
 Licence in `/usr/share/common-licenses/Artistic'.
 
-The Debian packaging is
-	(C) 2007-2008, Rene Mayorga <rmayorga at debian.org.sv>
-	(C) 2007-2008, Damyan Ivanov <dmn at debian.org>
-	(C) 2008, gregor herrmann <gregor+debian at comodo.priv.at>
-and is licensed under the GPL, see
-`/usr/share/common-licenses/GPL'.

Modified: trunk/libnet-sip-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/debian/rules?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/debian/rules (original)
+++ trunk/libnet-sip-perl/debian/rules Mon Mar 17 03:29:04 2008
@@ -1,19 +1,20 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
-# debian/rules file for libnet-sip-perl
 
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-ifndef PERL
-	PERL = /usr/bin/perl
-endif
+# If set to a true value then MakeMaker's prompt function will
+# always return the default without waiting for user input.
+export PERL_MM_USE_DEFAULT=1
 
 PACKAGE = $(shell dh_listpackages)
+PERL   ?= /usr/bin/perl
 TMP     = $(CURDIR)/debian/$(PACKAGE)
 
 build: build-stamp
 build-stamp:
 	dh_testdir
-	[ -f Makefile ] || $(PERL) Makefile.PL
+	$(PERL) Makefile.PL INSTALLDIRS=vendor
 	$(MAKE)
 	$(MAKE) test
 	touch $@
@@ -29,29 +30,28 @@
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	$(MAKE) install_vendor DESTDIR=$(TMP) PREFIX=/usr
+	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
 	[ ! -d $(TMP)/usr/lib/perl5 ] || \
-	     rmdir --ignore-fail-on-non-empty --parents --verbose \
-	         $(TMP)/usr/lib/perl5
+		rmdir --ignore-fail-on-non-empty --parents --verbose \
+		$(TMP)/usr/lib/perl5
 	touch $@
 
 binary-arch:
-# nothing to do
+# We have nothing to do here for an architecture-independent package
 
 binary-indep: build install
 	dh_testdir
 	dh_testroot
+	dh_installexamples bin samples/*
+	dh_installdocs
 	dh_installchangelogs Changes
-	dh_installdocs
+	dh_perl
 	dh_compress
-	dh_installexamples samples/*
-	dh_installexamples bin
 	dh_fixperms
 	dh_installdeb
-	dh_perl
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install

Modified: trunk/libnet-sip-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/debian/watch?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/debian/watch (original)
+++ trunk/libnet-sip-perl/debian/watch Mon Mar 17 03:29:04 2008
@@ -1,2 +1,4 @@
 version=3
-http://search.cpan.org/dist/Net-SIP/ .*/Net-SIP-v?(\d[\d_.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)
+opts="uversionmangle=s/_/./g" \
+	http://search.cpan.org/dist/Net-SIP/ \
+	.*/Net-SIP-v?(\d[\d_.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)

Modified: trunk/libnet-sip-perl/lib/Net/SIP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/lib/Net/SIP.pm?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/lib/Net/SIP.pm (original)
+++ trunk/libnet-sip-perl/lib/Net/SIP.pm Mon Mar 17 03:29:04 2008
@@ -4,7 +4,7 @@
 require 5.008;
 
 package Net::SIP;
-our $VERSION = '0.42';
+our $VERSION = '0.44_1';
 
 # this includes nearly everything else
 use Net::SIP::Simple ();

Modified: trunk/libnet-sip-perl/lib/Net/SIP/Endpoint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/lib/Net/SIP/Endpoint.pm?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/lib/Net/SIP/Endpoint.pm (original)
+++ trunk/libnet-sip-perl/lib/Net/SIP/Endpoint.pm Mon Mar 17 03:29:04 2008
@@ -296,6 +296,7 @@
 			incoming => 1,
 			from => scalar( $request->get_header( 'from' )),
 			to   => scalar( $request->get_header( 'to' )),
+			contact => scalar( $request->get_header( 'contact' )),
 			callid => scalar( $request->get_header( 'call-id' )),
 			via  => [ $request->get_header( 'via' ) ],
 		);

Modified: trunk/libnet-sip-perl/lib/Net/SIP/Leg.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/lib/Net/SIP/Leg.pm?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/lib/Net/SIP/Leg.pm (original)
+++ trunk/libnet-sip-perl/lib/Net/SIP/Leg.pm Mon Mar 17 03:29:04 2008
@@ -277,19 +277,32 @@
 		$packet->insert_header( via => $via );
 	}
 
-	# 2xx responses and INVITE requests need contact header
-	if (( $packet->method eq 'INVITE' and $isrq or !$isrq and $packet->code =~m{^2} ) 
-		and ! $packet->get_header( 'contact' )) {
-		# needs contact header, create from this leg and user part of from/to
-		my ($user) = sip_hdrval2parts( $isrq 
-			? ( from => scalar($packet->get_header('from')) )
-			: ( to   => scalar($packet->get_header('to')) )
-		);
-		my $contact = ( $user =~m{([^<>\@\s]+)\@} ? $1 : $user ). 
-			"\@$self->{addr}:$self->{port}";
-		$contact = 'sip:'.$contact if $contact  !~m{^\w+:};
-		$packet->insert_header( contact => $contact );
-	}
+	# 2xx responses and INVITE requests must have a contact header
+	# They should have an Allow header too und Supported would be good to
+	if ( $isrq and $packet->method eq 'INVITE' or !$isrq and $packet->code =~m{^2} ) {
+		if ( ! $packet->get_header( 'contact' )) {
+			# needs contact header, create from this leg and user part of from/to
+			my ($user) = sip_hdrval2parts( $isrq 
+				? ( from => scalar($packet->get_header('from')) )
+				: ( to   => scalar($packet->get_header('to')) )
+			);
+			my $contact = ( $user =~m{([^<>\@\s]+)\@} ? $1 : $user ). 
+				"\@$self->{addr}:$self->{port}";
+			$contact = 'sip:'.$contact if $contact  !~m{^\w+:};
+			$packet->insert_header( contact => $contact );
+		}
+		# allow and supported can be multiple so enforce array context
+		unless ( my @a =  $packet->get_header( 'allow' )) {
+			# add the default set
+			$packet->insert_header( allow => 'INVITE, ACK, OPTIONS, CANCEL, BYE' );
+		}
+		unless ( my @a = $packet->get_header( 'supported' )) {
+			# set as empty
+			$packet->insert_header( supported => '' );
+		}
+	}
+
+
 
 	my ($proto,$host,$port) =
 		$addr =~m{^(?:(\w+):)?([\w\-\.]+)(?::(\d+))?$};

Modified: trunk/libnet-sip-perl/lib/Net/SIP/Packet.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/lib/Net/SIP/Packet.pm?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/lib/Net/SIP/Packet.pm (original)
+++ trunk/libnet-sip-perl/lib/Net/SIP/Packet.pm Mon Mar 17 03:29:04 2008
@@ -215,7 +215,14 @@
 			push @v,$h->{value} if $h->{key} eq $key;
 		}
 		return @v if wantarray;
-		croak( "multiple values for $key" ) if @v>1;
+		if (@v>1) {
+			# looks like we have multiple headers but expect only
+			# one. Because we've seen bad client which issue multiple
+			# content-length header we try if all in @v are the same
+			my %v = map { $_ => 1 } @v;
+			return $v[0] if keys(%v) == 1; # ok, only one
+			croak( "multiple values for $key" );
+		}
 		return $v[0];
 	} else {
 		my %result;
@@ -430,7 +437,7 @@
 
 		my $v = $header->[$hi]{value};
 		$v =~s{\r?\n\s*}{\r\n }g; # \r?\n\s* -> \r\n + space for continuation lines
-		$result[$hi] = $header->[$hi]{key}.": ".$v;
+		$result[$hi] = ucfirst($header->[$hi]{key}).": ".$v;
 	}
 
 	# (re)build packet
@@ -633,7 +640,7 @@
 sub sdp_body {
 	my Net::SIP::Packet $self = shift;
 	my $ct = $self->get_header( 'content-type' );
-	return if $ct && $ct ne 'application/sdp';
+	return if $ct && lc($ct) ne 'application/sdp';
 	my $body = ($self->as_parts)[3] || return;
 	return Net::SIP::SDP->new( $body );
 }

Modified: trunk/libnet-sip-perl/lib/Net/SIP/Simple/Call.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/lib/Net/SIP/Simple/Call.pm?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/lib/Net/SIP/Simple/Call.pm (original)
+++ trunk/libnet-sip-perl/lib/Net/SIP/Simple/Call.pm Mon Mar 17 03:29:04 2008
@@ -432,6 +432,10 @@
 					$self->error( "only RTP/AVP supported" );
 					return;
 				}
+				if ( $m->{media} eq 'audio' ) {
+					# enforce PCMU/8000 for now
+					$m = { %$m, fmt => '0' }
+				}
 				push @media, {
 					media => $m->{media},
 					proto => $m->{proto},

Modified: trunk/libnet-sip-perl/t/05_call_with_stateless_proxy.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/t/05_call_with_stateless_proxy.t?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/t/05_call_with_stateless_proxy.t (original)
+++ trunk/libnet-sip-perl/t/05_call_with_stateless_proxy.t Mon Mar 17 03:29:04 2008
@@ -96,8 +96,8 @@
 	# top via must be from lproxy[1], next via from UAC
 	# this is to show that the request went through the proxy
 	fd_grep_ok( 'call created',10,$uas );
-	fd_grep_ok( "via: SIP/2.0/UDP $lproxy[1]{addr};",1,$uas );
-	fd_grep_ok( "via: SIP/2.0/UDP $luac->{addr};",1,$uas );
+	fd_grep_ok( qr{\Qvia: SIP/2.0/UDP $lproxy[1]{addr};}i,1,$uas );
+	fd_grep_ok( qr{\Qvia: SIP/2.0/UDP $luac->{addr};}i,1,$uas );
 
 	# done
 	fd_grep_ok( 'RTP done',10,$uac );

Modified: trunk/libnet-sip-perl/t/09_fdleak.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/t/09_fdleak.t?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/t/09_fdleak.t (original)
+++ trunk/libnet-sip-perl/t/09_fdleak.t Mon Mar 17 03:29:04 2008
@@ -13,8 +13,8 @@
 my ($ssock,$saddr) = create_socket();
 my $tfn = fileno( newfd() );
 if ( fileno($ssock) != $tfn-1 ) {
-	warn "Platform does not give fds in order fn,fn+1,fn+2...\n";
-	print "1..0\n";
+	print "1..0 # Platform does not give fds in order fn,fn+1,fn+2...\n";
+	exit;
 } else {
 	print "1..7\n";
 }

Modified: trunk/libnet-sip-perl/t/10_fdleak.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-sip-perl/t/10_fdleak.t?rev=17728&op=diff
==============================================================================
--- trunk/libnet-sip-perl/t/10_fdleak.t (original)
+++ trunk/libnet-sip-perl/t/10_fdleak.t Mon Mar 17 03:29:04 2008
@@ -13,8 +13,8 @@
 my ($ssock,$saddr) = create_socket();
 my $tfn = fileno( newfd() );
 if ( fileno($ssock) != $tfn-1 ) {
-	warn "Platform does not give fds in order fn,fn+1,fn+2...\n";
-	print "1..0\n";
+	print "1..0 # Platform does not give fds in order fn,fn+1,fn+2...\n";
+	exit;
 } else {
 	print "1..10\n";
 }




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