我解决了我的自我。
首先创建会议
incomingcalltest.php
<Response>
<Conference waitSound="<?php echo $url; ?>waitmusic.php" callbackUrl="<?php echo $url; ?>testcallbackurl.php" digitsMatch="0,9">testroom</Conference>
</Response>
比等待音乐
<Response>
<Play><?php echo $url; ?>MyMusicTherapy.mp3</Play>
<Speak>Please press 0 to disconnect the call or press 1 to leave a voicemail </Speak>
</Response>
不是创建回调URL页面和编写代码创建waitmusic.php
$ConferenceDigitsMatch = $_REQUEST['ConferenceDigitsMatch'];
if($ConferenceDigitsMatch == '0'){
$p = new RestAPI($auth_id, $auth_token);
$string = 'testroom';
$params = array(
'conference_name' => $string, # ID of the call
);
$resp = $p->get_live_conference($params);
foreach ($resp['response']['members'] as $num) {
$call_uuid = $num['call_uuid'];
$parameters = array(
'call_uuid' => $call_uuid,
'aleg_url' => <?php echo $url; ?>.'test.php', # URL to transfer for aleg
);
$transfer_call = $p->transfer_call($parameters);
}
}
并创建用于语音邮件和过去代码的转接呼叫的新文件
<Response>
<Speak>Please leave a message after the beep. Press the star key when done. </Speak>
<Record action="<?php echo $url; ?>plivo_call_record.php" maxLength="30" finishOnKey="*" />
<Speak>Recording not received.</Speak>
</Response>