* This tutorial is deprecated. Asterisk compilation is seamless with pjsip-bundled option. Asterisk compilation part is deprecated one, rest of the tutorial should work.
There are few steps to make calls using webrtc client.
There are few steps to make calls using webrtc client.
- Install prerequisites
- Install pjproject
- Install Asterisk
- Generate wss DTLS certificates for Asterisk
- Install Apache HTTP Server
- Generate self signed https certificates for Apache
- Configure Asterisk
- Configure sipml5 client
1 -
Download and install prerequisites
apt-get update
apt-get upgrade
reboot
apt-get install
build-essential libncurses5-dev libxml2-dev libsqlite3-dev libssl-dev uuid-dev
libjansson-dev libsrtp0-dev pkg-config unzip
cd /usr/src
wget
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
wget
https://github.com/sipml5/sipml5/archive/master.zip
2 -
Install pjproject
cd /usr/src/ tar -xjvf pjproject-2.4.5.tar.bz2 cd pjproject-2.4.5 ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG' make dep make make install ldconfig ldconfig -p | grep pj PKG_CONFIG_PATH=/usr/lib64/pkgconfig/ export PKG_CONFIG_PATH
3 - Install Asterisk
cd /usr/src/
tar -xzvf asterisk-13-current.tar.gz
./configure --prefix=/usr
--libdir=/usr/lib64
make && make install
&& make samples
ln -sf /usr/lib64/libasteriskssl.so.1
/usr/lib/libasteriskssl.so.1
ln -sf /usr/lib64/libresample.so.2
/usr/lib/libresample.so.2
ln -sf /usr/lib64/libportaudio.so.2
/usr/lib/libresample.so.2
4 - Generate wss DTLS certificates
cd
/usr/src/asterisk-13.7.0/contrib/scripts/
./ast_tls_cert -C mypbx.local -O
"my local pbx" -d /etc/asterisk/keys
5 - Install Apache HTTP Server
apt-get install apache2
6 - Generate self signed ssl certificates
openssl req -x509 -nodes -days 365
-newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out
/etc/apache2/ssl/apache.crt
sudo a2enmod ssl
vim
/etc/apache2/sites-available/default-ssl.conf
Search ssl block <VirtualHost _default_:443> and update
the following fields.
ServerAdmin admin@example.com
ServerName your_domain.com
ServerAlias www.your_domain.com
DocumentRoot /var/www/html
SSLCertificateFile
/etc/apache2/ssl/apache.crt
SSLCertificateKeyFile
/etc/apache2/ssl/apache.key
a2ensite default-ssl.conf
/etc/init.d/apache2 restart
7 - Configure Asterisk
sip.conf
[99300]
deny=0.0.0.0/0.0.0.0
dtmfmode=rfc2833
canreinvite=no
host=dynamic
trustpid=yes
sendpid=no
insecure=port,invite
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=ws,wss,udp
avpf=yes
force_avp=yes
icesupport=yes
encryption=yes
callgroup=
pickupgroup=
permit=0.0.0.0/0.0.0.0
dial=SIP/99300
secret=c602999e72c0054c7ad2f4b94559b23d
context=users
mailbox=99300@device
callerid=300 <99300>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic
dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass
dtlsrekey=0
disallow=all
;allow=g729
allow=alaw
allow=ulaw
;allow=ilbc
;allow=g726
;allow=opus
[100]
type=friend
callerid="100" <100>
defaultusername=100
host=dynamic
secret=100
dtmfmode=rfc2833
insecure=invite,port
canreinvite=yes
nat=force_rport,comedia
qualify=no
context=users
disallow=all
;allow=g729
allow=alaw
allow=ulaw
;allow=ilbc
extensions.conf
[users]
exten => 100,1,Dial(SIP/100)
exten => 99300,1,Dial(SIP/99300)
http.conf
enabled=yes
bindaddr=0.0.0.0
bindport=8088
tlsenable=yes ; enable tls - default no.
tlsbindaddr=0.0.0.0:8089 ; address and port to bind to - default is
bindaddr and port 8089.
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlsprivatekey=/etc/asterisk/keys/asterisk.pem
8 - Configure sipml5 client
cd /usr/src/
unzip master.zip
mv sipml5-master/ /var/www/html/
cd /var/www/html/
mv sipml5-master/ sipml5
chown www-data:www-data sipml5 -R
Open latest Chrome/Firefox and accpet
certificates.
https://asterisk-ip:8089/
https://asterisk-ip/sipml5/call.htm
Click on the advanced setting
Disable Video:
Enable RTCWeb Breaker[1]: check on
WebSocket Server URL[2]:
wss://server-ip:8089/ws
SIP outbound Proxy
URL[3]:udp://server-ip:5060
ICE Servers[4]: [ ]
Save the advanced setting page and
nevigate to call.htm page and enter fields.
Click Register button and start
making/receiving calls.
This works for my LAN
environment, configure it as per your environment.
Hope it will be useful
in developing your calling scenarios.
Hi, it's not working on chrome 52 version.
ReplyDeleteExtension is registered but it doesn't allow to call.
Few things.
ReplyDelete1 - You have configured self signed ssl certificated properly for Apache?
2 - You have accepted the self signed ssl certificates?
3 - Chrome browser popup a notification regarding mic/speeker notification. Did u accept that?
One more thing. Now Asterisk offers bundled pjsip project. Try to install latest Asterisk 13.x.x with pjsip bundled included, and do the same tests.
ReplyDeleteAn easy to follow tutorial for Asterisk 13 can be found here: https://www.mizu-voip.com/Support/Wiki/tabid/99/Default.aspx?topic=Asterisk+WebRTC
ReplyDeleteThanks for sharing your honest experience. When I first took a look at my headshots,
ReplyDeleteI wasn’t too thrilled with mine but you’ve given me a new perspective!
This blog post was done one and half years back, I suggest you should not follow this post anymore and try to use bundled pjsip project with Asterisk 13 latest. I wrote this thread when we don't have bundled version, and on that time it was my best findings to configure a SIPML5 webrtc phone to work with Asterisk.
ReplyDeleteCheers - Faheem
[2017-06-13 04:41:50] WARNING[2982][C-00000004]: res_rtp_asterisk.c:773 ast_rtp_ice_start: No RTCP candidates; skipping ICE checklist (0x7f6db831fbe8)-- Channel SIP/100-0000000a joined 'simple_bridge' basic-bridge <745e6ab1-d793-4894-bf06-823a0a9a78bc>-- Channel SIP/600-00000009 joined 'simple_bridge' basic-bridge <745e6ab1-d793-4894-bf06-823a0a9a78bc>[2017-06-13 04:42:21] NOTICE[1766]: chan_sip.c:29402 check_rtp_timeout: Disconnecting call 'SIP/600-00000009' for lack of RTP activity in 31 seconds-- Channel SIP/600-00000009 left 'simple_bridge' basic-bridge <745e6ab1-d793-4894-bf06-823a0a9a78bc>== Spawn extension (macro-dial-one, s, 51) exited non-zero on 'SIP/600-00000009' in macro 'dial-one'== Spawn extension (macro-exten-vm, s, 16) exited non-zero on 'SIP/600-00000009' in macro 'exten-vm'== Spawn extension (ext-local, 100, 2) exited non-zero on 'SIP/600-00000009'-- Executing [h@ext-local:1] Macro("SIP/600-00000009", "hangupcall,") in new stack-- Executing [s@macro-hangupcall:1] GotoIf("SIP/600-00000009", "1?theend") in new stack-- Goto (macro-hangupcall,s,3)-- Executing [s@macro-hangupcall:3] ExecIf("SIP/600-00000009", "0?Set(CDR(recordingfile)=)") in new stack-- Executing [s@macro-hangupcall:4] Hangup("SIP/600-00000009", "") in new stackIf I call webRTC "res_rtp_asterisk.c:773 ast_rtp_ice_start: No RTCP candidates; skipping ICE checklist (0x7f6db831fbe8)" warning appeared and hangup . What can I do? I used freepbx version 13 and asterisk 13.12.Please help me.
ReplyDeleteTry to update Asterisk version to 13.16 and set directmedia to 'no'. Also disable rtp inactivity.
ReplyDeleteto generate self-signed certificates also need to install openssl libssl-dev debian packages
ReplyDeleteNow getting error
Disconnected: Failed to connet to the server