Asterisk in Docker - bad one way audio quality

#1

Hi asterisk community!

Newbie here who could use some help with setting up asterisk in a Docker container: my setup is, I think, rather simple:

  • asterisk in docker container running on NAS
  • webrtc client (jssip) on a tablet
  • linphone client on raspberry pi zero w, installed via Doorpi.

As you might have guessed from the Doorpi, the endgoal is to make a Door intercom.

However, I’m currently unable to get two-way audio calling working well. Do note that my asterisk configuration probably will be wrong :smile: . I hope it will be something obvious. The current configuration results in the ‘best’ outcome I have util now. This means, I can have the tablet ringing, have one-way audio from the tablet to the raspberry pi running linphone but not the otherwaty aroung. Quality is not extremely good but ok. However, I’m trying to get two-way audio up & running. All clients and asterisk itself are on a local network (192.168.1.*) using a Fritzbox 7490 where I can’d disable SIP alg.

From what I think I understand of the SIP protocol, I don’t need ice nor stun as it is all in the local network (perhaps later when I’m not home, I’d like to call my phone but first let’s try to keep it simple and stupid). However, disabling ice and stun, I

My setup is as follows:

My Dockerfile

FROM debian:stretch
MAINTAINER Ronald Dehuysser

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y  build-essential openssl libxml2-dev libncurses5-dev uuid-dev sqlite3 libsqlite3-dev pkg-config libjansson-dev libssl-dev libedit-dev curl msmtp

ENV SRTP_VERSION 1.6.0
RUN cd /usr/local/src && curl -L -o srtp.tar.gz https://github.com/cisco/libsrtp/archive/v${SRTP_VERSION}.tar.gz \
    && tar xzf srtp.tar.gz
RUN cd /usr/local/src/libsrtp* \
    && ./configure CFLAGS=-fPIC \
    && make \
    && make install

ENV ASTERISK_VERSION 16.3.0
RUN cd /usr/local/src && curl -o asterisk.tar.gz http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${ASTERISK_VERSION}.tar.gz \
    && tar xzf asterisk.tar.gz
RUN cd /usr/local/src/asterisk* \
    && ./configure --with-pjproject-bundled --with-jansson-bundled --with-crypto --with-ssl \
    && make \
    && make install \
    && make config

CMD ["/bin/bash", "-c", "asterisk; sleep infinity"]

My docker-compose file:

  asterisk:
    image: asterisk:testing
    network_mode: "host"
    volumes:
     - "./asterisk/conf:/etc/asterisk"
    labels:
     - "traefik.enable=false"

My asterisk configuration files:
sip.conf

;sip.conf
[general]
externip = 192.168.1.61
media_address=192.168.1.61
localnet=192.168.0.0/255.255.0.0;
nat=yes
;nat=force_rport,comedia
transport=udp,tcp,ws,wss
directmedia=no
icesupport=yes

[21]
permit=192.168.1.0/255.255.255.0
type=friend
context=phones
host=dynamic
secret=test123
nat=no

[22]
permit=192.168.1.0/255.255.255.0
type=friend
context=phones
host=dynamic
secret=test123
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
directmedia=no ; Asterisk will relay media for this peer
transport=wss ; Asterisk will allow this peer to register 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 verify DTLS fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.key
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
rtcp_mux=yes ; Tell Asterisk to do RTCP mux
nat=force_rport,comedia

[23]
permit=192.168.1.0/255.255.255.0
type=friend
context=phones
host=dynamic
secret=test123
nat=force_rport,comedia

rtp.conf

;rtp.conf
[general]
rtpstart=10000
rtpend=10010

modules.conf

;modules.conf
[modules]
autoload=yes

http.conf

;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
tlsenable=yes
tlsbindaddr=0.0.0.0:8089 ; Replace this with your IP address
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlsprivatekey=/etc/asterisk/keys/asterisk.key
enablestatic=yes

extensions.conf

;extensions.conf
# [default]
# exten => 21,1,Dial(SIP/21)
# exten => 22,1,Dial(SIP/22)
[globals]

[general]

[internal]
exten => _XX,1,Dial(SIP/${EXTEN})

[phones]
include => internal

Thanks upfront for any help.

Best regards,
Ronald

#2

You’re using a ton of complicated things in and of themselves all at once. I’d suggest eliminating things and start simple first. Don’t use Docker, don’t touch WebRTC. Just get Asterisk talking to a simple softphone first and then start adding things.

3 Likes
#3

Thanks for the answer, I really appreciate it!

The simple stuff works already: I can call linphone on my android mobile with two way audio without any troubles running asterisk in Docker. Check! I’ll update the sip.conf in my original question with the entry of my mobile.

So, I think the problem is the WebRTC part. But, I have no clue to what could be the cause. P.s.: I already googled a lot, not trying to bother you guys too much. Attached you’ll find my sip debug messages from asterisk, perhaps they can help finding the root cause.

Off-course, I’m using wss with self-signed certificates for which I confirmed the security exeption in chrome.

ronald-desktop*CLI> 

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->
INVITE sip:22@192.168.1.61 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.6eUkO3~m8;rport
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61
CSeq: 20 INVITE
Call-ID: WObYzmVV0R
Max-Forwards: 70
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 266
Contact: <sip:21@192.168.1.64:5061>;+sip.instance="<urn:uuid:982343a1-4d82-400a-b4c8-2ffdd2e9c38e>"
User-Agent: (belle-sip/1.4.2)

v=0
o=21 4032 72 IN IP4 192.168.1.64
s=Talk
c=IN IP4 192.168.1.64
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 0 8 9 101
a=rtpmap:101 telephone-event/8000
m=video 9078 RTP/AVP 96
a=rtpmap:96 VP8/90000
<------------->
--- (13 headers 10 lines) ---
Sending to 192.168.1.64:5061 (NAT)
Sending to 192.168.1.64:5061 (NAT)
Using INVITE request as basis request - WObYzmVV0R
Found peer '21' for '21' from 192.168.1.64:5061

<--- Reliably Transmitting (no NAT) to 192.168.1.64:5061 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.6eUkO3~m8;received=192.168.1.64;rport=5061
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61;tag=as7b33609c
Call-ID: WObYzmVV0R
CSeq: 20 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="53ab0b1d"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'WObYzmVV0R' in 32000 ms (Method: INVITE)
Retransmitting #1 (no NAT) to 192.168.1.64:5061:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.6eUkO3~m8;received=192.168.1.64;rport=5061
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61;tag=as7b33609c
Call-ID: WObYzmVV0R
CSeq: 20 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="53ab0b1d"
Content-Length: 0


---

<--- SIP read from UDP:192.168.1.64:5061 --->
ACK sip:22@192.168.1.61 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.6eUkO3~m8;rport
Call-ID: WObYzmVV0R
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: <sip:22@192.168.1.61>;tag=as7b33609c
Contact: <sip:21@192.168.1.64:5061>;+sip.instance="<urn:uuid:982343a1-4d82-400a-b4c8-2ffdd2e9c38e>"
Max-Forwards: 70
CSeq: 20 ACK

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:192.168.1.64:5061 --->
INVITE sip:22@192.168.1.61 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.VKid1UbRb;rport
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61
CSeq: 21 INVITE
Call-ID: WObYzmVV0R
Max-Forwards: 70
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 266
Contact: <sip:21@192.168.1.64:5061>;+sip.instance="<urn:uuid:982343a1-4d82-400a-b4c8-2ffdd2e9c38e>"
User-Agent: (belle-sip/1.4.2)
Authorization: Digest realm="asterisk", nonce="53ab0b1d", algorithm=MD5, username="21", uri="sip:22@192.168.1.61", response="ba918040fc7754664da45d133a891e90"

v=0
o=21 4032 72 IN IP4 192.168.1.64
s=Talk
c=IN IP4 192.168.1.64
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 0 8 9 101
a=rtpmap:101 telephone-event/8000
m=video 9078 RTP/AVP 96
a=rtpmap:96 VP8/90000
<------------->
--- (14 headers 10 lines) ---
Sending to 192.168.1.64:5061 (no NAT)
Using INVITE request as basis request - WObYzmVV0R
Found peer '21' for '21' from 192.168.1.64:5061
  == Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 9
Found RTP audio format 101
Found audio description format telephone-event for ID 101
Found RTP video format 96
Found video description format VP8 for ID 96
Capabilities: us - (ulaw|alaw|gsm|h263), peer - audio=(ulaw|alaw|g722)/video=(vp8)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
       > 0x7fa350005ac0 -- Strict RTP learning after remote address set to: 192.168.1.64:7078
Peer audio RTP is at port 192.168.1.64:7078
Looking for 22 in phones (domain 192.168.1.61)
sip_route_dump: route/path hop: <sip:21@192.168.1.64:5061>

<--- Transmitting (no NAT) to 192.168.1.64:5061 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.VKid1UbRb;received=192.168.1.64;rport=5061
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61
Call-ID: WObYzmVV0R
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:22@192.168.1.61:5060>
Content-Length: 0


<------------>
    -- Executing [22@phones:1] Dial("SIP/21-00000008", "SIP/22") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 10000
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.1.23:41948:
INVITE sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws SIP/2.0
Via: SIP/2.0/WS 192.168.1.61:5060;branch=z9hG4bK576e63b5;rport
Max-Forwards: 70
From: "DoorPi" <sip:21@192.168.1.61>;tag=as48c94faa
To: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>
Contact: <sip:21@192.168.1.61:5060;transport=ws>
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 16.3.0
Date: Wed, 15 May 2019 10:33:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 812

v=0
o=root 1193167457 1193167457 IN IP4 192.168.1.61
s=Asterisk PBX 16.3.0
c=IN IP4 192.168.1.61
t=0 0
m=audio 10000 RTP/SAVPF 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=ice-ufrag:3b9ae8b17a61f1c00c7605160ce4f48b
a=ice-pwd:3792976e08321e6331a66c6269cdd957
a=candidate:Hc0a8013d 1 UDP 2130706431 192.168.1.61 10000 typ host
a=candidate:Hac110001 1 UDP 2130706431 172.17.0.1 10000 typ host
a=candidate:Hc0a8013d 2 UDP 2130706430 192.168.1.61 10001 typ host
a=candidate:Hac110001 2 UDP 2130706430 172.17.0.1 10001 typ host
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 26:34:B3:09:C4:12:FD:86:6D:7D:CF:D5:12:08:7E:4D:89:EA:94:51:A6:94:9D:61:A8:F0:A2:F3:E9:62:7B:21
a=rtcp-mux
a=sendrecv

---
    -- Called SIP/22

<--- SIP read from WS:192.168.1.23:41948 --->
SIP/2.0 100 Trying
Via: SIP/2.0/WS 192.168.1.61:5060;branch=z9hG4bK576e63b5;rport
To: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>
From: "DoorPi" <sip:21@192.168.1.61>;tag=as48c94faa
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 102 INVITE
Supported: timer,ice,replaces,outbound
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from WS:192.168.1.23:41948 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/WS 192.168.1.61:5060;branch=z9hG4bK576e63b5;rport
To: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;tag=sjqg5am81i
From: "DoorPi" <sip:21@192.168.1.61>;tag=as48c94faa
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 102 INVITE
Contact: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>
Supported: timer,ice,replaces,outbound
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>
    -- SIP/22-00000009 is ringing

<--- Transmitting (no NAT) to 192.168.1.64:5061 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.VKid1UbRb;received=192.168.1.64;rport=5061
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61;tag=as4e016cb5
Call-ID: WObYzmVV0R
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:22@192.168.1.61:5060>
Content-Length: 0


<------------>

<--- SIP read from UDP:192.168.1.64:5061 --->
ACK sip:22@192.168.1.61 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.6eUkO3~m8;rport
Call-ID: WObYzmVV0R
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: <sip:22@192.168.1.61>;tag=as7b33609c
Contact: <sip:21@192.168.1.64:5061>;+sip.instance="<urn:uuid:982343a1-4d82-400a-b4c8-2ffdd2e9c38e>"
Max-Forwards: 70
CSeq: 20 ACK

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->
       > 0x7fa3dc003fb0 -- Strict RTP learning after remote address set to: 192.168.1.23:36286

<--- SIP read from WS:192.168.1.23:41948 --->
SIP/2.0 200 OK
Via: SIP/2.0/WS 192.168.1.61:5060;branch=z9hG4bK576e63b5;rport
To: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;tag=sjqg5am81i
From: "DoorPi" <sip:21@192.168.1.61>;tag=as48c94faa
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 102 INVITE
Contact: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>
Session-Expires: 90;refresher=uas
Supported: timer,ice,replaces,outbound
Content-Type: application/sdp
Content-Length: 1128

v=0
o=- 916595910881380803 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS gqow1fpzCUqPVS4jaob24Du3CgPJ85dEcEbI
m=audio 36286 RTP/SAVPF 0 8 101
c=IN IP4 81.241.35.139
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:2787077078 1 udp 2122260223 192.168.1.23 36286 typ host generation 0 network-id 1 network-cost 10
a=candidate:1343164930 1 udp 1686052607 81.241.35.139 36286 typ srflx raddr 192.168.1.23 rport 36286 generation 0 network-id 1 network-cost 10
a=ice-ufrag:QMmA
a=ice-pwd:QhhgqWo0i7ixv7R2yCTrcJVy
a=ice-options:trickle
a=fingerprint:sha-256 C1:AA:9B:A5:50:DF:13:6D:27:30:15:10:74:E1:FC:6D:64:9D:4F:91:8C:D0:93:88:6C:3F:14:8F:4F:DD:5C:91
a=setup:active
a=mid:0
a=sendrecv
a=msid:gqow1fpzCUqPVS4jaob24Du3CgPJ85dEcEbI 57d58650-47a7-4b62-854e-a934992ec5de
a=rtcp-mux
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=ssrc:1053076092 cname:x4hLn7kWwt2A5iPw
a=ssrc:1053076092 msid:gqow1fpzCUqPVS4jaob24Du3CgPJ85dEcEbI 57d58650-47a7-4b62-854e-a934992ec5de
a=ssrc:1053076092 mslabel:gqow1fpzCUqPVS4jaob24Du3CgPJ85dEcEbI
a=ssrc:1053076092 label:57d58650-47a7-4b62-854e-a934992ec5de
<------------->
--- (11 headers 26 lines) ---
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|h263), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 81.241.35.139:36286
sip_route_dump: route/path hop: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>
Transmitting (NAT) to 192.168.1.23:41948:
ACK sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws SIP/2.0
Via: SIP/2.0/WS 192.168.1.61:5060;branch=z9hG4bK0cb4cdb9;rport
Max-Forwards: 70
From: "DoorPi" <sip:21@192.168.1.61>;tag=as48c94faa
To: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;tag=sjqg5am81i
Contact: <sip:21@192.168.1.61:5060;transport=ws>
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 16.3.0
Content-Length: 0


---
    -- SIP/22-00000009 answered SIP/21-00000008
Audio is at 10006
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (no NAT) to 192.168.1.64:5061 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.64:5061;branch=z9hG4bK.VKid1UbRb;received=192.168.1.64;rport=5061
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: sip:22@192.168.1.61;tag=as4e016cb5
Call-ID: WObYzmVV0R
CSeq: 21 INVITE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:22@192.168.1.61:5060>
Content-Type: application/sdp
Content-Length: 643

v=0
o=root 1137579837 1137579837 IN IP4 192.168.1.61
s=Asterisk PBX 16.3.0
c=IN IP4 192.168.1.61
t=0 0
m=audio 10006 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=ice-ufrag:0853657947bf76773c6e039c60912b5f
a=ice-pwd:0c8f3c7b03ffddd467bf3d7d4ed41ce3
a=candidate:Hc0a8013d 1 UDP 2130706431 192.168.1.61 10006 typ host
a=candidate:Hac110001 1 UDP 2130706431 172.17.0.1 10006 typ host
a=candidate:Hc0a8013d 2 UDP 2130706430 192.168.1.61 10007 typ host
a=candidate:Hac110001 2 UDP 2130706430 172.17.0.1 10007 typ host
a=sendrecv
m=video 0 RTP/AVP 96

<------------>
    -- Channel SIP/22-00000009 joined 'simple_bridge' basic-bridge <542ccbd6-e96c-45d3-b885-a6a61489d738>
    -- Channel SIP/21-00000008 joined 'simple_bridge' basic-bridge <542ccbd6-e96c-45d3-b885-a6a61489d738>
       > 0x7fa3dc003fb0 -- Strict RTP learning after ICE completion

<--- SIP read from UDP:192.168.1.64:5061 --->
ACK sip:22@192.168.1.61:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.64:5061;rport;branch=z9hG4bK.0WHEBcg0z
From: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
To: <sip:22@192.168.1.61>;tag=as4e016cb5
CSeq: 21 ACK
Call-ID: WObYzmVV0R
Max-Forwards: 70
Authorization: Digest realm="asterisk", nonce="53ab0b1d", algorithm=MD5, username="21", uri="sip:22@192.168.1.61", response="ba918040fc7754664da45d133a891e90"

<------------->
--- (8 headers 0 lines) ---
[May 15 10:33:16] WARNING[70][C-00000005]: res_rtp_asterisk.c:2940 __rtp_recvfrom: PJ ICE Rx error status code: 370400 'Bad Request'.
[May 15 10:33:16] WARNING[70][C-00000005]: res_rtp_asterisk.c:2940 __rtp_recvfrom: PJ ICE Rx error status code: 370400 'Bad Request'.
       > 0x7fa350005ac0 -- Strict RTP switching to RTP target address 192.168.1.64:7078 as source
       > 0x7fa350005ac0 -- Strict RTP learning complete - Locking on source address 192.168.1.64:7078

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from WS:192.168.1.23:41948 --->
REGISTER sip:192.168.1.61 SIP/2.0
Via: SIP/2.0/WSS hcg1vd6k6o5r.invalid;branch=z9hG4bK7540389
Max-Forwards: 69
To: <sip:22@192.168.1.61>
From: "intercom" <sip:22@192.168.1.61>;tag=jhichpsf73
Call-ID: 9lgcghkkbjiaj0rrstojms
CSeq: 3 REGISTER
Contact: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:596e810d-27b8-454a-8442-b39293a64986>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.3.5
Content-Length: 0

<------------->
--- (13 headers 0 lines) ---

<--- Transmitting (NAT) to 192.168.1.23:41948 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS hcg1vd6k6o5r.invalid;branch=z9hG4bK7540389;received=192.168.1.23;rport=41948
From: "intercom" <sip:22@192.168.1.61>;tag=jhichpsf73
To: <sip:22@192.168.1.61>;tag=as6d8e0350
Call-ID: 9lgcghkkbjiaj0rrstojms
CSeq: 3 REGISTER
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6fd28ff6"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '9lgcghkkbjiaj0rrstojms' in 32000 ms (Method: REGISTER)

<--- SIP read from WS:192.168.1.23:41948 --->
REGISTER sip:192.168.1.61 SIP/2.0
Via: SIP/2.0/WSS hcg1vd6k6o5r.invalid;branch=z9hG4bK1061855
Max-Forwards: 69
To: <sip:22@192.168.1.61>
From: "intercom" <sip:22@192.168.1.61>;tag=jhichpsf73
Call-ID: 9lgcghkkbjiaj0rrstojms
CSeq: 4 REGISTER
Authorization: Digest algorithm=MD5, username="22", realm="asterisk", nonce="6fd28ff6", uri="sip:192.168.1.61", response="c381b799ed1ebc20ae955eaa983fb066"
Contact: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:596e810d-27b8-454a-8442-b39293a64986>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.3.5
Content-Length: 0

<------------->
--- (14 headers 0 lines) ---

<--- Transmitting (NAT) to 192.168.1.23:41948 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS hcg1vd6k6o5r.invalid;branch=z9hG4bK1061855;received=192.168.1.23;rport=41948
From: "intercom" <sip:22@192.168.1.61>;tag=jhichpsf73
To: <sip:22@192.168.1.61>;tag=as6d8e0350
Call-ID: 9lgcghkkbjiaj0rrstojms
CSeq: 4 REGISTER
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 600
Contact: <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;expires=600
Date: Wed, 15 May 2019 10:33:47 GMT
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '9lgcghkkbjiaj0rrstojms' in 32000 ms (Method: REGISTER)

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from WS:192.168.1.23:41948 --->
BYE sip:21@192.168.1.61:5060;transport=ws SIP/2.0
Via: SIP/2.0/WSS hcg1vd6k6o5r.invalid;branch=z9hG4bK206646
Max-Forwards: 69
To: <sip:21@192.168.1.61>;tag=as48c94faa
From: "intercom" <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;tag=sjqg5am81i
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 976 BYE
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: outbound
User-Agent: JsSIP 3.3.5
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Scheduling destruction of SIP dialog '5b5966d259b1213251604cc936fa416c@192.168.1.61:5060' in 32000 ms (Method: BYE)

<--- Transmitting (NAT) to 192.168.1.23:41948 --->
SIP/2.0 200 OK
Via: SIP/2.0/WSS hcg1vd6k6o5r.invalid;branch=z9hG4bK206646;received=192.168.1.23;rport=41948
From: "intercom" <sip:4ii3uo15@hcg1vd6k6o5r.invalid;transport=ws>;tag=sjqg5am81i
To: <sip:21@192.168.1.61>;tag=as48c94faa
Call-ID: 5b5966d259b1213251604cc936fa416c@192.168.1.61:5060
CSeq: 976 BYE
Server: Asterisk PBX 16.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
    -- Channel SIP/22-00000009 left 'simple_bridge' basic-bridge <542ccbd6-e96c-45d3-b885-a6a61489d738>
    -- Channel SIP/21-00000008 left 'simple_bridge' basic-bridge <542ccbd6-e96c-45d3-b885-a6a61489d738>
  == Spawn extension (phones, 22, 1) exited non-zero on 'SIP/21-00000008'
Scheduling destruction of SIP dialog 'WObYzmVV0R' in 32000 ms (Method: ACK)
set_destination: Parsing <sip:21@192.168.1.64:5061> for address/port to send to
set_destination: set destination to 192.168.1.64:5061
Reliably Transmitting (no NAT) to 192.168.1.64:5061:
BYE sip:21@192.168.1.64:5061 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.61:5060;branch=z9hG4bK0f6ec117;rport
Max-Forwards: 70
From: sip:22@192.168.1.61;tag=as4e016cb5
To: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
Call-ID: WObYzmVV0R
CSeq: 102 BYE
User-Agent: Asterisk PBX 16.3.0
Proxy-Authorization: Digest username="21", realm="asterisk", algorithm=MD5, uri="sip:192.168.1.61", nonce="53ab0b1d", response="9119256ca3ae0269723028e1ac269191"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---

<--- SIP read from UDP:192.168.1.64:5061 --->
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.1.61:5060;branch=z9hG4bK0f6ec117;rport
From: <sip:22@192.168.1.61>;tag=as4e016cb5
To: "DoorPi" <sip:21@192.168.1.61>;tag=oxFiYhfxD
Call-ID: WObYzmVV0R
CSeq: 102 BYE
User-Agent: (belle-sip/1.4.2)
Supported: outbound

<------------->
--- (8 headers 0 lines) ---
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog 'WObYzmVV0R' Method: ACK

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->
Really destroying SIP dialog '9lgcghkkbjiaj0rrstojms' Method: REGISTER

<--- SIP read from UDP:192.168.1.64:5061 --->


<------------->
Really destroying SIP dialog '5b5966d259b1213251604cc936fa416c@192.168.1.61:5060' Method: BYE

<--- SIP read from UDP:192.168.1.64:5061 --->

Thanks again,
Ronald

#4

You would need to look at the ICE negotiation then to see what path is being chosen. This can be seen in chrome://webrtc-internals as well as Wireshark. Your problem may still be Docker, which is why I suggested trying outside of it. Keeping the environment as simple as possible for WebRTC is the best way forward because you’re dealing with the black box that is the browser, the network, and Asterisk, which is already complex.

I should also add that I have no idea of the current state of WebRTC with chan_sip. The browser may have done something to break it.

#5

Ok, I will look into it.

Small update: I can confirm however that two-way audio is working, but it’s too silent on the browser. I checked it with CAVA (Console-based Audio Visualizer for Alsa) and I can see that on the browser side, audio is coming through but at a very low level.

#6

Asterisk doesn’t manipulate the audio in a simple bridged scenario. It passes it through as received, unless transcoding is involved but even then unless the codec itself touches the volume it should remain the same.

Your config doesn’t specify codecs so it would go to default. I’d suggest adding “allow=!all,ulaw” to both as a test to force ulaw.

1 Like
#7

Problem solved (but I don’t understand it though)!! And, off course not related to Asterisk :slight_smile:

Putting the answer here as perhaps it may help fellow googlers:

So, in the doorpi configuration one must specify the capture device (so usb microphone, …), which is then used by linphone.
If I do cat /proc/asound/cards this gives me the following:

pi@raspberrypi:/usr/local/etc/DoorPi/conf $ cat /proc/asound/cards 
 0 [sndrpigooglevoi]: snd_rpi_googlev - snd_rpi_googlevoicehat_soundcar
                      snd_rpi_googlevoicehat_soundcard

According to the documentation, it should then be as follows:

capture_device = ALSA: snd_rpi_googlevoicehat_soundcar

This sometimes works, but if it works, the recored audio is way too silent. Off course I double, tripple and 15-pple checked alsamixer if my recording level was ok.

The solution was to put:

capture_device = ALSA: default device

Now, I’m having audio from the pi zero w to my browser running jssip, confirmed by CAVA. I’ll test the full-duplex audio tomorrow :sunny: