Asterisk: Difference between revisions

From Halfface
Jump to navigation Jump to search
No edit summary
No edit summary
Line 130: Line 130:
  apache:x:48:asterisk
  apache:x:48:asterisk
  asterisk:x:492:apache
  asterisk:x:492:apache
Restart webserver to get required access.
Start asterisk
service asterisk start


Check out latest freepbx source.
Check out latest freepbx source.
Line 155: Line 159:
  tos=0x68
  tos=0x68
  useragent=phonzo rules.
  useragent=phonzo rules.
Enable access to virified user.
*/etc/amportal.conf
AUTHTYPE=database

Revision as of 08:36, 15 October 2007

823547@fwd.pulver.com
823547@iax.fwdnet.net
+882 9999 432225
+882 9900 52230
Mark Spencer at Digium.

Usefull commands.

sip show registry

sip show users

sip show peers

sip debug
sip no debug
Download source.
http://www.asterisk.org
Mailing list. Commercial , development, user.
http://list.digium.com
Wiki.
http://www.voip-info.org
Documentation project.
http://www.asteriskdocs.org
AoR Address-of-Record, a canonical address by which a user is known in SIP
e.164 International Telecominication Union standard for telefon numbers.
fxo Foreign eXchange Office (pstn)
fxs Foreign eXchange Station (phone)
ivr Interactive voice response 
moh Message On Hold
pstn public switched telephone network
proxy servers route requests to the user's current location
registrar registrations, User Agent Server handles registers
rtp Real-time Transport Protocol
sdp Session Description Protocol
tdm Time Division Multiplexing (circuit switched network)
  1. Communication overview.
Asterisk
chan_zap.so
/dev/zap
zaptel
Hardware driver wctdm
hardware
Your Woize phone number is +46754400875. Your Woize account is now fully functional
# Install dependencies.
yum -y install gcc libxml2-devel libtiff-devel mysql-server php-gd php-mysql kernel-devel kernel-smp-devel bison ncurses-devel audiofile-devel subversion libogg-devel openssl-devel mysql-devel

# Install livna repository.
rpm -i http://rpm.livna.org/livna-release-7.rpm

# Install lame
yum install lame

# Prepare source.
cd /usr/src
tar zxf /net/www/storage/temp/freepbx-2.3.0.tar.gz
svn co http://svn.digium.com/svn/asterisk/branches/1.2 asterisk
svn co http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons
svn co http://svn.digium.com/svn/asterisk-sounds/trunk asterisk-sounds
svn co http://svn.digium.com/svn/zaptel/branches/1.2 zaptel
svn co http://svn.digium.com/svn/libpri/branches/1.2 libpri

# Create ztdummy
cd /usr/src/zaptel
cp ztdummy.c ztdummy.c.orig
sed -i "s/if 0/if 1/" ztdummy.c
make
make install
make config
echo "modprobe ztdummy" >> /etc/rc.d/rc.local

# Install asterisk
cd /usr/src/asterisk
mkdir /var/run/asterisk
make install
make config 

# Create asterisk user.
useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
mkdir /var/lib/php/session/
chown asterisk /var/lib/php/session/

# Setup mysql database.
cd /usr/src/freepbx-2.3.0/
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

# Setup passwords on databases.
mysql
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
flush privileges;
\q
mysqladmin -u root password 'PGPisvery5afe'

# Install FreePBX.
cd /usr/src/asterisk-addons
cp Makefile Makefile.orig
sed -i 's/SOURCE/SOURCE -DMYSQL_LOGUNIQUEID/' Makefile
make && make install

# Backup asterisk database.
tar zcf /temp/etc_asterisk /etc/asterisk/

cd /usr/src/freepbx-2.3.0/
rpm -y install php php-pear-DB

# Error checking.
tail /var/log/asterisk/full

Asterisk/freepbx installation through rpm/svn. Use standard webserver. (not a second one run by asterisk)

Enable atrpms. Read yum wiki.

Install asterisk with dependencies.

yum install lame php php-pear php-pear-DB spandsp zaptel asterisk asterisk-addons

Enable asterisk and apache to use same config files.

chmod -R g+rwx /etc/asterisk
find /etc/asterisk -type d -exec chmod g+s {} \;

Make asterisk and apache to use the same config files. (apache belongs to asterisk group, and asterisk belongs to apache group.

  • /etc/group
apache:x:48:asterisk
asterisk:x:492:apache

Restart webserver to get required access. Start asterisk

service asterisk start

Check out latest freepbx source.

svn co http://svn.freepbx.org/freepbx/trunk /usr/src/freepbx 

Start installation of freepbx

/usr/src/freepbx/install_amp

Chose destination of freepbx. (Most likely not this directory)

/www/www-halfface/freepbx

Change destination of binaries.

/var/lib/asterisk/bin > /usr/sbin/

Give permission for group.

chmod -R g+rwx  /www/www-halfface/freepbx/
find /www/www-halfface/freepbx/ -type d -exec chmod g+s {} \;

Make operator accept asterisk. Add useragent=whatever.

; If you need to answer unauthenticated calls, you should change this
; next line to 'from-trunk', rather than 'from-sip-external'.
; You'll know this is happening if when you call in you get a message
; saying "The number you have dialed is not in service. Please check the
; number and try again."
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown
tos=0x68
useragent=phonzo rules.

Enable access to virified user.

  • /etc/amportal.conf
AUTHTYPE=database