PlugPBX Forums
May 19, 2012, 04:06:48 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2 3
  Print  
Author Topic: Building PlugPBX from scratch  (Read 7328 times)
mattmc97
Administrator
Full Member
*****
Posts: 144


« on: June 24, 2010, 12:25:42 PM »

I have been able to install debian squeeze on my sdcard and have worked my way through installing asterisk.


I actually have gotten all the way thru to the end of the freepbx installation.

I can start asterisk using ./start_asterisk start, but when I after I install freepbx I get...



root@debian:/usr/src/freepbx-2.7.0# amportal start


SETTING FILE PERMISSIONS
Permissions OK

STARTING ASTERISK
Asterisk ended with exit status 1
Asterisk died with code 1.
Automatically restarting Asterisk.
Asterisk ended with exit status 1
Asterisk died with code 1.
Automatically restarting Asterisk.

Here is my running install log AFTER debian squeeze install....


********************************

apt-get install update

apt-get -y dist-upgrade


apt-get install gcc

apt-get -y install debconf-utils


apt-get -y install  apache2 php5 php5-cli php-pear  php-db libapache2-mod-php5 php5-gd php5-curl libncurses5-dev


cd /var/www/

-- check php setup

vi test.php

<?php phpinfo(); ?>

/etc/init.d/apache2 restart

-- check php setup

apt-get -y install mysql-server-5.1 mysql-client php5-mysql  libmysqlclient-dev

if mysql did not ask you to set a root password then:

mysql -u root -p
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('newpass') WHERE
user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit



apt-get -y install asterisk  asterisk-dev asterisk-dbg


ITU-T telephone code: 61


cd /tmp

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2-current.tar.gz

cd /usr/src

tar zxvf /tmp/asterisk-addons-1.6.2-current.tar.gz

cd asterisk*

./configure

make menuselect

  Selections:  app_addon_sql_mysql on    cdr_addon_mysql on    [ ] chan_ooh323 off 
  • format_mp3 on     
  • res_config_mysql on

x to save and exit

 

make

make install

cd /tmp

wget http://mirror.freepbx.org/freepbx-2.7.0.tar.gz

cd /usr/src

tar zxvf /tmp/freepbx-2.7.0.tar.gz



chmod 755 /etc/init.d/asterisk
update-rc.d asterisk defaults 90 10

# configure freepbx
cd freepbx-${FREEPBX_VERSION}

# setup databases for freepbx use
mysqladmin -u root -p create asterisk
mysqladmin -u root -p create asteriskcdrdb
mysql -u root -p asterisk < SQL/newinstall.sql
mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
mysql -u root -p

enter password
       
mysql>GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "password";
mysql>GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "password";
mysql>flush privileges;
mysql>exit

# reconfigure php for freepbx
cp /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini-orig
sed -i "s/\(upload_max_filesize *= *\)\(.*\)/\120M/" /etc/php5/apache2/php.ini
sed -i "s/\(memory_limit *= *\)\(.*\)/\1100M/" /etc/php5/apache2/php.ini
sed -i "s/\(magic_quotes_gpc *= *\)\(.*\)/\1Off/" /etc/php5/apache2/php.ini

# fix up directory use and permissions for asterisk
mkdir /var/run/asterisk
chown asterisk:asterisk /var/run/asterisk
chown asterisk:asterisk -R /etc/asterisk
chown asterisk:asterisk -R /var/lib/asterisk
# chmod a+x /var/lib/asterisk/bin/*
chown asterisk:asterisk -R /var/log/asterisk
chown asterisk:asterisk -R /var/spool/asterisk
chown asterisk:asterisk -R /var/www

sed -i "s/\[directories\](!) .*/[directories]/" /etc/asterisk/asterisk.conf  **Event not found**
sed -i "s|astrundir *=> */var/run|astrundir => /var/run/asterisk|" /etc/asterisk/asterisk.conf

#fix mohmp3
mkdir /var/lib/asterisk/mohmp3
chmod 775 /var/lib/asterisk/mohmp3
chown asterisk:asterisk /var/lib/asterisk/mohmp3

# start asterisk
./start_asterisk start

# configure amportal
cp amportal.conf /etc/amportal.conf

# Username should come before password in cdr_mysql.cof - seems to cause issues, you might have to manually edit after fact and invert entry order
sed -i "s/# \(AMPDBUSER=asteriskuser\) */\1/" /etc/amportal.conf
sed -i "s/# \(AMPDBPASS=\).*/\1password/" /etc/amportal.conf
sed -i "s|\(AMPWEBROOT=\)/var/www/html|\1/var/www|" /etc/amportal.conf
sed -i "s|\(FOPWEBROOT=\)/var/www/html/panel|\1/var/www/panel|" /etc/amportal.conf
#sed -i "/#AMPWEBADDRESS=/d" /etc/amportal.conf
sed -i "s/AMPWEBADDRESS=/AMPWEBADDRESS=${IP_ADDRESS}/" /etc/amportal.conf   ///AMPWEBADDRESS=     


#Fix corrupted Pear PHP Channels and Fault Symlink present in PHP 5.9+?
install DB module    **Doesn't do anything**

# Freshen Up PHP install
apt-get -y remove php-pear   **Never had installed**
apt-get -y install php-pear

rm -rf /usr/share/php/.channels   **had to had rm -rf to remove directory **

pear update-channels


rm -f /usr/share/php/doc
ln -s /usr/share/doc/php-pear/ /usr/share/php/doc

pear install DB

cd /usr/src/freepbx-${FREEPBX_VERSION}

# install amp
./install_amp

cp /var/lib/asterisk/moh/*.wav  /var/lib/asterisk/mohmp3/  ** No wav files in moh **

# start apache web server
/etc/init.d/apache2 restart

# start amportal
amportal start

**********************

So something in the freepbx config seems to breaking asterisk. At least that is what it seems to me. Cause I can issue the original asterisk start command BEFORE installing freepbx and it asterisk will not complain. AFTER installing Freepbx, I get the error above.

Apparently, it is a very generic error, as I have not found any specific google help. I have check the /var/log/asterisk/full logs and there are a few errors but they don't seem to be related.

ERROR[20617] res_config_pgsql.c: PostgreSQL RealTime: Failed to connect database asterisk on 127.0.0.1:
ERROR[20617] res_config_ldap.c: No directory URL or host found.
ERROR[20617] codec_dahdi.c: Failed to open /dev/dahdi/transcode: No such file or directory
ERROR[20617] pbx.c: Function MAILBOX_EXISTS already registered.

I am not using Postgres, LDAP, or Dahdi card so I don't know why those would cause the start issues.

Anyone have any ideas?
Logged
PlugPBX Admin
Administrator
Sr. Member
*****
Posts: 426



« Reply #1 on: June 24, 2010, 06:27:13 PM »

Disable the modules giving you issues (set the noload parameter) for them and try again
Logged

-Greg
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #2 on: June 25, 2010, 02:30:26 PM »

Still no luck.

I tried No Loading the offending items and now the only ERROR I have is this:


ERROR[20617] pbx.c: Function MAILBOX_EXISTS already registered.

But I still get the same:

STARTING ASTERISK
Asterisk ended with exit status 1
Asterisk died with code 1.
.....loops forever


I went back to my debian image today and re-installed everything again. Exact same result.

Asterisk starts upon installation you can view it with ps aux | grep asterisk.

But as soon as I install FreePBX, it breaks and will not start ever again.

I am now trying to compare the before FreePBX and after FreePBX  /etc/asterisk/modules.conf files and determine the differences.

Admin, how is your build going?

 
Logged
PlugPBX Admin
Administrator
Sr. Member
*****
Posts: 426



« Reply #3 on: June 25, 2010, 06:45:51 PM »

Its not right now ;P

I'm still trying to get the serial console to work with newer sheevaplugs and my old setup.

You can begin to appreciate the work and struggling I had building PlugPBX1.00 now eh? Smiley

I'm on vacation all next week and busy busy right now with other things, so it's being worked on, but its going to take time Wink
Logged

-Greg
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #4 on: June 26, 2010, 10:52:14 PM »

WOOT!

Got it working!!!!!!




Greg - Have fun on your vacation and I will try and get this with webmin and sys info over the next few days. I definitely need to get someone to check this out as this is my first build on the plug AND I have no asterisk/freepbx experience.

 
Logged
PlugPBX Admin
Administrator
Sr. Member
*****
Posts: 426



« Reply #5 on: June 27, 2010, 09:40:22 AM »

Okay so to be clear, you have a working system without having to compile asterisk from source ? (using debian apt binaries?)

IF so that's fantastic!!!!

This makes building PlugPBX (or people making their own) very easy to do. Most excellent!

We'll have to document your process. I think we can even take the 'script' I posted based on others work and revise it to embody everything automatically. Cool stuff.

I love debian, can't praise it enough - being able to provide a system that users can update components via apt is a perfect way to go.
Logged

-Greg
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #6 on: June 27, 2010, 11:05:46 AM »

I installed debian using the debian installer from the link on the home page.

I installed asterisk using apt-get

I manually installed asterisk addons
 
I manually installed freebpx

I used apt-get install phpsysinfo & webmin.

I have not tried to USE the system yet, as I finally got it to work passed midnight last night, but is appears to be fine as FreePBX is up and all the freepbx links are working.

I have fully documented the process as I did it to track my changes so I could do it again later.

I am going to get a softphone working tonite and then I want to try and install it again from scratch to make sure I did figure it out and it wasn't just the full moon  Grin



Version Info:

2.6.32-5-kirkwood
Asterisk 1.6.2.6-1
asterisk-addons-1.6.2.1
freepbx-2.7.0
phpSysInfo - 3.0-rc6
webmin 1.510-2

Logged
PlugPBX Admin
Administrator
Sr. Member
*****
Posts: 426



« Reply #7 on: June 27, 2010, 04:45:38 PM »

When you are happy with the results, feel free to post here and/or post into the wiki for others as well!

I'll also likely use your steps and build a new PlugPBX thats apt based (no more compiling, yay!)
Logged

-Greg
xdm
Newbie
*
Posts: 21


« Reply #8 on: July 12, 2010, 01:54:13 PM »

mattmc97,

I am trying to follow your steps to build a working system and I'm stuck on the first step, the installation of Debian Squeeze.  I followed the instructions (linked on the main site) and I must have a newer sheevaplug cause I just get garbage characters when it boots.  I've been able to install Debian Squeeze (with the serial console fully working) using the ESIA application (and Squeeze image) but the kernel is version 2.6.33 and the repositories only seem to have old versions of asterisk and I haven't been able to figure out how to get past compile errors for dahdi.

Do you have the garbage character issue when you boot?
Logged
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #9 on: July 12, 2010, 04:41:56 PM »

No I do not have garbage when I boot the new version. Only the original PlugPBX version.

Here is the version info of my build.

Version Info:
Linux: 2.6.32-5-kirkwood
Asterisk 1.6.2.6-1
asterisk-addons-1.6.2.1
freepbx-2.7.0
phpSysInfo - 3.0-rc6
webmin 1.510-2

When I use apt-get install asterisk, this is the version that was installed. I don't know off the top of my head what the latest asterisk is, but I am not going to try and install asterisk from source. Admin was telling me it was a major pain. I went from starting from scratch to working asterisk in a few hours, then FreePBX took me another few days to start and run. I think compiling asterisk took him way longer and he knows way more than me!

What version of asterisk does apt-get install pull?

What version of asterisk are you wanting to install?
« Last Edit: July 12, 2010, 04:48:50 PM by mattmc97 » Logged
xdm
Newbie
*
Posts: 21


« Reply #10 on: July 12, 2010, 05:20:03 PM »

apt-get was installing asterisk 1.4.2 after I installed Debian Squeeze (2.6.33) from the image provided by ESIA.  asterisk 1.4.2 is fine but I need zaptel/dahdi working for the timer that is required for conferencing and music on hold and I couldn't get zaptel/dahdi to compile or install with apt-get.  Compiling dahdi and asterisk is usually really easy on a standard server.

I wonder why I am getting garbage characters and you are not.  Can we compare model numbers of our plugs?  You followed the instructions at: http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html ?

Sheeva Plug MODEL: 003-SP1001
SKU #: RD88F6281-BPLUG-A

GLOBALSCALE Technologies, Inc.

I am determined to get this working!

Logged
xdm
Newbie
*
Posts: 21


« Reply #11 on: July 12, 2010, 05:38:12 PM »

on http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html - I get garbage characters on my terminal after I run the "bootm..." command to "start the installer".  The only time I have been able to install linux and log into it via the serial console is when I installed the image of Debian Squeeze provided by and using the ESIA installer.

I'm trying to install from scratch since I had a major issue with the PlugPBX image on this site.  I get very consistent voice clipping any time I am connected to an IVR on the plug such as voicemail.  To give an example, I have one Aastra IP phone registered to it, I pickup the phone and call voicemail, I leave a message that counts 1 to 10.  I play back that message through the phone and I hear 1-2-3-4-6-7-8-10.  If I pull the voicemail file off the plug and play it on a PC, I hear 1-2-3-4-5-6-7-8-9-10.  It seems to be specifically with the playback of audio files - all other functions worked fine aside from the serial console.
Logged
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #12 on: July 12, 2010, 05:58:56 PM »

Same model and sku


I have never had garbage and I have done two partial installs (locked up when my laptop went to sleep 1/2 way thru) and two full installs with the newer debian.

Now the original plugpbx gives me garbage everytime after uncompressing linux message.

Try these uImage and uInitrd files. These were the ones I used when the installer was broken.

http://ubuntuone.com/p/9RR/

http://ubuntuone.com/p/9RS/

I would also upload them using a TFTP server as opposed to USB.

The only other issue I encountered was on booting to the SD Card, here is the correct parameters.


**NOTE ** // don't let your laptop or pc go to sleep, you have to start over! it freezes the installer.
I disabled my sleep / hibernate/ & Screensaver until install was complete

debian install takes 1-2 hours on 3mb DSL.


Correct SD Card env parameters

setenv bootargs_console console=ttyS0,115200
setenv bootargs_root root=/dev/mmcblk0p2
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0:1 0x01100000 /uInitrd; ext2load mmc 0:1 0x00800000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x00800000 0x01100000'
saveenv



Here is my printenv after debian install and after adding the lines above.

Marvell>>printenv

baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
run_diag=yes
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethaddr=00:50:43:50:02:28
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
arcNumber=2097
bootargs_console=console=ttyS0,115200
bootargs_root=root=/dev/mmcblk0p2
bootcmd_mmc=mmcinit; ext2load mmc 0:1 0x01100000 /uInitrd; ext2load mmc 0:1 0x00800000 /uImage
bootcmd=setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x00800000 0x01100000
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2

Environment size: 1394/131068 bytes
« Last Edit: July 12, 2010, 06:27:00 PM by mattmc97 » Logged
PlugPBX Admin
Administrator
Sr. Member
*****
Posts: 426



« Reply #13 on: July 13, 2010, 03:58:24 AM »

Wicked, I'm going to try these newer images with the existing PlugPBX image when I have time...might get rid of the garbage bootup.

Feel free to try this everyone. You can insert the PlugPBX SD card into a linux host or a Ubuntu Live CD booted PC and copy these files over the existing ones in the /boot directory on the SD card. Ubuntu should auto-mount everything more or less.
Logged

-Greg
mattmc97
Administrator
Full Member
*****
Posts: 144


« Reply #14 on: July 13, 2010, 05:25:07 AM »

Unfortunately changing to newer images DID NOT remove the garbage for me.

I don't know if maybe the bootloader version needs to be matched to the debian version or what.

I have searched extensively on plugcomputer forums and I only found one person with this issue and they did not explain how they fixed it.

It HAS to be figured out though, because if not, in order for new people to run a PlugPBX image, they would have to have the exact same revision as the last build. If not, they will get garbage on boot. The functionality is there, but if you lose Eth0 due to a misconfiguration, the users only choice is to reflash the image as the serial connection is useless.

I was thinking about emailing the mod of the debian squeeze linux guide and see if he has any suggestions?
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Install SimpleMachinesForum web hosting Valid XHTML 1.0! Valid CSS!