Hello: I am trying to connect SIPDEMO application to IMS Network (SBC/P-CSCF). I am using Android Studio. I just commented few lines and added following code to setup correct SipProfile , targetting P-CSCF/IMS
username="+9665xxxxxxx"; domain="rcs.xxx.xxx.com.sa"; builder.setOutboundProxy("xx.xx.xx.xx"); builder.setAuthUserName("+9665xxxx...@rcs.xxx.xxx.com.sa"); Now, I am tracing in IMS/P-CSCF and can see REGISTER message coming and is replying to my application with "401 UNAUTHORISED". You can see below 2 REGISTER messages that first one has Request-URI without port:5060 but the second one has port:5060 (in the first line of both REGISTER). This is causing failure in REGISTRATION as Response to second register should match with the first one saved in IMS...so, all i need to remove port:5060 from Request-URI in second REGISTER. Any help will be apreciated. FIRST REGISTER ============== REGISTER sip:rcs.ksa.zain.com.sa SIP/2.0 Via: SIP/2.0/UDP 51.36.23.185:1616;branch=z9hG4bKa9c834f6a38ee3cb85e41bb99ec297d3343431;rport Call-ID: 4879fafe9136742e297f1d60da8f0e35@10.185.25.70 From: <sip:+966592442...@rcs.ksa.zain.com.sa>;tag=3228249145 To: <sip:+966592442...@rcs.ksa.zain.com.sa> CSeq: 1118 REGISTER Max-Forwards: 70 User-Agent: SIPAUA/0.1.001 Contact: <sip:+966592442474@51.36.23.185:1616;transport=udp> Expires: 3600 Content-Length: 0 SECOND REGISTER =============== REGISTER sip:rcs.ksa.zain.com.sa:5060 SIP/2.0 Via: SIP/2.0/UDP 51.36.23.185:1616;branch=z9hG4bK8981b68d329313b6b56eadeb92bb53e9343431;rport Call-ID: 4879fafe9136742e297f1d60da8f0e35@10.185.25.70 From: <sip:+966592442...@rcs.ksa.zain.com.sa>;tag=3228249145 To: <sip:+966592442...@rcs.ksa.zain.com.sa> CSeq: 1119 REGISTER Max-Forwards: 70 User-Agent: SIPAUA/0.1.001 Contact: <sip:+966592442474@51.36.23.185:1616;transport=udp> Expires: 3600 Authorization: Digest username="+966592442...@rcs.ksa.zain.com.sa",realm="rcs.ksa.zain.com.sa",nonce="W5zuSqrOAyQDQ4HVyRk3/Q==",uri="sip:rcs.ksa.zain.com.sa:5060",response="a6325969f125416e6a8256a34eabbc46",algorithm=MD5,cnonce="xyz",qop=auth,nc=00000001 Content-Length: 0 On Tuesday, March 13, 2012 at 8:22:23 PM UTC+3, matej148 wrote: > > Hi to all, > we want to create SIP application on Android 2.3.3 and have some > issues with android.sip stack (default sip stack). Our mobile app > sends register sip packet, but > 1.) by default OpenIMS core responds 400 Bad request P-Visited-Network- > ID Header missing > 2.) in the case that we set port number to 4060 -PCSCF / > builder.setPort(4060)/ OpenIMS core sends this request from 4060 to > 4060 (same port, same IP, same CSCF, same packet) and this is cykling > until OpenIMS core send respond to mobile app - 504 Server Time-out. > We also tried SipDemo, CSipSimple and we had same problems. > When we tried Monster Communicator or IMSDroid, then it works! > > There is one difference between working and problematic applications - > working apps send register packet also with Authorization field. > > Part of the code: > > public SipManager mSipManager = null; > public SipProfile mSipProfile = null; > SipProfile.Builder builder = new SipProfile.Builder(username, > domain); > builder.setPassword(password); > builder.setDisplayName(username); > builder.setProfileName(username + "@" + domain); > port = Integer.parseInt(4060); > builder.setProtocol(protocol); > mSipProfile = builder.build(); > ... > try { mSipManager.open(mSipProfile);} catch (SipException e) > { ...} > try { > mSipManager.register(mSipProfile, 30, new > SipRegistrationListener() > { > public void onRegistering(String localProfileUri) > { > } > public void onRegistrationDone(String > localProfileUri, long > expiryTime) { > } > public void onRegistrationFailed(String > localProfileUri, int > errorCode, String errorMessage) { > } > }); > } catch (SipException e) { > .... > } > > How to give authorization field to register packet in classic SIP > stack? > > We also tried J-SIP but it display error: Conversion to dalvik format > failed with error 1. > > Every answer would be very appreciated. > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/c8bc3263-b178-4c94-bc4a-fd5d9788c22f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.