Board logo

標題: 【Raspberry Pi】—— 自家製 VOIP Asterisk Raspberry Pi Image 2015/01/17 更新 [打印本頁]

作者: ckleea    時間: 2013-12-7 21:50     標題: 【Raspberry Pi】—— 自家製 VOIP Asterisk Raspberry Pi Image 2015/01/17 更新

本帖最後由 ckleea 於 2015-1-17 09:29 編輯

2014年5月20日更新

請參考主帖  http://www.telecom-cafe.com/foru ... &extra=page%3D1

這是我自己在 Raspberry Pi compiled 的  Asterisk,此版本目的是讓各供 Telecom-Cafe VOIP 網友可以利用手上的 Raspberry Pi 建立一個輕便簡單易用的 VOIP PBX,配合已有的 USB 3G 手指,輕鬆上網通話和發放 SMS。

同時附上以下VOIP - PBX 功能
1. 最新版 Asterisk 11.X (SVN version),沒有G729 codec ,其他功能已 compiled.
2. 配合 Asterisk GUI 輕鬆設定
3. 內建 Dongle 供 USB 3G 手指發放 SMS,如手指是 Voice activated/enabled,更可收發電話
4. 已內置 SIP Trunk settings for HKBN 2B, NWT, ComNet, SPA3000 ATA (via HTTP Digest)
5. Fax (已設置IAXModem + Hylafax),設定未完成
6. Web based SMS client 供發放英文 SMS
7. Mail tools to send SMS 去指定電郵地址,可使用 Google Mail SMTP 或網友 ISP 提供 Mail server

其他server功能
1. VPN supported by Softether - SSTP, IPSec, OpenVPN (已啟動)
2. VNC server (已啟動)
3. Samba client and server
4. Webmin 系統管理 (已啟動)
5. Printing support
6. PPTP server (已啟動)
7. Backup and email important configuration files (已啟動)
8. xRDP for remote desktop (已啟動)
9. 加入 Watchdog

硬件:
1. Raspberry Pi with at least 8GB SD Card
2. 充足電力 Power Supply - 最好使用帶電 USB 2.0 Hub
建議使用呢款 USB 3.0 Hub (http://www.connectland.com.hk/ma ... t_detail.php?id=966),完全解決電力不足 reboot 的情況。

screenshot.09-12-2013 19.15.50.png


3. 支援  USB 3G 手指,例如華為 E180 (可參考支援型號: http://wiki.e1550.mobi/doku.php? ... of_supported_models)
另外要留意手指是否 Voice enable

下面網頁有 Raspberry Pi 支援硬件
http://elinux.org/RPi_VerifiedPeripherals



軟件:
1. Debian Wheezy
2. Asterisk 11 (latest SVN version)
3. chan_dongle driver
4. Softether VPN server
5. webmin
6. fail2ban (可以自行啟動)
7. minisipserver 已安裝配,有GUI 的 SIP server (可以自行啟動)
8. ddclient for dynamic host  (可以自行啟動)
9. Avantfax Fax Web based frontend

ToDo List:
1. OpenVPN
2. Fax Web based frontend
3. Iptables


感謝:角色、雯雯、Bubblestar 協助

圖片附件: screenshot.09-12-2013 19.15.50.png (2013-12-9 19:21, 377.48 KB) / 下載次數 1444
http://www.telecom-cafe.com/forum/attachment.php?aid=3000&k=eda679b82d8333329c068e77983b70f6&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-7 21:50

本帖最後由 ckleea 於 2013-12-14 19:56 編輯

我的硬件

P1050985.png

Samples Screenshots

1. Telecom-Cafe (Digium) Asterisk GUI
screenshot.12-12-2013 21.43.18.png

2. SMS Gateway
screenshot.07-12-2013 22.38.44.png

3. Webmin Interface
screenshot.12-12-2013 21.45.22.png

4. VNC server
screenshot.12-12-2013 21.54.29.png
screenshot.12-12-2013 21.55.14.png
screenshot.12-12-2013 21.54.45.png

圖片附件: screenshot.07-12-2013 22.35.52.png (2013-12-7 22:41, 67.49 KB) / 下載次數 1566
http://www.telecom-cafe.com/forum/attachment.php?aid=2998&k=ce690aa7c6c95e10243d6839a8b0b1be&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.07-12-2013 22.38.44.png (2013-12-7 22:44, 6.42 KB) / 下載次數 1304
http://www.telecom-cafe.com/forum/attachment.php?aid=2999&k=d5d7be36b66a55c0f2b32bb3be0c2e34&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.43.18.png (2013-12-12 21:52, 82.59 KB) / 下載次數 1340
http://www.telecom-cafe.com/forum/attachment.php?aid=3023&k=e9a0a19236ad42db15f04b45d3beadd5&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.45.22.png (2013-12-12 21:52, 33.34 KB) / 下載次數 1313
http://www.telecom-cafe.com/forum/attachment.php?aid=3024&k=19619acf3618f9f287fba700ea9ae1a3&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.54.29.png (2013-12-12 22:01, 90.05 KB) / 下載次數 1309
http://www.telecom-cafe.com/forum/attachment.php?aid=3028&k=35dd578cf9add36792a7316bb1d4ff5a&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.55.14.png (2013-12-12 22:01, 131.59 KB) / 下載次數 1357
http://www.telecom-cafe.com/forum/attachment.php?aid=3029&k=ba54a848f141cd49d34216d67fec9ab9&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.54.45.png (2013-12-12 22:01, 117.37 KB) / 下載次數 1345
http://www.telecom-cafe.com/forum/attachment.php?aid=3030&k=6bf20fdb6e7c69c3b79b77fda1837698&t=1713895373&sid=8Kbb6H



圖片附件: P1050985.png (2013-12-14 19:56, 746.79 KB) / 下載次數 1189
http://www.telecom-cafe.com/forum/attachment.php?aid=3049&k=d35c289ad7800838278544bf79125690&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-7 21:50

本帖最後由 ckleea 於 2015-1-17 09:15 編輯

下載及基本安裝程序: (下載Image 會不斷更新)



1. 下載 RASPASTDON-V1.8-201500117.zip from https://drive.google.com/file/d/ ... 3M/view?usp=sharing

2. 下載 Win32 Disk Imager from http://sourceforge.net/projects/win32diskimager/
3. 使用 Win32 Disk Imager 將下載的zip 檔放出的 RASPASTDON-V1.8-201500117.img, 寫入一張最小有 8GB SD Card
4. 用剛剛準備好 SD Card 起動 Raspberry Pi;如果用 HMDI 出 Mon 或 電視,可以看到Raspberry Pi系統起動的資訊
5. 正常的話,Raspberry Pi系統應該可以從 Router DHCP 取得網內 IP
6. 用 putty 登入 raspberrypi, root password is raspberrypi
基本上系統內所有 password 均預設為 raspberrypi

更改 root password
1. 用 putty 進入系統 as root
2. passwd 更改 your root password

主要軟件工具:
1. Putty - http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
2. WinSCP - http://winscp.net/eng/download.php
3. VOIP - Soft client - http://www.zoiper.com/en/voip-softphone/download/zoiper3
4. Windows VNC Clients - http://portableapps.com/node/11285  & http://portableapps.com/node/2031
作者: ckleea    時間: 2013-12-7 21:50

本帖最後由 ckleea 於 2013-12-13 06:49 編輯

更改網絡設定



注意:同一 USB 3G 手指,不能同時使用 為 internet 上網和 Asterisk dongle
設定DHCP versus static IP
1. 用 putty 進入系統 as root
2. 更改 /etc/network/interfaces
screenshot.09-12-2013 19.32.02.png
3. 改為
screenshot.09-12-2013 19.33.16.png
例如 網友的網絡設定為
<ip-address> = 192.168.1.10
<netmask address> = 255.255.255.0
<gateway address> = 192.168.1.1

screenshot.09-12-2013 19.35.57.png
4. 儲存檔案,然後
/etc/init.d/networking reload
or
reboot

參考網頁:http://elinux.org/RPi_Setting_up_a_static_IP_in_Debian

設定USB 3G 手指上網
1. 已裝置 sakis3g 程式
2. 輸入 /usr/bin/sakis3g --interactive
screenshot.12-12-2013 21.51.16.png
3. 成功上網
screenshot.12-12-2013 21.35.39.png

圖片附件: screenshot.09-12-2013 19.32.02.png (2013-12-9 19:38, 4.51 KB) / 下載次數 1282
http://www.telecom-cafe.com/forum/attachment.php?aid=3002&k=7c1fde969005cab29b8d7518bdb1abda&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.09-12-2013 19.33.16.png (2013-12-9 19:39, 10.28 KB) / 下載次數 1295
http://www.telecom-cafe.com/forum/attachment.php?aid=3003&k=eef657baea9eb04072476e658c69f774&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.09-12-2013 19.35.57.png (2013-12-9 19:41, 7.51 KB) / 下載次數 1343
http://www.telecom-cafe.com/forum/attachment.php?aid=3004&k=9fe2afd7d8a49ce1c7fe5bb0b0c75f7b&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.51.16.png (2013-12-12 21:57, 5.17 KB) / 下載次數 1278
http://www.telecom-cafe.com/forum/attachment.php?aid=3026&k=a311c84be0868e67746d8c927248ac35&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.12-12-2013 21.35.39.png (2013-12-12 21:57, 7.02 KB) / 下載次數 1310
http://www.telecom-cafe.com/forum/attachment.php?aid=3027&k=ab91341188df1609d67910d2bcf940aa&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-7 21:51

本帖最後由 ckleea 於 2013-12-11 07:02 編輯

設定VOIP - Asterisk 和 Dongle
注意:已內置ComNet Phone, NWT, HKBN 2b和 SAP3000/3102 SIP Trunks的基本設定, 但需要自行加入VOIP Provider (ComNet Phone, NWT, HKBN 2b) 的username 和 password

1. 登入 asterisk gui via http://yourip:8088/
2. user name: admin; password: raspberrypi
3. 修改 HKBN; NWT; ComNET; SPA300/3102 trunk 的 資料
4. 更改 ext 6000/ 6001 password
5. 記住按 Apply change
6. 用自己喜歡的 Windows or 手機的 SIP client 登入

手動修改 dongle.conf 及 dongle_extensions.conf
1. 打開/etc/asterisk/dongle.conf
screenshot.10-12-2013 01.17.02.png
2. 更改 SIM Card 電信號碼如cursor 位置
screenshot.10-12-2013 01.17.22.png
3. 打開/etc/asterisk/dongle_extensions.conf
更改 SIM Card 電信號碼及電郵地址
screenshot.10-12-2013 01.20.42.png


更改 SMTP server address 供電郵 sms

1. 用 putty 登入 Raspberry Pi
2. cd /etc/ssmtp
3. 更改 ssmtp.conf
screenshot.09-12-2013 21.15.53.png
跟據gmail user name 設定 修改
screenshot.09-12-2013 21.16.59.png

圖片附件: screenshot.09-12-2013 21.15.53.png (2013-12-9 21:21, 9.87 KB) / 下載次數 1331
http://www.telecom-cafe.com/forum/attachment.php?aid=3005&k=597731972f9f45a6226cc5777e3f01bf&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.09-12-2013 21.16.59.png (2013-12-9 21:23, 9.39 KB) / 下載次數 1246
http://www.telecom-cafe.com/forum/attachment.php?aid=3006&k=34cad0bd52485b116ff8fefd682064fe&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 01.17.02.png (2013-12-10 01:31, 11.44 KB) / 下載次數 1277
http://www.telecom-cafe.com/forum/attachment.php?aid=3007&k=b504afd802791781e359f2da7d254c21&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 01.17.22.png (2013-12-10 01:31, 12.04 KB) / 下載次數 1429
http://www.telecom-cafe.com/forum/attachment.php?aid=3008&k=e8c59f5dbaa0ca04b43ae5ca5b394dac&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 01.20.42.png (2013-12-10 01:31, 15.13 KB) / 下載次數 1263
http://www.telecom-cafe.com/forum/attachment.php?aid=3009&k=95555454db18c48a4d68b5b24332aa8b&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-7 21:51

本帖最後由 ckleea 於 2013-12-13 06:59 編輯

設定 miniSipServer

http://www.myvoipapp.com/
這是一個簡單易用 VOIP PBX (用GUI 設定),asterisk外另一選擇。

1. 用你的瀏覽器指向 http://yourip:8080/
2. password:raspberrypi
3. 設定 ipaddress, sip port, extension(s), trunk(s), etc

screenshot.12-12-2013 21.43.48.png

圖片附件: screenshot.12-12-2013 21.43.48.png (2013-12-12 21:53, 24.37 KB) / 下載次數 1412
http://www.telecom-cafe.com/forum/attachment.php?aid=3025&k=7253f9c1f01c7d3f99fa5499d4ef11eb&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-7 21:51

本帖最後由 ckleea 於 2013-12-11 22:09 編輯

設定你的VPN Server

1. Image 已內置 Softether VPN 和 PPPD,在開機時已自動起動
2. Use Softether VPN Server Manager 設定 SSTP, IPSec 和 OpenVPN
登入 Softether VPN Server
screenshot.10-12-2013 06.26.55.png

- 雙擊 Manage Virtual Hub "Default"

screenshot.10-12-2013 06.27.18.png

- 雙擊 Manage Users

screenshot.10-12-2013 06.27.39.png

- 加入 User name 和 password

screenshot.10-12-2013 06.27.50.png

- 揀選 enable Open VPN 和 enable MS STP

screenshot.10-12-2013 06.28.19.png

-  揀選  enable VON Azure 功能

screenshot.10-12-2013 06.28.43.png
- 最重要是更改 Dynamic Host name

screenshot.10-12-2013 06.29.10.png

3. PPTP VPN 設定
- 已設定基本 PPTPD
- 請修改以下部份
- in /etc/ppptd.conf, 更改 localip
screenshot.11-12-2013 21.51.03.png

- in /etc/ppp/pptpd.options, 更改 ms-dns
screenshot.11-12-2013 21.54.32.png

- in /etc/ppp/chap-secrets, 加入 user 和 password
screenshot.11-12-2013 21.55.44.png

- 在 command line, 輸入 service pptpd restart
- 在 windows 加入 ppp connection 設定

參考: http://blog.wellsb.com/post/29412820494/raspberry-pi-vpn-server

圖片附件: screenshot.10-12-2013 06.26.55.png (2013-12-10 06:39, 89.6 KB) / 下載次數 1346
http://www.telecom-cafe.com/forum/attachment.php?aid=3010&k=a435bfcd400f3bfd45f0da94944b183d&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 06.27.18.png (2013-12-10 06:40, 74.13 KB) / 下載次數 1270
http://www.telecom-cafe.com/forum/attachment.php?aid=3011&k=2d9b7e4b1d53949e51b6120ecdea45e9&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 06.27.39.png (2013-12-10 06:40, 30.45 KB) / 下載次數 1339
http://www.telecom-cafe.com/forum/attachment.php?aid=3012&k=7982c5f80cfdd5e4d179e6d450ebdb10&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 06.27.50.png (2013-12-10 06:40, 52.9 KB) / 下載次數 1308
http://www.telecom-cafe.com/forum/attachment.php?aid=3013&k=b9e70cefc122c469f96b5a1a464b9464&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 06.28.19.png (2013-12-10 06:40, 73.6 KB) / 下載次數 1265
http://www.telecom-cafe.com/forum/attachment.php?aid=3014&k=13f355db6c2ef0df5edf92c7b0aebfb9&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 06.28.43.png (2013-12-10 06:41, 133.94 KB) / 下載次數 1313
http://www.telecom-cafe.com/forum/attachment.php?aid=3016&k=6bcf9c799b7eeb3e56107d94e8ed34b7&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.10-12-2013 06.29.10.png (2013-12-10 06:41, 64.2 KB) / 下載次數 1326
http://www.telecom-cafe.com/forum/attachment.php?aid=3017&k=7948d47b3011125ad50b4871535fbe6d&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.11-12-2013 21.51.03.png (2013-12-11 21:57, 1.62 KB) / 下載次數 1405
http://www.telecom-cafe.com/forum/attachment.php?aid=3019&k=05fc7fc74cf0e56fe225fd9a21535721&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.11-12-2013 21.54.32.png (2013-12-11 22:00, 1.04 KB) / 下載次數 1458
http://www.telecom-cafe.com/forum/attachment.php?aid=3020&k=383feab1bb2435f630900948f97677b7&t=1713895373&sid=8Kbb6H



圖片附件: screenshot.11-12-2013 21.55.44.png (2013-12-11 22:01, 3.26 KB) / 下載次數 1242
http://www.telecom-cafe.com/forum/attachment.php?aid=3021&k=342dfd5f9af05716430e425058c6da72&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-7 21:51

本帖最後由 ckleea 於 2013-12-14 19:35 編輯

VNC 使用
1. 使用你喜愛的 Windows vncclient 登入 Raspberry Pi VNC server;網絡地址為 yourip:0
2. password: raspberrypi

RDP 使用
1. 利用Windows Remote Desktop Connection 登入 Raspberry Pi xRDP server
2. 網絡地址為yourip

Webmin 使用
1. 使用你喜愛的 browser 登入 raspberry Pi webmin 管理系統;網絡地址為 https://yourip:10000/
2. username: root; password: raspberrypi

Backup script
1. 已內置 a bash script 自動備份 /etc 內所有 config files
2. 備份於每星期日零晨1時
2. 備份檔案位置 - /opt/backup

Raspberry Pi 系統 Image 備份
1. 最簡單是 poweroff 後,將全張 SD Card 用 Wind32 DiskImager 備份
(參考:
http://lifehacker.com/how-to-clo ... r-easy-r-1261113524
http://rpi.tnet.com/project/faqs/backups/backingup
)
2. 但備份檔案最小 2.9 GB (zip)
3. 另一問題是 reboot 後, softether vpn dynamic host 有機會用不到
4. 其他方法
參考: http://jonathangiles.net/blog/?p=1554
作者: ckleea    時間: 2013-12-7 21:52

留用 ###8
作者: ckleea    時間: 2013-12-7 21:52

留用 ###9
作者: bubblestar    時間: 2013-12-8 21:17

Is it feasible to install OBiApp in this tiny device?
作者: ckleea    時間: 2013-12-8 21:42

本帖最後由 ckleea 於 2013-12-9 21:36 編輯

回復 11# bubblestar

應該唔得,因為冇x86 instruction set,但請看看這帖子

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=12727

希望有機會做到!
作者: 角色    時間: 2013-12-8 22:07

是否有一个version number control 那么大家知道现在自己用哪个版本?

可以的话,那么member可以在某个version上再加东西,然后楼主可以根据step再把Official version升级。
作者: ckleea    時間: 2013-12-9 03:00

本帖最後由 ckleea 於 2013-12-9 21:35 編輯

回復 13# 角色

暫時會用 date stamp標示不同版本。

還在想怎樣協助網友不用更新全套image ,因為現在仍未知怎樣才可以提供patches or updates。而且整套 images 更新需要網友自己先行backup 和轉移設定,所以有機會做漏。
作者: orangelau    時間: 2013-12-10 00:53

太好了, 等我試試
作者: 角色    時間: 2013-12-10 23:55

本帖最後由 角色 於 2013-12-11 00:04 編輯

好想没有ComNet Phone。

如果ComNet Phone出现No Authentication,等我有空写一个script,然后通过cron job自动运行sip reload。
作者: 角色    時間: 2013-12-11 00:02

还有Asterisk的SVN怎样check out,然后complile和安装呢?
作者: 角色    時間: 2013-12-11 00:05

Windows的VNC Client呢?
作者: wochinaren123    時間: 2013-12-11 01:26

提示: 作者被禁止或刪除 內容自動屏蔽
作者: ckleea    時間: 2013-12-11 06:36

回復 17# 角色

請看我在 /usr/scr/asterisk 內的 install 和 update scripts
作者: ckleea    時間: 2013-12-11 06:41

回復 18# 角色

有不同Windows VNC 選擇,如 vncviewer, ultraVNCviewer ,tightVNC, 個人喜好最重要。

我選 portable 版本

http://portableapps.com/node/11285

http://portableapps.com/node/2031
作者: ckleea    時間: 2013-12-11 06:47

好想没有ComNet Phone。

如果ComNet Phone出现No Authentication,等我有空写一个script,然后通过cron jo ...
角色 發表於 2013-12-10 23:55


對 ,版本是洗沒有實際的 sip trunk,需要網友自己加入自己的 ComNet Phone, NWT, HKBN 2B 或 SPA 3000/3102 資料。
作者: 角色    時間: 2013-12-11 13:28

回復 22# ckleea

其实已经有一个非常好开始,这可以让非常多的人“快速”入门。
作者: bubblestar    時間: 2013-12-11 22:19

基本的運行是沒有問題的,我把舊的Asterisk 設定蓋在上面而能馬上運作的了。

sSMTP,fail2ban 都已裝好,現在我尚欠3G dongle SMS 及 3G 上網未作測試,而WiFi 上網是沒有問題的。
作者: 角色    時間: 2013-12-11 22:43

回復 24# bubblestar

WiFi你怎样连接呢?
作者: ckleea    時間: 2013-12-12 11:04

回復 25# 角色

設定應該不太難
但要
1. 參考及配置合適的 USB Wifi dongle http://elinux.org/RPi_USB_Wi-Fi_Adapters
2. 想設定為 wireless lan adaptor to access 網絡,或
3. 設定為 hotspot

相信每種功能都想要。

希望遲少少找到隻USB Wifi dongle試試,然後 post 出設定
作者: bubblestar    時間: 2013-12-12 11:20

回復 25# 角色


   
我是用這個設備:

TP-LINK TL-WN823N 300Mbps Mini Wireless N USB Adapter

http://www.tp-link.com/en/products/details/?model=TL-WN823N#spec

TL-WN823N-02.jpg

我選它是因為隻WiFi Dongle 不需特別去裝driver,RaspberryPI 已可以認到,減少麻煩,其次,我也看中它是因為它提供了

•300Mbps wireless speed 就算減半, 理論上也有 150Mbps 啩
•SoftAP Mode – Turn a wired internet connection to a PC or Laptop into a Wi-Fi hotspot 在 RasperryPI 未試此功能,但可塑性高
•Easily setup a secure wireless connection with one-touch WPS button 未試,但在Windows 使用時,也會增添方便。

此品牌旗下還有其它更細小的Dongle 都可以使用的,只是賣70-80港元左右,算抵玩,但它們都多數只提供150Mbps,以現時及未來使用上計,我才選上WN823N,也不算太大隻,售價大概110-130之間罷了。大陸買應可以平很多,但我不想麻煩,大費周章,所以.......

入正題,WiFi 設定:

1. 插入Wifi Dongle,使用ifconfig,掃瞄附近的 AP,看看wlan0有沒有被認來
  1. sudo iwlist wlan0 scan 或這
  2. sudo iwlist wlan0 scan | grep SSID
複製代碼
如果有掃瞄到,代表有正確的驅動起來,

2. 現在連上無線AP,Edit interfaces
   sudo nano /etc/network/interfaces ,然後加入以下設定
  1. auto lo
  2. iface lo inet loopback
  3. #如果eth0 如果搵唔到, 可以試著把它打開
  4. auto eth0
  5. iface eth0 inet dhcp
  6. #自動開啟wlan0
  7. auto wlan0
  8. allow-hotplug wlan0
  9. #使用dhcp配置
  10. iface wlan0 inet dhcp
  11. #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
  12. #iface default inet dhcp
  13. # wpa 檔案放在這裡
  14. wpa-conf /etc/wpa.conf
複製代碼
3. 新增一個 wpa.conf 檔
     sudo nano /etc/wpa.conf,鍵入以下內容,SSID = 改成自己的SSID, PSK 改成自己的密碼。
  1. network={
  2.   ssid="MyAP"
  3.   proto=RSN
  4.   key_mgmt=WPA-PSK
  5.   pairwise=CCMP TKIP
  6.   group=CCMP TKIP
  7.   psk="12345678"
  8. }
複製代碼
不過,這個PSK是明碼,不太安全,所以可以使用 wpa_passphrase 把密碼加密一下。

在command line 輸入格或是 wpa_passphrase <ssid> [passphrase]

例如:
  1. wpa_passphrase MyAP 12345678
複製代碼
  1. network={
  2.   ssid="MyAp"
  3.     #psk="12345678"
  4.     psk=b2449175398db27f75a0790f780cdacd0cbf8529e9e29fa051bdf3248f1fd595
  5. }
複製代碼
再把它產生出來的 psk 這段code 貼入wpa.conf中就可以啦,當一切完成後, 重新reboot應該就可以使用了。

圖片附件: TL-WN823N-02.jpg (2013-12-12 10:51, 12.22 KB) / 下載次數 808
http://www.telecom-cafe.com/forum/attachment.php?aid=3022&k=f1f1d9f64c376108c8111e7799bf72d5&t=1713895373&sid=8Kbb6H


作者: bubblestar    時間: 2013-12-12 11:30

第二版本的image 修改/增加或 fix-bug 了什麼功能,可否簡單地概述一下。  THANKS!
作者: ckleea    時間: 2013-12-12 13:47

發展有部份scripts 有問題,所以未夠一日就放出另一 Image。

但已試了pptp VPN;和backup scripts,可以將wifi 部份加上去先。

另外,已內置了USB 3G 手指 Dial up 上網功能。
作者: ckleea    時間: 2013-12-12 13:50

有空的話,會 clean up asterisk config scripts,因為太多不必要的 sample codes
作者: 角色    時間: 2013-12-12 13:53

建议除了日期去分版本,建议用第几版,像我那样,我用的是第二版,日期我也忘记。

<name_of_image>-<version nunber>-<date> or
<name_of_image>-<date>-<version number>
作者: bubblestar    時間: 2013-12-12 15:13

我第一時間用了第一版,都要update 到第二版了,Thanks
作者: ckleea    時間: 2013-12-12 16:23

回復 32# bubblestar

等等先,過一兩日會出
作者: ckleea    時間: 2013-12-12 17:01

建议除了日期去分版本,建议用第几版,像我那样,我用的是第二版,日期我也忘记。

-- or
-- ...
角色 發表於 2013-12-12 13:53



    試下係Image 內加個text file 或者其他方法
作者: lawleo    時間: 2013-12-13 12:32

謝謝.... 我一直用 asterisk 18 (No GUI) + ComNet, 沒有甚麼大問題(只是 peer 與 peer 之間無聲),請問如果推倒重練,使用這個版本好用嗎?
作者: ckleea    時間: 2013-12-13 13:41

回復 35# lawleo


換張新的 8GB SD Card先試下。基本上,asterisk 設定全部放在 /etc/asterisk 內。
copy and paste 已經可以用,但 log 會有D depreciated errors。

點解 peer to peer 冇聲?

是否 NAT issues ?
作者: ckleea    時間: 2013-12-13 13:49

舊版本不會在 google drive 出現。

現在最新版本會在這帖主題出現和有3 樓下載。

基本上,現在的更新是將一些我已經下載,但未裝好的程式,整理好。所以不算是 bug fixed 版。雖然的確有少少 scripts 改動。

個人相信已經差不多完成 (除了 OpenVPN, IPTables 和 Wifi)。

下一部是簡化 asterisk config files,太多、太長。

注意:跟隨 asterisk 11 版的原裝 config files 已經放在 /etc/asterisk.samples
作者: bubblestar    時間: 2013-12-13 21:45

剛剛試做Asterisk update,做到以下步驟有問題:

svn update 順利
./configure 順利
make menuselect 順利
make 出現以下 error
  1. CC="cc" CXX="" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
  2. make[1]: Entering directory `/usr/src/asterisk/asterisk11/menuselect'
  3. make[1]: `makeopts' is up to date.
  4. make[1]: Leaving directory `/usr/src/asterisk/asterisk11/menuselect'
  5. Generating input for menuselect ...
  6. menuselect/menuselect --check-deps menuselect.makeopts
  7. Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
  8. menuselect/menuselect --check-deps menuselect.makeopts
  9. Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
  10. Generating embedded module rules ...
  11.    [CC] res_fax_spandsp.c -> res_fax_spandsp.o
  12. res_fax_spandsp.c: In function ‘spandsp_v21_new’:
  13. res_fax_spandsp.c:470:52: error: ‘MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE’ undeclared (first use in this function)
  14. res_fax_spandsp.c:470:52: note: each undeclared identifier is reported only once for each function it appears in
  15. res_fax_spandsp.c: In function ‘spandsp_fax_gateway_start’:
  16. res_fax_spandsp.c:774:36: error: ‘t38_gateway_state_t’ has no member named ‘t38’
  17. res_fax_spandsp.c:825:43: error: ‘t38_gateway_state_t’ has no member named ‘t38’
  18. res_fax_spandsp.c:825:83: error: ‘t38_gateway_state_t’ has no member named ‘t38’
  19. make[1]: *** [res_fax_spandsp.o] Error 1
  20. make: *** [res] Error 2
複製代碼
我早兩天用第一版本試過同樣步驟 UPDATE 沒有問題,非常順利,現在用最新第三版,便出現error,ckleea 師兄,你可否試做一次Asterisk update,看看有沒有問題?

Many thanks
作者: bubblestar    時間: 2013-12-13 21:47

似乎係 res_fax_spandsp 呢個有問題 ...
作者: bubblestar    時間: 2013-12-13 21:51

如果唔 compile 呢個 res_fax_spandsp ,對 fax 功能有無影響 ?
作者: ckleea    時間: 2013-12-13 22:45

fax 功能未試。
作者: ckleea    時間: 2013-12-13 22:47

如果在 command line 輸入 apt-get upgrade,有下面的更新
  1. The following packages have been kept back:
  2.   pypy-upstream
  3. The following packages will be upgraded:
  4.   libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 libsmbclient libv4l-0 libv4lconvert0 libwbclient0
  5.   omxplayer raspberrypi-bootloader samba samba-common samba-common-bin scratch smbclient
  6. 15 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
  7. Need to get 108 MB of archives.
  8. After this operation, 1,468 kB of additional disk space will be used.
  9. Do you want to continue [Y/n]? y
  10. Get:1 http://archive.raspberrypi.org/debian/ wheezy/main libv4l-0 armhf 1.0.0-1 [61.9 kB]
  11. Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main samba armhf 2:3.6.6-6+deb7u2 [3,301 kB]
  12. Get:3 http://archive.raspberrypi.org/debian/ wheezy/main libv4lconvert0 armhf 1.0.0-1 [97.3 kB]
  13. Get:4 http://archive.raspberrypi.org/debian/ wheezy/main omxplayer armhf 0.3.3~git20131119~9b52cee [3,222 kB]
  14. Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libwbclient0 armhf 2:3.6.6-6+deb7u2 [90.6 kB]
  15. Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main smbclient armhf 2:3.6.6-6+deb7u2 [4,596 kB]
  16. Get:7 http://mirrordirector.raspbian.org/raspbian/ wheezy/main samba-common all 2:3.6.6-6+deb7u2 [213 kB]
  17. Get:8 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libsmbclient armhf 2:3.6.6-6+deb7u2 [1,259 kB]
  18. Get:9 http://mirrordirector.raspbian.org/raspbian/ wheezy/main samba-common-bin armhf 2:3.6.6-6+deb7u2 [2,683 kB]
  19. Get:10 http://archive.raspberrypi.org/debian/ wheezy/main scratch all 1.4.20131203-1 [30.8 MB]
  20. Get:11 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi-dev armhf 1.20131209-1 [678 kB]
  21. Get:12 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi-doc armhf 1.20131209-1 [31.5 MB]
  22. Get:13 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi-bin armhf 1.20131209-1 [219 kB]
  23. Get:14 http://archive.raspberrypi.org/debian/ wheezy/main libraspberrypi0 armhf 1.20131209-1 [445 kB]
  24. Get:15 http://archive.raspberrypi.org/debian/ wheezy/main raspberrypi-bootloader armhf 1.20131209-1 [28.7 MB]
複製代碼

作者: bubblestar    時間: 2013-12-13 22:57

apt-get upgrade 都已經做了。

但我發覺 res_fax 跟 res_fax_spandsp 是不能共存的 (conflicts and mutually exclusive),現在我
disable 後者再compile  一次,似乎去的很順利了。
作者: 角色    時間: 2013-12-14 09:03

哗噻!估计有不少的CDROM都注视这幅帖子!

特别之处就是能把Raspberry Pi发挥得淋漓尽致!3G手指上网、VoIP Trunk也可以。(如果把两个功能都结合在一个3G modem里,就更加好了!)

其实这个imaging,估计再会是一张super image。如果能把Skype放入去就。。。。。
作者: 角色    時間: 2013-12-14 09:59

如果架上SSTP和OpenVPN后就更加不得了!
作者: ckleea    時間: 2013-12-14 10:30

將最少的資源和免費軟件組合成超簡單系統,但唯一我不能像其他的image,可以再方便大家用 wizard 安裝自已的設定和 package
作者: ckleea    時間: 2013-12-14 11:24

回復 38# bubblestar


    跟進中
作者: ckleea    時間: 2013-12-14 11:25

回復 45# 角色

SSTP 比較簡單
作者: ckleea    時間: 2013-12-14 12:45

回復 38# bubblestar

應該是簡單問題,遲一些會有一個新版本。
作者: 角色    時間: 2013-12-14 14:56

在第三post的下载地址没有link!
作者: 角色    時間: 2013-12-14 16:19

忘了,如果加上ET263和点易通就更加好了!!!!!
作者: 角色    時間: 2013-12-14 16:29

建议CK你之前学过购买篇,加上链接,那么后来的members看了知道在哪里购买。
作者: ckleea    時間: 2013-12-14 17:02

回復 50# 角色

因為要解決 bubblestar 兄提出的問題,已知道問題所在,在 compile 中。

另外,softether 有些問題,所以跟進中。
作者: ckleea    時間: 2013-12-14 17:03

回復 51# 角色

請指示帖子加進
作者: 角色    時間: 2013-12-14 23:39

CK,跟member测试你的系统,分别注册6000和6001,但是不能互打,主要愿你的的HKBN2b trunk dialplan问题,X., where includes 6001/6000, 转到2b trunk,所以不能互打。
作者: ckleea    時間: 2013-12-15 05:44

本帖最後由 ckleea 於 2013-12-15 05:53 編輯

回復 55# 角色
謝謝,因沒有跟進試。
請手動更改 /etc/asterisk/extensions.conf
exten = _9X.,1,Macro(trunkdial-failover-0.3,${trunk_2}/${EXTEN:1},,trunk_2,)
或在 GUI 改
screenshot.15-12-2013 05.45.51.png

可能將看的版本會改為 請跟某帖自行加入。

圖片附件: screenshot.15-12-2013 05.45.51.png (2013-12-15 05:51, 16.92 KB) / 下載次數 730
http://www.telecom-cafe.com/forum/attachment.php?aid=3057&k=eaa29473171f26ada7727b674d5975f6&t=1713895373&sid=8Kbb6H


作者: 角色    時間: 2013-12-15 08:59

回復 56# ckleea

CK,我建议下个version,可以这样做。

所有HK VoIP Trunks一律先用00852做Prefix,如果多个member自己更加(附上简单例子),但是在default dialplan不加入,用帖子说明怎样加入那条trunk。还有member也不会像我们有那个多trunks,都是简单使用。
作者: ckleea    時間: 2013-12-15 14:47

回復  ckleea

CK,我建议下个version,可以这样做。

所有HK VoIP Trunks一律先用00852做Prefix,如果多 ...
角色 發表於 2013-12-15 08:59



明白,已更新
作者: ckleea    時間: 2013-12-15 16:14

除跟進先前的bugs 外,另加上 NS, NTFS 和 HFS+ 支援,還有加入 Proftpd server 供 FTP
作者: ckleea    時間: 2013-12-15 16:14

請看根目錄的 Readme
作者: ckleea    時間: 2013-12-15 19:09

原來更新了 Asterisk 後, chan_dongle.so 又不運作
作者: bubblestar    時間: 2013-12-15 22:54

本帖最後由 bubblestar 於 2013-12-15 22:58 編輯

You may try to add MiniDLNA as media server.

Installation steps:

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=16352

Configuration example:

https://wiki.archlinux.org/index.php/MiniDLNA#Configuration

A more simple installation and set up:

http://aymerick.com/2013/09/21/mini_dlna_on_raspberrypi.html
作者: 角色    時間: 2013-12-15 23:00

本帖最後由 角色 於 2013-12-16 00:07 編輯

SoftEther 怎样打开?

(因为很久都没有SoftEther,所以不记得怎样连SoftEther Server。其实要用PC安装Windows SoftEther Client,然后去连接)

但是怎样从Windows的SoftEther VPN Server Manager去login Softher VPN Server呢?

找到答案了。

1. 在http://www.softether.org,下载Windows的Windows SoftEther VPN Server Manager。

2. 安装上面的软件,在桌面上寻找SoftEther的Icon,然后点击那个icon。

3.
1117a.gif

4. 密码:raspberrypi
1117b.gif

5.
1117c.gif

6.
1117d.gif

圖片附件: 1117a.gif (2013-12-16 00:06, 27.61 KB) / 下載次數 922
http://www.telecom-cafe.com/forum/attachment.php?aid=3064&k=811fa58ee1a8eb50f53bafa1b213b9fe&t=1713895373&sid=8Kbb6H



圖片附件: 1117b.gif (2013-12-16 00:06, 33.11 KB) / 下載次數 732
http://www.telecom-cafe.com/forum/attachment.php?aid=3065&k=d2cdd41f121e7bbff431d713b3f2d96c&t=1713895373&sid=8Kbb6H



圖片附件: 1117c.gif (2013-12-16 00:06, 28.95 KB) / 下載次數 747
http://www.telecom-cafe.com/forum/attachment.php?aid=3066&k=9f65bcda62b1cd5308ce78e9f032ce2a&t=1713895373&sid=8Kbb6H



圖片附件: 1117d.gif (2013-12-16 00:06, 44.03 KB) / 下載次數 717
http://www.telecom-cafe.com/forum/attachment.php?aid=3067&k=7e31e8ec994edfc561e793da7bc7f477&t=1713895373&sid=8Kbb6H


作者: SuiYan    時間: 2013-12-15 23:08

今日去買左張8G卡返來, 準備坐享其成之際,
咦.. 無左條下載link既.?
作者: 角色    時間: 2013-12-15 23:11

哈哈!楼主忙于真理image嘛!
作者: ckleea    時間: 2013-12-16 06:40

回復 65# 角色

等等,新版會加入更多實用功能。基本上代替了用緊的 Centos server 和 NAS。唯一裝不到 Skype

注意: Raspberry Pi CPU 始終是有限,不要期望太高。
作者: ckleea    時間: 2013-12-16 09:38

PDF 列印支援,有中文!

244_-_Powered_by_Discuz_.pdf (600.2 KB)

附件: 244_-_Powered_by_Discuz_.pdf (2013-12-16 09:37, 600.2 KB) / 下載次數 1656
http://www.telecom-cafe.com/forum/attachment.php?aid=3068&k=ca75c68ef427f940d0a60ec380d6a620&t=1713895373&sid=8Kbb6H
作者: ckleea    時間: 2013-12-16 14:24

本帖最後由 ckleea 於 2013-12-16 18:45 編輯

Web based Fax Frontend 已建立

screenshot.16-12-2013 13.44.16.png

已肯定可以正確經 asterisk 運作

圖片附件: screenshot.16-12-2013 13.44.16.png (2013-12-16 14:24, 31.98 KB) / 下載次數 740
http://www.telecom-cafe.com/forum/attachment.php?aid=3069&k=f01f523f4c67923c35e11b0bf21046f2&t=1713895373&sid=8Kbb6H


作者: orangelau    時間: 2013-12-17 02:10

我已安裝20131210版。
(1)這版本是否已安裝miniSipServer,如已安裝,我打開唔到,方法:http://yourip:8080/
(2)我想用obi110連接asterisk server,把pstn電話線連入asterisk及連接無線電話,請問應怎設定。
(3)我已自行加ext.6003, 設定跟6001一樣,我在obi110內的sip設定內加入6003,但它說設定有問題,問題出在那裡?
作者: ckleea    時間: 2013-12-17 05:58

回復 69# orangelau

yourip is your raspberry lan ip

obi的設定未試
asterisk extensions 的問題是 demo sip trunk  ,在dailplan 取消 HKBN2B或 改 HKBN outgoing rule 由 _X. 為 _00852. 就可以
作者: Qnewbie    時間: 2013-12-17 06:25

The link for download is gone
作者: orangelau    時間: 2013-12-17 11:17

ipaddress 已改raspberry Pi 的,但進入不到,會是什麼原因?
作者: ckleea    時間: 2013-12-17 12:03

回復 72# orangelau

可能係系統起動時未 enable 。

試下 Putty login 後,打  /opt/sipserver/msscli&;然後 login

你的版本是早期的,可能未做好。
作者: ckleea    時間: 2013-12-17 22:13

Latest asterisk security fixes

Latest Asterisk 11.X.png

圖片附件: Latest Asterisk 11.X.png (2013-12-17 22:13, 8.05 KB) / 下載次數 790
http://www.telecom-cafe.com/forum/attachment.php?aid=3070&k=da39a0b0e4f33041a0fef942381ac1e7&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-17 22:18

究竟自家製 VOIP Asterisk with Dongle Support Raspberry Pi Image 安排了甚麼?

請看看下面

Services at bootup.png

圖片附件: Services at bootup.png (2013-12-17 22:18, 9.42 KB) / 下載次數 775
http://www.telecom-cafe.com/forum/attachment.php?aid=3071&k=f6578aa07b157a13894e5295cba1905b&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-17 22:20

本帖最後由 ckleea 於 2013-12-17 22:21 編輯

想知道 asterisk內 有甚麼 codecs?

asterisk-codecs.png

圖片附件: asterisk-codecs.png (2013-12-17 22:20, 12.74 KB) / 下載次數 638
http://www.telecom-cafe.com/forum/attachment.php?aid=3072&k=2eec9935c0706dd274cff8eec153a231&t=1713895373&sid=8Kbb6H


作者: 角色    時間: 2013-12-17 22:47

哗噻!G729在ARM里也有!
作者: ckleea    時間: 2013-12-18 06:10

回復 77# 角色

是的。下面是CPU utilizations

g729 echo test -1.png g729 echo test -2.png

圖片附件: g729 echo test -1.png (2013-12-18 06:10, 69.84 KB) / 下載次數 641
http://www.telecom-cafe.com/forum/attachment.php?aid=3073&k=37550c8ce945beb6d199a7d894d3d3f3&t=1713895373&sid=8Kbb6H



圖片附件: g729 echo test -2.png (2013-12-18 06:10, 68.5 KB) / 下載次數 651
http://www.telecom-cafe.com/forum/attachment.php?aid=3074&k=316dae477f9b867479bfd5c8285679ba&t=1713895373&sid=8Kbb6H


作者: 浮雲1965    時間: 2013-12-18 17:19

請問你們將Raspberry Pi + 3G modem放在大陸,然後連接香港的Asterisk server, 可以收發sms嗎?有連接香港手機網絡的API發sms嗎?
Raspberry Pi 除了超級省電外,有什麼特別好處?

謝謝!
作者: ckleea    時間: 2013-12-18 17:44

回復 79# 浮雲1965
如果你要在香港發 SMS,USB 3G dongle 手指就放在香港。要透過同一server 的sms gateway送出 SMS。

中文短訊現在未知道怎樣發。
作者: orangelau    時間: 2013-12-18 18:43

回復 73# ckleea

Screen Shot 2013-12-18 at 6.36.33 pm.JPEG

都係唔得

圖片附件: Screen Shot 2013-12-18 at 6.36.33 pm.JPEG (2013-12-18 18:42, 16.82 KB) / 下載次數 718
http://www.telecom-cafe.com/forum/attachment.php?aid=3075&k=d24782a600b8ddce9c8a07ad9a0a991c&t=1713895373&sid=8Kbb6H


作者: ckleea    時間: 2013-12-18 19:28

回復 81# orangelau


    /opt/sipserver/msscli &
作者: 角色    時間: 2013-12-19 22:29

在3#的link,用什么browser也看不到,其他member是否能看到呢?

1121.gif

圖片附件: 1121.gif (2013-12-19 22:29, 5.28 KB) / 下載次數 624
http://www.telecom-cafe.com/forum/attachment.php?aid=3078&k=298e626fa2af0b2cb578e176bfee5bd3&t=1713895373&sid=8Kbb6H


作者: Qnewbie    時間: 2013-12-20 04:37

Unfortunately, I don't have self-powered USB hub. There is not plug-in dongle. Asterisk seems to be reloaded every few minutes.

Is it possible to unload the dongle module just like
  1. module unload chan_dongle.so
複製代碼
As dongle.conf, dongle_extensions.conf and extensions-dongle.conf are configured, it might be low-priority in the wish-list.
作者: ckleea    時間: 2013-12-20 05:51

回復 84# Qnewbie

請留意自家製的目的asterisk + USB 3G 上網手指,所以沒有 上網手指可以考慮在 /etc/asterisk/modules加入
unload chan_dongle.so

或在/usr/lib/asterisk/modules,移除 chan_dongle.so

其他功能是因應最想有的去加入,如 sms gateway 應用於上網手指,fax gateway。

其實如果有時間的話,可以去raspberrry pi 官方論壇,就可以找到自己想要的功能,然後加上去。
作者: ckleea    時間: 2013-12-20 05:54

回復 83# 角色

我未發放嗎!先前做的版本不太滿意,所以要收起,遲些更新後才發放,
作者: ckleea    時間: 2013-12-20 07:19

防火牆 Iptables 參考例子
  1. # Firewall configuration written by system-config-firewall
  2. # Manual customization of this file is not recommended.
  3. *filter
  4. :INPUT ACCEPT [0:0]
  5. :FORWARD ACCEPT [0:0]
  6. :OUTPUT ACCEPT [0:0]
  7. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  8. -A INPUT -p icmp -j ACCEPT
  9. -A INPUT -i lo -j ACCEPT

  10. # VPN
  11. -A INPUT -m state --state NEW -m tcp -p tcp --dport 47 -m comment --comment "PPTP" -j ACCEPT
  12. -A INPUT -m state --state NEW -m tcp -p tcp --dport 1723 -m comment --comment "PPTP" -j ACCEPT
  13. -A INPUT -m state --state NEW -m udp -p udp --dport 500 -m comment --comment "IPSEC" -j ACCEPT

  14. # FTP
  15. -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -m comment --comment "FTP" -j ACCEPT

  16. # SSH
  17. -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -m comment --comment "SSH" -j ACCEPT

  18. # allow time sync via NTP for lan users (open udp port 123) ##
  19. -A INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 123 -m comment --comment "NTP" -j ACCEPT

  20. # open dns server ports for all #
  21. -A INPUT -m state --state NEW -p udp --dport 53 -m comment --comment "DNS" -j ACCEPT
  22. -A INPUT -m state --state NEW -p tcp --dport 53 -m comment --comment "DNS"-j ACCEPT


  23. # Mail Server
  24. -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -m comment --comment "SMTP" -j ACCEPT
  25. -A INPUT -m state --state NEW -m tcp -p tcp --dport 110 -m comment --comment "POP3" -j ACCEPT
  26. -A INPUT -m state --state NEW -m tcp -p tcp --dport 143 -m comment --comment "IMAP" -j ACCEPT

  27. # Squid
  28. -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -m comment --comment "Proxy" -j ACCEPT


  29. # WEB SERVER
  30. -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -m comment --comment "HTTP" -j ACCEPT
  31. -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -m comment --comment "HTTPS" -j ACCEPT

  32. # WEB SERVER with WebDAV support
  33. -A INPUT -m state --state NEW -m tcp -p tcp --dport 1980 -m comment --comment "HTTP with WebDAV" -j ACCEPT

  34. #NETAFP
  35. -A INPUT -m state --state NEW -m tcp -p tcp --dport 548 -m comment --comment "NETAFP" -j ACCEPT
  36. -A INPUT -m state --state NEW -m udp -p udp --dport 548 -m comment --comment "NETAFP" -j ACCEPT
  37. -A INPUT -m state --state NEW -m tcp -p tcp --dport 5353 -m comment --comment "NETAFP" -j ACCEPT
  38. -A INPUT -m state --state NEW -m udp -p udp --dport 5353 -m comment --comment "NETAFP" -j ACCEPT
  39. -A INPUT -m state --state NEW -m tcp -p tcp --dport 5354 -m comment --comment "NETAFP" -j ACCEPT
  40. -A INPUT -m state --state NEW -m udp -p udp --dport 5354 -m comment --comment "NETAFP" -j ACCEPT

  41. # VOIP Ports
  42. -A INPUT -m state --state NEW -m tcp -p tcp --dport 3478 -m comment --comment "Stun TCP" -j ACCEPT
  43. -A INPUT -m state --state NEW -m udp -p udp --dport 3478 -m comment --comment "Stun UDP" -j ACCEPT
  44. -A INPUT -m state --state NEW -m udp -p udp --dport 5060:5080 -m comment --comment "SIP UDP" -j ACCEPT
  45. -A INPUT -m state --state NEW -m tcp -p tcp --dport 5060:5080 -m comment --comment "SIP TCP" -j ACCEPT
  46. -A INPUT -m state --state NEW -m udp -p udp --dport 4569 -m comment --comment "IAX2" -j ACCEPT
  47. -A INPUT -m state --state NEW -m udp -p udp --dport 5036 -m comment --comment "IAX" -j ACCEPT
  48. -A INPUT -m state --state NEW -m udp -p udp --dport 10000:20000 -m comment --comment "RTP" -j ACCEPT
  49. -A INPUT -m state --state NEW -m udp -p udp --dport 2727 -m comment --comment "MGCP" -j ACCEPT

  50. # Asterisk GUI
  51. -A INPUT -m state --state NEW -m tcp -p tcp --dport 5038 -m comment --comment "AMI" -j ACCEPT
  52. -A INPUT -m state --state NEW -m tcp -p tcp --dport 8088 -m comment --comment "GUI" -j ACCEPT

  53. # VNC
  54. -A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -m comment --comment "VNC" -j ACCEPT

  55. # RDP
  56. -A INPUT -m state --state NEW -m tcp -p tcp --dport 3389 -m comment --comment "RDP" -j ACCEPT

  57. # webmin
  58. -A INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -m comment --comment "Webmin" -j ACCEPT

  59. # NFS
  60. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 111 -m comment --comment "NFS" -j ACCEPT
  61. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 111 -m comment --comment "NFS" -j ACCEPT
  62. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 2049 -m comment --comment "NFS" -j ACCEPT
  63. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 32803 -m comment --comment "NFS" -j ACCEPT
  64. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 32769 -m comment --comment "NFS" -j ACCEPT
  65. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 892 -m comment --comment "NFS" -j ACCEPT
  66. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 892 -m comment --comment "NFS" -j ACCEPT
  67. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 875 -m comment --comment "NFS" -j ACCEPT
  68. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 875 -m comment --comment "NFS" -j ACCEPT
  69. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 662 -m comment --comment "NFS" -j ACCEPT
  70. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 662 -m comment --comment "NFS" -j ACCEPT

  71. # Samba AD
  72. #-A INPUT -m udp -p udp --dport 53 -m comment --comment "DNS" -j ACCEPT
  73. #-A INPUT -m udp -p udp --dport 123 -m comment --comment "NTP" -j ACCEPT
  74. #-A INPUT -m udp -p udp --dport 135 -m comment --comment "RPC UDP" -j ACCEPT
  75. #-A INPUT -m udp -p udp --dport 138 -m comment --comment "NetBIOS Netlogon and Browsing" -j ACCEPT
  76. #-A INPUT -m udp -p udp --dport 389 -m comment --comment "LDAP UDP" -j ACCEPT
  77. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 88 -m comment --comment "Kerberos" -j ACCEPT
  78. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 464 -m comment --comment "Kerberos Password Management" -j ACCEPT
  79. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -m comment --comment "NetBIOS Session" -j ACCEPT
  80. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -m comment --comment "SMB CIFS" -j ACCEPT
  81. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 389 -m comment --comment "LDAP TCP" -j ACCEPT
  82. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 636 -m comment --comment "LDAP SSL" -j ACCEPT
  83. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 3268 -m comment --comment "LDAP Global Catalog" -j ACCEPT
  84. #-A INPUT -m state --state NEW -m tcp -p tcp --dport 3269 -m comment --comment "LDAP Global Catalog SSL" -j ACCEPT

  85. # Samba 4.x
  86. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 389 -m comment --comment "LDAP" -j ACCEPT
  87. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 389 -m comment --comment "LDAP (UDP)" -j ACCEPT
  88. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 636 -m comment --comment "LDAPS" -j ACCEPT
  89. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 53  -m comment --comment "DNS (TCP)"  -j ACCEPT
  90. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 53 -m comment --comment "DNS (UDP)" -j ACCEPT
  91. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 88 -m comment --comment "Kerberos (TCP)" -j ACCEPT
  92. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 88 -m comment --comment "Kerberos (UDP)" -j ACCEPT
  93. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 464 -m comment --comment "Kerberos Password (TCP)" -j ACCEPT
  94. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 464 -m comment --comment "Kerberos Password (UDP)" -j ACCEPT
  95. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 135 -m comment --comment "RPC" -j ACCEPT
  96. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 137 -m comment --comment "NetBIOS Name Service" -j ACCEPT
  97. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 138 -m comment --comment "NetBIOS Datagram Service" -j ACCEPT
  98. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 139 -m comment --comment "NetBIOS Session Service" -j ACCEPT
  99. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 445 -m comment --comment "MS Directory Service" -j ACCEPT
  100. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 3268 -m comment --comment "MS Global Catalog" -j ACCEPT
  101. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 1024 -m comment --comment "DCOM" -j ACCEPT


  102. # iSCSI
  103. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 3260 -m comment --comment "iSCSI" -j ACCEPT
  104. -A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 3260 -m comment --comment "iSCSI" -j ACCEPT


  105. -A INPUT -j REJECT --reject-with icmp-host-prohibited
  106. -A FORWARD -j REJECT --reject-with icmp-host-prohibited
  107. COMMIT
  108. # Generated by webmin
  109. *mangle
  110. :FORWARD ACCEPT [0:0]
  111. :INPUT ACCEPT [0:0]
  112. :OUTPUT ACCEPT [0:0]
  113. :PREROUTING ACCEPT [0:0]
  114. :POSTROUTING ACCEPT [0:0]
  115. COMMIT
  116. # Completed
  117. # Generated by webmin
  118. *nat
  119. :OUTPUT ACCEPT [0:0]
  120. :PREROUTING ACCEPT [0:0]
  121. :POSTROUTING ACCEPT [0:0]
  122. COMMIT
  123. # Completed
複製代碼

作者: ckleea    時間: 2013-12-20 07:26

Wifi 無線上網和設定 hotspot or access point 會是另一方向,因為細小的 Raspberry Pi 可以放在不同的地方,如果有 wifi 聯網加上 3G,就可以變得更多樣化和便攜。
作者: 亞星    時間: 2013-12-20 18:54

可以接 pstn 嗎?
作者: Qnewbie    時間: 2013-12-20 18:58

回復 89# 亞星


    Yes and No.

Yes: if you have mobile sim-card & voice-enabled 3G dongle.
No: if you want to connect to landline. In this case, you need other ATA like Linksys SPA/Obi110 to bridge landline and asterisk.
作者: ckleea    時間: 2013-12-20 22:15

回復 89# 亞星


    需要接ATA才實現 PSTN
作者: ckleea    時間: 2013-12-21 08:40

可參考下面網頁,設定 Raspberry Pi 為 wireless access point / router

http://sirlagz.net/2012/08/09/ho ... pointrouter-part-1/
作者: 亞星    時間: 2013-12-21 09:08

回復  亞星


    需要接ATA才實現 PSTN
ckleea 發表於 2013-12-20 22:15


隻 IP01 用咗幾年,早兩日 reboot 完起唔返,睇嚟 Raspberry Pi 係唔錯嘅代暮氣替品
作者: ckleea    時間: 2013-12-21 22:49

回復 93# 亞星

用serial cable 看 boot 機log,是否 log files 太大搞到冇 space
作者: ckleea    時間: 2013-12-21 22:52

回復 88# ckleea

已製作一套 wireless access point scripts
作者: 亞星    時間: 2013-12-22 05:44

回復  亞星

用serial cable 看 boot 機log,是否 log files 太大搞到冇 space
ckleea 發表於 2013-12-21 22:49


應該係硬件問題,已經換咗火牛一 login 完過一陣就踢返出嚟。
都係時候學習新嘢,可以用 3G USB+充值卡來代替 PSTN 對於 PSTN 用量少係一個好方案。
作者: Qnewbie    時間: 2013-12-22 07:28

Strange behavior:

In module.conf, add
  1. noload => chan_dongle.so
複製代碼
Asterisk gui login, click "System Info" first and "Call Features" afterwards, the RPi runs into the endless loop, "Waiting for XXX.XXX.XXX.XXX"(RPi's IP).

The asterisk -rvvvc shows:
  1.   == Parsing '/etc/asterisk/dongle_extensions.conf': Found
  2.   == Parsing '/etc/asterisk/extensions_macro.conf': Found
  3.   == Parsing '/etc/asterisk/extensions.conf': Found
複製代碼

作者: ckleea    時間: 2013-12-22 07:31

回復 97# Qnewbie

Strange behaviour. It is related to the extensions_marco.conf that I move out from extensions.conf.

Go to the stock extensions.conf at /etc/asterisk.examples
作者: 角色    時間: 2013-12-22 09:22

回復 97# Qnewbie

Try to use other brand's SD card to see any help.
作者: 角色    時間: 2013-12-22 10:16

回復 96# 亞星

你从新在flash过updated image,应该可以把它救活。

不要浪费那个经典产品 IP-01。




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2