Skip to content

Instantly share code, notes, and snippets.

@cloudvoxcode
Created October 30, 2009 16:37
Show Gist options
  • Save cloudvoxcode/222504 to your computer and use it in GitHub Desktop.
Save cloudvoxcode/222504 to your computer and use it in GitHub Desktop.
Basic click-to-call example using HTTP via Cloudvox
<?php // more: http://help.cloudvox.com/
$r= new HttpRequest('http://your.cloudvox.com/applications/42/dial', HttpRequest::METH_POST);
$r->addPostFields (
array (
'destination' => '2061112222',
'caller_id' => '2065559999',
'remote_number' => $_GET['remote_number'];
)
);
$r->send ()
?>
<?php // more: http://help.cloudvox.com/
$remote_number = $_GET['remote_number']);
print make_call_steps($remote_number);
function make_call_steps($remote_number) {
$steps = array(
array('name' => 'speak', 'phrase' => 'Calling other party.'),
array('name' => 'dial', 'destination' => $remote_number, 'caller_id' => '2065559999')
);
return(json_encode($steps));
}
?>
@nateritter
Copy link

The example 1 file has a syntax error on line 7, FYI.

@cloudvoxcode
Copy link
Author

Thanks! Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment