레이블이 Asterisk인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Asterisk인 게시물을 표시합니다. 모든 게시물 표시

2015년 4월 1일 수요일

setting for asterisk cdr record ( mysql )

vi /etc/asterisk/cdr_mysql.conf

[global]
hostname=xxx.xxx.xxx.xxx
dbname=mysqldatabasename
table=cdr
password=mysqluserpassword
user=mysqluser

/etc/init.d/asterisk restart

2014년 11월 13일 목요일

Realtime mapping for 'sipregs' found to engine 'odbc', but the engine is not available

localhost*CLI> module show like odbc

if not found

yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel

cd /usr/local/src/asterisk-xxxx
make clean && make distclean
./configure && make menuselect && make && make install
./configure --libdir=/usr/lib64 && make menuselect && make && make install

/etc/init.d/asterisk restart

2014년 10월 16일 목요일

asterisk stress test by sipp with hp380

일단, 핵심은 시험하는 BOX 의 File Descriptor 제한을 풀어주는 것이다

[ limits.conf add ]
vi /etc/init.d/asterisk
start() {
        ulimit -n 20000
        # Check if Asterisk is already running.  If it is, then bug out, because

[ limits.conf add ]
vi /etc/security/limits.conf
root             soft   nofile          20000
root             hard   nofile          25000

[ sip.conf in asterisk ]
[sipp]
type=friend
context=test11
host=dynamic
port=5060
user=sipp
canreinvite=no
disallow=all
allow=ulaw

[ extensions.ael in asterisk ]
context test11
{
        s => {
                Answer();
                while (1) {
                        Background(demo-instruct);
                }
                Hangup();
        }
        _X. => {
                Answer();
                while (1) {
                        Background(demo-instruct);
                }
                Hangup();
        }
}

[ sipp command ]
./sipp -sn uac asteriskipaddr -s 12 -d 1000000 -l 5000

[ etc ]
dmidecode -t 4

[ sipp install ]
tar -zxvf sipp-3.3.tar.gz
cd sipp-3.3
make

[ asterisk installl ]
yum install –y gcc
yum install –y ncurses-devel
yum install –y libtermcap-devel
yum install –y ernel kernel-devel kernel-headers
yum install –y kernel-smp-devel
yum install –y gcc-c++
yum install –y openssl-devel
yum install –y zlib-devel

yum install –y unixODBC-devel
yum install –y libtool
yum install –y libxml2-devel
yum install sqlite-devel
yum install –y make

./configure ( only 32bit )
./configure --libdir=/usr/lib64  ( only 64bit )
make
make install

make config
chkconfig asterisk on

2014년 6월 4일 수요일

sip call pickup with asterisk

asterisk version : 11.6.1

1. sip.conf 에서 각각의 extension 에 아래와 같이 추가 설정 ( 묶고 싶은 내선번호 끼리 )
callgroup = 1
pickupgroup = 1

2. features.conf 파일에서 아래의 내용의 주석을 해제하고, 원하는 번호를 입력 한다 ( 변경하지 않으면 *8 이다. sip hardphone 에서는 *8# 을 발신하면 된다. 난 **# 이다
pickupexten = **

2014년 3월 27일 목요일

asterisk codecs.conf for use speex codec

os : centos 6.5
asterisk : 11.6.1
requirements : speex-1.2rc1 installed & asterisk remake

*Table 4:* Quality versus bit-rate
Mode Bit-rate (bps) mflops Quality/description
0 250 N/A No transmission (DTX)
1 2,150 6 Vocoder (mostly for comfort noise)
2 5,950 9 Very noticeable artifacts/noise, good intelligibility
3 8,000 10 Artifacts/noise sometimes noticeable
4 11,000 14 Artifacts usually noticeable only with headphones
5 15,000 11 Need good headphones to tell the difference
6 18,200 17.5 Hard to tell the difference even with good headphones
7 24,600 14.5 Completely transparent for voice, good quality music
8 3,950 10.5 Very noticeable artifacts/noise, good intelligibility

vi /etc/asterisk/codecs.conf

[speex]
;0-10
quality => 4
;0-10
complexity => 4
; true / false
enhancement => true
; true / false
vad => false
; true / false
vbr => false
; 0 = off, otherwise, target bitrate in bps
abr => 8000
;0-10
vbr_quality => 5
; true / false
dtx => false

CLI>reload

origin : http://lists.digium.com/pipermail/asterisk-users/2005-January/073992.html

2014년 3월 24일 월요일

odbc use with asterisk

asterisk build 하기전에 아래 요소들이 필요 하다
없으면 'odbc' but the engine is not available 요딴 에러가 발생 한다

yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel

2013년 3월 6일 수요일

Asterisk 11 에서 TLS 와 SRTP 를 정상적으로 돌린 예

오류를 만났을 때를 대비해 올려 둔다


Client A ( 1000 ) <--> Asterisk ( TLS, SRTP ) <--> Client B ( 1001 )

Client A IP : 192.168.1.151
Client B IP : 192.168.1.131
Asterisk IP : 192.168.1.106

<--- SIP read from TLS:192.168.1.151:58418 --->
INVITE sip:1001@192.168.1.106:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b295a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 5 INVITE
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 70
Supported: 100rel, replaces, from-change
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: <sip:1000@192.168.1.106>
Content-Length: 365

v=0
o=- 3664105484 1 IN IP4 192.168.1.151
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.151
t=0 0
m=audio 5062 RTP/SAVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:ZHXu5KBoj8MK32CKMJgQv6IyCaDCJGsxjaP3heIV
a=encryption:optional
a=ssrc:2834382215
a=sendrecv
<------------->
--- (14 headers 14 lines) ---
Sending to 192.168.1.151:58418 (no NAT)
Using INVITE request as basis request - 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
Found peer '1000' for '1000' from 192.168.1.151:58418

<--- Reliably Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b295a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as0c95498a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 5 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="54692493"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151' in 32000 ms (Method: INVITE)

<--- SIP read from TLS:192.168.1.151:58418 --->
ACK sip:1001@192.168.1.106:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b295a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as0c95498a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 5 ACK
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---

<--- SIP read from TLS:192.168.1.151:58418 --->
INVITE sip:1001@192.168.1.106:5061;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Authorization: Digest username="1000", realm="asterisk", nonce="54692493", uri="sip:1001@192.168.1.106:5061;transport=tls", response="0af5468b1ce97a76e4ad687f79ddd48c", algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 70
Supported: 100rel, replaces, from-change
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: <sip:1000@192.168.1.106>
Content-Length: 365

v=0
o=- 3664105484 1 IN IP4 192.168.1.151
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.151
t=0 0
m=audio 5062 RTP/SAVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:ZHXu5KBoj8MK32CKMJgQv6IyCaDCJGsxjaP3heIV
a=encryption:optional
a=ssrc:2834382215
a=sendrecv
<------------->
--- (15 headers 14 lines) ---
Sending to 192.168.1.151:58418 (NAT)
Using INVITE request as basis request - 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
Found peer '1000' for '1000' from 192.168.1.151:58418
  == Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.151:5062
Looking for 1001 in default (domain 192.168.1.106)
list_route: hop: <sip:1000@192.168.1.151:5062;transport=tls>

<--- Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:1001@192.168.1.106:5061;transport=TLS>
Content-Length: 0


<------------>
    -- Executing [1001@default:1] NoOp("SIP/1000-00000010", "STRP TEST CALL") in new stack
    -- Executing [1001@default:2] Set("SIP/1000-00000010", "_SIP_SRTP_SDES=1") in new stack
    -- Executing [1001@default:3] Set("SIP/1000-00000010", "_SIPSRTP=enable") in new stack
    -- Executing [1001@default:4] Dial("SIP/1000-00000010", "SIP/1001") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 10452
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.1.131:1162:
INVITE sip:1001@192.168.1.131:5064;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport
Max-Forwards: 70
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>
Contact: <sip:1000@192.168.1.106:5061;transport=TLS>
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.2.1
Date: Thu, 07 Mar 2013 05:35:12 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 346

v=0
o=root 1013182859 1013182859 IN IP4 192.168.1.106
s=Asterisk PBX 11.2.1
c=IN IP4 192.168.1.106
t=0 0
m=audio 10452 RTP/SAVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:mMRKpI/m8Km1Of9+Yg+ZXvRhJDbHkpsWkG39TxPd

---
    -- Called SIP/1001

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Server: SIPPER for PhonerLite
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
Contact: <sip:1001@192.168.1.131:5064;transport=tls>
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Server: SIPPER for PhonerLite
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
list_route: hop: <sip:1001@192.168.1.131:5064;transport=tls>
    -- SIP/1001-00000011 is ringing

<--- Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:1001@192.168.1.106:5061;transport=TLS>
Content-Length: 0


<------------>

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK62a1d8b9;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 INVITE
Contact: <sip:1001@192.168.1.131:5064;transport=tls>
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Supported: replaces, from-change
Server: SIPPER for PhonerLite
Content-Length: 341

v=0
o=- 3541565629 1 IN IP4 192.168.1.131
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.131
t=0 0
m=audio 5064 RTP/SAVP 8 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:X8/0CNQMoXIwAHnR83FGV90zS/v2e5CfvEBVIc+f
a=ssrc:519851118
a=sendrecv
<------------->
--- (12 headers 13 lines) ---
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.131:5064
list_route: hop: <sip:1001@192.168.1.131:5064;transport=tls>
set_destination: Parsing <sip:1001@192.168.1.131:5064;transport=tls> for address/port to send to
set_destination: set destination to 192.168.1.131:5064
Transmitting (NAT) to 192.168.1.131:1162:
ACK sip:1001@192.168.1.131:5064;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK15518c0a;rport
Max-Forwards: 70
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Contact: <sip:1000@192.168.1.106:5061;transport=TLS>
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.2.1
Content-Length: 0


---
    -- SIP/1001-00000011 answered SIP/1000-00000010
Audio is at 18472
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK802a1e955685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 INVITE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:1001@192.168.1.106:5061;transport=TLS>
Content-Type: application/sdp
Content-Length: 344

v=0
o=root 167695273 167695273 IN IP4 192.168.1.106
s=Asterisk PBX 11.2.1
c=IN IP4 192.168.1.106
t=0 0
m=audio 18472 RTP/SAVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:aZZxOF0pTT+ZX6yqPO+2OFYQSn6NACHVUya5wQQt

<------------>

<--- SIP read from TLS:192.168.1.151:58418 --->
ACK sip:1001@192.168.1.106:5061;transport=TLS SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK808480975685e211b296a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 6 ACK
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Authorization: Digest username="1000", realm="asterisk", nonce="54692493", uri="sip:1001@192.168.1.106:5061;transport=TLS", response="0798b41a3be5d62178429ba127c43925", algorithm=MD5
Max-Forwards: 70
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---

<--- SIP read from TLS:192.168.1.151:58418 --->
BYE sip:1001@192.168.1.106:5061;transport=TLS SIP/2.0
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK00fc0e9e5685e211b296a5e36e5e2deb;rport;alias
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 7 BYE
Contact: <sip:1000@192.168.1.151:5062;transport=tls>
Authorization: Digest username="1000", realm="asterisk", nonce="54692493", uri="sip:1001@192.168.1.106:5061;transport=TLS", response="dd5cbc609545f27c554309306dc71135", algorithm=MD5
Max-Forwards: 70
User-Agent: SIPPER for PhonerLite
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Sending to 192.168.1.151:58418 (NAT)
Scheduling destruction of SIP dialog '802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151' in 32000 ms (Method: BYE)

<--- Transmitting (NAT) to 192.168.1.151:58418 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.151:58418;branch=z9hG4bK00fc0e9e5685e211b296a5e36e5e2deb;alias;received=192.168.1.151;rport=58418
From: "1000" <sip:1000@192.168.1.106>;tag=3690110982
To: <sip:1001@192.168.1.106:5061;transport=tls>;tag=as4a1ba60a
Call-ID: 802A1E95-5685-E211-B294-A5E36E5E2DEB@192.168.1.151
CSeq: 7 BYE
Server: Asterisk PBX 11.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
    -- Executing [h@default:1] Hangup("SIP/1000-00000010", "") in new stack
  == Spawn extension (default, h, 1) exited non-zero on 'SIP/1000-00000010'
Scheduling destruction of SIP dialog '0890653214d997963645c7254cd05250@192.168.1.106:5061' in 32000 ms (Method: INVITE)
set_destination: Parsing <sip:1001@192.168.1.131:5064;transport=tls> for address/port to send to
set_destination: set destination to 192.168.1.131:5064
Reliably Transmitting (NAT) to 192.168.1.131:1162:
BYE sip:1001@192.168.1.131:5064;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK5217b6fa;rport
Max-Forwards: 70
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 103 BYE
User-Agent: Asterisk PBX 11.2.1
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---
  == Spawn extension (default, 1001, 4) exited non-zero on 'SIP/1000-00000010'

<--- SIP read from TLS:192.168.1.131:1162 --->
SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.1.106:5061;branch=z9hG4bK5217b6fa;rport=5061
From: "1000" <sip:1000@192.168.1.106>;tag=as2d08fdeb
To: <sip:1001@192.168.1.131:5064;transport=tls>;tag=802a1e955685e211bb01f39673b1fead
Call-ID: 0890653214d997963645c7254cd05250@192.168.1.106:5061
CSeq: 103 BYE
Contact: <sip:1001@192.168.1.131:5064;transport=tls>
Server: SIPPER for PhonerLite
Content-Length: 0

2011년 8월 23일 화요일

Linux 에서 해당 App 가 어떤 Lib 를 참조하는지 확인

ldd /usr/sbin/asterisk

or

strace -e open /usr/sbin/asterisk ( 없으면 yum install strace )

2011년 8월 10일 수요일

TLS, sRTP For Asterisk

[ 테스트 환경]
- kernel : 2.6.36
- srtp-1.4.2.tgz
- asterisk-1.8.5.0.tar.gz
- dahdi-linux-complete-2.5.0+2.5.0.tar.gz
- libpri-1.4.12.tar.gz
- OpenSSL-1.0.0d.tar.gz ( 이 문서 작성 당시에 yum 을 통해 설치하면 OpenSSL 0.9.8e-fips-rhel5 이 설치 되는데, 하필 ECC 가 지원되지 않아 1.0.0d 를 사용한다 )
- PhonerLite 1.91

[ Asterisk ]
- key 생성

mkdir /etc/asterisk/keys
- Server 측 인증파일 생성
./ast_tls_cert -C pointermans.dyndns.org -O "Arisys" -d /etc/asterisk/keys
- Client 측 인증파일 생성
./ast_tls_cert -m client -c /etc/asterisk/keys/ca.crt -k /etc/asterisk/keys/ca.key -C pointermans.dyndns.org -O "Arisys" -d /etc/asterisk/keys -o 1000


- sip.conf
[general]
context=default                 ; Default context for incoming calls
srtpcapable=yes
tlsenable=yes
tlsbindaddr=0.0.0.0
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscafile=/etc/asterisk/keys/ca.crt
tlscipher=ALL
tlsclientmethod=tlsv1 ;none of the others seem to work with Blink as the client

[1000]
type=peer
context=main
host=dynamic
disallow=all
allow=ulaw
allow=alaw
secret=1000
transport=tls
nat=yes
encryption=yes
canreinvite=no

[1001]
type=peer
context=main
host=dynamic
disallow=all
allow=ulaw
allow=alaw
secret=1001
transport=tls
nat=yes
encryption=yes
canreinvite=no

- extensions.conf

[main]
exten => _XXXX,1,NOOP(SRTP TEST CALL)
exten => _XXXX,n,Set(_SIPSRTP_CRYPTO=enable)
exten => _XXXX,n,DIAL(SIP/${EXTEN})



[ PhonerLite ]
최근 테스트 해본 Softphone 중에 최고!
아래와 같이 설정

[ 결과 ]
- SRTP 만 적용한 SIP Message Flow

- SRTP 음원 : Play 해 봐야 들을 수 없당

- TLS 와 SRTP 가 모두 적용 된 INVITE Method

<--- SIP read from TLS:192.168.1.129:59240 --->
INVITE sip:1001@pointermans.dyndns.org;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.129:59240;branch=z9hG4bK008a4625d4cbe011a013005056c00001;rport;alias
From: "1000" <sip:1000@pointermans.dyndns.org>;tag=3955497885
To: <sip:1001@pointermans.dyndns.org;transport=tls>
Call-ID: 008A4625-D4CB-E011-A012-005056C00001@192.168.1.129
CSeq: 108 INVITE
Contact: <sip:1000@192.168.1.129:59240;transport=tls>
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 70
Supported: 100rel, replaces, from-change
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: <sip:1000@pointermans.dyndns.org>
Content-Length: 347

v=0
o=- 2733979642 0 IN IP4 192.168.1.129
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.129
t=0 0
m=audio 61911 RTP/SAVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:qvfRcmB5uE0WrXOcRuBV0KgzE3CSl6N9On/gvutN
a=encryption:optional
a=sendrecv

[ 기타 ]
/main/tcptls.c -> ast_tls_read_conf 은 아래 파일에서 사용 됨
/channels/chan_sip.c
/main/http.c
/main/manager.c

[ 참고사이트 ]
일단 설치는 여기 참고 : http://www.technicalhowto.com/opensource/asterisk/installing.html

이놈이 핵심 : http://www.openssl.org/

http://astrecipes.net/index.php?n=398

http://www.remiphilippe.fr/2011/01/16/asterisk-srtp-with-1-8/

http://www.voip-info.org/wiki/view/Asterisk+SRTP

https://wiki.asterisk.org/wiki/display/AST/Secure+Calling+Tutorial

http://srtp.sourceforge.net/srtp.html

2011년 8월 2일 화요일

Outbound CID 변경

exten => _8188,1,Set(CALLERID(num)=1234)
exten => _8188,n,NoOp(===================)
exten => _8188,n,Dial(SIP/901036309431@onenumber)

CLI 에서 SIP Hardphone Reboot 하기

vi /etc/asterisk/sip_notify.conf

[moim-talk]
Event=>talk
Content-Length=>0

CLI> sip notify moim-talk 3700

출처 > http://blog.naver.com/hsunryou/60112053852

Avaya Phone 도 될까? 내일 해봐야 겠네

CLI 에서 Debug 켜고/끄기

sip debug peer 3700
sip no debug

Asterisk CD 만들기

링크> http://wiki.kldp.org/wiki.php/AsteriskInst/AsteriskCentos5