SIP中的 session, dialog 及 transaction 的解释
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 3261Dialog: 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)
SIP中的 session, dialog 及 transaction 的解释的更多相关文章
- hibernate 中的session和事务(Transaction)
在使用hibernate开发时,遇到最多的就是session与事务,那么他们两个有什么关系呢?下面我来抛砖引玉: 1.session是hibernate中的以及缓存机制,是用来对数据进行增删改查的一个 ...
- 【转】SIP 中的Dialog,call,session 和 transaction
如果你对Sip协议中Call, Dialog, Transaction和Message之间的关系感觉到迷惑,那么,那么我可以告诉你,你并不孤单,因为大多数初学者对于这些名词之间的关系都会感到疑惑. ...
- 第四讲 :hibernate中的session
hibernate中的session中可以进行增删改差,通过工具类可以得到相关的工具类. 方法概要: Transaction beginTransaction()开始一个工作单元,得到关联的事务对象 ...
- Hibernate中的session对象update方法的使用
使一个游离对象转变为持久化对象.例如以下代码在session1中保存了一个Customer对象,然后在session2中更新这个Customer对象: Customer customer = new ...
- Spring与Hibernate集成中的Session问题
主要讨论Spring与Hibernate集成中的session问题 1.通过getSession()方法获得session进行操作 public class Test extends Hibernat ...
- Sipdroid实现SIP(六): SIP中的请求超时和重传
目录 一. Sipdroid的请求超时和重传 二. SIP中超时和重传的定义 三. RFC中超时和重传的定义 一. Sipdroid的请求超时和重传 Sipdroid实现SIP协议栈系列, 之前的文章 ...
- 巨人大哥谈Web应用中的Session(session详解)
巨人大哥谈Web应用中的Session(session详解) 虽然session机制在web应用程序中被采用已经很长时间了,但是仍然有很多人不清楚session机制的本质,以至不能正确的应用这一技术. ...
- SQLAlchemy 中的 Session、sessionmaker、scoped_session
目录 一.关于 Session 1. Session是缓存吗? 2. Session作用: 3. Session生命周期: 4. Session什么时候创建,提交,关闭? 4. 获取一个Session ...
- (八) Hibernate中的Session以及事务
HibernateUtil.getSessionFactory().getCurrentSession() 和HibernateUtil.getSession() 的区别: 1.异:getCurren ...
随机推荐
- 亿级日PV的魅族云同步的核心协议与架构实践(转)
云同步的业务场景 这是魅族云同步的演进,第一张是M8.M9,然后到后面的是MX系统,M9再往后发展,我们的界面可以看到基本上是没有什么变化的,但本质发生了很大的变化,我们经过了一些协议优化,发展到今天 ...
- CentOS 6.5 安装 php7 教程 包很重要使用lnmp1.4里面的包
./configure \ --prefix=/usr/local/php-7.0.1 \ --with-mysql=mysqlnd \ --with-pdo-mysql=mysqlnd \ --wi ...
- mybatis 的动态sql语句是基于OGNL表达式的。
mybatis 的动态sql语句是基于OGNL表达式的.可以方便的在 sql 语句中实现某些逻辑. 总体说来mybatis 动态SQL 语句主要有以下几类:1. if 语句 (简单的条件判断)2. c ...
- redhat7搭建本地yum仓库
ftp服务器搭建 安装vsftpd yum install vsftpd 配置启动服务和防火墙 修改配置,由于默认不开启主动模式,需要配置开启,在/etc/vsftpd/vsftpd.conf添加如下 ...
- 传递任意数量的实参*parameter&使用任意数量的关键字实参**parameter
1.*形参名(*parameter) 有时候我们不知道知道函数需要接受多少个实参,所以我们可以在形参名前加一个*,是让python创建一个名为parameter的空元组,并将收到的所有值都封装到这个元 ...
- C#中文件和byte[]互换问题
如何将图片和声音转化成byte[],并通过webservice进行传输? 如何将webservice传输过来的byte[],转化成我们想要的文件? (一)文件转化为byte[] 方法 ...
- HTML5游戏制作完全指南
简介 创建画布 游戏循环 Hello world 创建player 键盘控制 a:使用jQuery Hotkeys b:移动player 添加更多游戏元素 炮弹 敌人 使用图片 碰撞检测 声音 简介 ...
- JS-Zepto.js中文链接
附上zepto.js的中文链接:http://www.css88.com/doc/zeptojs_api/ 小伙伴再也不用担心“这特么到底啥意思!”
- 在用VMware虚拟机的时候,有时会发现打开虚拟机时提示“该虚拟机似乎正在使用中。如果该虚拟机未在使用,请按“获取所有权(T)”按钮获取它的所有权。否则,请按“取消(C)”按钮以防损坏。配置文件: D:\win10x64\Windows 10 x64.vmx。”这是由于虚拟机未正常关闭引起的,下面看看解决办法
我们首先点击“获取所有权(T)”按钮,会发现弹出一个窗口,显示“ 无法打开虚拟机: D:\win10x64\Windows 10 x64.vmx获取该虚拟机的所有权失败.主机上的某个应用程序正在使用该 ...
- deviceready has not fired after 5 seconds
deviceready has not fired after 5 seconds 建议用手机连上电脑,用真机进行调试: