react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Route incoming call

Open nitishymtpl opened this issue 1 year ago • 6 comments

Hello guys,

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

Thanks

nitishymtpl avatar Jun 15 '24 02:06 nitishymtpl

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.

Irfanwani avatar Jun 28 '24 12:06 Irfanwani

Hey, Did you checked it? Is it working?

On Fri, Jun 28, 2024, 9:49 PM Irfan Wani @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-callkeep/issues/788#issuecomment-2196833633, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5AHJNVCGIQKLFCCN37D5LZJVLXPAVCNFSM6AAAAABJLJM5SKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJWHAZTGNRTGM . You are receiving this because you authored the thread.Message ID: @.*** com>

nitishymtpl avatar Jun 30 '24 11:06 nitishymtpl

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

Irfanwani avatar Jun 30 '24 11:06 Irfanwani

Hi Irfan, Do you updated github repo, which could I look into ? Would you mind sharing it. I'll also give a try :).

On Sun, Jun 30, 2024, 8:55 PM Irfan Wani @.***> wrote:

yes it is working now

— Reply to this email directly, view it on GitHub https://github.com/react-native-webrtc/react-native-callkeep/issues/788#issuecomment-2198536709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5AHJJ55KKVNL7ZQCGRPADZJ7W4HAVCNFSM6AAAAABJLJM5SKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGUZTMNZQHE . You are receiving this because you authored the thread.Message ID: @.*** com>

nitishymtpl avatar Jun 30 '24 13:06 nitishymtpl

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 avatar Jun 30 '24 13:06 Irfanwani

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.

Irfanwani avatar Jul 02 '24 07:07 Irfanwani