team-telnyx / flutter-voice-sdk

Telnyx Flutter WebRTC SDK - Enable real-time communication with WebRTC and Telnyx
MIT License
12 stars 5 forks source link

[Bug] Call Audio/Mic not working #13

Closed icodelifee closed 2 years ago

icodelifee commented 2 years ago

Bug Category

SDK Version telnyx_webrtc: ^0.0.3

Describe the bug After the receiver accepts the call, both the caller nor the receiver cannot hear any audio from the device

Expected behavior The caller and receiver should be able to hear and speak

Device (please complete the following information):

Logs INVITATION ANSWERED :: {jsonrpc: 2.0, id: 67246, method: telnyx_rtc.answer, params: {callID: Instance of 'Uuid', variables: {Event-Name: CHANNEL_DATA, Core-UUID: efaeab2c-2067-42d3-b973-37aa4330ac97, FreeSWITCH-Hostname: b2bua-rtc.tel-sy1-ibm-prod-133, FreeSWITCH-Switchname: b2bua-rtc.tel-sy1-ibm-prod-133, FreeSWITCH-IPv4: 10.33.0.80, FreeSWITCH-IPv6: ::1, Event-Date-Local: 2022-08-19 14:24:34, Event-Date-GMT: Fri, 19 Aug 2022 14:24:34 GMT, Event-Date-Timestamp: 1660919074493112, Event-Calling-File: switch_channel.c, Event-Calling-Function: switch_channel_get_variables_prefix, Event-Calling-Line-Number: 4576, Event-Sequence: 163053}}}

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee. Can You please test call via our test tool here:

https://webrtc.telnyx.com/

You can log in with sip credentials and call your flutter app. It would be nice to confirm if in this case there is still no audio on both ends so we can isolate it to the flutter SDK.

Oliver-Zimmerman commented 2 years ago

@icodelifee I just tested one more time with the example app and it all seems to be working correctly.

Can you have a look at the reference application here: https://github.com/team-telnyx/telnyx-webrtc-flutter/tree/main/lib

It's a very simple implementation but should give you a good idea of how it works.

Do you have the correct permissions in the manifest?

icodelifee commented 2 years ago

Hi @icodelifee. Can You please test call via our test tool here:

webrtc.telnyx.com

You can log in with sip credentials and call your flutter app. It would be nice to confirm if in this case there is still no audio on both ends so we can isolate it to the flutter SDK.

I tried the webrtc app and was able to make calls using credentials but for my use case, we only require outbound calls

icodelifee commented 2 years ago

Screenshot 2022-08-19 at 9 29 55 PM Yep i think i do have correct permissions

@icodelifee I just tested one more time with the example app and it all seems to be working correctly.

Can you have a look at the reference application here: main/lib

It's a very simple implementation but should give you a good idea of how it works.

Do you have the correct permissions in the manifest?

icodelifee commented 2 years ago

I tried using the example app image

icodelifee commented 2 years ago

Also facing this issue, even though i tried using the same organization number in webrtc.telnyx.com where it worked fine Screenshot 2022-08-19 at 9 35 25 PM

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee. Can You please test call via our test tool here: webrtc.telnyx.com You can log in with sip credentials and call your flutter app. It would be nice to confirm if in this case there is still no audio on both ends so we can isolate it to the flutter SDK.

I tried the webrtc app and was able to make calls using credentials but for my use case, we only require outbound calls

So in this case please log into that web app and then call the web app credentials from your flutter application

Oliver-Zimmerman commented 2 years ago

Also facing this issue, even though i tried using the same organization number in webrtc.telnyx.com where it worked fine Screenshot 2022-08-19 at 9 35 25 PM

Please share the exact invite message sent on the socket

Oliver-Zimmerman commented 2 years ago

I tried using the example app image

Are you on the Main branch? This error isn't happening for me currently. I will spend some time this weekend looking into this though.

There is a refactor that we have planned which will simplify this flow and might indirectly fix this issue

icodelifee commented 2 years ago

Also facing this issue, even though i tried using the same organization number in webrtc.telnyx.com where it worked fine Screenshot 2022-08-19 at 9 35 25 PM

Please share the exact invite message sent on the socket https://katb.in/porozosiwor [Edited with full logs]

icodelifee commented 2 years ago

I tried using the example app image

Are you on the Main branch? This error isn't happening for me currently. I will spend some time this weekend looking into this though.

There is a refactor that we have planned which will simplify this flow and might indirectly fix this issue

Yes im using the main branch

Oliver-Zimmerman commented 2 years ago

Also facing this issue, even though i tried using the same organization number in webrtc.telnyx.com where it worked fine Screenshot 2022-08-19 at 9 35 25 PM

Please share the exact invite message sent on the socket https://katb.in/porozosiwor [Edited with full logs]

Have you enabled the +91 call code area within your portal?

I tried using the example app image

Are you on the Main branch? This error isn't happening for me currently. I will spend some time this weekend looking into this though. There is a refactor that we have planned which will simplify this flow and might indirectly fix this issue

Yes im using the main branch

Strange, I will look in to this. You can't build a call without being logged in successfully which sets that sessionId. To me this sounds like somehow you aren't receiving a sessionId or logging in successfully before trying to create a call. Do you get a gateway registered log before attempting to make a call? Screenshot 2022-08-19 at 17 21 00

icodelifee commented 2 years ago

Also facing this issue, even though i tried using the same organization number in webrtc.telnyx.com where it worked fine Screenshot 2022-08-19 at 9 35 25 PM

Please share the exact invite message sent on the socket katb.in/porozosiwor [Edited with full logs]

Have you enabled the +91 call code area within your portal?

I tried using the example app image

Are you on the Main branch? This error isn't happening for me currently. I will spend some time this weekend looking into this though. There is a refactor that we have planned which will simplify this flow and might indirectly fix this issue

Yes im using the main branch

Strange, I will look in to this. You can't build a call without being logged in successfully which sets that sessionId. To me this sounds like somehow you aren't receiving a sessionId or logging in successfully before trying to create a call. Do you get a gateway registered log before attempting to make a call? Screenshot 2022-08-19 at 17 21 00

Yes i do receive the gateway log and yes +91 is enabled, i was able to make calls in my app Screenshot 2022-08-19 at 9 53 12 PM

icodelifee commented 2 years ago

I'm in the Telnyx slack, if you would like you test with my credentials, maybe we could contact through there

Oliver-Zimmerman commented 2 years ago

Okay, I will look into this over the weekend and will do a relevant patch if required on Monday.

icodelifee commented 2 years ago

Hi @icodelifee. Can You please test call via our test tool here: webrtc.telnyx.com You can log in with sip credentials and call your flutter app. It would be nice to confirm if in this case there is still no audio on both ends so we can isolate it to the flutter SDK.

I tried the webrtc app and was able to make calls using credentials but for my use case, we only require outbound calls

So in this case please log into that web app and then call the web app credentials from your flutter application

i think we only have one telnyx number so i don't know if that will work or not

icodelifee commented 2 years ago

Okay, I will look into this over the weekend and will do a relevant patch if required on Monday.

Thank you

icodelifee commented 2 years ago

Hey, any update? @Oliver-Zimmerman

Oliver-Zimmerman commented 2 years ago

@icodelifee Fixed: https://github.com/team-telnyx/telnyx-webrtc-flutter/pull/14

Please test with telnyx_webrtc: ^0.0.4

icodelifee commented 2 years ago

@icodelifee Fixed: #14

Please test with telnyx_webrtc: ^0.0.4

Thank you for the update, I'm testing it right now and the mic and audio still doesnt work and also SocketMethod.BYE and RINGING is not being returned in the callback" logs: https://katb.in/ujoyituzayi

icodelifee commented 2 years ago

I had a chat with Telnyx representative the other day and i tried calling them through my app and i was able to hear and speak without any issue, i dont know why it doesnt work with other number

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee thanks for the PR! Ringing doesn't necessarily need to be added because you should receive an INVITE message that functions the same, however I will review your PR and test it and merge if all is working.

In terms of BYE, what do you mean? You aren't getting a bye message when a call ends? It could be that the message isn't being interpreted by JSON as an actual BYE message. I can look into that

icodelifee commented 2 years ago

Hi @icodelifee thanks for the PR! Ringing doesn't necessarily need to be added because you should receive an INVITE message that functions the same, however I will review your PR and test it and merge if all is working.

In terms of BYE, what do you mean? You aren't getting a bye message when a call ends? It could be that the message isn't being interpreted by JSON as an actual BYE message. I can look into that

Hi, I did not receive an INVITE message when I tried calling a number, I needed RINGING for a specific use case.

I only receive bye when i endCall programmatically and not when I hang up the call on the receiving mobile. I want to know if the receiver hangup the call so I can update the UI .

Oliver-Zimmerman commented 2 years ago

@icodelifee can you confirm if this is calling a SIP Connection or an actual mobile number?

icodelifee commented 2 years ago

@icodelifee can you confirm if this is calling a SIP Connection or an actual mobile number?

actual number

Oliver-Zimmerman commented 2 years ago

Thanks, I'll look into this right now

Oliver-Zimmerman commented 2 years ago

Okay I can reproduce, I was testing before with SIP connections. I will look into a solution

icodelifee commented 2 years ago

Hey @Oliver-Zimmerman, i just tried the example app and I'm not able to hear anything E63C8E87-57A2-4A70-AE99-B58F09ECAC1A_1_102_o telegram-cloud-photo-size-5-6073577828563136835-y

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee, as mentioned before. I can reproduce this now and am working on it. Before I was testing sip connection to sip connection. The error is between sip connection and a real number.

I will update you when I can.

icodelifee commented 2 years ago

Hi, any updates? Thank you

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee, we are still working on this issue. It's very strange and may be related to the backend. We are entirely sure why it is only affecting PSTN calls. I am hoping to have a more substantial update for you by the end of today

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee, we have isolated the issue to something relating to the Flutter WebRTC library and how it is interacting with our backend. We are working to patch it at the moment. It involves Ice Candidates including a local host IP address. We are testing ignoring it as it comes in. Hoping to have it resolved today

Oliver-Zimmerman commented 2 years ago

@icodelifee we have a fix. I am opening a PR now. Once it is merged I will release a new version that contains your RINGING code as well

Oliver-Zimmerman commented 2 years ago

@icodelifee https://github.com/team-telnyx/telnyx-webrtc-flutter/pull/16

Oliver-Zimmerman commented 2 years ago

@icodelifee we have released 0.0.5 https://pub.dev/packages/telnyx_webrtc

Please test and close if it is working

icodelifee commented 2 years ago

Hey @Oliver-Zimmerman, I just tested and calls are working fine. Thank you. But is there a way to switch from speakerphone to earpiece speaker.

Oliver-Zimmerman commented 2 years ago

Hi @icodelifee, it is possible but would require a small bit of development. If you open a feature request I can add it to the backlog and notify you when it is complete.

Essentially we need to add a method that gets the current track and .enableSpearkerphone(true) or false. I will close this current issue for now. Please open a feature request instead.