http://stackoverflow.com/questions/35133331/difference-between-session-dialog-and-transaction-in-sip

http://sipforum.org/pipermail/discussion/2007-August/003046.html

http://stackoverflow.com/questions/34562635/difference-between-dialog-and-session-in-sip

Transactions

A transaction consists of a Request, any non-final (1xx) Responses received, and a final Response (2xx, 3xx, 4xx, 5xx, or 6xx), as well as the acknowledgements of the Responses (ACK or PRACK), except for ACKs to 2xx Responses. For example:

SIP peer A sends an INVITE Request to SIP peer B
SIP peer B returns a Response of TRYING; this is a non-final Response, so the transaction is not completed yet
SIP peer B returns OK (a final response), accepting the invitation; this completes the transaction

Basically, one complete Request-Response.

Dialogs

A dialog is just a series of transactions between two SIP peers. The purpose of a dialog is to setup, possibly modify, and then teardown a session. Hence the name Session Initiation Protocol. Since there could be many dialogs in progress between two SIP peers at any time (e.g. there could be many simultaneous calls in progress between two SIP servers), dialogs are identified by the From, To, and Call-ID fields in the header. So if SIP peer A gets two BYE Requests at the same time, it can look at these fields to determine which dialog they belong to. 
A typical set of transactions you might see in a dialog could include:

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

Sessions

A session is just a media stream (e.g. audio or video) flowing between peers, usually consisting of RTP (and possibly RTCP) packets. For example, if SIP is used to make a voice call, the session is the voice data that is sent between endpoints.

To answer the question do you need all three together, you need transactions and dialogs in order to create sessions, and sessions are the whole point of the protocol

Here is a link to a thread that contains examples of dialogs and transactions.

Since there can be many dialogs in progress at a time between two peers (e.g. many calls in progress between two SIP servers), these tags just serve to identify which dialog a particular request or response belongs to.

======================

A transaction refers to a fundamental unit of message exchange. It
basically includes a request-response cycle. Dialog represents a peer-to-peer relationship between two user
agents.It is usually created through generation of "non-failure"
responses to request. e.g. Example-1: UAC UAS
---INVITE (a)--->
<--100 Trying (b)-----
<---200 OK (c)-------- ---ACK (d)---------------> <-----BYE(e)----------------
----200OK (f)------------------> In the example 1, (a) to (c) are one transaction. (d) is second
transaction and (e)& (f) constitute third transaction. Together, these three transaction constitute one dialog Example-2: UAC UAS
-----INVITE (g)----->
<---100 Trying-(h)----
<--486 Busy (i)------
---ACK (j)-------------> In the example-2, the messages from (g) to (j) constitute one
transaction. This is a "no-dialog" scenario. A session refers to the exchange of media between two or more Endpoints.
Also, there can be dialogs without SIP sessions. =====================
From RFC 3261
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 RFC 2543.
  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.

In my own words: A SIP dialog refers to the signaling relationship between two peers. A SIP dialog can be used to establish calls (INVITE), but there are other SIP methods that could establish a dialog (e.g. SUBSCRIBE)

A (multimedia) session is exchanged through a SIP dialog initiated by an INVITE method, using the SDP offer/answer (see RFC 3264)

最新文章

  1. Android SDK 与API版本对应关系
  2. XtraBackup原理解读
  3. ubuntu 13.04下MYSQL 5.5环境搭建
  4. urllib编码
  5. linux下动态链接库.so文件 静态链接库.a文件创建及使用
  6. C#.Net 图片处理大全
  7. iOS:UIAlertController和UIAlertAction的详解
  8. MongoDB工具MagicMongoDBTool
  9. Win8.1重装win7或win10中途无法安装
  10. Java中的二进制及基本的位运算
  11. matlab——之class类(详细总结)
  12. 【Git】Git使用记录: remove *.lock eg: index.lock/head.lock
  13. 左查询left join on简单总结
  14. vue中上传图片至阿里云oss
  15. powershell脚本的格式化
  16. powerdesiner技巧
  17. POJ2230 Watchcow
  18. [Deep-Learning-with-Python] Keras高级概念
  19. 使用JPush(极光推送)实现远程通知
  20. yum常用操作

热门文章

  1. linux系统中/etc/syslog.conf文件解读
  2. memcached server LRU 深入分析
  3. CSS(四):字体和文本属性
  4. Easy UI分页控件修改刷新方法后触发两次请求
  5. 在linux 列出 超级用户 普通用户和 系统用户
  6. 开源 java CMS - FreeCMS2.3 移动app生成栏目数据
  7. js调绝对定位的top
  8. .NET Entity Framework(EF)使用SqlQuery直接操作SQL查询语句或者执行过程
  9. Tomcat高并发配置优化
  10. 数据驱动ddt+excel数据读取