Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route incoming call #788

Open
nitishymtpl opened this issue Jun 15, 2024 · 6 comments
Open

Route incoming call #788

nitishymtpl opened this issue Jun 15, 2024 · 6 comments

Comments

@nitishymtpl
Copy link

Hello guys,

I want to forward my incoming call to SIP URI e.g Sip:[email protected]. How to achieve it?

Thanks

@Irfanwani
Copy link

I am not sure, i am also trying to achieve something similar, but here is how i am trying it. when using sip, we get an invite when someone calls us which we can handle using onInvite delegate of useragent. That is passed with the invitation object which is the main thing.

Here is react-native-callkeep, we can use listeners to check if the call is answered or rejected or any other action is taken like this:

RNCallKeep.addEventListener('answerCall', onAnswerCall);
RNCallKeep.addEventListener('endCall', onEndCall);

Then, we need to have access to the invitation object from sip and inside the onAnswerCAll function, we can call, invitation.accept() to accept the call and so on.

@nitishymtpl
Copy link
Author

nitishymtpl commented Jun 30, 2024 via email

@Irfanwani
Copy link

Irfanwani commented Jun 30, 2024

If you are talking about the listeners, yes it is working now, still working on the sip part.

@nitishymtpl
Copy link
Author

nitishymtpl commented Jun 30, 2024 via email

@Irfanwani
Copy link

Sorry, I was just talking about the listeners. But talking about the SIP part, here is the flow,
You need to set the listeners for callkeep so that whenever a user interacts with the call buttons i.e, either accepts the call or rejects it (or similarly we have other listeners too like when a user toggles mute etc), the call back function should handle the rest. For that, inside the callback functions provided to listeners, you should have access to the invitation object coming from onInvite method of user agent delegate.
The, you just need to call accept or reject in the callback functions accordingly.

@Irfanwani
Copy link

I tested the listeners in foreground and it works, but not when the app is killed. Also, when answering the call, call accepted screen is never shown, it just shows a blank screen and then after some time shows the incoming call UI again.

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

No branches or pull requests

2 participants