Skip to content

Instantly share code, notes, and snippets.

@chrismatthieu
Created May 10, 2011 14:26
Show Gist options
  • Save chrismatthieu/964578 to your computer and use it in GitHub Desktop.
Save chrismatthieu/964578 to your computer and use it in GitHub Desktop.
Phono Autodial on Page Load
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script src="http://s.phono.com/releases/0.2/jquery.phono.js"></script>
<script>
$(document).ready(function(){
var phono = $.phono({
apiKey: "api goes here",
onReady: function() {
phono.phone.dial("sip:chrismatthieu@sip2sip.info", {
onRing: function() {
$("#status").html("Ringing");
alert('ringing')
},
onAnswer: function() {
$("#status").html("Answered");
alert('answered')
},
onHangup: function() {
$("#call").attr("disabled", false).val("Call");
$("#status").html("Hangup");
alert('hung up')
}
});
}
});
});
</script>
</head>
<body>
<h1>autodial on page load</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment