How long does a ringout ID live for?

  • 1
  • Question
  • Updated 2 years ago
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?
Photo of Janielle

Janielle

  • 530 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,904 Points 2k badge 2x thumb
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.
(Edited)
Photo of Janielle

Janielle

  • 530 Points 500 badge 2x thumb
ok, I understand, thanks
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
If you're the person who posted the same question in StackOverflow, I'm going to reference the URL to this response in the answer there (as Anton's answer can be considered definitive).