====== Thirdlane iPBX ======
Thirdlane PBX is a professional GUI management tool for Asterisk. There is a multi-tenant version available.
===== Searching the Forums =====
Searching with google may be preferable to the built-in forum search. Preface a google search with:
site:http://www.thirdlane.com/forum
===== License =====
Licenses are keyed to a hardware MAC address.
If you install the PBX from the .iso, a 30-day license is created.
If you create a backup, then delete these files from the .tar.gz, the temporary license will not be overwritten:
/etc/webmin/asterisk/license-data
/etc/webmin/asterisk/pbxmanager.license
==== Spoof a MAC Address ====
You can spoof the hardware MAC address after a hardware change.
vim /etc/rc.local
ifconfig eth0 down hw ether 00:07:E9:DA:56:01 #specify desired MAC address
ifconfig eth0 up
===== Upgrade Thirdlane =====
From 'Home' page, click the 'check for updates link.
There is always a chance that something will break.
Don't forget to reload.
===== Upgrade Asterisk =====
Be very careful about upgrading the host OS or Asterisk. Avoid doing so if possible.
==== Recompile Asterisk ====
This probably doesn't apply if you used the Thirdlane ISO to install the PBX.
For **asterisk** and **asterisk-addons** you should:
make distclean
./configure
make menuselect
make
make install
===== Tools =====
Enter 'pbx-help' at the command line for a list of some tools.
===== Installation =====
Thirdlane can be installed via an ISO (CD) that packages CentOS, Asterisk and various goodies such as vTiger CRM and the Thirdlane web management interface. Or, you can install any Linux, Asterisk, Webmin plus the Thirdlane Webmin GUI module.
Thirdlane maintains a CentOS 5 repository so updates are easier than before (untested).
Configure a [[networking:linux:static_ip_addr|static IP address]] and default route.
Setup DNS to resolve host 'pbx' to the internal IP address.
yum update -y
==== MySQL ====
If you install via the Thirdlane ISO, the default MySQL password is "passw0rd".
Root password is empty unless you set it:
mysqladmin -u root password 'mypassword'
Reset lost mysql root password:
service mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("new-password-here") where User='root';
flush privileges;
quit
service mysqld restart
==== DAHDI ====
No installation required when using the ISO install as the ISO uses RPM-based packages and Thirdlane repo.
=== Configuration ===
See **[[voice:pbx:dahdi|DAHDI]]**
===== NTP =====
Make PBX ntp server for phone network:
vim /etc/ntp.conf
# Hosts on local network are less restricted.
restrict 192.168.30.0 mask 255.255.255.0 nomodify notrap
broadcast 192.168.30.255
service ntpd restart
netstat -uapn|grep 123
===== DHCP Server =====
FIXME
===== Music on Hold =====
See **[[voice:pbx:moh|Music on Hold]]**
===== Configuration =====
==== System Settings ====
Branding
Upload Logo (150x60 px)
Logo URL
Network
eth0 (LAN)
Addressing
192.168.1.30
Hostname
FQDN
DNS Domain
Postfix SMTP address rewriting
iPBX@sonoracomm.com
domain name of owner
important for mail relaying
Provisioning
TFTP, HTTP and FTP
all enabled by default
This server's address - enter server IP address
external server IP if it has one
Preferences
Color - Lilac
License
Upload the license file sent by Thirdlane
==== PBX Settings ====
Default Values
Caller ID
Default Script
Distinctive Ring
yes
Internal (Polycom)
Voicemail Template
Probably OK as-is
Phone Template
Global Variables
OPERATOR
RECORDING_FORMAT (wav for non-MS)
Schedules
tl-off-hours
Office Closed Hours
00:00-07:59
17:00-23:59
holidays
==== Media Files ====
Music on Hold
Use 'default' or create a new playlist
Default MoH is not random
Delete songs you don't like
Delete all but 'morning coffee' and/or 'simplicity'
Add songs you do like to a new playlist
==== Trunks ====
=== DAHDI (Zap) ===
Create a trunk
Name your first trunk 'G0' (case sensitive)
=== Mediatrix ===
http://www.sonoracomm.com/support/20-voice-support/154-mediatrix-1204
http://lists.digium.com/pipermail/asterisk-users/2004-February/028568.html
Create a trunk
Mediatrix gateway is SIP trunk
Name, Description, Host, Codecs
No authentication
Routes -> Inbound Routes
Create a new inbound route
Choose a DID number to use (such as 999)
Also, you can create a new Feature extension and use that. Security implications?
On the Mediatrix 1204 gateway
No authentication
Point ports to extension 999 on server for inbound calls
See setup info on web site for SAIL
Logging
Device Info -> Monitoring
Enable syslog to PBX IP
On PBX, enable remote logging
vi /etc/sysconfig/syslog
add '-r' to SYSLOGD_OPTIONS
service syslog restart
=== Vitelity ===
You can use Vitelity either as a registered or an IP-routed trunk. Vitelity recommends using the more efficient IP-routed method to connect PBXs with static IPs.
IP-routed method shown here with separate trunks for inbound and outbound.
Note that you can only manipulate outbound caller ID if using IP routing. If using registration, specify the desired CLID in the Vitelity Portal Subaccount.
Create SIP Trunk
Name: vitel-inbound
Description: Vitelity Inbound SIP Trunk
Host: inbound23.vitelity.net
Direction: Inbound
Context: from-outside
Caller ID: Company Name
Codecs: G.711u, G.729, GSM # order by preference
DTMF mode: Auto
Other options: insecure=very
Provider's web site https://portal.vitelity.net
Clone the inbound trunk to create the outbound trunk:
Name: vitel-outbound
Host:
Description: Vitelity Outbound SIP Trunk
Direction: Outbound
Context: from-inside
Codecs: G.711u, G.729, GSM
DTMF mode: Auto
Provider's web site https://portal.vitelity.net
==== Extensions ====
* Bulk creation is easy
* 468* for a few seconds to reset Polycom phones
* Hit 'Setup'
* Set server to TFTP
* Set server IP address
* Directory - may need tweaking
==== Routes ====
* Add DIDs, if using digital circuit or VoIP trunks
* Add channel mappings for analog circuits, if desired
=== Inbound ===
* Just modify pattern 's' if using FXO gateway
* Office Closed Hours -> Play Closed IVR
* All Hours -> Play Open IVR, Except when OFFICE_OPEN_OVERRIDE
* All Hours #2 (cloned from tl-allhours) -> Play Open IVR
You can create a new inbound route for an extension, but it is easier to just add the DID number in the User Extension instead of doing this.
* DID
* Create Schedule-based Route
* DID/Pattern:
* Description: My Direct Dial
* When: All Hours
* Script: Goto User Extension
* User Extension: 101
=== Outbound ===
* Point existing routes to new trunk just created
* Use check boxes and Assign button
==== PBX Features ====
http://www.thirdlane.com/forum/selective-call-recording-by-pressing-9
Feature Codes
_8NXXX tl-transfer-to-voicemail, enter '1' and 'u', Forward to VM
*96 Close Office During Normally Open Hours (operator), closeoffice
*97 Reopens Office During Normally Open Hours (operator), openoffice
===== Tools =====
Auto-Provisioning
Configure or fine-tune phones and MAC addresses
Hit 'Provision Selected' to actually create config files and reboot phones
===== IVR (Auto-Attendant) =====
FIXME
===== Backup =====
Tools -> Backup
Create user on SME Server
Enable FTP on SME Server
Schedule backup
Simple -> Daily
FTP Server ->
File on FTP Server -> /path/to/your/backup.thirdlane.tar.gz
I also had to edit root's crontab to suppress useless e-mail messages sent nightly:
crontab -e
@daily /etc/webmin/asterisk/backup.pl >/dev/null 2>&1
===== Restore =====
Asterisk CLI problem after restore:
Edit the path in asterisk.conf to say /var/run/asterisk and restart:
vim /etc/asterisk/asterisk.conf
pbxportal kill
pbxportal start
rm /var/run/asterisk.*
asterisk -vvvvvvvr
===== Security =====
==== Fail2Ban ====
**[[networking:linux:fail2ban|Fail2Ban]]** is installed by default using TL ISO 2.0+.
:!: Fail2ban can complicate troubleshooting, so check it!
==== Arno's Firewall ====
vim /etc/arno-iptables-firewall/firewall.conf
OPEN_TCP="2222"
OPEN_UDP="4569,5060-5061,10000-20000"
HOST_OPEN_TCP="209.193.93.158~80,443,10000 209.193.64.254~80,443,10000 70.162.22.135~80,443,10000 209.193.64.2~80,443,10000"
iptables -nL |grep ACCEPT
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2222
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:4569
ACCEPT tcp -- 209.193.93.158 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 209.193.93.158 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 209.193.93.158 0.0.0.0/0 tcp dpt:10000
ACCEPT tcp -- 209.193.64.254 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 209.193.64.254 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 209.193.64.254 0.0.0.0/0 tcp dpt:10000
ACCEPT tcp -- 70.162.22.135 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 70.162.22.135 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 70.162.22.135 0.0.0.0/0 tcp dpt:10000
ACCEPT tcp -- 209.193.64.2 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 209.193.64.2 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 209.193.64.2 0.0.0.0/0 tcp dpt:10000
=== Redhat Firewall ===
http://wiki.centos.org/HowTos/Network/IPTables
Run iptables commands, then issue:
service iptables save
or
iptables-save > /etc/sysconfig/iptables
Restore saved rules like this:
iptables-restore
===== Night Mode =====
This may have changed. Check!
Voice Recordings
Upload two .gsm files to /var/lib/asterisk/sounds/ogm/
offices-open.gsm
offices-closed.gsm
===== Dial by Name Directory =====
http://www.asterisk.org/docs/asterisk/trunk/applications/directory
If you want to announce the extension number to the callers, and dial by first name, clone the script tl-directory into tl-directory-first-ext.
To clone a script on Web Interface menu go to PBX Settings > Script Library > choose script to clone and use button at the bottom of the page.
Add '|ef' to the options:
exten => s,2,Directory(default${TL_DASH}${tenant},local-extensions${TL_DASH}${tenant}|ef)
Once the script is created, add a feature code that uses the new script. Then you can use it in IVRs.
===== Root Mail =====
To forward administrative mail to a real user, edit ''/etc/aliases'':
vi /etc/aliases
Edit the bottom of the file:
# Person who should get root's mail
root: you@your.domain
Then run the ''newaliases'' command to activate the changes:
newaliases
===== Voicemail to E-Mail =====
==== Postfix ====
See also **[[networking:linux:postfix_smarthost|Postfix Authenticated Smarthost]]**
http://www.cyberciti.biz/faq/postfix-smtp-authentication-for-mail-servers/
http://www.dnsexit.com/support/mailrelay/postfix.html
ISO 2.0 install includes the Postfix MTA, so we tweak it to **forward mail to a smarthost** rather than configure everything necessary for a full-blown mail server.
Set the From Address for messages from the PBX:
**System Settings -> Network Settings -> Postfix SMTP rewriting -> iPBX@sonoracomm.com**
==== voicemail.conf ====
Edit ''voicemail.conf''. Set format for e-mail attachments to 'wav'.
volgain=6.0 # TDM400P card
serveremail=SonoraPBX
minsecs=5 # was 'minmessage' - adjust to get rid of hangups
fromstring=The Sonora iPBX
emailbody= (change 'Thirdlane' to 'SonoraPBX')
tz=arizona
[zonemessages]
arizona=America/Phoenix|'vm-received' Q 'digits/at' IMp
===== Digium TDM Cards =====
:!: TDM (FXO) cards don't like to share a hardware interrupt.
Check for shared IRQ:
lspci -vb
===== Echo Cancellation =====
Run ''fxotune'' to tune the TDM card to the actual phone lines connected.
- Connect the phone lines to the FXO ports
- Shut down Asterisk
- Run ''fxotune'' to modify the config file
- Verify the changed config file
- Restart Asterisk
Shut down Asterisk, then:
fxotune -i 4
cat /etc/fxotune.conf
Run this to set the running configuration to the settings in ''/etc/fxotune.conf'' (created by fxotune -i 4):
fxotune -s
Normally, fxotune -s is run by Zapata startup.
Restart Asterisk.
===== Provisioning =====
==== Polycom ====
http://www.thirdlane.com/forum/ftp
http://www.fonality.com/trixbox/forums/vendor-moderated-forums/polycom/configuring-polycom-phones-tb-2-2-endpoint-mgr
* Download the appropriate SIP and BOOTROM from Polycom Portal
* Unzip both files into /home/PlcmSpIp
* same location used for HTTP, FTP and TFTP
* Test with 'ftp pbx'
* Username 'PlcmSpIp'
* Password 'PlcmSpIp'
* > get sip.cfg
* Listing of files is disabled for security
* Test with 'tftp pbx' command from another PC
* > get sip.cfg
* Test with browser
* http://192.168.1.30/provisioning/ReadMe.txt
cd /home/PlcmSpIp/
# For older Polycoms such as 301, 501 and 4000
wget http://downloads.polycom.com/voice/voip/sp_ss_sip/spip_ssip_3_1_7_legacy_release_sig_combined.zip
wget http://downloads.polycom.com/voice/voip/sp_ss_bootrom/spip_ssip_vvx_BootROM_4_1_4_release_sig.zip
unzip spip_ssip_3_1_7_legacy_release_sig_combined.zip
unzip spip_ssip_vvx_BootROM_4_1_4_release_sig.zip
# For newer phones - don't use the latest as it doesn't work with TL provisioning yet
wget http://downloads.polycom.com/voice/voip/sp_ss_sip/spip_ssip_vvx_3_2_5_release_sig_split.zip
wget http://downloads.polycom.com/voice/voip/sp_ss_bootrom/spip_ssip_BootROM_4_3_0_release_sig.zip
chown -R PlcmSpIp.PlcmSpIp *
==== Snom ====
http://wiki.snom.com/Features/Auto_Provisioning/Redirection
http://www.thirdlane.com/forum/snom-auto-provisioning
===== Polycom Provisioning =====
Polycom Inter-Digit Timeout
==== Firmware ====
Use 'Split' firmware as long as BootRom is v 4.0 or above.
cd /home/PlcmSpIp/
wget http://downloads.polycom.com/voice/voip/sp_ss_bootrom/spip_ssip_BootROM_4_3_0_release_sig.zip
wget http://downloads.polycom.com/voice/voip/sp_ss_sip/spip_ssip_vvx_3_2_5_release_sig_split.zip
unzip spip_ssip_BootROM_4_3_0_release_sig.zip
unzip spip_ssip_vvx_3_2_5_release_sig_split.zip
=== Files ===
Thirdlane generates these config files based on templates in /etc/asterisk/provisioning
${mac} (lists config files to be read - static)
${mac}-registration.cfg (per-phone (line) settings)
local-settings.cfg (per-installation site-wide settings)
sip.cfg (static)
Each phone generates this override config file for user-changed settings in /tftpboot:
OVERRIDES/${mac}-phone.cfg
=== Templates ===
Copy /etc/asterisk/provisioning/models.txt to /etc/asterisk/user_provisioning/ and delete all models not being modified. 'user_provisioning' folder will not be overwritten upon TL upgrades and will override 'provisioning' templates.
cp -a /etc/asterisk/provisioning/models.txt /etc/asterisk/user_provisioning/
vim /etc/asterisk/user_provisioning/models.txt
cp -a /etc/asterisk/provisioning/models.txt /etc/asterisk/user_provisioning/
cp -a /etc/asterisk/provisioning/polycom_* /etc/asterisk/user_provisioning/
To program the second and third line keys for other functions, specify the number of line keys as 1.
=== Programming ===
http://www.thirdlane.com/forum/custom-polycom-soft-key-programming
Edit /etc/asterisk/user_provisioning/polycom_mac.cfg:
Modify for current version of firmware (change 313 to 317) to fix error 0x20.
Edit /etc/asterisk/user_provisioning/polycom_local.cfg:
Verify that the phone will dial *97 to check voicemail:
msg.mwi.1.callBack="*97"
=== Enable Presence ===
feature.1.enabled="1"
softkey.feature.mystatus="1"
Use these settings to override DHCP for NTP:
Adjust the phone's digitmap as needed. These settings require hitting 'send' for all calls:
dialplan.digitmap=""
dialplan.impossibleMatchHandling="2"
=== Testing ===
Format Filesystem on phone to test configuration file changes.
Check Voicemail
*97 - feature code - check your own mailbox
_*85NNNN - Check mailbox NNNN ????
=== Directory ===
Assign fewer lines to phones in order to leave buttons free for programming.
cp -a /tftpboot/000000000000-directory~.xml /tftpboot/000000000000-directory.xml
-
Park
700
1
-
Page
*98
2
=== Park and Paging ===
https://www.8774e4voip.com/kb.asp?ID=42
=== BLF ===
http://www.thirdlane.com/forum/shared-line-appearances
Assign fewer lines (1) to leave buttons free for programming in Tools -> Auto-Provisioning.
Polycom - Not yet working for line buttons, only expansion? May work soon...
Unused line keys are automatically populated with speed-dial contacts based on their speed dial index number. It is the same way you populate the expansion module.
These settings are needed and are default in /etc/asterisk/user_provisioning/polycom_local.cfg:
feature.1.name="presence"
feature.1.enabled="1"
Also:
* create a Contact (First Name)
* specify the extension (Contact)
* select yes to 'watch buddy'
* give it a speed dial index of 1
* it will be the first listed on the expansion module
* for these 'watched buddies' go into their extension configuration in pbx manager and limit their calls to 10 calls.
* Reload asterisk.
==== Thirdlane Dialer ====
Works as a standalone application or as an Outlook toolbar.
http://www.thirdlane.com/downloads/DialerSetup20.exe
http://www.thirdlane.com/products/thirdlane-dialer/configuration
==== vTiger CRM ====
yum install vtigercrm-ast-en
==== OpenFire Instant Messaging Server ====
yum install openfire