2 Replies Latest reply: Jul 23, 2013 8:26 AM by 2bdadeac-7653-401d-a44d-30c49f7404cd RSS

    OCCAS 4.0 overwrites the Contact header in REGISTER request sent by OCCAS

    963269
      Hello,

      I have written a SIP Client on OCCAS 4.0. When the REGISTER request is sent to the IMS Core by OCCAS, it removes the contact header I have manually set, and it puts its Contact header with lots of parameters (especially 'sipappsessionid'). This behaviour produce problems to receive INVITE.

      When an INVITE request is sent toward this client, the IMS Core uses this Contact header as Request-URI for the INVITE request (with all parameters) : OCCAS 4.0 parses the Request URI and try to find the SipApplicationSession specified in the INVITE Request URI.
      Of course, the SipApplicationSession doesn't exist anymore, so OCCAS returns an error "481 Malformed or expired encoded URI data." to the INVITE request.

      Here the REGISTER request dumped from the java code :

      REGISTER sip:sim.net SIP/2.0
      To: <sip:+32678318128@sim.net>
      Expires: 300
      Allow: INVITE, UPDATE, ACK, CANCEL, BYE, NOTIFY, OPTIONS, MESSAGE, REFER
      CSeq: 1 REGISTER
      Content-Length: 0
      Route: <sip:10.62.102.221:5060;lr>
      Supported: path
      Call-ID: e1187bc79a0c0e6e965ad7ff141db948@10.67.102.17
      User-Agent: IM-client/OMA1.0 IM-Test-Client/1.0
      Max-Forwards: 70
      From: <sip:+32678318128@sim.net>;tag=3f8a5ad9
      Contact: <sip:10.67.102.17:5060>

      Here the REGISTER request from the pcap trace at OCCAS output :

      REGISTER sip:sim.net SIP/2.0
      To: <sip:+32678318128@sim.net>
      Via: SIP/2.0/UDP 10.67.102.17:5060;wlsscid=-40d95f036e3b4ce8;branch=z9hG4bK5190649671a802971547f087f55f8bf4;sipappsessionid="keyEs1q-IM_Client-G01R01C00-registertel:+32678318128_-40d95f036e3b4ce8"
      Allow: INVITE, UPDATE, ACK, CANCEL, BYE, NOTIFY, OPTIONS, MESSAGE, REFER
      Call-ID: e1187bc79a0c0e6e965ad7ff141db948@10.67.102.17
      User-Agent: IM-client/OMA1.0 IM-Test-Client/1.0
      From: <sip:+32678318128@sim.net>;tag=3f8a5ad9
      Max-Forwards: 70
      Contact: <sip:10.67.102.17:5060;transport=udp;wlsscid=-40d95f036e3b4ce8;sipappsessionid=keyEs1q-IM_Client-G01R01C00-registertel:+32678318128_-40d95f036e3b4ce8>
      Expires: 300
      CSeq: 1 REGISTER
      Route: <sip:10.62.102.221:5060;lr>
      Content-Length: 0
      Supported: path

      Then Request-URI of received INVITE is :
      INVITE sip:10.67.102.17:5060;transport=udp;wlsscid=-40d95f036e3b4ce8;sipappsessionid=keyEs1q-IM_Client-G01R01C00-registertel:+32678318128_-40d95f036e3b4ce8 SIP/2.0

      And then OCCAS sends an error 481. :(


      To produce the REGISTER request my code is :

                     SipServletRequest sipRequest = sipFactory.createRequest(applicationSession, SIPMethodConstants.REGISTER, addr, addr);
                     sipRequest.pushRoute(sipUriImsCore);
                     sipRequest.setRequestURI(addrRUri.getURI());

                     sipRequest.setHeader("Supported", "path");
                     sipRequest.setHeader("Allow", "INVITE,UPDATE,ACK,CANCEL,BYE,NOTIFY,OPTIONS,MESSAGE,REFER");
                     sipRequest.setHeader("User-Agent", "IM-client/OMA1.0 IM-Test-Client/1.0");
                     sipRequest.setExpires(300);

                     Address addrContact = sipFactory.createAddress("<sip:10.67.102.17:5060>");
                     //sipRequest.setAddressHeader(SIPHeaderConstants.CONTACT, addrContact);
                     //sipRequest.addAddressHeader(SIPHeaderConstants.CONTACT, addrContact, true);
                     //sipRequest.addAddressHeader(SIPHeaderConstants.CONTACT, addrContact, false);
                     //sipRequest.setHeader(SIPHeaderConstants.CONTACT, "<sip:10.67.102.17:5060>");
                     sipRequest.addHeader(SIPHeaderConstants.CONTACT, "<sip:10.67.102.17:5060>");
                     
                     sipRequest.send();


      Do you know how to force OCCAS to keep the specified Contact header (as it should be according to SipServlet1.1 documentation) ?

      Regards
        • 1. Re: OCCAS 4.0 overwrites the Contact header in REGISTER request sent by OCCAS
          963269
          I have found something from log files :

          [TransactionManager] : Transaction key for the request [INVITE] is z9hG4bKa26e.a74f98e.0:10.67.120.211, server transaction is null
          [TransactionManager] : appSessionId=keyEs1q-IM_Client-G01R01C00-registertel:+33676368218_-40d95f036e3b4ce8 appSession=null
          [TransactionManager] : Servlet not found for encodeURI request, handle the request according to SipServerBean.StaleSessionHandlingerror

          So, in OCCAS configuration, I have changed the parameter 'stale-server-handling' to 'continue', and now input INVITE requests are not rejected with an error 481.

          But the method to calculate the SipApplicationKey is not called. The SipApplicationSession attached to the INVITE request has the name provided in the Request-URI.


          How to force OCCAS to call the @SipApplicationKey function to set the name of the SipApplicationSession when the usecase "stale-server-handling=continue" is used ?


          Regards
          • 2. Re: OCCAS 4.0 overwrites the Contact header in REGISTER request sent by OCCAS
            2bdadeac-7653-401d-a44d-30c49f7404cd

            Hi

             

            Did you find the solution for this, I am running into same issue. I appreciate if you can share the solution

             

            thanks