addConference("My room", ['callbackUrl' => "http://foo.com/confevents/", 'callbackMethod' => "POST", 'digitsMatch' => "#0,99,000"]); $dial = $resp->addDial( [ 'confirmSound' => "http://foo.com/sound/", 'confirmKey' => "3" ]); $dial->addNumber("18217654321", [ 'sendDigits' => "wwww2410" ]); $dial->addUser("sip:john1234@phone.plivo.com", [ 'sendDigits' => "wwww2410" ]); $dial1 = $resp->addDial( [ 'timeout' => "20", 'action' => "http://oo.com/dial_action/" ]); $dial1->addNumber("18217654321", []); $dial2 = $resp->addDial([]); $dial2->addNumber("15671234567", []); $resp->addDTMF("12345", []); $get_digits = $resp->addGetDigits( [ 'action' => "http://www.foo.com/gather_pin/", "method" => "POST" ]); $get_digits->addSpeak("Enter PIN number.", []); $get_input = $resp->addGetInput( [ 'action' => "http://www.foo.com/gather_feedback", "method" => "GET" ]); $get_input->addSpeak("Tell us more about your experience.", []); $resp->addSpeak("Input not recieved.", []); $resp->addHangup( [ 'schedule' => "60", 'reason' => "rejected" ]); $resp->addSpeak("Call will hangup after a min.", [ 'loop' => "0" ]); $resp->addMessage("Hi, message from Plivo.", [ 'src' => "12023222222", 'dst' => "15671234567" , 'type' => "sms", 'callbackUrl' => "http://foo.com/sms_status/", 'callbackMethod' => "POST" ]); $resp->addPlay("https://amazonaws.com/Trumpet.mp3", []); $answer = $resp->addPreAnswer(); $answer->addSpeak("This call will cost $2 a min.", []); $resp->addSpeak("Thanks for dropping by.", []); $resp->addRecord( [ 'action' => "http://foo.com/get_recording/", 'startOnDialAnswer' => "true", 'redirect' => "false" ]); $dial3 = $resp->addDial([]); $dial3->addNumber("15551234567", []); $resp->addSpeak("Leave message after the beep.", []); $resp->addRecord( [ 'action' => "http://foo.com/get_recording/", 'maxLength' => "30", 'finishOnKey' => "*" ]); $resp->addSpeak("Recording not received.", []); $resp->addSpeak("Your call is being transferred.", []); $resp->addRedirect("http://foo.com/redirect/", []); $resp->addSpeak("Go green, go plivo.", [ 'loop' => "3" ]); $resp->addSpeak("I will wait 7 seconds starting now!", []); $resp->addWait( [ 'length' => "7" ]); $resp->addSpeak("I just waited 7 seconds.", []); $resp->addWait( [ 'length' => "120", 'beep' => "true" ]); $resp->addPlay("https://s3.amazonaws.com/abc.mp3", []); $resp->addWait( [ 'length' => "10" ]); $resp->addSpeak("Hello", []); $resp->addWait( [ 'length' => "10", 'silence' => "true", 'minSilence' => "3000" ]); $resp->addSpeak("Hello, welcome to the Jungle.", []); $output = $resp->toXML(true); self::assertEquals( "\nMy room18217654321sip:john1234@phone.plivo.com182176543211567123456712345Enter PIN number.Tell us more about your experience.Input not recieved.Call will hangup after a min.Hi, message from Plivo.https://amazonaws.com/Trumpet.mp3This call will cost $2 a min.Thanks for dropping by.15551234567Leave message after the beep.Recording not received.Your call is being transferred.http://foo.com/redirect/Go green, go plivo.I will wait 7 seconds starting now!I just waited 7 seconds.https://s3.amazonaws.com/abc.mp3HelloHello, welcome to the Jungle.\n", $output); } }