0
votes

after signing in from getonsip.com to get a free SIP account, I tried to use the credentials with the provided android Sip Demo, but cannot continue due to the registration failure.

username, domain, password is from the settings displayed from the web after logging in.

I also confirmed that is has VOIP and SIP API using package manager, though there is no SIP over wifi (I think VOIP can be used.).

here is the code:

if(mSipManager == null) {
            mSipManager = SipManager.newInstance(this);
            Toast.makeText(this, "is wifi supported?" + mSipManager.isSipWifiOnly(this) + ", is VOIP support?" + mSipManager.isVoipSupported(this) +
                    ", is API support?" + mSipManager.isApiSupported(this), Toast.LENGTH_LONG).show();
        }

        SipProfile.Builder builder = new SipProfile.Builder(username, domain);
        builder.setPassword(password);
        mSipProfile = builder.build();

        Intent intent = new Intent();
        intent.setAction("android.SipDemo.INCOMING_CALL");
        PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, Intent.FILL_IN_DATA);
        mSipManager.open(mSipProfile, pendingIntent, null);

        mSipManager.setRegistrationListener(mSipProfile.getUriString(), new SipRegistrationListener() {

            public void onRegistering(String localProfileUri) {
                updateStatus("Registering with SIP Server...");
            }

            public void onRegistrationDone(String localProfileUri, long expiryTime) {
                updateStatus("Ready");
            }

            public void onRegistrationFailed(String localProfileUri, int errorCode,
                String errorMessage) {
                updateStatus("Registration failed.  Please check settings." + errorMessage);
            }
        });
1
What status you have got ? - Priyank Patel
by status you mean error code? the error code is -9 - vims liu
Error code -9 means IN_PROGRESS - The client is in a transaction and cannot initiate a new one. checkout here SipErrorCode. Kill your app and restart it again to register. - Priyank Patel
was able to get it registered by using another android device (with few tweaks), wonder whats wrong with the other device though both have voip and sip api base on what packagemanager returned. - vims liu

1 Answers

1
votes

from building the profile add few more settings like the one from below:

SipProfile.Builder builder = new SipProfile.Builder(username, domain);
        builder.setPassword(password);
        builder.setAuthUserName(auth_username);
        builder.setOutboundProxy(outbound_proxy);
        mSipProfile = builder.build();

then make sure you are able to login through the web using the site: https://app.onsip.com/app/, to know if the device can cannot to their server