Author Topic: Problems establishing websocket connections with SSL  (Read 892 times)

qmax

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 0
  • Asterisk-11.7.0-ubuntu, Queuemetrics-15.10.1-tgz
    • View Profile
    • Email
Problems establishing websocket connections with SSL
« on: June 04, 2016, 07:19:47 »
I'm trying to setup websocket softphone.
Using queuemetrics-15.10.1, asterisk-11.7.0~dfsg-1ubuntu1

In sip.conf:
Code: [Select]
[callcenterW](!)
type=friend
host=dynamic
nat=force_rport,comedia
permit=0.0.0.0/0.0.0.0
context=callcenter
allow=all
callcounter=yes
busylevel=1
qualify=yes
transport=wss
avpf=yes
encryption=yes
srtpcapable=yes
icesupport=yes
videosupport=no

[agent007](callcenterW)
secret=1234567

In http.conf:
Code: [Select]
tlsenable=yes
tlscertfile=/etc/ssl/certs/ast-host.crt
tlsprivatekey=/etc/ssl/private/ast-host.key   

Related config in configuration.properties:
Code: [Select]
default.sipaddress=ast.host
default.websocketurl=wss://ast.host/ws
default.rtcWebBreaker=true ; also tried false

Certificate is issued by self-signed CA with subj CN:ast-host
The CA is imported into browsers.
All https connections work well.

When agent page opened in Chrome(50.0) or Firefox(43.0) new ws-connections constantly appear, and later get timeouted.
No data frames sent.

Console shows:
Code: [Select]
s_websocket_server_url=wss://ast-host:8089/ws
VM73:1 s_sip_outboundproxy_url=(null)
VM73:1 b_rtcweb_breaker_enabled=no
VM73:1 b_click2call_enabled=no
VM73:1 b_early_ims=yes
VM73:1 b_enable_media_stream_cache=yes
VM73:1 o_bandwidth={"audio":"64"}
VM73:1 o_video_size={"minWidth":"640","minHeight":"480","maxWidth":"640","maxHeight":"480"}
VM73:1 SIP stack start: proxy='ns313841.ovh.net:13060', realm='<sip:ast-host>', impi='a001', impu='"Пупкин Вася"<sip:a001@ast-host>'
VM73:1 Connecting to 'wss://ast-host:8089/ws'

In asterisk log:
Code: [Select]
[Jun  4 11:54:01] DEBUG[4064] http.c: HTTP Request URI is /ws
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [httpstatus] len 0
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [amanager] len 10
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [arawman] len 8
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [manager] len 7
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [rawman] len 7
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [static] len 6
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [amxml] len 6
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [mxml] len 5
[Jun  4 11:54:01] DEBUG[4064] http.c: match request [ws] with handler [ws] len 4
[Jun  4 11:54:01] VERBOSE[4064] res_http_websocket.c:   == WebSocket connection from '85.118.225.90:46250' for protocol 'sip' accepted using version '13'
[Jun  4 11:57:16] VERBOSE[4064] res_http_websocket.c:   == WebSocket connection from '85.118.225.90:46250' closed

Nothing else happens.
And the peer do not register.

Is there anything wrong in provided configs and logs?
What else to debug?
« Last Edit: June 04, 2016, 07:26:23 by qmax »

kravasi

  • Loway
  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
    • Email
Re: Problems establishing websocket connections with SSL
« Reply #1 on: June 07, 2016, 09:19:34 »
Hi,

We recently had some problems with browser support for WebRTC. We will be releasing a new version that solves these issues, maybe you would like to try this beta version:

http://downloads.loway.ch/beta/queuemetrics-15.10.9-54.noarch.rpm

If you still have problems here is a link for a handy troubleshooting checklist on the Asterisk side:

http://forums.asterisk.org/viewtopic.php?f=1&t=90167

We are also working on a tutorial that might come in handy when setting up queuemetrics for WebRTC use, it has not been published yet but if you PM me your email address i can send it to you.   
feel free to let us know if you need further assistance.