private void initSip() { account = SipApplication.getInstance().getAccount(); sipManager = SipManager.newInstance(this); if (sipManager == null) { showToast("SIP feature is not supported in your device"); return; } try { SipProfile.Builder builder = new SipProfile.Builder(account.getUsername(), account.getDomain()); builder.setPassword(account.getPassword()); sipProfile = builder.build(); connectSip(); } catch (ParseException e) { e.printStackTrace(); Log.e(TAG, e.getMessage()); showToast(e.getMessage()); } }
/** * Get the sip account manager for the current context. * * @param context The current context to use. * @return The {@link SipManager} for the given context. */ public static SipManager getSipManager(Context context) { if (mSipManager == null) { mSipManager = SipManager.newInstance(context.getApplicationContext()); } return mSipManager; }
public void initializeManager() { if (mSipManager == null) { mSipManager = SipManager.newInstance(this); } initializeLocalProfile(); }