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

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.

主站蜘蛛池模板: 沙坪坝区| 安国市| 浮梁县| 山东| 吉林省| 漳平市| 余姚市| 当涂县| 平凉市| 姚安县| 淮南市| 汕尾市| 南京市| 富宁县| 长乐市| 富宁县| 邮箱| 宁乡县| 蒲城县| 云和县| 凤翔县| 南昌县| 龙门县| 循化| 澎湖县| 旺苍县| 峨山| 内丘县| 铁岭市| 乐清市| 盘山县| 长乐市| 齐齐哈尔市| 玉田县| 来安县| 富阳市| 吴江市| 通州市| 武安市| 呈贡县| 永福县|