安装说明
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
yum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel db-devel e2fsprogs-devel flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel python26-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel
cd /usr/local/src
git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch
cd /usr/local/src/freeswitch
./bootstrap.sh -j
./configure -C
make
make -j install
make -j cd-sounds-install
make -j cd-moh-install
修改配置文件
1.fs_cli连接
cd /usr/local/freeswitch/conf/autoload_configs
vi event_socket.conf.xml
###修改为127.0.0.1,启动fs_cli
2.webrtc配置
cd /usr/local/freeswitch/conf/sip_profiles
vi internal.xml ###打开注释
检查5066端口是否打开
3.SIPJS使用
sipjs-webphone
REGISTER sip:10.10.10.199:5066 SIP/2.0
Via: SIP/2.0/WS s5i42ue4okl7.invalid;branch=z9hG4bK162830
Max-Forwards: 70
To: "tianyu"
From: "tianyu" ;tag=v6rd74h85t
Call-ID: 47poq38kmunnt70cm38q6j
CSeq: 4187 REGISTER
Contact: ;reg-id=1;+sip.instance="";expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: path, gruu, outbound
User-Agent: SIP.js/0.11.6
Content-Length: 0
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WS s5i42ue4okl7.invalid;branch=z9hG4bK162830;received=10.10.10.239;rport=57056
From: "tianyu" ;tag=v6rd74h85t
To: "tianyu" ;tag=1tvNrDtF19Hre
Call-ID: 47poq38kmunnt70cm38q6j
CSeq: 4187 REGISTER
User-Agent: FreeSWITCH-mod_sofia/1.6.20+git~20180507T185611Z~43a9feb7f8~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
WWW-Authenticate: Digest realm="10.10.10.199", nonce="172ad673-9c5b-46f5-8fea-dbfd6b1160e7", algorithm=MD5, qop="auth"
Content-Length: 0
REGISTER sip:10.10.10.199:5066 SIP/2.0
Via: SIP/2.0/WS s5i42ue4okl7.invalid;branch=z9hG4bK4108439
Max-Forwards: 70
To: "tianyu"
From: "tianyu" ;tag=v6rd74h85t
Call-ID: 47poq38kmunnt70cm38q6j
CSeq: 4188 REGISTER
Authorization: Digest algorithm=MD5, username="1000", realm="10.10.10.199", nonce="172ad673-9c5b-46f5-8fea-dbfd6b1160e7", uri="sip:10.10.10.199:5066", response="635242442fa82d499423b02d4296e528", qop=auth, cnonce="6f1757jocgu8", nc=00000001
Contact: ;reg-id=1;+sip.instance="";expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: path, gruu, outbound
User-Agent: SIP.js/0.11.6
Content-Length: 0
SIP/2.0 200 OK
Via: SIP/2.0/WS s5i42ue4okl7.invalid;branch=z9hG4bK4108439;received=10.10.10.239;rport=57056
From: "tianyu" ;tag=v6rd74h85t
To: "tianyu" ;tag=23Net8aKyj8aa
Call-ID: 47poq38kmunnt70cm38q6j
CSeq: 4188 REGISTER
Contact: ;expires=600
Date: Wed, 05 Dec 2018 04:25:37 GMT
User-Agent: FreeSWITCH-mod_sofia/1.6.20+git~20180507T185611Z~43a9feb7f8~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Content-Length: 0
### webrtc注册成功。