本文整理汇总了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']);