Selasa, 06 Desember 2011

Connecting Two Asterisk Boxes Together via SIP

Connecting Two Asterisk Boxes Together via SIP

There may come a time when you have a pair of Asterisk boxes, and you’d like to pass calls between them. Luckily this isn’t very difficult, although it does have some oddities that we need to deal with, but from the configuration viewpoint it isn’t really all that difficult.
Our topology will consist of a SIP phone (Alice) registered to Asterisk A (Toronto), and a separate SIP phone (Bob) registered to Asterisk B (Osaka). At the end of this section, you will be able to set up a call from Alice to Bob (and vice versa) through your pair of Asterisk boxes (see Figure 4.5, “SIP trunking topology”). This is a common scenario when you have two physical locations, such as a company with multiple offices that wants a single logical extension topology.
Figure 4.5. SIP trunking topology
SIP trunking topology
First, let’s configure our Asterisk boxes.

Configuring Our Asterisk Boxes

We have a pair of Asterisk boxes that we’re going to call Toronto and Osaka and that we’re going to have register to each other. We’re going to use the most basic sip.conf file that will work in this scenario. Just like the SIP phone configuration earlier in this chapter, it’s not necessarily the best way to do it, but it’ll work.
Here is the configuration for the Toronto box:
[general]
register => toronto:welcome@192.168.1.101/osaka

[osaka]
type=friend
secret=welcome
context=osaka_incoming
host=dynamic
disallow=all
allow=ulaw
And the configuration for the Osaka box:
[general]
register => osaka:welcome@192.168.2.202/toronto

[toronto]
type=friend
secret=welcome
context=toronto_incoming
host=dynamic
disallow=all
allow=ulaw
Many of the previous options may be familiar to you by now, but let’s take a look at them further just in case they are not.
The second line of the file tells our Asterisk box to register to the other box, with the purpose of telling the remote Asterisk box where to send calls when it wishes to send a call to our local Asterisk box. Remember how we mentioned a little oddity in the configuration? Notice that at the end of the registration line we tag on a forward slash and the username of the remote Asterisk box? What this does is tell the remote Asterisk box what digest name to use when it wants to set up a call. If you forget to add this, then when the far end tries to send you a call, you’ll see the following at your Asterisk CLI:
[Apr 22 18:52:32] WARNING[23631]: chan_sip.c:8117 check_auth: username mismatch, 
                                  have <toronto>, digest has <s>
So by adding the forward slash and username, we tell the other end what to place in the Digest username of the Proxy Authorization field in the SIP INVITE message.
The rest of the file is the authorization block we use to control the incoming and outgoing calls from the other Asterisk box. On the Toronto box, we have the [osaka] authorization block, and on the Osaka box, we have the [toronto] block. We define the type as a friend, which allows us to both receive and place calls from the other Asterisk box. The secret is the password the other system should use when authenticating. The context is where incoming calls are processed in the dialplan (extensions.conf). We set the host parameter to dynamic, which tells our Asterisk box that the other endpoint will register to us, thereby telling us what IP address to set up calls when we want to send a call to the other end. Finally, the disallow and allow parameters control the codecs we wish to use with the other end.
If you save the file and reload the SIP channel on both Asterisk boxes (sip reload from the Asterisk console), you should see something like the following, which will tell you the remote box successfully registered:

*CLI>     -- Saved useragent "Asterisk PBX" for peer toronto

You should see the status of the Host change from (Unspecified) to the IP address of the remote box when you run sip show peers:
*CLI> sip show peers
Name/username        Host            Dyn Nat ACL Port     Status               
toronto/osaka        192.168.2.202    D          5060     Unmonitored
You can verify that your own registration was successful by running sip showregistry from the Asterisk console:
*CLI> sip show registry
Host                   Username    Refresh State      Reg.Time                 
192.168.1.101:5060     osaka       105 Registered     Sun, 22 Apr 2007 19:13:20
Now that our Asterisk boxes are happy with each other, let’s configure a couple of SIP phones so we can call between the boxes.

SIP Phone Configuration

See the the section called “Configuring an FXS Channel for an Analog Telephone”” section of this chapter for more information about configuring SIP phones with Asterisk. Below is the configuration for two SIP phones in the sip.conf file for each server, which we’ll be referencing from the dialplan in the next section, thereby giving us two endpoints to call between. Append this configuration to the end of the sip.conf file on each respective server.
Toronto sip.conf:
[1000]
type=friend
host=dynamic
context=phones
Osaka sip.conf:
[1001]
type=friend
host=dynamic
context=phones
You should now have extension 1000 registered to Toronto, and extension 1001 registered to Osaka. You can verify this with the sip show peers command from the Asterisk console. Next, we’re going to configure the dialplan logic that will allow us to call between the extensions.

Configuring the Dialplan

Now we can configure a simple dialplan for each server allowing us to call between the two phones we have registered: one to Toronto, the other to Osaka. In the the section called “Working with Interface Configuration Files”” section of this chapter, we asked you to create a simple extensions.conf file. We are going to build up a dialplan based on this simple configuration. The dialplan for each server will be very similar to the other one, but for clarity we will show both. The new lines we’re adding to the file will be italicized.
Toronto extensions.conf:
[globals]

[general]
autofallthrough=yes

[default]

[incoming_calls]

[phones]
include => internal
include => remote

[internal]
exten => _2XXX,1,NoOp()
exten => _2XXX,n,Dial(SIP/${EXTEN},30)
exten => _2XXX,n,Playback(the-party-you-are-calling&is-curntly-unavail)
exten => _2XXX,n,Hangup()

[remote]
exten => _1XXX,1,NoOp()
exten => _1XXX,n,Dial(SIP/osaka/${EXTEN})
exten => _1XXX,n,Hangup()

[osaka_incoming]
include => internal
Osaka extensions.conf:
[globals]

[general]
autofallthrough=yes

[default]

[incoming_calls]

[phones]
include => internal
include => remote

[internal]
exten => _1XXX,1,NoOp()
exten => _1XXX,n,Dial(SIP/${EXTEN},30)
exten => _1XXX,n,Playback(the-party-you-are-calling&is-curntly-unavail)
exten => _1XXX,n,Hangup()

[remote]
exten => _2XXX,1,NoOp()
exten => _2XXX,n,Dial(SIP/toronto/${EXTEN})
exten => _2XXX,n,Hangup()

[toronto_incoming]
include => internal
Once you’ve configured your extensions.conf file, you can reload it from the Asterisk console with the dialplan reload command. Verify your dialplan loaded with the dialplan show command.
And that’s it! You should be able to place calls between your two Asterisk servers now.

Connecting FreeSWITCH and Asterisk using SIP

Connecting FreeSWITCH and Asterisk using SIP

With ACLs

These are the steps and how I did to connect FreeSWITCH and Asterisk.
I first tried to use auth gateways to do the job, but was VERY tedious to resolve some issues, so I decided to do it using ACLs in both ways.
Lets assume you have asterisk box using IP 2.2.2.2 and FS using IP 1.1.1.1.
You need to add a acl list to ${FREESWITCH_HOME}/conf/autoload_configs/acl.conf.xml

<list name="asterisk_box" default="deny">
  <node type="allow" cidr="2.2.2.2/32"/>
</list>

In the [settings] section of ${FREESWITCH_HOME}/conf/sip_profiles/external.xml

<param name="apply-inbound-acl" value="asterisk_box"/>

Create the exten in ${FREESWITCH_HOME}/conf/dialplan/default.xml with the pattern to call asterisk extensions

<extension name="ast_extens">
  <condition field="destination_number" expression="^(2\d{3})$">
    <action application="set" data="hangup_after_bridge=true"/>
    <action application="bridge" data="sofia/external/$1@2.2.2.2"/>
    <action application="hangup"/>
  </condition>
</extension>
In the Asterisk box on /etc/asterisk/sip.conf
[general]

...

allowguest=no

[freeswitch_1]
type=peer
host=1.1.1.1
port=5080
disallow=all
allow=ulaw
trustrpid=yes
sendrpid=yes
; if using elastix you need the following or all phones will ring when a sip call comes in
context=from-internal
In /etc/asterisk/extensions.conf
exten => _1XXX,1,Dial(SIP/freeswitch_1/${EXTEN})
exten => _1XXX,n,Hangup

exten => _2XXX,1,Dial(SIP/${EXTEN})
exten => _2XXX,n,Hangup

Using Authentication

This howto is based on FreeSWITCH Version 1.0.trunk (10906) with default configuration. We assume that booth servers have static IPs and don't need to register. To set up the trunk we are going to utilize the use case predefined in default configuration for default gateway.

FreeSWITCH Side

In vars.xml you will find 6 variables which define your default gateway:

  <X-PRE-PROCESS cmd="set" data="default_provider=HOSTNAME.DOMAIN.COM"/>
  <X-PRE-PROCESS cmd="set" data="default_provider_username=USER_NAME"/>
  <X-PRE-PROCESS cmd="set" data="default_provider_password=BOOTH_WAY_PASSWORD"/>
  <X-PRE-PROCESS cmd="set" data="default_provider_from_domain=HOSTNAME.DOMAIN.COM"/>
  <X-PRE-PROCESS cmd="set" data="default_provider_register=false"/>
  <X-PRE-PROCESS cmd="set" data="default_provider_contact=5000"/>

Note: default_provider_password is used to authenticate calls from and to Asterisk and HOSTNAME.DOMAIN.COM is the DNS name of Asterisk server.

Those variables are used in two configuration files:
  1. directory/default/example.com.xml which describes:
    • the user for authentication of calls coming from Asterisk to FreeSWITCH. The ID on this user will be the same as value of variable default_provider.
    • the gateway for authentication of calls outgoing from FreeSWITCH to Asterisk. The ID of this gateway will be the same as ID of the user.
  2. dialplan/default//01_example.com.xml which contains routes utilizing the gateway. Probably you should customize expression parameter of <condition field="destination_number" ... > to your needs. Only calls to destination number matching expression will go through the gateway.
Before going further, you should look into dialplan/public.xml, this is the file where you'll need to create a rule to route incoming calls in public to default. If the call reach FS console but it doesn't go further, look again at this file, you might have an error. I've include an example to route incoming calls to extension 6969 to default dialplan!

    <extension name="public_extensions">
      <condition field="destination_number" expression="^(6969)$">
        <action application="transfer" data="$1 XML default"/>
      </condition>
    </extension>

After setting variables and tuning routes(see above) type on FS console sofia profile restart all reloadxml to activate changes.

Asterisk Side

You have to define sip peer and dialplan extension.
In sip.conf add:

[freeswitch]
type=peer
host=IP_ADDRESS_OF_FREESWITCH_SERVER
username=HOSTNAME.DOMAIN.COM
port=5080
fromdomain=IP_ADDRESS_OF_FREESWITCH_SERVER
secret=BOOTH_WAY_PASSWORD

In extensions.conf, probably in your internal context, add:

exten => _1XXX,1,Dial(SIP/${EXTEN}@freeswitch)

So you will be able to call to default phones (1000-1019) configured on FS.

One Asterisk console type: sip reload and extensions reload to activate changes.

The Easy Way

Assume 10.1.1.1 is FreeSWITCH with extensions of 1000-1019 and 10.1.1.2 is Asterisk with extensions in the range 2000-2019.

FreeSWITCH Side

We need to route calls made on freeswitch to the 2000-2019 extensions to the asterisk box, we'll use our external sip profile for this but internal should work, as well.
Create $FREESWITCH_HOME/conf/dialplan/default/00_asterisk_extensions.xml:

<extension name="to_asterisk">
  <condition field="destination_number" expression="^(20[01]\d)$">
    <action application="set" data="hangup_after_bridge=true"/>
    <action application="bridge" data="sofia/external/$1@10.1.1.2"/>
  </condition>
</extension>

Now we have to handle calls coming from asterisk, which by default hit the 'public' dialplan. 

Create $FREESWITCH_HOME/conf/dialplan/public/00_from_asterisk.xml:
<extension name="from_asterisk">
  <condition field="network_addr" expression="10.1.1.2" />
  <condition field="destination_number" expression="^(10[01]\d)$">
    <action application="transfer" data="$1 XML default" />
  </condition>
</extension>

Asterisk Side

We'll make freeswitch a peer in asterisk Add an entry in /etc/asterisk/sip.conf:

[freeswitch_1]
type=peer
host=10.1.1.1
port=5080
deny=0.0.0.0/0.0.0.0
permit=10.1.1.1/255.255.255.255
jbenable=no
disallow=all
allow=ulaw   
trustrpid=yes
sendrpid=yes
; if using elastix you need the following or all phones will ring when a sip call comes in, in general set this a context where your internal extensions are included
context=from-internal
And route calls to the appropriate place based on the extension In /etc/asterisk/extensions.conf:
exten => _10XX,1,Dial(SIP/freeswitch_1/${EXTEN})
exten => _10XX,n,Hangup

exten => _20XX,1,Dial(SIP/${EXTEN})
exten => _20XX,n,Hangup

You should now be able to make calls from the 1000s on FreeSWITCH to 
the 2000s on asterisk, and vice-versa.  If that's all you wanted/needed 
to do between them, you're Done!

A little more advanced

Instead of routing the calls to freeswitch's public dialplan from asterisk and having to create an appropriate transfer to the default XML dialplan, you could instead allow asterisk calls to directly hit the default XML dialplan on freeswitch. There are a few ways to do this, in this case we're just going to make the internal sip profile on freeswitch use the default context instead of the public context, then set an acl to allow asterisk to use that internal sip profile without authenticating.
First the ACL,
Edit $FREESWITCH_HOME/conf/autoload_configs/acl.conf.xml, adding:

<list name="asterisks" default="deny">
  <node type="allow" cidr="10.1.1.2/32"/>
</list>

Now, to apply it, In the [settings] section of $FREESWITCH_HOME/conf/sip_profiles/internal.xml, add:
 
<param name="apply-inbound-acl" value="asterisks"/>

Also in $FREESWITCH_HOME/conf/sip_profiles/internal.xml, edit the context to make it default:

<param name="context" value="default"/>

Now you can remove the public/00_from_asterisk.xml file and change 
the port from 5080 to 5060 in asterisk's sip.conf and you should be able
 to call any freeswitch extension that you set a route for in asterisk.

Kamis, 01 Desember 2011

INSTALLASI VYATTA ROUTER OPENSOURCE

Vyatta Quick Setup

This is a quick guide setup guide for the Vyatta open source router. This article assumes that you have already installed Vyatta either on physical hardware or in a virtual machine. For more information on creating a private network in ESXi Server see this article.

Vyatta can be downloaded from http://www.vyatta.org

Version 6.3 has a new LiveCD installer so there is a little work to get it going.

I used the VI Client to create a new VM. Select File, then New Virtual Machine.

Choose the following Settings:

    Configuration: Custom
    Name: "MyVyatta" Note: This name is whatever you want it to be.
    Datastore: Choose the datsstore you wish Vyatta to install on.
    Virtual Machine Version: 7
    Guest OS: Linux/Other 2.6x Linux
    CPU: "1"
    Memory: "512"
    Network: "2" / vmxnet3
    SCSI Controller: keep the defaults
    Select a Disk: keep the default
    Create a Disk: "4"GB then select thin provisioning

 Select the box to customize the configuration prior to completing the VM creation and do the following:

    Click CD/DVD Drive 1
    Select "Connect at power on"
    Select Device Type: "Datastore ISO File"
    Click "Browse..." and choose the LiveCD ISO file that you got from Vyatta.org


Start the new VM.
When it boots to the login prompt, login with a user and a password of "vyatta"
Now its time to install. Do this type


    #install-image

Choose all of the defaults and when the install is complete type


    #shutdown

Once it's shutdown, go back to the VI Client and select the Vyatta VM. Go to Edit Setting and do the following.

    Click CD/DVD Drive 1
    Unselect "Connect at power on"
    Select Device Type: "Client Device"

Start the Vyatta VM and once it powers up, log back in. 

Once you are logged into the Vyatta console you need to enter configuration mode, this is done by typing “configure” in the console.

    #configure



 Next use the show interfaces command to see the network configuration of your Vyatta router.

By using the MAC address of your network card you should be able to match your network card to the correct Vyatta ethernet interface.

You must set the IP address range for the Private Network in Vyatta. Because my private network is on eth1 I will use the following command to give it a static IP address.

    #set interfaces ethernet eth1 address 192.168.1.1/24

Then commit the IP address by using the commit command

    #commit

If you have a PC with a statically assigned IP address on the private network, you can test if the IP address took by pinging the IP address of your router inside of a virtual machine on the private network, if not, just continue.

Give the router a hostname and domain name by entering the following commands

    #set system host-name <your-router-name>
    #set system domain-name <your.domain.name>

 Set up the Timzone by typing

    #set system time-zone <your-time-zone>


Hit the tab key for timezone options.

    #commit

Now we setup external interface to gets its address from a DHCP server. Please note, if you need PPPOE for your internet provider you will need to take other steps. My internet provider uses DHCP so I don't have the ability to test any other configuration

    #set interfaces ethernet eth0 address dhcp

Now that the hostname, domain name, and IP information is set, its time to configure the private network to have a DHCP server.
The process below enables the DHCP server for the 192.168.1.0/24 network. It will distribute IP addresses at 50 and stop at 100. I also setup the outside DNS server and the default router for the DHCP server to give to clients.

This command names the network PRIVATE and sets the DHCP address range to start at 192.168.1.50

    #set service dhcp-server shared-network-name PRIVATE subnet 192.168.1.0/24 start 192.168.1.50

Now we tell the DHCP server to stop handing out addresses at 100

    #set service dhcp-server shared-network-name Home subnet 192.168.10.0/24 start 192.168.1.50 stop 192.168.1.100

Now setup the DNS and Default gateway. I use OpenDNS for my all of my DNS needs, it's free and allows for content filtering.

    #set service dhcp-server shared-network-name PRIVATE subnet 192.168.1.0/24 dns-server 208.67.222.222
    #set service dhcp-server shared-network-name PRIVATE subnet 192.168.1.0/24 dns-server 208.67.222.222
    #set service dhcp-server shared-network-name PRIVATE subnet 192.168.1.0/24 default-router 192.168.1.1

The last step to setup connectivity for the private network is to setup NAT. NAT will allow you to connect to the internet from any device on the private network.

    #Set service nat rule 10 type masquerade
    #Set service nat rule 10 source address 192.168.1.0/24
    #Set service nat rule 10 outbound-interface eth0
    #commit
    #save
    #exit

Once you have added NAT, check to see if your private network PC can access the internet. At this point, there should be full access from the private network to anywhere on your network.

INSTALLASI VSFTPD PADA CENTOS SERVER 5.3

Ya udahlah tanpa basa-basi dan banyak cincong ,nih berikut settingan konfigurasi pada saat saya menginstall ftp server pada server saya , cekidot :
1. Langkah pertama Instalasi Paket vsftpd nya terlebih dahulu dengan menggunakan perintah yum
[root@my-centos]# yum install vsftpd
2. Lalu Konfigurasi file vsftpd.conf nya
[root@my-centos]# vim /etc/vsftpd/vsftpd.conf
Yang perlu dirubah adalah:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to FTP Server K-Place.
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

3. Kemudian buat user lokal dengan nama ozotmacho
[root@my-centos]# adduser rivkhi
[root@my-centos]# passwd rivkhi
Changing password for user rivkhi.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
4. Membuat file chroot_list
File ini berisi daftar user yang bisa mengakses FTP server.
[root@my-centos]# vim /etc/vsftpd/chroot_list
Isinya adalah :
rivkhi
5. Restart Service FTP
[root@my-centos]# service vsftpd restart
[root@my-centos]# chkconfig vsftpd on
6. Cek konfigurasi FTP
[root@my-centos]# getsebool -a | grep ftp
nah dibagian ini saya mendapatkan status : getsebool: SELinux is disabled
maka untuk mengatasi hal tersebut saya edit file :
[root@my-centos]# vi /etc/selinux/config
dimana sebelumnya filenya :
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – SELinux is fully disabled.
SELINUX=disable
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection.
SELINUXTYPE=targeted
saya edit menjadi :
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – SELinux is fully disabled.
SELINUX=permisive
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection.
SELINUXTYPE=targeted

lalu aku reboot komputernya. Setelah komputer di reboot aku jalan kembali command :
[root@my-centos]# getsebool -a | grep ftp
allow_ftpd_anon_write –> off
allow_ftpd_full_access –> off
allow_ftpd_use_cifs –> off
allow_ftpd_use_nfs –> off
allow_tftp_anon_write –> off
ftp_home_dir –> on
ftpd_disable_trans –> off
ftpd_is_daemon –> on
httpd_enable_ftp_server –> off
tftpd_disable_trans –> off

apabila ftp_home_dir masih berstatus off, maka jalankan perintah :
[root@lmy-centos]# setsebool -P ftp_home_dir on
[root@my-centos]# iptables –F
 [root@bluebox ~]# setsebool -P allow_ftpd_full_access on
Sekian dulu dah postingan dari saya, soalnya mata udah berat banget mau di shutdown dulu

INSTALLASI FREESWITCH PADA UBUNTU SERVER 11.04

FreeSwitch merupakan open source lintas-platform skalalabel platform telepon yang dirancang untuk rute dan interkoneksi protokol komunikasi yang populer menggunakan audio, video, teks atau bentuk media lainnya.

CARA MENGINSTALL FREESWITCH DI LINUX UBUNTU SERVER 11.04

1.    Persyaratan
Prasyarat ini wajib menyediakan untuk mengkompilasi instalasi standar FreeSWITCH dan menguji konfigurasi yang disertakan dan IVR sampel. Berikut syarat-syarat package yang harus terinstal agar proses kompilasi berjalan dengan baik :
a.    GIT atau WGET
b.    AUTOCONF
c.    AUTOMAKE
d.    GCC-C ++
e.    LIBJPEG-DEVEL
f.    LIBTOOL
g.    MAKE
h.    NCURSES-DEVEL
Lalu ketikkan di terminal ubuntu : #sudo apt-get install git-core build-essential autoconf automake libtool libncurses5 libncurses5-dev make libjpeg-dev
Ada modul opsional yang dapat di bangun dan jika demikian mungkin memerlukan satu atau lebih hal berikut :
a.    Curl-devel
b.    Expat-devel
c.    GnuTLS
d.    Libtiff
e.    Libx11-devel
f.    ODBC or UNIX-ODBC and ODBC-devel
g.    Open SSL
h.    Python-devel
i.    ZLIB and ZLIB-devel
j.    Libzrtp
Lalu ketikkan lagi di terminal : #sudo apt-get install libcurl4-openssl-dev libexpat1-dev libgnutls-dev libtiff4-dev libx11-dev unixodbc-dev libssl-dev python2.6-dev \
zlib1g-dev libzrtpcpp-dev libasound2-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev libdb-dev python-dev \
uuid-dev

2.    INSTALASI FREESWITCH
a.    Masuk ke : #cd /usr/local/src
a.    Lalu kita bisa memilih proses download melalui Git atau Wget. Bila mau mendownload melalui Git ketik : #git clone git://git.freeswitch.org/freeswitch.git setelah itu ketik : #cd freeswitch lalu ketik lagi : #./bootstrap.sh
Bila mau mendownload melalui Wget ketik : #wget http://files.freeswitch.org/freeswitch-1.0.6.tar.gz . setelah itu ekstrak file dengan perintah : #tar xvfz freeswitch-1.0.6.tar.gz Lalu kita konfigurasi file freeswitch dengan perintah : #./configure
b.    Setelah kita mendownload dan mengekstrak, lalu edit file modules.conf terlebih dahulu dan menghilangkan tanda “#” di kata kunci “flite” setelah itu save.
c.    Sehabis kita mengedit file modules.conf, lakukan perintah #./configure lalu #make setelah itu #make install untuk proses pendownloadan menggunakan Git. Untuk yang menggunakan pendownloadan Wget langsung dengan perintah #make dan #make install
d.    Lalu kompilasi dan install sound dengan perintah : #make all cd-sounds-install cd-moh-install
e.    Setelah itu jalankan service freeswitch dengan perintah : #/usr/local/freeswitch/bin/freeswitch
f.    Instalasi sudah selesai. Tinggal mengedit di bagian extension dan SIP Phone nya.




KONFIGURASI FREESWITCH
Membuat start up Freeswitch
Menambahkan user dan group, dan mengubah hak akses yang diperlukan:

adduser freeswitch
addgroup freeswitch
chown -R freeswitch:freeswitch /usr/local/freeswitch   
Kemudian membuat file / etc / init.d / freeswitch dengan script berikut:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          skeleton
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Description:       Freeswitch debian init script.
# Author: Matthew Williams
#
### END INIT INFO
# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC="Freeswitch"
NAME=freeswitch
DAEMON=/usr/local/freeswitch/bin/$NAME
DAEMON_ARGS="-nc"
PIDFILE=/usr/local/freeswitch/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

FS_USER=freeswitch
FS_GROUP=freeswitch

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that sets ulimit values for the daemon
#
do_setlimits() {
        ulimit -c unlimited
        ulimit -d unlimited
        ulimit -f unlimited
        ulimit -i unlimited
        ulimit -n 999999
        ulimit -q unlimited
        ulimit -u unlimited
        ulimit -v unlimited
        ulimit -x unlimited
        ulimit -s 240
        ulimit -l unlimited
        return 0
}

#
# Function that starts the daemon/service
#
do_start()
{
    # Set user to run as
        if [ $FS_USER ] ; then
      DAEMON_ARGS="`echo $DAEMON_ARGS` -u $FS_USER"
        fi
    # Set group to run as
        if [ $FS_GROUP ] ; then
          DAEMON_ARGS="`echo $DAEMON_ARGS` -g $FS_GROUP"
        fi

        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null -- \
                || return 1
        do_setlimits
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                $DAEMON_ARGS \
                || return 2
        # Add code here, if necessary, that waits for the process to be ready
        # to handle requests from services started subsequently which depend
        # on this one.  As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2
        # Wait for children to finish too if this is a daemon that forks
        # and if the daemon is only ever run from this initscript.
        # If the above conditions are not satisfied then add some other code
        # that waits for the process to drop all resources that could be
        # needed by services started subsequently.  A last resort is to
        # sleep for some time.
        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
        [ "$?" = 2 ] && return 2
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
        return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
        #
        # If the daemon can reload its configuration without
        # restarting (for example, when it is sent a SIGHUP),
        # then implement that here.
        #
        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
        return 0
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  #reload|force-reload)
        #
        # If do_reload() is not implemented then leave this commented out
        # and leave 'force-reload' as an alias for 'restart'.
        #
        #log_daemon_msg "Reloading $DESC" "$NAME"
        #do_reload
        #log_end_msg $?
        #;;
  restart|force-reload)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac
   

Kemudian jangan lupa untuk melakukan perintah berikut:

chmod +x /etc/init.d/freeswitch
update-rc.d freeswitch defaults   
Setelah selesei restart untuk menguji start up.


Menambah extension
Untuk menambahkan ekstensi baru, salin 1000.xml Anda ke file dengan nomor ekstensi dengan nama selain "1000". Contoh: Jadi jika Anda ingin menambahkan ekstensi 8989 dengan password 2424, Anda harus melakukan perintah sebagai berikut:

cd /usr/local/freeswitch/conf/directory/default
cp 1000.xml 8989.xml
nano 8989.xml      
<include>
  <user id="8989" mailbox="8989">
    <params>
      <param name="password" value="2424"/>
      <param name="vm-password" value="1000"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="8989"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Extension 8989"/>
      <variable name="effective_caller_id_number" value="8989"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
      <variable name="callgroup" value="techsupport"/>
    </variables>
  </user>
</include>
   

Installasi web based (bluebox)
Install paket untuk bluebox :
#apt-get install mysql-server
#apt-get install apache2
#apt-get install php5
Sekarang kita perlu mendownload software bluebox dan kemudian menjalankannya :
#cd /var/www  (pindah direktori ke web root)
#wget http://www.bluebox.co.za/?download&global[option]=quick_setup (download bluebox)
#cd .. (kembali ke direktori sebelumnya)
#chmod -R 777 www (mengatur direktori untuk bias akses Read & Write)
Buka web browser dan browse ke alamat IP dari server (contoh: http://192.168.0.1/setup.php). Kemudian akan meminta untuk mengkonfirmasi download bluebox. Selanjutnya ikuti petunjuknya.
Isi di host mysql pengguna rincian Server DatabaseName "bluebox", User Name "root", Password "bluebox", Host “localhost”, Port “3306”, Type (dirver) “mysql”.
Setelah itu membuat account untuk akses bluebox.
Kemudian pilih klik update “Config File”
Database baru sekarang dibuat. Kemudian situs ini akan mengarahkan kembali ke homepage(http://192.168.0.1/bluebox) dan sistem web base bluebox siap untuk digunakan.

Reset Password Webmin

Gara-gara update dari centos 5 ke 5.3 eh malah webmin ngga mau dibuka. Akhirnya harus reset password nya.  Pertama2 masuk ke serverk menggunakan user root. Selanjutnya, jika menggunakan distro redhat (Centos, Fedora, Gentoo) maka lakukan perintah sebagai berikut :

#/usr/src/libexec/webmin/changepass.pl /etc/webmin username password
Jika menggunakan distro debian, perintahnya sbb:

#/usr/share/webmin/changepass.pl /etc/webmin username password
Selanjutnya silahkan login dengan username dan password yang sudah di reset.