官术网_书友最值得收藏!

SIP transactions and dialogs

It is important to understand the difference between a transaction and dialog because we will use this ahead in OpenSIPS scripting. For example, there are attribute value pairs attached to transactions and dialog variables attached to dialogs. If you can't recognize a dialog and variable, it will be hard to configure the SIP server.

A transaction occurs between a user agent client and server and comprises of all the messages from the request to the final response (including all the interim responses). The responses can be provisional, starting with one followed by two digits (for example, 180 Ringing) or final, starting with two followed by two digits (for example, 200 OK). The scope of a transaction is defined by the stack of Via headers of the SIP messages. So, the user agents, after the initial invite, don't need to rely on DNS or location tables to route the messages.

The ACK request is a special case. For positive replies (2XX), the UAC creates a new transaction and generates a new CONTACT header and it can be sent straight to the UAS bypassing the proxy. However, for negative replies, it belongs to the INVITE transaction because it is not possible to create a new transaction without the Contact of the other part. In this case, the request is sent to the same proxy as INVITE.

According to RFC 3261, a dialog represents a peer-to-peer SIP relationship between two user agents that persists for some time. A dialog is identified at each UA with a dialog ID, which consists of a Call-ID value, local tag, and remote tag present in the From and To headers, respectively.

A dialog is a succession of transactions that control the creation, existence, and termination of the dialog. All dialogs do have a transaction to create them and may (or may not) have a transaction to change the dialog (mid-transaction). Additionally, the end-dialog transaction may be missing. (Some dialogs do end based on timeouts rather than on explicit termination.)

According to RFC 3665, there are 11 basic session establishment flows. The list is not meant to be complete but covers the best practices. The first two were already covered in this chapter, Successful Session Establishment and Session Establishment through two Proxies. Some of them will be seen in Chapter 11, Implementing SIP Services.

主站蜘蛛池模板: 哈巴河县| 丰宁| 贡嘎县| 双峰县| 读书| 句容市| 荣成市| 琼海市| 怀来县| 林西县| 马关县| 攀枝花市| 东城区| 淅川县| 平潭县| 四平市| 山东| 蓬莱市| 江城| 吉木萨尔县| 九龙坡区| 舒兰市| 铜陵市| 南投市| 灵寿县| 静海县| 文成县| 广饶县| 屯留县| 宁河县| 岑溪市| 虞城县| 普定县| 唐山市| 平昌县| 长武县| 潼南县| 灵川县| 盱眙县| 吴旗县| 株洲县|