0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SIPp + TLSメモ

0
Posted at

Asterisk側

openssl

mkdir -p /etc/asterisk/keys
cd /etc/asterisk/keys

openssl req -new -x509 -days 3650 -nodes \
  -out asterisk.pem \
  -keyout asterisk.key

Asterisk

pjsipの大事なところはcert/keyファイルの設定・パーミッションとtlsのバージョン

pjsip.conf
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/asterisk/keys/asterisk.pem
priv_key_file=/etc/asterisk/keys/asterisk.key
method=tlsv1_2

[6001]
type=endpoint
transport=transport-tls
context=from-internal
disallow=all
allow=ulaw
auth=6001
aors=6001

[6001]
type=auth
auth_type=userpass
password=asterisk1
username=6001

[6001]
type=aor
max_contacts=1

[sipp-identify]
type=identify
endpoint=6001
match=192.168.48.130

[6002]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
aors=6002

[6002]
type=aor
contact = sip:6002@192.168.197.10:5060

権限

cat /etc/passwd #asteriskユーザの確認
chown asterisk:asterisk /etc/asterisk/keys/*
chmod 600 /etc/asterisk/keys/*

transportの確認

sudo asterisk -rvvv
pjsip show transports

ここで、tlsのトランスポートタイプが存在しなければいけない

extensions.confの一例

extensions.conf
[from-internal]
exten = 100,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()
exten = 6002,1,Dial(PJSIP/6002,30,r)
same = n,Hangup()
asterisk1@asterisk1:/etc/asterisk$

SIPp側

openssl

sippがデフォルトで使う名前は、cakey.pem cacert.pem

openssl req -newkey rsa:2048 -x509 -keyout cakey.pem -out cacert.pem -days 3650 -nodes

uac

-rはcps、-mが最大コール数、-sが宛先ユーザ、-dがコールの長さ(ms)

./sipp -sf <uac file> -d 1000 -i 192.168.48.130 -p 5061 -t l1 -s 100 192.168.48.129:5061 -r 1 -m 1

簡易検証

# UAS
sipp -sf <uas file> -t t1 -p 5061

# UAC
sipp 127.0.0.1:5061 -sf <uac file> -t t1
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?