I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-09-02 12:10:17.679902-07 by mwb
Additional SIP::Packet Documentation
Hello, I was hoping there was some additional documentation on the SIP:Packet module. I am currently writing a script which needs to create a REQUEST based on a number pulled from a database and receive a 302 redirect w/ LNP information in it. I just need to see that packet and save the information stored in the RN field. I am currently having issues creating the packet by string and was hoping I could get a little additional info detailing the overhead I need to create the packet. thanks, Will
Direct Responses: 12915 | Write a response
Posted on 2010-09-02 22:12:40.846071-07 by noxxi in response to 12913
Re: Additional SIP::Packet Documentation
please look at the documentation of Net::SIP::Packet.
There it ist documented (even with example) how to create a packet from string
Direct Responses: 12916 | Write a response
Posted on 2010-09-03 16:14:47.742332-07 by mwb in response to 12915
Re: Additional SIP::Packet Documentation
Noxxi, Were you referring to the example below? I initially tried to run this and use as a template, however, I believe that the "..." in the "PACKET FROM STRING" example indicate unwritten code needed for the body of the packet. If not, is there additional documentation that I'm missing. I apologize if I'm seeming a little out of the loop, first time using the CPAN forum. thanks!
# create packet from string my $invite = Net::SIP::Packet->new( <<'EOS' ); INVITE sip:you@example.com SIP/2.0 From: <sip:me@example.com> To: <sip:you@example.com> ... EOS # show and manipulate some header print "callid=".$invite->get_header( 'call-id' )."\n"; print "route=".join( ",", $invite->get_header( 'route' ))."\n"; $invite->set_header( 'via' => [ $via1,$via2,.. ] ); # get resulting string representation print $invite->as_string; # create packet from parts my $resp = Net::SIP::Packet->new( 200, 'Ok', { to => '<sip:you@example.com>', from => '<sip:me@example.com>',.. } Net::SIP::SDP->new(...) ); # and get the packet as string print $resp->as_string;
Direct Responses: 12918 | Write a response
Posted on 2010-09-05 22:48:46.433934-07 by noxxi in response to 12916
Re: Additional SIP::Packet Documentation
Yes, the ... means that there will be more from the packet.
But of course you should run the code with your packet, and not with the incomplete packet from the example.
Direct Responses: 12924 | Write a response
Posted on 2010-09-06 23:19:10.238609-07 by mwb in response to 12918
Re: Additional SIP::Packet Documentation
Yeah, I think we've sorta arrived at my real issue. I guess I'm looking for documentation on what I'd need to construct a packet. I have the address information, most of what is needed in the header but am not really sure what belongs in the body or how to format it so that SIP::Packet will think it's proper. I've done a couple of experiments using body info I pulled from a tethereal trace of a similar request but typically get the following error:
C:\>perl c:\bin\sip_test.pl Attempt to access disallowed key 'body' in a restricted hash at C:/Perl/site/lib/Net/SIP/Packet.pm +line 141.
So anyways, that is why I was looking for additional documentation, to try and understand what SIP::Packet is looking for when constructed via a string. Thanks
Direct Responses: 12925 | Write a response
Posted on 2010-09-06 23:24:17.322746-07 by noxxi in response to 12924
Re: Additional SIP::Packet Documentation
Net::SIP::Packet accepts as a string a valid SIP packet.
How a valid SIP packet looks like see RFC3261.
If you think you have a valid SIP packet which Net::SIP::Packet does not like please post the full SIP packet (so that I may decide if it's a bug in Net::SIP or if the packet is invalid) and also post the error you get from Net::SIP::Packet.
I'm not able to speculate about the problem without having these details.
Direct Responses: Write a response