最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【整理】PJSIP PJSIPUA PJLIB PJMEDIA PJNATH

SIP crifan 5012浏览 0评论

 

关于了解PJSIP相关的东西之前要了解的背景

  • SIP是个会话发起的方面的协议
    • SIP==Session Initiation Protocol==会话发起协议:负责发起会话,但不负责发起后的会话的控制和描述
  • SDP是个会话描述方面的协议
    • SDP==Session Description Protocol==会话描述协议:负责描述(发起后的)会话的详细信息,包括会话细节Session(),会话时间Time(),会话所用介质Media(何种协议,端口号,)

 

TCP==

UDP==

RTP==

RTCP==

RTSP==

TLS==

NAT==

ICE==Interactive Connectivity Establishment

 

而打电话这个事情,首先可以被拆分为:

A要打给B

A要先发起想要打电话的会话给B

A等待B的应答

B应答或拒绝

B如果应答了

然后A和B之间就建立了连接,会话,语音通话

然后中间实时地传输语音信号,即音频流媒体

关于如何发起和应答等方面的会话,属于会话的发起,是SIP协议做的事情->定位用户,协调功能和特性,改变参数,管理发起和挂断;

关于发起会话后,解释通过何种方式去通话,是会话的描述,是SDP协议做的事情->描述了会话的细节,时间,介质;

在真正建立起通话后的实时的语言数据的传输,即流媒体的传输,是流媒体协议RTP做的事情;

流媒体传输期间,如何控制流媒体传输,是RTCP做的事情->保证传输时的质量和成员管理;

    =>RTP和RTCP是相辅相成,保证了流媒体传输和控制。

而针对于传输流媒体的控制,RTSP也可以实现;

 

PJSIP总体介绍

PJSIP是SIP协议的实现,其架构很不错,功能很丰富。

PJSIP主要包含以下几个部分/层次/架构:

  • PJSIP:Open Source SIP Stack,开源的SIP协议栈。
  • PJMEDIA:Open Source Media Stack,开源的媒体栈。
  • PJNATH:Open Source NAT Traversal Helper Library,开源的NAT-T辅助库。
  • PJLIB-UTIL:Auxiliary Library,辅助工具库。
  • PJLIB:Ultra Portable Base Framework Library,基础框架库。

 

关于PJSIP中的的各种协议的之间关系

 

PJSIP Architecture and Protocol Relation

 

 

PJSIP介绍

PJSIP is a free and Open Source multimedia communication library implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. It combines signaling protocol (SIP) with multimedia framework and NAT traversal functionality into high level multimedia communication API that is portable and suitable for almost any type of systems ranging from desktops, embedded systems, to mobile handsets.

PJSIP is both compact and feature rich. It supports audio, video, presence, and instant messaging, and has extensive documentation. PJSIP is very portable. On mobile devices, it abstracts system dependent features and in many cases is able to utilize the native multimedia capabilities of the device.

PJSIP has been developed by a small team working exclusively for the project since 2005, with participation of hundreds of developers from around the world, and is routinely tested at SIP Interoperability Event (SIPit) since 2007.

 

别的用到PJSIP的程序/项目

Projects_Using_PJSIP – pjsip Open source SIP, media, and NAT traversal stacks/libraries for smartphones

A native SIP client for Android

http://code.google.com/p/csipsimple/

 

csipsimple – SIP application for Android devices – Google Project Hosting

CSipSimple – Android Apps on Google Play

代码:r3gis3r/CSipSimple · GitHub

 

【整理】PJSIP是否支持通过蓝牙传输(而不是原先的TCI/IP的VoIP)

看到:

PJSIP-Datasheet – pjsip Open source SIP, media, and NAT traversal stacks/libraries for smartphones

Transports:

  • UDP, TCP, TLS (server or mutual)
  • DNS SRV resolution (​RFC 3263)
  • IPv6 (UDP only)
  • QoS (DSCP, WMM)

感觉传输层还是只是支持:

网络相关的协议

->估计不支持蓝牙。

 

另外,也去查了查:

CSipSimple是否支持bluetooth

参考:

CSipSimple | Android Forums

Are you able to use bluetooth on csipsimple?I have been using sipdroid for about a week now and the only problem i see is the bluetooth is not working.How is your battery? I hear the program can drain the battery. I have visited the developers google code site. I see complaints about it draining the battery.Sipdroid does not drain my battery.The program works well just wished the bluetooth was working.

请问支持android手机的voip软件哪个比较好?(頁 1) – Android系統 – 電訊茶室 – Powered by Discuz! Archiver

leitany 發表於 2011-10-30 08:38

试用过Csipsimple,iptel没问题,ET263也没问题。
但是,Csipsimpl不支持蓝牙,打voip电话时,无法用蓝牙耳机通话;
并且装了Csipsimple后,手机原有的蓝牙功能也受影响。电话打入时,用不了蓝牙耳机,打出就没受影响。
(ObiON也不支持蓝牙,不过不会影响到手机原有的蓝牙功能。)
不知其他C兄C姐是不是也有同样的问题?

也基本确定了:

CSipSimple不支持蓝牙作为底层通讯方式,而支持,底层用网络传输语言数据后,手机端得到了音频,通过蓝牙耳机,可以把电话的音频输出到蓝牙耳机。

 

资料

PJSIP-Datasheet – pjsip Open source SIP, media, and NAT traversal stacks/libraries for smartphones

PJSIP – Open Source SIP, Media, and NAT Traversal Library

 

PJSIP的在线代码文档:

PJSIP – Open Source SIP Stack (2.3.0)

->

Endpoint (2.3.0)

Transaction Layer (2.3.0)

 

About PJSIP

PJSIP-Datasheet – pjsip Open source SIP, media, and NAT traversal stacks/libraries for smartphones

pjsip简介 – 潜龙勿用 – 博客频道 – CSDN.NET

 

PJSUA

PJSUA==PJ SIP User Agent

 

pjsua is an open source command line SIP user agent (softphone) that is used as the reference implementation for PJSIP, PJNATH, and PJMEDIA. Despite its simple command line appearance, it does pack many features!

 

相关资料:

PJSUA2 Documentation — PJSUA2 Documentation 1.0-alpha documentation

PJSUA2-High Level API — PJSUA2 Documentation 1.0-alpha documentation

Manual of pjsua – Command Line SIP User Agent/Softphone

内部有:

  • Endpoint
  • Account
  • Media
  • Call
  • Buddy

的解释。

 

PJSUA是个命令行版本的SIP的用户代理==软电话

用于针对PJSIP,PJNATH,PJMEDIA的参考实现

功能很丰富

 

PJSUA的应用

sipdroid

Sipdroid Android VoIP app SIP Client Setup Configuration

sipdroid – Free SIP/VoIP client for Android – Google Project Hosting

Bluetooth.java – sipdroid – Free SIP/VoIP client for Android – Google Project Hosting

package org.sipdroid.media;
import java.util.Set;
import org.sipdroid.sipua.ui.Receiver;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothClass.Device;
import android.bluetooth.BluetoothClass.Service;
import android.content.Context;
import android.media.AudioManager;
/*
 * Copyright (C) 2010 The Sipdroid Open Source Project
 * Copyright (C) 2007 The Android Open Source Project
 *
 * This file is part of Sipdroid (http://www.sipdroid.org)
 *
 * Sipdroid is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This source code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this source code; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
public class Bluetooth {
        static BluetoothAdapter ba;
        static AudioManager am;
       
        public static void init() {
                if (ba == null) {
                        ba = BluetoothAdapter.getDefaultAdapter();
                        am = (AudioManager) Receiver.mContext.getSystemService(
                        Context.AUDIO_SERVICE);
                }
        }
       
        public static void enable(boolean mode) {
                if (mode)
                        am.startBluetoothSco();
                else
                        am.stopBluetoothSco();
        }
       
        public static boolean isAvailable() {
                if (!ba.isEnabled())
                        return false;
                Set<BluetoothDevice> devs = ba.getBondedDevices();
                for (final BluetoothDevice dev : devs) {
                        BluetoothClass cl = dev.getBluetoothClass();
                        if (cl != null && (cl.hasService(Service.RENDER) ||
                                        cl.getDeviceClass() == Device.AUDIO_VIDEO_HANDSFREE ||
                                        cl.getDeviceClass() == Device.AUDIO_VIDEO_CAR_AUDIO ||
                                        cl.getDeviceClass() == Device.AUDIO_VIDEO_WEARABLE_HEADSET))
                                return true;
                }
                return false;
        }
       
        public static boolean isSupported() {
                init();
                return am.isBluetoothScoAvailableOffCall();
        }
}

 

 

 

 

PJLIB

 

PJMEDIA

支持的Media介质:

音频编解码:

 G.711 Codec

Standard G.711/PCMA and PCMU codec

 AMR Codec Helper

AMR common tables and helper functions

 Codec registration helper

Helper function to register all codecs

 G.722 Codec

Implementation of G.722 Codec

 G.722.1 Codec (Siren7/Siren14)

Implementation of G.722.1 codec

 GSM 06.10 Codec

Implementation of GSM FR based on GSM 06.10 library

 iLBC Codec

Implementation of iLBC Codec

 IPP Codecs

Implementation of IPP codecs

 L16 Codec Family

Implementation of PCM/16bit/linear codecs

 OpenCORE AMR Codec

AMRCodec wrapper for OpenCORE AMR codec

 Passthrough Codecs

Implementation of passthrough codecs

 SILK Codec Family

Implementation of SILK codecs (narrow/medium/wide/superwide-band)

 Speex Codec Family

Implementation of Speex codecs (narrow/wide/ultrawide-band)

 

视频编解码:

  • FFmpeg Codecs
  • Open H.264 Codec

 

Media Session介质会话:

RTCP Session and Encapsulation (RFC 3550)

RTCP format and session management

 RTCP Extended Report (XR) – RFC 3611

RTCP XR extension to RTCP session

 RTP Session and Encapsulation (RFC 3550)

RTP format and session management

 SDP Parsing and Data Structure

SDP data structure representation and parsing

 SDP Negotiation State Machine (Offer/Answer Model, RFC 3264)

SDP Negotiation State Machine (Offer/Answer Model, RFC 3264)

 

PJMEDIA (2.3.0)

PJMEDIA Reference Modules (2.3.0)

Manual of pjsua – Command Line SIP User Agent/Softphone

 

PJNATH

 

TLS

TLS – pjsip Open source SIP, media, and NAT traversal stacks/libraries for smartphones

转载请注明:在路上 » 【整理】PJSIP PJSIPUA PJLIB PJMEDIA PJNATH

与本文相关的文章

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.195 seconds, using 21.95MB memory