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


Java SipUri類代碼示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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