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()); } }
/** * Create a {@link SipProfile} to use as backend. * * @param username The username at the service. * @param password The password for authentication. * @param domain The domain for the service. * @param proxyAddress A proxy to connect to. * @return The build {@link SipProfile}. * @throws ParseException If the Sip Uri can not be parsed. */ public static SipProfile createSipProfile(String username, String password, String domain, String proxyAddress) throws ParseException { SipProfile.Builder builder = new SipProfile.Builder(username, domain); builder.setPassword(password) .setOutboundProxy(proxyAddress); return builder.build(); }