I have the below method. Currently is just calls up an external phone number and says "Welcome". I cannot understand how to connect a twilio number with an external phone number by voice? Lots of example of how to do text-to-voice but not much on voice to voice. Any pointers appreciated.
public function test_call(){
$this->account_sid = 'AC-account_sid';
$this->auth_token = 'myauth_token';
$this->client = new Client($this->account_sid, $this->auth_token);
$call = $this->client->account->calls->create(
'+81xxxxxxxxxx', // Destination phone number
'+81yyyyyyyyyy', // Valid Twilio phone number
array(
"record" => false,
"url" => "http://development.example.com/gomi.xml")
);
if($call) {
echo 'Call initiated successfully';
} else {
echo 'Call failed!';
}
}
Contents of gomi.xml
<Response>
<Say voice="alice">Welcome</Say>
</Response>