I am creating a conference with two or more participants.
I send all conference participants to Hold.
I do not want to record when all conference participants are in Hold.
I pause the conference record.
Then I transfer the participants to Unhold and turn on the record again.
After I turn on the record again, the record is NOT recorded. Only the first part is recorded, until the moment of Hold.
If don’t transfer participants to Hold, then everything works well. (Record save before pause and after in-progress)
If at least one participant in the conference is not in Hold, and everyone else is in Hold, then everything works well. (Record save before pause and after in-progress)
If transfer all participants to Hold, then the record is NOT recorded after Unhold. (Record save before pause and NOT save after in-progress)
If use $conference->recordings('Twilio.CURRENT')->update('paused') - without ['pauseBehavior' => 'skip'] then everything works fine. But I do not want to have a large conference recording file. When participants are in Hold, there will be silence in the record. But the file will be large. I want to stop recording, and then turn it back on. I don’t want silence in the file.
How to stop recording before transferring participants to Hold and start recording again after Unhold?
$sid = "XXX";
$token = "ZZZ";
$twilio = new Client($sid, $token);
$conference = $twilio->conferences("CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
$conference->recordings('Twilio.CURRENT')->update('paused', ['pauseBehavior' => 'skip']);
$conference->participants('P1')->update(['hold' => true]);
$conference->participants('P2')->update(['hold' => true]);
---------------
$conference = $twilio->conferences("CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
$conference->participants('P1')->update(['hold' => false]);
$conference->participants('P2')->update(['hold' => false]);
$conference->recordings('Twilio.CURRENT')->update('in-progress);