當前位置: 首頁>>代碼示例>>PHP>>正文


PHP response::addPlayAudio方法代碼示例

本文整理匯總了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']);
開發者ID:vinody-babajob,項目名稱:kookoo_ivr,代碼行數:31,代碼來源:newphoneservice.php


注:本文中的response::addPlayAudio方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。