my $proxy; $proxy='212.190.89.137'; $proxy='62.189.34.7'; $proxy='212.249.15.4'; $proxy='195.129.125.74'; my $me='195.129.125.73'; my $contact='128.179.67.76'; my $to; $to='+41216939263'; $to='+41215500309'; my $from='+41216939999'; use IO::Socket; my $sock = new IO::Socket::INET ( PeerAddr =>$proxy, PeerPort => '5060', Proto => 'udp', ); die "Could not create socket: $!\n" unless $sock; my $callid="bb".(100000+int(rand()*100)).'@1.1.1.1'; my $branch="z9hG4bKfc89.aa".(100000+int(rand()*100)).".0"; my $tag="cc".(100000+int(rand()*100)).".0"; my $body= 'v=0' . "\r\n" . 'o='.$from.' 8000 8000 IN IP4 128.179.67.76' . "\r\n" . 's=SIP Call' . "\r\n" . 'c=IN IP4 128.179.67.76' . "\r\n" . 't=0 0' . "\r\n" . 'm=audio 5004 RTP/AVP 4 18 97' . "\r\n" . 'a=sendrecv' . "\r\n" . 'a=rtpmap:4 G723/8000' . "\r\n" . 'a=rtpmap:18 G729/8000' . "\r\n" . 'a=rtpmap:97 iLBC/8000' . "\r\n" . 'a=fmtp:97 mode=20' . "\r\n" . 'a=ptime:60' . "\r\n"; my $invite1= 'INVITE sip:'.$to.'@'.$proxy.':5060 SIP/2.0' . "\r\n" . 'Via: SIP/2.0/UDP '.$me.';branch='.$branch . "\r\n" . 'From: ;tag='.$tag . "\r\n" . 'To: ' . "\r\n" . 'Contact: ' . "\r\n" . 'Call-ID: '.$callid . "\r\n" . 'User-Agent: Cisco-SIPGateway/IOS-12.x'."\r\n". #without this line portaSIP returns 401-Unathorized !!!!! 'Cisco-Guid: 1267993024-132714972-2850357268-473918838' . "\r\n" . 'CSeq: 61469 INVITE' . "\r\n" . 'Max-Forwards: 68' . "\r\n" . 'Content-Type: application/sdp' . "\r\n" . 'Content-Length: 236' . "\r\n" . "\r\n"; $invite2= # 'INVITE sip:'.$to.'@'.$proxy.':5060 SIP/2.0' . "\r\n" . # 'Via: SIP/2.0/UDP '.$me.';branch='.$branch."\r\n". # #'From: "anonymous" ;tag='.$tag."\r\n". # 'From: ;tag='.$tag."\r\n". # 'To: '."\r\n". 'INVITE sip:'.$to.'@'.$proxy.':5060 SIP/2.0'."\r\n" . 'Via: SIP/2.0/UDP '.$me.';branch='.$branch."\r\n" . 'From: ;tag='.$tag."\r\n" . 'To: '."\r\n" . 'Call-ID: '.$callid."\r\n". # 'Supported: timer'."\r\n". # 'Cisco-Guid: 3897858241-132780508-2628321300-473918850'."\r\n". 'User-Agent: Cisco-SIPGateway/IOS-12.x'."\r\n". 'CSeq: 101 INVITE'."\r\n". 'Max-Forwards: 4'."\r\n". 'Contact: '."\r\n". 'Allow-Events: telephone-event'."\r\n". 'Content-Type: application/sdp'."\r\n". 'Content-Length: 236'."\r\n". ''."\r\n"; print "transmittng\n"; print $sock $invite1 . $body; print "transmitted\n"; close($sock);