Skip Menu |

This queue is for tickets about the Net-SIP CPAN distribution.

Report information
The Basics
Id: 31276
Status: resolved
Priority: 0/
Queue: Net-SIP

People
Owner: Nobody in particular
Requestors: tlwilsonii [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Error creating SIP packet from string
using Net::SIP v 0.40, perl 5.8.8, Ubuntu 7.10, the following snippet: #!/usr/bin/perl -w use strict; use Net::SIP::Packet; my $string="SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP 75.81.49.192:5060;branch=z9hG4bK3a2b495c;rport=5060\r\nFrom: <sip:user\@server>;tag=as4c6f5865\r\nTo: <sip:user\@server>;tag=f851abebff21dfe055504b396d2efab8.21e8\r\nCall-ID: 70bd2490050337f02185235a17aeb47d\@127.0.0.1\r\nCSeq: 127736 REGISTER\r\nWWW- Authenticate: Digest realm=\"provider.com\", nonce=\"47587817e64620d949e769c97eb7d8fbe0048955\"\r\nContent-Length: 0\r\n\r\n"; my $sip_pkt = Net::SIP::Packet->new($string); results in: Pseudo-hashes are deprecated at /usr/local/share/perl/5.8.8/Net/SIP/Packet.pm line 141. No such pseudo-hash field "body" at /usr/local/share/perl/5.8.8/Net/SIP/Packet.pm line 141.
From: tlwilsonii [...] yahoo.com
Problem is fixed if I add: use Net::SIP::Request; use Net::SIP::Response; to program. Maybe just add to the example that they are required? Should have been obvious to me, but wasn't.
Just 'use Net::SIP', which includes nearly everything. Don't include the seperate packages because there are cross-dependencies (e.g Net::SIP::Packet needs Net::SIP::Request to rebless itself if it's a request packet, but Net::SIP::Request needs Net::SIP::Packet because it's derived from it). Yes, it's nowhere documented that you Net::SIP::Packet seperatly but it's not documented either that you can use it seperatly :) Steffen