Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio Participants on a Completed Conference

Tags:

rest

twilio

In the Twilio REST API, is it possible to retrieve a Participants list for a completed conference? I am trying to calculate each participant's call duration at the end of a conference. I'm passing an "action" callback when the conference is created, but in this callback (when the conference ends and the callback is called), when I query the Participants resource for the ConferenceSid, the list of participants is now empty. I can see the participants in this resource while the conference is running, if I hit it manually, but apparently they disappear when the conference ends (but before the callback is called). Does anyone have any thoughts on how to get either all of the Participant objects or all of the Call objects (or call sids) which are connected to a completed conference? Thanks for any help.

like image 838
user5304181 Avatar asked Sep 27 '22 19:09

user5304181


1 Answers

First off, I am having a similar issue where I would like to retrieve a list of phone calls (participants) associated with a conference call. I believe that the participant endpoint should show completed/disconnected participants as well as active ones instead of just active participants for an active conference call.

In your case I believe that you can work around the limitation of Twilio's REST Api. What you'll need to do is store the CallSid of each participant when each leg of the conference call is created. You can then retrieve the call records for the stored call_sids when the conference call ends.

To clarify, you'll retrieve the call data from the calls endpoint instead of the participants endpoint. Does that make sense? I can clarify and add code examples if that helps.

I think I'll do something like this to address my problem. If someone knows a better way to do this, let me know. I will also talk to my Twilio rep to see if they can address this.

Thanks, Jared

Update: I ended up doing this and it worked quite well. Whenever I created a new conference call participant, I stored the conference_sid and the call_sid in a table in the database. when I needed information on the call I just used that table and twilio's rest api for phone calls.

like image 187
Jared Menard Avatar answered Sep 30 '22 07:09

Jared Menard