29.01.2015 Views

trixbox2_without_tea.. - UV UTBM J. Millet - Free

trixbox2_without_tea.. - UV UTBM J. Millet - Free

trixbox2_without_tea.. - UV UTBM J. Millet - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TRIXBOX-2 <strong>without</strong> Tears<br />

Incorporating PBX in a Flash<br />

The ICT serial following<br />

Trixbox <strong>without</strong> Tears<br />

If you find this book helpful and you are a private user, a small PayPal donation made to<br />

bensharif@gmail.com would be very highly appreciated. If you are in Australia and don’t have Paypal, you may<br />

forward a cheque made to:<br />

Ben Sharif, PO Box 70 Kingswood NSW 2747, Australia.<br />

(For business use or using this as manual for your customers, prior arrangement with the author is required)<br />

http://dumbme.voipeye.com.au/Trixbox/index1.htm<br />

TRIXBOX-2 Without Tears Page 1 of 238


Intentionally left blank<br />

TRIXBOX-2 Without Tears Page 2 of 238


For TRIXBOX 2.x with freePBX<br />

(Version 2.6.0a)<br />

(Work in Progress is Perpetually ongoing)<br />

by<br />

Ben Sharif<br />

(The same author who brought you Asterisk@Home <strong>without</strong> <strong>tea</strong>rs and Trixbox <strong>without</strong> <strong>tea</strong>rs)<br />

About the Author<br />

Last updated on April 21, 2008<br />

Please send comment or suggestions to me at the address below<br />

<br />

mailto:netvoice.solutions@gmail.com<br />

First Published on 1 st January 2007<br />

This document is released under the Creative Commons By-Attrib Non-Commercial Share-Alike 2.1 licence.<br />

This work is dedicated to my wife, who has been very patient with me, Andrew Gillis, Ward<br />

Mundy and Rob Thomas whose devotions to TRIXBOX, PiaF and freePBX made it all<br />

possible.<br />

*<br />

Stay tuned for our next episode – TRIXBOX version X<br />

TRIXBOX-2 Without Tears Page 3 of 238


Intentionally left blank<br />

TRIXBOX-2 Without Tears Page 4 of 238


TABLE OF CONTENT<br />

Forward......................................................................................................................................... 11<br />

1 Introduction.............................................................................................................................. 12<br />

1.1 Is VoIP for you............................................................................................................ 12<br />

1.1.1 What is it going to cost........................................................................................ 12<br />

1.1.2 What will the quality of the phone calls be.......................................................... 12<br />

1.2 What is Trixbox........................................................................................................... 12<br />

1.3 The IP PBX Components ............................................................................................. 13<br />

1.3.1 The IP PBX ........................................................................................................... 13<br />

1.3.2 Phones.................................................................................................................. 14<br />

1.3.3 SIP Gateway ......................................................................................................... 14<br />

1.3.4 Home Network ...................................................................................................... 14<br />

1.3.5 VOIP Service Providers ........................................................................................ 14<br />

2 Initial Preparation and Planning............................................................................................. 15<br />

3 Installation................................................................................................................................ 16<br />

3.1 Initial Installation........................................................................................................... 16<br />

3.2 Change Default Settings .............................................................................................. 19<br />

3.2.1 To get Help ........................................................................................................... 20<br />

3.2.2 Change IP Address (set IP address to Static) ...................................................... 20<br />

4 Set-up TRIXBOX....................................................................................................................... 23<br />

4.1 Installing Trixbox Modules............................................................................................ 24<br />

4.2 Installing freePBX Modules .......................................................................................... 26<br />

5 Basic configuration using freePBX ....................................................................................... 30<br />

5.1 General Settings........................................................................................................... 30<br />

5.1.1 Dial Command Options......................................................................................... 31<br />

5.2 Extensions.................................................................................................................... 34<br />

5.2.1 Create Extensions................................................................................................. 34<br />

5.2.2 Enable Voicemail ................................................................................................... 36<br />

5.3 Follow Me ..................................................................................................................... 37<br />

5.4 Ring Groups ................................................................................................................. 38<br />

6 Set up softphones. .................................................................................................................. 40<br />

6.1 CounterPath X-Lite Softphone ..................................................................................... 40<br />

6.2 BOL SIPPhone............................................................................................................. 41<br />

Profile Tab....................................................................................................................... 41<br />

Audio & Video Tab .......................................................................................................... 42<br />

Network Tab.................................................................................................................... 42<br />

STUN Tab ....................................................................................................................... 42<br />

Call Forward.................................................................................................................... 43<br />

7 Trunks to the outside world ................................................................................................... 44<br />

7.1 What is a Dial Pattern ................................................................................................ 44<br />

7.2 What is a Trunk .......................................................................................................... 44<br />

7.3 Trunks and Outbound Routes – a circus of confusion................................................. 45<br />

7.3.1 Outgoing Route Dial Pattern................................................................................. 45<br />

7.3.2 Trunk Outgoing Dial Rules.................................................................................... 45<br />

7.4 Let’s Create The VoIP Trunks...................................................................................... 46<br />

7.4.1 Pennytel ................................................................................................................ 46<br />

7.4.2 Oztell (SIP)............................................................................................................ 48<br />

6.4.3 Oztell (IAX)............................................................................................................ 49<br />

8 Calls Handling.......................................................................................................................... 51<br />

8.1 Inbound Routes (Incoming Calls)................................................................................. 51<br />

8.1.1 Inbound Route from ZAP Trunk............................................................................ 52<br />

8.2 Time Conditionds ......................................................................................................... 53<br />

8.2.1 Simple Time Condition.......................................................................................... 54<br />

8.2.2 Complex Time Condition....................................................................................... 54<br />

8.3 Outbound Routes ......................................................................................................... 55<br />

8.3.1 What is an Outbound Route ............................................................................... 55<br />

8.3.2 How does it work................................................................................................. 55<br />

8.3.3 International .......................................................................................................... 56<br />

8.3.4 Domestic ............................................................................................................... 57<br />

TRIXBOX-2 Without Tears Page 5 of 238


8.3.5 MobileAust ............................................................................................................ 58<br />

8.3.6 Oztellonly .............................................................................................................. 58<br />

8.4 ENUM........................................................................................................................... 59<br />

8.4.1 Setting up ENUM Trunk........................................................................................ 59<br />

8.4.2 Setting up ENUM Outbound Route....................................................................... 60<br />

9 Custom Contexts Module ...................................................................................................... 61<br />

Downloading and unpacking module. ................................................................................. 61<br />

Installing Custom Context Module ...................................................................................... 61<br />

Add and Configure New Custom Context ........................................................................... 62<br />

Apply a Custom Context to Extension................................................................................. 63<br />

10 System Recordings ............................................................................................................... 64<br />

10.1 Direct recording.......................................................................................................... 65<br />

10.2 Upload Pre-recorded Material .................................................................................... 65<br />

11 Digital Receptionist ............................................................................................................... 67<br />

11.1 Setting Up Digital Receptionist................................................................................... 67<br />

11.2 Multi-Language IVR.................................................................................................... 70<br />

11.2.1 Complimentary multi-language MOH.................................................................. 71<br />

11.3 Multi-Tenants IVR....................................................................................................... 72<br />

12 Get Under The Bonnet .......................................................................................................... 74<br />

12.1 Editing The .conf Files................................................................................................ 75<br />

12.1.1 sip.conf................................................................................................................ 75<br />

12.1.2 sip_custom.conf.................................................................................................. 76<br />

12.1.3 iax.conf................................................................................................................ 76<br />

12.1.4 iax_custom.conf.................................................................................................. 76<br />

12.1.5 Indications.conf................................................................................................... 76<br />

12.1.6 enum.conf ........................................................................................................... 76<br />

12.1.7 extensions_custom.conf ..................................................................................... 77<br />

12.1.8 features.conf ....................................................................................................... 77<br />

13 Check your System ............................................................................................................... 79<br />

13.1 System Process Status .............................................................................................. 79<br />

13.2 Asterisk Info................................................................................................................ 80<br />

14 Interfacing Asterisk to PSTN ................................................................................................ 82<br />

14.1 A100P FXO PCI Card ................................................................................................ 82<br />

14.2 Create a ZAP trunk..................................................................................................... 83<br />

14.2.1 zapata.conf ......................................................................................................... 83<br />

14.2.2 zapata-auto.conf ................................................................................................. 83<br />

14.2.3 zaptel.conf........................................................................................................... 83<br />

14.3 OpenVox A400P FXO/FXS Card ............................................................................... 84<br />

14.3.1 zapata-auto.conf ................................................................................................. 84<br />

14.3.2 modprobe.conf.................................................................................................... 85<br />

14.4 Is the A100P/A400P installed................................................................................... 86<br />

14.5 Caller ID (CID) using ZAP device............................................................................... 87<br />

14.5.1 zapata.conf ......................................................................................................... 87<br />

14.5.2 zapata-auto.conf ................................................................................................. 87<br />

14.6 Sipura SPA3000/3102 as a PSTN Interface .............................................................. 88<br />

14.6.1 Log in to SPA3000/3102..................................................................................... 88<br />

14.6.2 Change the settings............................................................................................ 88<br />

14.6.3 Add SIP Trunk..................................................................................................... 90<br />

14.6.4 SPA3000 as an outbound PSTN Trunk.............................................................. 91<br />

14.7 SPA3000 remote management................................................................................... 91<br />

14.8 Use STUN Server on SPA3000 ................................................................................. 92<br />

15 PSTN to VOIP Gateway ......................................................................................................... 93<br />

16 DISA ........................................................................................................................................ 94<br />

16.1 DISA - Hand Coding Method...................................................................................... 94<br />

16.2 DISA – Using freePBX ............................................................................................... 95<br />

17 Operator Panel....................................................................................................................... 96<br />

17.1 Flash Operator Panel (FOP) ...................................................................................... 96<br />

17.1.1 Setting the Admin Password............................................................................... 97<br />

17.1.2 Hang-up a Call .................................................................................................... 97<br />

17.1.3 Transfer a Call .................................................................................................... 97<br />

TRIXBOX-2 Without Tears Page 6 of 238


17.1.4 Initiate a Call ....................................................................................................... 97<br />

17.1.5 Barge in or Create a Conference........................................................................ 97<br />

17.2 HUDLite...................................................................................................................... 98<br />

17.2.1 Setting up HUDLite Admin.................................................................................. 98<br />

17.2.2 Setting Up HUDLite............................................................................................. 99<br />

17.2.3 What if it does not work .................................................................................. 102<br />

18 Call parking and transfer .................................................................................................... 103<br />

18.1 Call Transfer - Managed .......................................................................................... 103<br />

parking_additional.inc ................................................................................................... 103<br />

18.1.1 How is it done ................................................................................................. 104<br />

18.2 Call Transfer – Blind................................................................................................. 105<br />

18.3 Put a Call On Hold.................................................................................................... 105<br />

18.4 Call Pickup ............................................................................................................... 105<br />

18.5 Filter Your Incoming Calls - Only Accept Known Calls ............................................ 105<br />

19 Conference ........................................................................................................................... 108<br />

meetme.conf ................................................................................................................. 108<br />

meetme_additional.conf................................................................................................ 108<br />

19.1 Create Conference.................................................................................................... 108<br />

19.2 Invalid Conference number ...................................................................................... 109<br />

20 Voicemail .............................................................................................................................. 111<br />

20.1 Enabling Email Notification ...................................................................................... 111<br />

20.1.1 Installing sendmail ............................................................................................ 111<br />

20.1.2 /etc/hosts........................................................................................................... 112<br />

20.2 Use Postfix Ins<strong>tea</strong>d of Sendmail .............................................................................. 114<br />

20.3 How to Retrieve Voicemail from External Phone ..................................................... 114<br />

20.3.1 Method 1 ........................................................................................................... 114<br />

20.3.2 Method 2 ........................................................................................................... 115<br />

20.4 How to Change Voice Mail Greetings ...................................................................... 115<br />

21 Fax to E-Mail......................................................................................................................... 116<br />

21.1 Installing Fax for TRIXBOX ...................................................................................... 116<br />

22 Weather Reports.................................................................................................................. 117<br />

22.1 Configure Weather Report – On Demand................................................................ 117<br />

22.1.1 Create Extension codes.................................................................................... 118<br />

22.2 Configure Weather Report – Background Method................................................... 118<br />

22.2.1 Create Extension codes.................................................................................... 119<br />

22.3 Now put it in your Digital Receptionist...................................................................... 120<br />

23 Remote Management .......................................................................................................... 121<br />

23.1 httpd.conf.................................................................................................................. 121<br />

24 How to set up a Remote Extension.................................................................................... 122<br />

24.1 Create a new extension ........................................................................................... 122<br />

24.2 IAX.Conf ................................................................................................................... 123<br />

24.3 Sip_Nat.Conf............................................................................................................ 123<br />

24.4 Setting up an IAX Softphone.................................................................................... 123<br />

24.4.1 First the general options ................................................................................... 124<br />

24.4.2 Accounts options............................................................................................... 125<br />

25 Calls Recordings ................................................................................................................. 126<br />

25.1 ARI Interface ............................................................................................................ 126<br />

25.1 Record all calls by default ........................................................................................ 127<br />

25.2 Record calls on demand. ......................................................................................... 127<br />

26 STUN Servers....................................................................................................................... 128<br />

27 Dialing through MS Outlook® ............................................................................................ 128<br />

27.1 Download AstTapi .................................................................................................... 128<br />

27.2 Install AstTapi........................................................................................................... 129<br />

27.3 Configure Outlook Address Book............................................................................. 129<br />

28 Speed Dial ............................................................................................................................ 131<br />

28.1 The Dumb-Me method ............................................................................................. 131<br />

28.2 TRIXBOX’s method (Version 1.x) ............................................................................ 132<br />

28.3 TRIXBOX’s method (Version 2.x) ............................................................................ 132<br />

29 How to use Window Messenger® 5.x ................................................................................ 134<br />

30 How to interconnect 2 boxes.............................................................................................. 136<br />

TRIXBOX-2 Without Tears Page 7 of 238


30.1 Method 1 - With the Peer Asterisk box as Extensions............................................. 136<br />

30.2 Method 2 - In a Peer/User Arrangement.................................................................. 137<br />

30.3 Method 3 – Friend/Friend Arrangement................................................................... 138<br />

30.4 Thinking of more than 2 boxes............................................................................... 139<br />

30.5 Redirect Incoming in Box A to Box B ....................................................................... 139<br />

31 Customised Voice ............................................................................................................... 141<br />

31.1 Customising Voice Prompts ..................................................................................... 141<br />

31.2 Installing Other Languages ...................................................................................... 142<br />

31.3 Converting WAV files ............................................................................................... 142<br />

31.3.1 Converting WAV to GSM .................................................................................. 142<br />

31.3.2 Converting WAV to SLN ................................................................................... 143<br />

32 MOH (Music On Hold).......................................................................................................... 144<br />

32.1 Customising MOH .................................................................................................... 144<br />

32.2 MOH for different trunks........................................................................................... 145<br />

32.3 Streaming Music on Hold ......................................................................................... 146<br />

Method 1 ....................................................................................................................... 146<br />

Method 2 ....................................................................................................................... 147<br />

33 Backup and restore ............................................................................................................. 149<br />

33.1 Schedule a Backup .................................................................................................. 149<br />

33.2 To Restore a Backup................................................................................................ 151<br />

34 SugarCRM ............................................................................................................................ 152<br />

35 USB Phone Support ............................................................................................................ 154<br />

36 Codec (Coder Decoder) ...................................................................................................... 155<br />

36.1 Installing G729 and G723 CODECs......................................................................... 156<br />

36.2 To Install CODECS on PiaF...................................................................................... 157<br />

37 PSTN Trunk – Special Handling......................................................................................... 159<br />

37.1 Dial 0 for Outside Line.............................................................................................. 159<br />

37.1.1 Using Zaptel Card Method................................................................................ 159<br />

37.1.2 Using SPA3K Method ....................................................................................... 159<br />

37.2 Giving Priority to Emergency Numbers (E.g. 000) ................................................... 160<br />

38 Port Forwarding and QOS – Routers................................................................................. 161<br />

38.1 Port Forwarding........................................................................................................ 161<br />

38.2 QOS – Routers......................................................................................................... 161<br />

39 Upgrading your system ...................................................................................................... 163<br />

39.1 Upgrading Trixbox.................................................................................................... 163<br />

39.2 Upgrading freePBX .................................................................................................. 163<br />

40 Tools ..................................................................................................................................... 164<br />

40.1 Webmin for Trixbox .................................................................................................. 164<br />

40.1.1 To update WebMin............................................................................................ 165<br />

40.3 Putty ......................................................................................................................... 165<br />

40.4 WinSCP.................................................................................................................... 165<br />

41 Use ACCESS to connect to Database ............................................................................... 167<br />

41.1 Setting up a new MySQL user ................................................................................. 167<br />

41.2 Configure MySQL ODBC for Windows .................................................................... 168<br />

41.3 Connecting using MSACCESS ................................................................................ 170<br />

42 My TRIXBOX® PBX Network ............................................................................................. 174<br />

43 Trouble Shooting................................................................................................................. 175<br />

43.1 Debug Messages and Log Files are your friends .................................................... 175<br />

43.2 Unable to log on to Packages ................................................................................ 176<br />

43.3 Asterisk Feature Codes not working ........................................................................ 176<br />

43.4 Asterisk Drops Calls after a few seconds ................................................................ 176<br />

43.5 Pennytel Asterisk Problem ....................................................................................... 176<br />

43.6 Unable to receive Incoming Calls............................................................................. 176<br />

43.7 Sipura SPA3000 – Not hanging up after PSTN Calls .............................................. 177<br />

43.8 System Not Working after changing to Static IP ..................................................... 177<br />

43.9 No Audio on Analog line........................................................................................... 178<br />

43.10 Unexplained Crashes............................................................................................. 178<br />

43.11 ZAP Inbound Route Does not Work....................................................................... 178<br />

43.12 Occassional FATAL Error when defining extension............................................... 178<br />

43.13 All extensions failed to work when Internet down .................................................. 179<br />

TRIXBOX-2 Without Tears Page 8 of 238


Appendix A................................................................................................................................. 180<br />

A.1 Asterisk Feature Codes ............................................................................................. 180<br />

A.2 Asterisk CLI commands............................................................................................. 181<br />

A.2.1 General commands ............................................................................................ 181<br />

A.2.2 AGI Commands .................................................................................................. 182<br />

A.2.3 Database Handling............................................................................................. 182<br />

A.2.4 IAX Channel Commands.................................................................................... 182<br />

A.2.5 SIP Channel commands..................................................................................... 183<br />

A.2.6 Server management........................................................................................... 183<br />

A.3 Asterisk Special Extensions....................................................................................... 183<br />

A.4 Asterisk Common Variables ...................................................................................... 184<br />

A.5 Indications for Various Countries............................................................................... 185<br />

Appendix B................................................................................................................................. 194<br />

B.1 – Australian VSPs (trunks).......................................................................................... 194<br />

B.1.1 BBPglobal........................................................................................................... 194<br />

B.1.2 Engin BYO.......................................................................................................... 194<br />

B.1.3 Faktortel (IAX) .................................................................................................... 195<br />

B.1.4 iPrimus................................................................................................................ 195<br />

B.1.5 Koala................................................................................................................... 196<br />

B.1.6 MyNetFone ......................................................................................................... 196<br />

B.1.7 Nehos (IAX) ........................................................................................................ 197<br />

B.1.8 Nodephone ......................................................................................................... 197<br />

B.1.9 SipMe.................................................................................................................. 197<br />

B.2 – New Zealand VSPs (trunks) .................................................................................... 198<br />

B.2.1 iTalk .................................................................................................................... 198<br />

B.2.2 Double Zero 64 (IAX)......................................................................................... 198<br />

B.3 – Other VSPs (trunks)................................................................................................. 199<br />

B.3.1 Broadvoice.......................................................................................................... 199<br />

B.3.2 FWD aka Pulver(IAX) ......................................................................................... 199<br />

B.3.3 SipBroker............................................................................................................ 199<br />

B.3.4 SipPhone ............................................................................................................ 200<br />

B.3.5 VOIP Buster........................................................................................................ 200<br />

Appendix C................................................................................................................................. 201<br />

C.1 Voice for Asterisk Messages ..................................................................................... 201<br />

C.2 Australian Voice and Language Set for Asterisk ....................................................... 202<br />

C.3 More Australian Voice for Asterisk ............................................................................ 202<br />

Appendix D (ATAs and Routers).............................................................................................. 203<br />

D.1 Alcatel SpeedTouch 510/530 ADSL Router .............................................................. 203<br />

D.2 Billion 7402 VL........................................................................................................... 203<br />

D.3 Linksys PAP2 and Sipura SPA2000.......................................................................... 204<br />

Appendix E (Users’ Contributions).......................................................................................... 206<br />

E.1 Suggestions for Dial Plan and configuration.............................................................. 206<br />

E.3 Eliminating Echo Problems in SPA-3000 .................................................................. 209<br />

E.4 Immediate Answer of PSTN Calls ............................................................................. 211<br />

E.5 Rebuild Zaptel Driver (Users’ Suggestions) ............................................................. 211<br />

E.5.1 As experienced by marner – a Whirlpool Forum participant. ............................. 211<br />

E.5.2 As suggested by Rob Thomas (the <strong>Free</strong>PBX guru)........................................... 211<br />

E.6 Zaptel card configuration for Australia....................................................................... 212<br />

E.7 RAID1, LVM (logical volumes) – how to .................................................................... 214<br />

E.8 V2.2 Trixbox Load Config to include IDE raid............................................................ 223<br />

E.9 TEST Bench Anyone ............................................................................................... 226<br />

Appendix F (Publications and References) ........................................................................... 227<br />

F.1 DUNDi – a guide to a Simple Setup........................................................................... 227<br />

F.2 The future of Telephony by O’Reilly Publishing......................................................... 227<br />

F.3 Other Asterisk Forums, Tutorials and Wikis ............................................................. 227<br />

F.4 Voice over IP – Per call bandwidth consumption....................................................... 227<br />

Notes........................................................................................................................................... 228<br />

A2Billing............................................................................................................................. 228<br />

Delete Call Records from CDR ......................................................................................... 228<br />

Extension Numbers to avoid using.................................................................................... 229<br />

TRIXBOX-2 Without Tears Page 9 of 238


sip_nat.conf ....................................................................................................................... 229<br />

How to restrict Outgoing Calls – Manual Method.............................................................. 229<br />

Bugs Reports ............................................................................................................................. 233<br />

Asterisk re-load issue........................................................................................................ 233<br />

Are you still having problem ............................................................................................ 233<br />

Hangs on shutdown........................................................................................................... 233<br />

Zaptel Not Detected on Trixbox 2.2.4 ............................................................................... 234<br />

All phones UNUSABLE if internet connection is lost. ....................................................... 234<br />

Cheat Sheet ................................................................................................................................ 236<br />

Some Linux commands in common use ........................................................................... 236<br />

Bibliography............................................................................................................................... 237<br />

Changes Made since last Update............................................................................................. 238<br />

TRIXBOX-2 Without Tears Page 10 of 238


FORWARD<br />

Following the tradition of Asterisk@Home <strong>without</strong> Tears and Trixbox <strong>without</strong> Tears, this<br />

guide is not meant to be a detailed manual for Trixbox®; ins<strong>tea</strong>d it is just a quick and dirty<br />

guide and a resource to assist you get started with minimum pain. As always, use this<br />

document only as a guide, not as a Gospel. It does not cover every detail in Trixbox or<br />

PiaF neither will it provide you with a complete solution or spiritual guidance.<br />

Only a competent VoIP consultant can provide you the necessary know-how for a<br />

complete solution, and as for spiritual guidance, I will leave that entirely to you.<br />

This document was compiled mainly based on Australian conditions, through my<br />

experience going through the wash, supplemented by inputs from dozens of participants<br />

in the Whirlpool and other Trixbox and Asterisk related forums. These people were<br />

mentioned in A@H and Trixbox <strong>without</strong> <strong>tea</strong>rs. They have helped me whenever I get into<br />

difficulties, and I still seek guidance (the Trixbox/PiaF/Asterisk type) from them.<br />

I take no primary credit for this document (I am only the compiler of the not so divine<br />

revelation). I invite others to participate in improving this document. Please send me your<br />

feedbacks; so together we can make this document a valuable resource for our peers in<br />

the Trixbox/PiaF/freePBX community, experienced and new alike.<br />

- Ben Sharif January 1, 2007.<br />

<br />

<br />

The usual disclaimer: (Don’t you just hate it, having to say this.)<br />

In its Basic form, all that I have outlined worked for me but it may contain many<br />

errors – typographical, omissions and even misguidance that may require a lot of<br />

extra corrections. While I have taken due care, however, it may not necessarily be<br />

suitable for your individual configuration. I do not take; neither will I accept any<br />

responsibility for any losses incurred due to actions or inaction conducted as a result<br />

of methods or advice found in this document.<br />

I do not provide Trixbox/PiaF/freePBX support and neither do DIGIUM. If<br />

assistance is required, please post in the forum. Participants in the various<br />

forums may have a number of solutions and at the same time providing the<br />

opportunity for others with similar questions to benefit from the solutions<br />

provided.<br />

http://forums.whirlpool.net.au/forum-threads.cfmf=107<br />

Ever since the release of A@H <strong>without</strong> Tears, I have received numerous emails asking<br />

for assistance. Since I am putting a lot of efforts into providing personal assistance to<br />

those who have sent me donations (incidentally, my only source of income), the volume<br />

of email I received has become unmanageable. While I will try to assist within my limited<br />

knowledge, I hope you will understand if I don’t answer each and every email.<br />

<br />

I am not an expert and therefore I do not have all the answers. I ask those<br />

requiring assistance to post their questions in the Whirlpool, Digium, freePBX,<br />

PiaF or Trixbox Forum (forum participants may not answer any question if the<br />

solution is already in this guide) where there are many knowledgeable Asterisk<br />

and Linux savvy participants who will be able to assist.<br />

TRIXBOX-2 Without Tears Page 11 of 238


1 INTRODUCTION<br />

Asterisk TM is a Linux based IPBX application developed by Mark Spencer of Digium,<br />

the company behind Asterisk. Trixbox and PiaF TM (PiAF is Ward Mundy’s PBX in a<br />

Flash) evolved from the core Asterisk. It is made up of several major components. These<br />

were developed under GPL supported relatively by users themselves. It consists of<br />

applications, a provisioning system, an installer, and an operating system that, together,<br />

make a complete package ready for use as an out of the box PBX.<br />

Within this document, Trixbox, PiaF and Asterisk will be referred to frequently and they<br />

are interchangeable as Trixbox and PiaF are in essence supersets of the Asterisk.<br />

1.1 IS VOIP FOR YOU<br />

Whether VOIP is for you or not depends on a number of or combinations of factors.<br />

Some economic and quality requirements should be considered.<br />

1.1.1 What is it going to cost<br />

Assuming that you already have a broadband service, a router, and a Windows PC to<br />

run the softphone, the cost will be minimal.<br />

If you already have a spare computer to dedicate to this task, then the cost is almost<br />

nothing unless you need to buy an audio headset ($15.00 from your local electronic<br />

store) for the softphone. If you do not have a spare PC with the above specification,<br />

then you may be able to buy one from your local swap meets for under $200.00,<br />

which may include a monitor. Ensure that the PC has an Ethernet NIC for connecting<br />

to your home network.<br />

Your only other initial cost will be the $20.00 or so activation fee to Oztell (or other<br />

VSP of your choice). In fact many VSPs, the like of Pennytel, Primus etc., will<br />

register you for free if you want to restrict your calls to VoIP only within the same<br />

VSPs. If you want the ability to make to PSTN or between different VSPs, you may<br />

have to pay for the calls.<br />

All these “Major Expenses” will be recovered when you receive your monthly Telstra<br />

or Optus phone bills.<br />

1.1.2 What will the quality of the phone calls be<br />

If you are expecting the quality to be consistently as good as your existing PSTN<br />

calls, you will be somewhat disappointed, but if you will be happy with a quality that is<br />

comparable to your mobile phone, not quite but close to your existing PSTN calls and<br />

also be prepared for the whining by the other half, the phone calls are not being as<br />

good, while you are leaching off the P2P, you might be in luck.<br />

VoIP via the Public Internet is very much dependant on a number of factors –<br />

available bandwidth not withstanding, your usage habit of the internet and LAN traffic<br />

and equipment quality, amongst others, also play very important roles.<br />

For further information please refer to the link below:<br />

http://forums.whirlpool.net.au/index.cfma=wiki&tag=VOIP_Quality<br />

1.2 WHAT IS TRIXBOX<br />

Trixbox is a collection of telecommunication utilities and tools compiled together to<br />

become an integrated IP PBX. The major components that make up Trixbox are;<br />

TRIXBOX-2 Without Tears Page 12 of 238


• Asterisk, the core PBX<br />

• Sugar, a CRM system<br />

• A2Billing – Calling Card platform<br />

• Flash Operator Panel, a screen-based operator’s console<br />

• Web Meet Me Control, a meet me conferencing control application<br />

• freePBX a web-based User Interface tool for Trixbox.<br />

• A report system – the part of freePBX that provides CDR reporting.<br />

• A Maintenance system, also part of Trixbox, which provides low level interfaces<br />

to some components and real time system information<br />

• CentOS R , a version of Linux related to a very well known Enterprise Linux (but<br />

<strong>without</strong> the branding and support).<br />

1.3 THE IP PBX COMPONENTS<br />

Four main components needed to set up VoIP PBX:<br />

• Trixbox, the Asterisk powered IP PBX<br />

• The phones (or softphones)<br />

• The VOIP gateway services that let you call other VOIP users and people on the<br />

PSTN.<br />

• Have a home network and broadband access with a router and hubs/switches if<br />

needed. If you are restricting the usage to PSTN only, you will not need the<br />

broadband, but then it will defeat the whole purpose.<br />

Trixbox-2 while essentially similar to the previous version 1.x, does consist some set-up<br />

differences that warrant explanation. I will attempt to describe the set-up of each of<br />

these. In most cases it does not matter if you are behind a firewall provided that you have<br />

all the appropriate ports forwarded correctly. You are not required to do anything special<br />

like running the IP PBX outside the NAT or in the DMZ. However, it is important to<br />

ensure that you have enough bandwidth (upstream and downstream) to carry voice<br />

traffic.<br />

1.3.1 The IP PBX<br />

You will need a computer to run the IP PBX. It is recommended that you run a<br />

dedicated PC for this purpose. The PC described below (minimum) will be sufficient<br />

to power the IP PBX in a small office or home environment. Therefore don’t throw<br />

away that old Pentium II clunker you have in the attic.<br />

• 350Mhz Pentium II PC or better (PIII 800 will give extra comfort).<br />

• 256MB RAM – the more the better<br />

• 4 GB Hard disk space - minimum.<br />

• 10/100 NIC<br />

• CD-ROM Drive<br />

• 10/100 4 or 8 ports Ethernet hub/switch (not required if your router has spare<br />

ports)<br />

<br />

If you are using Telstra Alcatel SpeedTouch 510/530 ADSL Router, you will need<br />

to unbind port 5060. To do this, please refer to this link (or see Appendix D).<br />

http://www.sipgate.co.uk/faq/index.phpaktion=artikel&type=faq&rubrik=024&id=398&lang=de<br />

When you install Trixbox on this “old” computer, it will take it over – it starts by<br />

formatting all the hard disks (if you happen to have more than one), so make sure<br />

there is nothing on the machine that you want to keep. Detailed instructions are<br />

given in the installation section.<br />

TRIXBOX-2 Without Tears Page 13 of 238


1.3.2 Phones<br />

You can buy SIP phones from Grandstream, SNOM, and Cisco etc. Or you can buy<br />

an ATA (Analogue Telephone Adapter) produced by Linksys, Netcomm or Sipura and<br />

a few others, which enables you to use an analogue phone (the Linksys PAP2 will<br />

allow you to hang two analogue phones to it). The Netcomm and Linksys ATAs can<br />

be bought from Harris Technology and a number of VSPs.<br />

Register with a VSP such as Faktortel, Oztell, Pennytel and several other VOIP<br />

Service Providers (VSPs) or you may buy Engin locked ATAs from Harvey Norman<br />

and Dick Smith Electronic. The choice is yours.<br />

To get started, it is easiest to get a softphone and run it on another computer. See<br />

the section on installation of Softphone later in this document.<br />

1.3.3 SIP Gateway<br />

It is most likely that you want to communicate with others on the PSTN network, so<br />

you need to obtain a VOIP gateway service. Since part of the call is being carried on<br />

the circuit switched network, it costs real money. This means that you will have to<br />

pay for this part of the system.<br />

Setting up gateways will be covered in the installation section below.<br />

1.3.4 Home Network<br />

The fact that you are reading this and contemplating on installing Trixbox , I assume<br />

that you have a home network, a broadband service, and are set up behind a Router<br />

of some sort.<br />

You will need to pick a static IP address for your IP PBX that is on your home network<br />

e.g. 192.168.0.100. To keep it simple, please ensure that the Asterisk box is in the<br />

same network segment of your existing LAN.<br />

1.3.5 VOIP Service Providers<br />

If you are in Australia, the Whirlpool VOIP forum has a list of VOIP providers in<br />

Australia at the following link: http://forums.whirlpool.net.au/forum-replies.cfmt=370536<br />

TRIXBOX-2 Without Tears Page 14 of 238


2 INITIAL PREPARATION AND PLANNING<br />

Before setting up your IP PBX, it is recommended that you map out what your home (or<br />

small office) telephony requirements are.<br />

Compare the requirements with what facility you already have. You may find that you<br />

may need to provide extra facilities that you do not already have e.g. Network switches,<br />

router, ATAs or IP Phones and needless to say a suitable broadband service.<br />

For the purpose of this guide, I have determined that we will start with the following:<br />

• 2 extensions with voicemail using a Linksys PAP2 ATA<br />

• 1 extension using a Linksys SPA3000 ATA<br />

• 2 extension using Softphone (we will use these 2 extension for initial testing)<br />

• 3 extension using IP Phones<br />

• 2 VoIP service providers<br />

• 2 PSTN trunks – for the purpose of this exercise, I will be using a Linksys<br />

SPA3000 for one PSTN trunk and a X100P for the other PSTN trunk.<br />

• IVR<br />

• Music on hold<br />

• A number of customised voice prompts and announcements<br />

Once the above are set-up, I will customise it further with the following;<br />

• Time conditions<br />

• Ring groups<br />

• Follow me<br />

• Conference facility<br />

• DISA<br />

• Etc.<br />

In this exercise we will cover all of the above (not necessarily in the stated sequence) and<br />

we may also look at other possibilities as we go along, if time and/or resources permit.<br />

<br />

This is not an industrial grade installation. This installation is for training<br />

purposes only and to assist new hopefull to get started with Trixbox and nothing<br />

more.<br />

Once you are clear on what you want, you can start the installation in earnest.<br />

TRIXBOX-2 Without Tears Page 15 of 238


3 INSTALLATION<br />

A PC is a prerequisite. You can either install Trixbox in a virtual machine in your<br />

Windows based PC (there is a version of Trixbox for this) or install Trixbox on a dedicated<br />

PC. The later is recommended given that once it is set-up, we will need to leave the PC<br />

running and not burden it with other daily applications such as playing games, browsing<br />

the internet or doing the children school assignments.<br />

For stability, I will suggest that Trixbox be installed on a dedicated machine. This is what<br />

we are setting out to do.<br />

3.1 INITIAL INSTALLATION<br />

The Trixbox version that we will be installing is the latest current version available today –<br />

Trixbox 2.0. You will need to download the ISO from the Trixbox website below.<br />

http://www.trixbox.org/modules/smartsection/item.phpitemid=2/<br />

After you have completed the download,<br />

• Burn the ISO image that you have just downloaded to a blank CD.<br />

• Ensure that your PC will boot from the CD. If necessary change the BIOS<br />

settings to enabled this.<br />

• **NOTE: This will erase all data on the hard drives of the PC.<br />

If you have 2 drives, both may be blown away as well - beware.<br />

• Boot your Trixbox PC with the CD in the CD Drive and press enter. After a few<br />

seconds, the following screen will be displayed. You press F2 to see the various<br />

options. However, it is not really necessary. Just press [Enter] to start the<br />

installation<br />

• Press the Enter key to start the installation.<br />

TRIXBOX-2 Without Tears Page 16 of 238


• After initial system detection, you will be asked to select the type of keyboard that<br />

you will be using. Use your cursor keys to navigate the keyboard types and use<br />

the Tab key to move the focus to the OK or Back option. Select the appropriate<br />

keyboard. Selected us and move the focus to OK and hit [Enter]<br />

• After system hardware probing is completed, you will be asked to select the Time<br />

Zone you are in.<br />

• Use your cursor arrow keys to navigate to the appropriate time zone. In our case,<br />

we will selected Australia/NSW. Use the TAB key to move the focus to OK and<br />

hit [Enter] to accept (see cheat sheet to set NTP time manually).<br />

• Next you will be asked to enter your root password (remember this password).<br />

TRIXBOX-2 Without Tears Page 17 of 238


• After entering and confirming your password, installation will now commence by<br />

first formatting the Hard Disk/s.<br />

• From this point it will take about 30-45 minutes for the installation to be complete<br />

and ready for the configuration stage.<br />

• During this stage, you will see screens similar to the following. Linux and the<br />

required files are being installed. All you do is, wait for it to finish.<br />

• After Linux is loaded the CD will eject. Take the CD out and wait for the system to<br />

reboot.<br />

• When it reboots, you will be presented with the following screen.<br />

TRIXBOX-2 Without Tears Page 18 of 238


• After a moment, it will continue and you will see lots of lines of codes. This<br />

process will take a while because it is building Asterisk.<br />

• When Asterisk build is complete, it will reboot itself. Once rebooted, Trixbox is<br />

ready for you to continue configuring and make changes to the system default.<br />

3.2 CHANGE DEFAULT SETTINGS<br />

Once Trixbox has been installed, some changes need to be made to secure your<br />

installation.<br />

Log in to your new Trixbox (user: root, password: The one you gave earlier)<br />

<br />

Trixbox 2.0 uses freePBX 2.1.3. To take full advantage of the latest freePBX<br />

features, lets upgrade the existing freePBX to the latest version 2.2. See the section<br />

on upgrading freePBX. Once that is done we will come back here.<br />

TRIXBOX-2 Without Tears Page 19 of 238


3.2.1 To get Help<br />

At the command line, type<br />

help-trixbox<br />

A list of help will be displayed – see illustration below:<br />

<br />

The help screen will also tell you the necessary command required to<br />

change the password of the various default users e.g. passwd-maint for<br />

user maint and passwd for user root.<br />

3.2.2 Change IP Address (set IP address to Static)<br />

(If you are installing Trixbox v2.6.0.5, I suggest that you DO NOT use NetConfig, ins<strong>tea</strong>d<br />

use webmin or the Trixbox GUI to change your IP address because using NetConfig may<br />

cause you some problem)<br />

The following example is for those still using Trixbox v2.2.x or earlier on Centos prior<br />

to version 5. For Centos 5, please refer to the second part of this section.<br />

To change Asterisk IP address from DHCP to Static. At the command prompt enter:<br />

Netconfig<br />

You will see the following:<br />

TRIXBOX-2 Without Tears Page 20 of 238


Select [Yes] to set up networking and hit enter.<br />

You will then see the following screen.<br />

(If you are installing Trixbox v2.6.0.5, I suggest that you DO NOT use NetConfig, ins<strong>tea</strong>d<br />

use webmin or the Trixbox GUI to change your IP address because using NetConfig may<br />

cause you some problem)<br />

Use the Tab key to cycle through the fields. Enter the IP address that is to be<br />

allocated to the Asterisk box, the Netmask (subnet mask), Default Gateway, and<br />

Primary nameserve as per the example above. In my example above, I used my<br />

existing network regime.<br />

• In the IP address field, enter an IP address Trixbox making sure it is within your<br />

network range e.g.: 192.168.1.100<br />

• Netmask is normally 255.255.255.0 unless your network has different Network<br />

mask.<br />

• Default gateway IP is the address of your router. In my case, my router address<br />

is 192.168.1.1<br />

• Primary nameserver is the address of your Name Server, usually your domain<br />

server if you have a network domainserver but if you are running workgroup, use<br />

the address of your default gateway e.g.: 192.168.1.1<br />

Once done, select OK.<br />

TRIXBOX-2 Without Tears Page 21 of 238


Those using Centos 5 are advised to use the Trixbox GUI to change the IP address<br />

to a Static IP address (see illustration below).<br />

Hover mouse on the System tab and select Network.<br />

Select the appropriate interface device as per the illustration below.<br />

Change the IP address appropriately.<br />

Those are the initial inputs that require immediate attention. Others, such as Admin<br />

password etc, are optional although it is recommended that you change them. Once<br />

done, log off Linux and reboot.<br />

amportal stop<br />

Shutdown –r now<br />

Asterisk will now start with the new IP address.<br />

TRIXBOX-2 Without Tears Page 22 of 238


4 SET-UP TRIXBOX<br />

Now, using your browser, you can connect to http://ipaddress/ (e.g. http:192.168.1.100)<br />

to configure Trixbox .<br />

You will be presented with the Trixbox initial User Mode splash screen as illustrated<br />

below.<br />

This screen (once Trixbox has been properly set-up) enables users to monitors ARI, FOP<br />

(flash operator panel), Client Manager (SugarCRM) and setup personal MeetMe<br />

requirement.<br />

As it stands, Trixbox need to be configured before any of those facilities are operable by<br />

users.<br />

Initial Welcome Screen (User Mode) v2.2 – 2.6<br />

To start configuring Trixbox, it is necessary to switch to Admin Mode. To do this, click on<br />

the “switch” label situated on the top right hand corner of the screen (marked with an<br />

arrow in the illustration above).<br />

A username and password dialog screen will appear where the default username and<br />

password need to be entered as per the illustration below.<br />

The Username is maint and the default password is password, unless you have<br />

changed the default password for user maint to something else using the passwd-maint<br />

command in chapter 3.2 above.<br />

TRIXBOX-2 Without Tears Page 23 of 238


Log in to System Administration<br />

<br />

To log in to System Administration, use user: maint, password: password unless you<br />

have changed the user maint password during initial set up in 3.2<br />

Once you logged in, you will be presented with the following screen<br />

Admin Mode Initial Configuration Screen<br />

4.1 INSTALLING TRIXBOX MODULES<br />

In most cases, all the modules that you will required have already been installed as<br />

defaulty. However, should you need other modules that were not included, you may need<br />

to install them from the online repository. At this stage, it is unlikely that we will need<br />

other modules.<br />

To install the Trixbox modules, you will need to log on to the Package Manager site to<br />

enable you to get a list of all the available modules (see Unable to log to Packages).<br />

I am already registered to the site and therefore I simply need to enter my username and<br />

password to login otherwise registration will be required before one can log on to the<br />

Package Manager site.<br />

If you are new, click on the “Register” button and register. Simply follow the prompt.<br />

However if you are unable to register through this method (some Firefox users are having<br />

this problem – Ed Note. Since the new interface, neither Firefox nor IE is able to register<br />

this way), you will need to go to http://www.trixbox.org and register to be a member of the<br />

forum.<br />

TRIXBOX-2 Without Tears Page 24 of 238


It is this username and password that you that is required for you to successully log in to<br />

Packages database (Please don’t ask me why this is so).<br />

Once logged in, select/click on the “Packages” tab (marked with an arrow above) and the<br />

current package list will be downloaded as illustrated below.<br />

Most of the modules necessary to get Trixbox operational are already pre-installed and<br />

ready for the individual administrator to start setting-up. However there are other optional<br />

modules that can be installed if necessary, MySqlManager, tbm-phpmyadmin.noarch is<br />

one such example. Without this package you will not be able to get to phpadmin through<br />

the GUI.<br />

For this installation, we will simply use the standard default modules and for the purpose<br />

of the exercise, we will additionally install “webmin” using the module manager.<br />

To find the package, you may need to scroll down the list till you get to the package called<br />

“webmin noarch” adjacent to Trixbox update as per the illustration below and place a tick<br />

in the install box (in the illustration it was shown that the tick was in the update box<br />

because webmin was already installed and to upgrade to a new version, place a tick in<br />

the upgrade box ins<strong>tea</strong>d).<br />

TRIXBOX-2 Without Tears Page 25 of 238


Click the install or the upgrade button and webmin will be installed or upgraded.<br />

<br />

You will now have to wait for the installation to finish, as there is no progress<br />

indicator during the process. Patience is a virtue.<br />

How long you will need to wait depends on the number of modules that you selected. If<br />

you only select one module, it may only take a minute or so. If you selected more<br />

modules it will take much longer. Once done, we can focus on the rest of the chores.<br />

You are now ready to take the next step of installing freePBX modules as <strong>without</strong> these<br />

you will not have the GUI interface for managing Trixbox. There are other GUI interface<br />

that can be used but freePBX comes with Trixbox.<br />

<br />

Before you proceed further, it is a good idea to upgrade to the latest freePBX because<br />

by the time you install Trixbox, there is a good chance that there is a new version of<br />

freePBX. Besides, Trixbox did not come with the latest version of freePBX.<br />

To upgrade freePBX, go to the chapter relating to Upgrading freePBX.<br />

4.2 INSTALLING FREEPBX MODULES<br />

<strong>Free</strong>PBX is the GUI interface that Trixbox uses to manage the IP PBX.<br />

Before you can use freePBX you need to install all the modules that you require. You<br />

need to do this through freePBX.<br />

On the Trixbox Admin Mode screen, hover the mouse pointer over the Asterisk tab and<br />

select <strong>Free</strong>PBX from the dropdown list as illustrated below (see arrow).<br />

The following screen will appear.<br />

TRIXBOX-2 Without Tears Page 26 of 238


We are now in freePBX and this is where most of your configurations will take place.<br />

Select the “Module Admin” selection on the left.<br />

The next screen will then be presented with the list of available freePBX modules. Some<br />

of them will not be installed or enabled.<br />

It is up to you to select whichever modules you require to be installed in freePBX.<br />

If the orange bar as displayed above appears, simply ignore it for now.<br />

Start selecting all the modules that you want to install or enabled. To make it simple, let's<br />

install all the modules to start with (you can always remove modules or choose to disable<br />

some of the modules that you do not need at a later stage).<br />

<br />

You don’t have to select all the modules. Only select the modules that you need.<br />

Click 'Process' at the bottom of the list of modules once you have selected all of the<br />

modules.<br />

On the confirmation page, click 'Confirm.'<br />

TRIXBOX-2 Without Tears Page 27 of 238


You should get a page telling us that all modules were installed successfully. Then click<br />

return to go back to the modules list page.<br />

At this stage, click on the orange bar at the top of the page that says 'Apply Configuration<br />

Changes’ To confirm your intention, click on it.<br />

At the next prompt, select “Continue with reload” on the window that pops up. This<br />

reloads the Asterisk configuration and the orange bar will then go away.<br />

<br />

You will need to click on the orange bar anytime you make changes<br />

Before you go any further, you will check for modules updates that may be available or<br />

you may wish to include other extra modules that have been released since the<br />

installation of freePBX, online.<br />

TRIXBOX-2 Without Tears Page 28 of 238


We will go back to the Module Admin screen and lick on the “Check for update online”<br />

label as illustrated below.<br />

If there are updates that you need, simply select the necessary updated modules<br />

indicated in the list, click “Download and upgrade” radio button.<br />

The process is similar to the the initial installing and enabling of modules in the<br />

preceeding paragapgs.<br />

<br />

You can also uninstall or disable any module using this modular approach..<br />

On completion, an orange bar at the top of the page that says 'Apply Configuration<br />

Changes’ will appear. Now click on it to confirm your intention then click 'Continue with<br />

reload' on the window that pops up. This reloads the Asterisk configuration and the<br />

orange bar bar will then go away.<br />

You can now click on ‘Setup’ tab next to the “Tools” tab to get to the modules you have<br />

just activated and finally start to configure the Trixbox IP PBX.<br />

TRIXBOX-2 Without Tears Page 29 of 238


5 BASIC CONFIGURATION USING FREEPBX<br />

From now on, we will be configuring Trixbox using freePBX web GUI as this is where<br />

most of the actions will be.<br />

5.1 GENERAL SETTINGS<br />

The first thing you will need to do is select General Setting and set it up as illustrated<br />

below. It is self-explanatory so I will not try to explain, as it is quite minimal and nothing<br />

substantial that warrants explanation.<br />

Notice that the extra information that will define the way Asterisk behave, are also<br />

required in freePBX. Set the fields to the following (these are vital settings):<br />

Asterisk Outbound Dial command option:<br />

“r” which generate the ring when you dial out, or “m” if you want music ins<strong>tea</strong>d. There<br />

are other options of course – refer to the sub-chapter on Dial Command Options.<br />

TRIXBOX-2 Without Tears Page 30 of 238


Voicemail:<br />

Change the Direct Dial to Voicemail message type to something other than default - this<br />

will save you a lot of head scratching later on when you start using follow me etc. as your<br />

customs recorded message will not be played, ins<strong>tea</strong>d the default Asterisk message will<br />

be played back if you don’t change the setting.<br />

I have set mine to Unavailable.<br />

Country Indications: Australia<br />

Allow Anonymous Inbound SIP Calls Yes (if this is set you ‘No’, all inbound unidentified<br />

SIP calls will not be accepted).<br />

Generally the default values are sufficient to get you started. These values can be<br />

changed later to suit your purposes. However the value I have as example above is<br />

required to ensure that Trixbox will function as expected – at the very list, during the<br />

testing stages.<br />

Naturally, help is available. Hovering your mouse on the corresponding field description<br />

with a dotted underline (e.g. Asterisk Outbound Dial Command options) will display the<br />

purpose of the fields and the various switches related to it.<br />

See illustration below.<br />

After setting up the General Settings, click on Submit Changes button and the red bar on<br />

top of the screen for the change to take effect.<br />

5.1.1 Dial Command Options<br />

In the Asterisk Dial command option, you may customise your preference to the<br />

way asterisk behave e.g. if you want the caller to hear music ins<strong>tea</strong>d of the standard<br />

ringing sound, you may replace the “r” with an “m”. For further options, hover your<br />

mouse on the label and you will be informed of the other options.<br />

The following are the dial command options available to you but for now, lets leave it<br />

alone:<br />

TRIXBOX-2 Without Tears Page 31 of 238


Options:<br />

A(x)<br />

C<br />

d<br />

D([called][:calling])<br />

f<br />

g<br />

G(context^exten^pri)<br />

h<br />

H<br />

i<br />

L(x[:y][:z])<br />

m([class])<br />

M(x[^arg])<br />

Play an announcement to the called party, using 'x' as<br />

the file<br />

Reset the CDR for this call<br />

Allow the calling user to dial a 1 digit extension while<br />

waiting for a call to be answered. Exit to that extension<br />

if it exists in the current context, or the context defined<br />

in the EXITCONTEXT variable, if it exists.<br />

Send the specified DTMF strings *after* the called party<br />

has answered, but before the call gets bridged. The<br />

'called' DTMF string is sent to the called party, and the<br />

'calling' DTMF string is sent to the calling party. Both<br />

parameters can be used alone.<br />

Force the callerid of the *calling* channel to be set as<br />

the extension associated with the channel using a<br />

dialplan 'hint'. For example, some PSTNs do not allow<br />

CallerID to be set to anything other than the number<br />

assigned to the caller.<br />

Proceed with dialplan execution at the current<br />

extension if the destination channel hangs up<br />

If the call is answered, transfer both parties to the<br />

specified priority. Optionally, an extension, or extension<br />

and context may be specified. Otherwise, the current<br />

extension is used.<br />

Allow the called party to hang up by sending the '*'<br />

DTMF digit.<br />

Allow the calling party to hang up by hitting the '*'<br />

DTMF digit.<br />

Jump to priority n+101 if all of the requested channels<br />

were busy.<br />

Limit the call to 'x' ms. Play a warning when 'y' ms are<br />

left. Repeat the warning every 'z' ms. The following<br />

special variables can be used with this option:<br />

• LIMIT_PLAYAUDIO_CALLER yes|no<br />

(default yes) - Play sounds to the caller.<br />

• LIMIT_PLAYAUDIO_CALLEE yes|no -<br />

Play sounds to the callee.<br />

• LIMIT_TIMEOUT_FILE File to play when<br />

time is up.<br />

• LIMIT_CONNECT_FILE File to play when<br />

call begins.<br />

• LIMIT_WARNING_FILE File to play as<br />

warning if 'y' is defined. The default is to<br />

say the time remaining.<br />

Provide hold music to the calling party until a<br />

requested channel answers. A specific MusicOnHold<br />

class can be specified.<br />

Execute the Macro for the *called* channel before<br />

connecting to the calling channel. Arguments can be.<br />

specified to the Macro using '^' as a delimiter. The<br />

Macro can set the variable MACRO_RESULT to<br />

specify the following actions after the Macro is finished<br />

executing<br />

• ABORT Hangup both legs of the call.<br />

• CONGESTION Behave as if line<br />

congestion was encountered.<br />

• BUSY Behave as if a busy signal was<br />

TRIXBOX-2 Without Tears Page 32 of 238


n<br />

N<br />

o<br />

p<br />

P([x])<br />

r<br />

S(x)<br />

t<br />

T<br />

w<br />

W<br />

encountered. This will also have the<br />

application jump to priority n+101 if the 'j'<br />

option is set.<br />

• CONTINUE Hangup the called party and<br />

allow the calling party to continue dialplan<br />

execution at the next priority.<br />

• GOTO:^^ -<br />

Transfer the call to the specified priority.<br />

Optionally, an extension, or extension and<br />

priority can be specified.<br />

This option is a modifier for the screen/privacy mode.<br />

It specifies that no introductions are to be saved in the<br />

priv-callerintros directory.<br />

This option is a modifier for the screen/privacy mode. It<br />

specifies that if callerID is present, do not screen the<br />

call.<br />

Specify that the CallerID that was present on the<br />

*calling* channel be set as the CallerID on the *called*<br />

channel. This was the behavior of Asterisk 1.0 and<br />

earlier.<br />

This option enables screening mode. This is basically<br />

Privacy mode <strong>without</strong> memory.<br />

Enable privacy mode. Use 'x' as the family/key in the<br />

database if it is provided. The current extension is used<br />

if a database family/key is not specified.<br />

Indicate ringing to the calling party. Pass no audio to<br />

the calling party until the called channel has answered.<br />

Hang up the call after 'x' seconds *after* the called<br />

party has answered the call.<br />

Allow the called party to transfer the calling party by<br />

sending the DTMF sequence defined in features.conf.<br />

Allow the calling party to transfer the called party by<br />

sending the DTMF sequence defined in features.conf.<br />

Allow the called party to enable recording of the call by<br />

sending the DTMF sequence defined for one-touch<br />

recording in features.conf (default *1 in Asterisk v1.2)<br />

Allow the calling party to enable recording of the call by<br />

sending the DTMF sequence defined for one-touch<br />

recording in features.conf (default *1 in Asterisk v1.2)<br />

TRIXBOX-2 Without Tears Page 33 of 238


5.2 EXTENSIONS<br />

The number of extensions to be set up depends on you. You can have soft phones<br />

installed in 4 or 5 computers or mixture of ATAs and SIP SoftPhones. In this case, we<br />

have 8 extensions to be set up using ATA as well as softphone and IP phone as we have<br />

planned.<br />

It’s best to avoid the following extension numbers:<br />

<br />

200 - Park Notify<br />

300-399 - Reserved for speed dial (Backward compatible)<br />

666 - Reserved for FAX testing<br />

70-79 - Reserved for calls on hold (Definable)<br />

700-799 - Reserved for calls on hold (Definable)<br />

7777 - Reserved extension for incoming calls simulation<br />

5.2.1 Create Extensions<br />

To create extensions, do the following:<br />

1. Select the Setup Tab<br />

2. Click on Extensions<br />

3. Click on Add Extension<br />

4. From the drop down selection box, select Generic Sip Device since we are<br />

going to create a SIP extension<br />

5. Click Submit<br />

(see illustration below).<br />

Creating of SIP, IAX2, ZAP or Custom, can done from the Create Extension menu<br />

illustrated above:<br />

We need to create a few SIP extensons. Therefore you should select Generic SIP<br />

Device from the device drop-down list then click “Submit” as many times as you need<br />

to create extensions for.<br />

The illustration below is where you create the extension.<br />

You will notice a few fields that you will need to populate. The important ones are:<br />

TRIXBOX-2 Without Tears Page 34 of 238


• User Extension: 2000 (that’s the extension number I gave for reception)<br />

• Display Name: Reception<br />

• Secret: 2000 (for simplicity, I used the exten number as the secret password)<br />

I left the rest of the fields at their default values..<br />

Click Submit when done.<br />

Add Extension Screen<br />

Click on the orange bar on the top of the screen after every time you have submitted<br />

a new extension.<br />

Click on the Add Extension button to add more extensions.<br />

We will create 8 extensions;<br />

2000 - Main Reception<br />

2001 - Medical Centre Manager<br />

2002 - Dr. Stan Roberts<br />

2003 - Dr. Susan Forbes<br />

2004 - Dr. Francis Wong<br />

TRIXBOX-2 Without Tears Page 35 of 238


2005 - Admin Office<br />

2006 - Lab and X-Ray<br />

2007 - Courtsy Phone.<br />

For simplicity, we will allocate passwords to be the same as the extension numbers.<br />

Where Voicemail is enabled, we will allocate the same password as well (but you<br />

don’t have to. You may also nominate an email address for Voicemail Email<br />

Notification – it’s up to you). Voicemail will be covered in more detail a little later in<br />

this document.<br />

<br />

If you want this extension to be a remote extension, you will need to edit the<br />

extension and ensure that the entry under Device options reads Nat: yes.<br />

5.2.2 Enable Voicemail<br />

To enable voicemail on an extension simply "enable" it when you create the<br />

extensions from the freePBX GUI. If you require email notification of your voicemail,<br />

you may enter your email address in the email address field.<br />

In this case let us enable voicemail on extension 2001 (the Manager’s extension).<br />

Go back to the Extension Option of freePBX and click on extension 2001. Scroll<br />

down to the Voicemail and directory section and do the following:<br />

• Status: Enabled (use the drop down selection to select it)<br />

• Voicemail password: 2001 (to keep it simple we shall use the extension<br />

number)<br />

• Email address: Enter an email address of the person (only if you want email<br />

notification)<br />

• Email attachment: yes (mark the radio button)<br />

• Play CID: yes<br />

• Play envelope: yes<br />

• Vm context: default<br />

Click submit when done followed by the red bar on top of the scree.<br />

TRIXBOX-2 Without Tears Page 36 of 238


5.3 FOLLOW ME<br />

After setting up the extensions, you need to decide if you want Asterisk to call another<br />

pre-arranged extension, if the extensions called do not answer. This is where we will<br />

define it as per the illustrations below:<br />

To do this, select the Follow me option; Setup -> Follow Me.<br />

You will be presented with the following screen:<br />

.<br />

Select the extensions that you want to define (the extension selection is on the right of the<br />

screen). In this case, we will pick the Medical Centre Manager’s extension – ‘Manager<br />

add’<br />

In the screen that follows (see the illustration above), enter the following information.<br />

TRIXBOX-2 Without Tears Page 37 of 238


• Ring strategy: hunt (to call the numbers in sequence)<br />

• Extension List: 2001 (Manager’s extension) followed by Administration’s Office<br />

and the Reception (The reception will take down messages for the Manager).<br />

• Ring time: 40 seconds<br />

• Destination if no answer: Core – Hangup<br />

Every time the Manager’s extension is called, Asterisk will try to connect to extension<br />

2001 and if no answer, it will call Ext. 2005 followed by the Reception. If still no answer, it<br />

will simply hang up. During business hours, the reception will take down messages for<br />

the manager or the Doctors.<br />

Click “submit” followed by clicking the red bar on top of the screen to finalise this<br />

selection.<br />

5.4 RING GROUPS<br />

A ring group is a group of extensions that will ring when there is an external incoming call.<br />

You can even put your Mobile Phone number in the ring group if you want to. The<br />

0400123456# is the Medical Centre’s Manager phone (see illustration below). For mobile<br />

phone to work, you must have the appropriate route and trunk set up.<br />

You may not want a ring group – it’s entirely up to you. If you don’t require a ring group, you<br />

may ignore this section.<br />

When there is an incoming call to the ring group, the phones nominated in the selected<br />

group will ring. You may select different ring group for each of the incoming trunk or you<br />

may nominate the same group for all the trunks, in which case you will only need to define<br />

only one ring group.<br />

For simplicity, we will only defined 1 ring group for all incoming calls from all trunks – at<br />

this stage, let’s not get too fancy.<br />

We will create a ring group 600 for this purpose. Let’s call it AdminGroup as it rings all the<br />

phones related to the Administration of the Medical Centre. A single digit ring group is not<br />

recommended.<br />

We have included the Manager’s Mobile Phone number in as the last one in the group. If<br />

noone answer the call, Asterisk will simply hang up. Since the last number in the group is<br />

the Manager’s mobile phone, generally, the Mobile phone voicemail will take the message<br />

if the phon is not answered.<br />

The ring group screen is illustrated below:<br />

TRIXBOX-2 Without Tears Page 38 of 238


Now it’s a good time to set up your softphones.<br />

TRIXBOX-2 Without Tears Page 39 of 238


6 SET UP SOFTPHONES.<br />

There are a number of softphones available for use with PiaF. Some of them are free.<br />

The following are 2 examples of the free softphones.<br />

6.1 COUNTERPATH X-LITE SOFTPHONE<br />

X-Lite Softphones can be downloaded here:<br />

http://www.counterpath.com/xlitedownload.html<br />

After installing the softphone (assuming that users can install the softphone), we need to<br />

configure the sofphone.<br />

When you start X-Lite 3 for the first time, you will see the following screen.<br />

Click the Add button.<br />

You will then get the following screen.<br />

This is where you will enter your credential<br />

At the various fields, add the following:<br />

• Display Name: Your Name - not Ben<br />

Sharif ☺<br />

• User Name: Your extension number<br />

• Password: The password of the<br />

extension when you created it in Elastix<br />

• Authorization User name: The same as<br />

your User Name or extension<br />

• Domain: Your Elastix IP address<br />

Put a check mark in the Register with domain<br />

and receive incoming calls<br />

Make sure the Target Domain Radio Button is<br />

marked.<br />

For this purpose, that’s all you need to do and Click apply, OK and close at the next<br />

screen. You are now ready to use the X-Lite softphone.<br />

TRIXBOX-2 Without Tears Page 40 of 238


Sometime it is necessary to change the Honor setting in X-Lite for it to work correctly. To<br />

do this, you would need to go to the advance setting of X-lite.<br />

Those using X-Lite having this problem may have to make the following correction in the<br />

advance setting of X-Lite.<br />

How to get to the advance setting<br />

In X-lite:<br />

Dial ***7469 (SEND)<br />

This will bring up the advanced settings window<br />

Filter for honor<br />

Double click on the honor entry and change the value to 1<br />

6.2 BOL SIPPHONE<br />

I have found the BOL SIPPhone extremely<br />

simple to set up for use with Asterisk and it<br />

also has a call forward facility that I use from<br />

time to time.<br />

You may obtain a copy of the BOL 2000<br />

sipphone from the link below.<br />

http://www.bol2000.com/website_c/download/sip<br />

phone/BOL%20SIPPhone_EN.msi<br />

After downloading and set up you will see the<br />

following when it is run:<br />

To configure the softphone, click on the hammer icon and you will see the following.<br />

Profile Tab<br />

This is the only screen that is required to be<br />

filled in.<br />

These are the only information required:<br />

Account: <br />

Password: 3001 (I use the same number as<br />

password for simplicity. I use the same<br />

password when I set up the extension in<br />

Asterisk).<br />

Domain/Realm: <br />

Proxy: Your Asterisk network address e.g. 192.168.1.100<br />

Port: 5060<br />

Check the Auto Login and Keep Password.<br />

TRIXBOX-2 Without Tears Page 41 of 238


Then click OK.<br />

Audio & Video Tab<br />

Next Click on the Audio & Video Tab to ensure<br />

that audio properties set is consistent with the<br />

Audio card installed in your PC/Notebook.<br />

The illustration above depicts the sound device installed in my Notebook.<br />

• Click on the Tuning Wizard to tune your audio input and output.<br />

• Check Auto Send Video (if you are using Video). I checked it anyway.<br />

• Check Auto Receive Video (if you are using Video). I checked it anyway.<br />

Click OK<br />

Network Tab<br />

Ensure that your Internet Connection Type is<br />

set to LAN.<br />

You may ignore the Information of Network<br />

field.<br />

Click OK<br />

STUN Tab<br />

You may or may not need to use a STUN<br />

server. If you need to use it, click on the<br />

STUN tab and enter the STUN server you<br />

want to use. If you do, a list of publicly<br />

available STUN server is listed in the section<br />

referring to STUN Servers later in this<br />

document.<br />

In my case, I do not use STUN and therefore I left that section blank and Enable STUN<br />

check box un-ticked.<br />

Click OK to close.<br />

TRIXBOX-2 Without Tears Page 42 of 238


Call Forward<br />

This is pretty simple to set-up. To forward an unanswered call to this extension, all<br />

you need to do is click on the Call Forward tab and enter the telephone number you<br />

want to forward your incoming calls to. You have 3 options of call forwarding –<br />

Always, On Busy or On No Answer. However this facility is only available if your PC<br />

is on and the softphone is active.<br />

Click OK when done.<br />

You might want to set-up a couple of PCs with the softphone after which you may start<br />

testing your brand new Phone System by dialling each extension in turn.<br />

If you use one of the softphone and dial 7777, Asterisk will simulate an incoming call.<br />

Once done, you may test your softphone connection to Asterisk.<br />

If everything has been done as explained above, we should be able to make and receive<br />

calls between our internal extensions. If not, it is time to re-inspect what we have done<br />

above and make the necessary correction before attempting to go any further.<br />

Let’s take a break and test the soft phone extensions by making calls to each extension<br />

that we have created.<br />

TRIXBOX-2 Without Tears Page 43 of 238


7 TRUNKS TO THE OUTSIDE WORLD<br />

Making and receiving calls between internal extensions is one thing, but a telephony<br />

installation isn’t really an installation if you can’t receive and make calls to the outside<br />

worlds.<br />

To be able to do these, you will need at least one trunk to the outside world.<br />

This is a simplified guide to give the budding Trixbox users some understanding in setting<br />

up Trunks.<br />

<br />

Points to keep in mind.<br />

Beware!!! If you are using an ATA, please allow for what the ATA will be sending<br />

to asterisk when you are preparing you rules and patterns. If you want asterisk to<br />

take care of all the rules, it is best to ensure that your ATA is sending exactly what<br />

you dialled to Asterisk – just delete your dialling rule from your ATA and replace it<br />

with (**|*x.|x.|**x.)<br />

7.1 WHAT IS A DIAL PATTERN<br />

Dial patterns are part of Outbound Routing. They act like a filter for matching numbers<br />

dialled with trunks.<br />

The various patterns you can enter are similar to Asterisk's definition of them:<br />

• X — Refers to any digit between 0 and 9<br />

• N — Refers to any digit between 2 and 9<br />

• Z — Any digit that is not zero. (E.g. 1 to 9)<br />

• [Various] — Match only one character that matches any of the one in the square<br />

brackets. (E.g. [02-68*#] would match 0, any number between 2 and 6 inclusive,<br />

8, * and #. Or, another way of saying this would be 'Match * or #, or a number that<br />

isn't 1,7 or 9') –Avoid using this notation in your Trunk Dial Rule as it does not seem<br />

to work. Use this only in your Outgoing Route Dial Pattern.<br />

• . — Wildcard. Match any number of anything. Must match *something*.<br />

• | — This lets you use a '0 to dial out' (or '9' in the US) by matching anything<br />

before the line, but not sending it to the trunk.<br />

7.2 WHAT IS A TRUNK<br />

A trunk is the telephony service line that you will be using to make an external call on, e.g.<br />

the Telstra telephone line that you have at home is a trunk (or it can be used as a trunk if<br />

you wish but not necessarily so). A VOIP service provider (VSP) that you have signed up<br />

with is also a trunk.<br />

If you have paid for VOIP service to enabled you to make calls out through PSTN, you<br />

can use this as a trunk for that purpose otherwise, you can only use it for making calls<br />

using VOIP between subscribers of the VSP only (unless there are peering arrangements<br />

with other VSPs).<br />

You can have several trunks if you want to. You can have Telstra and/or Optus<br />

telephone lines and use them as trunks, and you can also have a few VSPs that you<br />

subscribed to as additional trunks.<br />

To make external, PSTN or VOIP calls; you must have at least one trunk.<br />

TRIXBOX-2 Without Tears Page 44 of 238


The reason why asterisk users have several trunks can be explained as follows:<br />

• Trunk (a) charges the best rate for Local calls but is expensive for Mobile calls and not so<br />

great for international calls.<br />

• Trunk (b) has great rate for international call.<br />

• Trunk (c) has good mobile rate and will allow 1300 numbers while the other 2 do not.<br />

A properly planned route will direct the phone calls you make to the appropriate trunk that<br />

will provide you with maximum effectiveness and savings.<br />

E.g. When you make a call to a Mobile phone, asterisk will route your call via trunk (c)<br />

while it will route your call to trunk (a) if you make a local call. Similarly, when you make<br />

an international call, asterisk will route your outbound call via trunk (b).<br />

7.3 TRUNKS AND OUTBOUND ROUTES – A CIRCUS OF CONFUSION<br />

To the uninitiated, Outbound Route Dial Patterns and Trunk Outgoing Dial Rules are<br />

2 areas of confusion. I will try to explain this in the simplest possible term.<br />

Each of these two works in conjunction with each other – they compliment each other<br />

when an outgoing call is being made.<br />

7.3.1 Outgoing Route Dial Pattern<br />

This is the pattern you normally will dial when you want to make a phone call.<br />

As an example, if you are living in Brisbane, and you are calling a friend who lives in<br />

Sydney, you will normally dial a number such as 02 91234567, however if that friend<br />

is in Victoria, you will need to dial 03 91234567.<br />

Since your VOIP provider does not discriminate where you are calling from or where<br />

you are calling to, it requires a universal type number to call so your call can be<br />

directed to the correct recipient.<br />

In most cases, the VOIP provider will need to dial the universal e164 format e.g.<br />

61291234567 for Sydney or 61391234567 for Melbourne. (61 being the code for<br />

Australia, 2 or 3 being the code for Sydney or Melbourne respectively, followed by<br />

the telephone number of your friend which is 91234567).<br />

Since you are dialling 03 91234567, asterisk only need to send 391234567 (<strong>without</strong><br />

the 0 prefix). Therefore in your Outbound Route Dial Pattern (lets call this Outgoing<br />

Route Domestic) you will need the following pattern:<br />

0|NXXXXXXXX<br />

That pattern tells Asterisk to send only 9 digits out of 10 dialled by not sending the<br />

first digit 0. Thus, if you dialled 0291234567, the number that will be sent to the<br />

Trunk will be 291234567.<br />

How will this then be translated to 61291234567 This is where the Trunk Outgoing<br />

Dial Rule comes in.<br />

7.3.2 Trunk Outgoing Dial Rules<br />

This is what the trunk is required to send to the VSP to make a successful call to the<br />

number you dialled.<br />

Using the above example, assuming that the VOIP service provider requires the full<br />

e164 format, Asterisk will need to add the missing Australian code 61.<br />

TRIXBOX-2 Without Tears Page 45 of 238


In your Trunk Outgoing Dial Rule, you will need the following pattern.<br />

61+NXXXXXXXX<br />

That pattern tells Asterisk to add 61 in front of the 291234567 before dialling the<br />

number via the trunk. For variations of patterns, see What is a Dial Pattern in the<br />

previous chapter earlier on in this document.<br />

7.4 LET’S CREATE THE VOIP TRUNKS<br />

To create a new trunk using freePBX, select Setup tab and then select the Trunks option<br />

from the vertical menu on the left.<br />

For this example, let’s create 2 SIP trunks; Pennytel and Oztell.<br />

Pennytel will be used for all International and mobile calls<br />

Oztell will be used for all local and mobile calls.<br />

To create a new Trunk, click on the Add Trunk option (first option on the right of the<br />

screen).<br />

General Setting (This applies to all the trunks):<br />

Outbound Caller ID: “Insert Your Name” (Must include the “ “ and )<br />

Maximum channels: Leave blank for maximum.<br />

In this example we will create a Pennytel and Oztell SIP Trunks, which we will call<br />

pennytel and oztell respectively. We will also define their dialling patterns.<br />

7.4.1 Pennytel<br />

In this example, we will use Pennytel for all international and mobile calls only.<br />

Pennytel requires numbers dialled to follow the international format Country code +<br />

area code + phone number. To call an overseas destination you would normally dial<br />

0011+country code + phone number. E.g. to call New Zealand is 0011 64 , and to dial France is 0011 33 . Since Pennytel only requires<br />

the country code and the phone number but does not require the 0011, the route (that<br />

we will create later) will not pass the 0011 to the trunk.<br />

We will require the following Outgoing Dialling Rules for this trunk, which instruct the<br />

trunk to dial whatever is sent by the appropriate route. This example is for dialling<br />

Malaysia with a country code of 60, and Australian Mobile phones.<br />

Pattern<br />

601XXXXXXXX<br />

60NXXXXXXX<br />

61+4XXXXXXXX<br />

Explanation<br />

This pattern tells Pennytel to dial all Malaysian Mobile numbers<br />

starts with 601 followed by 8 more digits.<br />

This pattern dials numbers start with 60 followed by a one-digit<br />

number in the range of 2-9 followed by 7 more digits.<br />

For dialling Australian Mobile phone. The 61 is the Australian<br />

Country code that will be added to the mobile phone number.<br />

In your Outgoing Dial Rules box, we will enter the<br />

following;<br />

601XXXXXXXX<br />

60NXXXXXXX<br />

61+4XXXXXXXX<br />

Next we need to create the Outgoing Setting, Incoming Settings and Registration for<br />

Pennytel.<br />

TRIXBOX-2 Without Tears Page 46 of 238


Outgoing Settings<br />

In the Trunk Name field we will enter the name of this trunk: pennytel<br />

In the Peer Details enter the following;<br />

Pennytel preferred codecs are: g729, gsm<br />

and g723 but g729 and g723 are not installed<br />

as default in TRIXBOX<br />

allow=alaw&ulaw&gsm<br />

canredirect=no<br />

canreinvite=no<br />

disallow=all<br />

host=sip.pennytel.com<br />

insecure=very<br />

secret= Password<br />

type=peer<br />

username=8880XXXX<br />

Incoming Settings<br />

In the User Context, enter the Pennytel User ID: 888XXXXX<br />

In the User Details we will have the following:<br />

canreinvite=no<br />

context=from-trunk<br />

fromuser=888XXXXX<br />

qualify=no<br />

secret= Password<br />

type=user<br />

username=888XXXXX<br />

Registration<br />

In the registration field, enter the following:<br />

888XXXXX:Password@sip.pennytel.com/888XXXXX<br />

After all these have been done, click on the Submit Changes button and click on the<br />

red bar across the top of the screen.<br />

<br />

It seems that Pennytel is rejecting Asterisk. To overcome this problem, it is<br />

necessary to add the following in the general section of your sip.conf.<br />

useragent = Trixbox<br />

The useragent can be any name, as long as it is NOT Asterisk.<br />

My sip.conf looks like this;<br />

; Note: If your SIP devices are behind a NAT and your Asterisk<br />

; server isn't, try adding "nat=1" to each peer definition to<br />

; solve translation problems.<br />

[general]<br />

port = 5060 ; Port to bind to (SIP is 5060)<br />

bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)<br />

disallow=all<br />

allow=ulaw<br />

allow=alaw<br />

; If you need to answer unauthenticated calls, you should change this next line to<br />

TRIXBOX-2 Without Tears Page 47 of 238


; 'from-trunk', rather than 'from-sip-external'. You'll know this is happening if when<br />

; you call in you get a message saying "The number you have dialled is not in service.<br />

; Please check the number and try again."<br />

context = from-sip-external ; Send unknown SIP callers to this context<br />

callerid = Unknown<br />

tos=0x68<br />

useragent = Trixbox<br />

; #, in this configuration file, is NOT A COMMENT. This is exactly how it should be.<br />

#include sip_nat.conf<br />

#include sip_custom.conf<br />

#include sip_additional.conf<br />

7.4.2 Oztell (SIP)<br />

Oztell requires the numbers dialled to follow international format Country code + area<br />

code + phone number. To call Sydney 67541234, Oztell requires it in the following<br />

format 61 267541234. To use Oztell family cheap rate you can also prefix it with 09.<br />

Therefore the dialling rule will be in this form:<br />

We need various patterns here:<br />

Pattern<br />

Explanation<br />

899060X. This pattern tells Oztell to dial the inter Oztell’s numbers<br />

This pattern dials numbers start with 60 followed by a one<br />

digit number 1-9 followed by other numbers minimum of 2<br />

60ZXX.<br />

digits from 0 -9. This can be an international number with a<br />

Country code of 60 followed by a number between 1 and 9<br />

inclusive.<br />

06612+NXXXXXXX Using the Oztell 06 rate to dial any NSW number.<br />

0661+NXXXXXXXX Using Oztell 06 rate to dial any Australian number.<br />

61+1300XXXXXX Dials 1300 numbers<br />

61+13ZXXX Dials 13 numbers<br />

61+1800XXXXXX Dials 1800 numbers<br />

In your Outgoing Dial Rules box, it will look like this:<br />

– this is simply an example based on my setting;<br />

yours will no doubt be different.<br />

899060X.<br />

60ZXX.<br />

06612+NXXXXXXX<br />

0661+NXXXXXXXX<br />

61+1300XXXXXX<br />

61+13ZXXX<br />

61+1800XXXXXX<br />

Next we need to create the Outgoing Setting, Incoming Settings and Registration for<br />

Oztell.<br />

Outgoing Settings<br />

In the Trunk Name, enter the name of this trunk: oztellsip (as an example)<br />

In the Peer Details we will need the<br />

following;<br />

You must enable all the codecs that you want to<br />

use through Oztell’s web page.<br />

allow=ulaw&alaw<br />

canredirect=no<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromuser=899060xxxxx<br />

host= sip2.syd.net2max.com<br />

insecure=very<br />

secret=Password<br />

type=peer<br />

username=899060XXXXX<br />

TRIXBOX-2 Without Tears Page 48 of 238


Incoming Settings<br />

In the User Context, enter the Oztell User ID: 899060XXXXX<br />

In the User Details enter the following:<br />

Registration<br />

canreinvite=no<br />

context=from-trunk<br />

fromuser=899060XXXXX<br />

insecure=very<br />

qualify=no<br />

secret=Password<br />

type=user<br />

username=899060XXXXX<br />

In the registration field, enter the following:<br />

899060XXXXX:Password@sip2.syd.net2max.com/899060XXXXX<br />

After all have been done, click on the Submit Changes button and click on the red<br />

bar across the top of the screen.<br />

6.4.3 Oztell (IAX)<br />

Since I have IAX trunk with Oztell, I might as well include my Oztell IAX trunk setting<br />

here for general information only just in case you also want to set up an IAX trunk.<br />

Note* Don’t forget to Forward UDP Port 4569 to your Asterisk IP address and edit your<br />

iax.conf file.<br />

Outgoing Settings<br />

In the Trunk Name, enter the name of this trunk: oztelliax (as an example)<br />

In the Peer Details we will need the<br />

following;<br />

Note: You must enable all the codecs that you<br />

want to use through Oztell’s web page.<br />

allow=ulaw&alaw<br />

disallow=all<br />

host=iax2.syd.net2max.com<br />

qualify=yes<br />

secret=Password<br />

type=peer<br />

username=899060XXXXX<br />

Incoming Settings<br />

In the User Context, enter the Oztell User ID: 899060XXXXX<br />

In the User Details enter the following:<br />

context=from-trunk<br />

secret=Password<br />

type=user<br />

Registration<br />

In the registration field, enter the following:<br />

899060XXXXX:Password@iax2.syd.net2max.com<br />

After all have been done, click on the Submit Changes button and click on the red<br />

bar across the top of the screen.<br />

TRIXBOX-2 Without Tears Page 49 of 238


The SIP Trunks screen in freePBX will look like the following illustration below:<br />

* For more trunk settings, please refer to APPENDIX B<br />

Now that you know what the trunk will do, you may proceed to the next chapters to<br />

create the Inbound and outbound routes.<br />

TRIXBOX-2 Without Tears Page 50 of 238


8 CALLS HANDLING<br />

8.1 INBOUND ROUTES (INCOMING CALLS)<br />

This is where the behaviour of incoming calls from all trunks is being handled.<br />

When an incoming call from PSTN or VoIP trunk is received, asterisk needs to know<br />

where to direct it. It can be directed to a ring group, an extension, Digital Receptionist<br />

(IVR) or Queue. For this purpose, Inbound Route needs to be set up.<br />

Select the Inbound Routes selection in the left bar of the screen.<br />

Initially, (since we have not created an IVR yet) we will set all incoming calls to be<br />

directed to Ring Group 600 as illustrated below (later on in this guide we will create a<br />

digital receptionist for this purpose and we will redirect all the incoming calls to the IVR).<br />

<br />

As a matter of fact, this can be the only Inbound Route that you will need if<br />

you deploy IVR (to be discussed later on). Besides, <strong>without</strong> this inbound<br />

route created, your 7777 simulated calls will not work.<br />

For our purpose, only put in the following data. The rest are optional.<br />

• DID Number: Leave blank<br />

• CID Number: Leave blank<br />

TRIXBOX-2 Without Tears Page 51 of 238


• Fax Extension: Disabled (I do not require fax facility here)<br />

• Privacy Manager: No<br />

• In the radio button, enable Ring Group 600 (AdminGroup). We want all<br />

incoming calls to ring the phones in the Admin group (see illustration below).<br />

For each extra trunk, a corresponding inbound route may be created (you don’t have to).<br />

All incoming calls from all the different trunks that you may have can have their own<br />

individual characteristic by judicious deployment of the time condition facility available in<br />

<strong>Free</strong>PBX (to be discussed later on).<br />

However, at least one Inbound Route must be created for Trixbox to answer incoming<br />

calls. This includes calls from PSTN trunk as well. The route that we have created above<br />

is precicely for this purpose.<br />

This route will handle the calls that come in <strong>without</strong> Trunk ID and calls from trunks that do<br />

not have an Inbound Route created (which includes all calls from PSTN and incorrectly<br />

created incoming route). We call this a “Catch-All” route, an Inbound Route with the DID<br />

Number and Calling ID Number fields left blank.<br />

As usual, you will need to click on the red bar on top of the screen after each time you<br />

submit a new Inbound Route.<br />

8.1.1 Inbound Route from ZAP Trunk<br />

To handle inbound calls from a ZAP trunk, enter the Zaptel Channel number in the<br />

zaptel channel field. This will determine which zap call be directed to where. If there<br />

are 4 FXO modles in a TDM400 card, the zap channels will be 1, 2, 3 and 4. Each<br />

FXO is a channel (this can be confirmed in zapata_auto.conf file).<br />

TRIXBOX-2 Without Tears Page 52 of 238


8.2 TIME CONDITIONDS<br />

You can create various time conditions and use these time conditions in conjunction with<br />

your Inbound Route to individualise each of the incoming trunk’s behaviour.<br />

TRIXBOX-2 Without Tears Page 53 of 238


You may create several time conditions and give each of the time condition a Short Name<br />

to identify it. These time conditions can then be assigned to each individual Inbound<br />

Route if you choose to do so or they can be nested.<br />

8.2.1 Simple Time Condition<br />

Unlike businesses, most private householders, ignore the time condition, ins<strong>tea</strong>d<br />

would prefer to direct all calls to an extension or selected extensions regardless<br />

whether it is day or night. If this is the case, you may ignore time condition<br />

altogether, ins<strong>tea</strong>d, use the inbound route to direct your incoming calls to individual<br />

extensions or to the digital receptionist. However, if you want to accept calls during<br />

the day but prefer callers to simply leave voice messages during the night, below is<br />

an example of a simple time condition that you can adopt where the time condition<br />

will send the calls to IVR during the hour of 8:00am and 8:00pm and anything outside<br />

the stipulated hours, the calls will be directed to your voicemail.<br />

• Add a new time condition by selecting Setup - > Time Condition - > Add<br />

time condition.<br />

• In the Time condition name field, give it a name eg: DayNight<br />

• Under Time to match, do the following:<br />

o Time to start: 08:00<br />

o Time to finish: 20:00<br />

o Week Day start: Monday<br />

o Week Day finish: Sunday<br />

• Under Destination if time matches, select IVR (or Core extension or ring<br />

group)<br />

• Under Destination if time does not match, select Core mailbox: eg<br />

voicemail box 2001 (if you have voicemail enabled for ext. 2001).<br />

• Submit and click on the red bar on top of the page.<br />

Once the above is done, go to Inbound Route, select the appropriate inbound route<br />

and under Set Destination, select Time Condition DayNight, submit and click the red<br />

bar on top of the screen.<br />

8.2.2 Complex Time Condition<br />

A slightly more complex one can also be crafted e.g: You want o accept calls only<br />

between 8:00am till 1:00pm and between 2:00pm and 5:30pm Monday to Friday and<br />

any other time you want to direct all the calls to voicemail.<br />

1. Add a morning time condition.<br />

• Add a new time condition by selecting Setup - > Time Condition - > Add<br />

time condition.<br />

• In the Time condition name field, give it a name eg: OfficeMorning<br />

• Under Time to match, do the following:<br />

o Time to start: 08:00<br />

o Time to finish: 13:00<br />

o Week Day start: Monday<br />

o Week Day finish: Friday<br />

• Under Destination if time matches, select IVR (or Core extension or ring<br />

group)<br />

• Under Destination if time does not match, select a core extension for the<br />

moment. We will need to change this later.<br />

• Submit and click on the red bar on top of the page.<br />

2. Add an afternoon time condition<br />

• Add a new time condition by selecting Setup - > Time Condition - > Add<br />

time condition.<br />

• In the Time condition name field, give it a name eg: OfficeAfternoon<br />

• Under Time to match, do the following:<br />

o Time to start: 14:00<br />

TRIXBOX-2 Without Tears Page 54 of 238


o Time to finish: 17:30<br />

o Week Day start: Monday<br />

o Week Day finish: Friday<br />

• Under Destination if time matches, select IVR (or Core extension or ring<br />

group)<br />

• Under Destination if time does not match, select Core mailbox: eg<br />

voicemail box 2001 (if you have voicemail enabled for ext. 2001).<br />

• Submit and click on the red bar on top of the page.<br />

3. Go back to time condition OfficeMorning and change the Destination if time<br />

does not match to: Time Condition OfficeAfternoon. Submit and click on the<br />

red bar on top of the screen.<br />

4. Once the above is done, go to Inbound Route, select the appropriate inbound<br />

route and under Set Destination, select Time Condition OfficeMorning, submit<br />

and click the red bar on top of the screen.<br />

What the inbound route will do is, as soon as an incoming call is accepted, it will be<br />

forwarded to the OfficeMorning time condition.<br />

If the time condition is met, it will then be forwarded to the IVR. On the other hand, if<br />

it does not match, it will be forwarded to time condition OfficeAfternoon.<br />

If it matches the OfficeAfternoon time condition, the call will be forwarded to IVR, if<br />

not, it will be forwarded to the voicemail box that you have determined.<br />

Following the above example, time conditions can be nested to multiple levels deep<br />

allowing you to manage your time condition and make them as complex or as simple as<br />

the situation demands – imagination is the only restricting factor.<br />

8.3 OUTBOUND ROUTES<br />

8.3.1 What is an Outbound Route<br />

An outbound route works like a traffic cop giving directions to road users to use a<br />

predefined route to reach a predefined destination.<br />

8.3.2 How does it work<br />

Every time you dial a number, asterisk will do the following in strict order:<br />

• Examine the number you dialled.<br />

• Compare the number with the pattern that you have defined in your route 1<br />

and if matches, it will initiate the call using that trunk. If it does not match, if<br />

will compare the number with the pattern you have defined with route 2 and<br />

so on.<br />

• Pass the number to the appropriate trunk to make the call.<br />

<br />

To make an external call (except inter extension calls), you will need at least<br />

one trunk and one route.<br />

In this case we will create 5 routes:<br />

• International<br />

• Domestic<br />

• MobileAust<br />

TRIXBOX-2 Without Tears Page 55 of 238


• OztellOnly<br />

‣ The International Route will be used for all international phone calls.<br />

‣ The Domestic Route will take care of the Australian phone and mobile.<br />

‣ The other two will do as the names suggest.<br />

To create a new route using freePBX, select Setup tab and then select the<br />

Outbound Route option from the vertical menu on the left.<br />

Click on the Add Route in the menu on the right of the screen.<br />

8.3.3 International<br />

You will need the following pattern to match international dialing.<br />

Pattern<br />

0011|60NXX.<br />

0011|[7-9]XX.<br />

0011|NXX.<br />

Explanation<br />

Most of my International calls are to Malaysia, I have defined<br />

the Malaysian PSTN pattern here.<br />

This pattern dials all international numbers by prefixing it with<br />

0011 and any digit between 7 and nine inclusive. Before the<br />

number is sent to the trunk the 0011 will be stripped. If<br />

required by the trunk, the trunk will insert the 0011.<br />

This is the catchall international dialling including International<br />

Mobile (excluding USA which is a 1).<br />

TRIXBOX-2 Without Tears Page 56 of 238


In your Dial Patterns box, you will see something like this.<br />

Dial Patterns<br />

0011|60NXX.<br />

0011|[7-9]XX.<br />

0011|NXX.<br />

You will then need to pick the Trunk Sequence. In this case we will use Pennytel as<br />

the trunk for this route and if it fails, we will use Oztell as a second choice/backup.<br />

Trunk Sequence<br />

0 Pennytel<br />

1 Oztell<br />

Any number dialled with the 0011 prefix will be routed through the Astratel trunk and<br />

should it fail, it will be routed to Pennytel.<br />

8.3.4 Domestic<br />

You need the following pattern to match the Australian Telephone numbers and the<br />

Australian Mobile numbers.<br />

Pattern<br />

0|[23478]XXXXXXXX<br />

[2-9]XXXXXXX<br />

ZXX.<br />

Explanation<br />

You will dial Australian telephone number as normal<br />

using 03, 02 prefix but the route will strip the leading<br />

0 before it is sent to the trunk.<br />

If the trunk requires the 0, the trunk will insert it.<br />

If you dial local number and not use the STD prefix, it<br />

will send to the trunk as is and the trunk will insert the<br />

02 if required (this is a NSW pattern. If you are in<br />

Victoria you will need to modify the trunk).<br />

This is the catchall dialling for numbers that does not<br />

start with a 0 such as 1300, 1800, 13 etc.<br />

In your Dial Patterns box, you will see something like this.<br />

Dial Patterns<br />

0|[2378]XXXXXXXX<br />

[4689]XXXXXXX<br />

ZXX.<br />

You will then need to pick the Trunk Sequence. In this case we need Oztell as the<br />

trunk for this route and if it fails, we want Pennytel to take over as a second<br />

choice/backup.<br />

Trunk Sequence<br />

0 Oztell<br />

1 Pennytel<br />

All numbers dialled matching the above pattern will be routed through Oztell and if it<br />

failed, it will be routed via Pennytel.<br />

TRIXBOX-2 Without Tears Page 57 of 238


8.3.5 MobileAust<br />

There is only a single pattern for calling Australian mobile – illustrated below.<br />

Dial Patterns<br />

0|4XXXXXXXX<br />

We want all my domestic mobile calls to be routed via Pennytel and we have not<br />

nominated a second trunk. If it fails then we will not be able to make a Mobile call, as<br />

we don’t have a second trunk nominated.<br />

Trunk Sequence<br />

0 Pennytel<br />

8.3.6 Oztellonly<br />

The following pattern is in the Oztellonly route. We will use Oztell for a number of call<br />

types therefore some explanation may be in order.<br />

Pattern<br />

Explanation<br />

This pattern will allow me to dial a Malaysian Mobile number.<br />

The 0011 will be stripped before the number is sent to Oztell.<br />

0011|601XX.<br />

Oztell does not require the 0011. It only requires the Country<br />

code.<br />

You will dial Australian telephone number as normal using<br />

03, 02 prefix but the route will strip the leading 0 before it is<br />

0|[378]NXXXXXXX<br />

sent to the trunk.<br />

If the trunk requires the 0, the trunk will insert it.<br />

1[38]XX.<br />

This is for dialling 1300, 1800 and 13 numbers.<br />

899060XX. For dialling Oztell inter Oztell users<br />

NXXXXXXX Catchall for dialling a local number that doesn’t start with 1<br />

In the dial pattern box you will see something like the illustration below.<br />

Dial Patterns<br />

0011|601XX.<br />

0|[378]NXXXXXXX<br />

1[38]XX.<br />

NXXXXXXX<br />

Since the above pattern is for Oztell only, in my trunk sequence, Oztell was chosen to<br />

be the only trunk for any of these calls.<br />

Trunk Sequence<br />

0 Oztell<br />

TRIXBOX-2 Without Tears Page 58 of 238


8.4 ENUM<br />

ENUM is a way for us to use VOIP to establish calls between VOIP systems <strong>without</strong> using<br />

PSTN even though the numbers called are PSTN numbers provided that the numbers<br />

called are registered with ENUM. In short, ENUM offers you the ability to call other<br />

telephones directly over the Internet <strong>without</strong> involving a third party.<br />

I will not enter into any elaborate explanation how enum works, as there are already a<br />

number of articles describing this. In essence, your phone number and server information<br />

are stored in a special DNS zone (very similar to a reverse lookup zone). When an<br />

ENUM enabled Asterisk user calls your phone number, it will first attempt to find your<br />

phone number in the ENUM DNS zone. If it finds your phone number it will use the<br />

information to setup a call directly between his Asterisk server and yours, resorting to<br />

PSTN only if your number is not found.<br />

Note: ENUM only works between ENUM enabled Asterisk (or other ENUM enabled VOIP)<br />

users.<br />

8.4.1 Setting up ENUM Trunk<br />

1. Click the Add Enum Trunk link.<br />

2. In the Outbound Caller ID field enter your callerid information in the format of<br />

"Your Name" (Including the quotes), assuming your telephone<br />

number in Sydney is 0246123456.<br />

3. On the outgoing Dial Rule enter 612+NXXXXXXX (for local calls <strong>without</strong> having to<br />

dial the 02)<br />

4. On the second line enter 61+NXXXXXXXX (for dialling Australian numbers where<br />

you need to dial the prefix (eg. 03).<br />

5. On the next line enter ZXXXXXXXX. (including the dot) for dialling International<br />

numbers – see example below:<br />

6. Click the Submit Changes button at the bottom of the page<br />

7. Click the Apply Configuration Change at the top of the page.<br />

TRIXBOX-2 Without Tears Page 59 of 238


8.4.2 Setting up ENUM Outbound Route<br />

1. Click the Outbound Routes link on the left hand side.<br />

2. To create a new route, click on Add Route – the top option on the right side of the<br />

screen.<br />

3. Name the route eNUM.<br />

4. We will to use the prefix 164 to force dial through ENUM<br />

5. In the Dial Pattern, on the first line, we insert 1640|[378]NXX. This will allow us to<br />

dial an STD number such as 0732123456 by dialing 1640732123456 where only<br />

the 732123456 will be sent to the ENUM trunk.<br />

6. On the second line we insert 1640011|NXX. This will allow us to call an<br />

International number eg. To call Malaysia we will dial 16400116062861234 and<br />

only the 6062861234 will be sent to the ENUM trunk.<br />

7. On the third line I have 164|NXX. This enables me to dial NSW local number<br />

<strong>without</strong> having to dial 02.<br />

8. Make the ENUM trunk the first route in your Trunk Sequence. You may also<br />

add other trunks in the sequence in case ENUM failed.<br />

9. Click the Submit Changes button at the bottom of the page.<br />

10. Click the Apply Configuration Change at the top of the page.<br />

11. You may try calling someone while monitoring Asterisk CLI and you should see<br />

the Enumlookup scroll by.<br />

Click here for a Step-by-Step instruction on how to set up an ENUM account.<br />

<br />

There is a bug with freePBX 2.2.1 where ENUM trunk will not save. See<br />

ENUM Trunk won’r install under Bugs Report.<br />

TRIXBOX-2 Without Tears Page 60 of 238


9 CUSTOM CONTEXTS MODULE<br />

The custom contexts module currently is a beta module that must be manually installed.<br />

First a brief description of what custom contexts does (version 0.3.3):<br />

Custom contexts can be used to allow limited access to dialplan applications.<br />

Features:<br />

• Allows for time restrictions on any dialplan access.<br />

• Allows for pattern matching to allow/deny.<br />

• Allows for failover destinations, and PIN protected failover.<br />

• This can be very useful for multi-tennant systems.<br />

• Inbound routing can be done using DID or zap channel routing, this module<br />

allows for selective outbound routing.<br />

• Phones can be placed in a restricted context allowing them only internal calls.<br />

More info: http://aussievoip.com.au/wiki/freePBX-CustomContexts<br />

DOWNLOADING AND UNPACKING MODULE.<br />

Login on the Elastix box manually as user root and do the following:<br />

:<br />

cd /var/www/html/admin/modules<br />

wget http://www.freepbx.org/trac/attachment/ticket/1447/customcontexts-<br />

0.3.3.tgzformat=raw<br />

mv customcontexts-0.3.3.tgzformat=raw customcontexts-0.3.3.tgz<br />

tar -xzvf customcontexts-0.3.3.tgz<br />

rm -f customcontexts-0.3.3.tgz<br />

INSTALLING CUSTOM CONTEXT MODULE<br />

On the Trixbox/freePBX web interface click on Admin Setup Modules Admin<br />

At the Modules Admin screen, select Custom Contexts, select Install, click on Process.<br />

TRIXBOX-2 Without Tears Page 61 of 238


Confirm you action by<br />

clicking on the confirm<br />

button<br />

Click on the orange bar to complete the installation.<br />

ADD AND CONFIGURE NEW CUSTOM CONTEXT<br />

Add New custom Context: Admin Setup Custom Context<br />

To edit the custom-context,<br />

only select: Allow or Deny<br />

each context.<br />

To control any outbound call,<br />

select the route and from thes<br />

selection, select Allow or<br />

Deny.<br />

TRIXBOX-2 Without Tears Page 62 of 238


APPLY A CUSTOM CONTEXT TO EXTENSION.<br />

To finish, you use the custom context on<br />

Edit Extensions, Device Options.<br />

Reference<br />

http://aussievoip.com.au/wiki/freePBX-CustomContexts<br />

http://www.elastix.org/index.phpoption=com_openwiki&Itemid=27&id=installation#first_time_access_to_the_web_interface<br />

TRIXBOX-2 Without Tears Page 63 of 238


10 SYSTEM RECORDINGS<br />

System recording is a facility available under freePBX to enable the recording of<br />

customised voice prompts etc.<br />

By now we should be able to navigate ourselves through the freePBX menu. To get to<br />

the system recordings, select the Setup tab and pick System Recordings as per the<br />

illustration below.<br />

Clicking on the System recording label as highlighted by the red arrow will open the<br />

following “System Recordings” screen.<br />

There are two methods that you can capture your recording:<br />

TRIXBOX-2 Without Tears Page 64 of 238


• By recording directly using your telephone<br />

• Uploading pre-recorded materials<br />

10.1 DIRECT RECORDING<br />

Enter the extension number of the mouthpiece that you will be using to record your<br />

message in the appropriate field.<br />

You will be making your recording using the telephone on this extension (or the<br />

microphone of the softphone).<br />

Click Go.<br />

Follow the prompt on the screen and dial *77 on your phone to do your recording now.<br />

In my message, I have asked one of the receptionists to record the following:<br />

“Hi, you have reached the Family Health Centre. Press 1 for Reception, 2 for the<br />

Centre’s Manager, 3 for Dr. Roberts, 4 for Dr. Forbes, 5 for Dr. Wong, 6 for the Admin<br />

Office, 7 for Lab and X-Ray or you may simply hold and your call will be answered by one<br />

of our available receptionists. If no one answers your call, please leave a message”. -<br />

Then hang up.<br />

Verify the recording by dialling *99. Go to step 1 again if you are not happy with the<br />

recording. Keep doing this till you are satisfied.<br />

Once you are happy with the recording, give the recording a descriptive name e.g.<br />

“MainMenu” so you will know what the recording is for.<br />

Click Save.<br />

10.2 UPLOAD PRE-RECORDED MATERIAL<br />

TRIXBOX-2 Without Tears Page 65 of 238


If you have a recording that you have prepared in a .wav format you can simply upload<br />

that recording by browsing you local hard drive, locating the file that you want to upload<br />

and upload it to Trixbox.<br />

Follow the prompt for the upload and once again when the upload is completed, give the<br />

file a descriptive name for you to know what that recording is for.<br />

The above recorded files either recorded manually or uploaded using the system<br />

recording facility will be stored in the /var/lib/asterisk/sounds/custom directory.<br />

TRIXBOX-2 Without Tears Page 66 of 238


11 DIGITAL RECEPTIONIST<br />

Like most organisation, where possible, we would like to automate the redirecting of all<br />

incoming calls. The digital receptionist is very handy for these sorts of things. Unless the<br />

calls are non-specific and will need the assistance of the receptionist (in our case also the<br />

operator), the system should allow callers to make the selection.<br />

11.1 SETTING UP DIGITAL RECEPTIONIST<br />

In the Setup tab, click on the IVR option and get the following screen.<br />

Click on the Add IVR option on the top right on the screen (see arrow) and the new<br />

Unnamed IVR configuration screen will be presented to you.<br />

We will then fill in the following fields:<br />

TRIXBOX-2 Without Tears Page 67 of 238


Name (Change Name): MainMenu (that’s what we shall called the main menu)<br />

Timeout: 10 (leave it at default)<br />

Enable Directory: Tick<br />

Directory Context: Leave it at Default<br />

Enable Direct Dial: Tick<br />

Announcement: MainMenu (That’s what we called the IVR recording that was made for this<br />

purpose)<br />

(see illustration below)<br />

Then proceed to enter the selection options that you require for this IVR when the caller<br />

presses the appropriate option.<br />

If you need more choice options in the IVR, click on the Increase Options button at the<br />

bottom of the screen.<br />

In this IVR, we have defined our requirement as outlined below:<br />

For number 1 - 7, we select Extension, and for 8, which we have changed to the letter “t”,<br />

we also selected Extension.<br />

For 1, we will select the Reception (Extension 2000).<br />

For 2, select 2001, which is the Manager’s extension.<br />

For 3, select Dr. Roberts (Extension 2002)<br />

For 4, select Dr. Forbes<br />

For 5, select Dr. Wong<br />

For 6, select Admin Office<br />

For 7, select Lab and X-Ray<br />

For 8, (which we shall change to “t”) select extension 2000, which is the reception.<br />

TRIXBOX-2 Without Tears Page 68 of 238


The last extension (which we have changed to the letter “t”) is to capture timeout, if the<br />

caller does not press any option or, in case the DTMF tone does not register, the call will<br />

be sent to the receptionist.<br />

Once finished, click Save and also click on the Apply Configuration Changesed on the<br />

top of the screen.<br />

Test it by dialling 7777, (Asterisk will simulate an incoming call) and you will hear your<br />

Digital receptionist in action.<br />

TRIXBOX-2 Without Tears Page 69 of 238


11.2 MULTI-LANGUAGE IVR<br />

(This is included in this section as an example only and is not part of this tutorial. However you<br />

can use this if you want to. Besides, the latest <strong>Free</strong>PBX already has options for multi language<br />

implimentation.)<br />

Trixbox allows multi languages IVR handling by simply telling Trixbox what language to<br />

use. Naturally you will need to install all the language sets that you wish to use.<br />

See Installing Other Languages in the chapter referring to Customised Voice in later part<br />

of this document.<br />

I am assuming that you already have your MainMenu IVR in English set up for selecting<br />

various options. This IVR is known as IVR-2 in your extension_additional.conf file. Any<br />

subsequent IVR created will be IVR-3, IVR-4 and so on.<br />

You will need to create another IVR for selecting the language options that you want to<br />

present to the callers. This will be the IVR that will greet all callers with Select 1 for<br />

English, 2 for Italian etc. In this example, we will have 2 language sets, Australian and<br />

Italian. Let us name this second IVR LanguageChoice.<br />

Being the second IVR you have created, this IVR will be known as IVR-3 in your<br />

extension_additional.conf file. Any subsequent IVR created will be IVR-4 and so on.<br />

In LanguageChoice, we will have 3 options.<br />

• Select 1 for Australian English<br />

• Select 2 for Italian<br />

• The third option is unannounced as it will be the time out option represented by<br />

the letter “t”. This option is the option the IVR will defaulted to if no choice is<br />

made or if the caller’s DTMF tone is not recognised by Trixbox.<br />

In choice 1, select the Custom App: radio button and enter the following in the box:<br />

Custom App<br />

custom-language_au,s,1<br />

In choice 2, select the Custom App: radio button and enter the following in the box:<br />

Custom App<br />

custom-language_it,s,1<br />

The third choice, ins<strong>tea</strong>d of a number, you will enter the letter “t” in the option box, select<br />

Custom App: radio button and enter the following:<br />

Custom App<br />

custom-language_au,s,1<br />

Next, you will need to do a little editing of the extensions_custom.conf file. You need to<br />

add the following towards the end of your extensions_custom.conf.<br />

You will also need to create another IVR called MainMenu_IT with options to be<br />

presented in Italian. This is similar to your main IVR except that it is presented to the<br />

caller in Italian. This IVR being the third that you have created will be referred to as IVR-4<br />

in the extensions_additional.conf file.<br />

[custom-language_au]<br />

exten => s,1,Set(LANGUAGE()=au)<br />

exten => s,n,Playback(vm-dialout)<br />

exten => s,n,Goto(ivr-2,s,begin)<br />

[custom-language_it]<br />

TRIXBOX-2 Without Tears Page 70 of 238


exten => s,1,Set(LANGUAGE()=it)<br />

exten => s,n,Playback(vm-dialout)<br />

exten => s,n,Goto(ivr-4,s,begin)<br />

Save it and re-read the configuration change and you are done.<br />

Now you will need to change your inbound route to point to the LanguageChoice IVR.<br />

All calls will then be greeted by the LanguageChoice IVR and when the caller select 1 (or<br />

2), the IVR will call the appropriate exten. If the caller selected 1, the [customlanguage_au]<br />

will be selected and the language will be set to Australian English, an<br />

announcement in the appropriate language will be made and the caller will be sent to the<br />

MainMenu (or MainMenu_IT) for call options (you must also have recorded the call<br />

options announcement in the various languages).<br />

11.2.1 Complimentary multi-language MOH<br />

To take the multi-language IVR one step further, we can also have multi-language (or<br />

multi category) MOH to compliment the language.<br />

If the language used is Italian, it is safe to assume that the caller is Italian and would<br />

much prefer to listen to Italian music ins<strong>tea</strong>d of Chinese or Arabic music.<br />

To do this you will need to have the appropriate MOH music in Trixbox.<br />

Assuming that you already have the default music category that comes with Asterisk,<br />

you will need to create a new music category using freePBX On Hold Music option.<br />

Let us call this new category ItalianTune.<br />

See the chapter relating to MOH in the later chapter of this document.<br />

Once you have created this category, upload a few MP3 Italian music/Tunes to it. If<br />

you want the tune to be randomised, click the Enable Random button and you are set<br />

to go.<br />

You will need to modify the 2 scripts above to the following:<br />

[custom-language_au]<br />

exten => s,1,Set(LANGUAGE()=au)<br />

exten => s,n, SetMusicOnHold(default)<br />

exten => s,n,Playback(vm-dialout)<br />

exten => s,n,Goto(ivr-2,s,begin)<br />

[custom-language_it]<br />

exten => s,1,Set(LANGUAGE()=it)<br />

exten => s,n, SetMusicOnHold(ItalianTune)<br />

exten => s,n,Playback(vm-dialout)<br />

exten => s,n,Goto(ivr-4,s,begin)<br />

You may have to restart asterisk after this (although it may not be necessary).<br />

Now you will have multi language IVR as well as the complimentary MOH.<br />

TRIXBOX-2 Without Tears Page 71 of 238


11.3 MULTI-TENANTS IVR<br />

(This is included in this section as an example only and is not part of this tutorial. However you<br />

can use this if you want to).<br />

While freePBX is a very versatile GUI front-end for Trixbox it does not have the facility to<br />

configure a PBX for multi-Tenants application. However, Trixbox (Asterisk) has the<br />

ability to do it with a little creative manipulation.<br />

In the chapter above we covered multi languages IVR handling by simply telling Trixbox<br />

what language to use. We are going to use the same principal to handle the Multi-<br />

Tenants requirement.<br />

In this example, I will use a Medical Centre in Malaysia, that I have the privilege of<br />

installing the Asterisk PABX for. There are 3 tenants involved – a General Practitioner, a<br />

Dental Practitioner and a Pathology representative. Each has separate incoming<br />

telephone numbers with their own receptionist but using a common PABX.<br />

I have picked this organisation as an example because it is small enough to write about.<br />

If I choose one of my bigger installations, this book will never see the light of day ☺<br />

The main requirements are pretty straightforward:<br />

• Calls that come in through the different tenants should be directed to the<br />

appropriate IVR. One IVR for each tenant.<br />

• 12 extensions - 4 for Dental Practitioner, 3 for Radiologist and 5 for General<br />

Practitioners.<br />

• Voicemail for each receptionist.<br />

There are other requirements such as multi language prompts, after-hours ring groups,<br />

time conditions, Interlinking 2 Trixbox boxes between the Medical Centre and the<br />

Pathology Main Office in Kuala Lumpur etc., but I have only listed the major requirements.<br />

In this example I will only highlight the Multi-Tenants incoming route handling and<br />

restricting outgoing calls to the appropriate telephone lines only.<br />

The full case study can be found in the Appendix titled, Live Case Study at the end of<br />

this document.<br />

My first task was to install the base Trixbox as per the chapter on Installation. In this<br />

installation, there is no VOIP trunk involved. All telephone communications are through<br />

PSTN lines apart from the Trixbox inter-connect between the Medical Centre and the<br />

Pathology Main Office in Kuala Lumpur, which will be done via a DSL connection.<br />

PSTN Interface<br />

2 x TDM400 were installed in the PC designated for the PBX<br />

• 3 ports allocated to the General Practitioners (ports 1-3)<br />

• 3 ports allocated to Dental (ports 4-6) and<br />

• 2 ports allocated for Pathology (ports 7-8).<br />

IVR Prompts<br />

3 x IVR were created, one for each of the different tenant.<br />

• MedicalIVR (represented by ivr-3 in extensions_additional.conf)<br />

• DentalIVR (represented by ivr-4 in extensions_additional.conf)<br />

• PathoIVR (represented by ivr-5 in extensions_additional.conf)<br />

TRIXBOX-2 Without Tears Page 72 of 238


Each IVR will act as a traffic cop to direct calls to the appropriate extensions belonging to<br />

each tenant.<br />

Inbound Routings<br />

• ZAP channels 1,2 and 3 (3 PSTN numbers for GP) routed to MedicalIVR<br />

• ZAP channels 4,5 and 6 (3 PSTN numbers for Dentist) routed to DentalIVR<br />

• ZAP channel 7 and 8 (2 PSTN numbers for the Pathology representative) routed<br />

to PathoIVR<br />

Extensions<br />

1. Extensions 2000 to 2004 allocated to GP<br />

• 2000 for Receptionist/Clerk with voicemail<br />

• 2001 for Doctor A<br />

• 2002 for Doctor B<br />

• 2003 for Surgery Room<br />

• 2004 for Dispensary<br />

Change the context of these extensions, from [from-internal] to [from-internal-medical]<br />

2. Extensions 3000 to 3003 allocated to Dental<br />

• 3000 for receptionist/clerk with voicemail<br />

• 3001 for Dentist A<br />

• 3002 for Dentist B<br />

• 3003 Spare extension<br />

Change the context of these extensions, from [from-internal] to [from-internal-dental]<br />

3. Extensions 4000 to 4002 allocated to Pathology<br />

• 4000 for receptionist/clerk with voicemail<br />

• 4001 for Radiographer<br />

• 4002 for Assistant<br />

Change the context of these extensions, from [from-internal] to [from-internal-pathology]<br />

Outbound Calls Handling context<br />

Create 3 different call handling contexts in the extensions_custom.conf configuration<br />

file.<br />

• [from-Internal-medical]<br />

• [from-internal-dental]<br />

• [from-internal-pathology]<br />

The purpose of these contexts is to restrict extensions belonging to each tenant to be<br />

confined to telephone lines belonging to that particular tenant when making external calls.<br />

See How to restrict outgoing calls in the Calls Handling chapter earlier in this document.<br />

All of the basic set up requirements above are explained in the various chapters of this<br />

book and should not present any difficulty to complete.<br />

Once the basic is completed, the rest of the variations and extras can be handled as per<br />

the individual requirement.<br />

TRIXBOX-2 Without Tears Page 73 of 238


12 GET UNDER THE BONNET<br />

<br />

Config files manual tweaks in this guide are meant for advanced users.<br />

Unless you have a compelling reason to do so, users are advised against<br />

any manual config file tweaks. Lately, it seems that you must restart<br />

Asterisk everytime you make changes to the config file.)<br />

Just as you think that all is OK, you realized something else requires attention. This is<br />

true with Trixbox as well.<br />

To do this we may need to edit some configuration files (.conf) that reside both in the<br />

/etc/asterisk directory and /etc directories. Configuration files in the /etc/asterisk are<br />

generally editable through Config Edit.<br />

To start editing the .conf files we need to hover on the Asterisk tab and select the Config<br />

Edit selection from the dropdown menu as illustrated below.<br />

Select Config Edit (marked with arrow) and we will see a new screen with a list of all the<br />

.conf files, which can be edited manually.<br />

Scroll down the page to find the file that needs to be edited.<br />

TRIXBOX-2 Without Tears Page 74 of 238


12.1 EDITING THE .CONF FILES<br />

A number of .conf files may require editing to get asterisk to work, depending on the<br />

individual requirements. In this guide, as a base, we will be looking at sip.conf, iax.conf<br />

(just in case you want IAX, but not really necessary if you are just running SIP),<br />

indications.conf, enum.conf, extensions_custom.conf, features.conf, zaptel.conf<br />

and modprobe.conf (the last 2 files live in the /etc directory and may need to be edited if<br />

you have a FXO card e.g. X100P installed. We will look at them later on under<br />

Interfacing Asterisk to PSTN).<br />

12.1.1 sip.conf<br />

[general]<br />

port = 5060 ; Port to bind to (SIP is 5060)<br />

bindaddr = 0.0.0.0 ; Address to bind to (all addresses on<br />

machine)<br />

disallow=all<br />

allow=g729 ; I add this in sip_custom.conf ins<strong>tea</strong>d<br />

allow=ulaw<br />

allow=alaw<br />

allow=gsm<br />

; the 2 lines below I added them in sip_custom.conf although<br />

; you can add them in sip.conf<br />

defaultexpirey=600 ; **Engin users: include this if necessary<br />

maxexpirey=3600<br />

; **Engin & BBP Global users: include this if necessary<br />

rtptimeout=60<br />

rtpholdtimeout=120<br />

qualify=yes<br />

progressinband=yes<br />

; If you need to answer unauthenticated calls, you should<br />

; change this next line to 'from-trunk', rather than<br />

; 'from-sip-external'.<br />

; You'll know this is happening if when you call in you get<br />

; a message saying "The number you have dialled is not in<br />

; service. Please check the number and try again."<br />

;context = from-sip-external ; Send unknown SIP callers to this context<br />

context = from-trunk ;


12.1.2 sip_custom.conf<br />

language=au<br />

videosupport=yes<br />

allow=g729<br />

allow=g723<br />

allow=h261<br />

allow=h263<br />

allow=h263p<br />

defaultexpirey=600<br />

maxexpirey=3600<br />

; **Engin users: include this if necessary<br />

; **Engin & BBP Global users: include this if necessary<br />

12.1.3 iax.conf<br />

In the general section, add the following lines if it is not already there:<br />

[general]<br />

delayreject=yes<br />

jitterbuffer=yes ; I placed this line in my iax_custom.conf ins<strong>tea</strong>d<br />

mailboxdetail=yes ; I placed this line in my iax_custom.conf ins<strong>tea</strong>d<br />

<br />

Every time you update freePBX, there is a good chance that changes or<br />

additions you have made in iax.conf will be overwritten. To avoid this, all<br />

additions I wish to make in iax.conf are made in iax_custom.conf<br />

12.1.4 iax_custom.conf<br />

; additions to iax.conf that would not get deleted if you<br />

upgrade freepbx<br />

;externip = or (one or the other NOT both)<br />

externhost = <br />

localnet = 192.168.1.0/255.255.255.0<br />

language=au<br />

delayreject = yes<br />

jitterbuffer = yes<br />

allow=g729<br />

allow=ilbc<br />

allow=g723<br />

12.1.5 Indications.conf<br />

In the general section ensure the following exist:<br />

[general]<br />

country = au ; (The default is country = us, therefore replace “us” with “au”)<br />

12.1.6 enum.conf<br />

[general]<br />

;<br />

; The search list for domains may be customized.<br />

; Domains are searched in the order they are listed here.<br />

TRIXBOX-2 Without Tears Page 76 of 238


;<br />

search => e164.arpa<br />

search => e164.org<br />

12.1.7 extensions_custom.conf<br />

If you have a ZAP trunk and you want to get an external line and be presented with a<br />

dial tone first before you dial the external line, you may add the following codes in the<br />

extensions_custom.conf file.<br />

The example below assumes that your ZAP is on channel 1.<br />

Immediately after the line following the [from-internal-custom] context, insert the<br />

following codes:<br />

exten => 0,1,Dial(ZAP/1/{EXTEN})<br />

exten => 0,2,Hangup<br />

This will allow you to dial 0 and you will get a second dial tone from PSTN. Following<br />

which you can dial a PSTN number that you wish to call.<br />

<br />

.<br />

If you're using a PRI line, you need to enable 'overlapdial' in<br />

/etc/asterisk/zapata.conf for this to work.<br />

12.1.8 features.conf<br />

(Ignore this if you are using using Trixbox v2.6.x with the latest <strong>Free</strong>PBX)<br />

The default features.conf included with Trixbox is fairly minimal. It is recommended<br />

that you reflect the following in your features.conf file. The extra keywords will come<br />

in handy later on.<br />

;<br />

; Sample Parking configuration<br />

;<br />

[general]<br />

; do not manually enter parkinglot config information, use the parkinglot module<br />

;<br />

; the parking_additional.inc file is auto-generated by the Parkinglot Module, do<br />

; not hand edit that file<br />

#include parking_additional.inc<br />

#include features_general_custom.conf<br />

transferdigittimeout =>3 ; Number of seconds(in seconds)<br />

; to wait between digits when transferring a call<br />

courtesytone = beep<br />

; Sound file to play to the parked caller<br />

; when someone dials a parked call<br />

xfersound = beep<br />

; to indicate an attended transfer is complete<br />

xferfailsound = beeperr ; to indicate a failed transfer<br />

;adsipark = yes<br />

; if you want ADSI parking announcements<br />

;pickupexten = *8 ; Configure the pickup extension. Default is *8<br />

featuredigittimeout = 800 ; Max time (ms) between digits for<br />

; feature activation. Default is 500<br />

[applicationmap]<br />

#include features_applicationmap_additional.conf<br />

TRIXBOX-2 Without Tears Page 77 of 238


; *** IMPORTANT NOTE ***<br />

; The original blindxfer was '#', and has been changed to '##' to avoid<br />

; issues with sending DTMF '#' to remote parties.<br />

[featuremap]<br />

blindxfer => ##<br />

disconnect => **<br />

automon => *1<br />

;atxfer => *2<br />

; Blind Transfer (default is # - change if having<br />

; problem with external DTMF that requires #)<br />

; Disconnect Call<br />

; One Touch Record<br />

; Attended Xfer<br />

TRIXBOX-2 Without Tears Page 78 of 238


13 CHECK YOUR SYSTEM<br />

After doing all of the above, you will no doubt feel frustrated if your VOIP does not work.<br />

The following are some basic steps for you to do – at least to ensure that your installation<br />

is running correctly and is registered to the appropriate VSP before you start doing<br />

anything more adventurous.<br />

There are two places where you can obtain a quick health report of your system – the<br />

System Process Status and the Asterisk Info screens.<br />

<br />

If you don’t have the Asterisk Info option, refer to the NOTES section on how to<br />

obtain this module.<br />

13.1 SYSTEM PROCESS STATUS<br />

First you must ensure that asterisk is well and running or you may not be able to make or<br />

receive any call.<br />

If all processes are running then your battle is half won.<br />

In Trixbox 2.6, the information can be obtained straight from the Admin Maintainance<br />

screen as soon as you change user mode to Admin mode – see red arrow in the<br />

illustration below..<br />

If any of the four services aren’t running, chances are something is wrong and your<br />

Asterisk will not be working correctly or not working at all. A probable cause can be<br />

wrong configuration of your zaptel drivers. If you don’t have a zaptel devise, you should<br />

try to disable the related .conf files.<br />

Ensure that the minimum requirements have been met. If the minimum requirements and<br />

the right type of hardware requirements have been met, and yet it is still not working, then<br />

maybe its time to start the installation again.<br />

Next, select and click Asterisk Info to verify your status.<br />

TRIXBOX-2 Without Tears Page 79 of 238


13.2 ASTERISK INFO<br />

From freePBX, select the Asterisk Tab and click on the Asterisk Information option as<br />

shown by the red arrow.<br />

When presented with the info page, select Show All. See illustration below.<br />

You will then be presented with the following screen.<br />

TRIXBOX-2 Without Tears Page 80 of 238


Scroll down to the SIP (or IAX if you are using IAX) section and ensure that you are<br />

registered to your trunks. You will only be able to make and receive external calls –<br />

hopefully - if you are registered.<br />

If all trunks are registered, you can be almost certain that at the very least, your Trixbox<br />

installation is working (although not necessarily that you can make or receive calls).<br />

In the majority of cases, if you have done everything as described in the preceding<br />

chapters, the chances of your installation working are pretty good. However there are<br />

always times when you think that the weather is going to be fine and yet you are pelted by<br />

a thunderstorm.<br />

If you are not able to make or receive calls, the most common causes are Trunk<br />

Registrations, the choice of Codec, Routings, and Dialling rules errors.<br />

Routings and Dialling rules are something that needs to be thought out logically with no<br />

simple way of determining, as different people has different requirements and different<br />

VSP have different dialling rules.<br />

TRIXBOX-2 Without Tears Page 81 of 238


14 INTERFACING ASTERISK TO PSTN<br />

A new issue has raisen its ugly head with Trixbox 2.2.4. Building Trixbox 2.2.4 from the<br />

ISO broke the zaptel install module. As a result, zapel module will not be found and<br />

consequently the zaptel cards will not be detected<br />

To remedy this, log in as root and do the following at the command line:<br />

yum clean all<br />

yum install zaptel*<br />

14.1 A100P FXO PCI CARD<br />

The X100P card is no longer being made, but there are many X100P compatible in the<br />

market – some good and some not so good. The cards I am using is the A100P variety<br />

from Openvox. The 3 A100Ps I use for testing and POC (in different boxes of course)<br />

have been working flawlessly for the last 7 months; unfortunately, since Asterisk no<br />

longer will be supporting the X100P officially, Openvox has stopped its production.<br />

.<br />

This card allows you to connect a POTS (plain Old Telephone System) line to your<br />

Asterisk box.<br />

OpenVox A100P Card<br />

If this card is added after Asterisk has been configured, it may be necessary to configure<br />

it by using the zaptel card auto-config utility so the correct zaptel driver will be set up. To<br />

do that, enter the following from the command line.<br />

Setup-pstn<br />

Restart Asterisk<br />

Shutdown –r now<br />

After restart run the following:<br />

genzaptelconf –s –d –v –c au<br />

Restart again.<br />

Shutdown –r now<br />

TRIXBOX-2 Without Tears Page 82 of 238


14.2 CREATE A ZAP TRUNK<br />

Next go into the freePBX web interface to create a trunk and you will notice that there is<br />

already a trunk called ZAP/g0. You need to edit this.<br />

1. Enter the phone number for you pots line in the Caller ID field<br />

2. Enter 1 for Maximum channels<br />

3. Set a dial rule you want for this trunk<br />

4. Select an outbound dial prefix to select this trunk when dialling<br />

5. Set the Zap Identifier to 1 (the default is g0)<br />

Once the card is configured, you must add a route for Incoming Calls or asterisk will not<br />

answer this line<br />

Click on Incoming Calls in freePBX and set up an incoming route. To make outbound<br />

calls you will need to set an outbound route as well.<br />

If you have this card installed, you may need to edit the following files (usually you don’t<br />

have to); zapata.conf, zapata-auto.conf, zaptel.conf and modprobe.conf. The last 2<br />

files live in the /etc directory – use a text editor (I use nano) to edit them as you cannot<br />

edit them through Config Edit.<br />

14.2.1 zapata.conf<br />

Under [channels] add the following lines:<br />

[channels]<br />

busydetect=yes<br />

busycount=6<br />

The above is to ensure that the line is hung up if there is no answer or busy after 6<br />

busy tones.<br />

For my installation to function correctly, I have also changed the following setting to<br />

obtain a good compromise on volume/echoing:<br />

rxgain=4 (you may have to experiment a little with this setting)<br />

txgain=2 (you may have to experiment a little with this setting)<br />

14.2.2 zapata-auto.conf<br />

Ensure the following exist in Zapata-auto.conf. It is located at the end of the file.<br />

context=from-zaptel<br />

group=0<br />

channel => 1<br />

Leave the rest of the file as it is.<br />

14.2.3 zaptel.conf<br />

Change the loadzone and defaultzone to “au”<br />

# Global data<br />

loadzone = au<br />

defaultzone = au<br />

TRIXBOX-2 Without Tears Page 83 of 238


14.3 OPENVOX A400P FXO/FXS CARD<br />

Like the A100P, this card allows you to connect a POTS (plain Old Telephone System)<br />

line to your Trixbox. Unlike the A100P, this card has 4 module ports that can be loaded<br />

with FXS or FXO modules. Channel 1 is the top RJ-45 on the back of the card. The<br />

illustration below is the OpenVox A400P card and 2 fxo modules. This card is 100%<br />

compatible with the TDM400 and is very reliable.<br />

If this card is installed after Asterisk has been loaded, you will need to configure it just like<br />

the A100P by using the following command on the command line:<br />

setup-pstn<br />

Restart Asterisk<br />

Shutdown –r now<br />

After restart run the following;<br />

genzaptelconf –v –c au (au is for Australia)<br />

Restart again.<br />

shutdown –r now<br />

14.3.1 zapata-auto.conf<br />

Next, using config edit, look in the zapata-auto.conf file and you will see a list of all<br />

your channels in your A400P. Set up the trunks as trunks and the extensions as<br />

extensions in freePBX.<br />

When you open the zapata-auto.conf file, it will look something like the illustration<br />

below.<br />

TRIXBOX-2 Without Tears Page 84 of 238


; Autogenerated by /usr/local/sbin/genzaptelconf -- do not hand edit<br />

; Zaptel Channels Configurations (zapata.conf)<br />

; This is not intended to be a complete zapata.conf. Rather, it is intended<br />

; to be #include-d by /etc/zapata.conf that will include the global settings<br />

;<br />

callerid=asreceived<br />

; Span 1: WCTDM/0 "Wildcard TDM400P REV E/F Board 1"<br />

signalling=fxs_ks<br />

; Note: this is a trunk. Create a ZAP trunk in AMP for Channel 1<br />

context=from-pstn<br />

group=0<br />

channel => 1<br />

; channel 2, WCTDM, inactive.<br />

; channel 3, WCTDM, inactive.<br />

; channel 4, WCTDM, inactive.<br />

If in the illustration it shows channel 1 is your Zap extension then add a zap extension<br />

for channel 1 in freePBX and if it shows your Zap trunk is channel 2 you should<br />

create a zap trunk for channel 2 in freePBX.<br />

Once this is done, reboot your PC and when Asterisk starts, use freePBX to add a<br />

route for incoming calls or asterisk will not answer your trunk. Similarly, to make<br />

outbound calls you will need an outbound route. Set them up as per setting up routes<br />

in the earlier chapters of this document.<br />

If you have this card installed, you may need to edit the following files: zapata.conf<br />

and zaptel.conf as per the X100P card in the previous section.<br />

14.3.2 modprobe.conf<br />

You may need to edit the modprobe.conf to add the necessary option for usage in<br />

Australia.<br />

You may use nano or WinSCP3 to edit /etc/modprobe.conf. Simply add the line in<br />

red at the bottom of the file as illustrated below.<br />

alias eth0 natsemi<br />

alias snd-card-0 snd-intel8x0<br />

options snd-card-0 index=0<br />

install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :<br />

remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0<br />

alias usb-controller uhci-hcd<br />

options wctdm opermode=AUSTRALIA<br />

Once this is done, execute the following command.<br />

modprobe wctdm<br />

If there is no error,<br />

reboot<br />

To ensure that you have the right mode operating, do the following at the command<br />

line:<br />

grep "AUTO FXO" /var/log/messages<br />

or<br />

dmesg<br />

TRIXBOX-2 Without Tears Page 85 of 238


You should see something like this:<br />

Mar 10 13:30:09 asterisk1 kernel: Module 0: Installed -- AUTO FXO (AUSTRALIA mode)<br />

Mar 10 13:30:09 asterisk1 kernel: Module 1: Installed -- AUTO FXO (AUSTRALIA mode)<br />

Mar 10 13:30:09 asterisk1 kernel: Module 2: Installed -- AUTO FXO (AUSTRALIA mode)<br />

Mar 10 13:30:09 asterisk1 kernel: Module 3: Installed -- AUTO FXO (AUSTRALIA mode)<br />

If you see an FCC mode then you will have an impedance mismatch.<br />

<br />

As of Zaptel Drivers 1.2.4, by selecting opermode=AUSTRALIA the zaptel drivers<br />

automatically add the "boostringer=1, fxshonormode=1". Also see Appendix E.3<br />

(Users Suggestions)<br />

14.4 IS THE A100P/A400P INSTALLED<br />

At the command line, run lspci and amongst others, you should see the following;<br />

00:0f.0 Communication controller: Motorola Wildcard X100P<br />

Determine if there is any conflict with other PCI hardware. If there is, you probably will<br />

need to replace or use another motherboard. If there is no conflict, make sure you have<br />

the kernel sources installed and rebuild the zaptel component.<br />

setup-pstn<br />

genzaptelconf –v –c au (au for Australia)<br />

ztcfg<br />

Once done, run zttool on the command line to ensure the the card is functioning.<br />

To confirm that zaptel is actually running, after reboot, log in to Asterisk and at the<br />

command prompt issue the following command to configure zaptel.<br />

genzaptelconf<br />

Then issue the following command;<br />

modprobe wcfxo<br />

If there is no error then your card has been detected. Prove it by issue the following<br />

command:<br />

dmesg<br />

You should see the following in amongst the messages;<br />

wcfxo: DAA mode is 'FCC'<br />

Found a Wildcard FXO: Wildcard X100P<br />

After that restart amportal.<br />

Amportal restart.<br />

Using your browser on another PC, connect to TRIXBOX and using the Asterisk Info<br />

option, check to see if zaptel is loaded.<br />

TRIXBOX-2 Without Tears Page 86 of 238


Chances are, Zaptel will be found.<br />

14.5 CALLER ID (CID) USING ZAP DEVICE<br />

The illusive CID has been a talking point and hair pulling exercise for many users. It has<br />

always been the case of “I have my ZAP trunk working fine but it is not sending the CID to<br />

my Softphone or SIP Phone”.<br />

The simple answers to this:<br />

• In Australia, for you to get Caller ID is actually having to apply to your Telco to<br />

have it activated on your line – this is not activated by default by your Telco<br />

(Optus or Telstra). If caller ID is not activated on your line, you will not get CID.<br />

• If you already have caller ID activated and still don’t get caller ID, it’s time to have<br />

a look at the ZAP configuration file. Typically you may have to look at<br />

zapata.conf and/or zapata-auto.conf.<br />

Naturally if you are using an X100P clone for your FXO, the following exercise will<br />

probably be futile as the X100P, even at the best of time will probably not handle the CID<br />

properly. However if you are using a more substantial device such as the A400P or<br />

TDM400, then this may possibly help you towards getting the CID passed correctly.<br />

(caveat: This solution may not necessarily work for your installation but you have nothing to<br />

loose if you try)<br />

A participant (Shane B) in the Whirlpool Forum provided the solution below that will<br />

correctly pass the CID to Asterisk and your telephones:<br />

You may need to set the following switches in your zapata.conf and zapata-auto.conf.<br />

14.5.1 zapata.conf<br />

usecallingpres=yes<br />

callwaitingcallerid=yes<br />

threewaycalling=yes<br />

usecallerid=yes<br />

hidecallerid=no<br />

relaxdtmf=yes<br />

14.5.2 zapata-auto.conf<br />

The following switches may need to be added to the existing ones.<br />

useincommingcalleridonzaptransfer=yes<br />

adsi=yes<br />

sendcalleridafter=2 ;you may need to add this switch<br />

After the above are done, restart Trixbox:<br />

Amportal restart<br />

If you are lucky, it should work. If not, you haven’t really lost anything.<br />

TRIXBOX-2 Without Tears Page 87 of 238


14.6 SIPURA SPA3000/3102 AS A PSTN INTERFACE<br />

To those new to the SPA3000, there is a simplified installation and configuration<br />

instruction by JMG Technology. While it is directed mainly at standalone ATA users, it<br />

gives a good insight of the Sipura SPA3000’s capabilities.<br />

I have come across a few people in the various forums wanting to use their Sipura SPA-<br />

3000s as FXO front-end to their TRIXBOX boxes. To help them in their endeavours, I've<br />

put the following together, as no one single source of information that I've found so far<br />

has a config that would actually work for me.<br />

14.6.1 Log in to SPA3000/3102<br />

Login to your SPA-3000/3102 as admin/advanced.<br />

Before you change anything, I'd suggest taking a snapshot (i.e. just save the .html<br />

page) of your current SPA-3000 configuration, just in case you ever need to refer<br />

back to your own customisations.<br />

If you're not already running the latest SPA-3000 firmware, then upgrade it to the<br />

latest version (at the time of writing, it's 3.1.5a). Take another snapshot for good<br />

measure. Nothing should have changed in your settings, except that you have a few<br />

extra options that you didn't have before.<br />

Now reset SPA-3000 back to factory defaults, because I'm only going to list the<br />

minimum changes required to keep things simple. Take another snapshot now too, in<br />

case you ever want to know what the defaults were.<br />

14.6.2 Change the settings<br />

System tab<br />

DHCP: No<br />

Static IP: something on your local subnet e.g.; 192.168.1.200<br />

NetMask: 255.255.255.0<br />

Gateway: your router's IP address e.g.; 192.168.1.254<br />

Primary DNS: your ISP's primary DNS address e.g.; 203.12.160.35<br />

Secondary DNS: your ISP's secondary DNS address e.g.; 203.12.160.36<br />

Regional tab<br />

Dial Tone: 400@-19,425@-19;10(*/0/1+2)<br />

Busy Tone: 425@-10;10(.4/.4/1)<br />

Reorder Tone: 425@-10;10(.2/.2/1)<br />

Ring Back Tone: 400@-19,425@-19,450@-19;*(.4/.2/1+2+3,.4/.2/1+2+3,0/2/0)<br />

Ring 1 Cadence: 60(1.5/3.4)<br />

Ring 3 Cadence:<br />

60(1.5/3.4,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.<br />

2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2)<br />

CWT8 Cadence: 30(.2/.2,.2/4.4)<br />

Hook Flash Timer Min: .07<br />

Hook Flash Timer Max: .13<br />

FXS Port Impedance: 220+820||120nF<br />

<br />

Delete all the Vertical Service Activation Codes.<br />

Line 1 tab<br />

Proxy: IP address of your Asterisk box e.g.; 192.168.1.100<br />

Register Expires: 60<br />

Display Name: Whatever<br />

TRIXBOX-2 Without Tears Page 88 of 238


User ID: Asterisk extension number e.g.; 2000<br />

Password: password for that extension<br />

Silence Threshold: medium<br />

DTMF Tx Method: INFO<br />

Hook Flash Tx Method: INFO<br />

Dial Plan: (**|*xx|**x.|000|0011xxxxxxxx.|0[23478]xxxxxxxx|09xxxxxx|1100<br />

|122[135]|1222xxxxxxx|12510[12]|12554|1[38]00xxxxxx|13[1-9]xxx<br />

|2xx|393xxxxxx|3xxxx.|[4689]xxxxxxx|899060xxxxx.) for example<br />

(**|*x.|x.|**x.) will work, but I like to do a bit of sanity checking, etc.<br />

PSTN Line tab (method 1)<br />

Proxy: IP address of your Asterisk box e.g.; 192.168.1.100<br />

Register: no<br />

Make Call Without Reg: yes<br />

Ans Call Without Reg: yes<br />

Display Name: No name<br />

User ID: PSTN<br />

Password: password<br />

Silence Supp Enable: no<br />

Echo Canc Enable: no<br />

Echo Canc Adapt Enable: no<br />

Echo Supp Enable: no<br />

FAX CED Detect Enable: yes<br />

FAX CNG Detect Enable: yes<br />

FAX Passthru Codec: G711u<br />

FAX Codec Symmetric: no<br />

FAX Passthru Method: None<br />

DTMF Tx Method: INFO<br />

FAX Process NSE: no<br />

Dial Plan 1: (S0) for example - it could be your phone number<br />

VoIP Caller Default DP: none<br />

PSTN Ring Thru Line 1: no<br />

PSTN CID For VoIP CID: yes<br />

PSTN Answer Delay: 2<br />

PSTN Ring Thru Delay: 3<br />

PSTN Ring Timeout: 4<br />

PSTN Hook Flash Len: .1<br />

Disconnect Tone: 425@-30,425@-30;1(.375/.375/1+2)<br />

FXO Port Impedance: 220+820||120nF<br />

On-Hook Speed: 26ms (Australia)<br />

Using method 1 above, it will be necessary for you to create an inbound route using<br />

the 0298765432 (or whatever you have defined) as your inbound route DID number.<br />

As this incoming call is identified by the (S0) in the dial plan 1 setting<br />

of your SPA3000, this can be directed to any extension by the inbound route.<br />

PSTN Line tab (method 2)<br />

Proxy: IP address of your Asterisk box e.g.; 192.168.1.100<br />

Register: no<br />

Make Call Without Reg: yes<br />

Ans Call Without Reg: yes<br />

Display Name: No name<br />

User ID: PSTN<br />

Password: leave blank<br />

Silence Supp Enable: no<br />

Echo Canc Enable: no<br />

Echo Canc Adapt Enable: no<br />

Echo Supp Enable: no<br />

FAX CED Detect Enable: yes<br />

FAX CNG Detect Enable: yes<br />

FAX Passthru Codec: G711u<br />

FAX Codec Symmetric: no<br />

FAX Passthru Method: None<br />

TRIXBOX-2 Without Tears Page 89 of 238


DTMF Tx Method: INFO<br />

FAX Process NSE: no<br />

Dial Plan 1:(S0) e.g. (S0


nat=no<br />

port=5061 for example<br />

type=user<br />

username=PSTN<br />

Leave "Register String" empty<br />

14.6.4 SPA3000 as an outbound PSTN Trunk<br />

To make PSTN calls using the SPA3000 you simply select the SPA3000 trunk, which<br />

you have named Telstra (see trunk name that you have given to this trunk above) as the<br />

first choice in your outbound route.<br />

Also see Eliminating echo problems in Appendix E.3 in Sipura SPA-3000<br />

14.7 SPA3000 REMOTE MANAGEMENT<br />

The SPA3000 can be managed remotely. To enabled remote management the<br />

following must be set as per the illustration below:<br />

Naturally you will have to use the appropriate IP addresses, port and your own<br />

password etc. The illustration above is for my system.<br />

<br />

If you are managing your SPA3000 remotely, you may encounter some<br />

difficulties displaying the pages or sometimes it just seems to hang. To solve this<br />

problem, you can try changing your TCP setting (I use TCP Optimizer) by<br />

setting the RWIN to something smaller eg. 10xMTU, i.e if your MTU is 1500, try<br />

setting your RWIN to 15000.<br />

TRIXBOX-2 Without Tears Page 91 of 238


14.8 USE STUN SERVER ON SPA3000<br />

To use a STUN server with the SPA3000, simply select the SIP tab on Admin<br />

Admanced mode and make the following changes. I use stun.xten.com, you may use<br />

any STUN server of your choice.<br />

a. Select SIP Tab<br />

b. Handle VIA received: no<br />

c. Handle VIA rport: no<br />

d. Insert VIA received: no<br />

e. Insert VIA rport: no<br />

f. Substitute VIA Addr: yes<br />

g. Send Resp To Src Port: yes<br />

h. STUN Enable: yes<br />

i. STUN Test Enable: no<br />

j. STUN Server: stun.xten.com (I use stun.xten.com, you may use<br />

whichever stun server you like)<br />

k. NAT Keep Alive: 15<br />

TRIXBOX-2 Without Tears Page 92 of 238


15 PSTN TO VOIP GATEWAY<br />

<br />

If you are using the later versions of Trixbox, the following instruction may not<br />

apply as you can create DISA from <strong>Free</strong>PBX option <strong>without</strong> having to resort to<br />

the manual configuration below – see DISA,<br />

Now that the SPA-3000 has been set-up to accept PSTN, TRIXBOX can be turned into a<br />

PSTN to VOIP Gateway. You will not need a SPA-3000 if you have an FXO card<br />

installed.<br />

I need such a gateway because I often have to call overseas from my office. Needless to<br />

say, we don’t make private overseas calls from the office phone. I overcame this by<br />

calling my Asterisk box from the office and when it answered, I can then use asterisk to<br />

call overseas.<br />

I accomplished this through DISA – I have resorted to this manual method because in the<br />

initial release of Trixbox , DISA did not work, as I would like it to. This has since been<br />

rectified<br />

To do this, I manually edit the extensions_custom.conf, by adding the following entries<br />

at the end of the file,<br />

[custom-pstn2voip]<br />

; I use this to call VOIP from PSTN<br />

exten => s,1,Answer<br />

exten => s,2,DigitTimeout(5)<br />

exten => s,3,ResponseTimeout(10)<br />

exten => s,4,Authenticate(my password)<br />

exten => s,5,DISA(no-password|from-internal)<br />

I have Digital Receptionist answers all incoming calls (refer to Digital Receptionist in the<br />

previous section).<br />

In the previous section I have 5 options in Digital receptionist e.g. Press 1 for Ben, 2 for<br />

Rohani, and 3 for Norsurya. I did not announce the 4th option as I use it for DISA and is<br />

only known to me, besides, it requires a password.<br />

For option 4, I chose the radio button next to Custom App. In the custom app field I<br />

entered custom-pstn2voip,s,1<br />

Custom App<br />

custom-pstn2voip,s,1<br />

When 4 is pressed, followed by the # key, during the announcement, the digital<br />

receptionist will ask for a password. On entering the correct password, the one defined<br />

in the example above, a dial tone will be heard. At this stage, you can start dialling the<br />

number you wish to call.<br />

Option 5, (which I have changes to the letter ‘t’, for timeout) is invoked if the caller does<br />

not select any option or if the DTMF tone is not recognised. This option can be directed<br />

to a Ring Group or to a human receptionist if you are using Asterisk in a business<br />

environment.<br />

TRIXBOX-2 Without Tears Page 93 of 238


16 DISA<br />

16.1 DISA - HAND CODING METHOD<br />

I use this function in my PSTN to VOIP gateway above.<br />

DISA (Direct Inward System Access) allows you to dial in from outside to the Asterisk<br />

switch (PBX) to obtain an "internal" system dial tone. You can place calls from it as if<br />

they were placed from within.<br />

Normally you can do this via the Digital Receptionist and enter the unannounced option<br />

number known only to selected callers.<br />

The caller enters his/her password, followed by the pound sign (#). If the password is<br />

correct, the user is then given system dial tone on which an external call may be placed.<br />

This type of access has SERIOUS security implications, and GREAT care must be taken<br />

NOT to compromise your security.<br />

The example below is how I have implemented my DISA.<br />

In my "MyMenu" that says, “Hi, you have reached the Sharif’s household. Press 1 for<br />

Ben, 2 for Rohani, 3 for Norsurya etc…” I have created an extra option – option 4 (best if<br />

you use a few digits) that has an "Action" of "Custom App", which reads, "custompstn2voip,s,1".<br />

Then in extensions_custom.conf, I have added (do this towards the end of the file).<br />

[custom-pstn2voip] < -- you can name it to whatever you like<br />

exten => s,1,Answer<br />

exten => s,2,DigitTimeout(5)<br />

exten => s,3,ResponseTimeout(10)<br />

exten => s,4,Authenticate(12345678)<br />

exten => s,5,DISA(no-password|from-internal)<br />

Change "12345678" to whatever digits you want your "DISA password" to be.<br />

The above is one way of doing it (the hard way). The easier way of doing it is through<br />

freePBX - see below.<br />

TRIXBOX-2 Without Tears Page 94 of 238


16.2 DISA – USING FREEPBX<br />

Those using Trixbox with freePBX as the User Interface will be able to configure DISA<br />

from freePBX <strong>without</strong> having to do the above manual configuration. The same thing can<br />

be achieved through freePBX as illustrated in the screenshot below.<br />

I have populated the various fields thus:<br />

• DISA name: PSTNVoIP (This is the name I gave to this application)<br />

• PIN: 1234 (or whatever you think is appropriate. This pin number will be asked<br />

when you want to use this service)<br />

• Response Timeout: 10 (time needed for a response from the you in seconds)<br />

• Digit Timeout: 5<br />

The rest you can leave at the default value.<br />

When you set up your digital receptionist, in the DISA dropdown selection, simply select<br />

PSTNtoVOIP as your DISA application.<br />

If you are using this method, there is a slight catch. When you choose the DISA option to<br />

call a number, you will be greeted with “Please enter your password followed by the<br />

pound key” and immediately you will get a dialtone. You may start dialling the password<br />

followed by # followed by the telephone number.<br />

E.g. If you have chosen to have a password e.g. 12345, and the number you wish to dial<br />

is 0292345678, you must dial the number thus: 12345#0292345678 <strong>without</strong> waiting for<br />

another dialtone, otherwise it will not dial out correctly and you will be wondering what<br />

happened. I hope this will be fixed up soon.<br />

TRIXBOX-2 Without Tears Page 95 of 238


17 OPERATOR PANEL<br />

Operator Panel is a switchboard type application for the Asterisk PBX. Typically, it runs<br />

on a web browser. It is able to display information about your PBX activity in real time.<br />

The Flash Operator Panel is the one that comes with TRIXBOX.<br />

Apart from Flash Operator Panel, There are a number of operator panels available. One<br />

that comes to mind can be found at SOFTPEDIA and another is HUDLite from Fonality.<br />

HUD will integrate nicely with TRIXBOX and the support for HUD is already integrated<br />

within TRIXBOX.<br />

17.1 FLASH OPERATOR PANEL (FOP)<br />

This is the standard Operator Panel that is already part of TRIXBOX – some loved it<br />

while some hated it.<br />

The layout is configurable (button sizes and colours, icons, etc). You can have more than<br />

100 buttons active per screen. It also supports contexts: you can have one server<br />

running and many different client displays (for hosted PBX, different departments, etc).<br />

It can integrate with CRM software, by popping up a web page (and passing the CLID)<br />

when a specified button is ringing.<br />

FOP can be activated either from within freePBX by clicking on the Panel tab on the top<br />

of the freePBX screen or from TRIXBOX User Mode Welcome screen.<br />

The following information are displayed on FOP:<br />

• Which extensions are busy, ringing or available<br />

• Who is talking and to whom (CLID, context, priority)<br />

• SIP and IAX registration status and reachability<br />

• Meetme room status (number of participants)<br />

• Queue status (number of users waiting)<br />

• Message Waiting Indicator and count<br />

TRIXBOX-2 Without Tears Page 96 of 238


• Parked channels<br />

• Logged in Agents<br />

Functions you can perform on FOP:<br />

• Hang-up a channel<br />

• Using drag-&-drop to transfer a call<br />

• Initiate calls by drag-&-drop<br />

• Barge in on a call using drag-&-drop<br />

• Set the caller id when transferring or originating a call<br />

• Automatically pop up web page with customer details<br />

• Click-to-Dial from a web page<br />

• Mute/Unmute meet-me participants<br />

For more details refer to: http://www.asternic.org/<br />

17.1.1 Setting the Admin Password<br />

It is recommended to change the FOP password to something easy and simple to<br />

remember such as the number 2 for example. The simple method is by logging in to<br />

your asterisk box either remotely using putty or directly on your box console.<br />

In this example, Putty is used to log in remotely to TRIXBOX . Once logged in,<br />

change the directory to /var/www/html/panel<br />

cd /var/www/html/panel<br />

Using nano as the editor, open the configuration file op_server.cfg<br />

nano op_server.cfg<br />

Go to the line that says security code=passw0rd<br />

(in FOP that comes with TRIXBOX , the default password is “passw0rd”)<br />

Replace the “passw0rd” with the password of your choice.<br />

security_code=cowscomehome<br />

Close off nano and putty. Open your web browser and go to FOP. You should now<br />

be able to click on the little lock, put in your password and you will see it lock up. Now<br />

you can begin to have some fun.<br />

17.1.2 Hang-up a Call<br />

You can end a call by clicking the big red button.<br />

17.1.3 Transfer a Call<br />

Simply drag the little telephone over to the new extension and it will transfer the call.<br />

17.1.4 Initiate a Call<br />

If you are lazy, like me, not bothered to pick up the phone and dial, you can drag and<br />

drop your little telephone to another extension it will start by ringing your phone, when<br />

you pick up and then it will ring the other extension. Once the destination phone is<br />

picked up it will initiate the call.<br />

17.1.5 Barge in or Create a Conference<br />

Say there is a call already going and you want to jump in. Well all you have to do is<br />

grab your little phone in the flash panel and drop it into the conversation and it will<br />

connect you. Great if you want to see if your employees are making lots of private<br />

calls.<br />

TRIXBOX-2 Without Tears Page 97 of 238


17.2 HUDLITE<br />

HUDLite from Fonality integrates very nicely with Trixbox and the HUD manager is<br />

already incorporated in Trixbox. It has most of the necessary functionalities (if not all) of a<br />

modern operator switch panel where you can handle such tasks as:<br />

• Answer Calls<br />

• Transfer calls<br />

• Hang up calls<br />

• Put calls on hold etc.<br />

• Monitor status of extensions just like the default FOP that comes with TRIXBOX<br />

and more.<br />

To install HUDLite server, you must log in to Package (Trixbox Packages Tab) and select<br />

to install HUDLite server from the Package Manager.<br />

Once that is installed, you may proceed to set up HUDLite Admin.<br />

17.2.1 Setting up HUDLite Admin<br />

To set up HUDLite Admin, you will need to mouse ove the Asterisk Tab and select<br />

HUDlite Admin selection from the dropdown menu as shown below.<br />

When clicked with the mouse, you will be presented with the following screen where<br />

you may populate it with new devices..<br />

Click on HUDlite Admin to populate it.<br />

You will be presented with the screen as illustrated below.<br />

TRIXBOX-2 Without Tears Page 98 of 238


To populate the HUDlite Admin, click on New device and the manage device fields<br />

will be expanded. This is where you enter the credentials of the extensions that you<br />

want to register with HUD Manager.<br />

In the manage device fields I have entered the following:<br />

Device: SIP2001 (the device for my extension)<br />

Ext: 2001 (my extension)<br />

Name: Ben Sharif (that’s my name if you don’t know)<br />

Username: 2001 (that’s the extension ID)<br />

Password: 2001 (I like it real simple)<br />

The other three fields are not mandatory and you can leave them blank.<br />

Click save.<br />

If you have more extensions to register, click on New device again and repeat this<br />

process as many extensions as you have.<br />

Once this is done, you may proceed to install HUDLite.<br />

17.2.2 Setting Up HUDLite<br />

After downloading, simply click on the EXE file and HudLite will be installed in your<br />

Windows XP machine. Select the Typical setup option.<br />

TRIXBOX-2 Without Tears Page 99 of 238


Once installed, run HUDLite you will be prompted to enter your Username and<br />

Password:<br />

Enter your username and password as required. I would enter one of my extension<br />

number here and the extension password.<br />

In my case I use my main office extension 2000.<br />

Username: 2000<br />

Password: 2000<br />

Click Next<br />

Next you will be asked for the server details. This is your TRIXBOX credentials.<br />

However in the password field, don’t use your server password, ins<strong>tea</strong>d use HUDLite<br />

default password of password.<br />

.<br />

In the Server name I entered my Trixbox IP address: 192.168.1.100<br />

Server password, I simply use the default password: password.<br />

(I strongly urge that you use the default password for this initial installation. You can change<br />

it later when you are more comfortable with tinkering around)<br />

Then click Finish.<br />

HUDLite will now start. Initially you will see just a blank hudlite screen like the<br />

illustration below, as it will take a few seconds for it to gather some details.<br />

TRIXBOX-2 Without Tears Page 100 of 238


After a few seconds, it will populate all the extensions that you have added in the<br />

HUD Manager.<br />

TRIXBOX-2 Without Tears Page 101 of 238


If any of the extension is being called or making a call, you will see it highlighted just<br />

like the main office extension on the top left corner (the main number rang as I was<br />

capturing the illustration).<br />

17.2.3 What if it does not work<br />

If after following the above instruction, and it does not work, make sure that you have<br />

the correct values in the setup above.<br />

Click on File -> Setting on the HUDLite screen, expand the Advanced setting and<br />

make sure that the fields are correctly set as the set-up instructions above.<br />

Username: 2000 (you may have different extension)<br />

Password: 2000 (you may have different password)<br />

Server Name: 192.168.1.100 (your Trixbox IP may be different from mine)<br />

Server Password: password (it must be password)<br />

Leave the other 3 fields at the default value.<br />

<br />

The default password for HUD admin is password.<br />

TRIXBOX-2 Without Tears Page 102 of 238


18 CALL PARKING AND TRANSFER<br />

Trixbox provides this facility through the Parking Lot facility of freePBX. If you want to<br />

allocate other extensions rather than the one pre-configured, simply change the<br />

appropriate Parking Lot extension number in the configuration screen. For this purpose<br />

we will leave it at the default extension number 70.<br />

18.1 CALL TRANSFER - MANAGED<br />

The definition of this facility is found in parking_additional.inc and it contains the<br />

following lines:<br />

parking_additional.inc<br />

;*** WARNING: DO NOT HAND EDIT THIS FILE IT IS AUTO-GENERATD ***<br />

;<br />

parkext => 70<br />

; What ext. to dial to park<br />

parkpos => 71-79<br />

; What extensions to park calls on<br />

context => parkedcalls ; Which context parked calls are in<br />

parkingtime => 60<br />

; Number of seconds a call can be<br />

; parked for (default is 45 seconds)<br />

The above script is being called from feature.conf.<br />

;<br />

; Sample Parking configuration<br />

;<br />

TRIXBOX-2 Without Tears Page 103 of 238


[general]<br />

; do not manually enter parkinglot config information, use the parkinglot module<br />

;<br />

; the parking_additional.inc file is auto-generated by the Parkinglot Module, do<br />

; not hand edit that file<br />

#include parking_additional.inc<br />

#include features_general_custom.conf<br />

[applicationmap]<br />

#include features_applicationmap_additional.conf<br />

; *** IMPORTANT NOTE ***<br />

; The original blindxfer was '#', and has been changed to '##' to avoid<br />

; issues with sending DTMF '#' to remote parties.<br />

[featuremap]<br />

blindxfer => ##<br />

disconnect => **<br />

automon => *1<br />

;atxfer => *2<br />

; Blind Transfer<br />

; Disconnect Call<br />

; One Touch Record<br />

; Attended Xfer<br />

The following are other options that you can include in the general section of<br />

features.conf if necessary.<br />

transferdigittimeout =>3<br />

courtesytone = beep<br />

; Number of seconds to wait between digits<br />

; when transferring a call (in seconds)<br />

; Sound file to play to the parked caller<br />

; when someone dials a parked call<br />

xfersound = beep<br />

; to indicate an attended transfer is complete<br />

xferfailsound = beeperr ; to indicate a failed transfer<br />

;adsipark = yes<br />

; if you want ADSI parking announcements<br />

;pickupexten = *8 ; Configure the pickup extension. Default is *8<br />

featuredigittimeout = 800 ; Max time (ms) between digits for<br />

; feature activation. Default is 500<br />

Each call parked will be parked at that extension +1 e.g. if you have 3 calls that you need<br />

to park, the first call parked will be parked at ext. 71, the next call will be automatically<br />

allocated ext. 72 and the next ext. 73 and so on.<br />

This is handy if you want to manage the calls to be transferred. After parking the call, you<br />

may call the person you are transferring it to and tell him/her that there is a call on<br />

extension 71. The person can then dial 71 and get the parked call.<br />

18.1.1 How is it done<br />

When you answer a call and want to transfer that call, do the following:<br />

1. Dial ##70 - the call will be transferred to a park extension and the number<br />

will be announced to you. In this case it will be 71. After the announcement,<br />

you may hang up and dial the extension of the person you wish to transfer<br />

the call to and inform him to dial 71 to accept the call.<br />

2. While all this is happening, the caller will be listening to the music on hold.<br />

3. If for any reason the person refused to take the call, you then hang up and<br />

dial 71 to pick up the call back to you and speak to the caller making the<br />

usual excuses “I am afraid Mrs. Roberts, Dr. Roberts is busy with his nurse and<br />

TRIXBOX-2 Without Tears Page 104 of 238


his office door is being locked from the inside” ☺ and the next time Dr. Roberts<br />

will always accept the calls from his wife.<br />

18.2 CALL TRANSFER – BLIND<br />

To do a blind call transfer (where you simply transfer the call and bad luck if the extension<br />

does not answer), you simply dial ## followed by the extension that the call is meant for.<br />

E.g. to transfer to extension 2001, you simply dial ##2001 and hang up.<br />

18.3 PUT A CALL ON HOLD<br />

Just like the managed call transfer above, you dial ##70 and after the parked extension<br />

announcement, you hang up. This is simply a work around for those that do not have the<br />

hold function on the telephone.<br />

When you are ready to take the call, dial 71 (or whatever the park extension is) and the<br />

call will be picked up again. While the call is being parked, the caller will be listening to<br />

your MOH music.<br />

18.4 CALL PICKUP<br />

Call Pickup is the ability to pick up a call on a phone that is ringing from other than the<br />

ringing phone. E.g. you are sitting at your desk and the phone in the next office is ringing<br />

but there is no one there to answer the phone. You then use the phone on your desk to<br />

pick up the call.<br />

There are two type of call pickups:-<br />

• Group call pickup<br />

This allows you to pickup a call from any ringing phone that is in the same pickup<br />

group as you. However, if there were more than one phone ringing, you would<br />

have no control over which call will be transferred to you.<br />

• Directed pickup<br />

This allows you to pickup a call that was made to a specific extension, such as<br />

when you are in another office and a phone rings in the general direction of your<br />

office. You are wondering if it is your phone that is ringing. In this case you<br />

simply dial the pickup number and your extension number. If the ringing phone is<br />

your phone, the call will be transferred to you.<br />

Group call pickup is typically invoked by dialling ** from another phone in the call pickup<br />

group.<br />

You can also change to *8 or to something else if you wish.<br />

see http://www.voip-info.org/wiki/view/Asterisk+config+features.conf<br />

18.5 FILTER YOUR INCOMING CALLS - ONLY ACCEPT KNOWN<br />

CALLS<br />

(Good for filtering Telemarketers and ex-girlfriends)<br />

For this purpose, the Privacy Manager option of the extension can be invoked, however I<br />

found that caller often get confused with the need to enter the 10 digits phone number as<br />

often they may have only 9 digits or more than 10 digits.<br />

I have opted for the Nerd Vittles method.<br />

TRIXBOX-2 Without Tears Page 105 of 238


There is a good article on this site http://mundy.org/blog/index.phpp=66 relating to filtering<br />

incoming calls and also some discussions here http://forums.whirlpool.net.au/forumreplies.cfmt=418909<br />

This feature will force callers to record their names before the calls will be parked. The<br />

extension that you nominate will ring and on answering, you will be informed that there is<br />

a call waiting for you in a parked extension e.g. 71.<br />

After receiving the call and if you wish to take the call, hang up and dial 71 and you will be<br />

connected to the caller. Otherwise, just hang up and the caller will just have to leave a<br />

message in the voicemail. Real nifty ☺<br />

This is how I did it with my Asterisk. Since I am pretty simple myself, I just take the low<br />

road make it really simple.<br />

I add the following scripts in my extensions_custom.conf<br />

[from-internal-custom]<br />

; I create this extension for silent Auto attendant 30-10-2005<br />

exten => 111,1,Answer ;<br />

exten => 111,2,Goto(who-r-u,s,1)<br />

(Note: DO NOT create extension 111 in freePBX. This is only a<br />

dummy extension)<br />

At the end of the extensions_custom.conf, I added the following 2 blocks of extra<br />

codes.<br />

; experimental as per above 30-10-2005<br />

[who-r-u]<br />

exten => s,1,Background(privacy-unident)<br />

exten => s,2,Background(vm-rec-name)<br />

exten => s,3,Wait(2)<br />

exten => s,4,Record(/tmp/asterisk-stranger:gsm|5|15)<br />

exten => s,5,Background(pls-hold-while-try)<br />

exten => s,6,Goto(parkedcalls,70,1)<br />

exten => s,7,VoiceMail(2001@default)<br />

exten => s,8,Playback(Goodbye)<br />

exten => s,9,Hangup<br />

[parkedcalls]<br />

exten => 70,1,Answer<br />

exten => 70,2,SetMusicOnHold(default)<br />

exten => 70,3,ParkAndAnnounce(asterisk-friend:/tmp/asteriskstranger:vm-isonphone:at-followingnumber:PARKED|40|local/2001@from-internal|who-r-u,s,7)<br />

exten => 70,4,Hangup<br />

(*The codes in red must be in one continuous line)<br />

I forward all calls that were parked to my existing extension 2001 (in bold type) and direct<br />

voicemail for unanswered calls to the same extension as well.<br />

Next I create a new extension using freePBX e.g. 222. Using a softphone, I connect to<br />

extension 222 and unconditionally forward all calls to extension 222 to extension 111 by<br />

dialling *72111<br />

I then direct all my incoming calls from my PSTN trunk to extension 222.<br />

TRIXBOX-2 Without Tears Page 106 of 238


The result is, when there is an oncoming call from PSTN, the call will be sent to extension<br />

222 and in turn, the call will be forwarded to extension 111.<br />

When the call gets to extension 111, the caller will hear a message saying that,<br />

“unrecognised calls are not accepted and asking the caller to record his/her name after the tone”<br />

(or something to that effect). After the caller has complied and press the # key, the call<br />

will be parked.<br />

Extension 2001 will be called by Asterisk. When you answer the call, Asterisk will<br />

announce that there is a call by on extension 71 (or 72 depending on<br />

how many calls are being parked). If you recognize the name recorded, or if you want to<br />

take the call, simply hang up and dial 71. You will be connected to the caller. While this<br />

is all happening, the caller will be put on hold listening to your MOH.<br />

If however you do not wish to accept the call, you simply hang up and do not dial 71. The<br />

caller will be asked to leave a message ins<strong>tea</strong>d.<br />

TRIXBOX-2 Without Tears Page 107 of 238


19 CONFERENCE<br />

Tele-conference can be configured through <strong>Free</strong>PBX Conference option.<br />

Conference is pretty easy to set up, as there is very little to do. However, to set up<br />

Conference, a Zaptel card may be required (at least in my case as I don’t seem to be able<br />

to get it working <strong>without</strong> a Zaptel card installed). In the latest Trixbox 2, this seems to<br />

have been resolved.<br />

The Conference function of Asterisk is similar to a Tele-conference call where multiple<br />

callers can call in and participate in a two-way conference like in a party room where<br />

everyone can talk and listen to one another or just to listen to a Tele-presentation.<br />

In Trixbox, there are 2 .conf files that relates to conferencing. They are:<br />

meetme.conf<br />

meetme_additional.conf<br />

meetme.conf<br />

Ensure that you have the following 2 lines (only 2 lines in the file):<br />

[rooms]<br />

#include meetme_additional.conf<br />

All these lines do is point to the meetme_additional.conf where the conference<br />

room extensions are being created when you create a conference room through<br />

freePBX conference setup option.<br />

meetme_additional.conf<br />

This is where the extensions for the meeting rooms are created. One line per room.<br />

You may have just one extension for your meeting room or you may have several<br />

meeting rooms. In my case, I have 1 meeting room and therefore my<br />

meetme_additional.conf contains the following extension:<br />

; Extensions for my meeting rooms<br />

conf => 8200|<br />

19.1 CREATE CONFERENCE<br />

<strong>Free</strong>PBX allows you to create one or more conference room through the Setup -><br />

Conference screen. All you have to do is fill in the appropriate fields on the screen and<br />

you are on your way to a voice conference.<br />

Naturally there are some options that you may wish to have for the conference room.<br />

They are entirely up to you. The main important things are for you to create the<br />

conference room number and the conference name for you to know what that<br />

conference room is for. The rest of the fields are optional.<br />

Below is what my conference configuration page looks like:<br />

TRIXBOX-2 Without Tears Page 108 of 238


• This conference room number is 8000<br />

• I call this conference room General<br />

• Users are not required to enter a PIN number to join the conference.<br />

• Admin PIN number is not required for the conference to wait for the leader to<br />

conduct the conference.<br />

• I don’t have a joining message greeting when someone joins the conference.<br />

• I have No in the leader wait option for the conference to wait for the conference<br />

chairman.<br />

• I require a user count so I have Yes in the user count field.<br />

• I need to be informed when a user joins or leaves the conference. I have Yes<br />

here.<br />

• The music on hold is also flagged as Yes as I want music on while waiting.<br />

Once these are done, from one of your phones dial, 8000 and you will be able to join the<br />

conference.<br />

You are now in the conference room and every time someone joins or leaves the<br />

conference, it will also be announced.<br />

To test this, go to another phone and also dial 8000. You should hear an announcement<br />

(if you are listening on the first phone), indicating that someone has joined the<br />

conference.<br />

If there are 2 (or more) of you, you will be able to talk to each other. If one of you hangs<br />

up, you will know about it.<br />

19.2 INVALID CONFERENCE NUMBER<br />

If you get this error, chances are, it is caused by not having a zaptel timing source. This<br />

often happens when you have upgraded your kernel, but you haven't recompiled your<br />

zaptel to suit.<br />

Here is the quick fix compliment of Rob, our freePBX guru.<br />

Log in to your Asterisk box as root, and at the command prompt, do the following:<br />

cd /usr/src/zaptel<br />

TRIXBOX-2 Without Tears Page 109 of 238


make install<br />

/etc/init.d/zaptel stop<br />

/etc/init.d/zaptel start<br />

TRIXBOX-2 Without Tears Page 110 of 238


20 VOICEMAIL<br />

<br />

If you have enabled voice mail when setting up your extension, and you hear a<br />

stutter tone (not the normal dial tone) when you initially pick up your phone, it is<br />

indicating to you that you have a voice mail waiting.<br />

You must run setup-mail from the command line initially for Voice Mail and<br />

Notification to work in Trixbox.<br />

To enable voicemail on an extension simply "enable" it when you create the extensions<br />

from the freePBX GUI. If you require email notification of your voicemail, you may enter<br />

your email address in the email address field.<br />

Click submit when done followed by the red bar on top of the scree.<br />

20.1 ENABLING EMAIL NOTIFICATION<br />

Asterisk can send email to you informing you that you have voicemail waiting in your<br />

mailbox. In fact it can even send you the voicemail itself in the form of a .wav file if you so<br />

desire.<br />

20.1.1 Installing sendmail<br />

This is not always the case in every installation. If this happens to you, you may need to reinstall<br />

sendmail.<br />

I have been having some problem to get mail notification to be sent to my email<br />

address. I later discovered that sendmail needed to be installed for this function to<br />

work (thanks Thunderbird1 for pointing this out to me). Sadly, this is not mentioned<br />

anywhere and has caused me major grief.<br />

To install sendmail with yum, you can do it on the Asterisk box itself or connect<br />

through SSH (I use putty to connect), by logging in as root.<br />

Do these commands at the command prompt:<br />

yum install sendmail-cf<br />

This installs the necessary files for configuration of the sendmail client. Select “y” for<br />

yes when prompted and sendmail will be installed.<br />

Next you will need to do a little editing. I use nano to edit, thus:<br />

nano /etc/mail/sendmail.mc<br />

Locate the following line:<br />

dnl define(`SMART_HOST',`smtp.yourprovider')<br />

and edit it as per the example below<br />

define(`SMART_HOST',`smtp.yourprovider')<br />

Replace ‘smtp.yourprovider’ with your real smtp provider e.g. ‘smtp.ozemail.com.au’<br />

Then press CTRL-X, and type in Y, hit enter. You'll be asked for the file name you<br />

want "File Name To Write: /etc/mail/sendmail.mc", and hit enter.<br />

TRIXBOX-2 Without Tears Page 111 of 238


Next, you will need to rebuild your /etc/mail/sendmail.cf file.<br />

At the command prompt, do the following:<br />

make -C /etc/mail<br />

Once done, restart sendmail thus;<br />

/etc/init.d/sendmail restart<br />

You should now be able to have your voice mails sent to you via email.<br />

The above instruction is also mentioned in this link:<br />

http://sourceforge.net/forum/message.phpmsg_id=3387743<br />

and http://sourceforge.net/forum/message.phpmsg_id=3432175<br />

20.1.2 /etc/hosts<br />

There is a couple of things that you will need to do as your email host may not accept<br />

outgoing emails unless your system has a valid DNS name.<br />

By default, your host will look like this:<br />

# Do not remove the following line, or various programs<br />

# that require network functionality will fail.<br />

127.0.0.1 trixbox1.localdomain trixbox1 localhost.localdomain localhost<br />

Your mail server will not accept this as a valid DNS. Therefore you will need to use<br />

your valid Domain Name e.g. pbx.myasterisk.com. If you are like me, <strong>without</strong> a<br />

valid Domain Name, you should obtain one through DynDNS.<br />

Using Nano, you will need to edit your /etc/hosts file from command line to this:<br />

# Do not remove the following line, or various programs<br />

# that require network functionality will fail.<br />

127.0.0.1 localhost<br />

127.0.0.1 pbx.myasterisk.com (use a valid domain name here)<br />

127.0.0.1 trixbox1.localdomain trixbox1 localhost.localdomain<br />

You may use an editor (such as nano) to edit /etc/hosts file through CLI.<br />

<br />

If you are using SipBroker or Pennytel, its best not to make this change<br />

as describe above, as SipBroker and Pennytel will resolve your DNS name<br />

as the local host address of 127.0.0.1 as defined in the hosts file and not<br />

your actual external IP address. To overcome this I substitute my DNS<br />

hostname with another valid DNS name such as yahoo.com (as I have an<br />

account with Yahoo – not sure about the legality side of this though).<br />

Refer to Notes for a kludge fix if you are experiencing difficulties.<br />

Next, if you wish, you will need to customize your email notification message in<br />

/etc/asterisk/vm_email.inc file and to include the actual IP address of your asterisk<br />

PC. I have found that this is best done through a text editor (e.g. Nano) as AMP<br />

tends loose the formatting character. In the later versions of Trixbox, this can be<br />

done through Config Edit.<br />

TRIXBOX-2 Without Tears Page 112 of 238


; Change the email body, variables: VM_NAME, VM_DUR, VM_MSGNUM,<br />

VM_MAILBOX, VM_CALLERID, VM_DATE<br />

emailbody=${VM_NAME},\n\nThere is a new voicemail in mailbox<br />

${VM_MAILBOX}:\n\n\tFrom:\t${VM_CALLERID}\n\tLength:\t${VM_DUR}<br />

seconds\n\tDate:\t${VM_DATE}\n\nDial *98 to access your<br />

voicemail by phone.\nVisit http://pbx.myhome.com:8080/cgibin/vmail.cgiaction=login&mailbox=${VM_MAILBOX}<br />

to check your<br />

voicemail with a web browser.\n<br />

You can be aggressive and change /etc/asterisk/vm_general.inc as well.<br />

; 1st listed format gets emailed<br />

format=wav49|wav<br />

attach=yes<br />

pbxskip=yes<br />

; Don't put [PBX]: in the subject line<br />

serveremail=vm@asterisk ; Who the e-mail notification should appear to come from<br />

fromstring=Voicemail System ; Real name of email sender<br />

maxmessage=180<br />

; max length of vm message<br />

minmessage=3<br />

; Minimum length of a voicemail message in seconds<br />

maxsilence=5<br />

; Wait for 5 silent seconds and end the voicemail<br />

silencethreshold=128<br />

; What do we consider to be silence<br />

skipms=3000 ; ; How many millisecs to skip forward/back when rew/ff in<br />

; message playback<br />

review=yes<br />

; Allow sender to review/rerecord their message<br />

; before saving it<br />

operator=yes ; Allow caller to press 0<br />

nextaftercmd=yes<br />

; Automagically play next message when current<br />

; message is deleted or saved<br />

Change the entry in red to reflect your requirement e.g you may change vm@asterisk<br />

to FHC PBX and change Voice mail System to read Family Health Centre Voicemail.<br />

Once these are done, you will receive email notification of voicemail left in your<br />

voicemail box.<br />

You may start testing it and your email received will look something like this:<br />

From: Family Health Centre Voicemail To: Ben Sharif<br />

Subject: New Message 1 in mailbox 201<br />

Ben Sharif,<br />

There is a new voicemail in mailbox 201:<br />

From: "Mary" <br />

Length: 0:20 seconds<br />

Date: Friday, July 29, 2005 at 11:16:38 PM<br />

Dial *98 to access your voicemail by phone.<br />

Visit http://pbx.familyhealth.com:8080/cgibin/vmail.cgiaction=login&mailbox=201<br />

to check your voicemail with a web browser.<br />

TRIXBOX-2 Without Tears Page 113 of 238


20.2 USE POSTFIX INSTEAD OF SENDMAIL<br />

Another alternative to email notification is to use Postfix ins<strong>tea</strong>d of Sendmail because<br />

Sendmail is not as secure besides, using Postfix is a lot easier and it is more secure than<br />

Sendmail.<br />

If you wish to gi this path, it is strongly recommend you remove Sendmail and replace it<br />

with Postfix, with only 2 easy commands:<br />

rpm -e --nodeps sendmail<br />

yum -y install postfix<br />

Following this, edit your /etc/postfix/main.cf, (use nano and my smtp server is shown<br />

below, but you should be using yours) and add:<br />

relayhost = smtp.ozemail.com.au<br />

Replace smtp.ozemail.com.au with your own smtp server. E.g. if your belong to OPTUS,<br />

it should be:<br />

relayhost = mail.optusnet.com.au<br />

You should also edit /etc/asterisk/vm_general.inc and set the "serveremail" parameter to<br />

your real email address. This is to avoid messages with invalid from-addresses floating<br />

aimlessly in the Internet.<br />

Then load Postfix.<br />

service postfix reload<br />

Postfix will now send all outgoing email to your ISP's mail server.<br />

20.3 HOW TO RETRIEVE VOICEMAIL FROM EXTERNAL PHONE<br />

To call in and retrieve your voicemail from external phone is as easy as simply calling<br />

your number and retrieve your voice mail. This can be done easily if you have IVR<br />

enabled in your new TRIXBOX system.<br />

This is how I do it (you may have been told of other different methods).<br />

20.3.1 Method 1<br />

1. Call my number and when the Digital Receptionist answers, I will dial my<br />

extension number prefixing it with an *. E.g. My extension number is 2001,<br />

so when the DR answers me, I will dial *2001<br />

2. I will then be ask to leave a voicemail, but ins<strong>tea</strong>d, I will dial * again.<br />

3. DR will ask for a password to be followed by the # key.<br />

4. I enter my password followed by #<br />

5. DR will then give me my voice mail if there is any.<br />

TRIXBOX-2 Without Tears Page 114 of 238


20.3.2 Method 2<br />

1. From freePBX Setup Screen, create a Misc Destination and give it a name<br />

of e.g. “Check VM”<br />

2. Select Feature Code Dial Voicemail (*98) from the dropdown menu.<br />

3. Submit the changes.<br />

Next modify your IVR<br />

1. Increase option. If you already have 7 options, this will be the 8 th .<br />

2. Create an unannounced IVR selection e.g. selection no: 8<br />

3. For this option, select Misc Destination and from the drop down, select<br />

“Check VM”<br />

4. Save and don’t forget to click on the red bar.<br />

5. When you call your PBX from an external phone, DR will naturally ask you to<br />

make a selection. Selection 8 will not be announced, however you should<br />

select 8.<br />

6. DR will ask for a mailbox number<br />

7. Enter your extension number (which is also your mailbox number)<br />

8. Dr will then ask for your password<br />

9. And you will get your mailbox IVR prompt.<br />

As I said, it is indeed simple.<br />

20.4 HOW TO CHANGE VOICE MAIL GREETINGS<br />

The default Voicemail greeting is fine but it is rather bland and quite boring. No doubt<br />

some user would like to change the standard greeting to something more personal and<br />

meaningful.<br />

<br />

Ensure that you have changed your Direct Dial to Voicemail message type, in<br />

General Setting, from Default to something else e.g. Unavailable. Otherwise<br />

when you use follow-me and the like, your custom recorded message will not<br />

be played back. The Asterisk default message will be played back ins<strong>tea</strong>d.<br />

To do so is pretty simple. Here are the steps:<br />

1. Use your existing extension and dial *97<br />

2. You will be asked for your password (if you have entered one)<br />

3. When the Voicemail IVR starts, press 0<br />

4. You will then be given the choice what type of message you want to record.<br />

5. Choose the appropriate message you want to record.<br />

6. Record your message “Thank you for calling, I am either busy elsewhere or on the<br />

phone. Please leave me your message and I will call you back as soon as I can”.<br />

7. Review your message<br />

8. Re-record if you want to or if you are happy with the message, choose the option<br />

to save.<br />

That’s all – you are done.<br />

TRIXBOX-2 Without Tears Page 115 of 238


21 FAX TO E-MAIL<br />

Before setting up Fax over IP, I suggest that we should read this: http://www.softswitch.org/foip.html<br />

and : http://www.voip-info.org/wiki-Asterisk+fax<br />

While sending and/or receiving Faxes is one of the available functions in TRIXBOX, there<br />

have been reports of various degree of success. This is very much dependant on the<br />

type of equipment used such as PC, processor speed, line quality etc.<br />

In the earlier incarnation of TRIXBOX (it was AAH for those old enough to remember), for<br />

the fax facility to work reliably, you will also need Newman Telecom’s NVfaxdetect. This<br />

can be downloaded FREE. This may require some modification and recompiling.<br />

SpanDSP allows Asterisk to receive faxes by converting the received data to .pdf format.<br />

This service must be installed. If you want to have this function, you will need to install the<br />

support for encoding incoming faxes as PDF. This support is not pre-installed with<br />

TRIXBOX although the necessary files are there for you to manually install.<br />

21.1 INSTALLING FAX FOR TRIXBOX<br />

Unlike previous versions of Trixbox/AAH where it has to be installed separately, the later<br />

versions of Trixbox uses Asterisk version 1.2.2 where the developers of Asterisk have<br />

included NVfaxdetect in Asterisk which allows incoming faxes to be received over SIP,<br />

IAX & ZAP channel..<br />

There has been mixed reactions on the ability of sending and receiving fax through<br />

Trixbox as such I would suggest that, if you are relying on fax, to use a dedicated fax<br />

machine and only use Trixbox for experimental purposes only (at this stage anyway).<br />

<br />

Whatever it is worth, I have not been able to utilise this facility to my<br />

satisfaction.<br />

TRIXBOX-2 Without Tears Page 116 of 238


22 WEATHER REPORTS<br />

The existing weather forecast information that comes with TRIXBOX is configured for<br />

New York. However, Asterisk can be configured to allow the automatic downloading of<br />

Australian weather forecast information, convert it to a .wav file and play the<br />

announcement. The announcement will be a simulated announcement (ala Dr. Who’s<br />

Dalek). However it will provide you with the weather report of your region of choice.<br />

The Australia weather report reference file can be obtained from the following site:<br />

http://www.bom.gov.au/<br />

You may choose the reference file (text file) for the area that you are interested in. You<br />

do not need to manually download the file, ins<strong>tea</strong>d only the file name is required to be<br />

noted and can be incorporated within the Trixbox’s extensions_trixbox.conf file later.<br />

The script will download the file for you in the background.<br />

The following are examples of available weather report files that you can reference in<br />

your script.<br />

Forecast Area<br />

NSW Sydney Metro<br />

All NSW<br />

ACT<br />

Snowy Mountain<br />

Brisbane Metro<br />

All Queensland<br />

Melbourne Metro<br />

All Victoria<br />

Adelaide Metro<br />

All SA<br />

Perth Metro<br />

All WA<br />

Darwin and Rural Area (All NT)<br />

Tasmanian Cities<br />

All Tasmania<br />

File reference<br />

IDN10064<br />

IDN10031<br />

IDN10035<br />

IDN10103<br />

IDQ10090<br />

IDQ10700<br />

IDV10450<br />

IDV10310<br />

IDS10034<br />

IDS10033<br />

IDW12300<br />

IDW12000<br />

IDD10110<br />

IDT13400<br />

IDT13100<br />

For a complete list, refer to the link below:<br />

http://www.bom.gov.au/inside/cosb/stcm/idcodes/tables/current/vic_products.shtml<br />

The following step-by-step instruction will guide you through.<br />

22.1 CONFIGURE WEATHER REPORT – ON DEMAND.<br />

Some preparations need to be manually conducted through Linux Command Line, or if<br />

you prefer, you may use Webmin.<br />

I used Putty to log on to the Asterisk box remotely and used Nano to create a text file<br />

called “convert2wav” in the /usr/bin directory containing the following:<br />

/usr/bin/flite /tmp/weather.txt /tmp/weather.wav<br />

(This command is used to convert the weather text file to a .wav sound file).<br />

Once this is done, the permission for the “convert2wav” text file need to be appropriately<br />

set to allow it to be executed. To do this you need to run the following command from<br />

Command Line.<br />

chmod 755 /usr/bin/convert2wav<br />

TRIXBOX-2 Without Tears Page 117 of 238


Now you have completed all the necessary preparations – for me anyway.<br />

22.1.1 Create Extension codes.<br />

The next step is to include the following in the extensions_trixbox.conf through the<br />

Config Edit option of TRIXBOX Maintenance Tab. Select an unused extension code<br />

e.g. *61, *63, *64 etc.<br />

Add the following example (*Note: The third line in each section (bold) should read as a<br />

complete single line- change the file reference in red to suit.).<br />

; ##################################<br />

; Forecast for Sydney Metro<br />

; ###################################<br />

exten => *61,1,Answer<br />

exten => *61,2,Playback(national-weather-service)<br />

exten => *61,3,Playback(pls-hold-while-try)<br />

exten => *61,4,System(/usr/bin/wget -O weather.txt<br />

ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10064.txt)<br />

exten => *61,5,Wait(1)<br />

exten => *61,6,System(/usr/bin/convert2wav)<br />

exten => *61,7,Playback(/tmp/weather)<br />

exten => *61,8,System(rm /tmp/weather.* -f)<br />

exten => *61,9,Hangup<br />

; ######################################<br />

; Forecast for the whole of NSW<br />

; ######################################<br />

exten => *63,1,Answer<br />

exten => *63,2,Playback(national-weather-service)<br />

exten => *63,3,Playback(pls-hold-while-try)<br />

exten => *63,4,System(/usr/bin/wget -O weather.txt<br />

ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10031.txt)<br />

exten => *63,5,Wait(1)<br />

exten => *63,6,System(/usr/bin/convert2wav)<br />

exten => *63,7,Playback(/tmp/weather)<br />

exten => *63,8,System(rm /tmp/weather.* -f)<br />

exten => *63,9,Hangup<br />

Restart asterisk and test. You will be presented with the weather report of the areas<br />

you have chosen.<br />

(Source Reference:<br />

http://forums.whirlpool.net.au/forum-replies.cfmt=364420&p=1)<br />

This method is very slow and therefore is only suitable for a very fast PC. Depending on<br />

the speed of your computer during the .wav conversion, there may be about 1 minute or<br />

more delay between dialling the extension and the weather announcement. Therefore I<br />

have included step 3 telling the caller to hold while trying to connect.<br />

Therefore, there has to be a better method – so read on.<br />

22.2 CONFIGURE WEATHER REPORT – BACKGROUND METHOD.<br />

After giving it a bit of thought, I have decided to let Asterisk do the task of getting the<br />

weather text files and converting them to the necessary sound files in the background<br />

every 4 hours. This will cut down the waiting period when a caller chooses to listen to the<br />

weather report.<br />

TRIXBOX-2 Without Tears Page 118 of 238


First we will use putty to make a batch text file called “convert2wav” in the /usr/bin<br />

directory containing the following:<br />

/usr/bin/wget -O /tmp/weather1.txt ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10064.txt<br />

/usr/bin/flite /tmp/weather1.txt /tmp/weather1.wav<br />

/usr/bin/wget -O /tmp/weather2.txt ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10031.txt<br />

/usr/bin/flite /tmp/weather2.txt /tmp/weather2.wav<br />

(Change IDN10064.txt and IDN10031.txt to suit the areas you require)<br />

If you want to get rid of a couple of nasty characters, you can always add the following<br />

line or lines in the appropriate places and changing the characters that you want to<br />

discard or change,<br />

# sed 's/\[/ /g' /tmp/weather1.txt > temp.txt<br />

# sed 's/\]/ /g' /tmp/weather1.txt > temp.txt<br />

# sed 's/\_/ /g' /tmp/weather1.txt > temp.txt<br />

as an example<br />

- but we are not going there. It may get too confusing. For the moment we will just stick<br />

with the batch file example above.<br />

Once this is done, change the permission for “convert2wav” thus:<br />

chmod 755 /usr/bin/convert2wav<br />

Use Webmin to schedule a Cron job to run this batch file every 4 hours (or schedule it to<br />

suit your purpose). This will run the batch job at the scheduled time avoiding having to<br />

download the weather file and converting them to sound files when a caller chooses the<br />

weather report option.<br />

The sound files will always be available when a caller requires them <strong>without</strong> having to<br />

wait for them to be downloaded and converted.<br />

22.2.1 Create Extension codes.<br />

Next include the following in extensions_trixbox.conf. Select an unused extension<br />

code e.g. *61, *63, *64 etc.<br />

Add the following example<br />

; ##################################<br />

; Forecast for Sydney Metro<br />

; ###################################<br />

exten => *61,1,Answer<br />

exten => *61,2,Playback(national-weather-service)<br />

exten => *61,3,Playback(pls-hold-while-try)<br />

exten => *61,4,Playback(/tmp/weather1)<br />

exten => *61,5,Hangup<br />

; ######################################<br />

; Forecast for the whole of NSW<br />

; ######################################<br />

exten => *63,1,Answer<br />

exten => *63,2,Playback(national-weather-service)<br />

exten => *63,3,Playback(pls-hold-while-try)<br />

exten => *63,4,Playback(/tmp/weather2)<br />

TRIXBOX-2 Without Tears Page 119 of 238


exten => *63,5,Hangup<br />

Restart asterisk and test. You will be presented with the weather report of the areas<br />

you have chosen <strong>without</strong> any delay whatsoever.<br />

22.3 NOW PUT IT IN YOUR DIGITAL RECEPTIONIST<br />

If you want the 2 procedures to be incorporated in your Digital receptionist, simply<br />

duplicate them in your extensions_custom.conf with some minor changes. You will<br />

want the digital receptionist to know which weather report you are referring to when you<br />

make the choice. Give it a label – see example below (the changes made are in bold).<br />

; ##################################<br />

; Forecast for Sydney Metro<br />

; ###################################<br />

[custom-weathermetro]<br />

exten => s,1,Answer<br />

exten => s,2,Playback(national-weather-service)<br />

exten => s,3,Playback(pls-hold-while-try)<br />

exten => s,4,Playback(/tmp/weather1)<br />

exten => s,5,Hangup<br />

; ######################################<br />

; Forecast for the whole of NSW<br />

; ######################################<br />

[custom-weathernsw]<br />

exten => s,1,Answer<br />

exten => s,2,Playback(national-weather-service)<br />

exten => s,3,Playback(pls-hold-while-try)<br />

exten => s,4,Playback(/tmp/weather2)<br />

exten => s,5,Hangup<br />

When you create your menu option in Digital receptionist, e.g. “Press 6 for Sydney<br />

weather report, press 7 for the whole of NSW weather report”, select the custom app: and<br />

enter the appropriate custom procedures above. See example below:<br />

Custom App<br />

Custom App<br />

custom-weathermetro,s,1<br />

custom-weathernsw,s,1<br />

TRIXBOX-2 Without Tears Page 120 of 238


23 REMOTE MANAGEMENT<br />

Some may want to manage their Asterisk Box remotely. If you are thinking about doing<br />

this, I highly recommend you register with Dyndns to get yourself a dynamic DNS unless<br />

you have a fixed public IP address.<br />

You should also forward port 80 on your router to point to the local IP address of your<br />

Asterisk box.<br />

To log on to your Asterisk box remotely using your browser, use<br />

http://your_Dyndns_name:80 or http://your_public_ip_address:80<br />

23.1 HTTPD.CONF<br />

If you are using Optus Cable, you may not be able to use port 80. However this can be<br />

overcame by changing the port to 8080. To do this, you will be required to change one<br />

setting in the httpd.conf file which resides in the /etc/httpd/conf directory.<br />

If you are not a Linux fan, I suggest you use either webmin or putty to access the file. I<br />

use Putty to log on remotely to the console and edit the file with Nano using the following<br />

command.<br />

nano /etc/httpd/conf/httpd.conf<br />

In the file, look for the following entry (marked in red) - below :<br />

#<br />

# Listen: Allows you to bind Apache to specific IP addresses and/or<br />

# ports, in addition to the default. See also the <br />

# directive.<br />

#<br />

# Change this to Listen on specific IP addresses as shown below to<br />

# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)<br />

#<br />

Listen 80 change this from 80 to read 8080<br />

#<br />

After doing the above, reboot Asterisk.<br />

Don’t panic if you can no longer access AMP through you web browser. You simply<br />

append: 8080 after the address e.g. 192.168.1.101:8080<br />

TRIXBOX-2 Without Tears Page 121 of 238


24 HOW TO SET UP A REMOTE EXTENSION<br />

If you carry your laptop/notebook everywhere you go, you may want to consider setting<br />

up a remote extension on your Notebook. Basically its set up is similar to the softphone<br />

that you set up on your other computers except that you should have a fixed IP address<br />

for your Asterisk server or use DynDNS to register a Domain ID for your Asterisk box.<br />

Since I am on Optusnet cable, I only have the privilege of a dynamic IP hence I registered<br />

for a Domain ID with DynDNS pointing to my Dynamic IP address. Every time my<br />

dynamic IP changes, DynDNS will point to the new IP address. This way I don’t have to<br />

keep changing IP addresses. I simply use the same DNS ID eg: myasterisk.freedns.com<br />

24.1 CREATE A NEW EXTENSION<br />

Create a new IAX2 extension in Asterisk – just like the other extension that you created<br />

before. This time ins<strong>tea</strong>d of creating a SIP extension, create an IAX extension (you can<br />

use SIP as well but since you don’t have any control of the external router that you may<br />

be connected to when you are away from your own environment, IAX will avoid any NAT<br />

issue that you may encounter). In your router, you will need to forward port 4569 to your<br />

Asterisk Box.<br />

As mentioned above, you may create a SIP extension ins<strong>tea</strong>d, if you so wish but you<br />

must ensure that you set “nat” field to “yes” ( in the device option) ins<strong>tea</strong>d of “never” as<br />

illustrated in the screen below - see red arrow.<br />

Once you have done this, you will need to ensure a couple of things in your .conf files are<br />

set correctly.<br />

TRIXBOX-2 Without Tears Page 122 of 238


24.2 IAX.CONF<br />

The following is the content of my iax.conf file.<br />

iax.conf<br />

[general]<br />

bindport = 4569 ; Port to bind to (IAX is 4569. Forward this port to your Asterisk box)<br />

externip = or<br />

externhost = <br />

localnet = 192.168.1.0/255.255.255.0<br />

bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)<br />

delayreject = yes<br />

disallow=all<br />

allow=g729<br />

allow=ilbc<br />

allow=gsm<br />

allow=g723<br />

allow=alaw<br />

allow=ulaw<br />

jitterbuffer = yes<br />

mailboxdetail = yes<br />

#include iax_additional.conf<br />

#include iax_custom.conf<br />

24.3 SIP_NAT.CONF<br />

The only other .conf file that requires attention is the sip_nat.conf in case you want to<br />

use SIP. If you do, ensure that you have forward ports 5004 – 5082 as well. My file is as<br />

per the example below.<br />

sip_nat.conf<br />

nat=yes<br />

externip= or<br />

externhost=< myasterisk.freedns.com> (see note)<br />

localnet=192.168.1.0/255.255.255.0<br />

externrefresh=10<br />

Those are the only 2 .conf files that require changing if needed.<br />

24.4 SETTING UP AN IAX SOFTPHONE<br />

I use an IAX softphone called IDEFISK. You can get IDEFISK from here:<br />

http://www.asteriskguru.com/tools/idefisk_beta.php<br />

You can also use Virbiage softphone as it will handle IAX.<br />

Setting up IDEFISK is very simple. All you have to do is download the file, extract it and<br />

save it in its own directory.<br />

Click on the idefisk.exe and just configure it like the example below.<br />

TRIXBOX-2 Without Tears Page 123 of 238


Once the softphone is active, to start<br />

configuring, simply place your curser<br />

anywhere in the middle if the image and<br />

right click.<br />

The configuration option window will be<br />

displayed.<br />

24.4.1 First the general options<br />

In the general options, checked the<br />

“Check for update” and “Automatic<br />

popup on incoming call” options.<br />

The next option to take care of is the Account option. Apart from that, there is nothing<br />

else critical to be done for you to use IDEFISK.<br />

TRIXBOX-2 Without Tears Page 124 of 238


24.4.2 Accounts options<br />

Next click on the Account Options and set up your account as per the image below.<br />

The rest of the options are there for you to set up your sound preference and customize<br />

your look and feel. They are pretty straightforward.<br />

Now you are ready to go on the road with an Asterisk extension under your arm.<br />

TRIXBOX-2 Without Tears Page 125 of 238


25 CALLS RECORDINGS<br />

There have been numerous discussions on the legality of recording telephone<br />

conversations. Some say its OK while others say its illegal. If you are recording<br />

conversation <strong>without</strong> the consent of all parties, you may be breaking the law – so be<br />

warned.<br />

For those who do record conversations, the recording are kept in the<br />

/var/spool/asterisk/monitor directory or you can monitor the recording through the ARI<br />

interface.<br />

25.1 ARI INTERFACE<br />

The ARI interface can be access either from the User Mode screen of Trixbox or freePBX<br />

GUI.<br />

Use mode interface of Trixbox<br />

<strong>Free</strong>PBX GUI of Trixbox<br />

If you want to monitor all the calls, you will need to log in as admin with the default<br />

password of ari_password.<br />

To monitor the calls for any individual extension, log in using the extension number and<br />

the extension password.<br />

TRIXBOX-2 Without Tears Page 126 of 238


To play the recording, simply click on the Play link related to the extension that you want<br />

to listen to, in the screen that follows (ensure that you have installed Quicktime and Adobe<br />

Flash Player plugin for your browser on your local PC, otherwise it will not play the sound).<br />

The configuration file for ARI is /var/www/html/recordings/includes/main.conf.php<br />

There are 2 ways you can record your calls:<br />

25.1 RECORD ALL CALLS BY DEFAULT<br />

To record all calls, on a specific extensions or all extensions, this function has to be<br />

enabled on the extension or extensions involved. This is done through the Extension<br />

Options Record Incoming and Record Outgoing field by selecting “Always” from the<br />

dropdown box for both fields.<br />

25.2 RECORD CALLS ON DEMAND.<br />

To record on demand, the caller or the receiver have to dial *1 when he/she need the<br />

recording to start (Asterisk v1.2). This function will only work if the feature is enabled.<br />

To enabled this feature, the following Dial Command Option must be enabled in freePBX<br />

General settings Asterisk Dial command option and Asterisk Outbound Dial<br />

command option fields by adding the following flag in the fields.<br />

w: Allow the called user to start recording after pressing *1 (Asterisk v1.2)<br />

W: Allow the calling user to start recording after pressing *1 (Asterisk v1.2)<br />

Some users have noticed that the *1 need to be pressed very quickly for this feature to<br />

work. This can be remedied by adding the following line in the features,conf file under<br />

the general section.<br />

featuredigittimeout = 1500 ;(the default is 500 which is too fast for an old guy like me<br />

TRIXBOX-2 Without Tears Page 127 of 238


26 STUN SERVERS<br />

STUN (Simple Traversal of UDP through NAT - Network Address Translation) is a<br />

protocol for assisting devices behind a NAT firewall or router with their packet routing<br />

operates on TCP and UDP port 3478.<br />

I never have the need to use STUN. The list below is provided for those who have the<br />

need to use public STUN Servers. These are the servers that I am aware off - there may<br />

be others.<br />

stun.xten.com<br />

stun.fwd.org<br />

stun01.sipphone.com<br />

stun1.noc.ams-ix.net<br />

stun.voipbuster.com<br />

stun.voxgratia.org<br />

27 DIALING THROUGH MS OUTLOOK®<br />

One way of keeping a little black book for all your telephone contacts is through<br />

Microsoft Outlook® (for the windows users) address book. We can also use Outlook to<br />

dial the phone numbers in the address book as Outlook® has a click-to-dial facility.<br />

I was alerted of this facility in Outlook® and Asterisk® and asked to prove the application<br />

and publish a simplified instruction in this guide.<br />

27.1 DOWNLOAD ASTTAPI<br />

Before you get started, you will need to download AstTapi, which is a Microsoft TAPI to<br />

Asterisk Bridge. This little gem (still under further development at the moment but<br />

functional) will make it possible to do click-to-dial from Microsoft Outlook and for that<br />

matter from other TAPI compliant applications.<br />

Download AstTapi from http://sourceforge.net/projects/asttapi/<br />

To get started, you will need to edit manager_custom.conf file. The easiest is to use<br />

freePBX Config Edit (the easiest way!)<br />

SETUP -> Config Edit -> manager_custom.conf<br />

On opening the manager_custom.conf file, you will notice the following, which you will<br />

need to do a tiny weeny edit:<br />

[phpconfig]<br />

secret = php[onfig<br />

deny=0.0.0.0/0.0.0.0<br />

permit=127.0.0.1/255.255.255.0<br />

read = system,call,log,verbose,command,agent,user<br />

write = system,call,log,verbose,command,agent,user<br />

[phpagi]<br />

secret = phpagi<br />

deny=0.0.0.0/0.0.0.0<br />

permit=127.0.0.1/255.255.255.0<br />

read = system,call,log,verbose,command,agent,user<br />

write = system,call,log,verbose,command,agent,user<br />

[AstTapi]<br />

secret = AstTapi<br />

deny=0.0.0.0/0.0.0.0<br />

TRIXBOX-2 Without Tears Page 128 of 238


#permit=192.168.1.0/255.255.255.0<br />

read = system,call,log,verbose,command,agent,user<br />

write = system,call,log,verbose,command,agent,user<br />

Under the [AstTapi] User context, remove the # from the permit line and change the<br />

192.168.1.0 to the network address of your network. In my case I left it as it is because<br />

my network is under 192.168.1.0 (see red highlight).<br />

Once this is done, click Update and restart Asterisk.<br />

27.2 INSTALL ASTTAPI<br />

Install AstTapi on your PC – the one that you have Microsoft Outlook installed. Follow the<br />

prompt and once completed you will need to restart your PC for the new driver to take<br />

effect.<br />

27.3 CONFIGURE OUTLOOK ADDRESS BOOK<br />

Fire up Outlook®.<br />

Click on Contacts from your<br />

folder list.<br />

Select a contact that you<br />

want to call (provided that a<br />

telephone number has been<br />

recorded).<br />

Click on the phone icon.<br />

Click on the Telephone icon.<br />

The New Call dialog box will<br />

be displayed:<br />

Select Dialling Options.<br />

TRIXBOX-2 Without Tears Page 129 of 238


The Dialling Option box will<br />

be displayed.<br />

In the "connect using line"<br />

drop down box, select<br />

Asterisk.<br />

Then click on Line<br />

properties.<br />

In the Host field, enter the<br />

address of your asterisk<br />

server: e.g. 192.168.1.100<br />

In the Port Field: 5038<br />

User Field: AstTapi<br />

Password: AstTapi<br />

User Channel: (your extension – the extension you want Asterisk to ring before<br />

connecting you the number you are calling) e.g. sip/2001<br />

Select dial by context radio button.<br />

Enter outbound-allroutes in the context box<br />

When done, click Apply and you are done.<br />

You can now start making calls from Outlook using the click-to-dial facility.<br />

Now… that was quite painless.<br />

TRIXBOX-2 Without Tears Page 130 of 238


28 SPEED DIAL<br />

Sometime you may just need to call someone quickly <strong>without</strong> having to look up his/her<br />

phone number. Well, you can by simply defining a shortcut number. There are 2 ways<br />

you can do this - my way and Trixbox’s way.<br />

28.1 THE DUMB-ME METHOD<br />

Since I am very bad at remembering phone numbers – I cant remember my own phone<br />

number (or my car registration number), I have defined some shortcut numbers for my<br />

family using the first 3 characters of their first names e.g. Adam is ADA which translate to<br />

232 on the telephone keypad. Make sure the numbers have not been allocated to your<br />

local extension.<br />

To do this, you will need to edit extensions_custom.conf by adding the lines below<br />

containing the relevant exten expressions.<br />

You can do this through Setup -> Config Edit<br />

; #############################################################<br />

; Speed Dial to some predefined numbers (added by Ben 2/12/2005)<br />

; #############################################################<br />

exten => 236,1,Dial(SIP/6140036xxxx@pennytelsip,60,m) ; Ben’s Mobile<br />

exten => 236,n,Hangup<br />

exten => 764,1,Dial(SIP/6141242xxxx@pennytelsip,60,m) ; Rohani’s Mobile<br />

exten => 764,n,Hangup<br />

exten => 667,1,Dial(SIP/6140470xxxx@pennytelsip,60,m) ; Nor’s Mobile<br />

exten => 667,n,Hangup<br />

exten => 767,1,Dial(SIP/6140512xxxx@pennytelsip,60,m) ; Ros’s Mobile<br />

exten => 767,n,Hangup<br />

exten => 232,1,Dial(SIP/6140936xxxx@pennytelsip,60,m) ; Adam’s Mobile<br />

exten => 232,n,Hangup<br />

You will need to substitute the example phone numbers above such as 6140036xxxx with<br />

the real phone numbers.<br />

When 236 (which is BEN) is dialled, you will hear a voice prompt saying “Please wait<br />

while I connect your call” followed by Asterisk calling Ben’s Mobile number which is<br />

61400336510 using the Pennytel SIP trunk.<br />

Pennytel SIP trunk was called Pennytelsip when it was initially set up.<br />

The call will be tried for 60 seconds (,60) and while the call is being attempted, the caller<br />

will be listening to a MOH tune (,m) ins<strong>tea</strong>d of the ringing tone. You may however<br />

change it to a ringing tone by substituting the “m” with a “r” or remove “,m” altogether<br />

Once you have done that, click on Update and re-read the config. That’s all there is to it.<br />

TRIXBOX-2 Without Tears Page 131 of 238


28.2 TRIXBOX’S METHOD (VERSION 1.X)<br />

In Trixbox v1.x, there is however, a simpler way (Later versions have different method)<br />

which I will cover after this.<br />

TRIXBOX has included a built-in speed dialling utility amongst the goodies that comes<br />

with it. Numbers 300 to 399 has been reserved for this purpose.<br />

To add a number to your speed dial list, you simply pick up one of your extensions and<br />

punch in 3003XX61212345680 (assuming 61212345680 is the number you want to save<br />

in your speed dial list) where 3XX is the speed dial code for 61212345680 (substitute 3XX<br />

for the position e.g. 301).<br />

After doing that, Asterisk will confirm the code and the number that you have just<br />

registered. If you want to make correction to or change the telephone number that you<br />

have entered simply repeat the process.<br />

In the above example, every time you dial 301 Asterisk will dial out the number<br />

associated with that code. In this case, it is 61212345680.<br />

Ensure that you enter the number to be called in the same format that is supported by<br />

your Asterisk dialplan.<br />

To look up speed dial numbers, simply dial * followed by the 3-digit speed dial code, e.g.<br />

*301. This will tell you the number stored in speed dial position 301.<br />

28.3 TRIXBOX’S METHOD (VERSION 2.X)<br />

In Trixbox v2.x, the method in version 1.x has been revised to use the Asterisk Phone<br />

Book found under the TOOLS Tab.<br />

Here you simply enter the Phone number of the party you wish to call, the name and the<br />

Speed Dial Code in the appropriate fields as per the example below. Submit change<br />

when done.<br />

To call the Speed dial, e.g. you want to call Ben Sharif, simply dial *069 (the *0 tells<br />

Trixbox that you want to use the Speed Dial and the 69 is the Speed Dial Code for Ben<br />

Sharif).<br />

TRIXBOX-2 Without Tears Page 132 of 238


The Speed Dial Prefix *0 can be found under Feature Codes.<br />

Naturally if you have a big list of Names and Phone Numbers that you want to enter in<br />

your Trixbox Phone Book, you have the option of uploading the list. You have to scroll<br />

down the page to get to the “Import from CSV” section of the Phone Book (see illustration<br />

below)<br />

.<br />

The “Import from CSV” is a misnomer because, if you havae created a list using EXCEL<br />

and trying to import the list, it will not work since EXCEL CSV file is a comma delimited<br />

one where as freePBX is expecting a semi-colon delimited file. Mousing over the word<br />

file will give you the format it is expecting;<br />

“Name”;Number;Speeddial code<br />

Ensure that “Name” must be enclosed in quotation marks.<br />

Any speeddial code that already exist in the phone book cannot be reused. If you want to<br />

use an existing speeddial code in your so called “CSV” file, the existing entry in the phone<br />

book must first be removed.<br />

TRIXBOX-2 Without Tears Page 133 of 238


29 HOW TO USE WINDOW MESSENGER® 5.X<br />

<br />

Windows Messenger is NOT MSN Messenger. You may need to download<br />

Windows Messenger from Microsoft.<br />

Set up Windows Messenger 5.x as a SIP client on your PC:<br />

1. Start Windows Messenger from your PC.<br />

From the Windows Messenger dialog box, go to Tools -> Options ->Accounts:<br />

• Check the [My contacts include users of a SIP Communications Service] checkbox.<br />

• Enter "sip:@"<br />

(e.g.."sip:206@192.168.1.101") in the [Sign-in name] field<br />

2. Click on the [Advanced] button next to the Sign-in name.<br />

• Check the [Configure settings] button<br />

• Enter Asterisk IP address (e.g.192.168.1.101) in the [Server name of IP address]<br />

field<br />

• Check the [UDP] button<br />

• Click [OK] and [OK] again.<br />

In order for Windows Messenger to work as a voice communication device, you must<br />

have a microphone and speaker(s) connected to your PC.<br />

TRIXBOX-2 Without Tears Page 134 of 238


This setting means the Windows Messenger has a user/phone number of 206<br />

known to the SIP server (your Asterisk box) of 192.168.1.101.<br />

Verify that Windows Messenger has successfully registered with Asterisk by logging in to<br />

Asterisk.<br />

freePBX -> Tools -> Asterisk Information. – this is available as an addon (see NOTES<br />

on Adding the missing Maintenance Modules)<br />

You should see under SIP Registry that the Windows Messenger is registered as a<br />

user/phone number of 206, with a contact URL of your local PC IP Address e.g.<br />

192.168.0.11, among other registration information.<br />

Note: Windows Messenger 5.0 or later has support for VoIP communications but it seems<br />

that it may create problems with chat or other features. For this purpose, please focus<br />

your testing on VoIP only.<br />

TRIXBOX-2 Without Tears Page 135 of 238


30 HOW TO INTERCONNECT 2 BOXES<br />

There may be a time when you want to interconnect 2 Asterisks boxes (def.com.au and<br />

xyz.com.au) together and if you are like me, you will probably be spending a good part of<br />

3 hours trying to get them to talk to one another.<br />

I have 2 different locations, the Main Office (def.com.au) with about 11 extensions and<br />

another office in a different location (xyz.com.au) about 20 km away with 9 extensions.<br />

The main office is the only box that will have accounts with different VSPs and all external<br />

communications are through the main office Asterisk box. I settled for the simplest<br />

solution and after some fiddling around I managed to get them to work the way I wanted it<br />

but not happy with it, I solicited some advise from a friend (thanks to Mark Brooker) who<br />

provided further assistance.<br />

Ins<strong>tea</strong>d of being verbose in my explanation, I will just create a few tables outlining what I<br />

did. I hope this will help those in the same position as I am, to set 2 very basic systems<br />

together (you can refer to DUNDi for a more complete solution). A little tutorial on DUNDi<br />

can be found here.<br />

30.1 METHOD 1 - WITH THE PEER ASTERISK BOX AS EXTENSIONS<br />

For the purpose of registering the peers to each other, I created 1 extension on each box<br />

eg: 90000 on System 1 and 91000 on System 2– using extension numbers that I am not<br />

likely to use as local extensions (while some users have had success using common<br />

extension, but I prefer 2 separate extensions as I have them working). For simplicity, I<br />

gave a common password xxxyyy to both boxes. Avoid using extension starting with 8 as<br />

it may clash with conferencing.<br />

System 1<br />

def.com.au<br />

System 2<br />

xyz.com.au<br />

IAX Trunk<br />

Outgoing Dial Rules: XX. XX.<br />

Trunk Name Parramatta MainOffice<br />

Peer Details<br />

host=xyz.com.au (or System 2 IP)<br />

qualify=yes<br />

secret=xxxyyy<br />

type=peer<br />

username=91000<br />

host=def.com.au (or System 1 IP)<br />

qualify=yes<br />

secret=xxxyyy<br />

type=peer<br />

username=90000<br />

User Context Leave blank Leave blank<br />

User Details Leave blank Leave blank<br />

Register String 91000:xxxyyy@xyz.com.au 90000:xxxyyy@def.com.au<br />

Note: Registration isn’t really necessary. It will still work <strong>without</strong> it unless you use Dynamic IP.<br />

System 1 System 2<br />

Extensions<br />

Phone Protocol IAX IAX<br />

Extension Number 90000 91000<br />

Extension Password xxxyyy xxxyyy<br />

Fullname Parramatta Main Office<br />

Voicemail & Directory Disabled Disabled<br />

TRIXBOX-2 Without Tears Page 136 of 238


System 1 System 2<br />

Outbound Routing<br />

Route Name Parramatta MainOffice<br />

Route Password Leave Blank Leave Blank<br />

Dial Patterns<br />

6XXX<br />

(6001 to 6009 are Parramatta<br />

Office extensions)<br />

XX.<br />

(Apart from Local extensions, all<br />

others go via Main Office)<br />

Trunk Sequence IAX2/Parramatta IAX2/MainOffice<br />

The above Outbound Routing rule assumes that you do not wish to use a dialling prefix. If<br />

you want to use a prefix to dial the remote extensions and to use the remote routing rules,<br />

you may place a prefix e.g. 9|6XXX and 9|XX. for system 1 and system 2 respectively<br />

ins<strong>tea</strong>d of just 6XXX and XX.<br />

<br />

While this method will provide some rudimentary security (though pretty<br />

weak), as it requires an extension to be created for the peer Asterisk box, it will<br />

not pass the calling party extension number to the remote Asterisk box.<br />

Ins<strong>tea</strong>d, it will pass the Trunk ID only and all calls will seem to come from the<br />

same trunk and not individual extension – I did say that this is a simple<br />

solution.<br />

30.2 METHOD 2 - IN A PEER/USER ARRANGEMENT<br />

Another method that I use is described below. This method treats both the Asterisk box<br />

as internal to each other as peer and user. I am using IAX2 for this purpose, however I<br />

believe, you may be able to do this with SIP as well if you are trying to connect the older<br />

Asterisk with the newer incarnations (I have not proved it yet). This method does not<br />

require registration either and does not require you to create extensions for the peers. In<br />

many ways, this is simpler to set up.<br />

Unlike the first method, this second method will pass the Caller ID to the receiving party.<br />

The receiving party will actually get the callers’ extension number/ID ins<strong>tea</strong>d of the<br />

extension number of the peer Asterisk box.<br />

Rather than being verbose, I will illustrate this method using tables as follows:<br />

System 1<br />

def.com.au<br />

System 2<br />

xyz.com.au<br />

IAX2 Trunk<br />

Outgoing Dial Rules: XX. XX.<br />

Trunk Name InterOffice InterOffice<br />

Peer Details<br />

host=xyz.com.au (or System 2 IP)<br />

Qualify=yes<br />

type=peer<br />

User Context InterOffice-In InterOffice-In<br />

User Details<br />

context=from-internal<br />

host=xyz.com.au (or IP)<br />

type=user<br />

host=def.com.au (or System 1 IP)<br />

Qualify=yes<br />

type=peer<br />

context=from-internal<br />

host=def.com.au (or IP)<br />

type=user<br />

TRIXBOX-2 Without Tears Page 137 of 238


System 1 System 2<br />

Outbound Routing<br />

Route Name InterOffice InterOffice<br />

Route Password Leave Blank Leave Blank<br />

Dial Patterns<br />

6XXX<br />

(6001 to 6009 are Parramatta<br />

Office extensions)<br />

9|XX. (To call external number<br />

via Main Office)<br />

XX.<br />

(Apart from Local extensions, all<br />

others go via Main Office)<br />

Trunk Sequence IAX2/InterOffice IAX2/InterOffice<br />

30.3 METHOD 3 – FRIEND/FRIEND ARRANGEMENT<br />

(By far the simplest method)<br />

This method is by far the simplest method where the boxes are treated as friend to each<br />

other. Like Method 2, registration is not required and this method will also pass the Caller<br />

ID to the receiving party.<br />

System 1<br />

def.com.au<br />

System 2<br />

xyz.com.au<br />

IAX2 Trunk<br />

Outgoing Dial Rules: XX. XX.<br />

Trunk Name InterOffice InterOffice<br />

Peer Details<br />

User Context<br />

User Details<br />

host=xyz.com.au (or System 2 IP)<br />

Qualify=yes<br />

type=friend<br />

host=def.com.au (or System 1 IP)<br />

Qualify=yes<br />

type=friend<br />

System 1 System 2<br />

Outbound Routing<br />

Route Name InterOffice InterOffice<br />

Route Password Leave Blank Leave Blank<br />

Dial Patterns<br />

6XXX<br />

(6001 to 6009 are Parramatta<br />

Office extensions)<br />

9|XX. (To call external number<br />

via Main Office)<br />

XX.<br />

(Apart from Local extensions, all<br />

others go via Main Office)<br />

Trunk Sequence IAX2/InterOffice IAX2/InterOffice<br />

All the above examples assume that both Asterisk boxes have Public Fix IP address. If<br />

you have Dynamic IP addresses, you will need to register both the boxes with DynDns to<br />

obtain a valid DNS ID. If you are a part of a Corporate LAN, then you will have no need<br />

to worry about DynDns and what not.<br />

Warning: You must provide for security, as this is pretty wide open.<br />

Like all installation, you must provide for security. As different installation resorts to<br />

different types of security arrangement, I will leave that to the individual implementer to<br />

deal with the security issues.<br />

TRIXBOX-2 Without Tears Page 138 of 238


30.4 THINKING OF MORE THAN 2 BOXES<br />

Just as a matter of interest, you can connect several boxes using this method. While I<br />

have connected 3 boxes successfully, I believe, the same principle can be applied to<br />

more boxes.<br />

<br />

In my implementation I have box A, B and C (System 1, 2 and 3) in a star<br />

configuration. Box A is the master box. All the other boxes use box A as the<br />

main exchange.<br />

A peers with B and C - B peers with A - And C peers with A.<br />

Except for local traffic, all external and inter-office (inter-branch) traffic goes<br />

via Box A. – with the appropriate dial plan of course.<br />

Both the above methods, while useable for a basic configuration, will not provide you with<br />

a complete solution. To provide a complete solution is beyond the scope of this<br />

document.<br />

The following link will provide further reference for connecting two Asterisk boxes together<br />

http://www.voip-info.org/wiki/view/Asterisk+-+dual+servers<br />

If you require a complete solution tailored to your exact requirement, my advise to you is<br />

to hire a VOIP consultant.<br />

30.5 REDIRECT INCOMING IN BOX A TO BOX B<br />

There will be times when you will want to redirect certain calls made to one Trixbox box to<br />

another Trixbox box in another location. This can happen in a scenario where you are<br />

moving your mail office from your existing location to another location (or moving your<br />

sales office to another location away from your main office).<br />

Personally I really wouldn’t do this as it is simpler to get a redirection to the new number from<br />

the exchange.<br />

In this example, lets say that all calls coming to your head office Trixbox PABX made on<br />

phone number 12345678 need to be sent to your Trixbox PABX in a different location.<br />

Let us call your Head Office PABX Box-A and your remote PABX Box-B and calls coming<br />

in to Box-A to be sent to Box-B.<br />

There are a number of ways that this can be achieved but most involved editing conf files<br />

and adding extra codes in the conf files. Unless you are quite comfortable with doing this,<br />

it can be quite daunting to the uninitiated.<br />

The example I am illustrating here does not involve editing any conf file. All can be done<br />

through freePBX. It is a little long winded but you don’t have to touch any of the conf files.<br />

Step 1 – (Do this in Box-A)<br />

i. Create an IAX Trunk<br />

You will only need the following in the Outgoing Setting and leave everything else<br />

blank. Let us call this trunk TransferTrunk.<br />

host=BoxB.com.au (your qualified DNS or the IP address)<br />

type=peer<br />

TRIXBOX-2 Without Tears Page 139 of 238


username=6000 (this number will be used later)<br />

ii. Create and Outbound Route<br />

After you have created the trunk, you will need to create an outbound route. Let us<br />

call this outbound route TransferRoute.<br />

In the dial pattern, you will only require one entry:<br />

6000<br />

The trunk sequence will be TransferTrunk only.<br />

iii. Create a new extension<br />

Next create a new extension e.g. 500. You will be using this extension to<br />

unconditionally forward all calls made to this extension, to extension 6000 in BoxB<br />

which we will create later.<br />

To unconditionally forward calls made to this extension to extension 6000, you need<br />

to connect to extension 500 using a softphone and dial *726000. Any calls to this<br />

extension will be unconditionally forwarded to extension 9000.<br />

iv. Create and inbound route<br />

DID number is 12345678. This is your phone number of calls come in to Box-A from,<br />

assuming that all calls that come on this number are to be transferred to Box-B.<br />

Set Destination to Core 500.<br />

That’s all need to be done in Box-A<br />

Step 2 – (Do this in Box B)<br />

i. Create a Trunk<br />

Trunk name: TransferTrunk. Leave the peer details blank.<br />

User context: Transfer-In<br />

You will only need the following in the Incoming Setting and leave everything else<br />

blank.<br />

context=from-trunk<br />

ii. Create a new IAX extension<br />

Create a new IAX extension 6000 (this is the username defined in the outgoing<br />

setting in Step 1 above). Display name: CallTransfers.<br />

Edit this extension context to read from-trunk (ins<strong>tea</strong>d of from-internal).<br />

iii. Direct all calls to IVR<br />

Ensure that incoming route direct calls to the appropriate extension. In my case, all<br />

calls go to IVR.<br />

That is all we need to do and from now on, calls that come in to Box-A on your phone<br />

number 12345678 will be directed to extension 500 of Box-A. However, since all calls to<br />

extension 500 has been unconditionally redirected to extension 6000, asterisk will forward<br />

the call to extension 6000 which your outbound route will pick up and send to Box-B.<br />

When it gets to Box-B, it will be answered by the IVR in Box-B.<br />

TRIXBOX-2 Without Tears Page 140 of 238


31 CUSTOMISED VOICE<br />

The default pre-recorded voice prompts and announcements in TRIXBOX are suitable for<br />

almost every situation, however there will be times when customised voice prompts or<br />

announcements will be required, e.g. to mix English and other language on a single<br />

announcement.<br />

Although there are separate voice sets that can be used, sometimes we only require a<br />

few prompts and not the entire voice set.<br />

31.1 CUSTOMISING VOICE PROMPTS<br />

To satisfy this requirement, custom voice prompts can be recorded individually by using<br />

the System Recording facility of freePBX as covered in the chapter referring to System<br />

Recording earlier in this document.<br />

However, if you want to manually cut the script, you can do the following (personally I<br />

wouldn’t bother – why re-invent the wheel). Under the [from-internal-custom] context<br />

of extensions_custom.conf, add the following codes.<br />

[from-internal-custom]<br />

; For custom recording<br />

exten => 5678,1,Wait(2)<br />

exten => 5678,2,Record(/tmp/my-recording:gsm)<br />

exten => 5678,3,Hangup<br />

; for playback of custom recording<br />

exten => 5679,1,Playback(/tmp/my-recording)<br />

exten => 5679,2,Hangup<br />

To start recording, use one of the phone extension and dial 5678. At the beep, start<br />

recording the voice prompt.<br />

The voice prompt will be saved as my-recording.gsm (gsm format) in the /tmp directory.<br />

When completed, hang up and dial 5679. The voice prompt will be played back.<br />

If you are not satisfied, repeat the above process.<br />

Once you are satisfied, rename the file to something related and recognisable e.g.<br />

my_office_business_hours.gsm. The file should then be moved to the<br />

/var/lib/asterisk/sound directory.<br />

The file can be played through your custom applications or prompts using the Playback<br />

or Background function of Asterisk.<br />

A good information on Asterisk sound files and how to create them can be found here<br />

http://voip-info.org/wiki/view/Asterisk+sound+files<br />

TRIXBOX-2 Without Tears Page 141 of 238


31.2 INSTALLING OTHER LANGUAGES<br />

If you wish to use a different language other that the default American English that comes<br />

with Asterisk, there are a couple of ways that you can do but as this guide is for<br />

beginners, I will go the easiest method.<br />

Create a subdirectory for the particular language (eg: ‘au’ for Australian English, ‘fr’ for<br />

French, ‘it’ for Italian etc.) in the /var/library/asterisk/sounds directory, e.g.<br />

/var/library/asterisk/sounds/au and send all your prompts sound files there. Also create<br />

the language directories in the digits, letters etc directories, and send the entire prompt<br />

files there.<br />

Add the following line in the iax.conf and sip.conf configuration file under [general]. In<br />

zapata.conf configuration file the line should be added under [channels].<br />

language=au ; (or fr, it or whichever language is installed)<br />

<br />

You may use the Edit Configuration facility of TRIXBOX, otherwise you can use<br />

nano at the command prompt of your Asterisk box (or SSH to your Asterisk box) to<br />

edit the files that resides in the etc/asterisk directory.<br />

31.3 CONVERTING WAV FILES<br />

For those who wish to record their own sound prompts, the following may be of some<br />

assistance.<br />

Trixbox will be able to play virtually any sound that it has the codec for e.g. wav(pcm),<br />

wav49, gsm, g711, g729 etc. However, the gsm format seems to be the common format<br />

used for the default voice prompts.<br />

31.3.1 Converting WAV to GSM<br />

Since the WAV format is the most common format that is being adopted when<br />

recording with a windows based PC, and most times, the windows based WAV format<br />

does not play well with asterisk, below is a method of converting the windows<br />

recorded WAV format to GSM using SOX.<br />

Your result will be better if you record your sound files in mono, 16 bit, 8000 Hz.<br />

After recording the WAV sound files, transfer the sound files to the TEMP directory of<br />

the Trixbox PC. In this example, let,s call one of the sound files hello.wav.<br />

<br />

<br />

Login as root and change directory to the directory where you have transferred<br />

the sound files to e.g. cd /tmp<br />

At the prompt issue the following commands.<br />

• If your sound files were recorded in mono, 16 bit, 8000 Hz<br />

sox hello.wav hello.gsm<br />

• If your sound files were recorded in mono but NOT 16 bit, 8000 Hz<br />

sox hello.wav -r 8000 hello.gsm resample -ql<br />

TRIXBOX-2 Without Tears Page 142 of 238


• If your sound files were recorded in stereo, you will need the –cl switch.<br />

sox hello.wav -r 8000 –cl hello.gsm resample –ql<br />

• if your sound files were recorded in ADPCM wav files, to convert to standard<br />

wav file;<br />

sox hello.wav -r 8000 -c1 -s -w hello-out.wav resample -ql<br />

<br />

Next, move the sound file to the sound directory where all your prompts are<br />

stored and you are done.<br />

You may also convert a number of WAV files at once using the following command.<br />

In this example, lets assume that the files were all recorded in stereo;<br />

for a in *.wav; do sox "$a" -r 8000 -c1 "`echo $a|sed -<br />

e s/wav//`gsm" resample –ql<br />

31.3.2 Converting WAV to SLN<br />

Starting from Asterisk version 1.2.0, the .sln (SLINEAR) format seems to be the<br />

format that is being adopted (the GSM format is still commonly being used), so don’t<br />

worry about converting your existing prompts.<br />

To convert wav file to sln, use the following command:<br />

sox hello.wav -t raw -r 8000 -s -w -c1 hello.sln<br />

Further reference for converting wav sound files can be found here at voip-info.org.<br />

TRIXBOX-2 Without Tears Page 143 of 238


32 MOH (MUSIC ON HOLD)<br />

Trixbox comes with a number of preinstalled music on hold selections, however you may<br />

want to add your own music to the existing selection or remove the default selection<br />

altogether, and only use your own selection ins<strong>tea</strong>d.<br />

32.1 CUSTOMISING MOH<br />

TRIXBOX supports native MP3. To change or add to your music on hold collections,<br />

simply upload all your MP3 to TRIXBOX through the Onhold Music screen of freePBX.<br />

You may also need to add the following, under [channels] in your zapata.conf file:<br />

musiconhold=default<br />

Pretty much any mp3 will work with Trixbox. Prior to that, it's better to convert it to a<br />

standard format. When converting my MP3 music, I use <strong>Free</strong>Rip and convert the music<br />

as per the following:<br />

Bit Rate: 128<br />

Mono<br />

Constant Bit Rate (CBR)<br />

Make sure that there is no ID3 Tagging.<br />

I found that this conversion gives me the most satisfactory result.<br />

To customise your music to your favourite, you may need to create a new music category<br />

directory to hold your favourite music. Do this through the freePBX “On Hold Music” GUI<br />

interface. I call my category favourites.<br />

Upload your favourite music to this directory. Again, do this through the freePBX GUI.<br />

Once finished uploading, click the “Enable Random Play” button and the red bar.<br />

Make a little change to your musiconhold.conf file like the example below (this way you<br />

don’t have to delete the music in your default directory).<br />

You will now have to get used to the newer approach (it no longer uses the [classes] tag):<br />

The musiconhold.conf files in 1.2 is now set out differently as per the example of my file<br />

below:<br />

musiconhold.conf<br />

;<br />

; Music on hold class definitions<br />

; This is using the new 1.2 config file format, and will not work with<br />

1.0<br />

; based Asterisk systems<br />

;<br />

[default]<br />

mode=files<br />

;<br />

; valid mode options:<br />

; quietmp3 -- default<br />

; mp3 -- loud<br />

; mp3nb -- unbuffered<br />

; quietmp3nb -- quiet unbuffered<br />

; custom -- run a custom application<br />

; files -- read files from a directory in any Asterisk supported format<br />

;<br />

directory=/var/lib/asterisk/mohmp3/favourite ;


andom=yes<br />

#include musiconhold_additional.conf<br />

The corresponding entries can be found in musiconhold_additional.conf – see below:<br />

musiconhold_additional.conf<br />

[acc_1]<br />

mode=files<br />

directory=/var/lib/asterisk/mohmp3/acc_1/<br />

random=yes<br />

32.2 MOH FOR DIFFERENT TRUNKS<br />

So you are hosting three different sections of your business on your Trixbox with three<br />

different Phone numbers (or trunks for that matter) and would like to have different music<br />

on hold for the different Music On Hold for each of the section.<br />

While freePBX does not have a ready method of doing it from the GUI, we can trick the<br />

system into doing it with a simple creative modification. Here goes.<br />

Create 3 separate music categories (Rock, country and classical) and populate them with<br />

MP3s or whatever that turns you on.<br />

Create 3 custom context in extensions_custom.conf<br />

[custom-department_1]<br />

exten => s,1,playback(pls-wait-connect-call)<br />

exten => s,n,SetMusicOnHold(country)<br />

exten => s,n,Dial(SIP/2001,60,r)<br />

exten => s,n,Macro(vm,2001); voice mail to extension if no answer<br />

exten => s,n,Hangup<br />

[custom-department_2]<br />

exten => s,1,playback(pls-wait-connect-call)<br />

exten => s,n,SetMusicOnHold(classical)<br />

exten => s,n,Dial(SIP/2002,60,r)<br />

exten => s,n,Macro(vm,2002); voice mail to extension if no answer<br />

exten => s,n,Hangup<br />

[custom-department_3]<br />

exten => s,1,playback(pls-wait-connect-call)<br />

exten => s,n,SetMusicOnHold(Rock)<br />

exten => s,n,Dial(SIP/2003,60,r)<br />

exten => s,n,Macro(vm,2003); voice mail to extension if no answer<br />

exten => s,n,Hangup<br />

Assuming 2001,2002 and 2003 being the extensions of the various departments,<br />

Incoming route for Trunk1 send to<br />

Custom App custom-department_1,s,1<br />

Incoming route forTrunk2 send to<br />

Custom App custom-department_2,s,1<br />

Incoming route forTrunk3 send to<br />

Custom App custom-department_3,s,1<br />

TRIXBOX-2 Without Tears Page 145 of 238


32.3 STREAMING MUSIC ON HOLD<br />

Streaming music on hold is not directly supported using the GUI of Trixbox or freePBX,<br />

however if you are prepared to do a little editing of the musiconhold.conf file and<br />

downloading some external files, you will be able to get it working somehow.<br />

There are 2 ways of doing this and I will outline them both below:<br />

Method 1<br />

(old method of doing things but pretty straight forward and it works)<br />

Below is what I have to do to get Streaming On Hold for my system. I realised that it<br />

is not the best method, but for the sole purpose of getting Music on Hold, it got me<br />

working.<br />

From command line, find out if you have mpg123 installed using the following<br />

command.<br />

mpg123 –v<br />

You will find out if you have mpg123 installed or not and its version number. The<br />

version that we want is mpg123-0.59r.<br />

Since I do not have mpg123 installed, first I have to download and install mpg123 - it<br />

is not included in Trixbox implementation of Asterisk. To get mpg123 I have to log on<br />

as root and at the command prompt I did the following:<br />

cd /usr/bin<br />

wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz<br />

tar –zxvf mpg123-0.59r.tar.gz<br />

cd mpg123-0.59r<br />

make linux<br />

make install<br />

ln -s /usr/local/bin/mpg123 /usr/bin/mpg123<br />

I have to make a directory for the streaming music. You can do this though the<br />

freePBX GUI or manually. In this example, I have shown the manual method.<br />

su asterisk<br />

cd /var/lib/asterisk/mohmp3/<br />

mkdir stream<br />

Next I need to create a zero length dummy MP3 file for this purpose in the<br />

/var/lib/asterisk/mohmp3/stream directory (this can be done manually).<br />

cd stream<br />

touch stream.mp3<br />

exit<br />

Now I have to do some editing of my musiconhold.conf file.<br />

Open the musiconhold.conf file using the Config edit option on your Trixbox and add<br />

the following lines on top of the file;<br />

[classes]<br />

default => quietmp3:/var/lib/asterisk/mohmp3/stream,http://128.177.3.80:4064/<br />

and leave everything else out (or commented out) like my example below.<br />

TRIXBOX-2 Without Tears Page 146 of 238


The http://128.177.3.80:4064/ (SKY.FM – Country) is where I get my streaming<br />

music from.<br />

This is what my musiconhold.conf looks like.<br />

[classes]<br />

default => quietmp3:/var/lib/asterisk/mohmp3/stream,http://128.177.3.80:4064/<br />

;<br />

The lines in BOLD are the lines that was added to the musiconhold.conf file.<br />

After having done that, reboot your system .<br />

The above is not necessarily being the best way to approach it but that is the simplest<br />

way that I know of.<br />

Method 2<br />

(as suggested by Bob Fryer)<br />

This method was tested on system running Elastix 0.9.2, but we expect that it will<br />

work just as well under Trixbox.<br />

cd /usr/src<br />

wget http://dag.wieers.com/rpm/packages/libmad/libmad-0.15.1b-4.el5.rf.i386.rpm<br />

wget http://dag.wieers.com/rpm/packages/libid3tag/libid3tag-0.15.1b-3.el5.rf.i386.rpm<br />

wget http://zak.googlecode.com/files/madplay-0.15.2b-1.el5.i386.rpm<br />

rpm -ivh libmad*.*<br />

rpm -ivh libid3tag*.*<br />

rpm -ivh madplay*.*<br />

cd /var/lib/asterisk/mohmp3/<br />

mkdir stream<br />

cd stream<br />

touch stream.mp3<br />

Add the following to /etc/asterisk/musiconhold_custom.conf (if other lines are in this<br />

file, just add these afterwards)<br />

--------------------------------<br />

[easylistening]<br />

mode=custom<br />

application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0<br />

http://128.177.3.80:4064/<br />

[classical]<br />

mode=custom<br />

application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0<br />

http://216.126.84.50:8000/<br />

[Country]<br />

mode=custom<br />

application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0<br />

http://64.236.34.106:80/stream/1075/<br />

[Dance]<br />

mode=custom<br />

application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0<br />

http://193.138.205.194:8014/<br />

--------------------------------<br />

TRIXBOX-2 Without Tears Page 147 of 238


The above are just examples, you can add more, or change the ones above. You<br />

may want to find some low bandwidth streams that are closer to your Country to<br />

eliminate any dropouts etc.<br />

Just in case formatting is incorrect, between the start of the word "Application" and<br />

the end of the HTTP address is all on one line. The same with the WGET.<br />

Reboot your system afterwards.<br />

Then go into your trunks and extensions in freepbx and choose the MOH Stream you<br />

want for on hold music.<br />

The Madplay application offers a little more control, especially in volume/attenuation.<br />

The following are addresses where you may find some streaming music for your<br />

MOH.<br />

181.kickin’ country http://64.236.34.106:80/stream/1075/<br />

Classical 96.3 FM http://216.126.84.50:8000/<br />

SMOOTHJAZZ.COM http://scfire-chi0l-2.stream.aol.com:80/stream/1005/<br />

Sky FM – Modern Jazz http://205.188.215.227:8008/<br />

Energy 98 – Dance Hit http://193.138.205.194:8014/<br />

Life FM – Adelaide Australia http://203.16.214.174:8040/<br />

Groove Mix http://63.249.3.194:8010/<br />

The 80s channel http://64.236.34.106:80/stream/1040/<br />

TRIXBOX-2 Without Tears Page 148 of 238


33 BACKUP AND RESTORE<br />

Backup and Restore are two of the mandatory functions of any application. <strong>Free</strong>PBX is<br />

no exception. With this in mind, the developer of freePBX has incorporated this facility in<br />

freePBX under the Tools section.<br />

Provision for flexibilities was built in this tool. You can schedule your backup, Daily,<br />

Weekly, Monthly, Ad-Hoc and even hourly if you wish to. Therefore there is no excuse for<br />

not making a regular backup.<br />

33.1 SCHEDULE A BACKUP<br />

To schedule a backup, from freePBX choose Tools -> Backup & Restore<br />

You will then be presented with the following screen:<br />

Next select Add Backup Schedule<br />

The screen that follows is where you define your backup requirement.<br />

TRIXBOX-2 Without Tears Page 149 of 238


I have chosen to schedule a Weekly (on Sundays t ) backup as per the illustration above:<br />

• In the Schedule Name, I have given it a name Weekly (to signify that it is a<br />

weekly job)<br />

• I have also selected all the items to be backed up – VoiceMail, System<br />

Recordings, System Configurations and CDR only.<br />

• Next from the Run Backup drop down choice, I have chosen Weekly (on<br />

Sundays)<br />

Once I have done these, I click on Submit Changes.<br />

Naturally you can schedule numerous backups. It is up to you to decide. If you are<br />

wondering where it is being stored, it is here /var/lib/asterisk/backups. The backup files<br />

are identified by the backup names.<br />

<br />

If this is the first time you schedule a backup, it is advisable to do the backup right<br />

away by selecting Now from the Run Backup drop down selection box. After this is<br />

done, you may start scheduling your regular backup by selecting the appropriate<br />

option presented to you.<br />

.<br />

TRIXBOX-2 Without Tears Page 150 of 238


33.2 TO RESTORE A BACKUP<br />

Backup itself is not useful if it cannot be restored. The freePBX developer has thought of<br />

this too.<br />

This is a very simple procedure. All you need to do is click on the Restore option and the<br />

rest are all a matter of choosing what it is that you want to restore.<br />

TRIXBOX-2 Without Tears Page 151 of 238


34 SUGARCRM<br />

SugarCRM is a contact management software that comes bundled with Trixbox.<br />

To set up SugarCRM, first, you need to open the SugarCRM application<br />

http:///crm using the default username of Admin and the<br />

password of password.<br />

For security reason you should change the Admin password. To do this, click on 'My<br />

Account' in the upper right-hand corner, then click on the 'Change Password' button<br />

underneath 'Users: Administrator (Admin) in the center-left of the screen.<br />

Change it to a new password and confirm your new password and click 'Save.'<br />

Now it's time to set up your contacts. I will start off setting up a couple of my internal<br />

extensions.<br />

Click on 'My Account' again and then click the 'Edit' button.<br />

Change 'Asterisk Phone Extension' to your Asterisk extension. My extension is 2001.<br />

While you are at it, change your time zone and date format as well.<br />

Click 'Save' to save that information.<br />

Let's add another one.<br />

Click on the contacts tab and then select 'Create Contact' from the left hand Shortcuts<br />

menu.<br />

Add another extension, in my case I chose my daughter’s extension 2002:<br />

Firstname: Norsurya<br />

Last name: Sharif<br />

Home: 2002<br />

Click 'Save' to save that information.<br />

Add another and another if you want to, using the method above.<br />

At this point, you may find that you are unable to make a phone call through SugarCRM.<br />

This is due to a little bug in the popup_picker.php (this bug may have been fixed by the<br />

time you read this, but at the time of writing, this bug exists).<br />

To fix this bug, you need to edit popup_picker.php by doing the following:<br />

From your Linux CLI, log in as root.<br />

cd /var/www/html/crm/modules/Contacts<br />

nano Popup_picker.php<br />

Browse down to line 121 and change it from:<br />

$number = preg_replace ( "/[^\d\*]/", "", $number );<br />

To<br />

$number = preg_replace ( "/[^\d\*]/", "", $display_number );<br />

TRIXBOX-2 Without Tears Page 152 of 238


You should now be able to dial from SugarCRM to your other internal extensions and to<br />

the outside world.<br />

<br />

You can add multiple users who will each have their own settings/contacts etc.<br />

TRIXBOX-2 Without Tears Page 153 of 238


35 USB PHONE SUPPORT<br />

Most USB Phones are pre-configured for use with Skype and as a result some USB<br />

Phone users are experiencing difficulties using the USB phones dial pads to dial out using<br />

providers other than Skype especially when using SIP. Special driver are usually<br />

required.<br />

The following are links, which may interest USB phone users, where appropriate drivers<br />

may be found. Users may have to try different drivers to find a suitable one.<br />

http://www.yealink.com/english/support.htm<br />

http://www.packetizer.com/products/<br />

http://www.sednacomputer.com/products/se-p1k.html<br />

http://www.welltech.com/product_e_06.htm<br />

http://www.waytec.com.au/download.htm<br />

http://www.pc-telephone.com/free-phone.htm<br />

http://www.sjlabs.com/usbphone/SJphoneDriverATCOM-AU-100.exe<br />

TRIXBOX-2 Without Tears Page 154 of 238


36 CODEC (CODER DECODER)<br />

When making a call over the net, the software (soft-phone) or hardware needs to use a<br />

codec so as to send/receive information in a certain format and convert it to what you<br />

hear. What this means to you and me is that codecs compress data, allow you to transmit<br />

the compressed data which is then uncompressed at the receiving end. If you compress<br />

something with G729 and you don't have that installed, then you wont be able to<br />

decompress it and vice versa.<br />

<br />

g729 does not come preinstalled with Asterisk – you will need to purchase it.<br />

Different codecs have different compression ratios resulting in different bandwidth<br />

requirements. Generally the higher the compression the more CPU power required to<br />

compress, and sometimes decompress.<br />

In most cases this means:<br />

• Higher compression = More CPU power = Lower Bandwidth<br />

• Lower compression = Less CPU power = More Bandwidth<br />

So the more bandwidth you have, the less need for a higher compression ratio and the<br />

less powerful the CPU that will be needed.<br />

Most VoIP providers/hardware/licensed software will support G711 and G729 (However<br />

be sure to check this before purchasing hardware, or signing up with a VoIP provider!),<br />

with G711 requiring almost 3 times as much bandwidth, and providing excellent quality<br />

and the G729 providing quality similar to a good mobile call but using less bandwidth.<br />

Below are the approximate bandwidth requirements for Several Common VoIP<br />

Compression Algorithms using SIP. They vary slightly depending on the protocol used.<br />

Codec<br />

Codec Bit Rate Nominal Ethernet Approx. MBytes<br />

(Kbps)<br />

Bandwidth (Kbps) usage per hour<br />

G.711 64 87.2 39.24<br />

G.729 8 31.2 14.04<br />

G.723.1 6.4 21.9 9.86<br />

GSM 13.2 28.7 approx 12.92 approx<br />

iLBC 15.2 30.83 approx 13.87 approx<br />

G.723.1 5.3 20.8 9.36<br />

G.726 32 55.2 24.84<br />

G.726 24 47.2 21.24<br />

G.728 16 31.5 14.18<br />

Codecs used by TRIXBOX reside in the /usr/lib/asterisk/modules directory.<br />

The following links will give you some indications of the bandwidth usage of the various<br />

codecs that you may be using or contemplating on using.<br />

http://www.asteriskguru.com/tools/bandwidth_calculator.php<br />

http://www.cisco.com/en/US/tech/tk652/tk698/technologies_tech_note09186a0080094ae2.shtml<br />

http://www.voip-calculator.com/calculator/lipb/<br />

http://www.connect802.com/voip_bandwidth.php<br />

http://www.newport-networks.com/pages/voip-bandwidth-calculator.html<br />

There are others. All you have to do is Google for them ☺<br />

TRIXBOX-2 Without Tears Page 155 of 238


36.1 INSTALLING G729 AND G723 CODECS<br />

If you have the licence for the g729 codec and found that the digium version of g729<br />

is a little problematic and would like to try the free version, following is the method of<br />

installing it as described by David Klaverstyn – thanks David.<br />

DISCLAIMER:<br />

You might have to pay royalty fees to the G.729/723 patent holders for using their<br />

algorithm.<br />

Before downloading the codec module you need to verify what your processor type is,<br />

as to get a compatible compiled codec.<br />

From the Linux command type in:<br />

# cat /proc/cpuinfo<br />

Look specifically at the model name and the flags. The following is an example of the<br />

process that I am using.<br />

Process: 0<br />

vendor_id:<br />

GenuineIntel<br />

cpu family: 6<br />

model: 8<br />

model name:<br />

Pentium III (Coppermine)<br />

stepping: 3<br />

cpu MHz: 648.110<br />

cache size:<br />

256 KB<br />

fdiv_bug:<br />

no<br />

hlt_bug:<br />

no<br />

f00f_bug:<br />

no<br />

coma_bug:<br />

no<br />

fpu:<br />

yes<br />

fpu_exception: yes<br />

cpuid level: 2<br />

wp:<br />

yes<br />

flags:<br />

fpu vme de pse tsc msr pae mce cx8 mtrr pge mca<br />

cmov pat pse36 mmx fxsr sse<br />

bogomips: 1297.41<br />

From this information we can see that it is a Pentium III processor and it is using sse.<br />

This is the 2 bits of required information that we need. If you don’t see sse in your<br />

flag then the file you need must contain the words no-sse.<br />

Now go to http://kvin.lv/pub/Linux/Asterisk/ and select wither Asterisk version 1.2 or 1.4<br />

depending on the version you are using.<br />

The files are named as codec_g72x--pentiumx.so<br />

So from the information above to obtain the G729 codec we need to get the file<br />

codec_g729-gcc-pentium3.so and for the G723 codec we need to get the file g723-<br />

gcc-pentium3.so<br />

The gcc represents the way the module was compiled. This is your most likely<br />

choice. To view the different type of compiled version look at this file<br />

http://kvin.lv/pub/Linux/Asterisk/README<br />

Now that we know what file we need you can now download the appropriate file.<br />

Change folders to /usr/lib/asterisk/modules<br />

# cd /usr/lib/asterisk/modules<br />

TRIXBOX-2 Without Tears Page 156 of 238


Download the required file(s)<br />

For the G729 codec<br />

For Pentium III<br />

# wget http://kvin.lv/pub/Linux/Asterisk/codec_g729-ast14-gcc4-<br />

glibc-pentium3.so<br />

For Pentium IV<br />

# wget http://kvin.lv/pub/Linux/Asterisk/codec_g729-ast14-gcc4-<br />

glibc-pentium4.so<br />

For the G723 codec<br />

For Pentium III<br />

# wget http://kvin.lv/pub/Linux/Asterisk/codec_g723-ast14-gcc4-<br />

glibc-pentium3.so<br />

For Pentium IV<br />

# http://kvin.lv/pub/Linux/Asterisk/ codec_g723-ast14-gcc4-glibcpentium4.so<br />

Rename those files to codec_g729.so or codec_g723.so accordingly.<br />

Restart asterisk and you are done.<br />

If Asterisk does not start then you may need to try icc files ins<strong>tea</strong>d of gcc.<br />

36.2 TO INSTALL CODECS ON PIAF<br />

All processors EXPERIMENTAL and please ensure that this script is only used on<br />

PiaF or the codecs may not work. (unfortunately celeron processors are not supported).<br />

• Log onto PBX in a Flash via the CLI (Command Line Interface) as user root<br />

cd /root<br />

• wget http://www.pbxinaflash.org/scripts/install-codecs.x.gz<br />

• gunzip install-codecs.x.gz<br />

• chmod +x install-codecs.x<br />

• ./install-codecs.x<br />

• In the program you will have to agree to the license before the install can<br />

continue<br />

• you will then be prompted to choose the type of processor you have. You<br />

must choose the correct processor or else Asterisk will stop working!<br />

• rm -f install-codecs.x<br />

To check if the codecs has been properly installed, at the Asterisk CLI type the<br />

following:<br />

core show translation<br />

TRIXBOX-2 Without Tears Page 157 of 238


TRIXBOX-2 Without Tears Page 158 of 238


37 PSTN TRUNK – SPECIAL HANDLING<br />

37.1 DIAL 0 FOR OUTSIDE LINE<br />

There will be times when a user would like to get an outside line something similar to a<br />

PABX by simply dialling a number e.g. 0 or 9.<br />

I got around it by creating an entry in extensions_custom.conf.<br />

In my case I use 0 as the prefix to get an outside line.<br />

I have also pre-recorded a voice prompt to instruct the caller what to do after the second<br />

dial tone.<br />

37.1.1 Using Zaptel Card Method<br />

;##############################################<br />

; To get outside line through ZAP - Ben 22-12-2005<br />

; after dialling 0 will get a second dial tone.<br />

; Then dial the number required.<br />

; No need to press the send button after the second number dialled<br />

;##############################################<br />

exten => 0,1,Playback(start-dial-after-dialtone)<br />

exten => 0,2,Dial(ZAP/1/{EXTEN})<br />

exten => 0,3,Hangup<br />

The example above is based on systems that have Zaptel card (e.g. TDM400 or<br />

X100P etc.) installed. Note:* If you're using a PRI line, you need to enable 'overlapdial'<br />

in /etc/asterisk/zapata.conf for this to work.<br />

37.1.2 Using SPA3K Method<br />

Using SPA3K will be a little tricky. I am describing how I got around it (assuming that<br />

you have set up the SPA3K as described in this document), however there maybe<br />

other method.<br />

1. In the SPA Line 1 Tab, I have included the following entry in the dialplan:<br />

)<br />

2. The following is what my dialplan looks like in SPA3K<br />

(**|*xx|**x.|xx.|)<br />

3. In the PSTN Line Tab, I have the following:<br />

• VOIP-PSTN Gateway Enabled: Yes<br />

• VOIP Caller Auth Method: None<br />

• VOIP Caller Default DP: None<br />

In made the following entry in my Asterisk entensions_custom.conf<br />

;##############################################<br />

; To get outside line through SPA3K - Ben 25-12-2005<br />

; after dialling 0 will get a second dial tone. Then dial the<br />

; number required. No need to press the send button again<br />

;##############################################<br />

TRIXBOX-2 Without Tears Page 159 of 238


exten => 0,1,Playback(start-dial-after-dialtone)<br />

exten => 0,2,Dial(SIP/Telstra/{EXTEN}) ; Telstra being the name of the SPA3K trunk.<br />

exten => 0,3,Hangup<br />

Every time when I dial ‘0’, the SPA3K will send it to Gateway 0, which is the PSTN<br />

line and present me with a second dial tone.<br />

37.2 GIVING PRIORITY TO EMERGENCY NUMBERS (E.G. 000)<br />

Emergencies, by definition should be given right of way. This applies to the right of using<br />

the telephone for emergency purposes above other uses.<br />

Imagine what will happen if you want to use the PSTN line to call emergency 000 (in<br />

Australia) and someone else was hogging the line. The sensible way is for Asterisk to<br />

disconnect the line and allow you to make the emergency call ins<strong>tea</strong>d.<br />

The following method will provide you with the facility, however you need to do some<br />

editing to the extensions_custom.conf file in /etc/asterisk.<br />

In my case I have pre-recorded a voice prompt called ‘calling-emergency’ which says,<br />

“You are trying to call emergency assistance. If you have dial this in error, please hangup”<br />

;###################################################<br />

; Give priority to emergency number by disconnecting existing user<br />

; if using the PSTN line first, otherwise simply call the emergency number.<br />

;###################################################<br />

exten => 000,1,Background(calling-emergency) ; voice warning<br />

exten => 000,2,Wait(1) ; give caller a chance to hang up<br />

exten => 000,3,Dial(Zap/1/000,,j) ; If ZAP 1 is busy, jump to n+101<br />

exten => 000,4,Hangup() ; hang up after the call<br />

exten => 000,104,Softhangup(Zap/1-1) ; hang up the line if being used<br />

exten => 000,105,Goto(3) ; make call after disconnecting the other user<br />

TRIXBOX-2 Without Tears Page 160 of 238


38 PORT FORWARDING AND QOS – ROUTERS<br />

38.1 PORT FORWARDING<br />

While most domestic routers using UPnP do not require port forwarding, some routers do.<br />

Even if your router does not require port forwarding for TRIXBOX to work, do yourself a<br />

favour and forward a few of the relevant ports to your Asterisk IP address anyway – it<br />

doesn’t hurt.<br />

IAX Port: 4569 (UDP)<br />

Sip ports: 5004 - 5082 (UDP and TCP), more if you want to.<br />

RTP ports: 10000 – 10500 (UDP) – this should be enough.<br />

I am using the LinkSys WRT54G wireless router. In the example below, I have forwarded<br />

all the ports mentioned above to my asterisk box IP, which is 192.168.1.101<br />

These should be enough for starters.<br />

38.2 QOS – ROUTERS<br />

Some routers have QOS facility while some routers haven’t. It is highly recommended<br />

that you enable this function if your router supports it.<br />

There have been a number of discussions on the effectiveness of QOS on broadband<br />

utilising the public Internet circuit. It is beyond this guide to document the effectiveness or<br />

otherwise of enabling QOS on your router. For a start, there are just too many routers<br />

there for me to give any meaningful examples.<br />

I use the Linksys WRT54G®. Taking the easy way out, I simply restrict the PCs (see<br />

below) that more often than not will be used as a P2P client or chatting on the MSN chat<br />

channels.<br />

I restrict the PCs according to their MAC addresses.<br />

TRIXBOX-2 Without Tears Page 161 of 238


In the application priority section (see below), I have defined the various ports that I want<br />

priority to be accorded the highest priority. In this case I have defined the port ranges<br />

related to my VOIP requirement.<br />

My recommendation is, if your router has the function, use it. At the very least, it will<br />

prioritise traffic within your own LAN especially when you have sons and daughters (for<br />

that matter you too can be the culprit) who are always on the P2P, leeching files and<br />

music.<br />

<br />

This may not be the best solution. If anyone has a better solution for the Linksys<br />

WRT54G, please let me know.<br />

TRIXBOX-2 Without Tears Page 162 of 238


39 UPGRADING YOUR SYSTEM<br />

Mostly everyone would like to have the latest and the greatest and if you are like most,<br />

chances are that you would certainly want to update your TRIXBOX and/or freePBX as<br />

soon as there is a new update.<br />

If you are currently using Trixbox v2.x, the following instruction may get you there. It’s<br />

best to stop asterisk. Through SSH or the command prompt: type:<br />

amportal stop (Remember to always stop asterisk first before doing this)<br />

service zaptel stop (it helps to stop the zaptel service as well)<br />

39.1 UPGRADING TRIXBOX<br />

The trixbox-update.sh command has been depreciated and no longer availavle. To<br />

upgrade Trixbox, you now simply do it through yum.<br />

yum –y update<br />

At the end of it, you may need to reboot.<br />

reboot.<br />

39.2 UPGRADING FREEPBX<br />

There are 2 ways to upgrade freePBX as explained at the aussievoip website here<br />

http://www.aussievoip.com/wiki/freePBX<br />

Either one will be fine but I would like to suggest that you take the all-in-one version with<br />

modules and be done with it. Afterall, this is the method recommended if one is on a<br />

limited-bandwidth connection, or the <strong>Free</strong>PBX machine doesn't have easy Internet<br />

access.<br />

To conduct this upgrade, you will need to log on to the Trixbox PC as root.<br />

At the command prompt, do the following;<br />

cd /usr/src/<br />

wget http://mirror.freepbx.org/freepbx-2.4.0.tar.gz<br />

tar zxvf freepbx-2.4.0.tar.gz<br />

cd freepbx-2.4.0<br />

./install_amp<br />

Once this is done, freePBX is now upgraded to version 2.4.0 and you can start managing<br />

and/or upgrading the freePBX modules.<br />

The other method is through the upgrade mudule that can be obtained through Module<br />

Admin of freePBX. This is an easier method for most.<br />

TRIXBOX-2 Without Tears Page 163 of 238


40 TOOLS<br />

The following are tools that I use regularly to maintain my Asterisk systems.<br />

40.1 WEBMIN FOR TRIXBOX<br />

Webmin is an invaluable web based tool for managing a Linux box. Webmin make it easy<br />

to configure application like SMTP mail, editing files etc.<br />

Webmin is not installed as default in Trixbox but it is in the repositury that user can<br />

download. However I found that the package manager can be extremely slow if not<br />

impossible to get into. As a result I have resorted to doing it manually and much faster<br />

too.<br />

At the command line simply issue the following command:<br />

yum install webmin<br />

I have found the above method is straightforward and simple. However there are some<br />

users who found that following an alternative method is simpler. If that is the case, the<br />

alternative installation method can be found here:<br />

http://www.terrasoftsolutions.com/support/solutions/ydl_general/webmin.shtml<br />

Once installed, you may connect to Webmin remotely through your browser using the<br />

following address https://:10000. E.g.<br />

https://192.168.0.101:10000<br />

If you would like to avoid clashing the port with your RTP port which is 10000 – 20000,<br />

you may edit the file /etc/webmin/miniserv.conf and change the port value to something<br />

else, such as 9000.<br />

Locate the entry where it says:<br />

Port=10000<br />

And change this to;<br />

Port=9000<br />

You can use https://192.168.0.101:9000 to connect to Webmin ins<strong>tea</strong>d.<br />

The alternative is to edit the /etc/asterisk/rtp.conf file like the example below and you<br />

can keep https://192.168.0.101:10000<br />

TRIXBOX-2 Without Tears Page 164 of 238


This will break PA1688 based phones. It's better to change your webmin.conf file<br />

[general]<br />

;<br />

; RTP start and RTP end configure start and end addresses<br />

;<br />

rtpstart=10000 < - - change this to 10002(totally unnecessary.. ☺)<br />

rtpend=20000<br />

40.1.1 To update WebMin<br />

Anytime you want to update Webmin, simply do the following.<br />

Log on to your Asterisk box (SSH or at the console).<br />

At the command prompt, issue the following command:<br />

yum –y install webmin<br />

40.3 PUTTY<br />

PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along<br />

with an xterm terminal emulator.<br />

It is written and maintained primarily by Simon Tatham and can be downloaded from the<br />

following link.http://www.putty.nl/download.html<br />

40.4 WINSCP<br />

WinSCP is an open source freeware SFTP client for Windows using SSH. Legacy SCP<br />

protocol is also supported. Its main function is safe copying of files between a local and a<br />

remote computer.<br />

TRIXBOX-2 Without Tears Page 165 of 238


It can be downloaded from the following link.<br />

http://winscp.net/eng/index.php<br />

TRIXBOX-2 Without Tears Page 166 of 238


41 USE ACCESS TO CONNECT TO DATABASE<br />

A quick and dirty way to access the Trixbox database is through MSACCESS. This will<br />

enable you to work on the data kept in the MySQL database which Trixbox uses. You<br />

may want to extract CDR data for reporting etc. Imagination is the restricting factor.<br />

To do this first you must download the MySQL ODBC driver for Windows here:<br />

http://www.mysql.org/downloads/connector/odbc/3.51.html save it somewhere in your<br />

Windows local hard drive but do not install it yet.<br />

41.1 SETTING UP A NEW MYSQL USER<br />

Log into the TrixBox web interface, and navigate to the phpMyAdmin screen.<br />

phpadmin selection on Trixbox<br />

When selected, you will be presented the following screen.<br />

Select and Click "Privileges" (see arrow in the illustration above) and a new screen will<br />

pop up – see below.<br />

TRIXBOX-2 Without Tears Page 167 of 238


Select and Click "Add a new user" (see illustration above) and you will presented with the<br />

following screen but all the fields will be blank. The arrows indicate all the fields that I<br />

have filled.<br />

In the blank fields enter the following:<br />

User name: enter a User name (e.g. reportis)<br />

Password: enter a password of your choice (e.g. passw0rd)<br />

Since the database lives in the same host, leane the Host field blank.<br />

Under the Data section of "Global Privileges" – see arrow, check all the options. Since we<br />

don’t really want the user to start playing oround with the structure and other aspects of<br />

the database, leave the Structure and Administrations unticked.<br />

Once done, click "Go" in the lower right corner of the screen to save the new user after<br />

which you can get out of PHPAdmin.<br />

41.2 CONFIGURE MYSQL ODBC FOR WINDOWS<br />

Install the ODBC Driver that was downloaded.<br />

Once installed, on the Windows PC, click Start -> Control Panel -> Performance &<br />

Maintenance -> Administrative Tools -> Data Sources (ODBC)<br />

The following screen will appear.<br />

TRIXBOX-2 Without Tears Page 168 of 238


Select the Uer DSN tab and click on the “Add” button.<br />

Scroll to the bottom of the list, and select "MySQL ODBC 3.51 Driver" (see arrow), then<br />

click the Finished button.<br />

When following dialog box appears, fill in the following information:<br />

TRIXBOX-2 Without Tears Page 169 of 238


Data Source Name: TrixBox CDR<br />

Description: Call Detail Reporting<br />

Server: 192.168.1.100 (your server IP address)<br />

User: reports (the username you created in phpMyAdmin previously)<br />

Password: passw0rd (the password that we entered in phpadmin earlier)<br />

Database: asteriskcdrdb<br />

Once this is done, click "Test" to ensure that the connection is working<br />

Click "Ok" to save and finish and “OK” again to close the ODBC dialog box.<br />

41.3 CONNECTING USING MSACCESS<br />

To connect to the CDR database using MSACCESS, you must first create a blank<br />

database. Once the blank database has been created, the CDR table from MySQL can<br />

then be linked to the MSACCESS database that you have created. Once doce, you can<br />

start working on the data. Those familiar with Access can start creating a special<br />

application for their use.<br />

Create an empty ACCESS database. Call it reporting or whatever you like.<br />

TRIXBOX-2 Without Tears Page 170 of 238


Select Tables as illustrated by the arrow above.<br />

Select and click on File (see red arrow). The next screen will appear.<br />

TRIXBOX-2 Without Tears Page 171 of 238


Select “Get External Data” and choose “Link Tables…” and click.<br />

On the explorer’s screen that follows, click the drop down on the “Files of type” and select<br />

“ODBC Database()” – see illustration below.<br />

On the screen that follows, select the “Machine Data Source” tab and select Trixbox CDR<br />

and click on “OK”.<br />

When the following dialog box appears, select “cdr” and click “OK”<br />

Click “OK” again when the following dialog box appears.<br />

TRIXBOX-2 Without Tears Page 172 of 238


When you press OK, the CDR table will be linked to the blank Access Database and you<br />

can start looking at the data by clicking on the “cdr” table.<br />

Now if you click on the “cdr” table and it will open and display the data in the table in<br />

MSACCESS – see below.<br />

View of CDR table through MSACCESS<br />

TRIXBOX-2 Without Tears Page 173 of 238


IBM<br />

TALK / DATA<br />

TALK<br />

RS CS TR RD TD CD<br />

1 2 3<br />

4 5 6<br />

7 8 9<br />

* 8 #<br />

1 2 3<br />

4 5 6<br />

7 8 9<br />

* 8 #<br />

1 2 3<br />

4 5 6<br />

7 8 9<br />

* 8 #<br />

42 MY TRIXBOX® PBX NETWORK<br />

The following is a representation of my network schematic on my Local Area Network with<br />

my Asterisk box as I have done according to my narration above.<br />

My VOIP Network<br />

VOIP Service Provider<br />

PSTN<br />

Internet<br />

SPA3000<br />

8 Ports router<br />

192.168.1.1<br />

192.168.1.10<br />

Broadband Modem<br />

Asterisk PC (IPBX)<br />

192.168.1.101<br />

C3010-2E<br />

192.168.1.11<br />

PC<br />

192.168.1.21<br />

PC using SoftPhone<br />

(X-Ten)<br />

192.168.1.20<br />

C3010-2E<br />

192.168.1.12<br />

C3010-2E<br />

192.168.1.13<br />

PC<br />

192.168.1.22<br />

Through PSTN if network down<br />

PSTN Traffic to/from PBX<br />

Network Server<br />

192.168.1.100<br />

PC<br />

192.168.1.23<br />

VOIP Traffic<br />

ALL IP Phones and ATA registered to Asterisk<br />

Asterisk registered to VOIP Service Provider /s<br />

TRIXBOX-2 Without Tears Page 174 of 238


43 TROUBLE SHOOTING<br />

With any installation, you will find some unexpected problems. Some are inherent issues<br />

due to bugs or undocumented features, while others are unintentional mistakes.<br />

We will endeavour to list troubleshooting tips as we experience them (or those suggested<br />

by other users). These will be added progressively as we encounter them.<br />

43.1 DEBUG MESSAGES AND LOG FILES ARE YOUR FRIENDS<br />

Whenever problem strikes, there is always a reason for it. To assist you in locating the<br />

problem, generally there are 2 places that you can have a look at – the Asterisk Log<br />

Files, under TOOLS (which will give you the last 2000 entried in the log).<br />

The other is to monitor the activities of your Trixbox using the following command at the<br />

command line (which will give you the Asterisk CLI).<br />

Asterisk –rvvvv (the “v” depends on the level of verbosity you need)<br />

Studying the activities will give you an indication of what has gone wrong.<br />

TRIXBOX-2 Without Tears Page 175 of 238


43.2 UNABLE TO LOG ON TO PACKAGES<br />

From time to time, you may be having problem logging on to “Packages” to<br />

install/uninstall or update Trixbox modules. This has happened to me a number of time<br />

which made me post in the Trixbox forum thinking that I may have done something<br />

wrong.<br />

One such exampple is when I need to get the package that allow me to get tp PHPADMIN<br />

through thr GUI. After a number of tries I resorted to installig it manually uing the<br />

following command at the command line:<br />

yum install tbm-phpmyadmin<br />

This difficulty is due to the delay in connecting to the site (depending on how busy the site<br />

is at the time) and you get connection time out. Trying again later may solve this problem<br />

or you may use a hammer and fix it by changing an entry in the etc/php.ini file.<br />

Change the max_execution_time from 30 to 60 may solve this problem. All it does is to<br />

wait 60 seconds before reporting a time out.<br />

You may additionally delete guidRegistered using the following command:<br />

rm /var/www/html/maint/cache/guidRegistered<br />

Reboot and you should be on your way.<br />

43.3 ASTERISK FEATURE CODES NOT WORKING<br />

If you are using ATAs such as the Sipura SPA3K, Linksys PAP2 etc., you will need to<br />

delete all the Vertical Service Feature codes in the ATA, otherwise the Asterisk feature<br />

codes such as *77, *99 etc may not work. This is caused by the ATA intercepting the<br />

codes thinking that it is its own feature codes.<br />

This also applies to all other ATAs, FXS devices such as the various routers with built-in<br />

FXS ports and IP Phones that has their own feature codes built-in. Unless these feature<br />

codes are disabled, they are likely to clash with Asterisk's feature codes and as such<br />

Asterisk feature codes will not give you the desired results.<br />

43.4 ASTERISK DROPS CALLS AFTER A FEW SECONDS<br />

If Asterisk rings an extension but drops the calls too soon before it was answered,<br />

chances are, you may have set the ‘Number of seconds to ring phones before sending callers<br />

to voicemail:’ too short. This setting can be found in the General Setting under<br />

Voicemail.<br />

43.5 PENNYTEL ASTERISK PROBLEM<br />

Pennytel, for some reason rejects user agent if it is Asterisk. To work around this, you<br />

are required to introduce the following line in your sip.conf under [general]<br />

useragent = My PABX ; required if you are with Pennytel<br />

The user agent can be any string as long as it is not Asterisk.<br />

43.6 UNABLE TO RECEIVE INCOMING CALLS<br />

If you are unable to receive incoming calls, chances are that you may have missed setting<br />

up the incoming call handling as suggested in the previous sections of this guide.<br />

TRIXBOX-2 Without Tears Page 176 of 238


A quick fix for TRIXBOX is to create an Inbound Route with the DID and CID field left<br />

blank. At least this will let incoming calls through while you try to solve the problem.<br />

Please refer to the following section on Calls Handling in this guide:<br />

43.7 SIPURA SPA3000 – NOT HANGING UP AFTER PSTN CALLS<br />

For months I have to wrestle with the problem of SPA3K not hanging up after a PSTN<br />

call. Although the caller has hung up, SPA3K will hold the line off hook until I manually<br />

power cycle SPA3K.<br />

The following settings may overcome the problem:<br />

.<br />

PSTN Line Tab (Advanced Mode)<br />

PSTN Disconnect Detection<br />

Detect CPC: yes<br />

Detect Polarity Reversal: yes<br />

Detect PSTN Long Silence: yes<br />

Detect VoIP Long Silence: yes<br />

PSTN Long Silence Duration: 180<br />

VoIP Long Silence Duration: 180<br />

PSTN Silence Threshold: medium<br />

Min CPC Duration: 0.2<br />

Detect Disconnect Tone: no<br />

Disconnect Tone: Leave blank<br />

<br />

I deleted my original Disconnect Tone setting of: 425@-30,425@-<br />

30;1(.375/.375/1+2) which seems to work well for Telstra, and replaced it with<br />

425@-30,425@-30;1(.390/.390/1+2) which works better with Optus.<br />

Only one catch with this: if you put somebody on hold for longer than the above settings,<br />

if they don't make any noise, it will hang up.<br />

43.8 SYSTEM NOT WORKING AFTER CHANGING TO STATIC IP<br />

If you are using Netconfig to change to Static IP and to a new IP address and the system<br />

stopped working after that, netconfig in Centos V5 is the culprit.<br />

Using Nano, verify that /etc/sysconfig/network-scripts/ifcfg-eth0 contains the following.<br />

NAME=""<br />

GATEWAY=192.168.1.1 (or whatever your gateway should be)<br />

BOOTPROTO=static<br />

TYPE=Ethernet<br />

DEVICE=eth0<br />

TRIXBOX-2 Without Tears Page 177 of 238


MTU=""<br />

NETMASK=255.255.255.0 (or whatever your network mask is)<br />

NOZEROCONF=yes<br />

BROADCAST=192.168.1.255<br />

IPADDR=192.168.1.100 (or whatever your IP address is)<br />

NETWORK=192.168.1.0<br />

ONBOOT=yes<br />

Also check /etc/resolv.conf amd make sure you have the following.<br />

nameserver your primary dns<br />

nameserver your secondary dns<br />

The easiest out is to change your network setting using the Trixbox System Tab GUI or<br />

those who have Webmin installed, use Webmin to do it.<br />

43.9 NO AUDIO ON ANALOG LINE<br />

Problem: Call on an anlogue line seems to ring and connect correctly but no audio<br />

Solution: Trixbox now uses the oslec echo canceler which has provided significant<br />

improvement on echo problems on even the "worst" X100P clone card. In order for this to<br />

operate correctly echotraining needs to be commented out in zapata.conf. The installation<br />

does not always comment it out so it needs to be checked. The same parameter needs<br />

done for every FXS extension, but this is done in freebpbx GUI. After defining the zap<br />

extension go back and change the echotraining parameter from its default 800 to "blank".<br />

43.10 UNEXPLAINED CRASHES<br />

Problem: Unexplained crashes every few hours. People with other hardware platforms<br />

(Dell, Asus) also report the problem. This issue is not universal so seems to be hardware<br />

specific.<br />

Solution: Delete acpi=off in the kernel line in grub.conf.<br />

43.11 ZAP INBOUND ROUTE DOES NOT WORK<br />

Problem: Inbound route definition for a zap channel does not work, but a catch all<br />

inbound route definition captures the call correctly.<br />

Solution: This is because genzaptel.conf does not seem to insert the from-zaptel context<br />

in zapata-channels.conf. Check zapata-channels.conf and make sure context=from-zaptel<br />

is in the FXO port definition. Note, every time genzaptelconf is rerun you have to change<br />

it back again.<br />

43.12 OCCASSIONAL FATAL ERROR WHEN DEFINING EXTENSION<br />

Problem: Sometimes defining an extension generates FATAL ERROR. Error: Trying to<br />

write null voicemail file! I refuse to continue!<br />

Solution: Define the extension with voicemail enabled, and apply the config. Then go back<br />

and disable it. Alternatively copy vm_email.inc and vm_general.inc from /usr/src/freepbx-<br />

2.3.1/amp_conf/astetc to /etc/asterisk<br />

TRIXBOX-2 Without Tears Page 178 of 238


43.13 ALL EXTENSIONS FAILED TO WORK WHEN INTERNET DOWN<br />

One of the work around to avoid this from happening<br />

1. Install cache only name server on the trixbox.<br />

• Activate the CENTOS base packages and CENTOS base extras in the<br />

repositories dropdown menu under the settings tab in the dashboard<br />

• Load the package manager and find the caching-nameserver module<br />

• Tick the box to install caching-nameserver and go to bottom /press install<br />

2. Open an ssh window and type the following:<br />

cd<br />

chkconfig --add named<br />

chkconfig --level 345 named on<br />

echo "* IN A 127.0.0.2" >> /var/named/localdomain.zone<br />

service named start<br />

3. back to dashboard: system tab, dropdown menu NETWORKING:<br />

Click on OPEN NETWORK PARAMETERS<br />

Click on USE OPEN DNS<br />

Change the primary dns to: 127.0.0.1<br />

Make sure host is: trixbox1.localdomain<br />

Ensure that HOSTNAME=trixbox1.localdomain and NOT <br />

5. Reboot<br />

In this way, there is nothing you need to do when internet goes down.<br />

TRIXBOX-2 Without Tears Page 179 of 238


APPENDIX A<br />

A.1 ASTERISK FEATURE CODES<br />

Asterisk feature codes are defined in the feature codes selection of the Setup Tab,<br />

illustrated below:<br />

# Directory<br />

** Call Pickup<br />

*11 User Log on<br />

*12 User Log off<br />

*30 Blacklist a number<br />

*31 Remove a number from the blacklist<br />

*32 Blacklist the last caller<br />

TRIXBOX-2 Without Tears Page 180 of 238


*43 Echo Test<br />

*52 Call Forward No Answer/Unavailable Activate<br />

*53 Call Forward No Answer/Unavailable Deactivate<br />

*60 Time<br />

*61 Weather<br />

*62 Schedule wakeup call<br />

*65 Speak your Extension number (your extension is XXX)<br />

*69 Last Caller number/ID<br />

*70 Activate Call Waiting (deactivated by default)<br />

*71 Deactivate Call Waiting<br />

*72 Call Forwarding System<br />

*73 Disable Call Forwarding<br />

*74 Call Forward all prompting deactivate<br />

*77 IVR Recording<br />

*78 Enable Do-Not-Disturb<br />

*79 Disable Do-Not-Disturb<br />

*90 Call Forward on Busy<br />

*91 Disable Call Forward on Busy<br />

*92 Call Forward Busy Prompting deactivate<br />

*97 Message Center (does no ask for extension)<br />

*97 + 0 Change email greeting message.<br />

*98 Enter Message Center<br />

*99 Playback IVR Recording<br />

*411 Directory (while in IVR – similar to #)<br />

*422 Connect to Gabcast<br />

70 Call Parking (or 700 see Call Parking and Transfer)<br />

555 ChanSpy<br />

666 Test Fax<br />

888 Zap Barge (there are variations)<br />

7777 Simulate incoming call<br />

A.2 ASTERISK CLI COMMANDS<br />

These are some of the available CLI commands that can be executed from the console<br />

when you run: asterisk –r (or –rvvv depending on the level of verbosity you may want).<br />

To stop TRIXBOX – amportal stop<br />

To start TRIXBOX – amportal start<br />

A.2.1 General commands<br />

!: Executes a given shell command<br />

abort halt: Cancel a running halt<br />

add extension: Add new extension into context<br />

add ignorepat: Add new ignore pattern<br />

add indication: Add the given indication to the country<br />

amportal start: Stop TRIXBOX and<br />

amportal stop: Restart TRIXBOX.<br />

debug channel: Enable debugging on a channel<br />

dont include: Remove a specified include from context<br />

help: Display help list, or specific help on a command<br />

include context: Include context in other context<br />

load: Load a dynamic module by name<br />

logger reload: Reopen log files. Use after rotating the log files.<br />

no debug channel: Disable debugging on a channel<br />

pri debug span: Enables PRI debugging on a span<br />

pri intense debug span: Enables REALLY INTENSE PRI debugging<br />

pri no debug span: Disables PRI debugging on a span<br />

TRIXBOX-2 Without Tears Page 181 of 238


emove extension: Remove a specified extension<br />

remove ignorepat: Remove ignore pattern from context<br />

remove indication: Remove the given indication from the country<br />

save dialplan: Overwrites your current extensions.conf file with an exported<br />

version based on the current state of the dialplan. A backup copy of your old<br />

extensions.conf is not saved. The initial values of global variables defined in<br />

the [globals] category retain their previous initial values; the current<br />

values of global variables are not written into the new extensions.conf.<br />

Using "save dialplan" will result in losing any comments in your current<br />

extensions.conf.<br />

set verbose: Set level of verboseness<br />

show agents: Show status of agents<br />

show applications: Shows registered applications<br />

show application: Describe a specific application<br />

show channel: Display information on a specific channel<br />

show channels: Display information on channels<br />

show codecs: Display information on codecs<br />

show conferences: Show status of conferences<br />

show dialplan: Show dialplan<br />

show image formats: Displays image formats<br />

show indications: Show a list of all country/indications<br />

show locals: Show status of local channels<br />

show manager command: Show manager commands<br />

show manager connect: Show connected manager users<br />

show parkedcalls: Lists parked calls<br />

show queues: Show status of queues<br />

show switches: Show alternative switches<br />

show translation: Display translation matrix<br />

show voicemail users: List defined voicemail boxes<br />

show voicemail zones: List zone message formats<br />

soft hangup: Request a hangup on a given channel<br />

A.2.2 AGI Commands<br />

show agi: Show AGI commands or specific help<br />

dump agihtml: Dumps a list of agi command in html format<br />

A.2.3 Database Handling<br />

database del: Removes database key/value<br />

database deltree: Removes database keytree/values<br />

database get: Gets database value<br />

database put: Adds/updates database value<br />

database show: Shows database contents<br />

A.2.4 IAX Channel Commands<br />

iax2 debug: Enable IAX debugging<br />

iax2 no debug: Disable IAX debugging<br />

iax2 set jitter: Sets IAX jitter buffer<br />

iax2 show cache: Display IAX cached dialplan<br />

iax2 show channels: Show active IAX channels<br />

iax2 show peers: Show defined IAX peers<br />

iax2 show registry: Show IAX registration status<br />

iax2 show stats: Display IAX statistics<br />

iax2 show users: Show defined IAX users<br />

iax2 trunk debug: Request IAX trunk debug<br />

iax debug: Enable IAX debugging<br />

iax no debug: Disable IAX debugging<br />

TRIXBOX-2 Without Tears Page 182 of 238


iax set jitter: Sets IAX jitter buffer<br />

iax show cache: Display IAX cached dialplan<br />

iax show channels: Show active IAX channels<br />

iax show peers: Show defined IAX peers<br />

iax show registry: Show IAX registration status<br />

iax show stats: Display IAX statistics<br />

iax show users: Show defined IAX users<br />

init keys: Initialize RSA key passcodes<br />

show keys: Displays RSA key information<br />

A.2.5 SIP Channel commands<br />

sip debug: Enable SIP debugging<br />

sip no debug: Disable SIP debugging<br />

sip reload: Reload sip.conf (added after 0.7.1 on 2004-01-23)<br />

sip show channels: Show active SIP channels<br />

sip show channel: Show detailed SIP channel info<br />

sip show inuse: List all inuse/limit<br />

sip show peers: Show defined SIP peers (register clients)<br />

sip show registry: Show SIP registration status (when Asterisk registers as a<br />

client to a SIP Proxy)<br />

sip show users: Show defined SIP users<br />

A.2.6 Server management<br />

restart gracefully: Restart Asterisk gracefully<br />

restart now: Restart Asterisk immediately<br />

restart when convenient: Restart Asterisk at empty call volume<br />

reload: Reload configuration<br />

stop gracefully: Gracefully shut down Asterisk<br />

stop now: Shut down Asterisk immediately<br />

stop when convenient: Shut down Asterisk at empty call volume<br />

extensions reload: Reload extensions ONLY<br />

unload: Unload a dynamic module by name<br />

show modules: List modules and info about them<br />

show uptime: Show uptime information<br />

show version: Display Asterisk version info<br />

A.3 ASTERISK SPECIAL EXTENSIONS<br />

The following are some Asterisk Special Extensions that are useful to know when creating<br />

your Dial Plan or Special Custom Context.<br />

i = invalid, jump here when an invalid number is dialled.<br />

t = timeout, jump here when we timeout.<br />

h = hang-up, jump here when a call in hung up.<br />

s = standard, jump here if the dialled extension is unknown (used for generic<br />

processing).<br />

o = operator, a special extension to escape voice mail (configurable)<br />

TRIXBOX-2 Without Tears Page 183 of 238


A.4 ASTERISK COMMON VARIABLES<br />

The following are some of the special variables in use with the Asterisk scripts as defined<br />

in the Asterisk’s document. These variables are automatically defined when a new call<br />

starts.<br />

${ACCOUNTCODE}<br />

${CALLERID}<br />

${CALLERIDNAME}<br />

${CALLERIDNUM}<br />

${CALLINGPRES}<br />

${CHANNEL}<br />

${CONTEXT}<br />

${DATETIME}<br />

${DNID}<br />

${ENUM}<br />

${EPOCH}<br />

${EXTEN}<br />

${ENV(VAR)}<br />

${HANGUPCAUSE}<br />

${INVALID_EXTEN}<br />

${LANGUAGE}<br />

${LEN(VAR)}<br />

${MEETMESECS}<br />

${PRIORITY}<br />

${RDNIS}<br />

${TIMESTAMP}<br />

${TXTCIDNAME}<br />

${UNIQUEID}<br />

${SIPCALLID}<br />

${SIPDOMAIN}<br />

${SIPUSERAGENT}<br />

Account code (if specified)<br />

Caller ID<br />

Caller ID Name only<br />

Caller ID Number only<br />

PRI Caller ID presentation for incoming calls<br />

Current channel name<br />

Current context<br />

Current date time in the format: YYYY-MM-DD_HH:MM:SS<br />

Dialed Number Identifier<br />

Result of application EnumLookup<br />

Current unix style epoch<br />

Current extension<br />

Environmental variable VAR<br />

Asterisk hangup cause<br />

The invalid called extension (used in the "i" extension)<br />

Current language<br />

String length of VAR (integer)<br />

Number of seconds a user participated in a MeetMe<br />

Current priority<br />

Redirected Dial Number ID Service<br />

Current date time in the format: YYYYMMDD-HHMMSS<br />

Result of application TXTCIDName<br />

Current call unique identifier<br />

SIP Call-ID: header verbatim (for logging or CDR matching)<br />

SIP destination domain of an inbound call (if appropriate)<br />

SIP user agent<br />

The following are set by the dial() application:<br />

${DIALEDPEERNAME} Dialed peer name<br />

${DIALEDPEERNUMBER} Dialed peer number<br />

${DIALEDTIME} Total time for the call in seconds (Network time).<br />

${ANSWEREDTIME} Time from answer to end of call in seconds.<br />

${DIALSTATUS} Status of the call, one of: | CHANUNAVAIL |CONGESTION | BUSY |<br />

NOANSWER | ANSWER | CANCEL<br />

TRIXBOX-2 Without Tears Page 184 of 238


A.5 INDICATIONS FOR VARIOUS COUNTRIES<br />

The following are some of the indications for the various countries that I am aware off.<br />

Please submit others that you know of to me.<br />

[at]<br />

ringcadence = 1000,5000<br />

dial = 420<br />

busy = 420/400,0/400<br />

ring = 420/1000,0/5000<br />

congestion = 420/200,0/200<br />

callwaiting = 420/40,0/1960<br />

dialrecall = 420<br />

record = 1400/80,0/14920<br />

info = 950/330,1450/330,1850/330,0/1000<br />

stutter = 380+420<br />

[au]<br />

ringcadence = 400,200,400,2000<br />

dial = 413+438<br />

busy = 425/375,0/375<br />

ring = 413+438/400,0/200,413+438/400,0/2000<br />

congestion = 425/375,0/375,420/375,0/375<br />

callwaiting = 425/200,0/200,425/200,0/4400<br />

dialrecall = 413+438<br />

record = !425/1000,!0/15000,425/360,0/15000<br />

info = 425/2500,0/500<br />

std = !525/100,!0/100,!525/100,!0/100,!525/100,!0/100,!525/100,!0/100,!525/100<br />

facility = 425<br />

stutter = 413+438/100,0/40<br />

ringmobile = 400+450/400,0/200,400+450/400,0/2000<br />

[br]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/250,0/250<br />

ring = 425/1000,0/4000<br />

congestion = 425/250,0/250,425/750,0/250<br />

callwaiting = 425/50,0/1000<br />

dialrecall = 350+440<br />

record = 425/250,0/250<br />

info = 950/330,1400/330,1800/330<br />

stutter = 350+440<br />

[be]<br />

ringcadence = 1000,3000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/3000<br />

congestion = 425/167,0/167<br />

callwaiting = 1400/175,0/175,1400/175,0/3500<br />

dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440<br />

record = 1400/500,0/15000<br />

info = 900/330,1400/330,1800/330,0/1000<br />

stutter = 425/1000,0/250<br />

TRIXBOX-2 Without Tears Page 185 of 238


[ch]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = 425/200,0/200,425/200,0/4000<br />

dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425<br />

record = 1400/80,0/15000<br />

info = 950/330,1400/330,1800/330,0/1000<br />

stutter = 425+340/1100,0/1100<br />

[cl]<br />

ringcadence = 1000,3000<br />

dial = 400<br />

busy = 400/500,0/500<br />

ring = 400/1000,0/3000<br />

congestion = 400/200,0/200<br />

callwaiting = 400/250,0/8750<br />

dialrecall = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400<br />

record = 1400/500,0/15000<br />

info = 950/333,1400/333,1800/333,0/1000<br />

stutter =<br />

!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/10<br />

0,!0/100,400<br />

[cn]<br />

ringcadence = 1000,4000<br />

dial = 450<br />

busy = 450/350,0/350<br />

ring = 450/1000,0/4000<br />

congestion = 450/700,0/700<br />

callwaiting = 450/400,0/4000<br />

dialrecall = 450<br />

record = 950/400,0/10000<br />

info = 450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400<br />

stutter = 450+425<br />

[cz]<br />

ringcadence = 1000,4000<br />

dial = 425/330,0/330,425/660,0/660<br />

busy = 425/330,0/330<br />

ring = 425/1000,0/4000<br />

congestion = 425/165,0/165<br />

callwaiting = 425/330,0/9000<br />

dialrecall =<br />

!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660<br />

record = 1400/500,0/14000<br />

info = 950/330,0/30,1400/330,0/30,1800/330,0/1000<br />

stutter = 425/450,0/50<br />

[de]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

TRIXBOX-2 Without Tears Page 186 of 238


usy = 425/480,0/480<br />

ring = 425/1000,0/4000<br />

congestion = 425/240,0/240<br />

callwaiting =<br />

!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/<br />

200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0<br />

dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425<br />

record = 1400/80,0/15000<br />

info = 950/330,1400/330,1800/330,0/1000<br />

stutter = 425+400<br />

[dk]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = !425/200,!0/600,!425/200,!0/3000,!425/200,!0/200,!425/200,0<br />

dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425<br />

record = 1400/80,0/15000<br />

info = 950/330,1400/330,1800/330,0/1000<br />

stutter = 425/450,0/50<br />

[ee]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/300,0/300<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = 950/650,0/325,950/325,0/30,1400/1300,0/2600<br />

dialrecall = 425/650,0/25<br />

record = 1400/500,0/15000<br />

info = 950/650,0/325,950/325,0/30,1400/1300,0/2600<br />

stutter =<br />

!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10<br />

0,!0/100,425<br />

[es]<br />

ringcadence = 1500,3000<br />

dial = 425<br />

busy = 425/200,0/200<br />

ring = 425/1500,0/3000<br />

congestion = 425/200,0/200,425/200,0/200,425/200,0/600<br />

callwaiting = 425/175,0/175,425/175,0/3500<br />

dialrecall = !425/200,!0/200,!425/200,!0/200,!425/200,!0/200,425<br />

record = 1400/500,0/15000<br />

info = 950/330,0/1000<br />

dialout = 500<br />

[fi]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/300,0/300<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = 425/150,0/150,425/150,0/8000<br />

TRIXBOX-2 Without Tears Page 187 of 238


dialrecall = 425/650,0/25<br />

record = 1400/500,0/15000<br />

info = 950/650,0/325,950/325,0/30,1400/1300,0/2600<br />

stutter = 425/650,0/25<br />

[fr]<br />

ringcadence = 1500,3500<br />

dial = 440<br />

busy = 440/500,0/500<br />

ring = 440/1500,0/3500<br />

congestion = 440/250,0/250<br />

callwait = 440/300,0/10000<br />

dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330<br />

stutter =<br />

!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/10<br />

0,!0/100,440<br />

[gr]<br />

ringcadence = 1000,4000<br />

dial = 425/200,0/300,425/700,0/800<br />

busy = 425/300,0/300<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = 425/150,0/150,425/150,0/8000<br />

dialrecall = 425/650,0/25<br />

record = 1400/400,0/15000<br />

info =<br />

!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1<br />

400/330,!1800/330,!0/1000,0<br />

stutter = 425/650,0/25<br />

[hk]<br />

ringcadence = 400,200,400,2000<br />

dial = 350+440<br />

busy = 480+620/500,0/500<br />

ring = 440+480/400,0/200,440+480/400,0/2000<br />

congestion = 480+620/250,0/250<br />

callwaiting = 440/100,0/4000<br />

dialrecall = 300/1500,0/500<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330<br />

[hu]<br />

ringcadence = 1250,3750<br />

dial = 425<br />

busy = 425/300,0/300<br />

ring = 425/1250,0/3750<br />

congestion = 425/300,0/300<br />

callwaiting = 425/40,0/1960<br />

dialrecall = 425+450<br />

record = 1400/400,0/15000<br />

info =<br />

!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1<br />

400/330,!1800/330,!0/1000,0<br />

TRIXBOX-2 Without Tears Page 188 of 238


stutter = 350+375+400<br />

[il]<br />

; Source: libtonezone.<br />

description = Israel<br />

ringcadence = 1000,3000<br />

dial = 414<br />

busy = 414/500,0/500<br />

ring = 414/1000,0/3000<br />

congestion = 414/250,0/250<br />

callwaiting = 414/100,0/100,414/100,0/100,414/600,0/3000<br />

dialrecall = !414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414<br />

record = 1400/500,0/15000<br />

info = 1000/330,1400/330,1800/330,0/1000<br />

stutter =<br />

!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/16<br />

0,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414<br />

[in]<br />

; Source: libtonezone.<br />

description = India<br />

ringcadence = 400,200,400,2000<br />

dial = 400*25<br />

busy = 400/750,0/750<br />

ring = 400*25/400,0/200,400*25/400,0/2000<br />

congestion = 400/250,0/250<br />

callwaiting = 400/200,0/100,400/200,0/7500<br />

dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330,0/1000<br />

stutter =<br />

!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35<br />

0+440/100,!0/100,!350+440/100,!0/100,350+440<br />

[it]<br />

ringcadence = 1000,4000<br />

dial = 425/200,0/200,425/600,0/1000<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = 425/400,0/100,425/250,0/100,425/150,0/14000<br />

dialrecall = 470/400,425/400<br />

record = 1400/400,0/15000<br />

info =<br />

!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1<br />

400/330,!1800/330,!0/1000,0<br />

stutter = 470/400,425/400<br />

[jp]<br />

; Source: libtonezone.<br />

description = Japan<br />

ringcadence = 1000,2000<br />

dial = 400<br />

busy = 400/500,0/500<br />

ring = 400+15/1000,0/2000<br />

TRIXBOX-2 Without Tears Page 189 of 238


congestion = 400/500,0/500<br />

callwaiting = 400+16/500,0/8000<br />

dialrecall = !400/200,!0/200,!400/200,!0/200,!400/200,!0/200,400<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330,0<br />

stutter =<br />

!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/10<br />

0,!0/100,400<br />

[lt]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/350,0/350<br />

ring = 425/1000,0/4000<br />

congestion = 425/200,0/200<br />

callwaiting = 425/150,0/150,425/150,0/4000<br />

dialrecall = 425/500,0/50<br />

record = 1400/500,0/15000<br />

info =<br />

!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1<br />

400/330,!1800/330,!0/1000,0<br />

stutter =<br />

!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10<br />

0,!0/100,425<br />

[mx]<br />

ringcadence = 2000,4000<br />

dial = 425<br />

busy = 425/250,0/250<br />

ring = 425/1000,0/4000<br />

congestion = 425/250,0/250<br />

callwaiting = 425/200,0/600,425/200,0/10000<br />

dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440<br />

record = 1400/500,0/15000<br />

info = 950/330,0/30,1400/330,0/30,1800/330,0/1000<br />

stutter =<br />

!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35<br />

0+440/100,!0/100,!350+440/100,!0/100,350+440<br />

[nl]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/4000<br />

congestion = 425/250,0/250<br />

callwaiting = 425/500,0/9500<br />

dialrecall = 425/500,0/50<br />

record = 1400/500,0/15000<br />

info = 950/330,1400/330,1800/330,0/1000<br />

stutter = 425/500,0/50<br />

[no]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/4000<br />

TRIXBOX-2 Without Tears Page 190 of 238


congestion = 425/200,0/200<br />

callwaiting = 425/200,0/600,425/200,0/10000<br />

dialrecall = 470/400,425/400<br />

record = 1400/400,0/15000<br />

info =<br />

!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1<br />

400/330,!1800/330,!0/1000,0<br />

stutter = 470/400,425/400<br />

[nz]<br />

ringcadence = 400,200,400,2000<br />

dial = 400<br />

busy = 400/250,0/250<br />

ring = 400+450/400,0/200,400+450/400,0/2000<br />

congestion = 400/375,0/375<br />

callwaiting = !400/200,!0/3000,!400/200,!0/3000,!400/200,!0/3000,!400/200<br />

dialrecall = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,400<br />

record = 1400/425,0/15000<br />

info = 400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400<br />

stutter =<br />

!400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,<br />

!0/100,400<br />

[pl]<br />

ringcadence = 1000,4000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/4000<br />

congestion = 425/500,0/500<br />

callwaiting = 425/150,0/150,425/150,0/4000<br />

dialrecall = 425/500,0/50<br />

record = 1400/500,0/15000<br />

info =<br />

!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1<br />

400/330,!1800/330,!0/1000<br />

stutter =<br />

!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10<br />

0,!0/100,425<br />

[pt]<br />

ringcadence = 1000,5000<br />

dial = 425<br />

busy = 425/500,0/500<br />

ring = 425/1000,0/5000<br />

congestion = 425/200,0/200<br />

callwaiting = 440/300,0/10000<br />

dialrecall = 425/1000,0/200<br />

record = 1400/500,0/15000<br />

info = 950/330,1400/330,1800/330,0/1000<br />

stutter =<br />

!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10<br />

0,!0/100,425<br />

[ru]<br />

ringcadence = 800,3200<br />

dial = 425<br />

TRIXBOX-2 Without Tears Page 191 of 238


usy = 425/350,0/350<br />

ring = 425/800,0/3200<br />

congestion = 425/350,0/350<br />

callwaiting = 425/200,0/5000<br />

dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330,0<br />

[se]<br />

ringcadence = 1000,5000<br />

dial = 425<br />

busy = 425/250,0/250<br />

ring = 425/1000,0/5000<br />

congestion = 425/250,0/750<br />

callwaiting = 425/200,0/500,425/200,0/9100<br />

dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425<br />

record = 1400/500,0/15000<br />

info =<br />

!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/3<br />

32,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/<br />

24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,0<br />

stutter =<br />

!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10<br />

0,!0/100,425<br />

[sg]<br />

ringcadence = 400,200,400,2000<br />

dial = 425<br />

ring = 425*24/400,0/200,425*24/400,0/2000 ; modulation should be 100%, not 90%<br />

busy = 425/750,0/750<br />

congestion = 425/250,0/250<br />

callwaiting = 425*24/300,0/200,425*24/300,0/3200<br />

stutter =<br />

!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/60<br />

0,!0/200,!425/200,!0/200,!425/600,!0/200,425<br />

info = 950/330,1400/330,1800/330,0/1000 ; not currently in use acc. to reference<br />

dialrecall = 425*24/500,0/500,425/500,0/2500 ; unspecified in IDA reference, use repeating<br />

Holding Tone A,B<br />

record = 1400/500,0/15000 ; unspecified in IDA reference, use 0.5s tone every 15s<br />

nutone = 425/2500,0/500<br />

intrusion = 425/250,0/2000<br />

warning = 425/624,0/4376 ; end of period tone, warning<br />

acceptance = 425/125,0/125<br />

holdinga = !425*24/500,!0/500 ; followed by holdingb<br />

holdingb = !425/500,!0/2500<br />

[uk]<br />

ringcadence = 400,200,400,2000<br />

dial = 350+440<br />

specialdial = 350+440/750,440/750<br />

busy = 400/375,0/375<br />

congestion = 400/400,0/350,400/225,0/525<br />

specialcongestion = 400/200,1004/300<br />

unobtainable = 400<br />

ring = 400+450/400,0/200,400+450/400,0/2000<br />

callwaiting = 400/100,0/4000<br />

specialcallwaiting = 400/250,0/250,400/250,0/250,400/250,0/5000<br />

creditexpired = 400/125,0/125<br />

confirm = 1400<br />

switching = 400/200,0/400,400/2000,0/400<br />

TRIXBOX-2 Without Tears Page 192 of 238


info = 950/330,0/15,1400/330,0/15,1800/330,0/1000<br />

record = 1400/500,0/60000<br />

stutter = 350+440/750,440/750<br />

[us]<br />

ringcadence = 2000,4000<br />

dial = 350+440<br />

busy = 480+620/500,0/500<br />

ring = 440+480/2000,0/4000<br />

congestion = 480+620/250,0/250<br />

callwaiting = 440/300,0/10000<br />

dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330,0<br />

stutter =<br />

!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35<br />

0+440/100,!0/100,!350+440/100,!0/100,350+440<br />

[us-old]<br />

ringcadence = 2000,4000<br />

dial = 600*120<br />

busy = 500*100/500,0/500<br />

ring = 420*40/2000,0/4000<br />

congestion = 500*100/250,0/250<br />

callwaiting = 440/300,0/10000<br />

dialrecall = !600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330,0<br />

stutter =<br />

!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*<br />

120/100,!0/100,!600*120/100,!0/100,600*120<br />

[tw]<br />

ringcadence = 1000,4000<br />

dial = 350+440<br />

busy = 480+620/500,0/500<br />

ring = 440+480/1000,0/2000<br />

congestion = 480+620/250,0/250<br />

callwaiting = 350+440/250,0/250,350+440/250,0/3250<br />

dialrecall = 300/1500,0/500<br />

record = 1400/500,0/15000<br />

info = !950/330,!1400/330,!1800/330,0<br />

stutter =<br />

!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35<br />

0+440/100,!0/100,!350+440/100,!0/100,350+440<br />

TRIXBOX-2 Without Tears Page 193 of 238


APPENDIX B<br />

B.1 – AUSTRALIAN VSPS (TRUNKS)<br />

The following is a collection of TRUNK settings recommended for other VSPs that are not<br />

covered above. Details of trunks configuration are correct at the time they were compiled,<br />

however changes may have been made. Users are advised to consult their respective<br />

VSPs for confirmation.<br />

Note: In Peer Details, insert qualify=yes if you want fail-over to PSTN should you loose<br />

your internet connection.<br />

B.1.1 BBPglobal<br />

Peer Details<br />

Trunk Name: bbpglobal<br />

allow=g723&gsm<br />

authuser=<br />

disallow=all<br />

fromdomain=sip2.bbpglobal.com<br />

fromuser=<br />

host= sip2.bbpglobal.com<br />

insecure=very<br />

secret=<br />

type=peer<br />

username=<br />

User Details<br />

User Context: <br />

context=from-trunk<br />

fromuser=<br />

insecure=very<br />

secret=<br />

type=user<br />

username=<br />

Note:You may need to include the<br />

following in your sip.conf<br />

Maxexpirey=3600<br />

Qualify=yes<br />

Register String:<br />

:sip2.bbpglobal.com/<br />

B.1.2 Engin BYO<br />

Peer Details<br />

Trunk Name: engin<br />

allow=ulaw&alaw<br />

auth=md5<br />

canreinvite=yes<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromdomain=voice.mibroadband.com.au<br />

fromuser=02321XXXX<br />

host=byo.engin.com.au<br />

insecure=very<br />

musiconhold=framed<br />

nat=yes<br />

port=5060<br />

qualify=no<br />

realm=mobileinnovations.com.au<br />

reinvite=yes<br />

secret=<br />

type=friend<br />

username=02321XXXX<br />

User Details<br />

User Context: 02321XXXX<br />

context=from-pstn<br />

fromdomain=voice.mibroadband.com.au<br />

host=byo.engin.com.au<br />

secret=<br />

type=user<br />

username=02321XXXX<br />

Note:<br />

You may need to include the following in<br />

your sip.conf<br />

Defaultexpirey=600<br />

Maxexpirey=3600<br />

Register String:<br />

02321XXXX:@byo.engin.com.au/02321XXXX<br />

TRIXBOX-2 Without Tears Page 194 of 238


B.1.3 Faktortel (IAX)<br />

Peer Details<br />

Trunk Name: faktortel<br />

allow=g729&gsm&ulaw&alaw&ilbc<br />

disallow=all<br />

host=iax.faktortel.com.au<br />

qualify=3000<br />

secret=<br />

type=friend<br />

username=xxxxxx<br />

User Details<br />

User Context: xxxxxx<br />

auth=md5<br />

context=from-trunk<br />

host=iax.faktortel.com.au<br />

qualify=3000<br />

secret=<br />

type=friend<br />

username=xxxxxx<br />

Register String:<br />

xxxxxx:@iax.faktortel.com.au<br />

Faktortel supports the following codecs: ulaw, alaw, ilbc, gsm, g729. The following is<br />

the link on the discussions for setting up Faktortel on TRIXBOX.<br />

http://www.faktortel.com.au/support-Trixbox-settings.shtml<br />

B.1.4 iPrimus<br />

Primus is a strange animal. To get it to work with Trixbox requires me to do a bit of<br />

detective work. With my partner in crime, Colin, we set out to play detective because<br />

we need to obtain the correct credential to get Trixbox to register and to be able to<br />

make and receive calls through Trixbox. Primus Telecom has refused to assist.<br />

To get the necessary credentials, we cheated a little as the method was published in<br />

the whirlpool forum http://forums.whirlpool.net.au/forum-replies.cfmt=604015<br />

First of all, using a browser, we need to enter the following address:<br />

https://spconfig.voip.iprimus.net.au/SoftphoneConfigurationServer/Default.aspxAction=LOG<br />

IN&username=username&password=password&computerid=db7b351e57af&MAC=your<br />

_NIC_MAC_address<br />

Replace the bold type with your Talk Broadband username and password given to<br />

you by iPrimus. You can get your NIC MAC address by running ipconfig /all.<br />

When you submit that address, the following data will be displayed in your browser.<br />

[Data] Success=1 [Settings] proxies:proxy0:display_name="02********"<br />

proxies:proxy0:username="AU_********" proxies:proxy0:password="********"<br />

system:auto_update:config_server_url="https://spconfig.voip.iprimus.net.au/Soft<br />

phoneConfigurationServer/Default.aspxAction=CONFIG&Username=username&Version=1<br />

&MAC=$MAC$&computerid=$computerid$" audio:headset:audio_in_agc_enabled="0"<br />

audio:speaker_phone:audio_in_agc_enabled="0" codecs:speex_fec:enabled="0"<br />

codecs:speex_wb:other_bandwidths="24000,26000,28800,32800,40000,44000"<br />

codecs:speex_wb:starting_bandwidth="44000"<br />

codecs:speex_wb:usable_bandwidths="20800,24800,28800,36800,44000"<br />

codecs:speex_wb_fec:enabled="0" proxies:proxy0:contacts_etag=""<br />

proxies:proxy0:contacts_last_upload_failed="0" proxies:proxy0:contacts_mod="0"<br />

proxies:proxy0:default_session_refresh_interval_in_seconds="60"<br />

proxies:proxy0:digit_map="#1\a\a.T;match=1;prestrip=2;"<br />

proxies:proxy0:domain="asnjla2.bw.iprimus.net"<br />

proxies:proxy0:enable_session_timer="0" proxies:proxy0:enabled="1"<br />

proxies:proxy0:ice_enabled="1"<br />

proxies:proxy0:maximum_time_before_reregistration_in_seconds="1800"<br />

proxies:proxy0:minimum_time_before_reregistration_in_seconds="20"<br />

proxies:proxy0:override_outbound_proxy="1"<br />

proxies:proxy0:override_sip_listen_port="0"<br />

proxies:proxy0:override_stun_server="1" proxies:proxy0:port_range_enable="0"<br />

proxies:proxy0:proxy="sbc01a.syd.voip.iprimus.net.au:15060"<br />

proxies:proxy0:register="1" proxies:proxy0:reregister_in_seconds="3600"<br />

TRIXBOX-2 Without Tears Page 195 of 238


Note the bold highlights. These are the data that you need for your trunk setting.<br />

Armed with the data above, you may now set your trunk setting.<br />

Peer Details<br />

Trunk Name: iPrimus<br />

allow=alaw&ulaw<br />

disallow=all<br />

fromdomain=asnjla2.bw.iprimus.net<br />

fromuser=AU_XXXXXXXX<br />

host=asnjla2.bw.iprimus.net<br />

insecure=very<br />

outboundproxy=sbc01a.syd.voip.iprimus.net.au<br />

port=15060<br />

secret=YYYYYYYY<br />

type=peer<br />

username=AU_XXXXXXXX<br />

User Details<br />

User Context: 02********<br />

context=from-trunk<br />

type=user<br />

Register String:<br />

AU_XXXXXXXX@asnjla2.bw.iprimus.net:YYYYYYYY:AU_XXXXXXXX@iprimus/02********<br />

B.1.5 Koala<br />

Peer Details<br />

Trunk Name: KoalaSip<br />

allow=g729&gsm&alaw&ulaw<br />

disallow=all<br />

fromuser=<br />

host=203.122.248.173<br />

nat=yes<br />

port=5060<br />

qualify=no<br />

secret=<br />

type=friend<br />

User Details<br />

User Context: <br />

context=from-pstn<br />

fromdomain=203.122.248.173<br />

host=203.122.248.173<br />

secret=<br />

type=user<br />

username=<br />

Register String:<br />

:@koalavoip.com.au<br />

(Source Ref: Curtis of Koala) also refer here https://www.koalavoip.com.au/billing/node/75<br />

B.1.6 MyNetFone<br />

Peer Details<br />

Trunk Name: MyFonesip<br />

allow=g729&alaw&ulaw<br />

authname=091xxxxx<br />

canreinvite=no<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromuser=091xxxxx<br />

host=sip01.mynetfone.com.au<br />

insecure=very<br />

nat=yes<br />

pedantic=no<br />

qualify=yes<br />

secret=<br />

type=friend<br />

username=091xxxxx<br />

User Details<br />

User Context: 091XXXXX<br />

canreinvite=no<br />

context=from-trunk<br />

fromuser=091xxxxx<br />

insecure=very<br />

qualify=no<br />

secret=<br />

type=friend<br />

username=091xxxxx<br />

TRIXBOX-2 Without Tears Page 196 of 238


Register String:<br />

091xxxxx@sip01.mynetfone.com.au::091xxxxx@sip01.mynetfone.com.au/091xxxxx<br />

For further information on MyNetFone, you may refer to the following link:<br />

http://www.myfone.com.au/downloads/sip.conf<br />

http://www.myfone.com.au/downloads/extensions.conf<br />

B.1.7 Nehos (IAX)<br />

Peer Details<br />

Trunk Name: Nehos<br />

allow=g729<br />

disallow=all<br />

host=iax.ifone.com.au<br />

qualify=yes<br />

secret=<br />

type=peer<br />

username=661xxxx<br />

User Details<br />

User Context: 661XXXX<br />

context=from-trunk<br />

host=iax.ifone.com.au<br />

secret=<br />

type=user<br />

username=661xxxx<br />

Register String:<br />

661xxxx:@iax.ifone.com.au<br />

B.1.8 Nodephone<br />

Peer Details<br />

Trunk Name: Nodephone<br />

allow=g729<br />

canreinvite=no<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromdomain=sip.internode.on.net<br />

fromuser=<br />

username=<br />

host=sip.internode.on.net<br />

insecure=very<br />

secret=<br />

type=peer<br />

User Details<br />

User Context: <br />

context=from-trunk<br />

host= sip.internode.on.net<br />

secret=<br />

type=user<br />

username=<br />

Register String:<br />

:@sip.internode.on.net/<br />

B.1.9 SipMe<br />

Peer Details<br />

Trunk Name: sipme<br />

authname=1777xxxxxx<br />

dtmfmode=rfc2833<br />

fromuser=1777xxxxxx<br />

host=sip.sipme.com.au<br />

insecure=very<br />

secret=<br />

type=peer<br />

username=1777xxxxxx<br />

User Details<br />

User Context: 1777xxxxxx<br />

context=from-trunk<br />

fromuser=1777xxxxxx<br />

secret=<br />

type=user<br />

Register String:<br />

1777xxxxxx:@sip.sipme.com.au/1777xxxxxx<br />

TRIXBOX-2 Without Tears Page 197 of 238


B.2 – NEW ZEALAND VSPS (TRUNKS)<br />

B.2.1 iTalk<br />

Peer Details<br />

Trunk Name: italk<br />

allow=ulaw&g729<br />

canreinvite=no<br />

context=from-trunk<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromuser=64997xxxxx<br />

host=akl.italk.co.nz<br />

insecure=very<br />

secret=<br />

type=friend<br />

username=64997xxxxx<br />

User Details<br />

User Context:<br />

You may prefix outgoing<br />

calls with 0197 to disable<br />

outgoing CID.<br />

Inbound route 64997xxxxx<br />

required to be forwarded<br />

to a destination ext/menu<br />

Register String:<br />

64997xxxxx:@akl.italk.co.nz/64997xxxxx<br />

(Source Ref: Steve Biddle)<br />

B.2.2 Double Zero 64 (IAX)<br />

Peer Details<br />

Trunk Name: 0064<br />

allow=ulaw&g729<br />

disallow=all<br />

dtmfmode=rfc2833<br />

host=voip.0064.co.nz<br />

insecure=very<br />

secret=<br />

type=peer<br />

username=your_Customer_ID<br />

User Details<br />

User Context:; Your_Customer_ID<br />

context=from-pstn<br />

host=voip.0064.co.nz<br />

insecure=very<br />

secret=PASSWORD<br />

type=user<br />

username=CUSTOMER_ID<br />

Register String:<br />

Your_Customer_ID: @voip.0064.co.nz<br />

TRIXBOX-2 Without Tears Page 198 of 238


B.3 – OTHER VSPS (TRUNKS)<br />

B.3.1 Broadvoice<br />

Peer Details<br />

Trunk Name: Broadvoice<br />

allow=ulaw<br />

canreinvite=no<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromdomain=sip.broadvoice.com<br />

fromuser=<br />

host=sip.broadvoice.com<br />

insecure=very<br />

nat=yes<br />

secret=<br />

type=peer<br />

username=<br />

User Details<br />

User Context: <br />

context=from-trunk<br />

type=user<br />

Register String:<br />

@sip.broadvoice.com::@sip.broadvoice.com/<br />

B.3.2 FWD aka Pulver(IAX)<br />

Peer Details<br />

Trunk Name: fwd<br />

allow=ulaw&alaw<br />

auth=rsa<br />

canredirect=no<br />

disallow=all<br />

host=iax2.fwdnet.net<br />

inkeys=freeworlddialup<br />

insecure=very<br />

secret=<br />

type=peer<br />

username=65xxxx<br />

User Details<br />

User Context: 65xxxx<br />

auth=rsa<br />

context=from-trunk<br />

inkeys=freeworlddialup<br />

type=user<br />

Register String:<br />

65xxxx:@iax2.fwdnet.net<br />

B.3.3 SipBroker<br />

Peer Details<br />

Trunk Name: sipbroker-out<br />

allow=g729&ulaw&alaw<br />

canreinvite=no<br />

disallow=all<br />

dtmfmode=rfc2833<br />

fromdomain=<br />

fromuser=<br />

host=sipbroker.com<br />

insecure=very<br />

nat=yes<br />

port=5060<br />

secret=<br />

type=peer<br />

You will not require<br />

user details since you<br />

will not be receiving<br />

incoming calls from this<br />

trunk.<br />

You do not need to<br />

register either.<br />

TRIXBOX-2 Without Tears Page 199 of 238


If you are using SipBroker, you must ensure that your sip_nat.conf is modified to the<br />

following;<br />

nat=yes<br />

externip= ; if you have fix IP or<br />

externhost= ; if you are using Dynamic IP<br />

localnet=192.168.1.0/255.255.255.0<br />

B.3.4 SipPhone<br />

Peer Details<br />

Trunk Name: sipphone<br />

fromdomain=proxy01.sipphone.com<br />

host=proxy01.sipphone.com<br />

insecure=very<br />

secret=<br />

type=peer<br />

username=1747xxxxxxx<br />

User Details<br />

User Context: 1747xxxxxxx<br />

canreinvite=no<br />

context=from-trunk<br />

fromuser=1747xxxxxxx<br />

insecure=very<br />

qualify=no<br />

secret=<br />

type=user<br />

username=1747xxxxxxx<br />

Register String:<br />

1747xxxxxxx:@proxy01.sipphone.com/1747xxxxxxx<br />

B.3.5 VOIP Buster<br />

Peer Details<br />

Trunk Name: VoipBuster<br />

allow=alaw&ulaw<br />

context=from-pstn<br />

disallow=all<br />

dtmfmode=inband<br />

fromdomain=sip1.voipbuster.com<br />

fromuser=<br />

host=sip1.voipbuster.com<br />

insecure=very<br />

nat=yes (necessary in some<br />

cases)<br />

qualify=yes<br />

secret=<br />

srvlookup=yes<br />

type=friend<br />

username=<br />

User Details<br />

User Conext: <br />

If you have an inbound number, an<br />

Inbound route is required to forwarded<br />

your incoming call to a destination<br />

extension or IVR menu:<br />

Inbound Route:<br />

DID: <br />

No Fax<br />

Register String:<br />

:@sip1.voipbuster.com/<br />

(Source Ref: Florent Chandelier)<br />

TRIXBOX-2 Without Tears Page 200 of 238


APPENDIX C<br />

Details for Asterisk Sound Files can be obtained from the following links:<br />

http://www.voip-info.org/tiki-index.phppage=Asterisk+sound+files<br />

http://www.voip-info.org/wiki/view/Asterisk+sound+files+additional<br />

http://www.nathanpralle.com/software/ast_masterlist.html<br />

C.1 VOICE FOR ASTERISK MESSAGES<br />

Brian, a Whirlpool Enthusiast, posted the following tip in the Whirlpool forum. Brian has<br />

asked me to include his discovery in this guide.<br />

The following is an extract of Brian’s exploits – verbatim ☺<br />

<br />

I have just been setting up the Digital Receptionist and I wanted to use a professional<br />

voice for messages. I thought I might detail my exploits here for those that might be<br />

considering the same thing.<br />

First you need the original recording either from a real professional or a "text to voice"<br />

utility. I went with the Realspeak demo<br />

http://www.nuance.com/realspeak/demo/default.asp<br />

The "British Daniel" voice was deep and professional. Check this out<br />

http://www.cbservers.com.au/whirlpool.wav<br />

Now the demo has a 100-character limit so you may need to do 2 or 3 files and join them<br />

together with a program like Accoustica MP3 mixer.<br />

http://www.acoustica.com/mp3%2Daudio%2Dmixer/<br />

Save it as a wav file.<br />

It was after this part that I had a lot of problems. Asterisk is very funny about sound files. I<br />

tried using all sorts of programs to get the file to the right specs but it failed to work every<br />

time. I eventually used "sox" an open source command line editing tool and it worked first<br />

go (using advice from VoIP-info & digium forums) http://sox.sourceforge.net/ then at the<br />

command line prompt use this syntax:<br />

sox winwave.wav -r 8000 -c 1 -s -w linwave.wav<br />

you may then upload your message to asterisk.<br />

Some further reading;<br />

http://lists.digium.com/pipermail/asterisk-users/2002-December/006635.html<br />

http://www.voip-info.org/tiki-index.phppage=Convert+WAV+audio+files+for+use+in+Asterisk<br />

http://users.pandora.be/Asterisk-PBX/IVR.htm<br />

http://www.voip-info.org/tiki-index.phppage=Asterisk+sound+files<br />

<br />

TRIXBOX-2 Without Tears Page 201 of 238


C.2 AUSTRALIAN VOICE AND LANGUAGE SET FOR ASTERISK<br />

VOIPSHOP has made available the files free to non-commercial users. Log on to<br />

http://www.voipshop.com.au/product_info.phpproducts_id=72 to download<br />

The following is extract of the instructions by VOIPSHOP on their web site. Two files are<br />

available; one is as a replacement for the current asterisk files. The other is as an<br />

additional Asterisk language (if you are going to use the SetLanguage option).<br />

Replace Current Asterisk Files: ausounds.tar.gz<br />

Quick Steps for TRIXBOX.<br />

Log into your TRIXBOX server and at the command prompt, do the following:<br />

wget http://files.voipshop.com.au/ausounds.tar.gz<br />

tar cvfz backupsounds.tar.gz /var/lib/asterisk/sounds/ (for backing<br />

up your existing files)<br />

tar -zxvf ausounds.tar.gz -C /var/lib/asterisk/sounds/<br />

Done. Your asterisk sound files are replaced. Make sure you back up, just in case.<br />

Additional Asterisk Language Set: ausoundset.tar.gz<br />

At the command prompt execute the following commands:<br />

wget http://files.voipshop.com.au/ausoundset.tar.gz<br />

tar -zxvf ausoundset.tar.gz -C /var/lib/asterisk/sounds/<br />

Done. Your asterisk sound files now contain an au soundset.<br />

Note : You can only download these files from voipshop,<br />

Please do not re-distribute. These are free for non-commercial use only. Contact<br />

VOIPSHOP mailto:support@voipshop.com.au for commercial license details.<br />

C.3 MORE AUSTRALIAN VOICE FOR ASTERISK<br />

As part of OpenVoice contribution to the Asterisk community, they are offering a free set<br />

of Australian prompts for the Asterisk Open Source PBX.<br />

The files (male voice) can be downloaded here: http://www.openvoice.com.au/free.php<br />

Of course, don’t forget to add the following line in the iax.conf and sip.conf configuration<br />

file under [general]. In zapata.conf configuration file the line should be added under<br />

[channels].<br />

language=au ; (or fr, it or whichever language is installed)<br />

TRIXBOX-2 Without Tears Page 202 of 238


APPENDIX D (ATAS AND ROUTERS)<br />

D.1 ALCATEL SPEEDTOUCH 510/530 ADSL ROUTER<br />

If you are using Telstra Alcatel SpeedTouch 510/530 ADSL Router, you will need to<br />

unbind port 5060, otherwise you will not be able to use VOIP since Alcatel, in their<br />

wisdom for reasons best known to themselves, have decided that we are not suppose to<br />

use this port. So they blocked it in these types of routers.<br />

But, as we know, there are more than just one way to skin a cat ☺ thus, the solution is to<br />

telnet to the ADSL modem and remove this restriction.<br />

I am assuming that you are running a Windows PC to do this.<br />

Click on Start > Run then type:<br />

telnet 10.0.0.138 [or replace with the correct ip address]<br />

you will notice the following;<br />

Trying 10.0.0.138...<br />

Connected to speedtouch<br />

Escape character is '^]'.<br />

Username : root<br />

Password :<br />

----------<br />

...<br />

... welcome message blah blah blah<br />

...<br />

You then should unbind the SIP protocol and reboot the modem thus:<br />

=>nat unbind application=SIP port=5060<br />

=>config save<br />

=>system reboot<br />

To check whether the SIP protocol is bound in your modem use this command to show<br />

the list of bindings (only showing SIP here):<br />

=>nat bindlist<br />

Application Proto Port<br />

SIP udp 5060<br />

If the line doesn't appear, your phone should work.<br />

Source Reference:<br />

http://www.sipgate.co.uk/faq/index.phpaktion=artikel&type=faq&rubrik=024&id=398&lang=de<br />

D.2 BILLION 7402 VL<br />

Some extra information that will get a Billion 7402 VL FXS to work with asterisk and have<br />

NAT port 5060 points to the Asterisk server.<br />

By default, if you enable the FXS ports on the Billion 7402 VL router to be sip enabled,<br />

the router automatically forwards the port (5060) to its own IP address and an error will<br />

occur if you try to forward that port to the Asterisk box. This is because it is intended for<br />

the FXS ports to connect directly to an external SIP provider.<br />

TRIXBOX-2 Without Tears Page 203 of 238


To overcome this issue and make the FXS ports connect to the Asterisk box, complete<br />

the following:<br />

From a windows command prompt…<br />

telnet 192.168.XXX.XXX<br />

(router I.P. address)<br />

voip set interfacename iplan (this changes it from the WAN to the LAN interface<br />

Next, power reset the router.<br />

Now you can add the NAT to point to the asterisk server and the FXS ports will connect to<br />

the Asterisk box.<br />

NOTE: - Also codec G729 had to be disabled on the FXS ports for calls to work. Not sure<br />

why.<br />

(Source Reference: Sean Mahon)<br />

D.3 LINKSYS PAP2 AND SIPURA SPA2000<br />

The most common Analog Telephone Adapters (ATA) amongst Australian VOIP users<br />

are the Linksys PAP2, Sipura 2000 and Sipura SPA3000 (the Sipura SPA3000 was<br />

covered in the chapter relating to Interfacing Asterisk to PSTN). The Linksys PAP2 and<br />

the Sipura SPA2000 are essentially identical units encased in different boxes and<br />

branded differently. The examples presented here apply to both the Linksys PAP2 and<br />

Sipura SPA2000.<br />

Note:<br />

The set-up described here is for use with TRIXBOX and not for connecting the unit<br />

directly to the VOIP service provider.<br />

I will describe the minimum changes that are required to get these ATAs to work in<br />

conjunction with Asterisk.<br />

As supplied, the unit comes with DHCP enabled. It is best to allocate a fix IP address to<br />

the unit and therefore the first thing to do is to disable the DHCP and allocate a fix IP<br />

address e.g. 192.168.1.50. You need to do the following:<br />

1. Connect the unit to your network via the RJ45 port behind the unit.<br />

2. Power up the unit<br />

3. Plug in a telephone in the RJ11 port 1 behind the unit (any one will do)<br />

4. Dial **** and listen to the instruction that you will hear from the IVR<br />

5. Dial 101 and when prompted enter 0 followed by # (this will disable DHCP)<br />

6. Dial 111 and when prompted enter 192*168*1*50 followed by # (assuming that<br />

you want to allocate 192.168.1.50 as the IP address of the ATA).<br />

7. Dial 120 and you will hear the current sub-net mask. If it is not your existing<br />

network subnet mask you may want to change it. If it is the same as your current<br />

network’s subnet mask, do don’t need to do anything else). If you need to<br />

change the sub-net mask, do the following:<br />

8. Dial 121 and at the prompt enter 255*255*255*0 (assuming that is your existing<br />

sub-net mask)<br />

Next, connect to the Unit using your browser by entering http://192.168.1.50 in your<br />

browser address bar and hit enter.<br />

TRIXBOX-2 Without Tears Page 204 of 238


2. Select Admin Login and then select (switch to advanced view)<br />

3. Select the System Tab<br />

a. Under Internet Connection Type, change the Gateway address to the<br />

address of your router.<br />

4. Select Regional Tab<br />

a. Under Vertical Service Activation Codes, delete all the fields.<br />

5. Select Line 1 Tab<br />

a. Under SIP Setting, change the SIP Port to 5060<br />

b. Under Proxy and Registration, change the Proxy to reflect the address<br />

of your Asterisk box.<br />

c. Under Subscriber Information, change the Display Name to whatever<br />

you like, change the User ID to the Asterisk Extension number that you<br />

have allocated for this line e.g. 201. Change the Password to the<br />

password you have allocated to the asterisk extension. Change Use<br />

Auth ID to Yes. Change the Auth ID to the extension number you have<br />

allocated e.g. 201, the same as the User ID.<br />

d. Under Dial Plan, change the existing dial plan to (**|*x.|x.|**x.) Change<br />

Enable IP Dialling to yes.<br />

6. Select Line 2 Tab<br />

a. Under SIP Setting, change the SIP Port to 5061<br />

b. Under Proxy and Registration, change the Proxy to reflect the address<br />

of your Asterisk box.<br />

c. Under Subscriber Information, change the Display Name to whatever<br />

you like, change the User ID to the Asterisk Extension number that you<br />

have allocated for this line e.g. 202. Change the Password to the<br />

password you have allocated to the asterisk extension. Change Use<br />

Auth ID to Yes. Change the Auth ID to the extension number you have<br />

allocated e.g. 202, the same as the User ID.<br />

d. Under Dial Plan, change the existing dial plan to (**|*x.|x.|**x.) Change<br />

Enable IP Dialling to yes.<br />

7. Set this setting only if you are using STUN Server<br />

a. Select SIP Tab<br />

b. Handle VIA received: no<br />

c. Handle VIA rport: no<br />

d. Insert VIA received: no<br />

e. Insert VIA rport: no<br />

f. Substitute VIA Addr: yes<br />

g. Send Resp To Src Port: yes<br />

h. STUN Enable: yes<br />

i. STUN Test Enable: no<br />

j. STUN Server: stun.xten.com (I use stun.xten.com, you may use<br />

whichever stun server you like)<br />

k. NAT Keep Alive: 15<br />

These are the minimum changes you need to do to get the ATA working in conjunction<br />

with Asterisk. There are other changes that you can do depending on your own<br />

requirement. There are various discussions on this topic in the Whirlpool, Voxilla and<br />

other forums that you can refer to.<br />

TRIXBOX-2 Without Tears Page 205 of 238


APPENDIX E (USERS’ CONTRIBUTIONS)<br />

E.1 SUGGESTIONS FOR DIAL PLAN AND CONFIGURATION<br />

Place Holder for Suggestions on Dial Plan and Configurations<br />

TRIXBOX-2 Without Tears Page 206 of 238


E.2 MULTIPLE TDM400P INSTALLATION<br />

Neilmc, a participant I the Whirlpool Forum provided the following feedback on the use of<br />

multiple TDM400P Digium cards.<br />

This is being discussed in this thread:<br />

http://forums.whirlpool.net.au/forum-replies.cfmt=483550&p=1<br />

<br />

There are plenty of forum posts (on WP and elsewhere) + various how-to and guides that<br />

say don't use more than one if you want a reliable system with no audio problems.<br />

I'm sure that on the old Digium site they had a caution not to use more than one TDM or<br />

TE card (That's changed, they now brag about 1 box running 5 quad span TE cards).<br />

This machine is now working in a busy environment (medical centre) nicely, sometimes<br />

under full Zap call load. It has 5 x FXO & 5 x FXS on 3 cards. CPU is under 10% pretty<br />

much all the time.<br />

I asked them to be very fussy about audio quality and let me know if they have any echo,<br />

pops, clicks, distortion etc.<br />

So far everyone is saying that it's perfectly fine, not a bad call yet.<br />

There is good reason behind the old advice not to do it though. Lots of people have had<br />

grief.<br />

Make sure you don't grab any old motherboard that is lying about (especially if it isn't PCI<br />

2.2 compliant) Even though minimum system specs aren't high don't go for a bottom of<br />

the range el-crapo brand motherboard. There is a list of some incompatible motherboards<br />

on the Digium site, but no doubt there will be others that have problems.<br />

Choose a board that has plenty of PCI slots (5 or so). Make sure that it has plenty of<br />

control over IRQ in CMOS. Eg the ASUS P5P-800 I used could use APIC to assign IRQ<br />

or you could manually assign an IRQ to a particular PCI slot.<br />

Be very sure that each Digium card is not sharing an IRQ with anything else.<br />

Disable any onboard devices you don't need inc. serial, parallel & USB ports.<br />

It may not be a problem, but to minimise chances of problems disable Hyper threading if it<br />

is supported on your CPU. Use 32 bit OS rather than 64 bit.<br />

Use plenty of RAM. You don't want a PABX to be thrashing about with a swap file. I used<br />

1GB of decent quality RAM which is definitely far more than the system needs. (It's using<br />

about 230MB at the moment), but 1GB of RAM doesn't really cost much any more.<br />

Check that your hard drives are running in DMA mode (or use SCSI drives). Sometimes<br />

they default to PIO, which might cause problems if there is a sudden burst of disk activity.<br />

Sometimes APIC can cause you grief. You might be able to tweak your kernel, but you<br />

might get what you need by turning it off.<br />

Have a read through<br />

http://www.asteriskguru.com/tutorials/pci_irq_apic_tdm_ticks_te410p_te405p_noise.html<br />

If you have all of the driver stuff loading properly and still have audio problems.<br />

Use recent zaptel drivers (unless you become aware of an issue with them).<br />

TRIXBOX-2 Without Tears Page 207 of 238


• Make sure that the driver loads with the module option opermode=AUSTRALIA.<br />

• Run fxotune -i 4 (usually from /usr/src/zaptel) It will create a file /etc/fxotune.conf<br />

with settings for your cards based on tests with your lines (takes about 5 minutes<br />

per FXO port).<br />

• You will have to stop Asterisk before running fxotune.<br />

• Have /usr/src/zaptel/fxotune -s run at startup to have the card set. Apparently the<br />

values in the conf file are often zero if you have the modules in the correct<br />

opermode. ( have one module at the office where the first value is 10 rather than<br />

zero. I'll try fxotune again and see if it changes at all).<br />

I just put /usr/src/zaptel/fxotune -s at the bottom of /etc/rc.d/rc.local in A@H 2.6 and it<br />

loaded okay. You need it to run after the drivers load but before asterisk starts.<br />

• Check /var/log/messages after boot up. Each FXO port should have loaded with<br />

AUSTRALIA mode. If it is FCC mode then the card is set for North American<br />

lines.<br />

• Each FXS port should have an entry for boosting ringer.<br />

If fxotune is loading settings okay you should see a line saying something like after all of<br />

the other init stuff.<br />

kernel: -- Setting echo registers:<br />

kernel: -- Set echo registers successfully<br />

If you have 4 FXO ports, you should see this 4 times.<br />

<br />

TRIXBOX-2 Without Tears Page 208 of 238


E.3 ELIMINATING ECHO PROBLEMS IN SPA-3000<br />

Tony, another participant in the Whirlpool Forum, provided the following recommendation.<br />

Echo in the SPA-3000 is a common problem. In reality, most of the time the SPA-3000<br />

isn't causing the echo, it's just making it more noticeable. This is due to the fact that the<br />

SPA-3000 passes calls from the PSTN to the LINE1 by converting it to VoIP internally<br />

and then backs to analogue. This process does not produce any echo, however is can<br />

add about 30ms of latency to the call. This added latency can make echo that was<br />

previously unnoticed suddenly become annoying. A pure digital system has no echo (the<br />

TX and RX path are 100% separated). It's the interaction of the Digital and Analogue that<br />

cause problems.<br />

This may help getting rid of that pesky echo on your Sipura SPA-3000 PSTN line:<br />

1. Make sure you are running the latest firmware (3.1.7) and you have everything back to<br />

factory defaults or at least undo all the previous tweaking.<br />

2. Switch *off* all echo can in all your devices. There are 6 places in the sipura to switch<br />

off echo can.<br />

• PSTN Line -> "Echo Canc Enable",<br />

• "Echo Canc Adaptive Enable",<br />

• "Echo Supp Enable" and<br />

• Line 1 -> "Echo Canc Enable",<br />

• "Echo Canc Adaptive Enable",<br />

• "Echo Supp Enable".<br />

The idea is that we want to hear how bad the echo is with different configs.<br />

3. Unplug everything from your phone line except the SPA-3000. This includes all the<br />

extension cables even with nothing connected to them. These can cause impedance<br />

problems that lead to echo.<br />

4. Set the Impedance on your lines.<br />

• PSTN -> "Port Impedance" = 220+820||120nF as a starting point.<br />

• Regional -> FXS Port Impedance = "220+820||115nF" as a starting point.<br />

5. In the PSTN tab set –<br />

• "Tip/Ring Voltage Adjust: = 3.1V" and<br />

• "Operational Loop Current Min = 16mA".<br />

Doesn't seem to affect echo, but I believe that these are the correct numbers for<br />

Australia.<br />

6. Turn down the jitter buffers!<br />

• "PSTN -> Network Jitter Level: = low",<br />

• "PSTN -> Jitter Buffer Adjustment: = disable".<br />

This reduces the delay across your SPA-3000.<br />

• "LINE1 -> Network Jitter Level: = low",<br />

• "LINE1 -> Jitter Buffer Adjustment: = up and down".<br />

If you are using a poor quality VoIP service as well as the PSTN then you could change<br />

the<br />

• "LINE1 -> Network Jitter Level: = medium".<br />

7. Set the preferred codec for the PSTN to be g711a and lock it in.<br />

• "PSTN -> Preferred Codec = g711a",<br />

• "PSTN -> Use Pref Codec Only = yes".<br />

TRIXBOX-2 Without Tears Page 209 of 238


Obviously adjust this if you’re accessing your PSTN line via VoIP from a remote network.<br />

Set the LINE1 to allow g711a as well as whatever else your prefer.<br />

• "LINE1 -> Use Pref Codec Only = no".<br />

The g711a is fast to encode and decode. Using this codec again reduces your latency<br />

and may make the echo less obvious or easier to catch with the echo canceller.<br />

8. Power cycle the SPA-3000 (pull the power plug). Believe it or not, this sometimes fixes<br />

the problem. Especially after you have changed the physical phone wiring.<br />

9. Make some test calls. The telco test number 1800801920 is a good one to start with. It<br />

has a recorded voice telling you your local phone number. While it's talking, talk back and<br />

work out how much echo you are getting. Talk loud, talk soft.<br />

10. Look at what you have got. If you can hear an echo then the problem could be that<br />

your probably sending to much power down the line. This is probably reflecting back<br />

somewhere as an echo. If you’re close to the exchange and have good wires then this is<br />

probably the case. You need to crank back on the power. Go to PSTN -> "SPA To PSTN<br />

Gain" and turn it down. Be aware that at some point if you turn it down to much, the SPA<br />

sorts does a double negative and turns it way up. I believe the range of this variable is<br />

about -127 -> 127 (from my testing). Turn it down, down, down, down until the person can<br />

still hear you but reduced echo.<br />

Note: if you enable "Echo Supp Enable" then you will negate these parameters. It seems<br />

that the Sipura echo suppression is actually just an automatic gain control. It's really<br />

annoying - leave it off.<br />

11. Make a test call to someone with a known good phone out via the SPA's PSTN line or<br />

get someone to call in to the PSTN line. Best if it’s just a boring old Telstra phone hard<br />

wired to a socket on the wall. Don't call a mobile!<br />

If the remote party is hearing echo, it could be that your phone is so loud that it's feeding<br />

back into the microphone. Turn down the PSTN To SPA Gain until you can comfortable<br />

hear the person, no more. If the remote user can still hear echo, try using a different<br />

phone plugged into the SPA. Go for the basics first, a cruddy old Telstra phone is what I<br />

use for testing. If this solves the problem you may have a bad phone or an impedance<br />

miss match between your phone and the SPA.<br />

• Try changing the Regional -> FXS Port Impedance to "600".<br />

• Try changing the FXO port impedance to "600" or "global".<br />

If this doesn't help, change it back. The impedance will only affect what the *remote* party<br />

hears, it won't help echo you are hearing.<br />

12. After you have the echo down to a reasonable level, go back into the "PSTN" tab and<br />

switch on the "Echo Can Enable = yes". Check to see if the echo has improved. If the<br />

echo is tolerable at this level, leave the adaptive echo canceller off. You should have the<br />

echo level down to a level that can be stomped on by the echo canceller. If you are using<br />

a sip device to talk through your PSTN line, you should probably do all the echo<br />

cancellation at that device and leave it switched off in the SPA.<br />

The adaptive echo canceller is a lot more aggressive but also can cancel out some of the<br />

incoming conversation. In particular if you’re calling in a loud environment then the voice<br />

going down the line from your end can trick the echo canceller to start canning some of<br />

the real conversation. It makes the incoming party sound a bit scratchy. Leave it off<br />

unless you really need it.<br />

The "Echo Supp Enable" switches on automatic gain controls. This means the Sipura will<br />

be constantly turning up and down the volume of the call for you and the remote party to<br />

TRIXBOX-2 Without Tears Page 210 of 238


try and keep the sound levels at a "good" level. Sipura's definition of good may not suit<br />

your situation. The constant variation of the volume annoys me so I recommend leaving it<br />

"off".<br />

13. Test call. Talk loud, talk soft. Is your conversation clear at both ends Should be a lot<br />

better. If echo re-appears, at a later date, remember to try power cycling the SPA before<br />

you tweak with anything. It may also be at the other end of the call.<br />

In the end it basically boils down to this –<br />

If you are hearing the echo, the real problem is at the *other* end of the connection. In a<br />

normal phone conversation, the latency is so low that you don't notice it. Your brain<br />

automatically tunes out to its own voice when you’re talking (as long as the delay between<br />

talking and hearing isn't to long). When you insert the SPA, the delay is increased and<br />

sometimes the echo can become noticeable.<br />

The only way you can counter this is to reduce the latency (jitter buffer) and/or reduce the<br />

gains so the echo volume is reduced below the level that it is noticed. At this point, the<br />

SPA-3000 echo canceller should be able to kill off the rest.<br />

E.4 IMMEDIATE ANSWER OF PSTN CALLS<br />

By default, calls will be answered after about 3 rings thus allowing time for Asterisk to<br />

detect the CID. Some users may want the PSTN calls to be answered by Asterisk<br />

immediately especially if there is a common phone connected in parallel and to avoid<br />

someone answering the call using the parallel phone.<br />

To do this you need to change one setting in the zapata.conf file. By default the setting is<br />

set to:<br />

Immediate = no<br />

To force Asterisk to answer immediately, change the line to read:<br />

Immediate = yes<br />

If you are not using Fax, it is also a good idea to disable fax extension in your General<br />

setting.<br />

This may or may not work satisfactorily as Asterisk needs a couple of rings to detect CID.<br />

E.5 REBUILD ZAPTEL DRIVER (USERS’ SUGGESTIONS)<br />

E.5.1 As experienced by marner – a Whirlpool Forum participant.<br />

On his Dell box, marner had to do the following to rebuild the driver and for it to work.<br />

Log in as root and issue the following command:<br />

cd /usr/src/kernels/2.6.9-34.EL-smp-i 686/include/linux<br />

wget http://nerdvittles.com/aah27/spinlock.h<br />

The rest of the procedure is as per earlier chapter Rebuilding Zaptel Driver<br />

E.5.2 As suggested by Rob Thomas (the <strong>Free</strong>PBX guru)<br />

Rob’s suggestion is to edit the file<br />

TRIXBOX-2 Without Tears Page 211 of 238


usr/src/kernels/2.6.9-34.EL-i686/include/linux/spinlock.h<br />

and change 'rw_lock_t' on line 407 to 'rwlock_t'<br />

Once that is done, do the following:<br />

rebuild-zaptel<br />

That seems to be a lot easier.<br />

E.6 ZAPTEL CARD CONFIGURATION FOR AUSTRALIA<br />

Submitted by Stephen Gleeson – Technical Manager for Community Information Strategies<br />

Australia Inc (CISA).<br />

http://gleesos.wordpress.com/2006/02/08/voip-with-asterisk/<br />

Stephen has attached samples of Zapata configuration files – with correct settings for<br />

Australia – loop start.<br />

zaptel.conf<br />

# Autogenerated by /usr/local/sbin/genzaptelconf -- do not hand<br />

edit<br />

# Zaptel Configuration File<br />

#<br />

# This file is parsed by the Zaptel Configurator, ztcfg<br />

#<br />

# It must be in the module loading order<br />

# Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1"<br />

#<br />

# Update for regional - ls - loopstart au - zone<br />

#<br />

fxols=1<br />

fxsls=2<br />

fxsls=3<br />

fxsls=4<br />

# Global data<br />

loadzone = au<br />

defaultzone = au<br />

zapata_addiotional.conf<br />

;;;;;;[230]<br />

signalling=fxo_ls<br />

record_out=Adhoc<br />

record_in=Adhoc<br />

mailbox=230@device<br />

echotraining=800<br />

echocancelwhenbridged=no<br />

echocancel=yes<br />

context=from-internal<br />

callprogress=no<br />

callerid=device <br />

busydetect=no<br />

busycount=7<br />

TRIXBOX-2 Without Tears Page 212 of 238


channel=>1<br />

zapata.conf<br />

;<br />

; Zapata telephony interface<br />

;<br />

; Configuration file<br />

[trunkgroups]<br />

[channels]<br />

language=en<br />

context=from-pstn<br />

signalling=fxs_ls<br />

rxwink=300<br />

; Atlas seems to use long (250ms) winks<br />

;<br />

; Whether or not to do distinctive ring detection on FXO lines<br />

;<br />

;usedistinctiveringdetection=yes<br />

usecallerid=yes<br />

hidecallerid=no<br />

callwaiting=yes<br />

usecallingpres=yes<br />

callwaitingcallerid=yes<br />

threewaycalling=yes<br />

transfer=yes<br />

cancallforward=yes<br />

callreturn=yes<br />

echocancel=yes<br />

echocancelwhenbridged=no<br />

echotraining=800<br />

rxgain=0.0<br />

txgain=0.0<br />

group=0<br />

callgroup=1<br />

pickupgroup=1<br />

immediate=no<br />

;faxdetect=both<br />

faxdetect=incoming<br />

;faxdetect=outgoing<br />

;faxdetect=no<br />

;Include genzaptelconf configs<br />

#include zapata-auto.conf<br />

;Include AMP configs<br />

#include zapata_additional.conf<br />

TRIXBOX-2 Without Tears Page 213 of 238


E.7 RAID1, LVM (LOGICAL VOLUMES) – HOW TO<br />

(Submitted by a user: Rehan)<br />

Introduction<br />

According to Digium recommendations Asterisk boxes should be IDE based. This is<br />

counter to what one would expect. However if you are using Zaptel drivers then a fast<br />

hard disk or hardware RAID might ‘s<strong>tea</strong>l’ interrupts from the Zaptel drivers. Additionally<br />

many hardware RAID solutions set themselves up on the PCI bus with timings that can<br />

delay voice traffic to your voice cards.<br />

(See note 3 at the end if you want to use scsi or sata drives)<br />

For this particular application (A PBX) we are not too concerned about disk performance.<br />

Much of the software will run in memory on a 300Mb Ram machine (Trixbox default install<br />

consumes no more than 200Mb including the file cache). Fast hard discs improve<br />

performance in systems that are heavily dependant on a swap file. Linux will keep<br />

everything in memory + a reasonable file cache as much as possible. CPU performance<br />

and making sure you have sufficient memory to run the PBX are the key performance<br />

indicators of a healthy PBX.<br />

We wouldn’t want to put an Asterisk box in production <strong>without</strong> some kind of resiliency to<br />

survive continuous use over perhaps many years. To use an IDE disk based system we<br />

can use software RAID to provide some protection and to make sure the PBX stays up<br />

and running. The Raid subsystem can also email you if a drive fails.<br />

The following procedure describes setting up a software RAID during installation on all<br />

partitions of a Trixbox. This applies to a vanilla install from the Distribution CDROM.<br />

We will be using RAID and also Logical Volume Management. Logical Volume<br />

Management gives us the ability to dynamically resize drives and dynamically add disk<br />

space on a live system <strong>without</strong> having to delete or create new partitions. So if your<br />

requirements change in the future you can easily accommodate them.<br />

The issues:<br />

1. Implementing RAID and logical volumes post-install is complicated, dangerous and not<br />

recommended.<br />

2. RAID (hardware or software) and LVM are desirable features. IDE is still the cheapest<br />

storage platform. This is especially true of Asterisk installs as many PBX's use low-end<br />

hardware.<br />

3. The default install of Trixbox does not allow any options to install RAID or LVM<br />

4. The text mode Anaconda install does not allow manual configuration of Logical<br />

volumes however a kickstart file does.<br />

5. A kickstart install of RAID will always (!!!!) produce file system corruption if the software<br />

RAID is not allowed to complete its first sync before the first reboot.<br />

6. High end hardware RAID is still relatively expensive. Linux drivers are not always<br />

available or if available, not always stable.<br />

Point 5 will many times dissuade people from using software RAID and LVM. As long as<br />

we can accommodate the first sync then we will have no problems.<br />

Ok, lets get started:<br />

TRIXBOX-2 Without Tears Page 214 of 238


1) We’ll need to set-up the drives in a particular order:<br />

Hardware configuration:<br />

HD 1 connected to primary IDE as master.<br />

HD 2 connected to secondary IDE as master.<br />

CDROM connected to secondary IDE as slave.<br />

The hard disks don't need to be exactly the same size. Actually using this method the<br />

disks don't need to be the same size at all. I would recommend that the smallest disk be<br />

at least 5Gigs. The Raid will configure itself to the smallest disk and the larger disk will<br />

match up to the smaller disk’s partitions with any extra space left unused.<br />

Although I worked this for IDE drives it can be used on any type of disk subsystem -<br />

SCSI, sata etc with some modification for the drive labels.<br />

2) Extract/Edit the CDROM:<br />

Windows:<br />

I used UltraISO on windows to modify the CDROM. Open the ISO with UltraISO and copy<br />

the ks.cfg file somewhere. Remove the read only flag so you can edit it. It is very<br />

important you edit the file with an editor that knows how to do Linux linefeeds. I<br />

discovered and used Editpad pro for this. The lite (demo) version will suit the needs we<br />

have. If your editor is not 100% compatible with Linux linefeeds after you reboot you will<br />

get errors which have directory names with strange characters (/var/Trixbox_load^M/ or<br />

/var/Trixbox_load/R where the /rR is actually in the directory name of load not a separate<br />

directory)<br />

Linux: (incomplete)<br />

Extract the CDROM to a temporary Directory. Make the file ks.cfg as non-read only. Edit<br />

and create the files as below. Use the following command to rebuild the ISO.<br />

mkisofs -o modified-Trixbox.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -<br />

boot-load-size 4 -boot-info-table<br />

3) Get the Installation configuration file as follows:<br />

We need to create a file that will tell the install program what to do. A copy of the existing<br />

file is located in the root of the CDROM. It is called ks.cfg. Make a copy of this file and call<br />

it ksRAIDlvm.cfg<br />

4) Edit the ksRAIDlvm.cfg as follows<br />

Delete the line where it says reboot. We don’t want it to automatically reboot at the end.<br />

This is a critical step!<br />

Where it says:<br />

#Partition clearing information<br />

clearpart --all –initlabel<br />

part /boot --fstype ext3 --size=100<br />

part / --fstype ext3 --size=1024 –grow<br />

part swap --size=256 --grow --maxsize=768<br />

Replace with<br />

TRIXBOX-2 Without Tears Page 215 of 238


#Partition clearing information<br />

clearpart --all –initlabel<br />

part raid.01 --size=100 --ondisk=hda –asprimary<br />

part raid.02 --size=100 --ondisk=hdc –asprimary<br />

part swap --size=256 --ondisk=hda<br />

part swap --size=256 --ondisk=hdc<br />

part raid.11 --size=1 --grow --ondisk=hda<br />

part raid.12 --size=1 --grow --ondisk=hdc<br />

raid /boot --level=1 --device=md0 raid.01 raid.02<br />

raid pv.01 --level=1 --device=md1 raid.11 raid.12<br />

volgroup vg01 pv.01<br />

logvol / --vgname=vg01 --size=10000 --name=root<br />

Very important: the –asprimary switch must only appear on the raid.01 and raid.02<br />

lines.<br />

This will give you a 100MB RAID 1 /boot partition, two 256Mb swap partitions (change the<br />

256 to a desirable size or replace with --recommended) and the rest of the disk will be a<br />

logical volume (over laying a RAID1 ) containing the / (or root) filesystem. All partitions will<br />

be formatted as Ext3 as normal. If you want to create other partitions to support other<br />

uses you can change the raid.11 and raid.12 lines to read --size=xxxx (in megabytes) and<br />

remove the –grow option. This will fix the size of the partition you create. After the<br />

installation completes you can then go ahead and create more RAID1 partitions and<br />

Logical volumes.<br />

Where it says (in the section starting - %post)<br />

mount /dev/hda /mnt/source<br />

change to<br />

mount /dev/md1 /mnt/source<br />

Add the following lines to the end of the %post% section. This will update the boot<br />

information to make both drives bootable. Remember to update the hdx numbers to<br />

match your drive configuration.<br />

/sbin/grub --batch /dev/null<br />

root (hd0,0)<br />

setup (hd0)<br />

root (hd1,0)<br />

setup (hd1)<br />

quit<br />

EOT<br />

Save the file.<br />

Add it to the root directory of the ISO and save the ISO under a different name.<br />

Burn the new ISO to a CD. Boot your soon to be asterisk machine from this CD and use<br />

the following command to start the install.<br />

linux ks=cdrom:/ksRAIDlvm.cfg<br />

The install process will continue as before however it will create the RAID as we have setup.<br />

Begin the install. Let it run through to the end. When you see the REBOOT screen STOP.<br />

Don't do anything here. We need to wait for the RAIDs to complete their first sync.<br />

TRIXBOX-2 Without Tears Page 216 of 238


A way to be sure that discs have been synced is to press Alt+F2 to get a new console<br />

and then execute the following command.<br />

watch cat /proc/mdstat<br />

Once you are sure the disks are in sync. Reboot.<br />

You are done!<br />

Checking and maintaining:<br />

(Some elements have been edited in collaboration with Sofoklis Sflomos who emailed me with<br />

some corrections*)<br />

Login as root using the password set-up during the earlier phase.<br />

You can check the state of the RAID by using the following command:<br />

cat /proc/mdstat<br />

This will tell you if any of the hard disks have crashed.<br />

<br />

Note by Sofoklis Sflomos:<br />

In case of hard disc crash, then:<br />

1. execute the command "cat /proc/mdstat" to indicate which disc has crashed (let's say<br />

that hdc has crashed)<br />

2. replace hdc<br />

3. restore the primary partition table with "dd if=/dev/hda of=/dev/hdc count=1 bs=512"<br />

4. restore the extended partition table with "sfdisk -d /dev/hda > bak-hda"<br />

5. and then "sfdsik /dev/hdc < bak-hda"<br />

6. mdadm -a /dev/md0 /dev/hdc1<br />

mdadm -a /dev/md1 /dev/hdc2<br />

mdadm -a /dev/md2 /dev/hdc3<br />

You should have two raids called md0 md1 and md2 (if you are using 3 disks) or md0 and<br />

md1 (if you are using 2 disks). In square brackets for each it should say [2/2 (or 3/3)].<br />

Your disks are ready and Trixbox is installed. The block sizes may be different if you are<br />

not using identical disks.<br />

If it doesn't say [2/2] depending on the number of hard disks you are using but the<br />

machine has restarted ok and it says [2/1] then one or both your raids have not synced<br />

properly or your disk is faulty (bad blocks). To manually sync the raids type some<br />

commands (for simplicity all the commands are included below. If a partition is already in<br />

a Synced RAID the command will fail with an error (in this case the error means<br />

success!). This you can ignore and move onto the next command):<br />

mdadm -a /dev/md0 /dev/hda1<br />

mdadm -a /dev/md0 /dev/hdc1<br />

mdadm -a /dev/md1 /dev/hda2<br />

TRIXBOX-2 Without Tears Page 217 of 238


mdadm -a /dev/md1 /dev/hdc2<br />

mdadm -a /dev/md2 /dev/hda3<br />

mdadm -a /dev/md2 /dev/hdc3<br />

use<br />

watch cat /proc/mdstat<br />

to monitor the raid re-build. Once it is complete you can issue the<br />

reboot<br />

command and restart the machine. Check your raids again with<br />

cat /proc/mdstat<br />

They should be ok now.<br />

If the machine has not started ok (errors on the startup screen) then the chances are the<br />

RAID was not completely built before the restart. The best idea here is to re-install this<br />

time waiting longer before rebooting. It is difficult to know which files are not complete.<br />

The following is the full content of the ksRAIDlvm.cfg file as used by Sofoklis Sflomos.<br />

#CentOS trixbox Kickstart<br />

#modified by Sofoklis Sflomos ssflomos@cs.teiath.gr<br />

#System language<br />

lang en_US<br />

#Language modules to install<br />

langsupport en_US<br />

#System mouse<br />

mouse none<br />

#Use text mode install<br />

text<br />

#Install Red Hat Linux ins<strong>tea</strong>d of upgrade<br />

install<br />

#Use CDROM installation media<br />

cdrom<br />

#System bootloader configuration<br />

bootloader --location=mbr<br />

#Clear the Master Boot Record<br />

zerombr yes<br />

#Partition clearing information<br />

clearpart --all --initlabel<br />

# Creates the BOOT partition that is 100mb in size<br />

part raid.01 --size=100 --ondisk=hda --asprimary<br />

part raid.02 --size=100 --ondisk=hdc --asprimary<br />

# Creates the SWAP partition (1024mb)<br />

part raid.11 --size=1024 --ondisk=hda<br />

part raid.12 --size=1024 --ondisk=hdc<br />

TRIXBOX-2 Without Tears Page 218 of 238


# Creates the root (/) partition that is able to grow to fill<br />

part raid.21 --size=100 --grow --ondisk=hda<br />

part raid.22 --size=100 --grow --ondisk=hdc<br />

# Now create the raids using the above partitions<br />

raid /boot --level=1 --device=md0 --fstype=ext3 raid.01 raid.02<br />

raid swap --level=1 --device=md1 --fstype=swap raid.11 raid.12<br />

raid pv.01 --level=1 --device=md2 --fstype=ext3 raid.21 raid.22<br />

volgroup vg01 pv.01<br />

logvol / --vgname=vg01 --size 10000 --name=root<br />

#System authorization infomation<br />

auth --useshadow --enablemd5<br />

#Network information<br />

network --bootproto=dhcp --device=eth0<br />

#Firewall configuration<br />

firewall --disabled<br />

selinux --disabled<br />

#Do not configure XWindows<br />

skipx<br />

#Package install information<br />

%packages --resolvedeps<br />

alsa-utils<br />

audiofile-devel<br />

bind<br />

bison<br />

cpp<br />

curl<br />

curl-devel<br />

cvs<br />

dhcp<br />

flex<br />

gcc<br />

gcc-c++<br />

gd<br />

glibc-devel<br />

glibc-headers<br />

glibc-kernheaders<br />

grub<br />

httpd<br />

kernel<br />

krb5-devel<br />

libc-client<br />

libcap<br />

libpcap<br />

libstdc++<br />

libstdc++-devel<br />

libtermcap-devel<br />

libtiff<br />

libtiff-devel<br />

libxml2<br />

lm_sensors<br />

mc<br />

mkisofs<br />

mysql<br />

TRIXBOX-2 Without Tears Page 219 of 238


mysql-devel<br />

mysql-server<br />

ncurses-devel<br />

newt-devel<br />

net-snmp<br />

ntp<br />

openssl096b<br />

openssl-devel<br />

perl<br />

perl-libwww-perl<br />

perl-DateManip<br />

perl-DBD-MySQL<br />

perl-DBI<br />

perl-Net-DNS<br />

perl-suidperl<br />

perl-Time-HiRes<br />

perl-XML-Parser<br />

php<br />

php-gd<br />

php-imap<br />

php-mbstring<br />

php-mysql<br />

php-snmp<br />

postgresql-libs<br />

readline<br />

readline-devel<br />

sendmail-cf<br />

subversion<br />

system-config-date<br />

system-config-keyboard<br />

rpm-build<br />

slang-devel<br />

sox<br />

speex<br />

unixODBC<br />

vsftpd<br />

zlib-devel<br />

screen<br />

%post --nochroot<br />

mkdir /mnt/source<br />

mount /dev/md1 /mnt/source<br />

mount /tmp/cdrom /mnt/source<br />

mkdir /mnt/sysimage/var/trixbox_load<br />

cd /mnt/sysimage/var/trixbox_load<br />

tar xvfz /mnt/source/trixbox.tar.gz<br />

#unmount CD-ROM<br />

umount /mnt/source<br />

# ------------------------------------------<br />

# Post install<br />

# ------------------------------------------<br />

%post<br />

echo "/var/trixbox_load/install_all.sh" >> /etc/rc3.d/S99local<br />

echo "NETWORKING=yes" > /etc/sysconfig/network<br />

echo "HOSTNAME=asterisk1.local" >> /etc/sysconfig/network<br />

TRIXBOX-2 Without Tears Page 220 of 238


echo "# Do not remove the following line, or various programs" ><br />

/etc/hosts<br />

echo "# that require network functionality will fail." >><br />

/etc/hosts<br />

echo "127.0.0.1<br />

localhost" >> /etc/hosts<br />

echo "127.0.0.1<br />

asterisk1.local" >> /etc/hosts<br />

echo "driftfile /var/lib/ntp/drift" > /etc/ntp.conf<br />

echo "server 0.pool.ntp.org" >> /etc/ntp.conf<br />

echo "server 1.pool.ntp.org" >> /etc/ntp.conf<br />

echo "server 2.pool.ntp.org" >> /etc/ntp.conf<br />

echo "server 127.127.1.0" >> /etc/ntp.conf<br />

echo "fudge 127.127.1.0 stratum 10" >> /etc/ntp.conf<br />

cp -f /var/trixbox_load/splash.xpm.gz /boot/grub<br />

cp -f /boot/grub/grub.conf /boot/grub/grub.conf.old<br />

sed -e "s/hiddenmenu/#hiddenmenu/" /boot/grub/grub.conf.old ><br />

/boot/grub/grub.conf<br />

#make both disks bootable<br />

/sbin/grub --batch /dev/null<br />

root (hd0,0)<br />

setup (hd0)<br />

root (hd1,0)<br />

setup (hd1)<br />

quit<br />

EOT<br />

eject<br />

Notes:<br />

1) In a VMWARE machine everything works fine. (To test this you need to create a<br />

second hard drive when creating the virtual machine then do the install booting either off<br />

the new CDROM or the new ISO).<br />

2) For anyone who wants to revert (or vert) an existing drive to Raid, here is a good link:<br />

http://linux-sxs.org/hardware/raid_for_idiots.html<br />

Just ignore the last bit and use grub ins<strong>tea</strong>d (Lilo is too old!!!!).<br />

The following commands achieve the same ends:<br />

grub (enter)<br />

root (hdx0,0)<br />

setup (hdx0)<br />

root (hdx1,0)<br />

setup (hdx1)<br />

(ctrl-z to exit)<br />

3) This procedure will work for SCSI and SATA drives as well. Bearing in mind the<br />

caveats Digium have about using IDE many people have successfully installed RAID 1 on<br />

SCSI and SATA drives. To accomplish this replace the HDx with a suitable replacement<br />

(usually hd0 is replaced with sd0 and hd1 with sd1).<br />

If you have any issues booting from the RAID they can usually be fixed by booting from<br />

the Trixbox CD and starting the Rescue Environment and running some commands:<br />

TRIXBOX-2 Without Tears Page 221 of 238


Boot from the Trixbox CD. At the prompt type:<br />

Linux rescue<br />

Issue:<br />

grub (enter)<br />

root (hdx0,0)<br />

setup (hdx0)<br />

root (hdx1,0)<br />

setup (hdx1)<br />

(ctrl-z to exit)<br />

reboot<br />

We continue to use the textmode install because it reduces the chances of the install<br />

failing. For example if you have a Rage XL video card then using a graphical install, the<br />

format of the drives will fail (RAID or no RAID). In textmode logical volumes can only be<br />

created in the kickstart file.<br />

If your disk controller needs to have special drivers then the install must be started using<br />

the following command:<br />

Linux ks=cdrom:/ksRAIDlvm.cfg dd<br />

At some point it will ask you for a driver disk. This can usually be obtained from the<br />

manufacturers website.<br />

TRIXBOX-2 Without Tears Page 222 of 238


E.8 V2.2 TRIXBOX LOAD CONFIG TO INCLUDE IDE RAID<br />

The latest version of Trixbox includes a config file for sata raid (ks_sataraid.cfg) but not<br />

IDE raid. The following is the ks_ideraid.cfg for inclusion in Trixbox V2.2 (thanks to Rick<br />

Strangman for submitting this).<br />

#CentOS trixbox Kickstart<br />

#System language<br />

lang en_US<br />

#Language modules to install<br />

langsupport en_US<br />

#System mouse<br />

mouse none<br />

#Reboot after installation<br />

#Use text mode install<br />

text<br />

#Install Red Hat Linux ins<strong>tea</strong>d of upgrade<br />

install<br />

#Use CDROM installation media<br />

cdrom<br />

#System bootloader configuration<br />

bootloader --location=mbr<br />

#Clear the Master Boot Record<br />

zerombr yes<br />

#Partition clearing information<br />

clearpart --all --initlabel<br />

# Creates the BOOT partition that is 100mb in size<br />

part raid.01 --size=100 --ondisk=hda --asprimary<br />

part raid.02 --size=100 --ondisk=hdc --asprimary<br />

# Creates the SWAP partition (1024mb)<br />

part raid.11 --size=1024 --ondisk=hda<br />

part raid.12 --size=1024 --ondisk=hdc<br />

# Creates the root (/) partition that is able to grow to fill<br />

part raid.21 --size=100 --grow --ondisk=hda<br />

part raid.22 --size=100 --grow --ondisk=hdc<br />

# Now create the raids using the above partitions<br />

raid /boot --level=1 --device=md0 --fstype=ext3 raid.01 raid.02<br />

raid swap --level=1 --device=md1 --fstype=swap raid.11 raid.12<br />

raid / --level=1 --device=md2 --fstype=ext3 raid.21 raid.22<br />

#System authorization infomation<br />

auth --useshadow --enablemd5<br />

#Network information<br />

network --bootproto=dhcp --device=eth0<br />

#Firewall configuration<br />

firewall --disabled<br />

selinux --disabled<br />

#Do not configure XWindows<br />

skipx<br />

TRIXBOX-2 Without Tears Page 223 of 238


#Package install information<br />

%packages --resolvedeps<br />

alsa-utils<br />

audiofile-devel<br />

bind<br />

bison<br />

cpp<br />

curl<br />

curl-devel<br />

cvs<br />

dhcp<br />

flex<br />

gcc<br />

gcc-c++<br />

gd<br />

glibc-devel<br />

glibc-headers<br />

glibc-kernheaders<br />

grub<br />

httpd<br />

kernel<br />

krb5-devel<br />

libc-client<br />

libcap<br />

libpcap<br />

libstdc++<br />

libstdc++-devel<br />

libtermcap-devel<br />

libtiff<br />

libtiff-devel<br />

libxml2<br />

lm_sensors<br />

mc<br />

mkisofs<br />

mysql<br />

mysql-devel<br />

mysql-server<br />

ncurses-devel<br />

newt-devel<br />

net-snmp<br />

ntp<br />

openssl096b<br />

openssl-devel<br />

perl<br />

perl-libwww-perl<br />

perl-DateManip<br />

perl-DBD-MySQL<br />

perl-DBI<br />

perl-Net-DNS<br />

perl-suidperl<br />

perl-Time-HiRes<br />

perl-XML-Parser<br />

php<br />

php-gd<br />

php-imap<br />

php-mbstring<br />

php-mysql<br />

php-snmp<br />

postgresql-libs<br />

readline<br />

readline-devel<br />

sendmail-cf<br />

subversion<br />

system-config-date<br />

system-config-keyboard<br />

rpm-build<br />

TRIXBOX-2 Without Tears Page 224 of 238


slang-devel<br />

sox<br />

speex<br />

unixODBC<br />

vsftpd<br />

zlib-devel<br />

%post --nochroot<br />

mkdir /mnt/source<br />

mount /dev/md1 /mnt/source<br />

mount /tmp/cdrom /mnt/source<br />

mkdir /mnt/sysimage/var/trixbox_load<br />

cd /mnt/sysimage/var/trixbox_load<br />

tar xvfz /mnt/source/trixbox.tar.gz<br />

#unmount CD-ROM<br />

umount /mnt/source<br />

# ------------------------------------------<br />

# Post install<br />

# ------------------------------------------<br />

%post<br />

echo "/var/trixbox_load/install_all.sh" >> /etc/rc3.d/S99local<br />

echo "NETWORKING=yes" > /etc/sysconfig/network<br />

echo "HOSTNAME=asterisk1.local" >> /etc/sysconfig/network<br />

echo "# Do not remove the following line, or various programs" ><br />

/etc/hosts<br />

echo "# that require network functionality will fail." >> /etc/hosts<br />

echo "127.0.0.1<br />

localhost" >> /etc/hosts<br />

echo "127.0.0.1<br />

asterisk1.local" >> /etc/hosts<br />

echo "driftfile /var/lib/ntp/drift" > /etc/ntp.conf<br />

echo "server 0.pool.ntp.org" >> /etc/ntp.conf<br />

echo "server 1.pool.ntp.org" >> /etc/ntp.conf<br />

echo "server 2.pool.ntp.org" >> /etc/ntp.conf<br />

echo "server 127.127.1.0" >> /etc/ntp.conf<br />

echo "fudge 127.127.1.0 stratum 10" >> /etc/ntp.conf<br />

cp -f /var/trixbox_load/splash.xpm.gz /boot/grub<br />

cp -f /boot/grub/grub.conf /boot/grub/grub.conf.old<br />

sed -e "s/hiddenmenu/#hiddenmenu/" /boot/grub/grub.conf.old ><br />

/boot/grub/grub.conf<br />

# make both disks bootable<br />

/sbin/grub --batch /dev/null<br />

device (hd0) /dev/hdc<br />

root (hd0,0)<br />

setup (hd0)<br />

device (hd0) /dev/hda<br />

root (hd0,0)<br />

setup (hd0)<br />

quit<br />

EOT<br />

eject<br />

TRIXBOX-2 Without Tears Page 225 of 238


E.9 TEST BENCH ANYONE<br />

(Contribution from zforum69)<br />

Issue: I don't have any room for test machines, let alone spare TDM400 cards, to try out<br />

new releases of trixbox or other Asterisk distros like elastix. I cannot have my main stable<br />

trixbox machine down for any length of time.<br />

Solution: Install each different version on a separate partition, and change back to the<br />

production partition when you are done testing.<br />

How:<br />

When booting a trixbox install CD, normally you just press enter after the boot prompt,<br />

where it will promptly delete everything on the disk and install trixbox to occupy the whole<br />

disk. Ins<strong>tea</strong>d of pressing enter, type advanced where you can control how the partitions<br />

are created and where trixbox will be installed. During the install it is a matter of following<br />

your nose until it gets to the part about disk partitioning, which you will choose to do<br />

manually rather take what ever the install is offering.<br />

If this going to be the first install on this disk delete all existing partitions if they exist.<br />

Create a new partition and set the mount point to "/" so it will install it into that partition.<br />

Set the size at say 20GB. Create a swap partition (2GB). Install the GRUB boot loader<br />

into the “Master Boot record”.<br />

If this second or subsequent Asterisk install on this disk, just create a new primary<br />

partition, again with the mount point set to "/" so it will install it into the newly created<br />

partition. You don't need to install another swap partition as there should already be one<br />

there from a previous installation. Install the GRUB boot loader into the "First sector of<br />

boot partition".<br />

Only the GRUB boot loader from the first install in the MBR will ever be used. The<br />

“grub.conf” generated by each other install is used to add to the grub.conf in the first<br />

install to get a menu of installs you can boot to.<br />

Boot the first install and mount the other partitions to get to look at their “grub.conf” files.<br />

Using those files edit the “grub.conf” in the first install to add the additional menu items for<br />

all your other installs. Now when ever you boot up you can interrupt the GRUB boot<br />

loader and select which ever install you want to boot to next. To do it remotely <strong>without</strong> a<br />

remote console you need to modify the “default=0” line in the grub.conf. That value<br />

determines which of the menu items the default is. By changing that value the next boot<br />

up and every subsequent one will cause GRUB to default to the new menu item and boot<br />

that. To change it back, mount the first partition, and change the default line back to "0" in<br />

the “grub.conf” file.<br />

TRIXBOX-2 Without Tears Page 226 of 238


APPENDIX F (PUBLICATIONS AND REFERENCES)<br />

F.1 DUNDI – A GUIDE TO A SIMPLE SETUP<br />

You will find a guide to a simple DUNDi set-up at the GoldfishNet Blog:<br />

http://blog.thegoldfish.net/dundi-tutorial-for-asteriskhome/<br />

F.2 THE FUTURE OF TELEPHONY BY O’REILLY PUBLISHING<br />

You may download the pdf version of this publication here:<br />

http://voipspeak.net/images/stories/orielly/AsteriskTFOT.zip<br />

O’Reilly has licensed the book under the creative commons license and as such, you are<br />

free to download and distribute it.<br />

F.3 OTHER ASTERISK FORUMS, TUTORIALS AND WIKIS<br />

One of my favourite site is http://www.asteriskconnection.com.au/<br />

Others that I refer to are:<br />

http://asteriskathome.sourceforge.net/<br />

http://www.voip-info.org/wiki/view/Asterisk%40home+Handbook+Wiki<br />

http://asteriskathome.sourceforge.net/faq.html<br />

http://sourceforge.net/forum/group_id=123387<br />

http://amp.coalescentsystems.ca/<br />

http://sourceforge.net/docman/group_id=121515<br />

The following are two tutorial sites that I recommend everyone who is serious about<br />

Trixbox and Asterisk generally.<br />

http://mundy.org/blog/index.phpp=81<br />

http://www.asteriskguru.com/tutorials/<br />

General VOIP related:<br />

http://www.freewebs.com/voipformula/VoIP-HOWTO.html<br />

F.4 VOICE OVER IP – PER CALL BANDWIDTH CONSUMPTION<br />

The following is a reference from Cisco Systems that’s worth a look.<br />

http://www.cisco.com/en/US/tech/tk652/tk698/technologies_tech_note09186a0080094ae2.shtml<br />

TRIXBOX-2 Without Tears Page 227 of 238


NOTES<br />

A2BILLING<br />

A2Billing is a calling card platform to manage calling card users’ accounts. To log on to<br />

A2Billing through Web Interface, connect to asterisk.ip.address/a2billing e.g.<br />

192.168.0.101/a2billing<br />

Login as admin using the default password of mypassword.<br />

A2Billing is not being covered in this guide, as it is a whole documentation exercise on its<br />

own. Those interested in A2Billing may have to refer to other source for instructions<br />

available on the net such as the following link:<br />

http://sourceforge.net/forum/forum.phpthread_id=1398290&forum_id=420324<br />

http://www.voip-info.org/wiki/view/Asterisk+billing<br />

DELETE CALL RECORDS FROM CDR<br />

There will be time when you need to delete the CDR records from your call details record.<br />

One example is, those calls you made white testing will need to be deleted before going<br />

live where you will need clean record.<br />

• These records are being kept in the SQL database and to delete them, do the<br />

following:<br />

• From Tools Menu (or from System menu for Trixbox 2.2)<br />

• select phpmyadmin<br />

• In the Database dropdown field, (top left), select the asteriskcdrdb.<br />

Select the 'cdr' table in the tick box<br />

• At the bottom of the list of table you will find a dropdown field “With Selected”,<br />

select EMPTY<br />

• You will be asks to 'confirm truncate table cdr',<br />

• If you click Yes at this point the content of the table will be erased.<br />

<br />

MySQL Manager – “tbm-phpmyadmin.noarch” must be installed. This can be done<br />

through Packages. It is not installed by default. Without this you will not be able to<br />

use phpadmin from the GUI.<br />

Alternatively, you can do it manually;<br />

Login to the shell (SSH) as root. You can do this using Putty.<br />

Enter these commands manually, each on a new line.<br />

mysql –p<br />

Enter password: passw0rd<br />

use asteriskcdrdb;<br />

delete from cdr;<br />

exit;<br />

Your CDR will now be empty.<br />

TRIXBOX-2 Without Tears Page 228 of 238


EXTENSION NUMBERS TO AVOID USING<br />

Unless you are prepared to edit and change some codes, its best to avoid the following<br />

extension numbers:<br />

200 - Park Notify<br />

300-399 - Reserved for speed dial<br />

666 - Reserved for FAX testing<br />

70-79 - Reserved for calls on hold<br />

700-799 - Reserved for calls on hold<br />

7777 - Reserved extension for incoming calls simulation<br />

SIP_NAT.CONF<br />

To those who use this configuration (not all do), I have an issue with externip = . I wasn’t able to accept incoming calls although SIP was registered. Changing to<br />

externip= if you have a fixed IP or externhost= if<br />

you don’t have a fixed IP and use Dynamic DNS service, solved the issue or do the<br />

alternative as I have outlined below.<br />

This issue may not be apparent at first as Asterisk will show that it is registered and you<br />

will still be able to make a call out (except calls to another Asterisk that have this property<br />

set). Another telltale sign is, you may not hear the ring tone when you are calling a party<br />

or you may have audio problem.<br />

This is caused by my /etc/hosts file where I have an entry (in red)<br />

127.0.0.1 localhost<br />

127.0.0.1 pcnovation.homelinux.org asterisk1.local<br />

SipBroker will resolve pcnovation.homelinux.org as 127.0.0.1 which is what it is suppose<br />

to be as it is being defined as such by the offending line. In actual fact<br />

pcnovation.homelinux.org should be resolved to the external IP address. However I need<br />

that entry for my VoiceMail e-mail notification since most email server will not accept<br />

email from unknown source – grief time.<br />

Taking my DNS name out solved the issue, but I cannot send e-mail notification of my<br />

voicemail. To fix this problem (a kludge) I substituted pcnovation.homelinux.org with<br />

another valid domain name different to my DynDNS domain name such as yahoo.com<br />

thus:<br />

127.0.0.1 yahoo.com asterisk1.local<br />

and problem solved… for now until something else pops up ☺<br />

HOW TO RESTRICT OUTGOING CALLS – MANUAL METHOD<br />

This requirement often manifests itself in an office environment where management<br />

restricts staff from making International, long distance, or even local calls. In many<br />

organizations, staffs are confined to making internal calls only.<br />

There are 2 ways that this can be handled. One is by using the Custom Context module<br />

or by creating the necessary context manually.<br />

Here, we will create the procedure manually.<br />

TRIXBOX-2 Without Tears Page 229 of 238


It is somewhat complicated, but I will try to explain it here and provide an example.<br />

1. Set up all your trunks and outbound routes as normal. At this stage, users can make<br />

unrestricted calls. This is the normal way of doing it with freePBX. You probably<br />

would have already done this.<br />

2. Through Config Edit of Trixbox, open extensions_additional.conf and locate the<br />

[outbound-allroutes] section of the file. You will notice something like my example<br />

below.<br />

[outbound-allroutes]<br />

include => outbound-allroutes-custom<br />

include => outrt-001-PSTN<br />

include => outrt-002-SPA3K<br />

include => outrt-003-Oztell<br />

include => outrt-004-Pennytel<br />

include => outrt-005-Domestic<br />

include => outrt-006-MobileAust<br />

include => outrt-007-International<br />

include => outrt-008-12Number<br />

include => outrt-009-13N1800Numbers<br />

include => outrt-010-e164<br />

include => outrt-011-SingaporeLink<br />

include => outrt-012-KualaLumpurLink<br />

include => outrt-013-MalaccaLink<br />

exten => foo,1,Noop(bar)<br />

; end of [outbound-allroutes]<br />

Highlight them, copy and paste in a notepad text file somewhere and will get back to<br />

this a little later.<br />

Alternatively you can paste it directly to extensions_custom.conf. Do not do this if<br />

Trixbox is active as it may cause some problem while people using it.<br />

3. Through Config Edit of Trixbox, open extensions_custom.conf and create a<br />

section like my example below. You can get the codes from [from-internaladditional]<br />

of extensions_additional.conf. So will have to do some juggling<br />

because you can’t cut and paste this from another .conf file <strong>without</strong> having to close<br />

one (you can cut and paste from here if you like).<br />

[from-restricted]<br />

;<br />

; These are all the applications that you will require<br />

;<br />

include => app-cf-busy-off<br />

include => app-cf-busy-off-any<br />

include => app-cf-busy-on<br />

include => app-cf-off<br />

include => app-cf-off-any<br />

include => app-cf-on<br />

include => app-cf-unavailable-off<br />

include => app-cf-unavailable-on<br />

include => app-calltrace<br />

include => app-callwaiting-cwoff<br />

include => app-callwaiting-cwon<br />

include => app-dialvm<br />

include => app-directory<br />

include => app-dnd-off<br />

include => app-dnd-on<br />

include => app-echo-test<br />

TRIXBOX-2 Without Tears Page 230 of 238


include => app-recordings<br />

include => app-speakextennum<br />

include => app-speakingclock<br />

include => app-userlogonoff<br />

include => app-zapbarge<br />

include => app-vmmain<br />

include => ext-group<br />

include => ext-fax<br />

include => ext-meetme<br />

include => ext-findmefollow<br />

include => ext-paging<br />

include => ext-queues<br />

include => ext-test<br />

include => ext-local<br />

include => parkedcalls<br />

;<br />

; #### OutBound Routes ########<br />

; # Below are all restricted routes #<br />

; ###########################<br />

;<br />

Now copy your [outbound-allroutes] that was saved to the text file directly underneath<br />

the last line of the above context. Remember to delete the [outbound-allroutes] label.<br />

Unfortunately you can’t cut and paste my example because they are my routes NOT<br />

yours.<br />

Your final handiwork will look something like the example below:<br />

[from-restricted]<br />

;<br />

; These are all the applications that you will require<br />

;<br />

include => app-cf-busy-off<br />

include => app-cf-busy-off-any<br />

include => app-cf-busy-on<br />

include => app-cf-off<br />

include => app-cf-off-any<br />

include => app-cf-on<br />

include => app-cf-unavailable-off<br />

include => app-cf-unavailable-on<br />

include => app-calltrace<br />

include => app-callwaiting-cwoff<br />

include => app-callwaiting-cwon<br />

include => app-dialvm<br />

include => app-directory<br />

include => app-dnd-off<br />

include => app-dnd-on<br />

include => app-echo-test<br />

include => app-recordings<br />

include => app-speakextennum<br />

include => app-speakingclock<br />

include => app-userlogonoff<br />

include => app-zapbarge<br />

include => app-vmmain<br />

include => ext-group<br />

include => ext-fax<br />

include => ext-meetme<br />

include => ext-findmefollow<br />

include => ext-paging<br />

include => ext-queues<br />

include => ext-test<br />

TRIXBOX-2 Without Tears Page 231 of 238


include => ext-local<br />

include => parkedcalls<br />

;<br />

; #### OutBound Routes ########<br />

; # Below are all restricted routes #<br />

; ###########################<br />

;<br />

; new outbound-restricted-routes<br />

include => outbound-allroutes-custom<br />

;include => outrt-001-PSTN<br />

include => outrt-002-SPA3K<br />

include => outrt-003-Oztell<br />

include => outrt-004-Pennytel<br />

include => outrt-005-Domestic<br />

include => outrt-006-MobileAust<br />

include => outrt-007-International<br />

include => outrt-008-12Number<br />

include => outrt-009-13N1800Numbers<br />

include => outrt-010-e164<br />

include => outrt-011-SingaporeLink<br />

include => outrt-012-KualaLumpurLink<br />

include => outrt-013-MalaccaLink<br />

exten => foo,1,Noop(bar)<br />

;<br />

; end of outbound-restricted-routes<br />

Now add the following codes underneath that to finish it off.<br />

;<br />

exten => h,1,Hangup<br />

exten => s,1,Macro(hangupcall)<br />

exten => h,1,Macro(hangupcall)<br />

4. You may now comment out the outbound routes you do not want the restricted<br />

extensions to use.<br />

E.g. If you comment out include => outrt-001-PSTN, the restricted extension<br />

cannot use PSTN.<br />

5. After you have done that, you need to go back to <strong>Free</strong>PBX and edit the extension that<br />

you want to restrict by change the context to from-restricted ins<strong>tea</strong>d of from-internal.<br />

Now go enjoy yourself with it.<br />

TRIXBOX-2 Without Tears Page 232 of 238


BUGS REPORTS<br />

Software is not software if it is release <strong>without</strong> any bug. It just goes against nature’s logic,<br />

not to mention our Mr. Murphy ☺<br />

ASTERISK RE-LOAD ISSUE<br />

After making changes to Trunks, IVR or DISA etc, the changes do not translate to the<br />

system. This is due to an inherent bug in the Asterisk binary in Trixbox 1.2.<br />

If this happens, run the following at the command prompt to force the reload:<br />

asterisk -rx restart now<br />

If the problem is related to Asterisk, this should get you going otherwise, it may be some<br />

other gremlin that has gotten into the system.<br />

ARE YOU STILL HAVING PROBLEM<br />

If you are still having problem installing Trixbox 1.2, it probably is time for you to do some<br />

manual configuration as described in Rob Thomas’ blog.<br />

Here is the link and as I have personally done it this way, I can assure you that it will<br />

solve your problem – I hope ☺<br />

http://www.freepbx.org/2006/09/28/un-Trixbox-your-Trixbox/#more-7<br />

HANGS ON SHUTDOWN<br />

Using X100P card caused Trixbox to hang on shutdown in Trixbox 2.x. This happened to<br />

me on 2 different make X100P. This does not happen with TDM400 card.<br />

To avoid this hanging anomaly amportal stop must be executed before a reboot or<br />

shutdown.<br />

The following is the hack to stop the panic from occurring:<br />

Log in as root:<br />

Go to the /etc/rc.d directory.<br />

cd /etc/rc.d<br />

Rename all of the K92zaptel files to K95zaptel so that they are invoked after the<br />

K94asterisk scripts:<br />

mv rc0.d/K92zaptel rc0.d/K95zaptel<br />

mv rc1.d/K92zaptel rc1.d/K95zaptel<br />

mv rc2.d/K92zaptel rc2.d/K95zaptel<br />

mv rc4.d/K92zaptel rc4.d/K95zaptel<br />

mv rc6.d/K92zaptel rc6.d/K95zaptel<br />

shutdown -r now<br />

The system will now shutdown or reboot <strong>without</strong> a panic.<br />

TRIXBOX-2 Without Tears Page 233 of 238


ZAPTEL NOT DETECTED ON TRIXBOX 2.2.4<br />

Trixbox 2.2.4 seems to have a problem detecting Zaptel cards e.g. TDM400 from fresh<br />

install. To remedy this problem, it may be necessary to run the following command:<br />

yum clean all<br />

yum install zaptel*<br />

ALL PHONES UNUSABLE IF INTERNET CONNECTION IS LOST.<br />

This only happens if users are using SIP Trunks. Luckyly, those using IAX trunks only<br />

are spared from this issue.<br />

Some say it is not a bug but to me if users have to make modification to get all the<br />

phones to work locally and accept PSTN calls, something is terribly wrong and therefore it<br />

is a bug and I think it is a fundamental flaw in the design of Asterisk.<br />

Asterisk is assuming that when a call is being made, the call is going to be made via a<br />

trunk IF a sip trunk is recorded and enabled. Therefore Asterisk will scan for SIP trunks<br />

availability. Once Asterisk finds a trunk it will start sip. If it does not find an available trunk<br />

it will give up and start sip then you can make a call. However if you have more than one<br />

SIP trunks, it will scan for all enabled SIP trunks until the verification times out. If you also<br />

happen to have 10 SIP trunks, all 10 will be verified first before you can even use your<br />

phones.<br />

In normal cases where internet connection is available, this will only take a couple of<br />

seconds to complete, but if internet connection is out, the verification process will take for<br />

ever till it just die away and all your extensions rendered useless.<br />

If no SIP trunk is recorded or enabled at all, then it will start sip immediately and you can<br />

make a call. This issue only appears for those using SIP trunks, especially multiple SIP<br />

trunks.<br />

This is not a major issue if you only have 1 sip trunk because when Asterisk failed on that<br />

trunk, it will give up and start sip. The only thing you notice will be a slight delay between<br />

your dialling and the other phone ringing. Normally it is just a slight irritation - nothing<br />

more.<br />

The problem starts when you have multiple SIP trunks. If you have 2 SIP trunks, the delay<br />

before Asterisk gives up is a little longer and you can still dial internal number after a long<br />

delay. In many cases the delay is enough for users to think that nothing is happening, but<br />

if you keep waiting it will dial.<br />

However if you have 3 or more trunks, the delay becomes so long for Asterisk to cycle<br />

through all your SIP trunks and the phone system becomes unusable, just gave up and<br />

dies.<br />

This is where the fundamental flaw is.<br />

Asterisk should dial the number <strong>without</strong> scanning for SIP trunk (even if you have SIP<br />

trunks) unless the number dialed is part of an outbound route that requires SIP trunk.<br />

IAX is spared this hassle why not SIP<br />

I tested this by adding 1 sip trunk then 2 sip trunks etc. The delay becomes progressively<br />

longer and longer the more sip trunks I added.... which brought me to the above<br />

conclusion.<br />

TRIXBOX-2 Without Tears Page 234 of 238


Question is; how do we get around this There is a way but it is a kludge. It works and<br />

you don’t have to fiddle with codes or create a local DNS or BIND and what not that the<br />

normal digger would not know how.<br />

This is a project you should try.<br />

Hint: Create 2 boxes. Link both boxes using SIP. Make the other box a SIP trunk of your<br />

live box. Make sure that this SIP trunk appears as the first trunk in your<br />

sip_additional.conf. Comment out externhost and exterip from sip.conf or sip_nat.conf..<br />

TRIXBOX-2 Without Tears Page 235 of 238


CHEAT SHEET<br />

amportal restart<br />

asterisk -rvvvv<br />

Disable default voicemail<br />

message<br />

Enable Call waiting by default<br />

grep "AUTO FXO" /var/log/messages<br />

/etc/init.d/ntpd stop<br />

ntpdate ntp.netspace.net.au<br />

/etc/init.d/ntpd start<br />

rpm -qa | grep asterisk<br />

rpm -qa | grep zaptel-modules<br />

service asterisk restart<br />

service network restart<br />

Set System time on system clock<br />

core show features<br />

core show translation<br />

sip reload<br />

To restart Trixbox after configuration change <strong>without</strong><br />

rebooting. However certain changes will need<br />

rebooting.<br />

To get to asterisk CLI<br />

This works in custom context e.g.<br />

• Voicemail(s2000@default) - will not play<br />

default message<br />

• Voicemail(su2000@default) - will not play<br />

default message and ins<strong>tea</strong>d play your<br />

unavailable custom message.<br />

Edit ENABLECW=yes in amportal.conf<br />

Tells you what mode your TDM400 is running on.<br />

To set the NTP time manually from the command line.<br />

Tells you what version of Aterisk is installed.<br />

Tells you what Zaptel modules you have installed<br />

To restart asterisk if required when something goes<br />

wrong<br />

To restart network service if connection goes down and<br />

did not come up again even though internet has been<br />

restored.<br />

To set the system clock under Linux, you need touse<br />

the “date” command. Example: To set the current time<br />

and date to May 12, 2007:10:15.30 seconds pm, type<br />

``date 051222152007.30' (The time,in bold, is in 24<br />

hour notation). To see what the current local time is,<br />

run “date” with no arguments.<br />

This command run on the Asterisk CLI to tell you extra<br />

featuress in use<br />

This command run on the Asterisk CLI to tell you<br />

codecs in use.<br />

To reload SIP. This command is to be run from<br />

Asterisk CLI<br />

SOME LINUX COMMANDS IN COMMON USE<br />

chown <br />

To change file ownership to the new owner<br />

TRIXBOX-2 Without Tears Page 236 of 238


BIBLIOGRAPHY<br />

The real people behind this guide (Real Names used or aliases if real names unknown): I<br />

have also made references to a number of other online publications and forums whenever<br />

I need confirmations and further clarifications. Some of the information in this document<br />

were sourced from these people and places.<br />

1 Andrew Gillis The man who started it all – The Mahaguru<br />

2 Asterisk Guru http://www.asteriskguru.com<br />

3 Brian Advise tips and tricks- Voice for Asterisk<br />

4 Bob Fryer A friend from a long way back. From the days I learned to<br />

use a PC and according to Bob, I still can’t use it.<br />

5 Colin Swan Major assistance, advice, and basically a place to go when<br />

things go wrong.<br />

6 Graham Foote Always giving me tips and corrections<br />

7 Greg Hind Advise, Tips and tricks<br />

8 Jack Zimmermann Helping me with e164<br />

9 Jeffrey Borg Advise, Tips and tricks<br />

10 lusyn.com X100P Patch for UK Caller ID http://www.lusyn.com<br />

11 Mark Brooker Another of my source for help when things go wrong<br />

12 Matt (daggo) Advise, Tips and tricks<br />

13 Neilmc Advise, Tips and tricks<br />

14 Nathan Poyner Assistance with Scripts and also proofing the documents<br />

15 Openvoice Source for Australian Voice<br />

16 Peter Quodling Testbed and resident cynic<br />

17 Rehan Help with Raid configuration.<br />

18 Rob Thomas freePBX Developer and Super Hero – <strong>without</strong> which there<br />

will be no Trixbox<br />

19 Sammy/sz Taken time to point out some of my mistakes<br />

20 Sean Mahon Solution for Billion 7402 BL<br />

21 Shaun (Ewing) Advise, Tips and tricks on codecs and dial plan etc<br />

22 Sofoklis Sflomos Changes and assistance with Raid configuration<br />

23 Stefan Keller-Tuberg Helping me out with Cron Jobs and Scripts<br />

24 SteveM Advise, Tips and tricks on Webmin<br />

25 Steven D Help with detecting some error and proofing the document<br />

26 Thunderbird1/Chippy Giving me clues to some obscure processes. It is Chippy who<br />

solved the Fax problem that has been bugging us all.<br />

27 voip-info.org A site I often refer to when I require further clarification.<br />

28 VoipShop Source for Australian voice and others<br />

29 Voxilla.com http://voxilla.com<br />

30 Ward Mundy My hero http://mundy.org my place of salvation ☺.<br />

31 The PiaF Dev Team For giving us PiaF (Thanks Ward)<br />

TRIXBOX-2 Without Tears Page 237 of 238


CHANGES MADE SINCE LAST UPDATE<br />

Included some changes due to Asterisk 1.4<br />

TRIXBOX-2 Without Tears Page 238 of 238

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!