|
QNAP109+ Asterisk1.4.22 + oBI110 + Comnet Phone 設定心得
本帖最後由 harold 於 2016-8-11 16:38 編輯
先講背影
小弟有二部陳年舊的NAS, 一部Synology DS109j, 另一部係QNAP109+ !! 係NAS 來講, Synology 係好用過QNAP, 但唔再係到詳談!! 兩部都有Asterisk APP 可安裝!! 但 QNAP個QPKG 安裝檔案已經無得再download. 即QNAP唔再support TS109+.
我原先係用CallCentric + OBI110 + Comnet Phone 來玩VOIP, 但CallCentric 質數越來越差, 通話Delay 1-2秒, 所以決定起Asterisk Server.
平時我的Synology 只用來Data Backup, QNAP 只用來做 OpenVPN Server. 因為QNAP用無散熱扇的設計, 所以有利長時間開啟! QNAP 109+ Firmware update to 3.3.3 Build 1003T!
安裝Asterisk
先在Archive 地方download Asterisk_1.4.22.1b_arm_x09 安裝在QNAP 的QPKG!! 不要在QNAP109+ 上安裝 IPKG Asterisk, 因為QNAP 上的linux kernel 太舊, 有太多不足, 安裝後一大堆問題, 我搵咗好耐都無解決方法!!
安裝完成後, 你會看到Asterisk GUI版本!! 但這個GUI 有太多問題, 根本用不到啲個GUI! 唯一用到的, 只有GUI 內個的CLI !! 你必定要用它!! 因為在SSH 上, 你無可能用到Asterisk 上任何一個command 的!! 所以GUI 內個的CLI 係唯一一個途徑比你打CLI command 的地方!!
我用咗二個星期由Asterisk 零認識去到設定完成!!! 由摸不著頭到設定完成!! 真係嘔心瀝血!!!
有咗我啲個config, 時間會花少好多!! 因為我學藝未精, 唔一定最好!! 但我都叫好滿意!!
唔好對QNAP 的Asterisk 有咁大期望, 因為QNAP 比到你的Asterisk Function, 就可以用到, 但一啲要 Addon 安裝的, QNAP 的Asterisk 係唔會做到的!!
另外, 雖然通話質素滿意, 但當Asterisk 入到 OBI 的AA menu 時, 第一層(1,2,3 的選項)係無問題, 但去到第二層就出現Packet LOSS, 我未知乜事!! 但通話上係無問題的!
現今玩VOIP, 多數會係SmartPhone 到玩!!
IPhone 上, 免費選擇較少, 都都好穏定,設定不多 e.g. linphone, Zoiper
Android 上自身的SIP 是最好的, 但Andoird 6.0 後不再有啲個功能!!
Android上, 免費選擇較多, 都好壞一半半!! 有啲做都好複雜, 但一般來說基本設定就可以了!! e.g. csipsimple, linphone, Zoiper
Asterisk Config
Sip.conf
;Global Config
[general]
context = default
allowoverlap = no
bindport = 5060
bindaddr = 0.0.0.0
srvlookup = yes
allowexternaldomains = yes
allowguest = no
allowsubscribe = yes
allowtransfer = yes
alwaysauthreject = yes
autodomain = no
callevents = no
checkmwi = 10
defaultexpiry = 120
domain =
dtmfmode = auto
dumphistory = no
externrefresh = 10
fromdomain = “dynamic dns”
g726nonstandard = no
jbenable = yes
jbforce = yes
jbimpl = adaptive
jblog = yes
jbmaxsize = 200
jbresyncthreshold = 1000
language =
maxcallbitrate = 384
maxexpiry = 3600
minexpiry = 60
mohinterpret = default
mohsuggest =
nat = yes
notifyringing = yes
pedantic = no
progressinband = never
promiscredir = no
realm = asterisk
recordhistory = no
registerattempts = 0
registertimeout = 20
relaxdtmf = no
rtpholdtimeout =
rtptimeout =
sendrpid = no
sipdebug = no
subscribecontext =
t1min = 100
t38pt_udptl = no
trustrpid = no
useragent = IPPABX
usereqphone = no
videosupport =yes
icesupport=yes
stunaddr=stun.zoiper.com
disallow = all
allow=alaw
pedantic=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
notifymimetype=text/plain
vmexten=*9
language=en
compactheaders = yes
rtptimeout=60
rtpholdtimeout=300
externhost= “dynamic dns“
localnet=10.0.0.0/255.0.0.0
dtmfmode=rfc2833
srvlookup=yes
register => 1777xxxxxxxxx@callcentric.com:YouPasword:1777xxxxxxxxx@callcentric.com/You Extension
[callcentric]
type=peer
context=from-callcentric
host=callcentric.com
fromdomain=callcentric.com
username=1777xxxxxxxxx
fromuser=1777xxxxxxxxx
secret=YourPassword
insecure=very
canreinvite=no
allow=all
[100]
callerid="OBITrunk" <100>
username=YouUserName
type=friend
context=my-group
secret=YourPasword
host=dynamic
nat=no
canreinvite=no
transport=udp
dtmfmode = auto
mailbox=100@default
jbenable = no
jbforce = no
disallow=all
allow=alaw
allow=ulaw
extensions.conf
[DirectoryService]
exten => *0,1,Answer
exten => *0,2,Wait(1)
exten => *0,3,Directory(default,my-group,ef)
[EchoTest]
exten => *1,1,Playback(demo-echotest) ; Let them know what's going on
exten => *1,2,Echo ; Do the echo test
exten => *1,3,Playback(demo-echodone) ; Let them know it's over
exten => *1,n,hangup()
[VMail]
exten => *9,1,wait(1)
exten => *9,n,VoiceMailMain(s${CALLERIDNUM})
exten => *9,n,hangup()
[from-callcentric]
exten => s,1,Dial(SIP/100)
exten => s,n,hangup()
[obitrunk01]
exten => _1XXX,1,Dial(SIP/**1133${EXTEN}@100)
exten => _1XXXX ,1,Dial(SIP/**1133${EXTEN}@100)
exten => _1XXXXXX ,1,Dial(SIP/**1133${EXTEN}@100)
exten => _[2356789]XXXXXXX,1,Answer(1)
exten => _[2356789]XXXXXXX,n,Dial(SIP/**1${EXTEN}@100)
exten => _[2356789]XXXXXXX,n,hangup()
[StarCode]
;-------------------- **02 Call out from callcentric
exten => _**02X.,1,Answer
exten => _**02X.,2,Wait(2)
exten => _**02X.,3,Read(password,enter-password,4)
exten => _**02X.,4,GotoIf($[${password} = 0000]?5:8)
exten => _**02X.,5,playback(pls-wait-connect-call)
exten => _**02X.,6,Dial(SIP/${EXTEN:4}@callcentric)
exten => _**02X.,7,hangup()
exten => _**02X.,8,playback(privacy-incorrect)
exten => _**02X.,9,playback(goodbye)
exten => _**02X.,10,Wait(1)
exten => _**02X.,11,hangup()
;-------------------- **09 OBITalk Call
exten => _**09X.,1,Wait(1)
exten => _**09X.,n,Dial(SIP/**9${EXTEN:4}@100)
exten => _**09X.,n,hangup()
[my-group]
include =>DirectoryService
include =>EchoTest
include =>VMail
include =>StarCode
exten => 100,1,Dial(SIP/100,30)
exten => 100,n,Dial(SIP/101&SIP/102,45)
exten => 100,n,hangup()
exten => _XXX,1,Dial(SIP/${EXTEN},45)
exten => _XXX,2,VoiceMail(${EXTEN},u)
exten => _XXX,n,hangup()
voicemail.conf
; Sendmail not work on QNAP109
attach=yes
maxmsg=10
skipms=3000
maxsilence=10
saycid=yes
4200 => 9855,Mark Spencer,markster@linux-support.net,mypager@digium.com,
Rtp.conf
;要避開OBI110 的RTP Port
rtpstart=24000
rtpend=25000
dnsmgr.conf
enable=yes
設定完後到OBI 設定, OBItalk Website, 入ObiTalk Compatible Service Providers -> Generate SIP Setting, 入Comnet Config 係SP1
設定完後再入ObiTalk Compatible Service Providers -> Generate SIP Setting, 入Asterisk Account 係SP2
然後 Obi Expert Configuration -> Enter Obi Exprt -> Voice Service -> X_InboundCallRoute ,係value 入{@>(<**1:>xx.):sp1},{@>(<**2:>xx.):sp2}{@>(<**8:>xx.):li},{@>(<**9:>xx.):pp},{(100):aa},{>100:ph}
在router上, 記得Set 返 port forwarding
Asterisk UDP 5060 Port
Asterisk RTP UDP 24000-25000 port
希望幫到各位!! |
|