SIP Proxy Server PartySIP and osippartysip Based on oSIP open source Library

Source: Internet
Author: User

SIP Proxy Server PartySIP and osippartysip Based on oSIP open source Library

**************************************** **************************************** **************************************** ***
Author: EasyWave time: 2014.09.14

Category: Linux application-SIP Proxy Server PartySIP Declaration: reprinted, please keep the link

NOTE: If any error occurs, please correct it. These are my Learning Log articles ......

**************************************** **************************************** **************************************** ***

I. Introduction to PartySIP Proxy Server

PartySIP is the implementation of a SIP proxy server. The SIP protocol is a Session Initiation Protocol that is described by RFC2543 (which will soon be updated). PartySIP is a modular application that is added and deleted through plug-ins, partySIP and its plug-ins can be used as "SIP registration", "SIP redirect server", and "SIP stateful Proxy Server ". PartySIP is a SIP server based on oSIP. It implements Registration Service, redirection, locating, transaction status/non-state machine. The idea is the same as that of the eXosip framework, except that the functions of the modules are different.

 

Ii. Official website of PartySIP Proxy Server

The official website of the PartySIP proxy server is shown in:

Open source Web site: http://www.nongnu.org/partysip/partysip.html

 

Iii. Introduction to oSIP open source Library

OSIP is small and flexible. It is compiled based on standard C and can be used in any POSIX-supporting system. Therefore, it can be widely used in embedded systems. The main features of the oSIP protocol stack are listed below:

  • Open source library developed in pure C language.
  • Supported Operating Systems: Solaris, HP unix, RTOS VxWorks, Windows, GNU/Linux, and POSIX compatible systems.
  • Supported RFC standards: RFC 3261, RFC 2327, RFC 3264, RFC 3263, and RFC 3311.
  • Supported transmission protocols: TCP and UDP.
  • Supports single-thread and multi-thread programming.
  • The modules are loosely coupled and highly independent.
  • High compatibility, and can communicate with multiple SIP protocol stacks.

OSIP mainly provides APIs for parsing SIP/SDP messages and state machines for transaction processing. It does not provide high-level APIs for SIP session control. You can use oSIP to develop the User Agent, IPsoft-phone and SIP Proxy. Structure Diagram for oSIP:

When building a SIP application, the application models corresponding to different application types are not the same. Based on the research and practice of oSIP, the general application model of oSIP in POSIX-compatible systems is provided, as shown in:

 

Iv. Introduction to PartySIP program code

The main function of PartySIP consists of the following parts:

  • Command Line Parsing
  • The configuration file reads psp_config_load ();
  • Core code initialization: the transaction state/stateless processing psp_core_init () mentioned in the sip protocol; starts a thread.
  • The registered user information is read to the memory, and the information processing can be replaced by the database, so the function can be modified or removed as needed;
  • Processing Module loading. The related function main_load_plugins () is loaded according to the plugins and plugins_config of the configuration file. The parameters are the global variables stored in psp_config.c during the operation:
    Static config_element_t * elements = NULL;
    Static config_element_t * sub_elements = NULL;
  • Psp_core_start () starts the resolv thread that processes the received sip signaling, the underlying network packet organization thread tlp, And the sip transaction processing thread sfp.
  • Main Process Management Function main_run (), processing user input parameters
    Partysip parameter analysis is not important for program modification. It is suggested that the parsing process can be proposed to process exit operations of the entire program.

V. Transplantation of PartySIP

For the transplantation of PartySIP, continue to follow this blog ......

 

 


Osip protocol stack parsing Sip protocol package

Yes. Use this method to parse and obtain an osip_message_t struct.
 
How to Learn about sip, eXosip/osip hope to give some suggestions

1. First understand the sip protocol itself
2. Read exosip and osip documents.
3. Download and compile exosip and osip source code
4. Write a demo

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.