Thursday, January 31, 2008

Asterisk Installation

I install an Asterisk PBX from source code on a newly installed Debian system.I am using Debian Etch (4.0) . login as root during the whole process in order to complete all installations properly.

upgrade the system to the latest package versions:
# apt-get update
# apt-get dist-upgrade

To make things install properly, please install the following packages:
# apt-get install acpid \
apache2 \
apache2.2-common \
apache2-mpm-prefork \
apache2-utils \
bison \
bzip2 \
doxygen \
festival \
festival-dev \
gcc \
graphviz \
gsfonts \
less \
libapache2-mod-php5 \
libcurl3 \
libcurl3-dev \
libdbd-mysql-perl \
libedit2 \
libedit-dev \
libeditline0 \
libeditline-dev \
libgcrypt11 \
libmcrypt4 \
libmcrypt-dev \
libmhash2 \
libmysqlclient15-dev \
libmysqlclient15off \
libncurses5 \
libncurses5-dev \
libnewt0.52 \
libnewt-dev \
libspeex1 \
libspeex-dev \
libssl0.9.7 \
libssl-dev \
linux-headers-2.6-686 \
linux-image-2.6-686 \
lrzsz \
make \
mc \
mcrypt \
mysql-server \
ngrep \
openssh-server \
openssl \
patch \
php5-cgi \
php5-cli \
php5-common \
php5-gd \
php5-mcrypt \
php5-mysql \
phpmyadmin \
php-pear \
tofrodos \
zlib1g-dev
Download

We now continue to download the recent sources to "/var/download" and unpack them to "/usr/src"

Compile and Install

ZapTel

The first package I have to install is zaptel. Zaptel is a collection of kernel drivers and configuration utilities for Digium hardware such as analog and digital telephony interface cards. Zaptel also offers the ztdummy kernel module which allows you to run Asterisk without any telephony hardware, it makes use of the kernel realtime clock (RTC) interface. This has to be used when using Asterisk installations with multiple concurrent calls.

LibPri

LibPri is a mandatory library, Asterisk makes use of when taking to telephony hardware or timing interfaces, even if it is the ztdummy interface.

Asterisk

This is the Asterisk software itself, I build and install it with the following commands


Asterisk-AddOns

The Asterisk-addons are needed to
- offer MySQL storage of CDRs
- enable ARA (Asterisk Realtime Architecture) to store SIP and IAX users/peers in MySQL
- enabling MP3 format in soundfiles and voicemail

Installation of Asterisk GUI

In order to install "Asterisk GUI" you'll need:
Concurrent Versions System (CVS)
asterisk 1.4 - and all modules needed to compile and install asterisk 1.4

Go to your installation directory (for example '/usr/src') and download the latest version of asterisk-gui. To do this just execute the command:
svn checkout http://svn.digium.com/svn/asterisk-gui/trunk asterisk-gui

Enter this directory and compile the sources by executing the command `make`
Then distribute the compiled code by executing the command `make install`. With this step you will finish the installation of the asterisk-gui.

Configuration

It is recommended to back up your configuration files before you continue. To achieve this just copy /etc/asterisk under different name:
cp -r /etc/asterisk /etc/asterisk.backup
It is recommended to `install samples`. This command will modify some of your Asterisk configuration files. After that you'll have finish the configuration modification manually.

There are two files which you should modify:
`manager.conf`
[general]
displaysystemname = yes
enabled = yes
webenabled = yes
port = 5038
httptimeout = 60
bindaddr = 0.0.0.0

We will have to add a new user to `manager.conf`:
[administrator]
secret = pubudu
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config


`http.conf`
enabled=yes
enablestatic=yes
bindaddr=0.0.0.0
bindport=8088

After that run `make checkconfig` in your asterisk-gui directory. This script will check if your GUI is correctly configured.

Running asterisk-gui

In order to load the asterisk-gui, asterisk must restart/reload. You can reload your Asterisk server from your CLI console by executing the command `reload`. You can use asterisk-gui from these addresses (10.100.100.75 is our Asterisk server IP address):
http://10.100.100.75:8088/asterisk/static/config/cfgbasic.html
http://10.100.100.75:8088/asterisk/static/config/cfgadvanced.html





Introduction to Asterisk

In my internship I got chance to deal with AVAYA products,which are utilized in call centers.I did some projects on AVAYA as real customer solutions.Knowledge of Avaya systems leads me to develop a soft pbx system call Asterisk.

Asterisk is an “Open Source PBX software”.Asterisk can also be used as an application server for the existing PBX or it can be directly connected to PSTN. Asterisk can do services like voicemail, fax reception, call recording, IVR connected to a database, and audio conferencing server.The main feature of the Asterisk hardware is the use of the PC CPU to process media streaming, echo cancellation and transcoding.

Signaling protocols Asterisk supports:

  • SIP
  • H323
  • IAXv1 e v2
  • MGCP
  • SCCP (Cisco Skinny)
  • Nortel unistim
Asterisk is an open source PBX that acts like a hybrid PBX, integrating technologies such as TDM and IP telephony. Asterisk is ready for IVR (Interactive Voice Response) functionality and ACD (Automatic call distribution).

NetApp active/active storage controller configuration

I have connected new disk shelf to the john keels SAN.So I learn about how to loop them and use the method multi-path storage.The controlling node was a 3050 controller.
Each of the two identical storage controllers within the active/active configuration serves data independently during normal operation, but in the event of individual storage controller failure, the data service process transfers from the failed storage controller to the surviving
partner(work also in hardware failures).

The active/active controller configuration consists of a pair of matching FAS storage controllers (local node and partner node); each of these nodes must be connected to the other’s disk shelves.The Data ONTAP and interconnect adapters on each node must be identical and configured with the same firmware version.Data ONTAP on each node monitors the availability status of its partner by means of a heartbeat signal transmitted between the storage controllers,then stores this information on specialized mailbox disks.The NVRAM data of each controller node is always mirrored on the partner node.Only half of the NVRAM in the controller is dedicated to the local node,other half reserves for the partner node’s data to ensure that exactly the same data exists in NVRAM on both storage controllers. If fail over occurs, when the surviving node takes over the failed node, all WAFL checkpoints stored in NVRAM are flushed to disk. The surviving node then combines the split NVRAM and recovers the lost performance.
Once the surviving node restores disk control and data processing to the recovered failed node, all NVRAM data belonging to the partner node is flushed to disk during the course of the giveback operation.

Active controller configuration methods

1.standard active controller
2.active controller with syncmirror
3.Metro cluster
4.Multi-path HA storage

Multi-path HA storage

The Multi path HA Storage solution significantly improves data availability and performance consistency by providing multiple redundant paths to the storage shelves.This prevents fail overs and increase bandwidth of shelves.Multipath support is provided with Data ONTAP 7.1.1, 7.2.1, and higher(FAS3050 supports but FAS270c is not).Here Primary and secondary loops must use separate Fiber Channel adapters.Storage shelves must be equipped with controller modules providing auto-termination functionality(ESH2).Also we have to set software-based disk ownership (SANOWN).
NetApp storage controllers and disk shelves are equipped with redundant power supply modules. By connecting each of the two power supplies within a device to separate power circuits or PDUs (power distribution units), devices are protected from single circuit power failures.

Thursday, January 17, 2008

Configure Squid

The main Squid configuration file is squid.conf(/etc/squid/squid.conf), and, like most Linux applications, Squid needs to be restarted for changes to the configuration file

# service squid start
# service squid stop
# service squid restart

Some basic configurations are to be done. Uncomment and edit the following lines in the configuration file found default at "/usr/local/squid/etc/squid.conf".
cache_dir this direcitve specifies the cache directory storage format and its size as given below.
cache_dir ufs /usr/local/squid/cache 100 16 256
The value 100 denotes 100MB cache size. This can be adjusted to the required size.

http_port
Check http_port, 3128 is a default.

http_access
By default http_access is denied. The ACL rules should be modified to allow access only to the trusted clients. This is important because it prevents people from stealing your network resources.

cache_effective_user & cache_effective_ group
Set these directive to the user and group by which squid will run. This user should have the permission to read and write in the cache directory and to the log files.

Each Access list(ACL) line defines a particular type of activity, such as an access time or source network, they are then linked to an http_access statement that tells Squid to deny or allow traffic that matches the ACL.
Squid matches each Web access request by checking the http_access list from top to bottom.We should not to place a deny statement in the list that blocks a similar allow statement below it.so when placing a new http_access statements better to place it above the final http_access statement.

To restrict the usage with in bussiness hours
#
acl our_network src 192.168.10.0/24
acl business_hours time M T W H F 8:30-17:00
acl RestrictedHost src 192.168.1.23

# Add this at the top of the http_access section of squid.conf
#
http_access deny RestrictedHost
http_access allow our_network business_hours

Allowing 192.168.10.0 subnet to acess

acl home_network src 192.168.10.0/255.255.255.0
http_access allow home_network

For Configuring squid for proxy

By default, squid is configured as a direct proxy . In order to cache web traffic with squid, the browser must be configured to use the squid proxy. This needs the following information

i. the proxy server's host name
ii. the port by which the proxy server accepts connections.

Air-conditioner


An air conditioner is basically a refrigerator without the insulated box.The mechanics of the Freon evaporation cycle are the same in a refrigerator as in an air conditioner.

  1. The compressor compresses cool Freon gas, causing it to become hot, high-pressure Freon gas (red in the diagram above).
  2. This hot gas runs through a set of coils so it can dissipate its heat, and it condenses into a liquid.
  3. The Freon liquid runs through an expansion valve, and in the process it evaporates to become cold, low-pressure Freon gas (light blue in the diagram above).
  4. This cold gas runs through a set of coils that allow the gas to absorb heat and cool down the air inside the building.
A window air conditioner unit implements a complete air conditioner in a small space.

Storage networking appliance

In my internship I got chance to deal closely with netapp systems.There I find interesting feature call snapshot,which is very useful to administrators to restore systems when something goes wrong.

Benefits of storage appliances


  1. Easy to administration- File systems grow automatically when new disk are added.Logical partitions can be expanded and shrunk dynamically.Can take snapshots anytime(read only view of WAFL volume).
  2. Increase performance by reducing complexity at a reasonable cost.
  3. Data availability-RAID is used to protect data against data loss occured by disk failures.Snapshot, SnapMirror, SnapRestore can used as instant recovery.
  4. development and scalability.
Storage appliance architecture

The storage appliance provides block-level data access over a Fiber Channel SAN fabric using FCP and over an IP-based Ethernet network using iSCSI. File access protocols such as NFS, CIFS, HTTP, or FTP provide file-level access over an IP-based Ethernet network.WAFL(the storage appliance's file system) and RAID were designed together to avoid the performance problems that most file systems cause with RAID.WAFL makes RAID4 operate efficiently,WAFL always writes blocks to stripes that are near each other, eliminating long seeks on the parity disk.

WAFL(Write anywhere file layout)
  1. WAFL is block based, using 4KB blocks with no fragments.
  2. WAFL uses inodes to describe its files.
  3. Directories are specially formatted files.
WAFL uses files to store meta data,which allows mata-data blocks to be written anywhere on disk.WAFL introduced a new building block known as flexible volumes.

Snapshot technology

This is a benefit of the WAFL write anywhere approach. A Snapshot copy is an online, read-only copy of the entire file system(it takes less than 1 second time).A Snapshot copy can be used as an online backup capability(to tape), allowing users to recover their own files.

(a) is a simplified diagram of the file system, with a root structure at the top pointing to disk blocks.
(b) Snapshot copy being created by duplicating the root structure.
(c) shows block C being updated, so that the file system points to new data in C' while the Snapshot copy still points to the original data in C.

Every directory in the file system contains a special subdirectory that allows users to access the Snapshot copy.And the .snapshot directories are "hidden" in the sense that they do not show up in directory listings.
At least once every 10 seconds WAFL generates an internal Snapshot copy called a consistency point.When the storage appliance boots, WAFL always uses the most recent consistency point on disk, which means that even after power loss or system failure there is no need for time consuming file system checks.And also uses battery-backed up non-volatile RAM (NVRAM) to avoid losing any data input/output requests that might have occurred after the most recent consistency point.

RAID: Redundant Array of Inexpensive Disks

The storage appliance uses either RAID Level 4, which stores all parity information on a single disk, or RAID-DP, which stores all parity information on two disks to protect against disk failures.With RAID 4,when a disk fails the parity disk is used to recalculate its contents automatically after the disk is replaced.
The parity block is basically the sum of the blocks in the stripe.
Parity=15 Data 1=4 Data 2=5 Data 3=6
The RAID system uses EXCLUSIVE-OR instead of addition and subtraction.RAID-DP can recover from double disk-failure while allowing the RAID group to continue serving data and recreate data lost from up to two failed disks.

Other RAID levels

RAID 3,uses a single parity disk and systems often keep the disk heads synchronized to reduce latency.So RAID 3 is a good fit for applications that require a very high data rate for a single large file(super-computing and graphics processing).
RAID5 is like RAID4, but it cycles parity among all of the disks in the array.The primary disadvantage is that it is not practical to add a single disk to a RAID5 array because to add new disks,a new array must be added.