【发布时间】:2016-05-10 01:39:56
【问题描述】:
会话、对话和事务之间到底有什么区别?
所有人都必须在一起吗?
【问题讨论】:
标签: session transactions dialog sip
会话、对话和事务之间到底有什么区别?
所有人都必须在一起吗?
【问题讨论】:
标签: session transactions dialog sip
事务由请求、收到的任何非最终 (1xx) 响应和最终响应(2xx、3xx、4xx、5xx 或 6xx)以及响应的确认(ACK 或 PRACK)组成,除了对 2xx 响应的 ACK。例如:
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 对等方之间的一系列事务。对话的目的是设置,可能修改,然后拆除会话。因此得名会话发起协议。由于两个 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 包含对话和事务的示例
【讨论】: