本文整理匯總了PHP中response::addPlayAudio方法的典型用法代碼示例。如果您正苦於以下問題:PHP response::addPlayAudio方法的具體用法?PHP response::addPlayAudio怎麽用?PHP response::addPlayAudio使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類response
的用法示例。
在下文中一共展示了response::addPlayAudio方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CollectDtmf
$cd = new CollectDtmf();
//initiate new collect dtmf object
$cd->setMaxDigits(10);
$cd->setTermChar('#');
$cd->addPlayText("Please enter number to send message end with hash!");
$r->addCollectDtmf($cd);
$_SESSION['next_goto'] = 'phonemenu';
}
} else {
if ($_REQUEST['event'] == 'Record' && $_SESSION['next_goto'] == 'Record_Status') {
//recorded file will be come as url in data param
//print parameter data value
$r->addPlayText('your recorded audio is ');
$_SESSION['record_url'] = $_REQUEST['data'];
error_log($_SESSION['record_url']);
$r->addPlayAudio($_SESSION['record_url']);
$r->addPlayText('Thanks you for calling, we will deliver your message');
} else {
if ($_REQUEST['event'] == 'Dial' && $_SESSION['next_goto'] == 'Dial1_Status') {
//dial url will come data param //if dial record false then data value will be -1 or null
//dial status will come in status (answered/not_answered) param
//print parameter data and status params value
$_SESSION['dial_record_url'] = $_REQUEST['data'];
$_SESSION['dial_status'] = $_REQUEST['status'];
$_SESSION['dial_callduration'] = $_REQUEST['callduration'];
if ($_REQUEST['status'] == 'not_answered') {
//if you would like dial another number, if first call not answered,
//
$r->addHangup();
} else {
$r->addPlayAudio($_SESSION['record_url']);