當前位置: 首頁>>代碼示例>>Java>>正文


Java SipUri.parseSipContact方法代碼示例

本文整理匯總了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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:24,代碼來源:CallerInfo.java

示例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);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:19,代碼來源:Basic.java

示例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);
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:SimpleImplementation.java

示例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, "");
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:40,代碼來源:Advanced.java

示例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;
        }
    }
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:52,代碼來源:InCallCard.java


注:本文中的com.csipsimple.api.SipUri.parseSipContact方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。