UAC 發送 INVITE,UAS 回 180 Ringing,首次 tid 雙方皆為 1。UAS 重啟後,UAS 端 tid=1,但 UAC 收到的 tid=2。
eXosip 內部事務層(Transaction Layer)根據 Call-ID、CSeq、Via 分支識別事務。UAS 重啟後記憶體狀態重置,但網路對端(UAC)仍保留舊事務狀態,導致雙方事務 ID 不同步。
Call-ID 標頭。Map<String, Long> callIdToTid 記錄本端對應 tid。eXosip_transaction_terminate() 銷毀舊事務,重新建立。eXosip_automatic_refresh)僅能緩解,無法 100% 保證雙向同步。// 應用層比對 Call-ID
String callId = je->request->call_id->value;
Long localTid = map.get(callId);
if (localTid != null && localTid != je->tid) {
eXosip_transaction_terminate(localTid); // 清理舊事務
}
map.put(callId, je->tid);