flutterjanus / flutter_janus_client

A plugin that allows the flutter app to communicate with a Janus server using different transport mechanisms, such as WebSocket and HTTP(rest). It features a developer-friendly api to interact with various WebRTC Janus Plugins. Hence, it can be considered as a swiss-knife for WebRTC solutions.
MIT License
134 stars 76 forks source link

Error When try to create an answer #154

Closed mazen930 closed 8 months ago

mazen930 commented 9 months ago

When i receive an incoming call and try to call accept i got error e = "Unable to RTCPeerConnection::createAnswer: Error (null)" This happens whey i try to do as you in example , like the following :

 var answer = await sip?.createAnswer();
 await sip?.accept(sessionDescription: answer);

Any what what could be the problem of how i can solve it ?

shivanshtalwar commented 9 months ago

Can you verify your configuration on janus sip demo on their official website? If it works there then i will investigate it otherwise it has got something to do with your sip service

mazen930 commented 9 months ago

I have java script client that works fine with my sip configuration and outbound is working fine with this client , only answering the incoming call is the problem

mazen930 commented 9 months ago

Any update ?

shivanshtalwar commented 9 months ago

Please try using 2.2.14 and tell me if that works for you in the meantime i will fix it

shivanshtalwar commented 9 months ago

can you try latest commit if it works for you and let me know?

mazen930 commented 9 months ago

Actually your commit doesn't fix it , the problem still occurs

shivanshtalwar commented 9 months ago

Ok tell me platform on which you are experiencing this issue

mazen930 commented 9 months ago

Ok tell me platform on which you are experiencing this issue

IOS

mazen930 commented 9 months ago

Any update ?

shivanshtalwar commented 9 months ago

I still need time to investigate it, thank you for your patience

mazen930 commented 9 months ago

Any update here ?

shivanshtalwar0 commented 9 months ago

hi @mazen930 so i tried on two ios simulators with test sip credentials and everything seems to be working just fine i will need more info on your issue to reproduce the problem

mazen930 commented 8 months ago

Below is the full error appears when i try to create an answer , i use actual phone to test ,not an emulator , i appreciate if you can look it it

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unable to RTCPeerConnection::createAnswer: Error (null)
#0      RTCPeerConnectionNative.createAnswer (package:flutter_webrtc/src/native/rtc_peerconnection_impl.dart:355:7)
<asynchronous suspension>
#1      JanusPlugin.createAnswer (package:janus_client/janus_plugin.dart:586:38)
<asynchronous suspension>
#2      Janus.acceptCall (package:maqsam/models/services/web_rtc_clients/janus_client.dart:177:18)
<asynchronous suspension>
mazen930 commented 8 months ago

After debugging , it appears that await sip?.handleRemoteJsep(event.jsep); was not configured properly when receiving incoming event , the error was ambiguous and miss leading me in another direction , i suggest edit your example take that line of of the method that handles the UI showIncomingDialogBox or something like that , anyway thank you @shivanshtalwar0 for your effort and help

shivanshtalwar commented 8 months ago

Thanks for your debugging as well, i would appreciate if you could make a little pr for the same if you have time otherwise no problem i will do later

mazen930 commented 8 months ago

I added a pull request with changes needed to make the sip plugin work correctly , and i will also add another pull request to update the example to be more informative