Trixbox Quick Reference Guide


 

TrixBox Link Reference
Admin Login http://<IP>/maint
freepbx http://<IP>/maint/?freepbx
ssh terminal http://<IP>/maint/?sshTerm
Edit Configs http://<IP>/maint/?configEdit
Point Manager http://<IP>/maint/?epManager End
Asterisk Information http://<IP>/maint/?astInfo
Process status http://<IP>/maint/?sysMaint
Install/Update Packages http://<IP>/maint/?packages
Operator Panel http://<IP>/admin/panel.php
LINUX COMMANDS
Entering the Asterisk Console asterisk -r
Checking Current System Load top
Interrupt Information cat /proc/interrupts
RAID Array Information cat /proc/mdstat
Checking the Routing table netstat -rn OR route
Checking CPU Information cat /proc/interrupts
Checking Memory Information cat /proc/meminfo
Running tcpdump tcpdump -A -s 10000 port <port> and host <host>
Running PING tests ping -i 0.02 -c 500 -s 270 <host>
Intensive Performance Information vmstat 1
Current Wanpipe Version wanrouter version
Current system processes ps aux
Current Networking Information ifconfig -a
Duplexing Diagnostics mii-tool
Rsync Usage rsync -av -essh /path/to/file <remote_site>:/path/to/file
SCP Usage scp /path/to/file <remote_host>:/path/to/file
Checking Disk Space df -h
Display TrixBox help options help-trixbox
ASTERISK COMMANDS
Show Current Peers sip/iax2 show peers
Show Current Registration sip/iax2 show registry
PRI Status pri show span <span_number>
Database Dump database show
Show Channels show channels
Hangup a Channel soft hangup <channel_name>
Show Channel Detail show channel <channel_name>
SIP Debug sip debug ip <host>
Starting Asterisk /etc/init.d/asterisk start
Stopping Asterisk /etc/init.d/asterisk stop
Reloading Asterisk reload
Restarting Asterisk (without modules) restart now
Restarting Asterisk (when there are no active calls) restart when convenient
Enter PRI Debug Mode pri debug span <span_number>
List modules and info show modules
Lists parked calls show parkedcalls
Show status of a specified queue show queue
Show status of queues show queues
Show uptime information show uptime
Display version info show version
List defined voicemail boxes show voicemail users
Enable SIP debugging on IP sip debug ip
Enable SIP debugging on Peername sip debug peer
Enable SIP history sip history
Disable SIP debugging sip no debug
Disable SIP history sip no history
Reload SIP configuration sip reload
Show SIP dialog history sip show history
Show defined SIP users sip show users
Removes a channel from a specified queue remove queue member
Set level of debug chattiness set debug
Set level of verboseness set verbose
Show status of agents show agents
Shows registered applications show applications
Describe a specific application show application
Show status of conferences show conferences
Displays RSA key information show keys
Show manager command show manager command
Show connected managers show managers
Start Asterisk and Flash Operator Panel server amportal start|stop|kill|chown
Sets an agent offline agent logoff
Sets an agent online agent logon
Enable RTP debugging rtp debug
Enable RTP debugging on ip rtp debug ip
Disable RTP debugging rtp no debug
Destroy a channel zap destroy channel
List cadences zap show cadences
Show active zapata channels zap show channels
Show information on a channel zap show channel
Show all Zaptel cards status zap show status
PHONE SHORTCUTS
User Logon *11
User Logoff *12
ZapBarge 888
Simulate Incoming Call 7777
Call Forward All Activate *72
Call Forward All Deactivate *73
Call Forward All Prompting Deactivate *74
Call Forward Busy Activate *90
Call Forward Busy Deactivate *91
Call Forward Busy Prompting Deactivate *92
Call Forward No Answer/Unavailable Activate *52
Call Forward No Answer/Unavailable Deactivate *53
Call Waiting – Activate *70
Call Waiting – Deactivate *71
DND Activate *78
DND Deactivate *79
My Voicemail *97
Dial Voicemail *98
Save Recording *77
Check Recording *99
Directory #
Call Trace *69
Echo Test *43
Speaking Clock *60
Speak Your Exten Number *65
ChanSpy 555
Intercom Prefix *80
TIPS/TRICKS/TROUBLESHOOTING
Zaptel Card Status zttool
Detailed Card Status ztcfg -vvv
T1 Error / Status wanpipemon -i w1g1 -c Ta
Analog Voltage Check wanpipemon -i w1g1 -c astats -m <line_number>
Start Wanpipe Driver wanrouter start
Stop Wanpipe Driver wanrouter stop
Upgrade TrixBox to the latest version trixbox-update.sh
Set the local time zone and keyboard type config
Configure ethernet interface netconfig
Autoconfig Zaptel cards genzaptelconf
Install the HUDlite-server (Required for HUDlite client) install-hudlite
Set master password for web GUI passwd-maint
Set password for amp only passwd-amp
Set password for Web MeetMe only passwd-meetme
Set root password for console login passwd
Set admin password for checking system mail passwd admin
Create a SIPDefault.cnf in /tftpboot setup-cisco
Create a aastra.cfg in /tftpboot setup-aastra
Setup for autoconfiguration of Grandstream setup-grandstream
Set up a dhcp server setup-dhcp
Set up a Samba server (Microsoft file sharing) setup-samba
Configure sendmail setup-mail
Get latest patches for CentOS yum -y update
LOCATION OF Trixbox CONFIGURATION FILES
Asterisk Configuration Files /etc/asterisk/*.conf
Agents Configuration File /etc/asterisk/agents.conf
Queues Configuration File /etc/asterisk/queues.conf
Extensions Configuration File /etc/asterisk/extensions.conf
Extensions Additional Configuration File /etc/asterisk/extensions_additional.conf
Extensions Custom Configuration File /etc/asterisk/extensions_additional.conf
SIP Configuration /etc/asterisk/sip.conf
SIP Additional Configuration /etc/asterisk/sip_additional.conf
SIP Custom Configuration /etc/asterisk/sip_custom.conf
Voicemail Configuration Files /etc/asterisk/voicemail.conf
MeetMe Conferenece Configuration /etc/asterisk/meetme.conf
IAX2 Configuration /etc/asterisk/iax.conf
IAX2 Additional Configuration /etc/asterisk/iax_additional.conf
IAX2 Custom Configuration /etc/asterisk/iax_custom.conf
Asterisk Log Configuration /etc/asterisk/logger.conf
Wanpipe Configuration Files /etc/wanpipe/*
Zaptel Configuration /etc/asterisk/zaptel.conf
Zapata Configuration Files /etc/asterisk/zapata.conf
CDR Log Files /var/log/asterisk/cdr-csv
Queue Log Files /var/log/asterisk/queue*.log
Asterisk Log File /var/log/asterisk/messages
Outgoing Call Files Directory /var/spool/asterisk/outgoing
AGI-BIN /var/lib/asterisk/agi-bin/
Keys /var/lib/asterisk/keys/
Images /var/lib/asterisk/images
MeetMe recordings /var/spool/asterisk/meetme/
Voicemail Messages /var/spool/asterisk/voicemail/
Music on Hold /var/lib/asterisk/mohmp3/
Voice Prompts /var/lib/asterisk/sounds/
Dictation Recordings /var/spool/asterisk/dictate/
Monitor Recordings /var/spool/asterisk/monitor/
Phone Firmware and Config Locations /tftpboot/

Read and Generate Excel and Word files

Now you can generate Excel and Word File with NO extra charge, using Jakarta POI

Requirements:

  • .NET Framework 2.0
  •  JSharp framework 2.0
  • Configure your model to compile and execute with Framework 2.0
  • DLL from Jakarta poi

Install JSharp (vjredist)

Install the DLL from Jakarta in your model (jakartapoi-winfx-dll-251-3), if you are compiling for WEB, put them on “DATAxxx/web/bin/”

Now you are ready to Read or Create Excel or Word files, here an example:

 

&excel is ExcelDocument Type

Place the “UseAutomation” = 0 before the “Open” command line.

 

 

Event "Excel"    &excel.UseAutomation = 0     &excel.Open(&File)      If &excel.ErrCode <> 0         msg(&excel.ErrDescription)     else         &excel.Clear()               &excel.Cells(1,1).Text = 'Customers list'          &excel.Cells(1,1).Bold = 1         &excel.Cells(1,1).Color = 54         &excel.Cells(1,1).Size = 10                  &excel.Cells(3,1).Text = 'Customer Id'         &excel.Cells(3,1).Italic = 1         &excel.Cells(3,1).Bold = 1              &row = 4         &col = 1         For each line in Grid                      &excel.Cells(&row,&col).Number = CustomerId                 &excel.Cells(&row,&col).Color = 3                 &row  = 1                           endfor          &excel.Save()      endif EndEvent 

Delete temporary blob files on the web (.NET environment)

 

Abstract 

To implement the uploading of blob fields on the web, temporary directories are used to save the file to the server’s disk first and then upload it to the database

Detailed description 

 

The directories are specified using the Blob Local Storage Path and Temp Media Directory model properties. To have the files automatically deleted, in Upgrade 3 you can create a global.asax file and save it to the application directory.

The file must contain the following code:

<%@ Import namespace=”System.IO” %>
<Script language=”C#” runat=”server”>

public void Application_OnStart()
{
Application[“TemporaryFilesToDelete”]= new ArrayList();
}
public void Application_OnEnd()
{
ArrayList toDelete = (ArrayList)(Application[“TemporaryFilesToDelete”]);
foreach( string fileName in toDelete)
File.Delete( fileName);
}
</script>

This way the files will be deleted when the application’s memory usage exceeds the configured maximum or according to the recycling configuration. That is to say, when the process (Aspnet_wp or W3wp) is recycled, it deletes all the files that have been created since the application was started (and that haven’t been deleted after ending a session).

WARNING: This implementation has a high startup cost, which is an obstacle for prototyping. It implies that the person who executes the first request after restarting the process serving the web objects (w3wp or aspnet_wp) must run this deletion and therefore delay the request.

 

Use ssh as a proxy server

Using ssh as a proxy or encrypted tunnel to browse the web can sometimes be necessary:

  1. When you’re at a conference but need to login securely to your blog.
  2. When local access restrictions make life really difficult.
  3. If you have a server in another country and want to see what Google Adsense adverts people see in that country.

ssh -D 8181 -Nf  example.com

ssh -D 8181 -Nf  yourlogin@example.com

Where example.com is the name of the site you are connecting to (ssh) and 8181 is the port you’ll use in your browser.

You’ll use the first option if you have set up your connection without password, otherwise use the second option

Then configure your browser to user Proxy at: localhost:8181 (or 127.0.0.0:8181)

Here’s an example of how to configure the proxy on Mac

Mac's Proxy setup

Enjoy.

SSH Without Password

 

Sometimes we need a ssh connection that do not ask for passwords. It is use frequently in scripts that involve ssh, scp or sftp connections. 

So, those are the steps to make such connection.

1. Login as user1 on computer1 and generate a pair of authentication keys. Note: even if is unsecured to work without password, do not enter it. Let it empty…

[user1@computer1]$ ssh-keygen -t rsa 
Generating public/private rsa key pair. 
Enter file in which to save the key (/home/user1/.ssh/id_rsa): 
Created directory ‘/home/user1/.ssh’. 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user1/.ssh/id_rsa. 
Your public key has been saved in /home/user1/.ssh/id_rsa.pub. 
The key fingerprint is: 
31:df:a5:73:4a:2f:a6:6c:1c:32:a2:f2:b3:c5:a7:1f user1@computer1

2. Login to the remote computer (computer2) as user2 and create the .ssh directory (many Linux distributions create this folder by default. No problem with that.). You still need the password for now…

[user1@computer1]$ ssh -l user2 computer2 mkdir -p .ssh 
user2@computer2’s password:

3. Copy the user1 public key to user2@computer2 .ssh folder into authorized_keys file. And, type the password again for the last time, hopefully…

[user1@computer1]$ cat .ssh/id_rsa.pub | ssh -l user2 computer2  
>’cat >> .ssh/authorized_keys’ 
user2@computer2’s password:

4. If all things are OK, you don’t need the password

[user1@computer1]$ ssh -l user2 computer2 
[user2@computer2]$

..or optionaly (see the troubleshooting section of this page): 

[user1@computer1]$ ssh -i $HOME/.ssh/id_rsa user2@computer2

 

NOTE:
This is the way not only for ssh but also for scp and sftp as well…

TROUBLESHOOTING:
If the password prompt will be shown again check the /etc/ssh/ssh_config and uncomment or insert the following option:

IdentityFile ~/.ssh/id_rsa

As you can see, the above option is for RSA type keys. If you want to generate the key pairs using DSA change the “id_rsa” with “id_dsa”. Sound logic, right? 
This modification in /etc/ssh/ssh_config file can be avoided if you will use the parameter “-i” followed by the location of the key file as in example: 

[user1@computer1]$ ssh -i $HOME/.ssh/id_rsa user2@computer2

 
Also, if you do have write permissions for either the .ssh directory or for the authorized_keys file on the remote machine, then sshd will consider that the procedure is not safe enough, so it will abort the RSA challenge-authentication mode (mode 3) and will go to the default mode (mode 5) asking you for the password on the remote machine. Set chmod 700 for .ssh folder and 600 authorized_keys file.