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

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.

主站蜘蛛池模板: 定兴县| 清镇市| 屯昌县| 吉安市| 瓦房店市| 宁德市| 涿州市| 晋州市| 鹤壁市| 札达县| 承德县| 淳安县| 红原县| 永寿县| 巍山| 景东| 包头市| 磐安县| 鱼台县| 仪陇县| 竹溪县| 东安县| 光泽县| 阿巴嘎旗| 军事| 揭阳市| 台东市| 河南省| 焉耆| 乐都县| 珲春市| 九龙坡区| 金昌市| 承德县| 阜平县| 革吉县| 阜康市| 读书| 栾城县| 镇沅| 贡觉县|