相続、親が弱ってきたら銀行の預金は親の面倒を見ているものが全て解約して管理すべきである、銀行は解約させない!!

raspberry pi asterisk compile freepbx install

FreePBX
スポンサーリンク

Raspberry pi

raspberry lite を焼く

login: pi

password : raspberry

rootになるには # sudo su

# passwd root

# passwd pi

# adduser ckenko25

# localeなどを変更
# raspi-config 

# sshを有効にする
# raspi-config

# SDの容量を拡張する
# raspi-config

# apt-get update

# apt-get upgrade

# apt-get install openssh-server apache2 mysql-server mysql-client bison flex
# apt-get install php5 php5-curl php5-cli php5-mysql php-pear php5-gd curl sox
# apt-get install libncurses5-dev libssl-dev libmysqlclient-dev mpg123 libxml2-dev libnewt-dev sqlite3
# apt-get install libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev uuid uuid-dev
# apt-get install libasound2-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev
# apt-get install libspandsp-dev sudo libmyodbc subversion
reboot pear install Console_Getopt

# cd /usr/src
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
# wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.7.tar.gz

# cd /usr/src
# tar vxfz jansson.tar.gz
# rm -f jansson.tar.gz
# cd jansson-*
# autoreconf -i
# ./configure
# make
# make install

# apt-get install xmlstarlet
# cd /usr/src
# tar xvfz asterisk-13-current.tar.gz
# rm -f asterisk-13-current.tar.gz
# cd asterisk-*
# contrib/scripts/get_mp3_source.sh
# contrib/scripts/install_prereq install
# ./configure
# make menuselect
# make
# make install
# make config
# ldconfig
# update-rc.d -f asterisk remove

# useradd -m asterisk
# chown asterisk. /var/run/asterisk
# chown -R asterisk. /etc/asterisk
# chown -R asterisk. /var/{lib,log,spool}/asterisk
# chown -R asterisk. /usr/lib/asterisk
# rm -rf /var/www/html

# sed -i ‘s/\(^upload_max_filesize = \).*/\120M/’ /etc/php5/apache2/php.ini
# cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
# sed -i ‘s/^\(User\|Group\).*/\1 asterisk/’ /etc/apache2/apache2.conf
# sed -i ‘s/AllowOverride None/AllowOverride All/’ /etc/apache2/apache2.conf
# service apache2 restart

#cat /etc/odbcinst.ini

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1
 
EOF

cat >> /etc/odbc.ini << EOF
[MySQL-asteriskcdrdb]
Description=MySQL connection to 'asteriskcdrdb' database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/run/mysqld/mysqld.sock
option=3
 
EOF

cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgz
tar vxfz freepbx-13.0-latest.tgz
rm -f freepbx-13.0-latest.tgz
cd freepbx
./start_asterisk start
./install
パスワード以外はエンター

You have successfully installed FreePBX が表示される

a2enmod rewrite

vi /etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>

#DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

service apache2 restart 再起動で

vi /etc/init.d/freepbx

#!/bin/bash
### BEGIN INIT INFO
# Provides: freepbx
# Required-Start: mysql
# Required-Stop: mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start FreePBX
# Description: Start FreePBX
### END INIT INFO

AMPORTAL_BIN=/usr/sbin/amportal
AMPORTAL_DELAYED_START=/usr/sbin/amportal_delayed
MIN_START_TIME=1346787921

if [ ! -x ${AMPORTAL_BIN} ]; then
 echo "error : amportal binary can not be found (${AMPORTAL_BIN})"
 exit 0
fi


start() {
 echo "Starting FreePBX ..."
 if [ `date +%s` -lt $MIN_START_TIME ]
 then
 echo Not starting Asterisk with incorrect system time. Trying again in 10 seconds...
 sleep 10
 fi
 if [ `date +%s` -lt $MIN_START_TIME ]
 then
 echo Further delaying Asterisk start until correct system time has been obtained.
 ${AMPORTAL_DELAYED_START} &
 else
 ${AMPORTAL_BIN} start
 fi
}

stop() {
 echo "Stopping FreePBX ..."
 ${AMPORTAL_BIN} stop
}

case "$1" in
 start)
 start
 ;;

stop)
 stop
 ;;

 restart)
 stop
 start
 ;;

 status|reload|force-reload)
 echo "Error: argument '$1' not supported" >&2
 exit 3
 ;;

 *)
 echo $"Usage: $0 {start|stop|restart}"
 exit 1
esac

exit 0

chmod 755 /etc/init.d/freepbx

apt-get install chkconfig

chkconfig freepbx on

スワップファイルが少ない
service dphys-swapfile stop
vi /etc/dphys-swapfile
CONF_SWAPSIZE=1024
 service dphys-swapfile start

asterisk & freepbxの再起動

/etc/init.d/freepbx restart

または

/usr/sbin/amportal restart

FreePBXAsteriskRaspberry Pi
スポンサーリンク
シェアする
ふじやんをフォローする
スポンサーリンク

コメント