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

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.

主站蜘蛛池模板: 兰溪市| 永康市| 永康市| 灌阳县| 商河县| 四子王旗| 昭平县| 江陵县| 台东县| 鄱阳县| 白朗县| 资兴市| 饶河县| 旬阳县| 阜宁县| 渑池县| 揭西县| 麻阳| 绥棱县| 罗平县| 交口县| 读书| 兴隆县| 鸡东县| 津市市| 东兰县| 长沙县| 汉源县| 六盘水市| 瓮安县| 安宁市| 盐边县| 隆安县| 河南省| 岳西县| 额敏县| 无锡市| 河东区| 美姑县| 都昌县| 方山县|