Created
October 30, 2009 16:37
-
-
Save cloudvoxcode/222504 to your computer and use it in GitHub Desktop.
Basic click-to-call example using HTTP via Cloudvox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 () | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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)); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The example 1 file has a syntax error on line 7, FYI.