在某些日志中,存在一个invate字段来标记一次事务的开始(一次事务有多条日志),事务中有一个CALL-ID唯一标识这次事务。现在需要通过查询invate的CALL-ID,然后通过CALL-ID来获取这次事务,再求出时间差。 应该怎么操作。。
日志如下:
日志如下:
2018-09-26T01:18:45.822+0000
------------------------------------------------------------------------
INVITE sip:8666688888
Call-ID: 0_2456231099@10.81.41.3
------------------------------------------------------------------------
2018-09-26T01:18:45.842+0000
------------------------------------------------------------------------
Call-ID: 0_2456231099@10.81.41.3
------------------------------------------------------------------------
2018-09-26T01:18:45.922+0000
------------------------------------------------------------------------
ACK sip:8666688888
Call-ID: 0_2456231099@10.81.41.3
------------------------------------------------------------------------
2018-09-26T01:18:48.062+0000
------------------------------------------------------------------------
REFER sip:888880021
Call-ID: 0_2456231099@10.81.41.3
------------------------------------------------------------------------
2018-09-26T01:18:48.142+0000
------------------------------------------------------------------------
Call-ID: 0_2456231099@10.81.41.3
-----------------------------------------------------------------------
2018-09-26T01:18:48.342+0000
------------------------------------------------------------------------
SIP/2.0 200 OK
Call-ID: 0_2456231099@10.81.41.3
------------------------------------------------------------------------
2018-09-26T01:18:48.342+0000
------------------------------------------------------------------------
NOTIFY sip:8666688888
Call-ID: 0_2456231099@10.81.41.3
------------------------------------------------------------------------
1 个回复
rochy - rochy_he
赞同来自:
搜索的时候使用 TermQuery(call_id, "0_2456231099@10.81.41.3");
根据查询的结果得到 1 条或多条记录,获取记录中的 time 然后求出时间即可。