Integration issue for WebRTC with WCS server 5 and Asterisk 14.

I am trying a webrtc-sip via Asterisk call with Asterisk 14 and WCS Server version FlashphonerWebCallServer-5.0.2159. I am using the demo application for WebRTC(Phone and Phone Video) and Bria for SIP End Point. I am getting the following issue in the console of Asterisk
[Apr 5 15:36:51] ERROR[61043][C-00000001]: chan_sip.c:5933 dialog_initialize_dtls_srtp: No DTLS-SRTP support present on engine for RTP instance '0x7f3614009500', was it compiled with support for it?
[Apr 5 15:36:51] NOTICE[61043][C-00000001]: chan_sip.c:26201 handle_request_invite: Failed to authenticate device "1060" <sip:1060@192.168.30.156>;tag=fce5ad16
Can anyone please help me on this since I am unable to debug and the same and I'm stuck with this since a couple of days.

This is my http.conf
[general]
enabled=yes
bindaddr=0.0.0.0 ; Replace this with your IP address
bindport=8088 ; Replace this with the port you want to listen on
;sip.conf
[general]
realm=192.168.30.156 ; Replace this with your IP address
udpbindaddr=192.168.30.156 ; Replace this with your IP address
transport=udp

[1060] ; This will be WebRTC client
type=friend
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=password ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
nat=no
canreinvite=no
qualify=no
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
dtlscafile=/etc/asterisk/keys/ca.crt
allow=alaw
media_encryption=dtls

[1061] ; This will be the legacy SIP client
type=friend
username=1061
host=dynamic
secret=password
context=default
disallow=all
allow=alaw
qualify=no
;rtp.conf
[general]
rtpstart=10000
rtpend=20000
icesupport=yes
stunaddr=stun.l.google.com:19302
;extensions.conf
;extensions.conf
[default]
exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060
exten => 1061,1,Dial(SIP/1061) ; Dialing 1061 will call the SIP client registered to 1061
Have checked the configs in Asterisk and it seems to be fine.
Also I just wanted to know if the FlashPhoner client can support SRTP since I don't see the Offer/Answer having the fingerprint.
Getting the following error in the Asterisk debug Logs
han_sip.c:10726 process_sdp: Failed to receive SDP offer/answer with required SRTP crypto attributes for audio
Attached the logs for the WEB-SIP and SIP-WEB logs.

I have the current architecture framework as of now.
Firefox<->Web SDK Client(Flash Phoner SIP Phone Demo)<->WCS Server<->Asterisk<->Bria
I am launching the WCS server with the demo app running on it.
I understand that that WCS must be configured as a peer for both WebRTC and Asterisk. But can anyone please brief me about the framework again?
How can one deploy the client sdk( and the path) from flashphoner which supports a video and an audio call through Asterisk and reach the SIP endpoint on the WCS server and run calls and register with Asterisk.
Since I am fairly new to this framework, Really appreciate the help....:)
Thanking you for your help in advance..:)
 

Attachments

Last edited:

Max

Administrator
Staff member
I would list four basic steps:

Test your Asterisk
First of all you have to test your Asterisk server without WCS.
Just make a test between two softphones like bria, xlite or linphone through Asterisk.
Let's say you have configured accounts (peers) 101 and 102 on Asterisk server.
You should be able to call from 101 to 102 using a softphone.

Install WCS in the same LAN with Asterisk
Download and install WCS from here https://flashphoner.com/download
Installation instruction here.

Test default WCS phone sample with a softhphone through Asterisk
If server was installed properly, you will be able to test default demo samples in the dashboard.
It will look like this: https://wcs5-eu.flashphoner.com/demo2/phone
And it should work with your Asterisk server, with the same accounts 101 or 102.

Code your own page and script
Once you tested default samples, you can modify samples and move to your own web server.
Because samples are simple HTML/Javascript files.
Here you can read how to work with code samples for Phone sample: link.
 
Hi Max,
I thank you for your response. It seems pretty much that the first 2 steps are covered. I am facing issues when I test the Demo app from my WCS server. I see that the offer and answer sent from the server does not have the DTLS/SRTP fingerprint in the SDP. From the asterisk logs I can see this
"WARNING[37157][C-00000009]: chan_sip.c:10726 process_sdp: Failed to receive SDP offer/answer with required SRTP crypto attributes for audio"
Can you please let me know if I am missing out on anything in the peer configs from the asterisk config files or any changes to be done on the WCS server?
 

Max

Administrator
Staff member
To get this working with WCS you have to use Asterisk peers without DTLS, like this:
Code:
[1061] ; This will be the legacy SIP client
type=friend
username=1061
host=dynamic
secret=password
context=default
disallow=all
allow=alaw
qualify=no
;rtp.conf
ICE and DTLS should be disabled for the Asterisk peer.
 
Thank you for your response. I had a query regarding disabling of ICE and DTLS. I am sort of confused since DTLS and ICE marks the basic functionality of a WebRTC communcation, with neither of them that is without ICE gathering and DTLS being absent, can the secure communication be possible?Also, does WCS server have functionality with respect to these?
 

Max

Administrator
Staff member
WCS works with browsers via WebRTC and uses ICE and DTLS.
WCS works with Asterisk as plain SIP / RTP and does not use ICE and DTLS or WebRTC in communication with Asterisk.
 
Hi Max,
Thank you for your response. The audio calls are working fine. I got the required information about the working of ICE and DTLS with FlashPhoner. Could you please let me know the Video Codec support that FlashPhoner has and the XMPP support it has with Asterisk(or FlashPhoner App to be integrated with any other XMPP server application) and any Demo Apps that I can use to integrate and test for the same? That is Calls from SIP endpoint and to the SIP endpoint will have the presence getting updated. Are there any APIs for the same?I am grateful for the help in advance.
 
Last edited:

Max

Administrator
Staff member
Could you please let me know the Video Codec support
WCS supports H.264 and VP8 video codecs.
has and the XMPP support it has with Asterisk(or FlashPhoner App to be integrated with any other XMPP server application)
XMPP is not supported
That is Calls from SIP endpoint and to the SIP endpoint will have the presence getting updated.
WCS works as a browser-sip softphone. All SIP events are translated to JavaScript layer.
If you ask about JavaScript API, you can learn how our samples work. For example Phone sample.
 
Thank you for the response. Is there a support for the WCS server to integrate with any other XMPP client- server application?If so any documentation for the same?

Can you also give an insight on the presence updation for a user who goes on a call(on hook and off hook)
Thanks..:)
 
Last edited:

Max

Administrator
Staff member
XMPP is not supported.
Can you also give an insight on the presence updation for a user who goes on a call(on hook and off hook)
Could you please describe this behavior in details. I'm not sure that I got it.
WCS has
  • JavaScript API (Web SDK)
  • REST API
  • REST Methods
You can find all docs here.
 
Hi Max,
Thank you for the response. I wanted to understand the ways in which the presence of a user can be updated when he receives a call. I can probably give scenarios and explain the same.
Scenario 1:-
Web User is Available before the call.
He goes to the busy status when he is on a call(Now when another user tries to call him he should send a 486)
When he disconnects the call, he is back to the online status.
When is offline, he should reject the call.
Can this be handled from Flashphoner and Asterisk?

Scenario 2:-
When a user logs into Web Client from the Browser.
When the same user logs into another Browser or an android device(app), and he receives an incoming call, the user presence available and the call routing happening to the device or the browser.

Can you please let me know if these scenarios are possible using FlashPhoner?
Thanks for the help:)
 
SIP-WEB call seems to be failing for audio stream on both web and SIP endpoints but the call is getting established. The Chrome and Firefox seem to have the same behavior with respect to the media between the SIP and the WEB. No media on both ends. I am able to see that ICE is failing.
Attached below is the screenshot for chrome://webrtc-internals
upload_2017-4-6_22-21-15.png

Call gets teared down after 10 secs...Can you please help me with this and the previous query..Thanks..:)
 

Max

Administrator
Staff member
Web User is Available before the call.
He goes to the busy status when he is on a call(Now when another user tries to call him he should send a 486)
When he disconnects the call, he is back to the online status.
When is offline, he should reject the call.
Can this be handled from Flashphoner and Asterisk?
This works out of the box.
If user connected to WCS is in active call state, any incoming call to the same user will be rejected by WCS with 486 Busy Here SIP response.
When a user logs into Web Client from the Browser.
When the same user logs into another Browser or an android device(app), and he receives an incoming call, the user presence available and the call routing happening to the device or the browser.
WCS works as a softphone device and has the same behavior. It just receives a SIP call or places a SIP call.
You describe Call Forwarding feature. This feature should be set in Asterisk server. WCS operates as a SIP softphone, not PBX and does not support call forwarding out of the box. It can just receive a call (INVITE) already forwarded by Asterisk.
SIP-WEB call seems to be failing for audio stream on both web and SIP endpoints but the call is getting established. The Chrome and Firefox seem to have the same behavior with respect to the media between the SIP and the WEB. No media on both ends. I am able to see that ICE is failing.
WCS uses UDP ports in range [30000-32000] for SIP/RTP and WebRTC.
These ports should be open and routed properly.
You can create pcap file for this call
Code:
tcpdump udp -s 4096 -w log.pcap
or dump all available interfaces
Code:
tcpdump udp -i any -s 4096 -w log.pcap
Then analyze this pcap file in Wireshark
https://flashphoner.com/docs/wcs5/w...?troubleshooting-network_traffic_analysis.htm
 
Thank you for the response. As mentioned, I changed the rtp.conf as follows.
[general]
rtpstart=30000
rtpend=32000
;icesupport=yes
;stunaddr=stun.l.google.com:19302
It seems that the same problem still persists. I am using Bria as the SIP endpoint and PhoneJS as the web user. The call gets established but the media seems to be absent. I can see that the ports are changed accordingly between 30000-32000. And Ice connection failure is still persistent.
Just a follow up query, wanted to implement a scenario where the same user gets logged into different devices. Now since registrations happen from the same user, based on the AOR the mapping happens but not able to set the configs. Any insight on the configs from asterisk?Didn't seem to find any..
Thanks for the help..:)
 

Max

Administrator
Staff member
PhoneJS is quite old and out of date.
Please test dashboard Phone example. Not PhoneJS.
Code:
Test default WCS phone sample with a softhphone through Asterisk
If server was installed properly, you will be able to test default demo samples in the dashboard.
It will look like this: https://wcs5-eu.flashphoner.com/demo2/phone
And it should work with your Asterisk server, with the same accounts 101 or 102.
30000-32000 is WCS' port range. Not Asterisk.

Just a follow up query, wanted to implement a scenario where the same user gets logged into different devices. Now since registrations happen from the same user, based on the AOR the mapping happens but not able to set the configs. Any insight on the configs from asterisk?
Please search 'how to setup call forwarding in Asterisk'. We didn't test call forwarding with Asterisk.
 
Hi Max,
Thank you for your response. There still seems to be an issue with the SIP-WEB call with the Demo App launched. The media seems to be cut on both ends. Can you please help me this? Seems that the ICE is failing again. It would be really helpful if any insight is given on this..:)
 

Max

Administrator
Staff member
As I assume, you have three machines
1) WCS installed.
2) Asterisk installed.
3) Your PC.
Please create three pcap files:
1) wcs.pcap
2) asterisk.pcap
3) yourpc.pcap
On Linux or Mac:
Code:
tcpdump udp -s 4096 -i any -w log.pcap
On Windows or Mac
Code:
Run Wireshark and capture / filter all traffic between your IP and WCS IP.
Please share these three pcap files or send to logs@flashphoner.com. We will check.
 

Max

Administrator
Staff member
It seems your WCS configuration is incorrect.
Please share your /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties config

stun-binding-errors.jpg
 
Hi Max,
Thank you for the response. I have attached the following file. Also, had another question regarding the procedure for configuring the FlashPhoner server when the IP changes that is when the server changes from one network to another network. (For example the initial IP is 192.168.30.175 is changed to another internal IP that is 192.168.1.16 or 172.x.x.x). Can you please let me know the scripts that need to be modified for the same. Thank you for the same.:) I have snt in the logs
 
Top