SIP概念区别 Session Dialog Transaction

What are the relationships and differences between dialogue, transaction and session?

1. A dialog represents a peer-to-peer SIP relationship between two user agents that persists for some time, as a call-leg.It is identified at each UA with a dialog ID, which consists of a Call-ID, From tag and To tag. We can call a dialog is established when three values are all generated.

2. A sip transaction consists of a single request and any responses to that request, which includes zero or more provisional responses and one or more final responses.The branch parameter value in the VIA header is used to identify the transaction created by that request.

3.Session: In the SDP specification, a multimedia session is a set of multimedia senders and receivers and the data streams flowing from senders to receivers.  A session is defined by the SDP user name, session id, network type, address type, and address elements in the origin field.
A session can have multiple RTP sessions corresponding to the UDP ports define in the line of the SDP.

Summay:
1.Dialog and transaction are the concepts in the signalling part;But the session is the concept in the media transport part. SIP uses the SDP to notify the transport protocol(RTP) to create, add, remove and modify the sessions.

2.Generally, SIP can invite the user to attend an existing session, which occures in the conference call. In such case, the To tag as well as the call-ID which uniquely identifies a particular invitation, could be different to those of the existing dialog, so a new dialog is needed.
4. dialog的建立是收到UAS的响应(To tag)时开始建立的。收到180响应时建立
dialog叫做早期对话(early dialog),收到2XX的应答开始才是真正的dialog建立。

session 是媒体交换之后才建立的。具体而言就是通过offer/answer方式交换sdp的媒体。
session的建立可以使INVITE-200 也可以是200-ACK。这要看媒体的交换发生的时间。
具体来说,INVITE 中的消息体用sdp语言来描述自己可处理的媒体类型,200OK中
带回UAS端可处理的媒体类型。这个时候媒体交换就算是完成了。也就是session建立起
来了。

dialog是end-point对end-point的关系。而transcation 是hop by hop的关系。dialog通过
From tag, To tag(应该说local tag,remote tag--这两个tag随着UAC和UAS而不同。)以及
Call-ID 来判别。而transcation是一个SIP entity和下一个SIP entity之间请求和应答关系,
是通过对Via里的branch来判别的。

From : http://blog.csdn.net/shanyiwen/article/details/5794115

你可能感兴趣的:(SIP概念区别 Session Dialog Transaction)