harry
harry

Reputation: 501

Twilio: Trigger events on joining conference call.

I am working on a project in which i am using Twilio api for conference call. I have successfully integrated the conference feature and it us working fine. Now the problem is :

I need to trigger some events whenever any new user join or leave the conference. I am not able to find the way to do this. Could anybody suggest me the way or any documentation link to achieve this.

Thanks.

Upvotes: 0

Views: 871

Answers (2)

Roberto Carlos Beyra
Roberto Carlos Beyra

Reputation: 11

If you want to trigger an event when a new user has joined you have 6 options, start end join leave mute hold, You can set the statusCallbackEvent with the events that you want, in my example every time a participant joins or leaves my ConferenceCallStatus action gets call.If you need more info check the documentation. conference

<Response>
    <Dial>
        <Conference record="record-from-start" beep="false" waitUrl="WaitConferenceCallMessage" startConferenceOnEnter="true" endConferenceOnExit="true" statusCallbackEvent="join leave" statusCallbackMethod="GET" statusCallback="ConferenceCallStatus">myConference</Conference>
    </Dial>
</Response>

Upvotes: 1

philnash
philnash

Reputation: 73029

Twilio developer evangelist here.

There aren't specific events for joining or leaving a Conference within Twilio. However, you can find that information out yourself.

Firstly, every time your application responds to a call webhook with a <Conference> action that is someone joining your conference. You can log the participants and their callSids at this point. You can also call upon the Participants List resource at any time to find out what calls are currently participating in the conference.

As for people leaving, when a user hangs up the phone and you supply an action attribute to your <Dial> verb, that action will receive a webhook where you can either continue the call with more TwiML, finish the call or discover if the user hung up using the DialCallStatus. You can use that callback to infer that someone has left the Conference. Or, you can again use the Participants resource to find out who is in the Conference at this point.

Let me know if that helps at all.

Upvotes: 1

Related Questions