question

Nikolai Chashchin avatar image
Nikolai Chashchin asked Phong Vu commented

Retrieve IVR call option

Hi Community,

I set up a webhook to get notified about changes that happens to an account using filter: /restapi/v1.0/account/~/telephony/sessions. For my application I need some extra information about the session. Can u please tell me how to get this information and whether this is doable through a webhook:

1. Selected option in IVR. By this I mean option explained at https://support.ringcentral.com/article/6562.html?language=en_US under 'Sample Custom Greeting' topic.

2. Selected IVR menu. At this uri: https://github.com/dibyenduroy/csn-data/blob/master/PSTN-RingCentral-DataStreams.txt in the list of notifications I see at the line 3 f.ex:

{'uuid': '6157342698054500332', 'event': '/restapi/v1.0/account/809646016/telephony/sessions', 'timestamp': '2020-06-23T01:05:44.195Z', 'subscriptionId': '2461434a-276a-4073-bd26-34089effbad5', 'ownerId': '809646016', 'body': {'sequence': 4, 'sessionId': '429180487016', 'telephonySessionId': 's-718107795d564867a6f635fd81e89940', 'serverId': '10.13.22.27.TAM', 'eventTime': '2020-06-23T01:05:44.083Z', 'parties': [{'accountId': '809646016', 'id': 'p-718107795d564867a6f635fd81e89940-1', 'direction': 'Outbound', 'to': {'phoneNumber': '+18003151571', 'name': 'IVR Menu 1001', 'extensionId': '62242421016'}, 'from': {'phoneNumber': '+14083388064'}, 'status': {'code': 'Answered', 'rcc': False}, 'park': {}, 'missedCall': False, 'standAlone': False, 'muted': False}], 'origin': {'type': 'Call'}}}

It has parameter 'name': 'IVR Menu 1001'. Do I need to parse 'name' parameter to find out if the call uses IVR menu? Can IVR menu have arbitrary name?

Thanks!

Best,

Nikolai Chashchin

webhooksivr
1 |3000

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

Phong Vu avatar image
Phong Vu answered

First of all, IVR settings can be very complicated, and you should not rely on the IVR name in those events as it always displays the first IVR.

Any incoming call to a company number will end up in an IVR, then depending on the IVR settings, the call will be routed and handled according to the rules set for that IVR and the callers actions.

To detect an incoming call to an IVR, you can detect the extension id in the event payload (body.parties[0].extensionId). To identify an IVR by its id, you can call the Get Extension List API, set the type='IvrMenu' and keep the IVR menus' extension id in an array to compare the extension ids when you receive a telephony event notification.

To read the IVR settings, use the IVR extension id to call this endpoint.

1 |3000

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

Nikolai Chashchin avatar image
Nikolai Chashchin answered Nikolai Chashchin commented

Thanks for the fast reply, Phong!

But it is still not clear for me how to get a selected option in IVR during a call.

Let's say there is a following options for the caller: 'Thank you for calling <Company Name>. If you want to be recorded press 1, if not press 2'. Recording here means a consent to record what caller will be saying during a call. How can I check that the caller picks option 1?

Best,

Nikolai Chashchin

2 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.

Phong Vu avatar image Phong Vu ♦♦ commented ·

Unfortunately, the /telephony/sessions notification does not fire event of IVR action, nor the call log records IVR selected action.

1 Like 1 ·
Nikolai Chashchin avatar image Nikolai Chashchin Phong Vu ♦♦ commented ·

Thank you, Phong.

0 Likes 0 ·
Nikolai Chashchin avatar image
Nikolai Chashchin answered Phong Vu commented

Hi Phong,

Just want to be sure, that I understood your answers correctly. As far as I understood threre is no way to get IVR selected option by any means using RC Api? Neither via Subscription Api nor via any other Api provided by RC, right?

Best,

Nikolai Chashchin

1 comment
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

That is right. We don't log IVR action in the call log, nor sending any notification for such events.

1 Like 1 ·

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