本文整理汇总了Java中com.csipsimple.pjsip.PjSipService类的典型用法代码示例。如果您正苦于以下问题:Java PjSipService类的具体用法?Java PjSipService怎么用?Java PjSipService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PjSipService类属于com.csipsimple.pjsip包,在下文中一共展示了PjSipService类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: on_restore_contact
import com.csipsimple.pjsip.PjSipService; //导入依赖的package包/类
@Override
public pj_str_t on_restore_contact(int acc_id) {
int active = accountCleanRegisters.get(acc_id, 0);
if(active == 0) {
return EMPTY_STR;
}
long db_acc_id = PjSipService.getAccountIdForPjsipId(mCtxt, acc_id);
String key_expires = REG_EXPIRES_PREFIX + Long.toString(db_acc_id);
String key_uri = REG_URI_PREFIX + Long.toString(db_acc_id);
int expires = prefs_db.getInt(key_expires, 0);
int now = (int) Math.ceil(System.currentTimeMillis() / 1000.0);
if(expires >= now) {
String ret = prefs_db.getString(key_uri, "");
Log.d(THIS_FILE, "We restore " + ret);
return pjsua.pj_str_copy(ret);
}
return EMPTY_STR;
}
示例2: on_save_contact
import com.csipsimple.pjsip.PjSipService; //导入依赖的package包/类
@Override
public void on_save_contact(int acc_id, pj_str_t contact, int expires) {
long db_acc_id = PjSipService.getAccountIdForPjsipId(mCtxt, acc_id);
String key_expires = REG_EXPIRES_PREFIX + Long.toString(db_acc_id);
String key_uri = REG_URI_PREFIX + Long.toString(db_acc_id);
Editor edt = prefs_db.edit();
edt.putString(key_uri, PjSipService.pjStrToString(contact));
int now = (int) Math.ceil(System.currentTimeMillis() / 1000.0);
edt.putInt(key_expires, now + expires);
// TODO : have this asynchronous
edt.commit();
}
示例3: clearDynPlugins
import com.csipsimple.pjsip.PjSipService; //导入依赖的package包/类
/**
* Reset all dynamic plugins infos
*/
public static void clearDynPlugins() {
CACHED_RESOLUTION.clear();
CACHED_ACTIVITY_RESOLUTION.clear();
PjSipService.resetCodecs();
}