# Webrtc errors and no audio established

**URL:** <https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826>\
**Category:** Asterisk Support\
**Created:** [May 23, 2017, 10:51am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826 "2017-05-23T10:51:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bijumalla\_latha](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@bijumalla\_latha](https://community.asterisk.org/u/bijumalla_latha)\
**Post date:** [May 23, 2017, 10:51am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/1 "2017-05-23T10:51:16Z")

</div>

Hi

I am using Asterisk 14.2.1 to run webrtc example provided in [https://wiki.asterisk.org/wiki/display/AST/WebRTC+tutorial+using+SIPML5](https://wiki.asterisk.org/wiki/display/AST/WebRTC+tutorial+using+SIPML5)

I am able to connect to SIPML from asterisk server. But there is the following error seen on console when i try to generate a .call outbound call from Asterisk

[May 23 15:50:58] ERROR[29341]: netsock2.c:305 ast\_sockaddr\_resolve: getaddrinfo(“df7jal23ls0d.invalid”, “(null)”, …): Name or service not known  
[May 23 15:50:58] WARNING[29341]: chan\_sip.c:16667 \_\_set\_address\_from\_contact: Invalid host name in Contact: (can’t resolve in DNS) : ‘df7jal23ls0d.invalid’  
[May 23 15:50:58] ERROR[29341]: netsock2.c:98 ast\_sockaddr\_stringify\_fmt: getnameinfo(): ai\_family not supported

Also when i try to generate a call towards asterisk I see “Media Stream permission denied” shown on Chrome.

Please help me resolve this

---

<div class="post-metadata">

**Author:** ![navaismo](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/navaismo/32/2481_2.png) [@navaismo](https://community.asterisk.org/u/navaismo)\
**Post date:** [May 23, 2017, 2:25pm UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/2 "2017-05-23T14:25:44Z")

</div>

> [@bijumalla\_latha](#):
>
> [May 23 15:50:58] ERROR[29341]: netsock2.c:305 ast\_sockaddr\_resolve: getaddrinfo(“df7jal23ls0d.invalid”, “(null)”, …): Name or service not known  
> [May 23 15:50:58] WARNING[29341]: chan\_sip.c:16667 \_setaddress\_from\_contact: Invalid host name in Contact: (can’t resolve in DNS) : ‘df7jal23ls0d.invalid’  
> [May 23 15:50:58] ERROR[29341]: netsock2.c:98 ast\_sockaddr\_stringify\_fmt: getnameinfo(): ai\_family not supported

Look at doubango forums for that common error

> [@bijumalla\_latha](#):
>
> Also when i try to generate a call towards asterisk I see “Media Stream permission denied” shown on Chrome.

You have not permitted the usage of the audio device, usually you see a popup asking to use the hardware, or either you are using self certificates(invalid ssl)

---

<div class="post-metadata">

**Author:** ![bijumalla\_latha](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@bijumalla\_latha](https://community.asterisk.org/u/bijumalla_latha)\
**Post date:** [May 24, 2017, 9:47am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/3 "2017-05-24T09:47:25Z")

</div>

To elaborate this further. Please see below asterisk configurations

**sip.conf**

**[general]**  
udpbindaddr=0.0.0.0:5060  
realm=192.168.0.180 ;replace with your Asterisk server public IP address or host  
transport=udp,ws,wss  
; realm=202.65.140.19  
; externip=202.65.140.19  
videosupport=yes  
srvlookup=yes

**[6001]**  
type=friend  
host=dynamic  
username=6001  
secret=password  
context=from-internal  
encryption=yes  
srtpcapable=yes  
avpf=yes  
force\_avp=yes  
icesupport=yes  
directmedia=no  
allow=all  
allow=ulaw  
allow=gsm  
dtlsenable=yes  
dtlsverify=yes  
dtlscertfile=/etc/asterisk/keys/asterisk.pem  
dtlscafile=/etc/asterisk/keys/ca.crt  
dtls\_setup=actpass  
rtcp\_mux=yes

**http.conf**

**[general]**  
enabled=yes  
bindaddr=192.168.0.180  
bindport=8088

**rtp.conf**

**[general]**  
rtpstart=10000  
rtpend=20000  
icesupport=yes  
[stunaddr:19302=stun.l.google.com](http://stunaddr:19302=stun.l.google.com)

Installed the certificate as per [https://wiki.asterisk.org/wiki/display/AST/Secure+Calling+Tutorial](https://wiki.asterisk.org/wiki/display/AST/Secure+Calling+Tutorial).

Running the sipml5 test using http and not https

**Error seen on console when i try to create a outbound call**

```
-- Called 6001
-- SIP/6001-00000019 is ringing
-- SIP/6001-00000019 answered
-- Executing [10@from-outbound:1] NoOp("SIP/6001-00000019", ""From outbound"") in new stack
-- Executing [10@from-outbound:2] WaitExten("SIP/6001-00000019", "10") in new stack
-- Executing [5@from-outbound:1] NoOp("SIP/6001-00000019", ""Input received from user as: "5") in new stack
-- Executing [5@from-outbound:2] SayDigits("SIP/6001-00000019", "5") in new stack
-- <SIP/6001-00000019> Playing 'digits/5.gsm' (language 'en')

```

[May 24 14:43:46] ERROR[18002][C-0000001a]: res\_rtp\_asterisk.c:2218 \_\_rtp\_recvfrom: DTLS failure occurred on RTP instance ‘0xb4626cc4’ due to reason ‘certificate verify failed’, terminating  
[May 24 14:43:46] WARNING[18002][C-0000001a]: res\_rtp\_asterisk.c:4464 ast\_rtp\_read: RTP Read error: Unspecified. Hanging up.  
== Spawn extension (from-outbound, 5, 2) exited non-zero on ‘SIP/6001-00000019’

**Audio is enabled at browser end. But not able to hear to any audio files**

Please help

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [May 24, 2017, 9:50am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/4 "2017-05-24T09:50:09Z")

</div>

> [@bijumalla\_latha](#):
>
> [May 24 14:43:46] ERROR[18002][C-0000001a]: res\_rtp\_asterisk.c:2218 \_rtprecvfrom: DTLS failure occurred on RTP instance ‘0xb4626cc4’ due to reason ‘certificate verify failed’, terminating

You are either suffering a man in the middle attack, or you do not have a valid certificate path to a known root certificate.

---

<div class="post-metadata">

**Author:** ![bijumalla\_latha](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@bijumalla\_latha](https://community.asterisk.org/u/bijumalla_latha)\
**Post date:** [May 24, 2017, 9:53am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/5 "2017-05-24T09:53:59Z")

</div>

Installed the mentioned ca.crt on firefox. Anything else needs to be done? SIPML5 is running on Firefox

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [May 24, 2017, 10:00am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/6 "2017-05-24T10:00:26Z")

</div>

When it comes to WebRTC you have to learn and gain this knowledge, you can’t depend on help like this for ever as it is complex and deploying it is not easy.

---

<div class="post-metadata">

**Author:** ![kharwell](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/kharwell/32/1924_2.png) [@kharwell](https://community.asterisk.org/u/kharwell)\
**Post date:** [May 24, 2017, 9:02pm UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/7 "2017-05-24T21:02:09Z")

</div>

Just a heads up and someone can correct me if I am wrong, but I don’t think browsers (at least Chromium and Firefox) allow insecure websocket connections anymore, so you’ll also need to set up the tls bindings in Asterisk http.conf (note example config only below):

```
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=<path to your cert>/asterisk.pem
tlsprivatekey=<path to your key>/asterisk.pem

```

Then you’ll also need to point your sipml5 “WebSocket Server URL” found on the expert settings page to that port and give it the correct scheme:

```
wss://<your ip/host>:8089/ws
```

---

<div class="post-metadata">

**Author:** ![bijumalla\_latha](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@bijumalla\_latha](https://community.asterisk.org/u/bijumalla_latha)\
**Post date:** [May 25, 2017, 4:44am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/8 "2017-05-25T04:44:20Z")

</div>

Thanks, now i could see the call being received on Browser. But still no RTP seen, Audio and Video is failing.

See below updated **sip.conf, http.conf, rtp.conf**.

**http.conf**

[general]  
enabled=yes  
bindaddr=192.168.0.180  
bindport=8088  
tlsenable=yes ; enable tls - default no.  
tlsbindaddr=0.0.0.0:8089 ; address and port to bind to - default is bindaddr and port 8089.  
;  
tlscertfile=/etc/asterisk/keys/asterisk.pem ; path to the certificate file (_.pem) only.  
tlsprivatekey=/etc/asterisk/keys/asterisk.pem ; path to private key file (_.pem) only.

**sip.conf**

[general]  
udpbindaddr=0.0.0.0:5060  
realm=192.168.0.180 ;replace with your Asterisk server public IP address or host  
transport=udp,ws,wss  
; realm=202.65.140.19  
; externip=202.65.140.19  
videosupport=yes

srvlookup=yes

[6001]  
type=friend  
host=dynamic  
username=6001  
secret=password  
context=from-internal  
encryption=yes  
srtpcapable=yes  
avpf=yes  
force\_avp=yes  
icesupport=yes  
directmedia=yes  
allow=all  
allow=ulaw  
allow=gsm  
; allow=h263  
dtlsenable=yes  
dtlsverify=yes  
dtlscertfile=/etc/asterisk/keys/asterisk.pem  
dtlscafile=/etc/asterisk/keys/ca.crt  
dtls\_setup=actpass  
rtcp\_mux=yes

**rtp.conf**

[general]  
rtpstart=10000  
rtpend=20000  
icesupport=yes  
[stunaddr:19302=stun.l.google.com](http://stunaddr:19302=stun.l.google.com)

**Console output**

```
-- Attempting call on SIP/6001 for 10@from-outbound:1 (Retry 1)

```

== DTLS ECDH initialized (secp256r1), faster PFS enabled  
== DTLS ECDH initialized (secp256r1), faster PFS enabled  
== Using SIP VIDEO CoS mark 6  
== Using SIP RTP CoS mark 5  
[May 25 09:49:06] ERROR[29852]: netsock2.c:305 ast\_sockaddr\_resolve: getaddrinfo(“df7jal23ls0d.invalid”, “(null)”, …): Name or service not known  
[May 25 09:49:06] WARNING[29852]: chan\_sip.c:16667 \_\_set\_address\_from\_contact: Invalid host name in Contact: (can’t resolve in DNS) : ‘df7jal23ls0d.invalid’  
[May 25 09:49:06] ERROR[29852]: netsock2.c:98 ast\_sockaddr\_stringify\_fmt: getnameinfo(): ai\_family not supported  
– Called 6001  
– SIP/6001-00000024 is ringing  
– SIP/6001-00000024 answered  
– Executing [10@from-outbound:1] NoOp(“SIP/6001-00000024”, ““From outbound””) in new stack  
– Executing [10@from-outbound:2] WaitExten(“SIP/6001-00000024”, “10”) in new stack  
– Executing [7@from-outbound:1] NoOp(“SIP/6001-00000024”, ""Input received from user as: “7”) in new stack  
– Executing [7@from-outbound:2] SayDigits(“SIP/6001-00000024”, “7”) in new stack  
– \<SIP/6001-00000024\> Playing ‘digits/7.gsm’ (language ‘en’)  
[May 25 09:49:24] ERROR[29913][C-00000024]: res\_rtp\_asterisk.c:2218 \_\_rtp\_recvfrom: DTLS failure occurred on RTP instance ‘0x989db7c’ due to reason ‘certificate verify failed’, terminating  
[May 25 09:49:24] WARNING[29913][C-00000024]: res\_rtp\_asterisk.c:4464 ast\_rtp\_read: RTP Read error: Unspecified. Hanging up.  
== Spawn extension (from-outbound, 7, 2) exited non-zero on ‘SIP/6001-00000024’

Another observation in addition to the above

When i try to open URL: [https://192.168.0.180:8089/ws](https://192.168.0.180:8089/ws) i see below mentioned string displayed on screen

**_Upgrade Required_**

**_Asterisk/14.2.1_**

---

<div class="post-metadata">

**Author:** ![navaismo](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/navaismo/32/2481_2.png) [@navaismo](https://community.asterisk.org/u/navaismo)\
**Post date:** [May 26, 2017, 8:20am UTC](https://community.asterisk.org/t/webrtc-errors-and-no-audio-established/70826/9 "2017-05-26T08:20:21Z")

</div>

> [@Troubleshooting WebRTC Issues](https://community.asterisk.org/t/troubleshooting-webrtc-issues/46011):
>
> Here is a little guide to troubleshoot webrtc issues with Asterisk. Always try to use the latest WebRTC API with the latest Asterisk branch(11 or 12). Be sure you have the icessuport enabled in the rtp.conf ISSUE: I get this response on JSSIP or SIPML5 debug:tRemoteDescription failed: Called with an SDP without ice-ufrag and ice-pwd. This issue is caused because you asterisk don’t have ICE support, you can solve that by installing the uuid/libuuid and uuid-devel/libuuid-devel packages on your…
