当前位置: 首页>>代码示例>>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;未经允许,请勿转载。