返回列表 發帖

【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
2013-12-9 19:21



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 協助

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

我的硬件

P1050985.png
2013-12-14 19:56


Samples Screenshots

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


2. SMS Gateway
screenshot.07-12-2013 22.38.44.png
2013-12-7 22:44


3. Webmin Interface
screenshot.12-12-2013 21.45.22.png
2013-12-12 21:52


4. VNC server
screenshot.12-12-2013 21.54.29.png
2013-12-12 22:01

screenshot.12-12-2013 21.55.14.png
2013-12-12 22:01

screenshot.12-12-2013 21.54.45.png
2013-12-12 22:01
screenshot.07-12-2013 22.35.52.png

TOP

本帖最後由 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

TOP

本帖最後由 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
2013-12-9 19:38

3. 改為
screenshot.09-12-2013 19.33.16.png
2013-12-9 19:39

例如 網友的網絡設定為
<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
2013-12-9 19:41

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
2013-12-12 21:57

3. 成功上網
screenshot.12-12-2013 21.35.39.png
2013-12-12 21:57

TOP

本帖最後由 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
2013-12-10 01:31

2. 更改 SIM Card 電信號碼如cursor 位置
screenshot.10-12-2013 01.17.22.png
2013-12-10 01:31

3. 打開/etc/asterisk/dongle_extensions.conf
更改 SIM Card 電信號碼及電郵地址
screenshot.10-12-2013 01.20.42.png
2013-12-10 01:31



更改 SMTP server address 供電郵 sms

1. 用 putty 登入 Raspberry Pi
2. cd /etc/ssmtp
3. 更改 ssmtp.conf
screenshot.09-12-2013 21.15.53.png
2013-12-9 21:21

跟據gmail user name 設定 修改
screenshot.09-12-2013 21.16.59.png
2013-12-9 21:23

TOP

本帖最後由 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
2013-12-12 21:53

TOP

本帖最後由 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
2013-12-10 06:39


- 雙擊 Manage Virtual Hub "Default"

screenshot.10-12-2013 06.27.18.png
2013-12-10 06:40


- 雙擊 Manage Users

screenshot.10-12-2013 06.27.39.png
2013-12-10 06:40


- 加入 User name 和 password

screenshot.10-12-2013 06.27.50.png
2013-12-10 06:40


- 揀選 enable Open VPN 和 enable MS STP

screenshot.10-12-2013 06.28.19.png
2013-12-10 06:40


-  揀選  enable VON Azure 功能

screenshot.10-12-2013 06.28.43.png
2013-12-10 06:41

- 最重要是更改 Dynamic Host name

screenshot.10-12-2013 06.29.10.png
2013-12-10 06:41


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


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


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


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

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

TOP

本帖最後由 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

TOP

留用 ###8

TOP

留用 ###9

TOP

Is it feasible to install OBiApp in this tiny device?

TOP

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

回復 11# bubblestar

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

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

希望有機會做到!

TOP

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

可以的话,那么member可以在某个version上再加东西,然后楼主可以根据step再把Official version升级。

TOP

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

回復 13# 角色

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

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

TOP

太好了, 等我試試

TOP

返回列表