Created
May 10, 2011 14:26
-
-
Save chrismatthieu/964578 to your computer and use it in GitHub Desktop.
Phono Autodial on Page Load
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
<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:[email protected]", { | |
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