本文整理汇总了Java中com.csipsimple.api.SipUri.ParsedSipContactInfos类的典型用法代码示例。如果您正苦于以下问题:Java ParsedSipContactInfos类的具体用法?Java ParsedSipContactInfos怎么用?Java ParsedSipContactInfos使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParsedSipContactInfos类属于com.csipsimple.api.SipUri包,在下文中一共展示了ParsedSipContactInfos类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatCalleeNumber
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的package包/类
public ParsedSipContactInfos formatCalleeNumber(String fuzzyNumber) {
ParsedSipContactInfos finalCallee = SipUri.parseSipContact(fuzzyNumber);
if (TextUtils.isEmpty(finalCallee.domain)) {
String defaultDomain = getDefaultDomain();
if(TextUtils.isEmpty(defaultDomain)) {
finalCallee.domain = finalCallee.userName;
finalCallee.userName = null;
}else {
finalCallee.domain = defaultDomain;
}
}
if (TextUtils.isEmpty(finalCallee.scheme)) {
if (!TextUtils.isEmpty(default_uri_scheme)) {
finalCallee.scheme = default_uri_scheme;
} else {
finalCallee.scheme = SipManager.PROTOCOL_SIP;
}
}
return finalCallee;
}
示例2: create
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的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;
}
示例3: fillLayout
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的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);
}
示例4: fillLayout
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的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);
}
}
示例5: getDefaultDomain
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的package包/类
/**
* Get the default domain for this account
*
* @return the default domain for this account
*/
public String getDefaultDomain() {
ParsedSipContactInfos parsedAoR = SipUri.parseSipContact(acc_id);
ParsedSipUriInfos parsedInfo = null;
if(TextUtils.isEmpty(parsedAoR.domain)) {
// Try to fallback
if (!TextUtils.isEmpty(reg_uri)) {
parsedInfo = SipUri.parseSipUri(reg_uri);
} else if (proxies != null && proxies.length > 0) {
parsedInfo = SipUri.parseSipUri(proxies[0]);
}
}else {
parsedInfo = parsedAoR.getServerSipUri();
}
if (parsedInfo == null) {
return null;
}
if (parsedInfo.domain != null) {
String dom = parsedInfo.domain;
if (parsedInfo.port != 5060) {
dom += ":" + Integer.toString(parsedInfo.port);
}
return dom;
} else {
Log.d(THIS_FILE, "Domain not found for this account");
}
return null;
}
示例6: getDisplayName
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的package包/类
/**
* Gets the display name of the user.
*
* @return the caller id for this account
*/
public String getDisplayName() {
if (acc_id != null) {
ParsedSipContactInfos parsed = SipUri.parseSipContact(acc_id);
if (parsed.displayName != null) {
return parsed.displayName;
}
}
return "";
}
示例7: getSipDomain
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的package包/类
/**
* Gets the SIP domain when acc_id is [email protected]
*
* @return the sip domain for this account
*/
public String getSipDomain() {
ParsedSipContactInfos parsed = SipUri.parseSipContact(acc_id);
if (parsed.domain != null) {
return parsed.domain;
}
return "";
}
示例8: rewriteNumber
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的package包/类
private String rewriteNumber(String number) {
SipProfile acc = accountChooserButton.getSelectedAccount();
if (acc == null) {
return number;
}
String numberRewrite = Filter.rewritePhoneNumber(getActivity(), acc.id, number);
if(TextUtils.isEmpty(numberRewrite)) {
return "";
}
ParsedSipContactInfos finalCallee = acc.formatCalleeNumber(numberRewrite);
if(!TextUtils.isEmpty(finalCallee.displayName)) {
return finalCallee.toString();
}
return finalCallee.getReadableSipUri();
}
示例9: fillLayout
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的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, "");
}
}
示例10: updateRemoteName
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的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;
}
}
示例11: getSipUserName
import com.csipsimple.api.SipUri.ParsedSipContactInfos; //导入依赖的package包/类
/**
* Gets the username when acc_id is [email protected] WARNING : this is
* different from username of SipProfile which is the authentication name
* cause of pjsip naming
*
* @return the username of the account sip id. <br/>
* Example if acc_id is "Display Name" <sip:[email protected]>, it
* will return user.
*/
public String getSipUserName() {
ParsedSipContactInfos parsed = SipUri.parseSipContact(acc_id);
if (parsed.userName != null) {
return parsed.userName;
}
return "";
}