You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.
I have the following code to transfer an inbound call to a browser soft phone from one agent to another agent. This code works well for transferring an outbound call from the same browser softphone to another phone. But for inbound calls the browser phone disconnects when it puts into a conference room.
Here is the code
public void transferCall() {
System.Debug('Phone Number = ' + callTo + ' Transfer Number = ' + transferTo);
// Get the default Twilio Client
TwilioRestClient client = TwilioAPI.getDefaultClient();
Map<String,String> filters = new Map<String,String>{'Status'=>'in-progress'};
Iterator<TwilioCall> calls = client.getAccount().getCalls(filters).iterator();
System.Debug('Before Redirecting Calls to Conference');
// Redirect the ongoing call to a conference room
while (calls.hasNext()) {
TwilioCall call = calls.next();
System.Debug('Parent Call Sid = ' + call.getParentCallSid());
System.Debug('Sid = ' + call.getSid());
System.Debug('Call URI = ' + call.getUri());
System.Debug('Call Status = ' + call.getStatus());
System.Debug('Call Direction = ' + call.getDirection());
if(((call.getDirection() == 'inbound' && call.getParentCallSid() != null) ||
(call.getDirection() != 'inbound')) && (call.getStatus() == 'in-progress')
){
System.Debug('Before Re-directing call to conference Call URI = ' + call.getUri());
call.redirect('http://test-businessfunding.cs10.force.com/conference', 'POST');
System.Debug('After Re-directing call to conference Call URI = ' + call.getUri());
}
}
System.Debug('After Redirecting Calls to Conference');
// Dial the transfer number to join the conference room
Map<String,String> params = new Map<String,String>{
'To' => transferTo,
'From' => TwilioAPI.getTwilioConfig().CallerId__c,
'Url' => 'http://test-businessfunding.cs10.force.com/conference'
};
System.Debug('Before Making new call to Transfer number to join the same conference');
TwilioCall call = client.getAccount().getCalls().create(params);
System.Debug('After Making new call to Transfer number to join the same conference');
System.debug(call.getDuration());
System.debug(call.getSid());
}
Any help in resolving this critical issue will be highly appreciated.
Thanks
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have the following code to transfer an inbound call to a browser soft phone from one agent to another agent. This code works well for transferring an outbound call from the same browser softphone to another phone. But for inbound calls the browser phone disconnects when it puts into a conference room.
Here is the code
Any help in resolving this critical issue will be highly appreciated.
Thanks
The text was updated successfully, but these errors were encountered: