会话、对话和事务之间到底有什么区别?
所有的都必须一起出现吗?
发布于 2016-02-05 13:31:27
交易记录
事务由请求、收到的任何非最终(1xx)响应、最终响应(2xx、3xx、4xx、5xx或6xx)以及响应的确认(ACK或PRACK)组成,ACK到2xx响应除外。例如:
SIP peer A sends an INVITE Request to SIP peer B
SIP peer B returns a Response of 100 TRYING; this is a non-final Response, so the transaction is not completed yet
SIP peer B returns 200 OK (a final response), accepting the invitation; this completes the transaction
基本上,一个完整的请求-响应。
对话框
对话只是两个SIP对等体之间的一系列事务。对话的目的是设置,可能修改,然后拆卸会话。因此命名为Session Initiation Protocol。由于在任何时候在两个SIP对等体之间可能有许多正在进行的对话(例如,在两个SIP服务器之间可能有许多同时进行的呼叫),因此通过报头中的From、To和Call-ID字段来标识对话。因此,如果SIP对等体A同时收到两个BYE请求,则它可以查看这些字段以确定它们属于哪个对话。
您可能在对话框中看到的典型事务集可能包括:
SIP peer A invites SIP peer B to a session and suggests a certain codec, but does not include authentication and so is rejected
SIP peer A again invites SIP peer B to a session, this time supplying authentication, and the invitation is accepted
SIP peer B sends an invitation to change the codec used, and it is accepted
SIP peer A ends the session
会话
会话只是在对等体之间流动的媒体流(例如,音频或视频),通常由RTP (和可能的RTCP)分组组成。例如,如果使用SIP进行语音呼叫,则会话是在端点之间发送的语音数据
为了回答这三个问题,您需要事务和对话来创建会话,而会话是该协议的全部要点
包含对话框和事务示例的Here is a link to a thread
https://stackoverflow.com/questions/35133331
复制相似问题