How To : Raspberry PI install Asterisk 13

Raspberry Pi OS: Raspbian

Terminal / SSH

sudo apt-get install -y gcc make perl
sudo apt-get install -y libxml2 libxml2-dev
sudo apt-get install -y speex libspeexdsp-dev libspeex-dev ncurses-dev bison openssl libssl-dev sqlite3 libsqlite3-dev
sudo apt-get install -y libncurses5-dev subversion git-core libjansson-dev uuid-dev build-essential libsrtp0-dev

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar zxvf asterisk-13-current.tar.gz
cd asterisk-13.0.5 (Path 會改的)
./configure
make menuselect
make -j 4 (用4個 core, for Raspberry Pi 2 ) / make (Raspberry Pi )
sudo make install
sudo make samples
sudo make config

sample dialplan

sudo nano /etc/asterisk/extensions.conf 加在最後面 (nano goto file end short-cut key : Ctrl + w + v )

[mycontext]
exten => _2XXX,1,Answer()
exten => _2XXX,n,NoOP(exten=${EXTEN})
exten => _2XXX,n,Dial(SIP/${EXTEN})
exten => _2XXX,n,Hangup

;For Text chat
[messages]
exten => _.,1,NoOp(SMS receiving dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
exten => _.,n,Set(CDR(message)=${MESSAGE(from)})
exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($[“${MESSAGE_SEND_STATUS}” != «SUCCESS»]?sendfailedmsg)
exten => _.,n,Hangup()
;
; Handle failed messaging
exten => _.,n(sendfailedmsg),Set(MESSAGE(body)=”[${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.”)
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)}) exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,Hangup()
exten => _.,n,Hangup()

sudo nano /etc/asterisk/sip.conf

[general]
videosupport=yes ;For video call
tcpenable=yes ;For mobile phone, Mobile phone can’t get incoming call when use UDP.
accept_outofcall_message=yes ;For text chat
outofcall_message_context=messages ;For text chat
auth_message_requests=yes ;For text chat

;加在最後面
[2001]
type = friend
context=mycontext
callerid = User One <2001>
secret =
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 2001
disallow = all
allow = speex,g722,ilbc ; Auido codec
allow = vp8 ; Video codec
transport = udp

[2002]
type = friend
context=mycontext
callerid = User Two <2002>
secret =
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 2002
disallow = all
allow = speex,g722,ilbc ; Auido codec
allow = vp8 ; Video codec
transport = udp

Re-load config:
sudo asterisk -r
reload

P.S.
Raspberry Pi 最好是用有線接 Network
因為要用 Compiler,Raspberry Pi 2 比較好.

Link:
Raspbian install Asterisk 13
Raspberry PiとAsteriskでIP電話システムの構築(その1)
Asterisk Project Home – Getting Started
Asterisk 13 SIP SIMPLE messages to CDR
Asterisk權威指南

Skype upgrade fail solution

Error massage:
“A network error occurred while attempting to read from the file: C:ProgramDataSkype{4E76FF7E.AEBA-4C87-B788-CD47ES5425B9D}Skype PeSetup_6.3.105.msi”

Solution:
Use this link download skype latest version (MSI installer).
http://www.skype.com/go/getskype-msi

Vbuzzer dial plan

Dial Plan for vbuzzer
vbuzzer:How to dial a phone number

=======================
Dial Plan for vbuzzer

针对 VBUZZER 的设置是:
(*xx|<011:>x.|<0:86>x.|<1:861>xxxxxxxxxxS0|<:86311>x.|x|x.)

1、国外:011+国家号+区号+电话号码
例如:(打多伦多)011 1 416 2731234

2、国内长途:0+区号+电话号码
例如:(深圳)0 755 83901234

3、国内手机:直接拨
例如:13512345678

4、本地市话:直接拨
例如:(石家庄本地)86918071

(*xx|<:01186@@@>[2-9]xxxxxxx|<0:01186>[1-9]x.|<00:011>[1-9]x.|<:01186>1xxxxxxxxxx)
@@@替换成你本地区号
直拨是本地号码和手机,0开头是国内长途,00开头是国际长途

1、国外:00+国家号+区号+电话号码
例如:(打多伦多)00 1 416 2731234

2、国内长途:0+区号+电话号码
例如:(深圳)0 755 83901234

3、国内手机:直接拨
例如:13512345678

4、本地市话:直接拨
例如:86918071

5、Vbuzzer内部通话:直接拨打内部号码
例如:102623****
=======================

vbuzzer SIP setting

For PAP2T

NAT setting: (Useless in new router?)
NAT Mapping enable: Yes
NAT Keep Alive: Yes

SIP setting:
SIP Port: 80

Proxy Setting:
vbuzzer.com:80

Display Name: “Your Name”
User ID: “vbuzzer user ID”
User Passwd:” vbuzzer Passwd”

Dial plan: “Your dial plan”