showrav017 / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

When a UAC receives a 2xx response to a target refresh request it must replace the remote target URI with the Contact Header field of the reponse, if present #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

The Call Flow Tested is:

  Jain Sip UA                                                    Remote UA (SIPP)
      |                                                              |
      |                                                              |
      |                        INVITE  (1)                           |
      | -----------------------------------------------------------> |
      |                                                              |
      |                                                              |
      |                    200 OK INVITE  (2)                        |
      |                with Header Contact: [CONTACT_VALUE_1]        |
      | <----------------------------------------------------------- |
      |                                                              |
      |                                                              |
      |                        ACK  (3)                              |
      |         with Request-Line: INVITE [CONTACT_VALUE_1] SIP/2.0  |
      | -----------------------------------------------------------> |
      |                                                              |
      |                   ***** Call Established ****                |
      |                                                              |
      |                                                              |
      |                      Re-INVITE  (4)                          |
      |     with Request-Line: INVITE [CONTACT_VALUE_1] SIP/2.0      |
      | -----------------------------------------------------------> |  
      |                                                              |
      |                                                              |
      |                     200 OK Re-INVITE (5)                     |
      |              with Header Contact: [CONTACT_VALUE_2]          |   
      | <----------------------------------------------------------- |  
      |                                                              |
      |                                                              |
      |                 ACK  (6)                                     |
      |     with Request-Line: INVITE [CONTACT_VALUE_2] SIP/2.0      |   
      |  ----------------------------------------------------------> |
      |                                                              |
      |                                                              |
      |                      BYE  (7)                                |
      |     with Request-Line: INVITE [CONTACT_VALUE_2] SIP/2.0      |
      | -----------------------------------------------------------> |  
      |                                                              |
      |                                                              |
      |                     200 OK BYE (8)                           |
      | <----------------------------------------------------------- |  

What is the expected output? What do you see instead?

 Considering the Rfcs:
   - RFC 3261 chapter 12.2.1.2:  
        When a UAC receives a 2xx response to a target refresh request, it MUST replace the dialog's remote target URI with the URI from the Contact header field in that response, if present.
   - RFC 6141 chapter 4.5: UA Updating the Dialog's Local Target in a Response.
        A UA processing an incoming target refresh request can update its local target by returning a reliable provisional response or a 2xx response to the target-refresh request. The response needs to         contain the updated local target URI in its Contact header field. On sending the response, the UA can consider the target refresh operation completed.

What version of the product are you using? On what operating system?

Tested on the current version of jain-sip

Please provide any additional information below.

Proposed patch:

Save the remote Target Uri (when receiving 200 OK INVITE):

Add this code at line 3385 of gov.nist.javax.sip.stack.SIPDialog:

ContactList contactList = sipResponse.getContactHeaders();
if (contactList != null) {
  this.setRemoteTarget((ContactHeader) contactList.getFirst());
}

The remote target uri will be save and it seems that works.

Original issue reported on code.google.com by francois...@gmail.com on 25 Oct 2012 at 11:29

GoogleCodeExporter commented 8 years ago
Here are the sipp scripts (see UAS Contact Header change between INVITE and 
Re-INVITE)

We tested with a B2BUA Application on Mobicents.

Original comment by francois...@gmail.com on 25 Oct 2012 at 11:34

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 8 Nov 2012 at 1:43

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 15 Feb 2013 at 5:25

GoogleCodeExporter commented 8 years ago
This issue was updated by revision fb270e2a1a7a.

(git-repo)

http://java.net/jira/browse/JSIP-444

Fix + non regression test on master
(cherry picked from commit 3a324bf5d9fd68628b0750fff1742c249c7d8ec0)

git-svn-id: https://svn.java.net/svn/jsip~svn/trunk@2270 
8e71dc83-d81e-6649-80f2-80b843a9b2be

Original comment by jean.deruelle on 15 Feb 2013 at 5:32

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 3a324bf5d9fd.

(git-repo)

http://java.net/jira/browse/JSIP-444

Fix + non regression test

Original comment by jean.deruelle on 15 Feb 2013 at 5:33

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 15 Feb 2013 at 5:33

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 87e87b993e98.

(git-repo)

http://java.net/jira/browse/JSIP-444

Fix regressions on testsuite and NPE discovered in logs of testsuite

Original comment by jean.deruelle on 15 Feb 2013 at 7:46

GoogleCodeExporter commented 8 years ago
This issue was updated by revision d4e0eac0b4a0.

(git-repo)

http://java.net/jira/browse/JSIP-444

(master) Fix regressions on testsuite and NPE discovered in logs of testsuite
(cherry picked from commit 87e87b993e98abeea06523cec64b74f96c34c557)

Conflicts:
    src/gov/nist/javax/sip/stack/SIPDialog.java

git-svn-id: https://svn.java.net/svn/jsip~svn/trunk@2271 
8e71dc83-d81e-6649-80f2-80b843a9b2be

Original comment by jean.deruelle on 15 Feb 2013 at 7:50

GoogleCodeExporter commented 8 years ago
Before doing a doTargetRefresh(sipResponse) while at the 
gov.nist.javax.sip.stack.SIPDialog.setLastResponse(SIPTransaction, 
SIPResponse), transaction should be checked if null. 

If the SipApplicationSession is passivated, and the application is trying to 
access the SAS at somepoint, this method will receive the last response that 
has been sent. 
If that was a 2xx from server (Contact sip:127.0.0.1:5080) the remoteTarget 
will be set to sip:127.0.0.1:5080 which is wrong.

As a result, later if the application will try to create a new Request using:
sipSession.createRequest("BYE").send();
the requestURI will be sip:127.0.0.1:5080.

The method should check if transaction is not null before doing the 
doTargetRefresh(sipResponse)

Original comment by gvage...@gmail.com on 24 May 2013 at 10:00

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 9a724a571a75.

Original comment by gvage...@gmail.com on 24 May 2013 at 10:02

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 3a324bf5d9fd.

(git-repo)

http://java.net/jira/browse/JSIP-444

Fix + non regression test

Original comment by jean.deruelle on 19 Aug 2014 at 4:59

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 87e87b993e98.

(git-repo)

http://java.net/jira/browse/JSIP-444

Fix regressions on testsuite and NPE discovered in logs of testsuite

Original comment by jean.deruelle on 19 Aug 2014 at 4:59