Hello!
I have Asterisk 11.7.0 installed
The task is to make secure calls TLS+SRTP with direct RTP connections between phones.
I have read some how-to’s and manuals and managed to make encryption of SIP and RTP traffic working. All calls are successful without any problems.
But it seems SRTP streams are passing through asterisk, although directmedia=yes option is set in sip.conf
It is clearly seen in tcpdump and asterisk logs.
Besides, if I turn SRTP off using encryption=off directmedia becomes working properly. Tcpdump shows re-invite messages, which were not presented with SRTP enabled.
Is it normal behavior, or maybe I misunderstand something?
sip.conf
[general]
tlsenable=yes ; включить сигнализацию по TLS
tlsbindaddr=192.168.7.6 ; привязка TLS к адресу
bindaddress=192.168.7.6 ; привязка сервиса asterisk к адресу
tlscertfile=/etc/asterisk/keys/asterisk.pem ; путь к TLS сертификату сервера
tlscafile=/etc/asterisk/keys/ca.crt ; пусть к TLS CA сертификату
tlscipher=ALL ; тип TLS шифра
tlsclientmethod=tlsv1.0 ; версия TLS
maxexpirey=3600 ; максимальное время истечения регистрации 1ч
port=5060 ;стандартный порт
[local_secure](!)
type=friend
host=dynamic ; хост может менять адрес
disallow = all ; запрет всех кодеков
allow = alaw ; разрешить кодек G.711A
context=gm ; контекст канала
directmedia=yes
encryption=yes ; использовать SRTP
transport=tls ; использовать TLS для сигнализации
[1001](local_secure)
username=1001
secret=PASSWORD;
[1002](local_secure)
username=1002
secret=PASSWORD;
extensions.conf
[local] ; базовый контекст местных номеров
exten => _**,1,Pickup(${EXTEN:2})
exten => _1XXX,1,Dial(SIP/${EXTEN})
exten => _1XXX,n,Hangup
[gm]
include => local