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

OpenSER Architecture

OpenSER ArchitectureOpenSERarchitecture

Core and Modules

OpenSER is built on top of a core that is responsible for the basic functionality and handling of SIP messages. The modules are responsible for the majority of OpenSER functions. OpenSER modules expose their functionality inside OpenSER with new commands and parameters used inside scripts. OpenSER is configured in a file called openser.cfg. This configuration file controls which modules are loaded and their respective parameters. All the SIP flow is controlled too in several routing blocks defined in the file. The file openser.cfg is the OpenSER main configuration file.

Sections of the File openser.cfg

The openser.cfg file has seven sections:

  • Global definitions: This portion of the file contains several working parameters for OpenSER including the listening ip:port pair for the SIP service and debug level.
  • Modules: Contains a list of external libraries required to expose the functionalities not available in the core. Modules are loaded with loadmodule.
  • Modules configuration: Modules have parameters that needs to be set appropriately. These parameters are configured using modparam(modulename, parametername, parametervalue).
  • Main routing block: The main routing block is where the SIP message processing starts. It controls the processing of each message received.
  • Secondary routing blocks: The administrator can define new routing blocks using the command route(). These routing blocks works like subroutines in the OpenSER script.
  • Reply routing blocks: Reply routing blocks are used to process reply messages, usually 200 OK.
  • Failure routing blocks: Failure routing blocks are used to process failure conditions such as busy or timeout.

    Note

    This file will be covered in detail in the Chapters 4, 5, 6, 7, 8, and 9.

Sessions, Dialogs, and Transactions

It is important to understand some SIP concepts used in OpenSER processing:

  • SIP transaction: A SIP message including any resends and their direct responses (that is, REGISTER and 200 OK).
  • SIP dialog: A relation that exists for some time between two SIP entities (that is, a dialog established between two UACs from the INVITE until the BYE message).
  • SIP Session: A media flow (audio/video/text) between two SIP entities.

openser.cfg Message Processing

The openser.cfg is a script executed for each SIP message received. For example: If the userA wants to talk to userB it sends an INVITE message. This message is processed in the main routing block. The processing continues until it finds a t_relay() (forward) or an sl_send_reply (send an error message) or eventually discards the message at the end of the block using the exit() command.

主站蜘蛛池模板: 开封县| 徐州市| 文山县| 通许县| 昌邑市| 汕尾市| 天等县| 噶尔县| 嵊泗县| 拜城县| 中西区| 同江市| 青阳县| 汽车| 高雄县| 临城县| 策勒县| 上蔡县| 白山市| 吴堡县| 聊城市| 克山县| 林芝县| 安平县| 永宁县| 深圳市| 玉环县| 大邑县| 卫辉市| 双鸭山市| 漠河县| 平凉市| 木里| 阳信县| 玉溪市| 南汇区| 广元市| 宣化县| 文成县| 溆浦县| 墨脱县|