0

Connecting Phono and Tropo

I have an application created as a Web API in my Tropo account. It's still in the Delvelopment status. All I want is to make calls to the number provided in the form.

I got the Application ID from this URL: https://api.tropo.com/v1/applications

Then I'm using this Phono script, with the Phono API Key and the Application ID already there:

 

<html>

<head>

<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>

<script src="http://s.phono.com/releases/1.1/jquery.phono.js"></script>

</head>

<body>

<input id="phonenumber" type="text">

<input id="call" type="button" disabled="true" value="Loading..." />

<span id="status"></span>

<script>

$(document).ready(function(){

var phono = $.phono({

apiKey: "my_phono_key",

onReady: function() {

$("#call").attr("disabled", false).val("Call");

}

});

$("#call").click(function() {

$("#call").attr("disabled", true).val("Busy");

phono.phone.dial("app:my_app_id", {

headers: [

{

name:"x-numbertodial",

value:$('#phonenumber').val()

}

],

onRing: function() {

$("#status").html("Ringing");

},

onAnswer: function() {

$("#status").html("Answered");

},

onHangup: function() {

$("#call").attr("disabled", false).val("Call");

$("#status").html("Hangup");

}

});

});

})

</script>

</body>

</html>

 

When I run the script above, it rings once and then it hangup. I checked the logs in my Tropo account and there is nothing, so I guess there is no connection.

Based on the examples and tutorials, I just need to add the Tropo Application ID to my phono script to connect them:

phono.phone.dial("app:my_app_id"...

Am i doing something wrong? Do I need to move the application to Production in order to connect Phono to the Tropo application?

Thanks.

 

1 comment

Please sign in to leave a comment.