[OpenSER-Users] ALG error workarounds

Richard Bennett richard.bennett at skynet.be
Mon Oct 29 16:27:58 CET 2007


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:202000243999049102 at 81.1.2.218:2021 SIP/2.0.
  Via: SIP/2.0/UDP 81.1.2.218:2020;branch=z9hG4bK-a8d9ae6f.
  From: %5 <sip:101000000 at sip.example.com>;tag=32750c901739579ao0.
  To: <sip:00243999049102 at sip.example.com>;tag=F48836B0-608.
  Call-ID: da59b048-d5ba4742 at 192.168.1.6.
  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:202000243999049102 at 81.1.2.218:2021",algorithm=MD5,response="d0a6ac0edaabb7fca6ef3ff448c7c4e1".
  Contact: %5 <sip:101000000 at 81.1.2.218:2020>.
  User-Agent: Linksys/PAP2T-3.1.15(LS).
  Content-Length: 0.

What's wrong is that the uri should be:
  ACK sip:202000243999049102 at 1.2.3.204: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:202000243999049102@[81.1.2.218]:2021 SIP/2.0.

How can I test that in 1.1?

Thanks for your help.

Richard




More information about the Users mailing list