本文整理汇总了Java中com.csipsimple.api.SipUri.parseSipContact方法的典型用法代码示例。如果您正苦于以下问题:Java SipUri.parseSipContact方法的具体用法?Java SipUri.parseSipContact怎么用?Java SipUri.parseSipContact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.csipsimple.api.SipUri
的用法示例。
在下文中一共展示了SipUri.parseSipContact方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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);
}
}
示例4: fillLayout
import com.csipsimple.api.SipUri; //导入方法依赖的package包/类
public void fillLayout(final SipProfile account) {
bindFields();
accountDisplayName.setText(account.display_name);
ParsedSipContactInfos parsedInfo = SipUri.parseSipContact(account.acc_id);
String serverFull = account.reg_uri;
if (serverFull == null) {
serverFull = "";
}else {
serverFull = serverFull.replaceFirst("sip:", "");
}
// We have to set safe, because custom wizards may hide some fields
setFieldTextSafe(accountServer, serverFull);
setFieldTextSafe(accountCallerId, parsedInfo.displayName);
setFieldTextSafe(accountUserName, parsedInfo.userName);
if(!TextUtils.isEmpty(account.username)
&& !account.username.equals(parsedInfo.userName)) {
setFieldTextSafe(accountAuthId, account.username);
}else {
setFieldTextSafe(accountAuthId, "");
}
setFieldTextSafe(accountPassword, account.data);
if(accountUseTcp != null) {
accountUseTcp.setChecked(account.transport == SipProfile.TRANSPORT_TCP);
}
if(account.proxies != null && account.proxies.length > 0) {
setFieldTextSafe(accountProxy, account.proxies[0].replaceFirst("sip:", ""));
}else {
setFieldTextSafe(accountProxy, "");
}
}
示例5: updateRemoteName
import com.csipsimple.api.SipUri; //导入方法依赖的package包/类
private void updateRemoteName() {
final String aRemoteUri = callInfo.getRemoteContact();
// If not already set with the same value, just ignore it
if (aRemoteUri != null && !aRemoteUri.equalsIgnoreCase(cachedRemoteUri)) {
cachedRemoteUri = aRemoteUri;
ParsedSipContactInfos uriInfos = SipUri.parseSipContact(cachedRemoteUri);
String text = SipUri.getDisplayedSimpleContact(aRemoteUri);
StringBuffer statusTextBuffer = new StringBuffer();
remoteName.setText(text);
if (callInfo.getAccId() != SipProfile.INVALID_ID) {
SipProfile acc = SipProfile.getProfileFromDbId(getContext(), callInfo.getAccId(),
new String[] {
SipProfile.FIELD_ID, SipProfile.FIELD_DISPLAY_NAME
});
if (acc != null && acc.display_name != null) {
statusTextBuffer.append("SIP/" + acc.display_name + " : ");
}
} else {
statusTextBuffer.append("SIP : ");
}
statusTextBuffer.append(uriInfos.userName);
remoteSipAddress.setText(statusTextBuffer.toString());
Thread t = new Thread() {
public void run() {
// Looks like a phone number so search the contact throw
// contacts
CallerInfo callerInfo = CallerInfo.getCallerInfoFromSipUri(getContext(),
cachedRemoteUri);
if (callerInfo != null && callerInfo.contactExists) {
LoadCallerInfoMessage lci = new LoadCallerInfoMessage(InCallCard.this, callerInfo);
userHandler.sendMessage(userHandler.obtainMessage(LOAD_CALLER_INFO,
lci));
}
};
};
t.start();
}
// Useless to process that
if (cachedInvState == callInfo.getCallState() &&
cachedMediaState == callInfo.getMediaStatus()) {
return;
}
}