понедельник, 22 июня 2015 г.

Freeswitch + debian jessie (8.x)

Если apt-get install freeswitch-meta-vanilla заканчивается с ошибкой, можно поставить
freeswitch-meta-bare и затем freeswitch-init-systemd

Или наоборот, как вариант. Суть в том, что до установки freeswitch-init уже должен стоять хоть какой-то инит пакет.

Ошибка выглядит примерно так
# apt-get install -f
Reading package lists... Done
Building dependency tree    
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up freeswitch-sysvinit (1.4.20~34-1~jessie+1) ...
Job for freeswitch.service failed. See 'systemctl status freeswitch.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript freeswitch, action "start" failed.
dpkg: error processing package freeswitch-sysvinit (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of freeswitch-init:
 freeswitch-init depends on freeswitch-sysvinit (= 1.4.20~34-1~jessie+1); however:
  Package freeswitch-sysvinit is not configured yet.

dpkg: error processing package freeswitch-init (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 freeswitch-sysvinit
 freeswitch-init
E: Sub-process /usr/bin/dpkg returned an error code (1)

среда, 3 июня 2015 г.

freeswitch 1.6 - основные фишки

https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video
Detailed information on how to properly build and test the new FreeSWITCH™ 1.6 with awesome video conferencing support.
Прежде всего, перерабатывают работу с видео. Правда, штука довольно редко нужна, без учета всяких порночатиков.
Плюс изменили систему сборки, но зачем ради этого менять версию?...

По ссылке - инструкция по установке. Пока версия альфа, 1.5.

freeswitch + docker

Представляет определенный интерес такой продукт как Docker, он умеет пускать фрисвич в контейнере, но не требует всей обвязки openvz. Правда, без проброса группы портов он хорош только в небольших внедрениях, но это "пока"...

https://beingasysadmin.wordpress.com/2014/06/16/dockerizing-freeswitch-docker-enters-telephony-world/

I wouldn't recommend using Docker for a VoIP server before Docker supports port ranges. You need to configure it to map UDP port ranges for RTP, and with current version of Dicker you can only list every port explicitly. In the next release, they promise to support port ranges.
http://stackoverflow.com/questions/27830518/sip-408-request-timeout-for-freeswitch

и пример запуска из комментария

I did the following before running the freeswitch server on docker docker run -d -p 0.0.0.0:2223:22 -p 82:80 -p 5060:5060/tcp -p 5060:5060/udp -p 16384:16384/udp -p 16385:16385/udp -p 16386:16386/udp -p 16387:16387/udp -p 16388:16388/udp -p 16389:16389/udp -p 16390:16390/udp -p 16391:16391/udp -p 16392:16392/udp -p 16393:16393/udp -p 5080:5080/tcp -p 5080:5080/udp --name <container_name_goes_here> <repository_name_goes_here>

среда, 13 мая 2015 г.

Управление zrtp

ZRTP ("Z" is a reference to its inventor, Zimmermann; "RTP" stands for Real-time Transport Protocol)[2] is described in the Internet Draft as a "key agreement protocol which performs Diffie–Hellman key exchange during call setup in-band in the Real-time Transport Protocol (RTP) media stream which has been established using some other signaling protocol such as Session Initiation Protocol (SIP). This generates a shared secret which is then used to generate keys and salt for a Secure RTP (SRTP) session." One of ZRTP's features is that it does not rely on SIP signaling for the key management, or on any servers at all. It supports opportunistic encryption by auto-sensing if the other VoIP client supports ZRTP.
http://en.wikipedia.org/wiki/ZRTP

ZRTP is SRTP based, but instead of using SIP to exchange keys, it exchanges keys within the media stream itself making it more secure. It does not require PKI.
https://wiki.freeswitch.org/wiki/ZRTP

Включение: в switch.conf:
<param name="rtp-enable-zrtp" value="true"/>

Есть 3 режима работы:

  1. trusted MITM, когда устанавливается 2 сессии с сервером, с транскодингом, 
  2. простой проброс rtp - media relay, и 
  3. прямой (direct, peer-to-peer) режим, когда rtp через сервер вообще не ходит.

Про первый режим
The PBX can operate as a trusted man-in-the-middle, terminating the media streams for both parties at the PBX. This also terminates the ZRTP encryption for both parties at the PBX. This is mathematically equivalent to a classic man-in-the-middle attack, but it's not really an attack if the clients trust the PBX and consent to this. ZRTP has a mechanism to allow a client to recognize a trusted PBX to act as a "friendly" man-in-the-middle. This allows conference mixing, transcoding, and lawful interception of plaintext media, all within the confines of the trusted PBX.
http://zfoneproject.com/faq.html
ну и в целом дока интересная и полезная.

Включить первый режим:
<action application="set" data="zrtp_enrollment=true"/>

второй режим (проксирование):
<param name="inbound-zrtp-passthru" value="true"/>

плюс
https://wiki.freeswitch.org/wiki/Proxy_Media

И напоследок дока с картинками
http://zfone.com/docs/asterisk/man/html/u_guide.html

четверг, 23 апреля 2015 г.

180, 183, early_media

Early media это информация, которая ходит только в 1 сторону, оно же обычно pre answer. Если медиа нет - телефон сам генерирует гудки, иначе передает то, что прилетает. А это может быть "абонент временно недоступен", просто какая-то информация...

Обычно при установке соединения идут сообщения тип 100 (trying), потом 180 ringing, без медиа, потом 183 session progress, с медиа. Но в рф сотовые и тут выпендрились и медиа у них уже в 180 летит, что несколько ломает поведение фрисвича, хотя по RFC это и допустимо.