just50415 / android-rcs-ims-stack

Automatically exported from code.google.com/p/android-rcs-ims-stack
0 stars 0 forks source link

SIP INVITE for one-to-one chat unsuccesful #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Install 2.2.8 rcs-e client application on the android phone.
2.Initiate one-to-one chat with another phone.
3.SIP INVITE does not go through.
(Please refer to packet 1274 in the attached capture.)

What is the expected output? What do you see instead?
- SIP INVITE should go through and the chat session should be established. The 
INVITE does not go through and 403 Forbidden Error is received.Please refer to 
packet 1274 in the attached capture.

What version of the product are you using? On what operating system?
- RCS-e client, version 2.2.8, 

Please provide any additional information below.
We fixed the SIP INVITE failure by making the following changes in 
com.orangelabs.rcs.core.ims.network.sip.SipMesageFactory.java -

1) Route: header needs to be prefixed to include both defaultRoute and Route.

Ex: Route: <sip:10.67.64.21:4060;lr;transport=UDP> needs to be changed to 
something like - Route: 
<sip:10.67.64.21:4060;lr;transport=UDP>,<sip:orig@scscf.us.intinfra.com:6060;lr>

Code snippet
============
            // Set the Route header
            Vector<String> defaultRoute = dialog.getSipStack().getDefaultRoutePath();
            for(int i=0; i < defaultRoute.size(); i++) {
                Header defaultRouteHeader = SipUtils.HEADER_FACTORY.createHeader(RouteHeader.NAME, defaultRoute.elementAt(i));
                invite.addHeader(defaultRouteHeader);
            }

            // Set the Route header
            Vector<String> route = dialog.getRoute();
            for(int i=0; i < route.size(); i++) {
                Header routeHeader = SipUtils.HEADER_FACTORY.createHeader(RouteHeader.NAME, route.elementAt(i));
                invite.addHeader(routeHeader);
            }

2)Formatting the P-Preferred-Identity header to remove the 'user=phone' tag

Ex:P-Preferred-Identity: "anu" <sip:8047620201@us.intinfra.com;user=phone> 
needs to be changed to P-Preferred-Identity: <sip:8048524288@us.intinfra.com>

Code snippet
============
            // Set the P-Preferred-Identity header
            AddressImpl formatAddress = (AddressImpl)SipUtils.ADDR_FACTORY.createAddress(dialog.getLocalParty());
            formatAddress.removeParameter("user");
            Header prefHeader = SipUtils.HEADER_FACTORY.createHeader(SipUtils.HEADER_P_PREFERRED_IDENTITY, formatAddress.getURI().toString());
            invite.addHeader(prefHeader);

Please let us know if the above fixes are correct and also if there are any 
other changes that 2.2.8 apks are missing.

Original issue reported on code.google.com by Anupama....@gmail.com on 10 Aug 2011 at 2:36

Attachments:

GoogleCodeExporter commented 8 years ago
1) is fixed
2) is rejected

Original comment by jmauffret@gmail.com on 19 Sep 2011 at 9:32