And the response must be something likeINVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@pc33.atlanta.com CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Length: 0
Only the first line in the response changes. Everything else is same from received request. This is what I tried but didnt help....200 SIP/2.0 OK Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@pc33.atlanta.com CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> 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;
In reply to splitting and joining a network message by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |