0% found this document useful (0 votes)
101 views2 pages

PJSUA Python Module Overview

This document summarizes the PJSUA Python module, which provides a Python wrapper for the PJSUA SIP API. It has been deprecated and developers should now use PJSUA2 and the Python SWIG binding instead. The PJSUA Python module implements high-level call control, account management, presence, and multimedia features on top of the lower-level _pjsua C extension module. The module is intended for developers looking to build SIP-based client applications using Python with a familiar high-level API.

Uploaded by

Amit Choubey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views2 pages

PJSUA Python Module Overview

This document summarizes the PJSUA Python module, which provides a Python wrapper for the PJSUA SIP API. It has been deprecated and developers should now use PJSUA2 and the Python SWIG binding instead. The PJSUA Python module implements high-level call control, account management, presence, and multimedia features on top of the lower-level _pjsua C extension module. The module is intended for developers looking to build SIP-based client applications using Python with a familiar high-level API.

Uploaded by

Amit Choubey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

= PJSUA Python Module =

[[TracNav(Python_SIP/TOC)]]

'''* IMPORTANT! :*''' Python module for PJSIP has been deprecated and although it
may still be usable, the module, as well as this doc page, will no longer be
maintained. For the replacement, please use PJSUA2 and Python SWIG binding as
described [[Link]
python-and-java-swig-modules here].

The PJSUA for Python Module is an object oriented Python


wrapper/abstraction/modules for
[[Link] PJSUA API]. It provides
high level API for constructing [[Link] Session
Initiation Protocol (SIP)] multimedia user agent applications (a.k.a Voice over
IP/VoIP softphones). It wraps together the signaling, media, and NAT traversal
functionality into easy to use call control API, account management, buddy list
management, presence, and instant messaging, along with multimedia features such as
local conferencing, file streaming, local playback, and voice recording, and
powerful NAT traversal techniques utilizing [[Link]
behave-rfc3489bis STUN], [[Link] TURN],
and [[Link] ICE].

The PJSUA Python is implemented in two modules:

'''pjsua''' module: ::
This is the object-oriented, pure Python, and even higher level abstraction for
[[Link] PJSUA API]. It is
implemented on top of {{{_pjsua}}} C extension module, and it is the one described
on this article.

'''_pjsua''' module: ::
The "_pjsua" module (with underscore) is the low-level C Python extension which
provides Python bindings for
[[Link] PJSUA API]. This module
is the successor of [wiki:Py_PJSUA py_pjsua] module which now has been deprecated.

Applications should use the '''pjsua''' module rather than '''_pjsua''' module,
since it is easier to use and it is the module which API compatibility will be
maintained in future releases.

== Intended Audience ==

This tutorial is intended for developers looking to develop Session Initiation


Protocol (SIP) based client application using Python. Some knowledge on SIP is
definitely required, and of course some Python programming experience. Prior
knowledge of PJSUA C API is not needed, although it will probably help.

This Python SIP module provides very high level API to do SIP calls, presence, and
instant messaging, as well as handling media and NAT traversal. Knowledge of SIP
protocol details (such as the grammar, ''transaction'', ''dialog'', and whatnot)
are not required, however you should know how SIP works in general and particularly
how to configure SIP clients to, e.g. register to a SIP provider, specify SIP URI
to make call to, and so on, to use the module.
[[BR]]
[[BR]]
''Please click the link on the Table of Contents to the right to navigate to the
next chapters''

Common questions

Powered by AI

The PJSUA Python module implements NAT traversal using powerful techniques such as STUN, TURN, and ICE. STUN helps clients behind NAT in determining their public IP addresses, TURN assists in relaying media through a third-party server when direct connectivity is not possible, and ICE facilitates gathering candidate transport addresses for establishing peer-to-peer media paths in various network scenarios. These methods collectively ensure the SIP-based applications can maintain robust connections and communication paths across different network configurations.

The transition from PJSUA to PJSUA2 and Python SWIG binding implies significant changes for developers accustomed to the original module. This shift likely requires them to learn the new APIs and modify their existing applications to accommodate different functionalities and architectural paradigms. However, this transition also presents benefits such as enhanced performance, better maintenance, and access to updated features that align with contemporary programming standards. Developers may face short-term challenges in adapting to the new system but can achieve long-term improvements in application reliability and capabilities by making these changes.

The deprecation of the PJSUA Python module affects developers by requiring them to transition to alternative solutions, specifically PJSUA2 and Python SWIG binding. This can involve rewriting existing code to accommodate the new APIs and updating their knowledge base to effectively use these newer tools. While this may present an initial development hurdle, it also encourages developers to leverage more modern, supported, and potentially more efficient solutions for future-proofing their SIP applications.

The 'pjsua' module offers several advantages over the '_pjsua' module for SIP application development. It is higher-level, purely implemented in Python, and provides an easier to use abstraction of the PJSUA API. The 'pjsua' module abstracts complex C extensions, thereby simplifying application development and maintenance by focusing on high-level interactions. Additionally, it is designed to maintain API compatibility in future releases, ensuring more stable and enduring support compared to the '_pjsua' module.

STUN, TURN, and ICE support contribute to the robustness of the PJSUA Python module for SIP communications by ensuring effective NAT traversal and connectivity. STUN assists in determining the public IP behind NAT, essential for establishing direct communications. TURN provides a reliable fallback mechanism, allowing media to be relayed through an external server when direct paths are blocked. ICE is used to dynamically gather multiple candidate paths and select the best one for media navigation, enhancing resilience and adaptability in complex network topologies. These techniques collectively ensure stable and reliable SIP interactions across diverse network environments.

The primary purpose of the PJSUA Python module was to provide a high-level API for creating SIP-based multimedia user agent applications, commonly known as VoIP softphones. It enabled functionalities like call control, account management, buddy list management, multimedia features, and NAT traversal. Its maintenance has been discontinued because it has been deprecated and replaced by PJSUA2 and Python SWIG binding. Users are encouraged to transition to these newer technologies for better support and future compatibility.

Understanding the basics of the SIP protocol is crucial when using the PJSUA Python module because, although the module provides high-level APIs, users need to know how SIP mechanisms such as registration, URI specification, and configuration of SIP clients function. This foundational knowledge aids in effectively utilizing the module's capabilities for SIP calls, presence management, and instant messaging. Without it, developers might struggle with implementing these features or troubleshooting issues that arise from incorrect SIP configurations.

The PJSUA module's media handling approach is significant for developers creating feature-rich SIP applications because of its comprehensive multimedia capabilities such as local conferencing, file streaming, local playback, and voice recording. These features allow developers to implement versatile and scalable media solutions, essential for modern communication applications. By integrating such functionalities, developers can cater to various user needs, ensuring connectivity and interaction are seamless across different devices and network conditions. Furthermore, the inclusion of NAT traversal features like STUN, TURN, and ICE indicates an emphasis on reliable media delivery and connectivity, crucial for maintaining high-quality and uninterrupted communication.

The PJSUA Python module offers a range of multimedia features suitable for VoIP application developers. These include local conferencing, file streaming, local playback, and voice recording. These functionalities allow developers to integrate rich media interaction capabilities within their SIP client applications, enhancing user experiences by supporting various media handling operations that are common in VoIP settings.

The PJSUA Python module documentation was intended for developers looking to create SIP-based client applications using Python. Users were expected to have some knowledge of the SIP protocol and basic Python programming experience. Though prior knowledge of the PJSUA C API was not necessary, it could be beneficial. Developers were expected to understand general SIP operations like client registration and SIP URI configuration to effectively make use of the module.

You might also like