Hi,
Following on from last week's quest for the broken ALG fix in openser 1.1,  
I am trying to re-write the ACK that replies to the 200 OK the gateway  
sends when the call is connected, so that it arrives at the gateway  
instead of being sent back to the sender.
This is the bad ACK:
gateway ip= 1.2.3.204
proxy ip= 1.2.3.201
ua ip = 81.1.2.218

  U 81.1.2.218:2020 -> 1.2.3.201:5060
  ACK sip:[EMAIL PROTECTED]:2021 SIP/2.0.
  Via: SIP/2.0/UDP 81.1.2.218:2020;branch=z9hG4bK-a8d9ae6f.
  From: %5 <sip:[EMAIL PROTECTED]>;tag=32750c901739579ao0.
  To: <sip:[EMAIL PROTECTED]>;tag=F48836B0-608.
  Call-ID: [EMAIL PROTECTED]
  CSeq: 102 ACK.
  Max-Forwards: 70.
  Route: <sip:1.2.3.201;lr=on;ftag=32750c901739579ao0>.
  Proxy-Authorization: Digest
username="101000000",realm="sip.example.com",nonce="4721d74d797d2fcdae92fc29db4798914ddb90a4",uri="sip:[EMAIL
 PROTECTED]:2021",algorithm=MD5,response="d0a6ac0edaabb7fca6ef3ff448c7c4e1".
  Contact: %5 <sip:[EMAIL PROTECTED]:2020>.
  User-Agent: Linksys/PAP2T-3.1.15(LS).
  Content-Length: 0.

What's wrong is that the uri should be:
  ACK sip:[EMAIL PROTECTED]:5060 SIP/2.0.

I can fix the problem like this:

         if(src_ip==81.1.2.218  && method=="ACK" ){
                 rewritehostport("1.2.3.204:5060");
                 xlog("L_WARN", "rewritten host and port to: r-uri <$ru> ");
         }

But I really want to test (instead of src_ip==81.1.2.218) is whether the  
URLs in square brackets match :
  U [81.1.2.218]:2020 -> 1.2.3.201:5060
  ACK sip:[EMAIL PROTECTED]:2021 SIP/2.0.

How can I test that in 1.1?

Thanks for your help.

Richard

_______________________________________________
Users mailing list
[email protected]
http://lists.openser.org/cgi-bin/mailman/listinfo/users

Reply via email to