本文整理汇总了Java中com.csipsimple.api.SipUri类的典型用法代码示例。如果您正苦于以下问题:Java SipUri类的具体用法?Java SipUri怎么用?Java SipUri使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SipUri类属于com.csipsimple.api包,在下文中一共展示了SipUri类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionModeDialpad
import com.csipsimple.api.SipUri; //导入依赖的package包/类
private void actionModeDialpad() {
ListView lv = getListView();
for(int i = 0; i < lv.getCount(); i++) {
if(lv.isItemChecked(i)) {
mAdapter.getItem(i);
String number = mAdapter.getCallRemoteAtPostion(i);
if(!TextUtils.isEmpty(number)) {
Intent it = new Intent(Intent.ACTION_DIAL);
it.setData(SipUri.forgeSipUri(SipManager.PROTOCOL_SIP, number));
startActivity(it);
}
break;
}
}
mMode.invalidate();
}
示例2: onClick
import com.csipsimple.api.SipUri; //导入依赖的package包/类
@Override
public void onClick(View view) {
String nbr = (String) view.getTag();
if (!TextUtils.isEmpty(nbr)) {
SipProfile acc = mAccountChooserButton.getSelectedAccount();
Intent it = new Intent(Intent.ACTION_CALL);
it.setData(SipUri.forgeSipUri(SipManager.PROTOCOL_CSIP, nbr));
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
it.putExtra(SipProfile.FIELD_ACC_ID, acc.id);
startActivity(it);
}
}
示例3: getAddContactIntent
import com.csipsimple.api.SipUri; //导入依赖的package包/类
@Override
public Intent getAddContactIntent(String displayName, String csipUri) {
Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT, Contacts.CONTENT_URI);
intent.setType(Contacts.CONTENT_ITEM_TYPE);
if (!TextUtils.isEmpty(displayName)) {
intent.putExtra(Insert.NAME, displayName);
}
if (!TextUtils.isEmpty(csipUri)) {
ArrayList<ContentValues> data = new ArrayList<ContentValues>();
ContentValues csipProto = new ContentValues();
csipProto.put(Data.MIMETYPE, CommonDataKinds.Im.CONTENT_ITEM_TYPE);
csipProto.put(CommonDataKinds.Im.PROTOCOL, CommonDataKinds.Im.PROTOCOL_CUSTOM);
csipProto.put(CommonDataKinds.Im.CUSTOM_PROTOCOL, SipManager.PROTOCOL_CSIP);
csipProto.put(CommonDataKinds.Im.DATA, SipUri.getCanonicalSipContact(csipUri, false));
data.add(csipProto);
intent.putParcelableArrayListExtra(Insert.DATA, data);
}
return intent;
}
示例4: create
import com.csipsimple.api.SipUri; //导入依赖的package包/类
@Override
protected CallerInfo create(String sipUri) {
CallerInfo callerInfo = null;
ParsedSipContactInfos uriInfos = SipUri.parseSipContact(sipUri);
String phoneNumber = SipUri.getPhoneNumber(uriInfos);
if (!TextUtils.isEmpty(phoneNumber)) {
Log.d(THIS_FILE, "Number found " + phoneNumber + ", try People lookup");
callerInfo = ContactsWrapper.getInstance().findCallerInfo(mContext, phoneNumber);
}
if (callerInfo == null || !callerInfo.contactExists) {
// We can now search by sip uri
callerInfo = ContactsWrapper.getInstance().findCallerInfoForUri(mContext,
uriInfos.getContactAddress());
}
if(callerInfo == null) {
callerInfo = new CallerInfo();
callerInfo.phoneNumber = sipUri;
}
return callerInfo;
}
示例5: formatRemoteContactString
import com.csipsimple.api.SipUri; //导入依赖的package包/类
/**
* Format the remote contact name for the call info
* @param callInfo the callinfo to format
* @return the name to display for the contact
*/
private String formatRemoteContactString(String remoteContact) {
String formattedRemoteContact = remoteContact;
if(resolveContacts) {
CallerInfo callerInfo = CallerInfo.getCallerInfoFromSipUri(context, formattedRemoteContact);
if (callerInfo != null && callerInfo.contactExists) {
StringBuilder remoteInfo = new StringBuilder();
remoteInfo.append(callerInfo.name);
remoteInfo.append(" <");
remoteInfo.append(SipUri.getCanonicalSipContact(remoteContact));
remoteInfo.append(">");
formattedRemoteContact = remoteInfo.toString();
}
}
return formattedRemoteContact;
}
示例6: setupFrom
import com.csipsimple.api.SipUri; //导入依赖的package包/类
private void setupFrom(String from, String fullFrom) {
Log.d(THIS_FILE, "Setup from " + from);
if (from != null) {
if (remoteFrom != from) {
remoteFrom = from;
fromText.setText(remoteFrom);
CallerInfo callerInfo = CallerInfo.getCallerInfoFromSipUri(getActivity(), fullFrom);
if (callerInfo != null && callerInfo.contactExists) {
fullFromText.setText(callerInfo.name);
} else {
fullFromText.setText(SipUri.getDisplayedSimpleContact(fullFrom));
}
loadMessageContent();
notifications.setViewingMessageFrom(remoteFrom);
}
}
}
示例7: configureCallButton
import com.csipsimple.api.SipUri; //导入依赖的package包/类
/** Configures the call button area using the given entry. */
private void configureCallButton(String callText, CharSequence nbrLabel, CharSequence number) {
View convertView = getView().findViewById(R.id.call_and_sms);
convertView.setVisibility(TextUtils.isEmpty(number) ? View.GONE : View.VISIBLE);
TextView text = (TextView) convertView.findViewById(R.id.call_and_sms_text);
View mainAction = convertView.findViewById(R.id.call_and_sms_main_action);
mainAction.setOnClickListener(mPrimaryActionListener);
mainAction.setContentDescription(callText);
if(TextUtils.isEmpty(number)) {
number = "";
}
mainAction.setTag(SipUri.getCanonicalSipContact(number.toString(), false));
text.setText(callText);
TextView label = (TextView) convertView.findViewById(R.id.call_and_sms_label);
if (TextUtils.isEmpty(nbrLabel)) {
label.setVisibility(View.GONE);
} else {
label.setText(nbrLabel);
label.setVisibility(View.VISIBLE);
}
}
示例8: buildAccount
import com.csipsimple.api.SipUri; //导入依赖的package包/类
public SipProfile buildAccount(SipProfile account) {
account.display_name = accountDisplayName.getText();
account.acc_id = "<sip:" + SipUri.encodeUser(accountUsername.getText().trim()) + "@" + getDomain() + ">";
String regUri = "sip:" + getDomain();
account.reg_uri = regUri;
account.proxies = new String[] { "sip:"+accountProxy.getText() } ;
account.realm = "*";
account.username = getText(accountAuthorization).trim();
account.data = getText(accountPassword);
account.scheme = SipProfile.CRED_SCHEME_DIGEST;
account.datatype = SipProfile.CRED_DATA_PLAIN_PASSWD;
account.reg_timeout = 1800;
account.transport = SipProfile.TRANSPORT_UDP;
return account;
}
示例9: buildAccount
import com.csipsimple.api.SipUri; //导入依赖的package包/类
public SipProfile buildAccount(SipProfile account) {
account.display_name = accountDisplayName.getText();
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(accountAuthorization).trim();
account.data = getText(accountPassword);
account.scheme = SipProfile.CRED_SCHEME_DIGEST;
account.datatype = SipProfile.CRED_DATA_PLAIN_PASSWD;
account.reg_timeout = 1800;
account.transport = SipProfile.TRANSPORT_UDP;
return account;
}
示例10: buildAccount
import com.csipsimple.api.SipUri; //导入依赖的package包/类
public SipProfile buildAccount(SipProfile account) {
account = super.buildAccount(account);
String domain = getDomain();
String[] domainPart = domain.split(":");
boolean shouldAddPort = true;
if (domainPart.length > 1) {
// If latest part is digit we should not add port
shouldAddPort = !Pattern.matches("^[0-9]+$", domainPart[1]);
}
if (shouldAddPort) {
domain = domain + ":5061";
}
account.acc_id = "<sips:" + SipUri.encodeUser(accountUsername.getText().trim()) + "@"+domainPart[0].trim()+">";
account.reg_uri = "sips:" + domain;
account.proxies = new String[] {
"sips:" + domain + ";hide"
};
account.transport = SipProfile.TRANSPORT_TLS;
account.use_zrtp = 1;
account.vm_nbr = "*98";
return account;
}
示例11: buildAccount
import com.csipsimple.api.SipUri; //导入依赖的package包/类
@Override
public SipProfile buildAccount(SipProfile account) {
account = super.buildAccount(account);
account.proxies = null;
account.reg_timeout = 3600;
account.contact_rewrite_method = 1;
account.try_clean_registers = 0;
String finalUsername = accountUsername.getText().trim();
if(accountSuffix != null) {
String suffix = accountSuffix.getText();
if(!TextUtils.isEmpty(suffix)) {
finalUsername += "x"+suffix.trim();
}
}
account.acc_id = "<sip:" + SipUri.encodeUser(finalUsername) + "@"+getDomain()+">";
return account;
}
示例12: fillLayout
import com.csipsimple.api.SipUri; //导入依赖的package包/类
public void fillLayout(final SipProfile account) {
bindFields();
accountDisplayName.setText(account.display_name);
String serverFull = account.reg_uri;
if (serverFull == null) {
serverFull = "";
}else {
serverFull = serverFull.replaceFirst("sip:", "");
}
ParsedSipContactInfos parsedInfo = SipUri.parseSipContact(account.acc_id);
accountUserName.setText(parsedInfo.userName);
accountServer.setText(serverFull);
accountPassword.setText(account.data);
}
示例13: buildAccount
import com.csipsimple.api.SipUri; //导入依赖的package包/类
public SipProfile buildAccount(SipProfile account) {
Log.d(THIS_FILE, "begin of save ....");
account.display_name = accountDisplayName.getText().trim();
String[] serverParts = accountServer.getText().split(":");
account.acc_id = "<sip:" + SipUri.encodeUser(accountUserName.getText().trim()) + "@"+serverParts[0].trim()+">";
String regUri = "sip:" + accountServer.getText();
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;
//By default auto transport
account.transport = SipProfile.TRANSPORT_UDP;
return account;
}
示例14: buildAccount
import com.csipsimple.api.SipUri; //导入依赖的package包/类
public SipProfile buildAccount(SipProfile account) {
account = super.buildAccount(account);
String accId = "";
if(!TextUtils.isEmpty(accountCallerId.getText().trim())) {
accId += accountCallerId.getText().trim() +" ";
}
accId += "<sip:" + SipUri.encodeUser(accountUserName.getText().trim()) + "@" + getDomain() + ">";
account.acc_id = accId;
String regUri = "sip:" + getDomain();
account.reg_uri = regUri;
account.proxies = new String[]{regUri};
account.proxies = new String[] {"sip:nat.babytel.ca:5065"};
account.transport = SipProfile.TRANSPORT_UDP;
account.reg_timeout = 900;
account.ice_cfg_use = 1;
account.ice_cfg_enable = 1;
return account;
}
示例15: fillLayout
import com.csipsimple.api.SipUri; //导入依赖的package包/类
/**
* {@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);
}
}