Webrtc in Asterisk SIPML5


#1

Hello all,

I am facing an issue for the past two weeks about webrtc in asterisk…I had successfully installed asterisk and integrated webrtc SIPML5 in amazon ec2 instance…
extensions getting registered in firefox and the call flows but there is one way audio issue …
when i call lan to lan it works through speakers not from microphone.
If anyone can help me to solve this issue …plz.

I also attached sip debug and rtp debug logs below

Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025679, ts 4088251816, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028219, ts 4088251979, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025680, ts 4088251976, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009086, ts 1596214143, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020622, ts 1596214136, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009087, ts 1596214303, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020623, ts 1596214296, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028220, ts 4088252139, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025681, ts 4088252136, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028221, ts 4088252299, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025682, ts 4088252296, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009088, ts 1596214463, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020624, ts 1596214456, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009089, ts 1596214623, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020625, ts 1596214616, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028222, ts 4088252459, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025683, ts 4088252456, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009090, ts 1596214783, len 000160)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028223, ts 4088252619, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025684, ts 4088252616, len 000170)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020626, ts 1596214776, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009091, ts 1596214943, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020627, ts 1596214936, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028224, ts 4088252779, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025685, ts 4088252776, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009092, ts 1596215103, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020628, ts 1596215096, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028225, ts 4088252939, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025686, ts 4088252936, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009093, ts 1596215263, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020629, ts 1596215256, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028226, ts 4088253099, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025687, ts 4088253096, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028227, ts 4088253259, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025688, ts 4088253256, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009094, ts 1596215423, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020630, ts 1596215416, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028228, ts 4088253419, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025689, ts 4088253416, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009095, ts 1596215583, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020631, ts 1596215576, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028229, ts 4088253579, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025690, ts 4088253576, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009096, ts 1596215743, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020632, ts 1596215736, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009097, ts 1596215903, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020633, ts 1596215896, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028230, ts 4088253739, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025691, ts 4088253736, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009098, ts 1596216063, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020634, ts 1596216056, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028231, ts 4088253899, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025692, ts 4088253896, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009099, ts 1596216223, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020635, ts 1596216216, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028232, ts 4088254059, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025693, ts 4088254056, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028233, ts 4088254219, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025694, ts 4088254216, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009100, ts 1596216383, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020636, ts 1596216376, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009101, ts 1596216543, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020637, ts 1596216536, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028234, ts 4088254379, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025695, ts 4088254376, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009102, ts 1596216703, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020638, ts 1596216696, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028235, ts 4088254539, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025696, ts 4088254536, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009103, ts 1596216863, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020639, ts 1596216856, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028236, ts 4088254699, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025697, ts 4088254696, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028237, ts 4088254859, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025698, ts 4088254856, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009104, ts 1596217023, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020640, ts 1596217016, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009105, ts 1596217183, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020641, ts 1596217176, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028238, ts 4088255019, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025699, ts 4088255016, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009106, ts 1596217343, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020642, ts 1596217336, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028239, ts 4088255179, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025700, ts 4088255176, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009107, ts 1596217503, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020643, ts 1596217496, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028240, ts 4088255339, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025701, ts 4088255336, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009108, ts 1596217663, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020644, ts 1596217656, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028241, ts 4088255499, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025702, ts 4088255496, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009109, ts 1596217823, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020645, ts 1596217816, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028242, ts 4088255659, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025703, ts 4088255656, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009110, ts 1596217983, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020646, ts 1596217976, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028243, ts 4088255819, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025704, ts 4088255816, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009111, ts 1596218143, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020647, ts 1596218136, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028244, ts 4088255979, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025705, ts 4088255976, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009112, ts 1596218303, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020648, ts 1596218296, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028245, ts 4088256139, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025706, ts 4088256136, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009113, ts 1596218463, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020649, ts 1596218456, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009114, ts 1596218623, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020650, ts 1596218616, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028246, ts 4088256299, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025707, ts 4088256296, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028247, ts 4088256459, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025708, ts 4088256456, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009115, ts 1596218783, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020651, ts 1596218776, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028248, ts 4088256619, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025709, ts 4088256616, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009116, ts 1596218943, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020652, ts 1596218936, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028249, ts 4088256779, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025710, ts 4088256776, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009117, ts 1596219103, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020653, ts 1596219096, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028250, ts 4088256939, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025711, ts 4088256936, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028251, ts 4088257099, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025712, ts 4088257096, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009118, ts 1596219263, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020654, ts 1596219256, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009119, ts 1596219423, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020655, ts 1596219416, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028252, ts 4088257259, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025713, ts 4088257256, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009120, ts 1596219583, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020656, ts 1596219576, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028253, ts 4088257419, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025714, ts 4088257416, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009121, ts 1596219743, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020657, ts 1596219736, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028254, ts 4088257579, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025715, ts 4088257576, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009122, ts 1596219903, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020658, ts 1596219896, len 000170)
Got RTP packet from 103.249.82.14:46906 (type 00, seq 009123, ts 1596220063, len 000160)
Sent RTP packet to 103.249.82.14:62182 (via ICE) (type 00, seq 020659, ts 1596220056, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028255, ts 4088257739, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025716, ts 4088257736, len 000170)
Got RTP packet from 103.249.82.14:62182 (type 00, seq 028256, ts 4088257899, len 000160)
Sent RTP packet to 103.249.82.14:46906 (via ICE) (type 00, seq 025717, ts 4088257896, len 000170)
– Channel SIP/103-00000002 left ‘simple_bridge’ basic-bridge <33468818-05e5-4667-b450-ae31f9be4afd>
== Spawn extension (from-internal, 102, 2) exited non-zero on ‘SIP/103-00000002’
– Channel SIP/102-00000003 left ‘simple_bridge’ basic-bridge <33468818-05e5-4667-b450-ae31f9be4afd>


#2

Check in the wireshark that certificate key is exchange or not with server hello.

if not then
this is realted to dtls fragmentation. Certificate size is too large so that some Internet service provider is not accept the IP fragmentation…so that one way audio.
https://issues.asterisk.org/jira/browse/ASTERISK-28018


#3

hi,
Thanks for the response…
how can we check certificate key is exchanging or not in wireshark


#4

Install wireshark on client side… then start the capture…then type dtls in filter.

then try to call .

then hangup. then stop the capture…there you can see the detials…also you can save pcap file and send.


#5

i am not able to upload pcap …kindly find the screenshot attached here


#6


#7

you are using tcp instead of udp…so certificate exchanging but voice is not coming…so please check the sip.conf and confugure locanet as localip and externip as public ip of call server.


#8

i am currently having this type of configuration in sip.conf

udpbindaddr=0.0.0.0:5060
realm=public ip
externaddr=public ip
media_address=public ip
nat=force_rport,comedia
externip=public ip
rtcachefriends=yes
localnet=localip/255.255.255.0

transport=UDP,WS,TLS,tcp
disallow=all
allow=ulaw


#9

hi,
same issue persists…kindly help me with this issue


#10

You gave @vijaykumar 2 hours to respond. You do not need to post again so soon asking for help again.

If you are deploying WebRTC, though, you need to learn the fundamentals of it because - as you’ve seen - it can and will fail. Your RTP debug also shows media flowing in each direction. You should check on the browser side.


#11

@jcolp
ok thanks for the reply…I had checked in browser side and I wanted to know one thing ie…this issue related to natting or ICE server related …
I am unable to find which side issue persists…


#12

The ICE negotiation and DTLS negotiation appears to have succeeded. If ICE and DTLS didn’t work then you wouldn’t see traffic being sent with (via ICE) and you wouldn’t be receiving media.


#13

@jcolp

So,Now I have cleared that the problem is not with ICE and DTLS negotiation.If there is a Natting issue ,it will not work with LAN to LAN…but it works…Please guide me through this issue…


#14

You have to break down the scenario into its parts, and try to isolate the problem. WebRTC is VERY complex.


#15

@jcolp
Ok thanks for your response…I am trying my best to solve…


#16

For example, have you tried under Chrome to make sure it’s both? Have you tried using JsSIP (which is known to work)?


#17

@jcolp
We had tried under chrome…The extensions got registered but we are unable to call showing that media stream permission disabled… so we had tried using ssl certificate under https through secure connection but in this scenario extensions not getting registered using WS
I have not tried JsSIP yet…


#18

hi,
Now i am getting this error

[Aug 27 17:17:19] NOTICE[13691][C-0000000d]: chan_sip.c:10433 process_sdp: Recei ved AVP profile in audio answer but AVPF is enabled, disabling: audio 5077 RTP/A VP 18 0 8 101
[Aug 27 17:17:19] WARNING[13691][C-0000000d]: chan_sip.c:10840 process_sdp: Fail ed to receive SDP offer/answer with required SRTP crypto attributes for audio
[Aug 27 17:17:25] WARNING[13691]: chan_sip.c:4131 retrans_pkt: Timeout on 0c6b3f 8faf4bb386db2a8cc2fd30f596 on non-critical invite transaction.