question

Roman Pierce avatar image
Roman Pierce asked Tyler Liu commented

API for the realtime voice bot

Hello!
We want to develop a
bot that will auto-answer (pick up) the call when it is ringing and will reply smartly when it hears something from the caller.

But we can't find the API on how to listen to the call after it's answered and how to reply by some audio to the caller.

Could you please help us to find the solution to how exactly to implement this?

In
WebPhone SDK https://github.com/ringcentral/ringcentral-web-phone it looks like it is possible only to answer the incoming call, but there are no options on how to listen to the answered call or how to reply something back to the user.

Also, we found a similar post on the forum where the person was looking for the same API that we need, but it looks like it was not resolved.
https://community.ringcentral.com/questions/1535/realtime-voice-bot-with-ringcentral.html

Thanks in advance!

phonerest apisdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Tyler Liu avatar image
Tyler Liu answered Tyler Liu commented

The problem for https://github.com/ringcentral/ringcentral-web-phone is it can only run in a browser. In theory you will be able to get audio data, at least you computer's speaker can get the audio data.

This SDK is better in my opinion: https://github.com/ringcentral/ringcentral-softphone-ts

It can run on server side as a node.js app.

Sample code here https://github.com/ringcentral/ringcentral-softphone-ts/blob/main/demos/inbound-call.ts#L22-L32

tells you how to auto answers the call, how to get audio from remote peer and how to send/play local audio to remote peer.


4 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Roman Pierce avatar image Roman Pierce commented ·

Thanks! It seems like this is what we were looking for. I will check it out.

One thing that in this package I can't find call transfer.
Is it possible to transfer the call to another user in this library?

0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ Roman Pierce commented ·

Call Transfer is not supported by that library. You will have to use the RESTful API: https://developers.ringcentral.com/api-reference/Call-Control/transferCallParty

1 Like 1 ·
Roman Pierce avatar image Roman Pierce Tyler Liu ♦ commented ·

Thanks! We already discovered that the only issue is that we can't find telephoneSessionId and partyId in the SIP message, I asked about this in a different topic https://community.ringcentral.com/comments/119076/view.html

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys