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);
}
});
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