Original Document written By Matthew Mackes, May 30th, 2008
Copyright 2008 Loic Dachary <[email protected]> and Matthew Mackes<[email protected]>, this work is in the public domain.
Build a Wireless Network that will support 4 802.11 WiFi SIP handsets, and one Asterisk PBX, that will record all conversations. This wireless network will span as much as several 100 sq feet depending on the building material used in separating walls, structures, et.
This HOW TO was designed to meet this projects guidelines:
In the context of a role playing game, a set of four phones are used by the players for communications. The game takes place in a hotel or a conference center and the players are in two separate rooms. When the players arrive at their location, the recording phones are plugged in and tested. The game duration is six hours maximum. There is no cable connection between the two rooms.
Each conversation is recorded in separate timestamped files and are available in real time, on a file system or thru a standard networked protocol. The phones are never used for conferences between more than two phones.
The hardware and software solution is designed to work simply and reliably. The installation does not require a technical person and the probability of a malfunction within one game session is less than 1 time out of 10.
The deliverable of this work is two HOWTOs explaining:
A) which hardware should be acquired (phones + computer to store the recordings), which software should be installed and which software needs to be developped to glue the solution togeter. This HOWTO requires strong technical skills and the result of the HOWTO is a ready-to-use solution that can be used with the other HOWTO.
B) how to use the solution created by the first HOWTO, from installation to putting the hardware back in a box. The number of steps must be minized and the knowledge requirements must be nil.
HOW TO: PART ONE, FOR TECHNICAL USER:
(NON-TECHNICAL HOW TO AT END OF DOCUMENT)
Equipment/ Software Required:
Four 802.11 B/G SIP Handsets:
I recommend the Zultys WIP2 WIFI Handset
Zultys WIP2 WIFI:
Here is where the Zultys WIP2 is availible for purchace as of 5/2008:
http://www.neobits.com/zultys_wip_2wi-fi_ip_voip_sip_telephone_p9656.html
There is no evidence of GNU GPL compliance and resellers must consult a lawyer before redistributing this phone as they may be liable for copyright infringement when they do. Please comment here as soon as Zultys clarified the situation.
Unlike most WiFi SIP phones, The Zultys WIP2 is a Business phone, and is designed much like an early 1990’s cell phone. With a larger form factor, it feels like a solid unit, with large readable buttons, and contains all of the features of a full business class desk phone. Each phone includes a full size desk charging cradle, that fits the phone well. These units allow for 2+ hours of continuous use on a full charge, and are easly placed back in their base for all day charging between use.
The WIP2 two allows for easy provisioning via TFTP plain, flat text file named with each units MAC address. By default the searches for a wireless SID named ZULTYS out of the box, or when no other programing has been done on the keypad interface.
We will be using this default provisioning option for our project. We will create 4 text files containing the provisioning information for each of our four WIP2 phones so that if any of the units do lose their programing, they will regain all configuration at the next reboot.
It is important to note that many SIP WiFi phones are available, many of which are not well advertised or well known. Polycom as a very nice SIP WiFi phone that is coming onto the market Summer 2008, and I have had great success with the Hitachi-Cable Wireless IPC-5000AE WiFi SIP Phone.
https://www.voip-info.org/hitachi-wirelessip5000
http://www.polycom.com/usa/en/products/voice/mobile/wi-fi/handsets/spectralink_8002_wireless.html
For this HOW-TO, we will focus on the WIP2
One Wireless Access Point, w/ built in Switch:
For this project I recommend the Linksys-Cisco WRT54G, with DDWRT version DD-WRT v24. Linksys-Cisco has several models Wireless AP that are compatible with DDWRT, all of which are very good products. Linksys also offers an unit model number: WRT54GL has been especially designed by Linksys to support upgrades to thrid party Linux Firmwares. The WRT54GL is a fantastic unit, and a sure bet for DD-WRT. For WiFi Rollout I do with Linksys Products, I prefer the WRT54GL
Almost any Linksys-Cisco WRT54G will do well. Please check this link: http://www.dd-wrt.com/ for a full list of supported versions of routers with DDWRT
Below is a Link to specific instructions for Linksys WRT54G:
We will only be using one access point for our project. One access point will allow for our 4 units to be many feet away from the AP, or several rooms away with an issue.
For larger distances we could use more then one AP by placing the DDWRT -WRT54G in bridging mode, or by connecting several AP’s together via Ethernet cabling.
An antenna upgrade would also allow a single AP to provide greater coverage by directing the signal to a specific direction.
The Linksys-Cisco WRT54G is a great, inexpensive Access Point that has had its processor under clocked and has route able switch ports, definable antenna parameters, and several other possible options with the correct firmware. The correct firmware for this project is DDWRT.
DDWRT is an open source Linksys firmware derivative project that provides a large number of enhancements and services not available in the basic Linksys firmware, at no cost. DDWRT is fully supports the WRT54G, and the upgrade is very easy.
Key Points of this Software for our project:
WRT54G will allow our Wireless Network to be SIP-Aware using a new package/appication named Milkfish.
Milkfish should allow for SIP communications to pass though NAT more easily. This is an evolving part of the DDWRT project. Please visit DDWRT forums for more information on this feature at:
http://www.dd-wrt.com/phpBB2/
WRT54G will allow us to provide DHCP to our SIP handsets, and provide DHCP option 66 to each phone, providing the IP Address of the TFTP server that is providing Configuration files to provision our DHCP handsets at every boot without user intervention
Most importantly DDWRT allows a single AP to have the functionality usually not available in a Single AP, Vlans, QOS, Routing/ Bridging, and required for our project- Stability
Asterisk Server/PBX.
Asterisk Software Distribution:
I strongly recommend Digum’s Sponsored Linux Distribution: AsteriskNow, also called Poundkey.
AsteriskNow is an Rpath Linux Appliance distribution created and updated by Digium. Rpath Linux is a modified version of Redhat Linux.
As a result, AsteriskNow is a modified Redhat Linux Distribution, striped down to a lean, dependable, efficient operating system designed for bare metal server installation with all Asterisk drivers and modules pre complied and installed.
Besides Asterisk, Asterisk Now also includes:
a TFTP demon installed and ready for activation (Required for our WiFi phone provisioning)
MySQL installed (Not Required for this project)
OpenSSH (Required for configuration, and can be used to SFTP files Audio Files from the server)
For our project, I recommend using Poundkey (AsteriskNow) Version 1.2.2.
I have vetted this version in a large deployment, production use with no issues, and several hundred days of continuous uptime, with an average load of 20 – 30 connections at any one time, and call recording.
Server Hardware:
The hardware requirements for Rpath/ Digium AsteriskNow are relatively low. A Pentium 3 with 256 MB of RAM and a 20GB hard disk, with DVDROM (used for installation only) will easily support 20+ concurrent calls, all using the ULAW Codac in a small office environment. For this project we are going to record all calls placed on the system to WAV format, and our SIP connections between our Asterisk PBX and our SIP WiFi handsets will remain ULAW.
I recommend for this project a system with a small amount of extra horsepower simply to allow the machine breathing room while recording/ transcoding.
Intel Pentium 4 3.0 GHZ (Xeon, Single Core would also be a great choice)
1 GB of RAM
1 DVD ROM (For installation use)
250 Gb Harddisk (Larger storage allows for more audio storage as required)
1 Ethernet Interface
For Portability sake, I think a Laptop would be a great choice for this project. The specifications I suggested are available on several model laptops. I recommend not using Centrino based laptops that advertising long battery life. If a laptop is feasible I recommend P4 high MHZ processor with all speed stepping disabled in the BIOS.
We will be connecting our Asterisk Server Hardware to our network via Cat5 Ethernet Cable (RJ45 terminated) directly to our Linksys AP.
The Plan:
Our Linksys-DDWRT wireless Access Point will provide our four WIP2 SIP phones with 802.11 WiFi and will also provide DHCP, with DHCP Option 66 providing TFTP Server (Our Asterisk Server) IP information. No routing will happen on this device, No QOS will be required in that no other devices will be battling for bandwidth. We will leave all encryption off. (Yep, thats right). No WEP. Without a WEP we will be able to provision factory default our SIP phones without any programming. Our total network only consists of 4 phones, and 1 server that does not have any PSTN access.
Our WIP2 phones will be provisioned by TFTP, provided by our Asterisk servers TFTP server
Our Asterisk Server will be loaded with Rpath (Diguim Supported) Poundkey Asterisk Linux Version 1.2.2
This server will be configured without use of a GUI. We will only configure the server using the CLI and configuration files
We will place 4 text files, plus a global file in our TFTP directory that will provision our 4 WIP3 phones.
All IP addressing for the ethernet interface will be set at the operating system installation.
STEP 1: LOAD YOUR ASTERISK SERVER
Asterisk Server Setup:
Install Poundkey Linux (See Above) on your clean hardware. This installation will completely erase the harddrive of this system, and the result will be a complete Asterisk Server Appliance.
During the installation set the IP address of the server to:
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.1
DNS: 192.168.0.1
When asked, please set the user name and password to something memorable. Since this is a small system, with a most 4 caller in use, we will be operating as root.
Once the installation is complete, you will have a full Asterisk server, ready to use, but missing all configuration.
STEP 2: UPLOAD YOUR ASTERISK CONFIGURATION FILES
Upload the provided asterisk configuration files below. Each of these files are complete and may be used to replace the current files installed in /etc/asterisk. As a function of the premise of this installation I will assume that you have setup and Asterisk server in the past (in this example Asterisk 1.2) However, if not many great example are available and http://www.oreilly.com/catalog/9780596009625/
is a fantastic book containing many examples and a full explanation of the Asterisk command language.
If you would like to follow my example verbatim, please cut and paste the examples below replacing all of the information in the default files created by Poundkey.
We need to replace the configuration in 2 Text files.
sip.conf and extensions.conf
And we will need to place four configuration files and one global configuration files in the /tftp folder to provision our Zultys phones.
EXTENSIONS.CONF
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
CONSOLE=Console/dsp
[default]
exten => _1xxx,1,NoOp(CALL IN PROGRESS)
exten => _1xxx,n,Set(CALLERID(name) CALLING FROM ${CALLERID(number)})
exten => _1xxx,n,SetVar(CALLFILENAME=${CALLERID(number)}-CALLED-${EXTEN}-AT-${TIMESTAMP})
exten => _1xxx,n,Monitor(wav,${CALLFILENAME})
exten => _1xxx,n,Dial(SIP/${EXTEN}|35,t)
exten => _1xxx,n,Wait(1.5)
exten => _1xxx,n,Hangup
SIP.CONF EXAMPLE FILE
[general]
port = 5060
bindaddr = 0.0.0.0
;externip=
;externip=
localnet=192.168.0.200/255.255.255.0
srvlookup=yes
disallow=all
;allow=gsm
;allow=ilbc
allow=ulaw
;allow=g723
;allow=g726
;allow=g729
;allow=alaw
;allow=speex
context=default
maxexpirey=60
defaultexpirey=30
tos=reliability
nat=yes
; PHONES
;=================================================================
; WIFI PHONE 1
[1001]
username=1001
type=friend
secret=1001
qualify=no
port=5060
nat=never
mailbox=
host=dynamic
dtmfmode=rfc2833
context=default
canreinvite=yes
callerid=<1001>
; WIFI PHONE 2
[1002]
username=1002
type=friend
secret=1002
qualify=no
port=5060
nat=never
mailbox=
host=dynamic
dtmfmode=rfc2833
context=default
canreinvite=yes
callerid=<1001>
; WIFI PHONE 3
[1003]
username=1003
type=friend
secret=1003
qualify=no
port=5060
nat=never
mailbox=
host=dynamic
dtmfmode=rfc2833
context=default
canreinvite=yes
callerid=<1001>
; WIFI PHONE 4
[1004]
username=1004
type=friend
secret=1004
qualify=no
port=5060
nat=never
mailbox=
host=dynamic
dtmfmode=rfc2833
context=default
canreinvite=yes
callerid=<1001>
STEP 3: SETUP THE PHONE PROVISIONING FILES
Next, we will need to place four configuration files in the /tftp folder. I have provided examples of one of these files below. As you can see, the configuration file provides all of the information a SIP phone would need when first booting. This example will configure the the phone with an extension of XXXX . For our example, we will configure our phone range to use 1001 – 1004. So, in this first configuration file the phone is setup for a username of XXXX and a password of XXXX. Replace the XXXX with the extension for each phone throughout the configuration file. For each additional phone please change the extensions and password accordingly.
Each configuration needs to be cut and pasted into a txt file (one per phone) and each configuration file should be named with the “macaddress.cnf” so,
for example:
000BEA80C3C5.cnf
Capitalization does matter! I have had issues with this in the past. All of the name needs to be in all uppercase, however the extension of the name needs to be in lowercase .cnf
Place these 4 files in the /tftp folder located in the root of your Poundkey Linux installation. All 4 files should be set with full open permissions, all groups.
Example/ base configuration:
[NET_CONFIG]
use_dhcp=yes
ip_addr=
subnet_mask=
default_gateway=
primary_dns=
secondary_dns=
domain=asterisk
sntp_server_addr=
tftp_server_addr=
- tftp_cfg_dir=/
dscp_setting=0
[SIP_CONFIG]
phone_sip_port=5060
rtp_start_port=33000
;This must always be set to yes
register_w_proxy=yes
device_id=XXXX
auth_password=XXXX
encryption=3
display_name=XXXX
registrar_addr=192.168.0.200
registrar_port=5060
proxy_addr=192.168.0.200
proxy_port=5060
;voice_mail_uri=258
registration_expires=3600
[GENERAL_INFO]
;software_version=1.0.0
;The message displayed on the LCD in idle mode
greeting_message=XXXX
password=9399
time_fmt=%H:%M
date_fmt=%m-%-d-%Y
date_time_order=0
;This is the offset from GMT, in minutes
timezone=-480
country=USA
language=en_US.iso88591
clear_settings=2
[HW_CONFIG]
lcd_contrast=11
ring_volume=18
speaker_volume=20
handset_volume=20
;BELOW IS SETUP FOR 570 NORMAL USERS USE:
[AUDIO_INFO]
ext_call_answer=0
int_call_answer=0
ext_ring_tone=4
ext_cust_ring=24.wav
int_ring_tone=4
int_cust_ring=24.wav
ring_tone2=2
cust_ring2=
key_click=1
codec=2
distinctive_ring=no
sound_url=
startup_tone=2
int_call_disconnect=2
ring_vibe_mode=3
[LOCATIONS]
[WIFI_INFO]
power_save_mode=1
It is important to note that Zultys phones DO NOT need to be configured via TFTP for correct operation, however, they do need to be configured. If you would like not to use the TFTP method, you will need to configure the phone via the phones GUI interface on the phone, or via the web interface.
STEP 4: SETUP YOUR LINKSYS AP
The Upgrade of the firmware: I will not go into extreme detail here on this process. The good people at DDWRT have created very good, step by step directions on this process. Also, please review the DDWRT manuals online.
http://www.dd-wrt.com/wiki/index.php/Main_Page
DDWRT as easy to setup as any WEB GUI network device is. Please pay special attention as to how to setup DHCP, DHCP options (we will use option 66) and how to setup WiFi with one SID and no encryption. Any tech who is techically savy enough to work with Linux and Asterisk will have no issue with DDWRT.
http://www.dd-wrt.com/wiki/index.php/Linksys_WRT54G/GL/GS/GX
The Micro version of v24 DDWRT is just fine for our project, however I recommend the VPN version if you would like to take the extra step during the install. DO NOT INSTALL THE ASTERISK VERSION. This version installs Asterisk, or another SIP proxy on your AP. We do not need that nor do we want it.
Once your upgrade is complete, and you have visited the DDWRT site and downloaded, or reviewed the DDWRT manual pages,please log into the default setup of your newly upgraded DDWRT router, and set it up for the LAN IP ADDRESS: (We are not using the WAN port during this install)
192.168.0.1
Netmask 255.255.255.0
DNS: Not Required
Gateway: Not Required
WiFi Configuration:
For your WiFi Setup, we will be not enabling the WEP, or any security. Our Zultys phones will require extra configuration at initial deployment if we use a WEP key. If we do not, the phones will find the Zultys SID, and full our configuration files via TFTP
We need to create a SID with the name zultys (all lower case)
DHCP Configuration:
We need to enable our DHCP server, and create a range of 192.168.0.10 – 192.168.0.20
We would like to setup a DHCP option of 66, with a value of 192.168.0.1
You might want to test access to the AP using a laptop or some other WiFi device. Look for DHCP on the Zultys SID. Once connected attempt to ping the AP at 192.168.0.1
STEP 4: READY TO CONNECT YOUR SMALL LAN TOGETHER
Connect your Asterisk Server to your Linksys router via your Ethernet Cable (Straight Cable, not Cross) to one of the four switch ports on your Linksys Router.
Power on your Asterisk Server
Power on your Linksys AP
Again, you might want to test access to the AP using a laptop or some other WiFi device. Look for DHCP on the Zultys SID. Once connected attempt to ping the AP at 192.168.0.1, and your Asterisk Server at 192.168.0.200
If your test Wireless Device received DHCP, and was able to ping your AP and your Asterisk Server, its time to boot up your Zultys phones!
STEP 5: POWER ON YOUR ZULTYS PHONES
When the phones first power on, they should search for the Zultys SID. We have already tested with our test laptop (or what ever device) that it is online and handing out DHCP.
Once the phone receives DHCP, it will receive option 66 from the DHCP server that will allow the phone to find the TFTP server on your Asterisk server at 192.168.0.200
The phones will ask for a configuration file named by mac address of the phone
The file will be downloaded and installed on the phone.- and boom. Configured phone.
We should be ready to make calls.
Assuming everything has gone well with your TFTP upload to you phones, and your Asterisk configuration files were configured correctly, we should be ready to call from phone to phone. Each call in our configuration will be recorded to a directory on your Asterisk Server, in WAV format.
CALL RECORDINGS
The default recording directory for your server is:
/var/spool/asterisk/monitor/
Calls are placed in this directory in realtime, and are available as soon as the call is disconnected. Each calls recording is visible in this folder as soon as the recording begins, however, I recommend that files in progress should not be accessed for playback unit the current call has ended. All files will also be time stamped by the file system, in the same way any file on an Linux system is timestamped. File size can be monitored during the recording of each call by refreshing a directory listing of /var/spool/asterisk/monitor/ using the cmd ls -l or other remote file mangers you might use Via SSH to connect to your PoundKey Linux Server.
If the example extensions.conf configuration is used as supplied, each call will be recorded, and the resulting file will be named with the extension that called, who they called, and the time and date of the call.
When the call is completed a file will appear in
/var/spool/asterisk/monitor/
Each recording will be named 1xxx-CALLED-1xxx-at-TIMEDATE
HOW TO: PART TWO, FOR NON-TECHNICAL USER:
This Non-Technical How To component of this document assumes that all steps have been completed in the technical How To, and the non technical worker has been provided with the pre programed/ configured equipment.
Step 1: Remove all four Zultys phones from there boxes and and place each phone in its charger. Each phone will require electrical power for its base/ charger so that when not in use each phone can be charged while waiting for incoming calls. Do not power on Phones unit before step 4
Step 2. Connect the Access Point to electrical power via the AC adapter. Connect an Ethernet cable from one switch port on the Linksys AP to the Ethernet port on the Asterisk Server.
Step 3. Assuming that the Asterisk Server is a laptop, unbag laptop, and open lid. Connect the Laptop to electrical power via the laptop AC adapter. Connect the Ethernet port on the Asterisk Server to the Linksys AP via an Ethernet cable if not already done in step 3.
Step 4. Power on Asterisk server (Laptop in this example) The system will fully boot to a text login prompt. At this point the server is ready to connect calls, and record the connected calls.
Step 5: After your phones are fully charged, Power on each unit by holding the green Answer button until boot. Phone will boot into a ready state, displaying its extension on its LCD screen. Once powered on, phone is ready and extension is displayed on the LCD, you are free to send and receive calls.
For Cleanup, Server may be shutdown by pushing the power button on the laptop once, or holding the button in until shutdown. Once shutdown the laptop may be re bagged with AC adapter and ethernet cable.
All phones may be shutdown by holding the Red Hangup button on each phone. Once shutdown each phone may be re boxed with base and AC adapter.
The Wireless AP may be disconnected from power without a shutdown procedure. Please rebag the AP with the AC adapter.
Complete.