• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

SIP Stack registration packet with authorization

matej148

Lurker
Mar 13, 2012
3
0
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:
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.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones