Skip to content

Conversation

@cloudwebrtc
Copy link
Member

I added state storage to flutter-webrtc.
flutter-webrtc/flutter-webrtc@396af85
Try to fix the error after receiving 180/183 with SDP.

//if (this._connection.signalingState == RTCSignalingState.RTCSignalingStateStable)
/*{
if (this._connection.signalingState ==
RTCSignalingState.RTCSignalingStateStable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works if this line is changed to

RTCSignalingState.RTCSignalingStateHaveLocalOffer) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks wrong. If the status is not RTCSignalingStateHaveLocalOffer after receiving 180/183 with SDP, maybe we should check if the early media is properly connected.

@ghenry
Copy link
Collaborator

ghenry commented Sep 26, 2019 via email

@cloudwebrtc
Copy link
Member Author

cloudwebrtc commented Sep 26, 2019

Yes, there are already designs in JsSIP, but the expected state is inconsistent.
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/signalingState#RTCSignalingState_enum_2

The explanation of stable is as follows:

There is no ongoing exchange of offer and answer underway. 
This may mean that the RTCPeerConnection object is new,
in which case both the localDescription and remoteDescription are null;
it may also mean that negotiation is complete and a connection has been established.

If you have already received 180/183 with SDP, the status here should be "have-remote-pranswer" because pc has completed an offer/answer process

@cloudwebrtc
Copy link
Member Author

I use this branch to test the call on FreeSwitch, answered after receiving the early media, it seems to work fine.

@rlsutton1
Copy link
Contributor

It's a holiday here tomorrow, but I can arrange access to an asterisk system next week if that helps.

@cloudwebrtc
Copy link
Member Author

@rlsutton1 If you can, please send the asterisk test account to my Github email to reproduce the error, but I have a week holiday and go online again on October 3.

@cloudwebrtc
Copy link
Member Author

The expected state should be RTCSignalingStateStable because the SDP negotiation has been completed.

The explanation of stable is as follows:

There is no ongoing exchange of offer and answer underway. 
This may mean that the RTCPeerConnection object is new,
in which case both the localDescription and remoteDescription are null;
**it may also mean that negotiation is complete and a connection has been established.**

==> it may also mean that negotiation is complete and a connection has been established. <==

So I think this PR is correct, and when you test on Asterisk, the state is RTCSignalingState.RTCSignalingStateHaveLocalOffer, I guess your state is after the completion of CreateOffer and SetLocalDescription, but before receiving the 180/183 SDP, but I don't understand why I can't setRemoteDescription.

@mohbadar
Copy link

mohbadar commented May 15, 2023

I’ve been attempting to connect with FreeSWITCH using the provided example in this repo, but without success. Can anyone provide me with a working example for connecting with FreeSWITCH? I’ve even tried using code generated by ChatGPT, but it didn’t work. I’ve been stuck on this for days and would appreciate any help.
@cloudwebrtc @ghenry @rlsutton1 @DooMMasteR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants