2008年4月25日 星期五

LEXIS30 + Asterisk

Target:
Receive incoming Skype call and transfer to a sip extension
Make outbound call to PSTN/cell phone/normal skype from sip extension



1.E1 card configuration

LEXIS30 side:
/etc/zaptel.conf
--------------------------------------------------------
###### E1 NETWORK side setting sample BEGIN
span=1,0,0,ccs,hdb3,crc4
bchan=1-15,17-31
dchan=16
###### E1 NETWORK side setting sample END
--------------------------------------------------------


/etc/asterisk/zapata.conf
--------------------------------------------------------
;;; E1 NETWORK SIDE setting sample BEGIN
context=frome1
group=1
signalling=pri_net
switchtype=euroisdn
channel=1-15,17-31
;;; E1 NETWORK SIDE setting sample END
--------------------------------------------------------

Asterisk side:
/etc/zaptel.conf
--------------------------------------------------------
###### E1 CPE side setting sample BEGIN
span=1,1,0,ccs,hdb3,crc4
bchan=1-15,17-31
dchan=16
###### E1 CPE side setting sample END
--------------------------------------------------------


/etc/asterisk/zapata.conf
--------------------------------------------------------
;;; E1 CPE SIDE setting sample BEGIN
context=frome1
group=1
signalling=pri_cpe
switchtype=euroisdn
channel=>1-15,17-31
;;; E1 CPE SIDE setting sample END
--------------------------------------------------------


After Step 1, reboot both machnies , the light status should be blinking orange.
Connect E1 cable , both light should be GREEN

2. Configure Asterisk

Asterisk side:
/etc/asterisk/sip.conf
--------------------------------------------------------
[101]
type=friend
username=101
secret=101
context=frome1
host=dynamic
nat=yes
dtmfmode = rfc2833
disallow=all
allow=gsm
allow=ulaw
allow=alaw
--------------------------------------------------------

/etc/asterisk/extensions.conf
--------------------------------------------------------
[frome1]
exten=>s,1,Answer()
exten=>s,n,Background(vm-enter-num-to-call)
exten=>s,n,waitExten
exten=>s,n,Hangup

exten => _X.,1,Dial(SIP/${EXTEN})
exten => _9X.,1,Dial(Zap/g1/${EXTEN:1})
--------------------------------------------------------
note:under this configuration, when dialing 9XX from sip phone, it will dial XX in LEXIS30's phone book.


After these setting above, you are now able to receive incoming Skype call and make outbound call.

Test scenario
  1. Use a regular Skype (e.g.sarosa68) to call company ID of LEXIS30(e.g.sarosatest01), after hearing greeting, dial the sip extension no(e.g.101).The sip phone side will ring.
  2. Set an speed dial key on LEXIS30(e.g.10=>tpae01).On sip phone side, dial "910", it will call to tpae01 though LEXIS30

2008年4月17日 星期四

Nessus 3.0 (弱點掃描) Installation

1. Nessus plugin update through on-line update
1.1 automatic update throught install process

or

2. Nessus plugin update through off-line update
2.1 http://www.nessus.org/download/
2.2 http://www.nessus.org/register/
2.3 https://plugins.nessus.org/offline.php
2.4 nessus-fetch.rc. -> C:\Program Files\Tenable\Nessus\config
2.5 Up-to-date Plugins -> C:\Program Files\Tenable\Nessus\plugins\scripts
2.6 Run build.exe -> C:\Program Files\Tenable\Nessus\build.exe

3. Run Nessus Server Configuration.exe after install first
3.1 create Nessus client -> user management

4. Run Nessus client.exe
4.1 click connect with user acount
4.2 start scan

5. scan policy
5.1 default scan policy
5.2 Microsoft Patches

2008年4月16日 星期三

How to set-up autocall by using LEXIS30

1. Install LEXIS30


2. Add a new context named "testnewout" in /etc/asterisk/extensions.conf


[testnewout]
exten=>_X.,1,Wait(2)
exten=>_X.,n,SendDtmf(9)
;exten=>_X.,n,Wait(1)
exten=>_X.,n,SendDtmf(9)
;exten=>_X.,n,Wait(1)
;exten=>_X.,n,SendDtmf(9)
;exten=>_X.,n,Wait(1)
exten=>_X.,n,SendDtmf(1)
exten=>_X.,n,Wait(12)
exten=>_X.,n,NoOp(${EXTEN})
exten=>_X.,n(play),Playback(demo-moreinfo)
exten=>_X.,n,Goto(${EXTEN},play)
exten=>_X.,n,Hangup()

3. Create a folder named "autocall" under root dircetory

4. Cerate a file named "test.c" in autocall folder(Download Here)

5. Compile test.c by typing "gcc test.c -o testapp"

6. Execute ths program by typing "sudo ./testapp M N SkypeID X"

  • M means how many times the program will execute,if you type 2, it will call the SkypeID twice
  • N means how many calls will setup, if you type 5, it will setup 5 calls at the same time
  • SkypeID is the first account on LEXIS30
  • X is the fourth argument,If there is a X,after call connection it will send DTMF"991" and wait for 12 sec,than play a 10 seconds voice file looply.If there is not a X,after call connection it will play a 2 min voice file than hang up.


How to use SIPp--an example
如何使用SIPp

在做SIP測試的人都一定知道SIPp這套自動撥打工具,此工具由HP內部工程師所撰寫,就一般使用者而言,這套工具算是黃金級的測試工具,因為免費又好用!

原始網站連結: http://sipp.sourceforge.net/

以下我們以Debian 4.0 (RC3)這個作業系統做為安裝的平台

安裝前準備工作:
在開始安裝SIPp前,如果是全新安裝Debian,則必需在Linux中把以下套件安裝上去

1. C++ Compiler
2. curses or ncurses library
3. For authentication and TLS support: OpenSSL >= 0.9.8
4. For pcap play support: libpcap and libnet For distributed pauses: Gnu Scientific Libraries

其中第3點的OpenSSL尤其重要,請務必到OpenSSL網站Download OpenSSL 0.98版本,此處以0.98g做為說明,在安裝OpenSSL時請使用俱備root權力的帳號安裝OpenSSL OpenSLL

Download OpenSLL網站
http://www.openssl.org/source/
http://www.openssl.org/source/openssl-0.9.8g.tar.gz

Download SIPp
http://sourceforge.net/project/showfiles.php?group_id=104305
此處所使用的版本是用3.0版本 sipp-3.0.src.tar.gz

Install SIPp SIPp網站提供四種方式的安裝,個別的差異請自行到SIPp網站查閱,此處以第四種方式安裝

Without TLS (Transport Layer Security) and authentication support:
This is the recommended setup if you don't need to handle SIP authentication and/or TLS. In this case, there are no depencies to install before building SIPp. It is straight forward:

# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make

With TLS and authentication support, you must have installed OpenSSL library (>=0.9.8) (which may come with your system). Building SIPp consist only in adding the "ossl" option to the make command:

# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make ossl

With PCAP play and without authentication support:

# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make pcapplay

With PCAP play and authentication support: (此處使用的方式)

# gunzip sipp-xxx.tar.gz
# tar -xvf sipp-xxx.tar
# cd sipp
# make pcapplay_ossl


撰寫XML SIPp能夠運作一定要有一個簡單的xml腳本再搭配它的指令才能運作,而一般的情形是需要另一個*.csv檔案更能發揮其作用

我們提供一個簡單的腳本
請由此處Download.....uac-callpersec.xml (file name: uac-callpersec.xml)

腳本描述
Caller(A)       SIP Proxy
192.168.1.86     192.168.1.2
(local_IP)      (remote_IP)
     INVITE-->  
     407<------      ACK------>
     INVITE-->
     100<------      180<------      200<------      ACK------>
     Pause[5000ms]
     Send DTMF "3"
     Pause[1000ms]
     Send DTMF "2"
     Pause[1000ms]
     Send DTMF "5"
     Pause[5000ms]
     ACK------>
     200<------ 執行方式:
1. 請以root身份進入終端機
2. 進入SIPp所在的folder
3. Copy uac-callpersec.xml到SIPp所在的folder
4. Download peer_list.csv file (file name:peer_list.csv)
5. Copy peer_list.csv到SIPp所在的foler
6. 輸入下列指令

./sipp 192.168.1.2 -sf uac-callpersec.xml -i 192.168.1.86 -inf peer_list.csv -l 5

./sipp:是執行sipp的指令
192.168.1.2:是相對應在uac-callpersec.xml中的 remote_ip參數

-sf :當執行時需要讀入一個 xml檔案時,則需要下這個參數
-i 192.168.1.86 :是相對應在uac-callpersec.xml中的 local_ip參數
-inf :是相對應在uac-callpersec.xml中的[field0]參數
-l :指的是呼叫的限制次數,在這裡是5

建議
1. 各位把SIPp官方網站的文件download仔細閱讀,尤其在它能搭配的參數,其實還蠻多的
2. 要能清楚瞭解SIP呼叫模型,才能在xml中清楚定義

How to install Asterisk under Ubuntu

1. Install Ubuntu 7.04


2. download libpri,zaptel,asterisk from http://www.asterisk.org/downloads
libpri 1.4.3
zaptel 1.4.9.2
asterisk 1.4.18.1


3. pre-install package
bison
libncurses-dev
zliblg-dev
libcurl4-openssl-dev
libgnutls-dev
libstdc++-4.1-dev
g++
apt-get install build-essiental


4. compile libpri
enter the directory
make
make install


5. compile zaptel
enter the directory
make
make install

6. compile asterisk
enter the directory
./configure
make
make install
make samples


7. run asterisk
sudo asterisk -vvvvc