本文整理匯總了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;
}
}