3

I got two people in the same conference room #1, then I moved only one person to another conference #2, but kept the conference room #1 alive.

I was expecting that Twilio plays the hold music for the person left alone in the conference #1 until the other person goes back from #2 to #1, but since the conference was already started, there was only silence.

How can I make Twilio play the hold music when someone is left alone in the conference room, even though the conference was already started?

Thanks,

Update

I saw the new participant hold feature, tried to use it instead but no luck as well. See here: https://github.com/twilio/twilio-php/issues/368

Solved

I found a participant hold feature which does exactly what I want, without having to move an user to another conference. It had a bug (per my update above), but it was fixed. So the solution would be to update the participant with Hold => true:

$this->client
->conferences($conferenceSid)
->participants($memberCallSid)
->update(['Hold' => 'true']);

Moving him to a new conference as suggested here should solve this as well.

Brayan
  • 460
  • 2
  • 5
  • 17

2 Answers2

4

I ran into this issue a while back and was suggested by the twilio support team to transfer the remaining caller to a new empty conference room and this will trigger the hold music. They said you can't play hold music again after the conference room has started.

ecorvo
  • 3,559
  • 4
  • 24
  • 35
  • 1
    They actually had a bug, and the code I wrote on my Github issue now works. Your suggestion should also work as a workaround though.. – Brayan Aug 29 '16 at 22:19
3

Besides updating the participant by setting the Hold attribute to true, you need to update the HoldUrl attribute.

According to the Twilio documentation,

The 'HoldUrl' attribute lets you specify a URL for music that plays when a participant is held. The URL may be an MP3, a WAV or a TwiML document that uses Play, Say or Redirect.

Your code should look like below :

$this->client
     ->conferences($conferenceSid)
     ->participants($memberCallSid)
     ->update(
         [
             'Hold' => 'true', 
             'HoldUrl' => 'some url to mp3 file, wav file or twiml'
         ]
     );

Hope it helps.

php-dev
  • 6,998
  • 4
  • 24
  • 38
  • Thanks I'll test. But they said on another page that they have a default hold url, so not sure.. but I'll test anyway. – Brayan Aug 29 '16 at 17:04
  • Looks like it's a bug.. https://github.com/twilio/twilio-php/issues/368 – Brayan Aug 29 '16 at 20:34