Java 如何配置我的sip帐户

Java 如何配置我的sip帐户,java,android,sip,Java,Android,Sip,如何配置我的SIP帐户。我的项目被困在这里,因为SIP的配置没有完成。 这是我的项目类的一个方法。我可以在这里使用端口号吗?或者我做什么 public void initializeLocalProfile() { if (manager == null) { return; } if (me != null) { closeLocalProfile(); } SharedPreferences prefs = Pref

如何配置我的SIP帐户。我的项目被困在这里,因为SIP的配置没有完成。
这是我的项目类的一个方法。我可以在这里使用端口号吗?或者我做什么

public void initializeLocalProfile() {
    if (manager == null) {
        return;
    }

    if (me != null) {
        closeLocalProfile();
    }

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
    String username = prefs.getString("namePref", "");
    String domain = prefs.getString("domainPref", "");
    String password = prefs.getString("passPref", "");

    if (username.length() == 0 || domain.length() == 0 || password.length() == 0) {
        showDialog(UPDATE_SETTINGS_DIALOG);
        return;
    }

    try {
        SipProfile.Builder builder = new SipProfile.Builder(username, domain);
        builder.setPassword(password);
        me = builder.build();

        Intent i = new Intent();
        i.setAction("android.SipDemo.INCOMING_CALL");
        PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, Intent.FILL_IN_DATA);
        manager.open(me, pi, null);

        // This listener must be added AFTER manager.open is called,
        // Otherwise the methods aren't guaranteed to fire.

        manager.setRegistrationListener(me.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.");
                }
            });
    } catch (ParseException pe) {
        updateStatus("Connection Error.");
    } catch (SipException se) {
        updateStatus("Connection error.");
    }
}

你面临的问题是什么????因为上面的代码很好。只需添加用户名、密码和域,您就可以注册到sip服务器