Reputation: 61
Firstly, ringout is working correctly, it dials two numbers and connects them together successfully.
When I send a POST request to the Ringout REST API endpoint, I get a ringout ID back. I then use this ringout ID and issue a GET request every few seconds to track when both parties have answered there calls. ( I am aware of webhooks, but webhooks don't give me the callee's status)
{
"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/XXXX/extension/XXXXXX/ringout/XXx";,
"id": xxx,
"status": {
"callStatus": "Success",
"callerStatus": "Success",
"calleeStatus": "Success"
}
}
I use this same polling technique to work out when either party has disconnected from the call.
{
"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/xxxx/extension/xxxx/ringout/xxxx";,
"id": xxx,
"status": {
"callStatus": "CannotReach",
"callerStatus": "Finished",
"calleeStatus": "Finished"
}
}
I noticed that the ringout ID only lives for about 30 seconds, after this time when I send a GET request I get this response even though the phone call is still taking place.
{
"errorCode": "CMN-102",
"message": "Resource for parameter [ringoutId] is not found",
"errors": [
{
"errorCode": "CMN-102",
"message": "Resource for parameter [ringoutId] is not found",
"parameterName": "ringoutId"
}
],
"parameterName": "ringoutId"
}
Is this the expected behaviour for a ringout call, does the ID disappear after 30 seconds, even though the call is still active?
Upvotes: 1
Views: 86
Reputation: 1298
This question was also asked in the RingCentral Developer Community, and answered by the Principal Architect for the Platform: https://devcommunity.ringcentral.com/ringcentraldev/topics/how-long-does-a-ringout-id-live-for
Adding a copy of Anton's answer here to save people a click...
Ringout ID lives until both call legs are established (or canceled). You cannot use this ID to check the status of a call which is already connected to both parties or to cancel already connected call.
In order to monitor status of an established call you should use our presence notifications.
Upvotes: 1