TLS transport out going calls via the public ip has white noise in audio and video is not available

I have setup asterisk as pbx and setup port forwards as required.

I have the following etxenions

141 → registered on a softphone using a cellular network on TLS transport
140 → same as above
103 → grandstream phone on the local network of pbx

Situation: When 141 dials 103 all is ok but when 103 dials 141 there is white noise in the audio and no video on 103 , 141 shows some green patches and sometimes video from its own camera

Here is the pjsip history for a call made by 103- 141

No.   Timestamp  (Dir) Address                  SIP Message                        
===== ========== ============================== ===================================
00000 1648106987 * ==> 5.37.215.237:46854       OPTIONS sip:140@5.37.215.237:46854;transport=TLS SIP/2.0
00001 1648106987 * ==> 192.168.1.161:5060       OPTIONS sip:161@192.168.1.161:5060;line=1cedf43bfcd4544 SIP/2.0
00002 1648106987 * <== 5.37.215.237:46854       SIP/2.0 200 OK
00003 1648106987 * <== 192.168.1.194:37063      REGISTER sip:192.168.1.17 SIP/2.0
00004 1648106987 * ==> 192.168.1.194:37063      SIP/2.0 401 Unauthorized
00005 1648106987 * <== 192.168.1.161:5060       SIP/2.0 200 OK
00006 1648106987 * <== 192.168.1.194:37063      REGISTER sip:192.168.1.17 SIP/2.0
00007 1648106987 * ==> 192.168.1.194:37063      SIP/2.0 401 Unauthorized
00008 1648106988 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00009 1648106988 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00010 1648106988 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00011 1648106988 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00012 1648106991 * ==> 192.168.1.101:5062       OPTIONS sip:103@192.168.1.101:5062 SIP/2.0
00013 1648106991 * <== 192.168.1.101:5062       SIP/2.0 200 OK
00014 1648106994 * ==> 5.162.93.198:59422       OPTIONS sip:141@5.162.93.198:59422;transport=TLS SIP/2.0
00015 1648106995 * <== 5.162.93.198:59422       SIP/2.0 200 OK
00016 1648107000 * <== 192.168.1.161:5060       INVITE sip:601@192.168.1.17 SIP/2.0
00017 1648107000 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00018 1648107000 * <== 192.168.1.161:5060       ACK sip:601@192.168.1.17 SIP/2.0
00019 1648107000 * <== 192.168.1.161:5060       INVITE sip:601@192.168.1.17 SIP/2.0
00020 1648107000 * ==> 192.168.1.161:5060       SIP/2.0 100 Trying
00021 1648107000 * ==> 192.168.1.161:5060       SIP/2.0 180 Ringing
00022 1648107000 * ==> 192.168.1.101:5062       INVITE sip:103@192.168.1.101:5062 SIP/2.0
00023 1648107000 * <== 192.168.1.101:5062       SIP/2.0 100 Trying
00024 1648107000 * <== 192.168.1.101:5062       SIP/2.0 180 Ringing
00025 1648107006 * ==> 5.37.215.237:46854       INVITE sip:140@5.37.215.237:46854;transport=TLS SIP/2.0
00026 1648107006 * ==> 5.162.93.198:59422       INVITE sip:141@5.162.93.198:59422;transport=TLS SIP/2.0
00027 1648107006 * <== 5.37.215.237:46854       SIP/2.0 100 Trying
00028 1648107006 * <== 5.37.215.237:46854       SIP/2.0 180 Ringing
00029 1648107006 * <== 5.162.93.198:59422       SIP/2.0 100 Trying
00030 1648107006 * <== 5.162.93.198:59422       SIP/2.0 180 Ringing
00031 1648107011 * <== 5.162.93.198:59422       SIP/2.0 200 OK
00032 1648107011 * ==> 5.162.93.198:59422       ACK sip:141@5.162.93.198:59422;transport=TLS SIP/2.0
00033 1648107011 * ==> 192.168.1.101:5062       CANCEL sip:103@192.168.1.101:5062 SIP/2.0
00034 1648107011 * ==> 5.37.215.237:46854       CANCEL sip:140@5.37.215.237:46854;transport=TLS SIP/2.0
00035 1648107011 * <== 192.168.1.101:5062       SIP/2.0 200 OK
00036 1648107011 * <== 192.168.1.101:5062       SIP/2.0 487 Request Terminated
00037 1648107011 * ==> 192.168.1.101:5062       ACK sip:103@192.168.1.101:5062 SIP/2.0
00038 1648107011 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00039 1648107011 * <== 5.37.215.237:46854       SIP/2.0 200 OK
00040 1648107011 * <== 5.37.215.237:46854       SIP/2.0 487 Request Terminated
00041 1648107011 * ==> 5.37.215.237:46854       ACK sip:140@5.37.215.237:46854;transport=TLS SIP/2.0
00042 1648107011 * <== 5.162.93.198:59422       INFO sip:asterisk@5.37.215.237:5061;transport=TLS SIP/2.0
00043 1648107011 * ==> 5.162.93.198:59422       SIP/2.0 200 OK
00044 1648107011 * ==> 192.168.1.161:5060       INFO sip:161@192.168.1.161:5060 SIP/2.0
00045 1648107011 * <== 192.168.1.161:5060       ACK sip:192.168.1.17:5060 SIP/2.0
00046 1648107011 * <== 192.168.1.161:5060       SIP/2.0 200 OK
00047 1648107018 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00048 1648107018 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00049 1648107018 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00050 1648107018 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00051 1648107021 * <== 5.162.93.198:59422       BYE sip:asterisk@5.37.215.237:5061;transport=TLS SIP/2.0
00052 1648107021 * ==> 5.162.93.198:59422       SIP/2.0 200 OK
00053 1648107021 * ==> 192.168.1.161:5060       BYE sip:161@192.168.1.161:5060 SIP/2.0
00054 1648107021 * <== 192.168.1.161:5060       SIP/2.0 200 OK

Bellow is the pjsip log

You are confusing extensions with devices. Devices can initiate calls, and receive them but extensions are dialled.

TLS doesn’t carry media, so I assume you really meant SRTP.

You have late offer SDP. I hadn’t realised that chan_pjsip even supported that.

The answering device hasn’t offered a video stream, which is probably why you have no video. Maybe if you had used the more standard early offer, Asterisk would have offered one and the responding device would have accepted it.

By “has white noise”, do you mean it is only white noise. I notice that the responder hasn’t provide an encryption key, and that might be related. If you have audio and white noise combined, that isn’t something for which there is any processing in Asterisk that could have that result.

You don’t have any timestamps in the detailed trace which makes me think you screen scraped it, rather than taking it from the full log file.

@david551 Thanks for the detailed answer. Any how I am still a bit confused. Can you please sugget where I can change the SDP offer?

Is it because I have kept in the dial plan a 6 sec delay before it calls the 141 extension?

How can I use the early offer?

By white noise I mean just the white noise and no audio

I wasn’t even aware that Asterisk was capable of doing late offer as a UAC, so I obviously don’t know what triggered that behaviour.

It might, I suppose, be the result of how the latest version handles allow=all; you should always restrict to the codecs you actually expect to use.

1 Like

The two concrened endpoints 141 and 161 are as follows
Can you please checkand let me knwo what should be changed?


[161]
type = aor
max_contacts = 5
remove_existing = yes
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120

[161]
type = auth
username = 161
password = xxx161
nonce_lifetime = 200


[161]
type = endpoint
context=fullrights
rtp_symmetric = yes
rewrite_contact=yes
dtmf_mode = rfc4733
message_context=some_context_that_does_nothing
rtp_symmetric = yes
force_rport=yes
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = vp8
rtp_timeout = 30
timers = yes
direct_media = no
callerid=161 <Door_1>
send_pai = yes
use_avpf = no
tos_audio = ef
tos_video = af41
auth = 161
outbound_auth = 161
aors = 161

**141 — **



[141]
type = aor
max_contacts = 20
qualify_frequency = 60
maximum_expiration = 3600
minimum_expiration = 60
default_expiration = 120
remove_existing = yes

[141]
type = auth
username = 141
password = xxx141

[141]
type = endpoint
rewrite_contact=yes
context=mobile
dtmf_mode = rfc4733
allow = all
disallow = all
allow = ulaw
allow = alaw
allow = gsm
allow = g726
allow = h264
allow = mpeg4
allow = vp8
allow = h263p
rtp_timeout = 30
timers = yes
direct_media = no
callerid=141 <Mobile Exten 141>
send_pai = yes
auth = 141
outbound_auth = 141
aors = 141
dtmf_mode=rfc4733
media_encryption=sdes
transport = transport-tls
rtp_symmetric=yes
force_rport=yes



and this is the transport

[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/asterisk/keys/asterisk.crt
priv_key_file=/etc/asterisk/keys/asterisk.key
method=tlsv1
local_net=192.168.1.0/24
local_net=127.0.0.1/24
external_media_address=82.178.89.4
external_signaling_address=82.178.89.4
external_signaling_port=5061
tos = cs3

In that case, I don’t understand why it is using a late offer.

Now I am also getting the follwoing error some times

On TLS transport I have solved the issue . I had to comment out by commenting out tlsv1 mode line in the transport-tls. and enableing dtles auto genetae for 141.

It works well now but I face a problem in webrtc now . I cant get webrtc to make video still. Audio is fine
As I am not good in reading the debug logs please help in sorting out the issue.

Ip address of the device in local network is 192.168.1.163
the other device is using wifi of the same router and accessing the ws through ws://sip:myddns:8088/ws

No.   Timestamp  (Dir) Address                  SIP Message                        
===== ========== ============================== ===================================
00000 1648385560 * <== 192.168.1.163:5060       INVITE sip:601@192.168.1.17 SIP/2.0
00001 1648385560 * ==> 192.168.1.163:5060       SIP/2.0 401 Unauthorized
00002 1648385560 * <== 192.168.1.163:5060       ACK sip:601@192.168.1.17 SIP/2.0
00003 1648385560 * <== 192.168.1.163:5060       INVITE sip:601@192.168.1.17 SIP/2.0
00004 1648385560 * ==> 192.168.1.163:5060       SIP/2.0 100 Trying
00005 1648385560 * ==> 192.168.1.163:5060       SIP/2.0 180 Ringing
00006 1648385562 * ==> 192.168.1.163:5060       OPTIONS sip:161@192.168.1.163:5060;line=e63b8695feffcc4 SIP/2.0
00007 1648385562 * ==> 192.168.1.161:5060       OPTIONS sip:161@192.168.1.161:5060;line=1cedf43bfcd4544 SIP/2.0
00008 1648385562 * <== 192.168.1.163:5060       SIP/2.0 200 OK
00009 1648385562 * <== 192.168.1.161:5060       SIP/2.0 200 OK
00010 1648385563 * <== 85.154.63.39:40210       REGISTER sip:myddns.ddns.net SIP/2.0
00011 1648385563 * ==> 85.154.63.39:40210       SIP/2.0 401 Unauthorized
00012 1648385563 * <== 85.154.63.39:40210       REGISTER sip:myddns.ddns.net SIP/2.0
00013 1648385563 * ==> 85.154.63.39:40210       SIP/2.0 200 OK
00014 1648385564 * <== 192.168.1.163:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00015 1648385564 * ==> 192.168.1.163:5060       SIP/2.0 401 Unauthorized
00016 1648385564 * <== 192.168.1.163:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00017 1648385564 * ==> 192.168.1.163:5060       SIP/2.0 200 OK
00018 1648385569 * ==> 85.154.63.39:40210       INVITE sip:6w674019@85.154.63.39:40210;transport=ws SIP/2.0
00019 1648385570 * <== 85.154.63.39:40210       SIP/2.0 100 Trying
00020 1648385570 * <== 85.154.63.39:40210       SIP/2.0 180 Ringing
00021 1648385573 * <== 85.154.63.39:40210       SIP/2.0 200 OK
00022 1648385573 * ==> 85.154.63.39:40210       ACK sip:6w674019@85.154.63.39:40210;transport=ws SIP/2.0
00023 1648385573 * ==> 192.168.1.163:5060       SIP/2.0 200 OK
00024 1648385573 * <== 192.168.1.163:5060       ACK sip:192.168.1.17:5060 SIP/2.0
00025 1648385573 * ==> 192.168.1.163:5060       INVITE sip:161@192.168.1.163:5060 SIP/2.0
00026 1648385573 * <== 192.168.1.163:5060       SIP/2.0 100 Trying
00027 1648385574 * <== 192.168.1.163:5060       SIP/2.0 200 OK
00028 1648385574 * ==> 192.168.1.163:5060       ACK sip:161@192.168.1.163:5060 SIP/2.0
00029 1648385580 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00030 1648385580 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00031 1648385580 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00032 1648385580 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00033 1648385581 * <== 85.154.63.39:40210       BYE sip:asterisk@shaula-001:5060;transport=ws SIP/2.0
00034 1648385581 * ==> 85.154.63.39:40210       SIP/2.0 200 OK
00035 1648385581 * ==> 192.168.1.163:5060       BYE sip:161@192.168.1.163:5060 SIP/2.0
00036 1648385581 * <== 192.168.1.163:5060       SIP/2.0 200 OK
00037 1648385594 * <== 192.168.1.163:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00038 1648385594 * ==> 192.168.1.163:5060       SIP/2.0 401 Unauthorized
00039 1648385594 * <== 192.168.1.163:5060       OPTIONS sip:192.168.1.17 SIP/2.0
00040 1648385594 * ==> 192.168.1.163:5060       SIP/2.0 200 OK

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.