Forum Discussion

Evelin_195902's avatar
Evelin_195902
Icon for Nimbostratus rankNimbostratus
Aug 20, 2015

SIP Record-route problem

Hi guys, I would need your help regarding inserting Record-route header information in SIP profile. The scenario is as follows:

 

SIP agent -> Virtual Server+SIP+SNAT Automap profile applied on LTM -> SIP server as a pool member

 

In order to avoid direct communication between SIP agent and SIP server I got Record-route header insertion applied in my SIP profile. The thing is that record route inserts my Virtual server IP so any new request coming from SIP agent hit VIP and then get translated using Automap (source address of the IP request is LTM's private IP) and hit SIP server, same for the replies. So far so go good, but when SIP server needs to initiate a SIP request (like OPTIONS, BYE, INFO) it uses the Record-route information (pointing to Public Virtual server IP, instead of the private LTM IP) and construct a ROUTE header and sends its request to public Virtual server address instead of the private LTM IP. This is making a loop as SIP server sends SIP requests to its VIP, hense itself. My question is how can I make SIP server to sends its SIP requests to the Automap private IP instead of to public Virtual server ip.

 

Thank you!

 

12 Replies

  • Hi Evelin,

     

    If you trying to use SIP profile to insert RR then for sure F5 LTM will add its VS address. To avoid it you can use following I-rule

     

    if { [SIP::to] contains "xyz.com" } {

     

    SIP::header remove "Route" SIP::header insert "Record-Route" "" }

     

    }

     

    /Regards Amit Grover

     

  • SyedNazir_20946's avatar
    SyedNazir_20946
    Historic F5 Account

    Hi Evelin,

      It is little tricky here as F5 has to act as a ALG. F5 has to update/insert the Record-Record header based on where the request/response is coming from.
    
      If the request/response is coming from Client without Record-Route header then F5 has to insert the header with SNAT IP. But if the header is already present with VIP as value then F5 has to update the value with SNAT IP.
    
      If the request/response is coming from SIP server without Record-Route header then F5 has to insert the header with VIP. But if the header is already present with value as SNAT IP then F5 has to update the value with VIP.
    
      To know whether SIP message is coming from Client or SIP server you can use clientside command.
    
      if { [clientside] } { Message from Client
           SIP::header insert "Record-Route" SNATIP
      } else { Message from Server
           SIP::header insert "Record-Route" VIP
      }
    
    • Syed Nazir
  • Thanks for the replies, guys. For now I've implemented a simple irule which strips the RR header info for requests being forwarded to SIP server and add RR for any SIP responses being sent from the SIP server to SIP agent. It looks like this:

     

    when SIP_REQUEST_SEND { SIP::header remove "Record-Route" } when SIP_RESPONSE_SEND { SIP::header insert "Record-Route" "" }

     

    It seems to be working fine for now. Our QAs are testing it. If it doesn't work for some reason I'll try with your suggestions.

     

    Thanks again!

     

  • Godfrey_Tan_149's avatar
    Godfrey_Tan_149
    Historic F5 Account

    You can set the default route on the SIP server (on the private VLAN) to use the Bigip private VLAN Self IP.

     

  • Thanks, Godfrey but I cannot change the default GW for the SIP servers to point to the LTM private VLAN Self IP.

     

    The irule I've posted before seems to be working partially...

     

    All the requests coming from SIP clients get translated and forwarded to the SIP server. Replies from SIP servers are going over the LTM Automap NAT IP and then get translated and hit the SIP client.

     

    So far so good.

     

    BUT when SIP server has to terminate the call by sending BYE REQUEST that request is being sent to the SIP phone IP instead of to the Automap Private IP. As we are bloking any traffic coming from Internet on port 5060 on our SIP servers the OK reply message never hit the SIP server.

     

    Do you have any idea how I can make SIP server to send REQUEST messages to F5 Automap private IP instead of to the SIP agent directly?

     

    Thank you!

     

    regards, Evelin

     

    • satish_txt_2254's avatar
      satish_txt_2254
      Icon for Cirrus rankCirrus

      Any solution here because i am having same issue when

      SIP Server
      terminate call and generate
      BYE
      they BYE bouncing between F5 and SIP Server and after 10 tries it send 403 timeout. Any solution?

  • jjairos_43955's avatar
    jjairos_43955
    Historic F5 Account

    Are you inserting a VIA header on the BIGIP? Having the BIGIP insert a VIA header will ensure the server uses the details in the VIA to send the BYE via the BIGIP instead of the UAC/phone directly.

     

    If you are already inserting a VIA header on the BIGIP then open a ticket with F5 Support and provide a packet and a qkview taken after the packet capture.

     

    Syntax for taking a packet capture will be like below assuming same port is used for vip and pool:

     

    tcpdump -ni 0.0:nnn -s0 "((host( or ) and port )" -w /var/tmp/SIP.cap

     

    • satish_txt_2254's avatar
      satish_txt_2254
      Icon for Cirrus rankCirrus

      We are not inserting VIA header, should i insert VIA? if yes then what would be the option and setting?

      we are just inserting

      Record-Route
      header.

      also i have created this iRule, reason i created iRule because i have notice my packet was bouncing between F5 and SIP server and adding many many record-route over and over and finally it was dying.

      when SIP_REQUEST_SEND {
           SIP::header remove "Route"
      }
      
  • Are you inserting a VIA header on the BIGIP? Having the BIGIP insert a VIA header will ensure the server uses the details in the VIA to send the BYE via the BIGIP instead of the UAC/phone directly.

     

    If you are already inserting a VIA header on the BIGIP then open a ticket with F5 Support and provide a packet and a qkview taken after the packet capture.

     

    Syntax for taking a packet capture will be like below assuming same port is used for vip and pool:

     

    tcpdump -ni 0.0:nnn -s0 "((host( or ) and port )" -w /var/tmp/SIP.cap

     

    • We are not inserting VIA header, should i insert VIA? if yes then what would be the option and setting?

      we are just inserting

      Record-Route
      header.

      also i have created this iRule, reason i created iRule because i have notice my packet was bouncing between F5 and SIP server and adding many many record-route over and over and finally it was dying.

      when SIP_REQUEST_SEND {
           SIP::header remove "Route"
      }