对话
Dialog: A dialog is a peer-to-peer SIP relationship between two UAs that persists for some time. A dialog is established by
SIP messages, such as a 2xx response to an INVITE request. A dialog is identified by a call identifier, local tag, and a remote tag. A dialog was formerly known as a call leg in RFC2543.
对话:一个对话指的是两个UA之间端到端的SIP关系,并且这种关系能维持一段时间。对话是通过SIP消息创建的,对于INVITE请求的2xx应答就会创建一个对话。对话是通过 call identifier(呼叫ID), local tag(本地tag), and a remote tag(远程tag)区分的。在RFC2543中对话被看做是呼叫别名。
会话
Session: From the SDP specification: "A multimedia session is a set of multimedia senders and receivers and the data streams
flowing from senders to receivers. A multimedia conference is an example of a multimedia session." (RFC 2327 [1]) (A session
as defined for SDP can comprise one or more RTP sessions.) As defined, a callee can be invited several times, by different calls, to the same session. If SDP is used, a session is defined by the concatenation of the SDP user name, session id,
network type, address type, and address elements in the origin field.
会话:根据SDP 的描述:“一个多媒体会话是多媒体的发送者和接收者以及传输与发送者与接收者之间的多媒体流,一个多媒体会议是一个多媒体会话的例子”(在SDP定义下的会话是可以包含一个或者多个RTP会话)。一个被叫方可以被邀请多次,被不同的呼叫方呼叫至同一个会话,如果使用了SDP,一个会话被SDP开头处的一些相关的SDP用户名、会话id、网络类型、地址类型元素定义。
事务
SIP Transaction: A SIP transaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up to a final (non-1xx) response sent from the server to the client. If the request is INVITE
and the final response is a non-2xx, the transaction also includes an ACK to the response. The ACK for a 2xx response to an INVITE request is a separate transaction.
sip事务:一个sip事务指的是一个客户端、一个服务器以及从第一个由客户端发往服务器的请求一直到服务器发往客户端的非1xx最终响应。如果请求是INVITE并且最终的响应是非2xx,这个事务包含客户端对服务器响应的ack确认。如果INVITE请求有2xx响应,那么最终的ACK属于一个独立的事务。
Transaction User (TU): The layer of protocol processing that resides above the transaction layer. Transaction users include
the UAC core, UAS core, and proxy core.
事务用户:事务用户是协议处理层,位于传输层之上。事务用户包括UAC核心、UAS核心、和代理核心。
总结
因为sip是端到端的信令,在完成一项工作过程当中可能是需要几次信令交互才能完成,这几次的信令交互属于一个组,怎么来标识这个组呢?就是通过事务来标识的,所以在sip当中给事务最直白的解释就是一个信令与其所有的应答组成一个事务。设置事务层的另一个作用是简化应用层的逻辑,应用层只需要关注产生消息、处理消息,对于消息是否需要重传,以及重传消息的过滤都是由事务层完成。
事务是有状态的,对话也是有状态的,那么怎么区分事务与对话呢?
在上图中描述的是Alice与Bob之间的一个对话,这个对话中包含了3个事务,F1,F2,F3组成了一个invite事务,F4是一个事务,F5,F6组成了一个非invite事务。