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;