我希望这是我关于这个 SIP 主题的最后一个问题,我已经通过请朋友从远程计算机帮助我来克服我遇到的最后一个问题,我能够在计算机之间进行连接,但事情就是这样,根据我看到的所有示例,被叫方应该调用振铃响应,但在我的应用程序中我还没有实现它,但我仍然在主叫方 UAC 上收到振铃响应,这是 SIP 消息来电端:
传出请求 5:
INVITE sip:320@hostName.hn SIP/2.0
Contact: "Client 310" <sip:310@hostName.hn>
From: "Client 310" <sip:310@hostName.hn>
Max-Forwards: 32
CSeq: 2 INVITE
Call-ID: f8d171d3278788df9e03eb9cf3acba70@xxx.xxx.x.xxx
Allow: INVITE,CANCEL,ACK,BYE,OPTIONS
Content-Type: application/sdp
Proxy-Authorization: Digest username="310",nonce="012afffb",realm="asterisk",uri="sip:310@hostName.hn",algorithm=MD5,response="d19ca5b98450b4be7bd4045edb8a3a2f"
Via: SIP/2.0/UDP hostName.hn:5060
To: "Client 320" <sip:320@hostName.hn>;tag=as5a8fa200
Content-Length: 257
v=0
o=310 7108915969559970847 7108915969559970847 IN IP4 xxx.xxx.x.xxx
s=-
i=Nu-Art Software - TacB0sS VoIP information
c=IN IP4 xxx.xxx.x.xxx
m=audio 3312 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
传入响应 6:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:310@hostName.hn>
To: "Client 320" <sip:320@hostName.hn>;tag=as5a8fa200
Call-ID: f8d171d3278788df9e03eb9cf3acba70@xxx.xxx.x.xxx
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Contact: <sip:320@yy.yy.yy.yy>
Content-Length: 0
传入响应 7:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:310@hostName.hn>
To: "Client 320" <sip:320@hostName.hn>;tag=as5a8fa200
Call-ID: f8d171d3278788df9e03eb9cf3acba70@xxx.xxx.x.xxx
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Contact: <sip:320@yy.yy.yy.yy>
Content-Length: 0
呼叫:320@hostName.hn 正在振铃
传入响应 8:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:310@hostName.hn>
To: "Client 320" <sip:320@hostName.hn>;tag=as5a8fa200
Call-ID: f8d171d3278788df9e03eb9cf3acba70@xxx.xxx.x.xxx
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Contact: <sip:320@yy.yy.yy.yy>
Content-Type: application/sdp
Content-Length: 264
v=0
o=root 27669 27669 IN IP4 yy.yy.yy.yy
s=session
c=IN IP4 yy.yy.yy.yy
t=0 0
m=audio 10914 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
传入响应 9:
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP hostName.hn:5060;branch=f8d171d3278788df9e03eb9cf3acba70-xxx.xxx.x.xxx-2-invite-hostName.hn-5060333732;received=79.181.6.233
From: "Client 310" <sip:310@hostName.hn>
To: "Client 320" <sip:320@hostName.hn>;tag=as5a8fa200
Call-ID: f8d171d3278788df9e03eb9cf3acba70@xxx.xxx.x.xxx
CSeq: 2 INVITE
User-Agent: Freeswitch 1.2.3
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Content-Length: 0
我没有回应邀请,这就是为什么这一切都发生了,但是如果我不是发送邀请的人,为什么我会收到铃声。
谢谢,
亚当。
更新:
如果您会注意到我收到回复的时间:
传入响应 7:1275879030656 响铃
传入响应 8:1275879038734 会话进度
传入响应 9:1275879038781 服务不可用
我不明白这里的逻辑,我从第一次响铃到会话进度有 8 秒,但从会话进度到服务不可用我有 47 毫秒?
这有什么意义?50毫秒做什么?分析响应的时间 + 打开 RTP 会话的时间 + 构建响应的时间 + 构建 SDP 的时间 + 服务器接收消息所用的时间 - 503 消息到达我的 UAC 所用的时间,不是这切割有点接近?我应该在什么时候响应服务器?
再次感谢您的所有帮助 Wiz。