INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds Max-Forwards: 70 To: Bob From: Alice ;tag=1928301774 Call-ID: a84b4c76e66710@pc33.atlanta.com CSeq: 314159 INVITE Contact: Content-Length: 0 #### 200 SIP/2.0 OK Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds Max-Forwards: 70 To: Bob From: Alice ;tag=1928301774 Call-ID: a84b4c76e66710@pc33.atlanta.com CSeq: 314159 INVITE Contact: Content-Length: 0 #### my $length = $sock->recv($sip_request,1000); print "\nReceived message '", $request,"'\n"; my @headers = split/\n/, $request; my $tmp = 0; foreach my $line (@headers) { if ($tmp gt 0) { $sip_response = join($sip_response, $line, "\n"); } $tmp++; } print "Our response is : \n"; print $sip_response;