Thursday, March 09, 2006

Membuat SIP server menggunakan asterisk

Disini akan diterangkan mengenai pembuatan SIP server menggunakan Asterisk yang berbasis distro debian.

Langkah-langkah yang harus dilakukan adalah:
1)Download dan install asterisk dan zaptel

#apt-get install asterisk zaptel

2)Setelah terinstall kemudian konfigurasi file di /etc/asterisk/sip.conf untuk menentukan ip dan penamaan extension, perlu diingat sebelum mengkonfigurasi file diatas konfigurasi dulu file /etc/default/asterisk:

#vi /etc/default/asterisk

dan rubah:
RUNASTERISK=no
menjadi
RUNASTERISK=yes

#vi /etc/asterisk/sip.conf

[general]
bindport=5060 ;port dari SIP server
bindaddr=192.168.1.171 ;IP yang digunakan sebagai SIP server
srvlookup=yes
allow=ulaw
context=bogon-calls
autodomain=yes
dtmfmode=rfc2833 ;sinyal DTMF yang digunakan
localnet=192.168.1.0/255.255.255.0 ;network IP yang digunakan

[9250] ;username yang digunakan di softphone
type=friend
context=from-sip
subscribecontext=localextensions
host=dynamic
dtmfmode=rfc2833
defaultip=192.168.1.107 ;IP address default
mailbox=9250@context,9250
allow=ulaw

[9251]
type=friend
context=from-sip
subscribecontext=localextensions
host=dynamic
dtmfmode=rfc2833
defaultip=192.168.1.108
mailbox=9251@context,9251
allow=ulaw

Settingan diatas digunakan untuk 2 client yang akan saling berhubungan, jika anda ingin menambahkan user sebanyak-banyaknya anda tinggal menambahkan seperti diatas.

3)Konfigurasi file /etc/asterisk/extension.conf, untuk menentukan extension setiap client:

[general]
static=yes
writeprotect=yes

[bogon-calls]
autofalltrough=yes
clearglobalvars=no
priorityjumping=no

[from-sip]
exten => *9250,1,Dial(SIP/9250,20)
exten => 9250,2,Hangup

exten => *9251,1,Dial(SIP/9251,20)
exten => 9251,2,Hangup

exten => *9252,1,Dial(SIP/9252,20)
exten => 9252,2,Hangup

4)Setelah itu keluar dan simpan lalu restart asterisk anda:

#/etc/init.d/asterisk restart

Setelah semuanya selesai coba gunakan dari X-ten dowload dari
http://www.xten.com/index.php?menu=download.
Ok its done!!!! Untuk konfigurasi softphonenya baca aja manual booknya!!


And Dont Forget TO Always RTFM

Wednesday, March 08, 2006

Bagaimana menginstall CVS server di Centos 4.2??

ahHal yang pertama harus dilakukan adalah menginstall CVS server di komputer kita, check dengan perintah dibawah ini:

#rpm -qa grep cvs (jika sudah terinstall makan akan muncul seperti dibawah ini)
cvs-1.11.17-2
Atau apabila tampilannya kosong berarti belum terinstall.

Apabila CVS belum terinstall maka dapat diinstall dengan cara:

#rpm -ivh cvs-1.11.17-2.rpm

atau bisa juga langsung menggunakan perintah yum supaya langsung mengambil dari repository di internet.

#yum install cvs

Setelah cvs terinstall dengan sempurna buat file /etc/xinetd.d/cvspserver dan masukkan script berikut ke file berikut:

# default: off
# description: cvspserver

service cvspserver
{
id = cvspserver
socket_type = stream
protocol = tcp
user = root
wait = no
disable = no
server = /usr/bin/cvs
Port = 2401
passenv =
server_args = --allow-root=/home/cvsroot -f pserver
env = HOME=/home/cvsroot
log = /var/log/cvslog (Buat direktori /var/log/cvslog)
}

Lalu ikuti perintah berikut ini sebagai root tentunya:

#export CVSROOT=/home/cvsroot
#/usr/sbin/useradd -M cvsuser (membuat user tanpa membuat home direktori)
#groupadd cvsadmin
#mkdir $CVSROOT
#chmod -R 775 $CVSROOT
#chgrp -R cvsadmin $CVSROOT
#touch $CVSROOT/locks
#cvs init (membuat $CVSROOT/CVSROOT)
#cd /root
#cvs checkout CVSROOT

lalu edit /root/CVSROOT/config dan masukkan

# Set this to "no" if pserver shouldn't check system users/passwords
SystemAuth=no
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
TopLevelAdmin=yes



#cd
#cvs commit CVSROOT/config

Untuk memasukkan user fajar:
#htpasswd -d -c /home/cvsroot/passwd fajar

lalu kopikan file /home/cvsroot/passwd ke /home/cvsroot/CVSROOT/passwd

#cp /home/cvsroot/passwd /home/cvsroot/CVSROOT/passwd

Lalu edit file /etc/cvsroot/CVSROOT/passwd dengan bentuk seperti ini

[username]:[password terenkripsi]:[user CVS]

contoh untuk konfigurasi diatas:

fajar:1etfgfy90dft:cvsuser

Lalu edit file /home/cvsroot/cvswrappers seperti dibawah ini:

# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
*.gif -k 'b'
*.tga -k 'b'
*.bmp -k 'b'
*.psd -k 'b'
*.tif -k 'b'
*.png -k 'b'
*.iff -k 'b'
*.aiff -k 'b'
*.obj -k 'b'
*.dat -k 'b'
*.exe -k 'b'
*.com -k 'b'
*.dll -k 'b'
*.dsw -k 'b'
*.dsp -k 'b'
*.lwo -k 'b'
*.lws -k 'b'
*.p -k 'b'
*.ico -k 'b'
*.frx -k 'b'
*.class -k 'b'
*.jar -k 'b'
*.zip -k 'b'
*.lzh -k 'b'
*.lha -k 'b'
*.rar -k 'b'
*.arj -k 'b'
*.arc -k 'b'
*.avi -k 'b'
*.mov -k 'b'
*.asf -k 'b'
*.smk -k 'b'
*.jpg -k 'b'
*.mpg -k 'b'
*.swf -k 'b'
*.frx -k 'b'
*.fli -k 'b'
*.flc -k 'b'
*.tiff -k 'b'
*.bin -k 'b'
*.dat -k 'b'
*.wad -k 'b'
*.ppt -k 'b'
*.pdf -k 'b'
*.3ds -k 'b'
*.max -k 'b'


Lalu restart

#/etc/init.d/xinetd restart

lalu gunakan perintah netstat -tapn dan apakah port 2401 sudah listen???apabila sudah berarti cvs server sudah jalan dan kita tinggal mengetesnya.

gunakan perintah seperti dibawah ini:

$export CVSROOT=:pserver:fajar@yourhostname:/home/cvsroot

$cvs login

jika tidak ada gagal berarti sudah berhasil.
Untuk mencoba cvs server kita dari windows client dapat menggunakan TortoiseCVS.