Asterisk SIP连通测试(X-Lite eyebeam)
Step1:設置 sip.conf
root@Ubuntu:/etc/asterisk# vim sip.conf?
[general] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//類似與全局變量
context ?= default ? ? ? ? ? ? ? ?
srvlookup = yes ? ? ? ? ? ? ? ? ? //DNS SRV記錄查詢
[111]
secret=aaa ? ? ? ? ? ? ? ? ? ? ? ? //密碼,隨意設置
port=5060 ? ? ? ? ? ? ? ? ? ? ? ? ?//SIP端口地址
type=friend ? ? ? ? ? ? ? ? ? ? ? ? //類型為friend
host=dynamic ? ? ? ? ? ? ? ? ? ?//要求號碼注冊,以便Asterisk可以知道如何找到電話
qualify = yes ? ? ? ? ? ? ? ? ? ? ?//確認遠端設備是否可達
nat = no ? ? ? ? ? ? ? ? ? ? ? ? ? ? //如果一個號碼在NAT設備后面,例如防火墻,配置為yes
context = internal ? ? ? ? ? ? ?//定義了指令的地點,用于控制電話的權限,及如何處理此號碼的呼入呼叫。
canreinvite = no ? ? ? ? ? ? ? ?//讓Asterisk媒體通道經過自己,而不允許RTP信息直接在端點之間傳送
;-----------華麗的分割線--------------
[222]
secret=aaa
port=5060
qualify = yes
nat = no
context = internal
canreinvite = no
type=friend
host=dynamic
Step2:設置extensions.conf
root@Ubuntu:/etc/asterisk# vim extensions.conf?
[internal] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//這里的internal和sip.conf里的context相同,可修改
exten => 1001,1,Dial(SIP/111)
exten => 1002,1,Dial(SIP/222)
Step3:打開Asterisk
root@Ubuntu:/home/blackhole# asterisk -crvvvvv
...
...
Ubuntu*CLI>?
Step4:設置X-lite
點擊軟件上方三角形ShowMenu
再點開SIP Account Settings,設置新賬戶
如圖所示:
DisplayName可隨意填寫
User name 和Authorization user name填在sip.conf里面設置的名字我的是111就填111了
Domian就是本機的IP地址,proxy也是 但是記得加端口號
設置完點確定就OK了
此時 應該就能夠看到
-- Registered SIP '111' at 172.19.60.10:45738
[Apr 15 20:33:15] NOTICE[1154]: chan_sip.c:24728 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 111
Ubuntu*CLI>?
表示已經111已經連接上
此時你可以試試撥打1001
你會看到111在撥打自己
== Using SIP RTP CoS mark 5
? ? -- Executing [1001@internal:1] Dial("SIP/111-00000023", "SIP/111") in new stack
? == Using SIP RTP CoS mark 5
? ? -- Called SIP/111
? ? -- SIP/111-00000024 is ringing
? ? -- SIP/111-00000024 is ringing
? == Spawn extension (internal, 1001, 1) exited non-zero on 'SIP/111-00000023'
Ubuntu*CLI>?
Step5:設置eyeBeam
在此解釋一下X-lite和eyeBeam其實是相同的,只是eyeBeam不能使用視頻而X-lite可以
我只是用他們做個測試
所以設置和eyeBeam是相同的
設置好后
-- Registered SIP '222' at 172.19.60.10:15934
[Apr 15 20:42:55] NOTICE[1154]: chan_sip.c:24728 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 222
Ubuntu*CLI>?
這樣就可以呼叫X-lite啦?
撥打1001試試
當然也可以用X-lite撥打eyeBeam
?== Using SIP RTP CoS mark 5
? ? -- Executing [1001@internal:1] Dial("SIP/222-00000027", "SIP/111") in new stack
? == Using SIP RTP CoS mark 5
? ? -- Called SIP/111
? ? -- SIP/111-00000028 is ringing
? ? -- SIP/111-00000028 is ringing
Ubuntu*CLI>?
附圖:
這樣就算是成功了吧
注:如果extensions.conf被重新編寫了 一定要記得在CLI那里reload一下
重新編寫sip.conf就sip reload
總結
以上是生活随笔為你收集整理的Asterisk SIP连通测试(X-Lite eyebeam)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 手机QQ iOS版8.8.94更新发布:
- 下一篇: Meld安装