himalaya51 / sipservlets

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

Content of proxy branches responses cannot be modified #202

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Create a proxy branch for an INVITE request
2.Get the response and try to modify the content.

What is the expected output? What do you see instead?
An exception is rised
    at org.mobicents.servlet.sip.proxy.ProxyImpl.sendFinalResponse(ProxyImpl.java:763) [sip-servlets-impl-2.0.0.FINAL.jar:2.0.0.FINAL]
    at org.mobicents.servlet.sip.proxy.ProxyImpl.onFinalResponse(ProxyImpl.java:638) [sip-servlets-impl-2.0.0.FINAL.jar:2.0.0.FINAL]
    at org.mobicents.servlet.sip.proxy.ProxyBranchImpl.onResponse(ProxyBranchImpl.java:614) [sip-servlets-impl-2.0.0.FINAL.jar:2.0.0.FINAL]
    at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:446) [sip-servlets-impl-2.0.0.FINAL.jar:2.0.0.FINAL]
    ... 13 more
Caused by: java.lang.IllegalStateException: Message already sent or incoming 
message
    at org.mobicents.servlet.sip.message.SipServletResponseImpl.checkMessageState(SipServletResponseImpl.java:760) [sip-servlets-impl-2.0.0.FINAL.jar:2.0.0.FINAL]
    at org.mobicents.servlet.sip.message.SipServletMessageImpl.setContent(SipServletMessageImpl.java:1316) [sip-servlets-impl-2.0.0.FINAL.jar:2.0.0.FINAL]
    at com.medooze.mediaproxy.MediaProxyServlet.doInviteResponse(MediaProxyServlet.java:150)

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

Please provide any additional information below.
The problem is that the checkMessageState(); is returning true for proxyBranch 
responses as :

      @Override
        protected void checkMessageState() {
                if(isMessageSent || getTransaction() instanceof ClientTransaction) {
                        throw new IllegalStateException("Message already sent or incoming message");
                }
        }

It seems weird to be able to modify the content of a outgoing proxy branch 
request as the request is cloned, but it is not possible to do the same in the 
response of the branch. Is this intentional? I understand that the original 
request could not be modified outside of the proxy branch because there was no 
meaning to know if the request was going to be proxied or not, but in the 
response there is a public boolean isBranchResponse()that could be used for 
that purpose.

Original issue reported on code.google.com by sergio.g...@gmail.com on 25 Mar 2013 at 10:17

GoogleCodeExporter commented 8 years ago

Original comment by jean.deruelle on 5 Jul 2013 at 7:44

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 25c5d3e24576.

Original comment by jean.der...@telestax.com on 7 Mar 2014 at 3:29

GoogleCodeExporter commented 8 years ago

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