问题描述
我正在使用jain-sip实施sip服务器来处理呼叫事件,然后在Cisco cucm中记录呼叫。从启用录音的电话呼叫到禁用录音的电话(反之亦然)时,它工作正常。每个远端和近端电话都会收到两个邀请。
但是,当在两部电话之间进行通话并且在两部电话上都启用了录音(想内部通话)时,我会收到四个邀请,并且无法区分远端和近端,也无法知道哪个邀请进行处理,而忽略。两部手机都发送两个邀请,一个邀请自己,另一个邀请。通话结束后,将发送四个BYE。
处理这种情况的正确方法是什么?
下面是四个邀请;
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168..x.x:5060;branch=z9hG4bK2095e06f3b8;rport=58747
From: <sip:[email protected];x-nearend;x-refci=27425142;x-nearendclusterid=BR-Cluster2;x-nearenddevice=SEPD0C282D15AAF;x-nearendaddr=2400;x-farendrefci=27425141;x-farendclusterid=BR-Cluster2;x-farenddevice=sikander1;x-farendaddr=2701>;tag=519~00d3be95-408b-41c6-90cf-01ef66258892-27425149
To: <sip:[email protected]>
Date: Mon,09 Nov 2020 07:13:13 GMT
Call-ID: [email protected]
Supported: timer,resource-priority,replaces,X-cisco-srtp-fallback,Geolocation
Min-SE: 120
User-Agent: Cisco-cucm11.5
Allow: INVITE,OPTIONS,INFO,BYE,CANCEL,ACK,PRACK,UPDATE,REFER,SUBSCRIBE,NOTIFY
CSeq: 101 INVITE
Expires: 180
Allow-Events: presence,kpml
Call-Info: <sip:192.168..x.x:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Session-ID: 00000000000000000000000000000000;remote=00000000000000000000000000000000
Cisco-Guid: 0107253760-0000065536-0000000011-0805415104
Session-Expires: 120
P-Asserted-Identity: <sip:[email protected]>
Remote-Party-ID: <sip:[email protected]>;party=calling;screen=yes;privacy=off
Contact: <sip:[email protected]:5060;transport=tcp>;isFocus
Max-Forwards: 70
Content-Length: 0
-----------------------------------------
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168.x.x:5060;branch=z9hG4bK20a2071bec;rport=58747
From: <sip:[email protected];x-nearend;x-refci=27425141;x-nearendclusterid=BR-Cluster2;x-nearenddevice=sikander1;x-nearendaddr=2701;x-farendrefci=27425142;x-farendclusterid=BR-Cluster2;x-farenddevice=SEPD0C282D15AAF;x-farendaddr=2400>;tag=520~00d3be95-408b-41c6-90cf-01ef66258892-27425150
To: <sip:[email protected]>
Date: Mon,09 Nov 2020 07:13:13 GMT
Call-ID: [email protected]
Supported: timer,kpml
Call-Info: <sip:192.168..x.x:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Session-ID: 00000000000000000000000000000000;remote=00000000000000000000000000000000
Cisco-Guid: 0107253760-0000065536-0000000012-0805415104
Session-Expires: 120
P-Asserted-Identity: <sip:[email protected]>
Remote-Party-ID: <sip:[email protected]>;party=calling;screen=yes;privacy=off
Contact: <sip:[email protected]:5060;transport=tcp>;isFocus
Max-Forwards: 70
Content-Length: 0
-------------------------
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168..x.x:5060;branch=z9hG4bK20b5eb383e9;rport=58747
From: <sip:[email protected];x-farend;x-refci=27425142;x-nearendclusterid=BR-Cluster2;x-nearenddevice=SEPD0C282D15AAF;x-nearendaddr=2400;x-farendrefci=27425141;x-farendclusterid=BR-Cluster2;x-farenddevice=sikander1;x-farendaddr=2701>;tag=521~00d3be95-408b-41c6-90cf-01ef66258892-27425155
To: <sip:[email protected]>
Date: Mon,09 Nov 2020 07:13:13 GMT
Call-ID: [email protected]
Supported: timer,kpml
Call-Info: <sip:192.168..x.x:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Session-ID: 00000000000000000000000000000000;remote=00000000000000000000000000000000
Cisco-Guid: 0107253760-0000065536-0000000013-0805415104
Session-Expires: 120
P-Asserted-Identity: <sip:[email protected]>
Remote-Party-ID: <sip:[email protected]>;party=calling;screen=yes;privacy=off
Contact: <sip:[email protected]:5060;transport=tcp>;isFocus
Max-Forwards: 70
Content-Length: 0
-------------------------
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168..x.x:5060;branch=z9hG4bK20c2f880eb2;rport=58747
From: <sip:[email protected];x-farend;x-refci=27425141;x-nearendclusterid=BR-Cluster2;x-nearenddevice=sikander1;x-nearendaddr=2701;x-farendrefci=27425142;x-farendclusterid=BR-Cluster2;x-farenddevice=SEPD0C282D15AAF;x-farendaddr=2400>;tag=522~00d3be95-408b-41c6-90cf-01ef66258892-27425156
To: <sip:[email protected]>
Date: Mon,09 Nov 2020 07:13:13 GMT
Call-ID: [email protected]
Supported: timer,kpml
Call-Info: <sip:192.168..x.x:5060>;method="NOTIFY;Event=telephone-event;Duration=500"
Session-ID: 00000000000000000000000000000000;remote=00000000000000000000000000000000
Cisco-Guid: 0107253760-0000065536-0000000014-0805415104
Session-Expires: 120
P-Asserted-Identity: <sip:[email protected]>
Remote-Party-ID: <sip:[email protected]>;party=calling;screen=yes;privacy=off
Contact: <sip:[email protected]:5060;transport=tcp>;isFocus
Max-Forwards: 70
Content-Length: 0
解决方法
我想通常情况下,该想法可能是记录所有四个呼叫分支-即“相同”呼叫的两侧。例如一个软件,该软件可以分析记录双方的语音质量,以防双方遇到RTP流量问题或其他异常情况。编解码器差异或代码转换可能导致同一2方呼叫的一个“版本”听起来更好/更糟(或具有更大的存储要求)。 如果您不在乎该级别的RTP数据,则可能需要检查x-refci和其他“发件人:”字段,以便可以在事实发生之时或之后对其进行“重复数据删除” ...