datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 233 forks source link

Unable to successfully redirectCall and xferCall on both iOS and Android #57

Open bryanfarris opened 6 years ago

bryanfarris commented 6 years ago

Hi - we are struggling with the redirect/transfer call features.

This issue occurs both when we attempt to redirect an incoming call (prior to answering it) and when we attempt to transfer a call after it has been answered.

Here is our code for calling the PJSIP endpoint:

Redirects:

redirectCall = destination => {
  const { activeCallId, incomingCallId, calls, endpoint, accounts } = this.state
  const call = calls[activeCallId || incomingCallId]
  endpoint.redirectCall(accounts[call.getAccountId()], call, destination);
};

Transfers:

xferCall = destination => {
  const { activeCallId, calls, endpoint, accounts } = this.state
  const call = calls[activeCallId]
  endpoint.xferCall(accounts[call.getAccountId()], call, destination);
};

Is there something you see that we are doing wrong?

datso commented 6 years ago

Let me re-check, as I remember transfers was working fine :)

Betechmate commented 4 years ago

Hi - we are struggling to implement redirect/transfer call feature.

What will be the format of destination ? destination="sip:1111@ipAddress";?

endPointObj.xferCall(account,callInfo, "<sip:1111@ipAddress>").then((data: any) => {
  console.log("xferCall", data, this.callInfo);
}).catch((error: any) => {
  console.error('xferCall error:', error);
});