I need to continuously download all recordings for calls that went through any of N specific queues.
Ideally I could subscribe to an event/webook thats fired when a new recording is available, process that request to check if the conversation went through one of the targeted queues, and if so, download the recording file.
I've reviewed the Available Topic listed here and there doesn't appear to be a good way to do this.
I could maybe
- maintain a list of users
- subscribe to
v2.users.{id}.conversations
for each user - for each conversation started event,
** check if it came through a targeted queue
** subscribe tov2.users.{id}.conversations.{id}.recordings
** callv2.users.{id}.conversations.{id}.recordings.{id}
to "Subscribe to receive notifications when the transcode of a recording has completed."
** download the given recording
This seems like it could work but also feels like a lot of moving parts.
Alternatively I looked at the Recording API as well.
Perhaps I could
- create a cron
- have it call
POST /api/v2/recording/jobs
with an appropriate conversationQuery - call
PUT /api/v2/recording/jobs/{jobId}
to run the job - poll
GET /api/v2/recording/jobs/{jobId}
till the job is complete - download the returned recordings
That seems a little more straight forward, but still big enough to get a second opinion.
Is there a better way to do this?