Check also my previous How-to's:
[How To] Cheap Digital Stereo WiFi Internet Radio & MP3 Player:
(https://forum.openwrt.org/viewtopic.php?id=49013)
and
[How To] Control a simple DIY relay board via internet Web page or SMS:
https://forum.openwrt.org/viewtopic.php … 91#p258891
and
[How To] Web SMS server with OpenWRT:
https://forum.openwrt.org/viewtopic.php?id=60910
------------------------------------------------------
How To create a Voip gateway with OpenWrt Barrier_Breaker + Asterisk11
(don't use chaos calmer, it sucks, many asterisk 11 modules are missing!)
------------------------------------------------------
After reading and testing hundreds of incorrect and/or incomplete How-To's on this subject, I decided to create a serious one!
The Voip gateway has the following features:
SIP extensions (voip phones)
SIP channels (voip providers)
GSM channel (mobile phone line in/out)
SMS channel (mobile SMS in/out)
Voicemail (welcome audio messages + mini-sendmail to send recorded audio messages as mail attachements)
Hardware I used:
TP-Link TL-WR710n
Huawei e169 3G USB dongle
1 GB USB flash ext4 formatted (Overlay)
4 ports external powered USB Hub
Note: use only an external powered USB HUB (5V 1A or more), the Huawey dongle requires 0.5 A, the router itself is not capable of handling such a high current.
You can find my DEMO configuration files and other interesting stuffs @ my site: REMOVED ( under /software/openwrt/)
notes:
in the DEMO configuration files I used Italian language setting (it,IT), you can change it to match your desidered language (ex. en,EN) by editing /etc/asterisk/ configuration files.
The audio sound files (many languages) are here: http://downloads.asterisk.org/pub/telephony/sounds/ , untar and put them on '/var/lib/asterisk/sounds'.
---- [How to] --------------------------------------------------------------------
- External USB Overlay Instructions - OpenWrt Barrier Breaker - (single partition ext4 formatted USB Flash):
opkg update
opkg install kmod-usb-uhci
opkg install kmod-usb-ohci
opkg install kmod-usb2
opkg install kmod-usb-core kmod-usb-storage usbutils block-mount kmod-fs-ext4
Mount the filesystem:
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
Copy contents from /overlay to usb device:
tar -C /overlay -cvf - . | tar -C /mnt/sda1 -xf -
Generate fstab file:
block detect > /etc/config/fstab
Edit fstab file:
vi /etc/config/fstab
change the target to '/overlay'
change enabled option from '0' to '1'
Do not change UUID or other settings!
Reboot and check if everything is OK with the "df -kh" command:
root@OpenWrt:~# df -kh
Filesystem Size Used Available Use% Mounted on
rootfs 802.4M 512.3M 232.5M 69% /
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 14.1M 1.4M 12.7M 10% /tmp
/dev/sda1 802.4M 512.3M 232.5M 69% /overlay
overlayfs:/overlay 802.4M 512.3M 232.5M 69% /
tmpfs 512.0K 0 512.0K 0% /dev
Install the following packages:
opkg update
opkg install mini-sendmail
opkg install asterisk11 asterisk11-app-authenticate asterisk11-app-chanisavail asterisk11-app-chanspy asterisk11-app-directed_pickup asterisk11-app-disa asterisk11-app-exec
opkg install asterisk11-app-mixmonitor asterisk11-app-read asterisk11-app-readexten asterisk11-app-record asterisk11-app-sayunixtime asterisk11-app-senddtmf
opkg install asterisk11-app-sms asterisk11-app-stack asterisk11-app-system asterisk11-app-verbose asterisk11-app-waituntil asterisk11-app-while asterisk11-chan-dongle
opkg install asterisk11-codec-a-mu asterisk11-codec-alaw asterisk11-codec-gsm asterisk11-codec-resample asterisk11-curl asterisk11-format-gsm asterisk11-format-sln
opkg install asterisk11-format-wav asterisk11-format-wav-gsm asterisk11-func-blacklist asterisk11-func-channel asterisk11-func-cut asterisk11-func-devstate
opkg install asterisk11-func-extstate asterisk11-func-global asterisk11-func-groupcount asterisk11-func-shell asterisk11-func-uri asterisk11-pbx-spool asterisk11-res-agi
opkg install asterisk11-res-clioriginate asterisk11-res-xmpp asterisk11-sounds asterisk11-voicemail asterisk11-res-timing-timerfd
Download and copy (overwrite the existing files) the following DEMO configuration files on /etc/asterisk :
REMOVED
note: edit them with your own settings!
disable autostart of asterisk from init.d with the command:
/etc/init.d/asterisk disable
instead put the following lines in your "/etc/rc.local" file:
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
/bin/sleep 10
/etc/init.d/asterisk start
exit 0
note: to avoid problems asterisk has to be started only after the network is up and running (delay=10 seconds).
------------------------------------------------------
Internal DEMO extensions (see extensions.conf):
200: (rings for 20 seconds then hangs up if no answer)
user=200 - password=P@ssword
201: (goes to voicemail after 20 seconds if no answer)
user=201 - password=P@ssword
98: to manage voicemail from the phone
password=1234
Note: you can change passwords by editing sip.conf and voicemail.conf
--------------------------------------------------------
Command to get the Asterisk CLI:
asterisk -vvvr
useful asterisk CLI commands:
OpenWrt*CLI> voicemail show users
OpenWrt*CLI> sip show registry
OpenWrt*CLI> sip show peers
OpenWrt*CLI> dongle show devices
more to follow ...
(Last edited by pilovis on 13 Nov 2015, 13:24)