예제 #1
0
  /**
   * Basic implementation of the account building based on simple implementation fields. A
   * specification of this class could extend and add its own post processing here.
   *
   * <p>{@inheritDoc}
   */
  public SipProfile buildAccount(SipProfile account) {
    account.display_name = accountDisplayName.getText().trim();
    account.acc_id =
        "<sip:" + SipUri.encodeUser(accountUsername.getText().trim()) + "@" + getDomain() + ">";

    String regUri = "sip:" + getDomain();
    account.reg_uri = regUri;
    account.proxies = new String[] {regUri};

    account.realm = "*";
    account.username = getText(accountUsername).trim();
    account.data = getText(accountPassword);
    account.scheme = SipProfile.CRED_SCHEME_DIGEST;
    account.datatype = SipProfile.CRED_DATA_PLAIN_PASSWD;

    account.reg_timeout = 1800;

    if (canTcp()) {
      account.transport =
          accountUseTcp.isChecked() ? SipProfile.TRANSPORT_TCP : SipProfile.TRANSPORT_UDP;
    } else {
      account.transport = SipProfile.TRANSPORT_UDP;
    }

    return account;
  }
예제 #2
0
  private void sendInitmsg(String msg, String numb) {
    // TODO Auto-generated method stub
    if (!numb.contains("@")) {
      numb =
          "sip:"
              + numb
              + "@"
              + StaticValues.getServerIPAddress(prefs.getString(stored_server_ipaddress, ""));
    }

    msg = multimediaMsg + msg + "-" + MULTIMEDIA_MSG_INIT;

    SipMessage sipmsg =
        new SipMessage(
            SipMessage.SELF,
            SipUri.getCanonicalSipContact(numb),
            null,
            msg,
            "text/plain",
            System.currentTimeMillis(),
            SipMessage.MESSAGE_TYPE_QUEUED,
            null,
            0);
    sipmsg.setRead(true);
    getContentResolver().insert(SipMessage.MESSAGE_URI, sipmsg.getContentValues());

    Log.d("numb ", numb + " #");
  }
예제 #3
0
  /** {@inheritDoc} */
  public void fillLayout(final SipProfile account) {
    bindFields();

    String display_name = account.display_name;
    if (TextUtils.isEmpty(display_name)) {
      display_name = getDefaultName();
    }
    accountDisplayName.setText(display_name);
    ParsedSipContactInfos parsedInfo = SipUri.parseSipContact(account.acc_id);

    accountUsername.setText(parsedInfo.userName);
    accountPassword.setText(account.data);

    if (canTcp()) {
      accountUseTcp.setChecked(account.transport == SipProfile.TRANSPORT_TCP);
    } else {
      hidePreference(null, USE_TCP);
    }
  }