本文整理匯總了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();
}