Bertybb / sipservlets

Automatically exported from code.google.com/p/sipservlets
0 stars 0 forks source link

NPE when sending a CANCEL #267

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a B2BUA application (I tested the issue only for B2BUA application)
2. in the doCancel method forward the cancel to the second user
req.getB2buaHelper().createCancel( req.getB2buaHelper().getLinkedSession( 
req.getSession() ) ).send();
3. Send a CANCEL

What is the expected output? What do you see instead?
The CANCEL that comes from the first user is forwarded to the second. Instead a 
NullPointerException is thrown.

What version of the product are you using? On what operating system?
3.0.0-SNAPSHOT (buld 521)
It works on 2.0.0-Final

Please provide any additional information below.
It's not enough to check if the hop is null at line 1480 of SipRequestImpl, 
even though it seems logical, because in that case a "javax.sip.SipException: 
Could not find original tx to cancel. RFC 3261 9.1" is thrown.

Original issue reported on code.google.com by messa...@gmail.com on 29 Apr 2014 at 12:57

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 6 May 2014 at 4:47

GoogleCodeExporter commented 8 years ago
How do you create the CANCEL request ? It doesn't have any Via Header which 
seems weird. Can you share some code ?

Original comment by jean.deruelle on 6 May 2014 at 5:12

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 6 May 2014 at 5:12

GoogleCodeExporter commented 8 years ago
As soon as possible I'll try to isolate the problem.

Original comment by messa...@gmail.com on 6 May 2014 at 10:40

GoogleCodeExporter commented 8 years ago
OK, I've reproduced the issue.

There is an ip address hard coded in SimpleSipServlet and in 
canceltest/src/test/resources/sipstack.properties

In relation to the lack of the Via header is only a matter of logging. I don't 
know why but mobicents removes the via header just before throw the exception 
(line 1366 of SipServletRequestImpl "request.removeFirst(ViaHeader.NAME);" )

Original comment by messa...@gmail.com on 7 May 2014 at 1:32

Attachments:

GoogleCodeExporter commented 8 years ago
I found out (but this could be obvious for you) that hop is null only in the 
case the server is launched with -Djboss.bind.address=0.0.0.0

Original comment by messa...@gmail.com on 7 May 2014 at 9:55

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 8 May 2014 at 4:38

GoogleCodeExporter commented 8 years ago
Reproduced.

Original comment by jean.der...@telestax.com on 27 May 2014 at 7:25

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

 Fix + non regression test
(cherry picked from commit 27e1818a8e98624dadcb6858bf27748b89766420)

Conflicts:

    containers/sip-servlets-as7-drop-in/jboss-as-mobicents/.classpath
    containers/sip-servlets-as7/.classpath
    containers/sip-servlets-catalina-7/.classpath
    containers/tomcat-7/.classpath
    sip-servlets-core-api/.classpath
    sip-servlets-impl/.classpath

Original comment by jean.der...@telestax.com on 27 May 2014 at 9:05

GoogleCodeExporter commented 8 years ago

Original comment by jean.der...@telestax.com on 27 May 2014 at 9:05

GoogleCodeExporter commented 8 years ago

Original comment by jean.der...@telestax.com on 25 Aug 2014 at 10:52