Skip to content

Instantly share code, notes, and snippets.

@hiroeorz
Last active August 29, 2015 14:06
Show Gist options
  • Save hiroeorz/a97159c1b0af8b090f3e to your computer and use it in GitHub Desktop.
Save hiroeorz/a97159c1b0af8b090f3e to your computer and use it in GitHub Desktop.
クラウドにAsterisk立てて[SIPクライアント-(WebRTC)-WEBブラウザ]間でビデオ通話した時のメモ ref: http://qiita.com/hiroeorz@github/items/1092b0ee2503be30792f
$ apt-get install make automake gcc g++ ncurses-dev openssl libssl-dev
$ apt-get install libxml2 libxml2-dev sqlite3 libsqlite3-dev pkg-config
$ apt-get install libsrtp0 libsrtp0-dev
$ apt-get install libjansson4 libjansson-dev
$ apt-get install uuid uuid-dev
$ /etc/init.d/asterisk start
icesupport = yes
allowguest=no
realm=sip.hogetara.co.jp
videosupport=yes
disallow=all
allow=gsm
allow=ulaw
allow=ilbc
allow=vp8 ; Video codec from here.
allow=h264
allow=h263
allow=h263p
[2001]
type=friend
defaultuser=2001
secret=pass
canreinvite=no
host=dynamic
context=sip.hogetara.co.jp
allow=vp8,h264
nat=yes
[2002]
type=friend
defaultuser=SOMEI Yoshino
secret=pass
canreinvite=no
host=dynamic
context=sip.hogetara.co.jp
allow=vp8,h264
nat=yes
[2003]
type=friend
defaultuser=2003
secret=pass
canreinvite=no
host=dynamic
context=sip.hogetara.co.jp
allow=vp8,h264
nat=yes
[2004]
type=friend
defaultuser=2004
username=2004 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=pass ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=sip.hogetara.co.jp ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
allow=vp8,h264
nat=yes
[sip.hogetara.co.jp]
exten => _200Z,1,Dial(SIP/${EXTEN},30)
exten => _200Z,2,Congestion
exten => _200Z,102,Busy
rtpstart=10000
rtpend=20000
icesupport=yes
[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088
prefix=asterisk
$ sudo mkdir -p /etc/asterisk/keys
$ sudo ./contrib/scripts/ast_tls_cert -C sip.hogetara.co.jp -O "HogeTara Company" -d /etc/asterisk/keys/
$ sudo /etc/init.d/asterisk restart
$ tar xvjf pjproject-2.3.tar.bz2
$ cd pjproject-2.3
$ ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr
$ make dep
$ make
$ sudo make install
$ ldconfig
$ ldconfig -p | grep pj
$ ./configure --prefix=/usr/local/asterisk/12
$ make menuselect
[*] res_pjsip
[*] res_pjsip_acl
[*] res_pjsip_authenticator_digest
[*] res_pjsip_caller_id
[*] res_pjsip_dialog_info_body_generator
[*] res_pjsip_diversion
[*] res_pjsip_dtmf_info
[*] res_pjsip_endpoint_identifier_anonymous
[*] res_pjsip_endpoint_identifier_ip
[*] res_pjsip_endpoint_identifier_user
[*] res_pjsip_exten_state
[*] res_pjsip_header_funcs
[*] res_pjsip_log_forwarder
[*] res_pjsip_logger
[*] res_pjsip_messaging
[*] res_pjsip_multihomed [*] res_pjsip_mwi
... More ...
$ make
$ sudo make install
$ sudo make samples
$ sudo make config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment