1. libosip2 libeXosip2

http://www.antisip.com/download/exosip2/

Features:
--------
eXosip2 has support for:
 * registrations. (REGISTER)
 * call initiation and modification. (INVITE, re-INVITE)
 * other methods within calls (INFO, OPTIONS, UPDATE)
 * call transfer. (REFER)
 * reliability for provisionnal response. (PRACK)
 * sip event package. (SUBSCRIBE/NOTIFY)
 * event state publication. (PUBLISH)
 * instant messaging. (MESSAGE)
 * ...

eXosip2 does not contain:
 * RTP.
 * audio interface
 * sdp negotiation.
 * ...

2. Build libexosip2-5.1.0.tar.gz + libosip2-5.1.0.tar.gz

ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so
ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so

_install.sh

#compiler setup
if [[ $1 = 'arm' ]]; then
compiler=`CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++`
host=arm-linux-gnueabihf
elif [[ $1 = 'himix100' ]]; then
compiler=`CC=arm-himix100-linux-gcc CXX=arm-himix100-linux-g++`
host=arm-himix100-linux
elif [[ $1 = 'himix200' ]]; then
compiler=`CC=arm-himix200-linux-gcc CXX=arm-himix200-linux-g++`
host=arm-himix200-linux
else
:
fi #Preinstalled directory
install=${HOME}/_install #Delete installed directory
rm -rf ${install} #library path
pkg_config=${install}/lib/pkgconfig
lib_config=`CPPFLAGS=-I${install}/include CFLAGS=-I${install}/include LDFLAGS=-L${install}/lib` #Delete compiled directory
for i in `ls .`
do
if [ -d $i ];then
rm -rf $i
fi
done #http://www.mirrorservice.org/pub/gnu/osip/
tar xvf libosip2-*
cd libosip2-*
./configure --prefix=${install} ${compiler} PKG_CONFIG_PATH=${pkg_config} ${lib_config} --host=${host} --enable-static --enable-shared --disable-openssl
make && make install
cd .. #http://mirror.ossplanet.net/nongnu/exosip/
tar xvf libexosip2-*
cd libexosip2-*
./configure --prefix=${install} ${compiler} PKG_CONFIG_PATH=${pkg_config} ${lib_config} --host=${host} --enable-static --enable-shared --disable-openssl
make && make install
cd ..

媒体库

#JRTPLIB-3.11.1.tar.gz
cmake -DCMAKE_INSTALL_PREFIX=./_install -DCMAKE_C_COMPILER=/usr/local/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
make
make install #faac-1.29.9.2.tar.gz
./configure CXX=arm-linux-gnueabihf-g++ CC=arm-linux-gnueabihf-gcc --prefix=${PWD}/_install --host=arm-linux-gnueabihf --with-mp4v2=no --enable-shared --enable-static
make
make install #h264bitstream-0.2.0.tar.gz
sudo apt-get install build-essential libtool
autoreconf -i
./configure CXX=arm-linux-gnueabihf-g++ CC=arm-linux-gnueabihf-gcc --prefix=${PWD}/_install --host=arm-linux-gnueabihf --enable-shared --enable-static
make
make install

dong@ubuntu:~/libexosip2-5.1.0$ su
Password:
root@ubuntu:/home/dong/libexosip2-5.1.0# ./_install.sh
root@ubuntu:~# tar cvf _install.tar.gz _install/
root@ubuntu:~# mv _install.tar.gz /home/dong/
dong@ubuntu:~$ sudo chmod 777 _install.tar.gz

3. example

Freepbx or freeswitch can be used as SIP server

libexosip2-5.1.0/tools/sip_reg.c

add eXosip event

    /*zhoudd add*/
case EXOSIP_CALL_CANCELLED:
syslog_wrapper (LOG_INFO, "call cancelled");
break;
case EXOSIP_CALL_ACK:
syslog_wrapper (LOG_INFO, "call ack");
break;
case EXOSIP_CALL_CLOSED:
syslog_wrapper (LOG_INFO, "call closed");
break;
case EXOSIP_CALL_PROCEEDING:
syslog_wrapper (LOG_INFO, "call proceeding");
break;
case EXOSIP_CALL_RINGING:
syslog_wrapper (LOG_INFO, "call ringing");
break;
case EXOSIP_CALL_ANSWERED:
syslog_wrapper (LOG_INFO, "call answered");
break;
case EXOSIP_CALL_SERVERFAILURE:
case EXOSIP_CALL_RELEASED:
syslog_wrapper (LOG_INFO, "call release");
break;

compile example

export LD_LIBRARY_PATH=$(pwd)/_install/lib:$LD_LIBRARY_PATH
gcc -O2 -I./_install/include -L./_install/lib sip_reg.c \
-o sip_reg \
-leXosip2 -losip2 -losipparser2 -lpthread

test.sh

./sip_reg \
-r sip:182.61.147.213:5060 \
-u sip:1002@182.61.147.213 \
-c sip:1002@182.61.147.213:5060 \
-U 1002 \
-P 1234 \
-p 5060 \
-e 1800 \
-d

caller mode

dong@ubuntu:~/doing/demo$ ./test.sh
SipReg v1.0 up and running
proxy: sip:182.61.147.213:5060
fromuser: sip:1002@182.61.147.213
contact: sip:1002@182.61.147.213:5060
expiry: 3600
local port: 5060
transport: UDP
username: 1002
password: [removed]
r register
u unregister
i call
h hangup
a answer
q quit
f info
m message
Please input the command: registrered failure
registrered successfully
registrered successfully
registrered successfully
i
Please input the command: call proceeding
call requestfailure
call proceeding
call ringing
call answered
call message new
BYE
recieved message eXosip event (type, did, cid) = (14, 2, 1)
call closed
call release Please input the command: q
dong@ubuntu:~/doing/demo$

callee mode

dong@ubuntu:~/doing/demo$ ./test.sh
SipReg v1.0 up and running
proxy: sip:182.61.147.213:5060
fromuser: sip:1002@182.61.147.213
contact: sip:1002@182.61.147.213:5060
expiry: 3600
local port: 5060
transport: UDP
username: 1002
password: [removed]
r register
u unregister
i call
h hangup
a answer
q quit
f info
m message
Please input the command: registrered failure
registrered successfully
registrered successfully
registrered successfully
call invite
call cancelled
call closed Please input the command: call release
q
dong@ubuntu:~/doing/demo$

4. rport && contact

    case EXOSIP_CALL_INVITE:
{
eXosip_masquerade_contact (context_eXosip, event->request->req_uri->host, atoi(event->request->req_uri->port)); osip_message_t *answer = NULL;
int i;
/*180 ring*/
... /*200 ok*/
... break;
} case EXOSIP_CALL_ACK:
{
/*ack*/
... conference_bridge_creat_run(remote_audio_ip, atoi(remote_audio_port), local_audio_ip, atoi(local_audio_port));
break;
} case EXOSIP_CALL_ANSWERED:
{
/*ack*/
... /*200 ok*/
... conference_bridge_creat_run(remote_audio_ip, atoi(remote_audio_port), local_audio_ip, atoi(local_audio_port));
break;
}

#register into gb28181 server

34020000001320000001.sh

./sip_reg  \
-r sip:182.61..xxx: \
-u sip:@192.168.127.128 \
-c sip:@192.168.127.128: \
-U \
-P \
-p \
-e \
-d

5. User Agent Application
1) register
libexosip2-5.1.0/tools/sip_reg.c

2) invite
libexosip2-5.1.0/help/doxygen/ht0-initialize.dox
libexosip2-5.1.0/help/doxygen/ht1-callcontrol.dox
libexosip2-5.1.0/help/doxygen/ht2-registration.dox

3) rtp mediastream
rtp_over_udp: jrtplib-3.11.1/examples/example1.cpp
rtp_over_tcp:  jrtplib-3.11.1/tests/tcptest.cpp

4) audio encode/decode && conference bridge
https://trac.pjsip.org/repos/wiki/media-flow?from=groupmessage

SIP UserAgent (B2BUA client)——libosip2 libeXosip2的更多相关文章

  1. SIP UserAgent (B2BUA client)——linphonec

    1.linphone编译 linphone一般用在android/ios/windows/mobile上,但是没有图形界面的linphonec命令行程序用在资源紧张的硬件平台上也跟pjsip命令行一样 ...

  2. SIP UserAgent (B2BUA client)——pjsip

    SIP UserAgent常用的SIP协议栈有pjsip/bell-sip/sofia-sip/libeXosip/libre等 https://github.com/staskobzar/sip_s ...

  3. Simple GB28181 System

    I. Deployment  / Architecture Block Diagram II. Resources Used 1. freeswitch —— sip server and media ...

  4. Open Source VOIP applications, both clients and servers (开源sip server & sip client 和开发库)

    SIP Proxies SBO SIP Proxy Bypass All types of Internet Firewall JAIN-SIP Proxy Mini-SIP-Proxy A very ...

  5. libeXosip2(2-1) -- eXosip2 configuration API

    eXosip2 configuration API General purpose API. Data Structures struct   eXosip_dns_cache struct   eX ...

  6. sipp模拟电信运营商VoIP终端测试(SIP协议调试)

    三大运营商都有SIP服务器,用来支持语音对讲,多媒体调度等功能,他们的平台可能不是标准的SIP协议会话. 为了应对没完没了的对接各个厂商的平台,这里再整理了一套协议脚本,毕竟全都是没有意义的无用功,标 ...

  7. sipp模拟freepbx分机测试(SIP协议调试)

    1.sipp的安装 1) 在centos 7.2下安装 yum install make gcc gcc-c++ ncurses ncurses.x86_64 ncurses-devel ncurse ...

  8. UAC(User Agent Client) 和 UAS(User Agent Server)

    SIP协议采用Client/Server模型.每一个请求(Request)触发服务器的一个操作:每个操作被称为方法(Method):每个请求除了指明具体方法外,还携带了一系列的头域(Header fi ...

  9. RFC3261--sip

    本文转载自 http://www.ietf.org/rfc/rfc3261.txt 中文翻译可参考 http://wenku.baidu.com/view/3e59517b1711cc7931b716 ...

随机推荐

  1. [洛谷P1353] 跑步Running

    问题描述 奶牛们打算通过锻炼来培养自己的运动细胞,作为其中的一员,贝茜选择的运动方式是每天进行N(1 <= N <= 10,000)分钟的晨跑.在每分钟的开始,贝茜会选择下一分钟是用来跑步 ...

  2. go mac 交叉编译 linux

    CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go

  3. HTML基础—DOM操作

    DOM(Document Object Model文档对象模型) 一个web页面大的展示,是由html标签组合成的一个页面,dom对象实际就是将html标签转换成了一个文档对象.可以通过dom对象中j ...

  4. 一个KVO 实现WKWebView加载进度条的例子 (注意最后移除观察者)

    // // OpenWebViewController.m // Treasure // // Created by 蓝蓝色信子 on 16/7/29. // Copyright © 2016年 GY ...

  5. Python3解leetcode Average of Levels in Binary Tree

    问题描述: Given a non-empty binary tree, return the average value of the nodes on each level in the form ...

  6. git使用技巧总结

    一.把github上的代码下载下来 git clone ...... 二.把修改的代码提交上去 git add .... git commit -m "........" git ...

  7. BZOJ 3879: SvT 虚树 + 后缀自动机

    Description (我并不想告诉你题目名字是什么鬼) 有一个长度为n的仅包含小写字母的字符串S,下标范围为[1,n]. 现在有若干组询问,对于每一个询问,我们给出若干个后缀(以其在S中出现的起始 ...

  8. 2019ICPC上海网络赛A 边分治+线段树

    题目: 给定一棵树, 带边权. 现在有2种操作: 1.修改第i条边的权值. 2.询问u到其他一个任意点的最大距离是多少. 解法:边分治+线段树 首先我们将所有的点修改和边修改都存在对应的边里面. 然后 ...

  9. Java 封装 继承 多态

    Java 继承 继承的概念 继承是java面向对象编程技术的一块基石,因为它允许创建分等级层次的类. 继承就是子类继承父类的特征和行为,使得子类对象(实例)具有父类的实例域和方法,或子类从父类继承方法 ...

  10. Java多线程引例及实现多线程的方式

    多线程(英语:multithreading),是指从软件或者硬件上实现多个线程并发执行的技术. Java多线程是由JVM来实现,不必关心操作系统的调用问题. 假如我们要实现如下功能: public c ...