Wednesday, July 12, 2006

TrixBox v1.0 Quickie HOW-TO!


A Working How-To - Updated 9/27/2006!
Current for trixbox-update v1.0.0.8


TrixBox v1.0 was released 5/31/2006 & updated to v1.1.1 in August, 2006 for the review and testing of the Asterisk@Home community. As to be expected, Andrew has done an amazing job of making all our lives easier no matter what may crop up in TrixBox. However, as with all initial releases there is a growing list of issues to be addressed.

This short guide is simply a "how to" to side-step a couple of basic landmines in TrixBox v1.x installation and FreePBX v2.1.1 (included in TrixBox) to get the base system operational with a Digium card as we have become accustomed to with previous release of the old Asterisk@Home v2.x series.

Let's Get to It!

1) If upgrading from an older Asterisk@Home installation, run backups from AMP and manually download the compression, as well as backing up "/tftpboot" for you Cisco handset users, get your custom voice prompts, hold music, etc.

2) Install TrixBox v1.0 or v1.1 from the ISO/CD

3) Login to the command prompt


Workaround bug in CentOS that can cause echo with Digium/Zaptel hardware & causes an error in trixbox-update.sh ...

4) Type, "cd /usr/src/kernels/2.6.9-34.0.2.EL-i686/include/linux" (note the portion in the middle with the numbers may be different on your machine depending on what kind of CPU you have!)

5) Either edit your spinlock.h file by finding the line referencing "rw_lock_t" and changing it to "rwlock_t" (around line 500 in the file) or you can download a copy of the file already edited (albeit it may be older than you current install - beware!) ... wget http://www.kennonsoft.org/projects/trixbox/spinlock.h

6) cd /usr/src

Warning(s): Zaptel 1.2.8, 1.2.9 & 1.2.9.1 all seem to have a jitterbuffer launching issue that can lead to echo on Digium cards. v1.2.7 seems to be stable/proper.

7) wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.7.tar.gz

8) tar -zxvf zaptel-1.2.7.tar.gz

9) mv zaptel-1.2.7 zaptel

10) cd /usr/src/zaptel

11) make clean

11a) make linux26 (OPTIONAL step, only if echo persists if tried without it already!)

12) make install

13) modprobe wctdm

14) modprobe zaptel

15) genzaptelconf


Workaround bug in auto-detection of Digium hardware for reboots...

15) Type, "nano /etc/sysconfig/zaptel"

16) Uncomment the line that references your Digium board (e.g. remove the "#" at the "wctdm" line, also mentioned as "TDM400P") if not already uncommented!

17) Save changes & exit Nano


Continue a usual installation...

18) Type, "netconfig" and change your IP as needed

19) Type, "help-trixbox" to get a list of commands you can use

20) Run the commands listed to change your passwords as desired

21) Type, "setup-mail" if you wish to have email support for voicemail messages, etc.


Update TrixBox!

22) Type, "trixbox-update.sh update" (it will download a newer version of itself)

23) Type, "trixbox-update.sh update" (again, to run the newly downloaded version)

24) Type, "Reboot" (when it is done it will prompt you to do this)


Fix the MeetMe Conference bug that is still there as of trixbox-update v1.0.0.7 ...

25) mkdir /var/spool/asterisk/meetme

26) chown asterisk.asterisk /var/spool/asterisk/meetme

27) chmod 775 /var/spool/asterisk/meetme


Add HTTPS support if you think you may be accessing the web interface from the web...

28) Type, "yum -y install mod_ssl"

29) Type, "reboot"


Test the online web interface ...

30) With a browser go to your TrixBox IP address, then navigate to System Administration and eventually FreePBX

31) Click on the Tools section and Module Admin

32) Click on the "Connect to online repository..."

33) If it works, great! If it doesn't do the following steps (34-37) ...


If you can't connect to the online module repository, then there is an issue with your firewall more than likely (since FreePBX moved their module repository to a more reliable server recently). In the case of *** SonicWall *** firewalls with more recent firmware, the following will solve your problem!!

34) Login to your SonicWall via web browser

35) Navigate your browser to, http://xxx.xxx.xxx.xxx/diag.html (insert your firewall IP address or DNS name in the xxx.xxx.xxx.xxx)

36) Scroll down & uncheck "Enforce Host Tag Search with for CFS"

37) Click "Apply" at the top of the page, and voila!

OPTIONAL: Change default for "Call Waiting" on handsets/extensions...
By default FreePBX creates new extensions with "call waiting" disabled, meaning when you are on the phone a second call will get a busy message and get sent immediately to voicemail. If you wish the option for your handset to beep and display on your LCD the second inbound call giving you the option to answer it or ignore it, then you need to dial *70 on each handset -OR- change the default for new extensions created ...

38) Click, "System Administration" then "Config Edit"

39) Click, "/etc" at the top/middle then "amportal.conf"

40) Scroll down in the window until you find "ENABLECW=no", change it to "yes"

41) Click, "update" button at the bottom

FreePBX v2.1.1 initial config order of events to reduce confusion for the first timer ...

42) Open your web browser and point it to your TrixBox IP address

43) Click, "System Administration" then "FreePBX"

44) Click, "Tools" then "Module Admin"

45) Click, "Connect to online module repository" (gets list of latest modules from our temporary workaround file)

46a) For the full experience select everything except maybe Gabcast, Asterisk API, & VoicePulse (as you will have to have mode advanced needs to use these).

46b) For the streamlined experience select what you wish but be sure to include "core" as it is necessary, and we might recommend you choose "voicemail" as well otherwise you're callers/users are in for a surprise!


FreePBX v2.1.1 example setup to reduce confusion for the first timer (i.e. things appear/disappear based on whether they have been configured in the first place!)...

47) Click, "Setup" (get into the main web admin for FreePBX)

48) Click, "Trunks" (update & create your settings as needed, e.g. make sure you set "Max Channels" on your Zap/g0 trunk)

49) Click, "Outbound Routes" (get your dialplan set here & pointing at the correct trunks)

50) Click, "Extensions" (set them up & be sure after saving each to go back and update the "Mailbox" field on each to reference "...@default" rather than the incorrect "...@device" or your Message Waiting Indicators won't light up when voicemail is left!)

51) Click, "General Settings" (do what you wish here)

52) NOTE: If you haven't already, this is a good time to setup your handsets (e.g. for Cisco junkies, copy back or setup your TFTPBOOT folder) as the next steps involve recording prompts, etc.

53) Click, "System Recordings" (and record your Digital Receptionist, Queue, etc. prompts -- or copy backup recordings from your previous AAH install to the "/var/lib/asterisk/sounds/custom" folder)

54) Click, "Ring Groups" (and do what you need)

55) Click, "Queues" (and do what you need)

56) Click, "Digital Receptionist" (and setup your IVR prompts)

57) Click, "Time Conditions" (and create at least one if you need it)

58) Click, "Inbound Route" (and at least setup a catchall default, maybe pointing to your 'Time Condition' you created!)

59) Click, "On Hold Music" (and upload your files, or copy them by hand to the "/var/lib/asterisk/mohmp3" folder)


For those upgrading from an old Asterisk@Home v2.x installation...

60) Click, "Tools" then "Backup and Restore"

61) Create a backup job and run it once to create the disk folder (e.g. named 'Weekly' maybe but have it run "Now" then reset it after to "Weekly (on Sunday)")

62) Copy your old AAH backup file by hand to the "/var/lib/asterisk/backups/Weekly" folder, the final folder name being whatever you named your scheduled backup)

63) Click, "Restore from Backup" then "Weekly" (or whatever you called it)

64) Select your OLD backup from the list

65) When prompted DO NOT restore the "Restore Entire Backup Set" -- INSTEAD, restore just your users "Voicemail Files" and maybe "Call Detail Report" (to keep your call history and reports!)


That's it! Of course you will have to handle your handset configurations as needed. However, if you are migrating from an old AAH install to TrixBox and you backed up your handset configuration files (e.g. Cisco users need only copy/paste the "/tftpboot" directory between installations) you won't even have to touch that except to maybe reboot the handsets to ensure they properly register with the new Asterisk/TrixBox machine.

Good Luck & we would like to direct ALL HELP REQUESTS to TrixBox.org Help Forums!!

posted by Kennon Software at 9:15 AM | 29 comments


You're lifesavers.

Thanks for the effort - right on time.

posted by Anonymous Anonymous
on 6/02/2006 5:27 PM 

Thank you VERY much. Compact and clear.

posted by Anonymous Anonymous
on 6/05/2006 6:03 AM 

When I saw your post on trixbox I was hopeful it would fix my zaptel issues (I just upgraded to trix box).
rebuild_zaptel seems to work but genzaptelconf fails every time.
Asterisk doesn't start on reboot either (this is why you shouldn't do an upgrade at 9pm on Sunday...).
The failed line in /var/log/asterisk/full is
[app_trunkisavail.so]Asterisk ended with exit status 1
Asterisk died with code 1.

posted by Anonymous Anonymous
on 6/05/2006 7:34 AM 

Fixed it...
edit /etc/asterisk/modules.conf
after
autoload=yes
put
noload => app_trunkisavail.so

posted by Anonymous Anonymous
on 6/05/2006 10:26 AM 

There is a typo error in spinlock.h and will be fixed by sub 4

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=180568

posted by Anonymous diego
on 6/14/2006 12:55 PM 

This is the short list and works great:
-------------------------------
Install ISO
netconfig
service network restart
rpm -del zaptel-modules-2.6.9-34.EL
trixbox-update.sh
y
trixbox-update.sh update
shutdown -r now
cd /usr/src/kernels
ls
**** 2.6.9-34.0.1.EL-smp-i686
cd /usr/src/kernels/2.6.9-34.0.1.EL-smp-i686/include/linux
mv spinlock.h spinlock.h.old
wget http://nerdvittles.com/trixbox/spinlock.h
shutdown -r now
cd /usr/src
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.5.tar.gz
tar -zxvf zaptel-1.2.5.tar.gz
mv zaptel-1.2.5 zaptel
cd /usr/src/zaptel
make clean
make install
shutdown -r now
rebuild_zaptel
shutdown -r now
amportal stop
genzaptelconf
touch /etc/fxotune.conf
/usr/sbin/fxotune -s
shutdown -r now
yum -y install webmin
cd /var/www/html
mv index.php index-old.php (keep a backup in case you want to revert!)
wget http://www.kennonsoft.org/projects/trixbox/admin-ui-21.tgz
tar -xzf admin-ui-21.tgz
rm admin-ui-21.tgz
y
chmod 777 welcome/index.dat

posted by Anonymous Anonymous
on 6/18/2006 7:38 AM 

Thank you for posting that! We'll give it a run (might take a few days to carve out the time!) just for fun, and if a sure bet like you say we'll update our post. Thanks again.

posted by Blogger Kennon Software
on 6/19/2006 10:13 AM 

Just an FYI that you have some broken references after you have made some changes...

Step 24 continues on without telling you what file needs to be edited.

Step 28 tells you to continue with steps 42-45, which don't really go together with what it's talking about.

posted by Anonymous Mito
on 6/20/2006 7:57 AM 

Fixed, thank you for pointing those items out!

posted by Blogger Kennon Software
on 6/20/2006 9:31 AM 

Step 18 (netconfig) has to be done before step 5 (wget) will work.

posted by Anonymous Anonymous
on 6/22/2006 8:46 AM 

Thanks for the feedback, however the only instance where Step 18 may need be done before Step 5 (or any others) is if you do not have DHCP in your environment. Otherwise it really does not matter.

posted by Blogger Kennon Software
on 6/22/2006 9:02 AM 

Had a problem with step 4 in that I got a couldn't find file error? I did check the processor type so a little confused?
Tried it as per annonymous' short hand and seems to have worked through nicely.
Great site by the way, Cheers for the tips!

posted by Anonymous Anonymous
on 6/28/2006 9:08 AM 

It would be nice to have something also for the 1.1 version due to the problem posted in the official TB forum

posted by Anonymous Anonymous
on 6/28/2006 10:49 AM 

The FreePBX Online Repository fix, will this work for A@H 2.8 or only Trixbox? I am getting the same problem on A@H 2.8.

Thanks for your making Asterisk better.

posted by Anonymous Anonymous
on 6/30/2006 10:52 AM 

Thanks for the kind words.

Yes, it will work with any version of Asterisk@Home or TrixBox that uses (or has upgraded to) FreePBX.

We have been trying to keep the "workaround.xml" as current as possible (check the article header or near the instructions for an exact date) until they get a permanent fix for the intermittent issue.

posted by Blogger Kennon Software
on 6/30/2006 11:01 AM 

X100P card, no VOIP provider. Just want to do PSTN local calling only, as a start. Question: would X-lite work here? Is there a softphone that works specifically with ZAP only?

posted by Anonymous Anonymous
on 7/06/2006 11:19 AM 

Any softphone will work. Remember your extension talks to Asterisk, Asterisk talk to the PSTN.

Probably find your best answers at the www.TrixBox.org forums.

posted by Blogger Kennon Software
on 7/06/2006 11:23 AM 

Theres a new problen detected in Zapata.conf when you reboot a PBX you must edit mis_cojones.conf in line 32 replace #set_look=12 by set_look=33.

posted by Anonymous FOX
on 7/10/2006 5:55 AM 

Step 31 says:

31) If it works, great! If it doesn't do the following steps (29-32) ...

I think it should read "the following steps (32-35)".

posted by Anonymous Anonymous
on 7/10/2006 7:48 AM 

1) For the anonymous about "mis_cojones.conf", we've never heard of that file nor did you explain the issue. Would love to have more information about the issue you reference?

2) As for the incorrect line numbers correction, thanks! Fixed.

posted by Blogger Kennon Software
on 7/10/2006 8:59 AM 

Hi,
Great job. Compact and to the point.

Can you or someone address the zapata.conf and zaptel.conf changes when we have a T1 card adn a FXO card.

Thanks,
Mike

posted by Anonymous Anonymous
on 8/27/2006 10:29 PM 

For T1 cards (I assume you meant Digium?) simply modify step 13 and Step 16 to reflect the appropriate identifier for your card (they are all in the /etc/sysconfig/zaptel file for reference).

For both, simply repeat steps 13 & 16 once for each card type.

Have fun!

posted by Blogger Kennon Software
on 8/29/2006 9:59 AM 

I have just download Trixbox 1.1.0 and am trying to follow your instructions to install, update and configure it, however when I get to steps 7-12 (addressing the Trixbox Zaptel bug) I get the following error message and cannot continue...

make[3]: /usr/src/zaptel/wct4xxp/../oct612x/octasic-helper: Command not found
make[3]: /usr/src/zaptel/wct4xxp/../oct612x/octasic-helper: Command not found
CC [M] /usr/src/zaptel/wct4xxp/base.o
HOSTCC /usr/src/zaptel/wct4xxp/fw2h
/usr/src/zaptel/wct4xxp/fw2h /usr/src/zaptel/wct4xxp/OCT6114-128D.ima /usr/src/zaptel/wct4xxp/vpm450m_fw.h
make[3]: *** No rule to make target `/usr/src/zaptel/wct4xxp/../oct612x/include/oct6100api/oct6100_api.h', needed by `/usr/src/zaptel/wct4xxp/vpm450m.o'. Stop.
make[2]: *** [/usr/src/zaptel/wct4xxp] Error 2
make[1]: *** [_module_/usr/src/zaptel] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.9-34.0.1.EL-i686'
make: *** [linux26] Error 2

If I try to "make linux26" here, I get a similar error...

make[3]: /usr/src/zaptel/wct4xxp/../oct612x/octasic-helper: Command not found
make[3]: /usr/src/zaptel/wct4xxp/../oct612x/octasic-helper: Command not found
make[3]: *** No rule to make target `/usr/src/zaptel/wct4xxp/../oct612x/include/oct6100api/oct6100_api.h', needed by `/usr/src/zaptel/wct4xxp/vpm450m.o'. Stop.
make[2]: *** [/usr/src/zaptel/wct4xxp] Error 2
make[1]: *** [_module_/usr/src/zaptel] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.9-34.0.1.EL-i686'
make: *** [linux26] Error 2

Do you have any idea what I can do to address this issue? (I have a TDM400P card with 1 * FXS and 1 * FXO port.)

As an aside, the version of zaptel I am downloading is the latest - zaptel-1.2.9.tar.gz.

Thanks,
HiltonT

posted by Blogger HiltonT
on 9/11/2006 5:46 AM 

... and steps 34 - 37 (failure to download modules) needs to be worked on as this, too, fails with an error similar to that which you get if you use the original Trixbox 1.1.0 page.modules.php.

Regards,
HiltonT

posted by Blogger HiltonT
on 9/11/2006 6:56 AM 

HiltonT -

1) Your first post: Zaptel 1.2.9 has a compile bug as documented out at voip-info.org, sineapps.org, and others. Here is the current workaround (http://www.sineapps.com/news.php?rssid=1496), else use v1.2.7 as documented in the How To.

2) Your second post: a few things changed in v1.1 & v1.1.1 such that this workaround may no longer work entirely (delete page.modules.php and redownload from us again just in case). Ultimately, if you cannot connect it is something firewall or DNS related -- as this should and does work for most everyone. We have found that there is some anomaly with Sonicwall firewalls in this regard, but do not have an answer as of yet.

ksDevGuy

posted by Blogger Kennon Software
on 9/11/2006 9:56 AM 

Hi ksDevGuy,

1) I figured as much, so I ran with 1.2.7 to start with. I'll look at that link and see if I can't get 1.2.9 installed now.

2) I tried it and it definitely doesn't work. As for the firewall/DNS issue, that's not the case here as my LAN is working fine with DNS configured properly and my firewall not blocking anything (and yup, I checked the logs). The issue I see is as follows...

Say I want to update the "Voicemail" module. I check its box and click "Submit" and get the following error message:

Warning: file_get_contents(https://svn.sourceforge.net/svnroot/amportal/modules/release/voicemail-1.1.2.tgz): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/html/admin/page.modules.php on line 561

File Integrity FAILED for /var/www/html/admin/modules/_cache/voicemail-1.1.2.tgz - Aborting

So, I replace the file from your site with the original and instead, get the following error: (note the line number change in the error message)

Warning: file_get_contents(https://svn.sourceforge.net/svnroot/amportal/modules/release/voicemail-1.1.2.tgz): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/html/admin/page.modules.php on line 560

File Integrity FAILED for /var/www/html/admin/modules/_cache/voicemail-1.1.2.tgz - Aborting

Regards,
HiltonT

posted by Blogger HiltonT
on 9/11/2006 4:07 PM 

1) Sounds good.

2) Actually that is exactly the problem.

As for the solution we have been unable to find one and the case ticket at FreePBX.org seems closed as though it were addressed (orig. I think furl_open in PHP.ini entry was set to 'off' in the install scripts of FreePBX and now is to 'on' which is correct). Our experience is that all TrixBox's behind newer Sonicwall's (or maybe enhanced firmware ones?) exhibit this problem - however, directly connected or behind a different firewall they work ... without any modification whatsoever.

If you find the solution, there are a lot of TrixBox users that have been plagued with this issue -- share what you find, please!

As a hint, the failure is in the file_get_contents command in PHP. That is, most systems can ping, DNS resolve, and wget all files from the command prompt (even through the Sonicwall's) -- however the php command file_get_contents in FreePBX's code fails with the exact errors you have.

Let us know if you come up with anything! Thanks!

ksDevGuy

posted by Blogger Kennon Software
on 9/11/2006 4:27 PM 

Loaded TB 1.2 thinking spinlock, zaptel, and all the rest would of been straightened out by now. Still chronic echo problems on same hardware, phone line and X101P card, but perfect audio quality with no echo on exact same setup when I load aah 2.7, straight from the ISO. Echo still gone when updating 2.7 using yum update. Do I still need to revert back to original 1.2.5 zaptel?

posted by Anonymous Anonymous
on 9/18/2006 11:34 PM 

I've added your site to my bookmarks, nice site, Tks
http://macthink.net/antarctica/images/index.html#Rape

posted by Anonymous Anonymous
on 11/12/2006 1:50 AM 


Post a Comment