REST API Ringout results - is it possible to tell if the recipient never answered or if the call went to voicemail?
Aug 25, 2016 at 10:43am • 13 replies • 0 likes
janielle
Hi
I've implemented RingOut using the REST API and it's working as expected. I have also set up a webhook notification, which is also working.
I'd like to know if it's possible to tell if the recipient (the to number) never answered or the call went to voice mail?
I don't see anything that indicates this in the call log or in the notification payload
Thanks
13 Answers
To try and determine this for outbound calls, you'll have to mix and match your programming logic between call log and message store data.
You might ask how to do this in Stackoverflow (use the 'ringcentral' tag), since there are a lot more developers there who love to answer questions (and we're moving towards that system for technical questions anyway). You should reference this conversation in the question on SO.
You might ask how to do this in Stackoverflow (use the 'ringcentral' tag), since there are a lot more developers there who love to answer questions (and we're moving towards that system for technical questions anyway). You should reference this conversation in the question on SO.
0
You'll need to query the call log data from the other side of the call (the recipient side, which would be one of your RingCentral users).
You can do this in one of two ways:
1. Call Logs by Extension (as Recipient)
-or-
2. Call Logs as Admin User (and filter by Extension.id + session.id)
The reason for this is because every call has at least two parties: caller (person placing the call) and callee (recipient of the call being placed).
If you are fetching the call logs from the callers side (as your initial data indicated with the 'direction' property set to "Outbound"), then yes, you will only ever see "CallConnected" if the call was actually connected.
You'll need to GET the call-log data for the "callee". Then you should see the different statuses which will indicate either 'Missed' or 'VoiceMail'.
You can do this in one of two ways:
1. Call Logs by Extension (as Recipient)
-or-
2. Call Logs as Admin User (and filter by Extension.id + session.id)
The reason for this is because every call has at least two parties: caller (person placing the call) and callee (recipient of the call being placed).
If you are fetching the call logs from the callers side (as your initial data indicated with the 'direction' property set to "Outbound"), then yes, you will only ever see "CallConnected" if the call was actually connected.
You'll need to GET the call-log data for the "callee". Then you should see the different statuses which will indicate either 'Missed' or 'VoiceMail'.
0
So your presence events for both types have a "NoCall" telephonyStatus at the end.
When your application sees that NoCall event (which means the end of a call), then you should capture the 'sessionId' for that call, and then you can do a lookup in the Call Log API for that extension and filter by sessionId (Call Log Record) === sessionId (presenceEvent). Then you can use the 'result' property of the Call Log record to provide you the information you require.
Does this answer your question?
When your application sees that NoCall event (which means the end of a call), then you should capture the 'sessionId' for that call, and then you can do a lookup in the Call Log API for that extension and filter by sessionId (Call Log Record) === sessionId (presenceEvent). Then you can use the 'result' property of the Call Log record to provide you the information you require.
Does this answer your question?
0
Here you go.
Missed Call
Voicemail
Missed Call
{'json.data': {'timestamp': '2016-08-31T15:42:21.555Z', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true', 'subscriptionId': 'e36f3168-0c5e-4ff7-b343-b643d80fd1cd', 'uuid': '6effe768-758c-407f-a7ef-0ea70bcbf2fa', 'body': {'telephonyStatus': 'Ringing', 'allowSeeMyPresence': True, 'dndStatus': 'TakeAllCalls', 'activeCalls': [{'telephonyStatus': 'Ringing', 'sipData': {'localUri': 'sip:+2222222@ringcentral.com', 'remoteUri': 'sip:+1111111@ringcentral.com'}, 'direction': 'Outbound', 'id': '', 'sessionId': '14430984004', 'to': '+1111111', 'from': '+2222222'}], 'sequence': 27266, 'extensionId': 136908004, 'pickUpCallsOnHold': False, 'userStatus': 'Available', 'presenceStatus': 'Available', 'ringOnMonitoredCall': False}}}
{'json.data': {'timestamp': '2016-08-31T15:42:31.644Z', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true', 'subscriptionId': 'e36f3168-0c5e-4ff7-b343-b643d80fd1cd', 'uuid': 'b32ce8c8-35f1-419c-8740-73819912635f', 'body': {'telephonyStatus': 'CallConnected', 'allowSeeMyPresence': True, 'dndStatus': 'TakeAllCalls', 'activeCalls': [{'telephonyStatus': 'CallConnected', 'sipData': {'localUri': 'sip:+2222222@ringcentral.com', 'fromTag': '10.28.20.109-5070-5bdc1b99d6c447', 'remoteUri': 'sip:+1111111@ringcentral.com', 'toTag': 'gK02f952af'}, 'direction': 'Outbound', 'id': '89acdd571ee642d0943324250e00d3b4', 'sessionId': '14430984004', 'to': '+1111111', 'from': '+2222222'}], 'sequence': 27268, 'extensionId': 136908004, 'pickUpCallsOnHold': False, 'userStatus': 'Available', 'presenceStatus': 'Busy', 'ringOnMonitoredCall': False}}} {'json.data': {'timestamp': '2016-08-31T15:42:49.205Z', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true', 'subscriptionId': 'e36f3168-0c5e-4ff7-b343-b643d80fd1cd', 'uuid': '196b281a-51ca-42bd-8359-da130cb249b0', 'body': {'telephonyStatus': 'NoCall', 'dndStatus': 'TakeAllCalls', 'allowSeeMyPresence': True, 'userStatus': 'Available', 'pickUpCallsOnHold': False, 'extensionId': 136908004, 'presenceStatus': 'Available', 'ringOnMonitoredCall': False}}}
Voicemail
{'json.data': {'timestamp': '2016-08-31T15:40:29.627Z', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true', 'subscriptionId': 'e36f3168-0c5e-4ff7-b343-b643d80fd1cd', 'uuid': 'c3c98916-5c16-4a83-b757-54d592deb1fa', 'body': {'telephonyStatus': 'Ringing', 'allowSeeMyPresence': True, 'dndStatus': 'TakeAllCalls', 'activeCalls': [{'telephonyStatus': 'Ringing', 'sipData': {'localUri': 'sip:+2222222@ringcentral.com', 'remoteUri': 'sip:+11111111@ringcentral.com'}, 'direction': 'Outbound', 'id': '', 'sessionId': '14430974004', 'to': '+11111111', 'from': '+2222222'}], 'sequence': 27263, 'extensionId': 136908004, 'pickUpCallsOnHold': False, 'userStatus': 'Available', 'presenceStatus': 'Available', 'ringOnMonitoredCall': False}}} {'json.data': {'timestamp': '2016-08-31T15:40:42.548Z', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true', 'subscriptionId': 'e36f3168-0c5e-4ff7-b343-b643d80fd1cd', 'uuid': '3f66c368-b673-4455-8250-b49f0a5e0325', 'body': {'telephonyStatus': 'CallConnected', 'allowSeeMyPresence': True, 'dndStatus': 'TakeAllCalls', 'activeCalls': [{'telephonyStatus': 'CallConnected', 'sipData': {'localUri': 'sip:+2222222@ringcentral.com', 'fromTag': '10.28.20.110-5070-aaf99dee0c7d4a', 'remoteUri': 'sip:+11111111@ringcentral.com', 'toTag': 'gK02f8cf47'}, 'direction': 'Outbound', 'id': 'c4833d50e5cf4d50b93a2da4a8d79ae1', 'sessionId': '14430974004', 'to': '+11111111', 'from': '+2222222'}], 'sequence': 27264, 'extensionId': 136908004, 'pickUpCallsOnHold': False, 'userStatus': 'Available', 'presenceStatus': 'Busy', 'ringOnMonitoredCall': False}}} {'json.data': {'timestamp': '2016-08-31T15:41:11.423Z', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true', 'subscriptionId': 'e36f3168-0c5e-4ff7-b343-b643d80fd1cd', 'uuid': '352d3619-5416-4f0d-b124-e781ed4d7528', 'body': {'telephonyStatus': 'NoCall', 'dndStatus': 'TakeAllCalls', 'allowSeeMyPresence': True, 'userStatus': 'Available', 'pickUpCallsOnHold': False, 'extensionId': 136908004, 'presenceStatus': 'Available', 'ringOnMonitoredCall': False}}}
0
The data you've provided has a 'telephonyStatus' property which indicates what happens with a call.
Have you tried generating the two use cases you've provided in your original question (Missed Call, and VoiceMail) to see what the result is in the 'telephonyStatus' property?
Have you tried generating the two use cases you've provided in your original question (Missed Call, and VoiceMail) to see what the result is in the 'telephonyStatus' property?
0
Hi,
Sorry for only getting back to you now.
This is the JSON I POST to the subscription end point,
Here is what I see in the webhook event log.
Sorry for only getting back to you now.
This is the JSON I POST to the subscription end point,
{This is for a ringout type call, all I can tell is that the calling side answered, there is no mention of the other party's status etc.
"eventFilters": [
"/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true&sipData=true",
"/restapi/v1.0/account/~/extension/~/presence/line/presence"
],
"deliveryMode": {
"transportType": "WebHook",
"address": "http://ringcentral.somedomain.io/v1/rpc/call/webhook"
}
}
Here is what I see in the webhook event log.
{'json.data': {'body': {'activeCalls': [{'id': '', 'sessionId': '14424925004', 'from': '+34343434', 'telephonyStatus': 'Ringing', 'to': '+121212', 'sipData': {'localUri': 'sip:+34343434@ringcentral.com', 'remoteUri': 'sip:+121212@ringcentral.com'}, 'direction': 'Outbound'}], 'pickUpCallsOnHold': False, 'allowSeeMyPresence': True, 'sequence': 23753, 'telephonyStatus': 'Ringing', 'ringOnMonitoredCall': False, 'extensionId': 136908004, 'dndStatus': 'TakeAllCalls', 'userStatus': 'Available', 'presenceStatus': 'Available'}, 'uuid': '043d2818-7175-4dab-84b1-8aef485df15b', 'timestamp': '2016-08-30T15:02:39.437Z', 'subscriptionId': 'd424d24c-4104-4223-ad60-da3ebe40b1cf', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true'}}
/* Caller Answers his phone */
{'json.data': {'body': {'activeCalls': [{'id': 'da47a24af2f44ef4b12dbc0cd0abcea6', 'sessionId': '14424925004', 'from': '+34343434', 'telephonyStatus': 'CallConnected', 'to': '+121212', 'sipData': {'remoteUri': 'sip:+121212@ringcentral.com', 'fromTag': '10.28.20.109-5070-7d73312c2f8841', 'toTag': 'gK029fd65d', 'localUri': 'sip:+34343434@ringcentral.com'}, 'direction': 'Outbound'}], 'pickUpCallsOnHold': False, 'allowSeeMyPresence': True, 'sequence': 23755, 'telephonyStatus': 'CallConnected', 'ringOnMonitoredCall': False, 'extensionId': 136908004, 'dndStatus': 'TakeAllCalls', 'userStatus': 'Available', 'presenceStatus': 'Busy'}, 'uuid': '5ace2bdf-690a-4f44-bae3-fd98c0e075ce', 'timestamp': '2016-08-30T15:02:49.089Z', 'subscriptionId': 'd424d24c-4104-4223-ad60-da3ebe40b1cf', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true'}}
/* Call Ends */
{'json.data': {'body': {'userStatus': 'Available', 'pickUpCallsOnHold': False, 'telephonyStatus': 'NoCall', 'ringOnMonitoredCall': False, 'extensionId': 136908004, 'dndStatus': 'TakeAllCalls', 'allowSeeMyPresence': True, 'presenceStatus': 'Available'}, 'uuid': 'f663e0a4-b8ef-4dcb-8c0a-0e266cc5eae6', 'timestamp': '2016-08-30T15:03:35.347Z', 'subscriptionId': 'd424d24c-4104-4223-ad60-da3ebe40b1cf', 'event': '/restapi/v1.0/account/136908004/extension/136908004/presence?detailedTelephonyState=true&sipData=true'}}
0
Could you provide the code you're using to create the webhooks and the filters you're using please? Also, if you could provide some example of the webhook events you're receiving, this might help to drill down into what is blocking you from being able to achieve your goal.
0
Have you tried setting the 'view=Detailed' query parameter for your GET request to /call-log to view the information about each leg of a call and the callStatus? https://developers.ringcentral.com/api-docs/latest/index.html#!#RefExtensionCallLog.html
Another option would be to create a Push Notification (Subscription or Webhook) event consumer to be notified of presence events for extensions you wish to monitor. https://developers.ringcentral.com/api-docs/latest/index.html#!#RefNotifications.html
Another option would be to create a Push Notification (Subscription or Webhook) event consumer to be notified of presence events for extensions you wish to monitor. https://developers.ringcentral.com/api-docs/latest/index.html#!#RefNotifications.html
0
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder