当前位置: 首页>>代码示例>>PHP>>正文


PHP Response::addPlayText方法代码示例

本文整理汇总了PHP中Response::addPlayText方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::addPlayText方法的具体用法?PHP Response::addPlayText怎么用?PHP Response::addPlayText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Response的用法示例。


在下文中一共展示了Response::addPlayText方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CollectDtmf

    $collectInput->setTimeOut('4000');
    //maxtimeout if caller not give any inputs
    $collectInput->setTermChar('#');
    $r->addCollectDtmf($collectInput);
    $_SESSION['next_goto'] = 'conference';
} else {
    if ($_REQUEST['event'] == "GotDTMF" && $_SESSION['next_goto'] == 'conference') {
        if ($_REQUEST['data'] == "") {
            $collectInput = new CollectDtmf();
            $collectInput->addPlayText("You have not given any input");
            $collectInput->addPlayText('please enter the conference number again followed by hash', 3);
            $collectInput->setMaxDigits('4');
            //max inputs to be allowed
            $collectInput->setTimeOut('4000');
            //maxtimeout if caller not give any inputs
            $collectInput->setTermChar('#');
            $r->addCollectDtmf($collectInput);
            $_SESSION['next_goto'] = 'conference';
        } else {
            if ($_REQUEST['data'] == $confno[0]) {
                $r->addPlayText("Please be online while we connect you. Thank you");
                $r->addConference($confno[0]);
            } else {
                $r->addPlayText("Your input has been not matched with any our conference numbers");
            }
        }
    }
}
$r->send();
?>
 
开发者ID:deepak7514,项目名称:KooKoo-Social-Media-Challenge,代码行数:30,代码来源:User+joining+a+Dynamic+conference+by+entering+pin.php

示例2:

    $collectInput->addPlayText('Welcome to Koo Koo. Are you new to place?', 4);
    $collectInput->addPlayText('press 1 for entering location, press 2 for nearby places, press 3 for weather details', 4);
    $collectInput->setMaxDigits('1');
    //max inputs to be allowed
    $collectInput->setTimeOut('4000');
    //maxtimeout if caller not give any inputs
    $r->addCollectDtmf($collectInput);
    $_SESSION['next_goto'] = 'Menu1_CheckInput';
} else {
    if ($_REQUEST['event'] == 'GotDTMF' && $_SESSION['next_goto'] == 'Menu1_CheckInput') {
        //input will come data param
        //print parameter data value
        if ($_REQUEST['data'] == '') {
            //if value null, caller has not given any dtmf
            //no input handled
            $r->addPlayText('you have not entered any input');
            $_SESSION['next_goto'] = 'Menu1';
        } else {
            if ($_REQUEST['data'] == '1') {
                $_SESSION['next_goto'] = 'Record_Status';
                $r->addPlayText('Please enter your location after beep ');
                //give unique file name for each recording
                $r->addRecord('filename2', 'wav');
            } else {
                if ($_REQUEST['data'] == '2') {
                    $_SESSION['next_goto'] = 'DialMenu';
                } else {
                    if ($_REQUEST['data'] == '3') {
                        $_SESSION['next_goto'] = 'Dial1_Status';
                    } else {
                        $r->addPlayText('Thats an invalid input');
开发者ID:deepak7514,项目名称:KooKoo-Social-Media-Challenge,代码行数:31,代码来源:demo.php

示例3: CollectDtmf

    $collectInput->setTermChar('#');
    $r->addCollectDtmf($collectInput);
    $_SESSION['next_goto'] = 'check_pin';
} else {
    if ($_REQUEST['event'] == "GotDTMF" && $_SESSION['next_goto'] == 'check_pin') {
        if ($_REQUEST['data'] == "") {
            $collectInput = new CollectDtmf();
            $collectInput->addPlayText('You have not given any input', 3);
            $collectInput->addPlayText('please enter the pin again', 3);
            $collectInput->setMaxDigits('4');
            //max inputs to be allowed
            $collectInput->setTimeOut('4000');
            //maxtimeout if caller not give any inputs
            $collectInput->setTermChar('#');
            $r->addCollectDtmf($collectInput);
            $_SESSION['next_goto'] = 'check_pin';
        } else {
            if ($_REQUEST['data'] == $store[0]) {
                $r->addPlayText("Welcome to YourCompany");
                //your code here
            } else {
                $r->addPlayText("The pin you entered is wrong");
                $r->addHangup();
                //call disconnects at this stage
            }
        }
    }
}
$r->send();
?>
 
开发者ID:deepak7514,项目名称:KooKoo-Social-Media-Challenge,代码行数:30,代码来源:Validating+pin+number.php

示例4: Response

<?php

//Description:Sample Code to playback a dynamic text
session_start();
require_once "response.php";
//response.php is the kookoo xml preparation class file
$r = new Response();
$languages = array("Press 1 for English", "Press 2 for Hindi", "Press 3 for Kannada");
//Declaration of array consisting three values
if ($_REQUEST['event'] == "NewCall") {
    foreach ($languages as $key => $value) {
        $r->addPlayText($value);
    }
}
$r->send();
?>
 
开发者ID:deepak7514,项目名称:KooKoo-Social-Media-Challenge,代码行数:16,代码来源:Playback+dynamic+text.php

示例5:

    $collectInput->addPlayText('welcome to koo koo', 4);
    $collectInput->addPlayText('press 1 for record, press 2 dial, press 3 for conference test, press 4, for other', 4);
    $collectInput->setMaxDigits('1');
    //max inputs to be allowed
    $collectInput->setTimeOut('4000');
    //maxtimeout if caller not give any inputs
    $r->addCollectDtmf($collectInput);
    $_SESSION['next_goto'] = 'Menu1_CheckInput';
} else {
    if ($_REQUEST['event'] == 'GotDTMF' && $_SESSION['next_goto'] == 'Menu1_CheckInput') {
        //input will come data param
        //print parameter data value
        if ($_REQUEST['data'] == '') {
            //if value null, caller has not given any dtmf
            //no input handled
            $r->addPlayText('you have not entered any input');
            $_SESSION['next_goto'] = 'Menu1';
        } else {
            if ($_REQUEST['data'] == '1') {
                $_SESSION['next_goto'] = 'Record_Status';
                $r->addPlayText('Please record your message after beep ');
                //give unique file name for each recording
                $r->addRecord('filename2', 'wav', '120');
            } else {
                if ($_REQUEST['data'] == '2') {
                    $_SESSION['next_goto'] = 'DialMenu';
                } else {
                    if ($_REQUEST['data'] == '3') {
                        $r->addPlayText('your conference number is 1 2 3 4 ');
                        $r->addConference(1234);
                        $_SESSION['next_goto'] = 'Dial1_Status';
开发者ID:developers-truckaurbus,项目名称:KooKoo-PHP,代码行数:31,代码来源:demo.php

示例6: Response

<?php

/*Description:Using a record tag you get below request parameters from kookoo in response. * event =Record * data =Recorded file_URL * status =Record Status*/
session_start();
//start session, session will be maintained for entire call
require_once "response.php";
//response.php is the kookoo xml preparation class file
$r = new Response();
if ($_REQUEST['event'] == "NewCall") {
    $r->addPlayText('Please record your message after beep ');
    //give unique file name for each recording
    $r->addRecord('filename2', 'wav', '120');
    $_SESSION['next_goto'] = 'Record_Status';
} else {
    if ($_REQUEST['event'] == 'Record' && $_SESSION['next_goto'] == 'Record_Status') {
        //recorded file will be come as  url in request parameter called data
        $r->addPlayText('your recorded audio is ');
        //You can also store the URL in your database if you want
        $_SESSION['record_url'] = $_REQUEST['data'];
        $r->addPlayAudio($_SESSION['record_url']);
        $r->addPlayText('Thank you for calling, have a nice day');
        $r->addHangup();
    }
}
$r->send();
?>
 
开发者ID:deepak7514,项目名称:KooKoo-Social-Media-Challenge,代码行数:26,代码来源:Record+and+playback+the+audio+in+KooKoo.php

示例7: array

$store = array(9704);
// declaration of array
if ($_REQUEST['event'] == "NewCall" || $_SESSION['next_goto'] == 'restart') {
    $collectInput = new CollectDtmf();
    $collectInput->addPlayText('please enter the pin', 3);
    $collectInput->setMaxDigits('4');
    //max inputs to be allowed
    $collectInput->setTimeOut('4000');
    //maxtimeout if caller not give any inputs
    $collectInput->setTermChar('#');
    $r->addCollectDtmf($collectInput);
    $_SESSION['next_goto'] = 'check_pin';
} else {
    if ($_SESSION['next_goto'] == 'check_pin') {
        if ($_REQUEST['data'] == "") {
            $r->addPlayText("You have not given any input");
            $_SESSION['next_goto'] = 'restart';
        } else {
            if ($_REQUEST['data'] == $store[0]) {
                $r->addPlayText("Welcome to YourCompany");
                //your code here
            } else {
                $r->addPlayText("The pin you entered is wrong");
                $r->addHangup();
                //call disconnects at this stage
            }
        }
    }
}
$r->send();
?>
开发者ID:nzee,项目名称:KooKoo-PHP,代码行数:31,代码来源:Validating+pin+number.php

示例8:

    $collectInput->addPlayText('please enter the number that you want to dial followed by hash, if it is s t d number, enter 0 as pre fix ', 3);
    $collectInput->setMaxDigits('15');
    //max inputs to be allowed
    $collectInput->setTimeOut('4000');
    //maxtimeout if caller not give any inputs
    $collectInput->setTermChar('#');
    $r->addCollectDtmf($collectInput);
    $_SESSION['next_goto'] = 'Menu1_CheckInput1';
} else {
    if ($_REQUEST['event'] == 'GotDTMF' && $_SESSION['next_goto'] == 'Menu1_CheckInput1') {
        //input will come in data param
        //print print parameter data value
        if ($_REQUEST['data'] == '') {
            //if value null, caller has not given any dtmf
            //no input handled
            $r->addPlayText('you have not entered any input');
            $_SESSION['next_goto'] = 'Menu1';
        } else {
            $_SESSION['dial'] = $_REQUEST['data'];
            $r->addPlayText('please wait while we transfer your call to out customer care');
            $r->addDial($_SESSION['dial'], 'true', 1000, 30, 'ring');
            $_SESSION['next_goto'] = 'Dial1_Status';
        }
    } else {
        if ($_REQUEST['event'] == 'Dial' && $_SESSION['next_goto'] == 'Dial1_Status') {
            //dial url will come in data param  //if dial record is false then data value will be -1 or null
            //dial status will come in status (answered/not_answered) param
            $_SESSION['dial_record_url'] = $_REQUEST['data'];
            $_SESSION['dial_status'] = $_REQUEST['status'];
            $_SESSION['dial_callduration'] = $_REQUEST['callduration'];
            if ($_REQUEST['status'] == 'not_answered') {
开发者ID:nzee,项目名称:KooKoo-PHP,代码行数:31,代码来源:Collecting+mobile+number+and+dialing+out.php

示例9: Response

session_start();
$r = new Response();
if ($_REQUEST['event'] == "NewCall") {
    $cd = new CollectDtmf();
    $cd->setTermChar("#");
    $cd->setTimeOut("4000");
    $cd->addPlayText("welcome to adder.Please enter your first number.Terminate with hash");
    $r->addCollectDtmf($cd);
    $_SESSION['state'] = "firstNumber";
    $r->send();
} else {
    if ($_REQUEST['event'] == "GotDTMF" && $_SESSION['state'] == "firstNumber") {
        $first = $_REQUEST['data'];
        $cd = new CollectDtmf();
        $cd->setTermChar("#");
        $cd->setTimeOut("4000");
        $cd->addPlayText("Please enter the Second number.Terminate with hash");
        $_SESSION['firstNumber'] = $first;
        $_SESSION['state'] = "secondNumber";
        $r->addCollectDtmf($cd);
        $r->send();
    } else {
        if ($_REQUEST['event'] == "GotDTMF" && $_SESSION['state'] == "secondNumber") {
            $second = $_REQUEST['data'];
            $total = $_SESSION['firstNumber'] + $second;
            $r->addPlayText("your total is {$total}");
            $r->addHangup();
            $r->send();
        }
    }
}
开发者ID:deepak7514,项目名称:KooKoo-Social-Media-Challenge,代码行数:31,代码来源:adder.php

示例10: Response

include "php/db.php";
session_start();
require_once "response.php";
//include KooKoo library
$r = new Response();
//create a response object
$cd = new CollectDtmf();
if (isset($_REQUEST['event']) && $_REQUEST['event'] == 'NewCall') {
    $no = $_REQUEST['cid'];
    $result = mysqli_query($conn, "select * from user where  mobile='{$no}' ");
    $row_cnt = $result->num_rows;
    $row = mysqli_fetch_assoc($result);
    $userid = $row['id'];
    if ($row_cnt == 0) {
        $r->addPlayText("Sorry. This number is not registered. Thank you for calling, have a nice day");
        $postdata = "name=Audiochat&no=" . $no . "&msg=register at audiochat.azurewebsites.net  ";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'http://faltusms.tk/sendSms.php');
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_VERBOSE, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 60);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($ch, CURLOPT_POST, 1);
        $result = curl_exec($ch);
        $r->addHangup();
        $r->send();
        exit;
开发者ID:aakash03,项目名称:Audiochat,代码行数:30,代码来源:api.php

示例11: CollectDtmf

    //
    //You maintain your own session params store require data
    $_SESSION['caller_number'] = $_REQUEST['cid'];
    $_SESSION['kookoo_number'] = $_REQUEST['called_number'];
    //called_number is register phone number on kookoo
    //
    $_SESSION['session_id'] = $_REQUEST['sid'];
    //sid is unique callid for each call
    // you maintain one session variable to check position of your call
    //here i had maintain next_goto as session variable
    $_SESSION['next_goto'] = 'Menu1';
    $_SESSION['menu'] = 0;
    $_SESSION['cat'] = 0;
    $_SESSION['sub_cat'] = 0;
    $_SESSION['sub_sub_cat'] = 0;
    $r->addPlayText('welcome to koo koo e commerce platform. ', 4);
}
if ($_REQUEST['event'] == "Disconnect" || $_REQUEST['event'] == "Hangup") {
    //when users hangs up at any time in call  event=Disconnect
    // when applicatoin sends hangup event event=Disconnect
    //if users hang up the call in dial event you will get data ans status params also
    //$_SESSION['dial_record_url']=$_REQUEST['data'];
    //$_SESSION['dial_status']=$_REQUEST['status'];
    exit;
}
if ($_SESSION['next_goto'] == 'Menu1') {
    $collectInput = new CollectDtmf();
    $collectInput->addPlayText('Please choose category', 4);
    for ($i = 0; $i < count($category[$_SESSION['menu']][$_SESSION['cat']][$_SESSION['sub_cat']]); $i++) {
        $collectInput->addPlayText("Press " . $i . " for " . $category[$_SESSION['menu']][$_SESSION['cat']][$_SESSION['sub_cat']][$i] . ", ", 4);
    }
开发者ID:deepak7514,项目名称:Ecommerce-Challenge,代码行数:31,代码来源:demo.php


注:本文中的Response::addPlayText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。