Skip to content

Instantly share code, notes, and snippets.

@zlu
Created December 21, 2010 20:00
Show Gist options
  • Save zlu/750478 to your computer and use it in GitHub Desktop.
Save zlu/750478 to your computer and use it in GitHub Desktop.
on tropo (ruby):
answer()
say("please wait while open voice is transferring your call")
transfer($currentCall.getHeader("x-sbc-numberToDial"))
for phono (rails):
<script>
$(document).ready(function(){
var phono = $.phono({
apiKey: "246718baa63464f91cb348a76559d700",
onReady: function() {
$("#call").attr("disabled", false).val("Call with browser");
}
});
$("#call").click(function() {
$("#call").attr("disabled", true).val("Busy");
phono.phone.dial("app:9991480119", {
headers: {
numberToDial:$('#outgoing_call_callee_number').val()
},
onRing: function() {
$("#status").html("Ringing");
},
onAnswer: function() {
$("#status").html("Answered");
},
onHangup: function() {
$("#call").attr("disabled", false).val("Call with browser");
}
});
});
})
</script>
@johntdyer
Copy link

[12/21/10 3:01:28 PM] John Dyer: you have to have x-

[12/21/10 3:01:34 PM] John Dyer: x-numberToDial:$('#outgoing_call_callee_number').val()

[12/21/10 3:01:39 PM] Zhao Lu: i would like to access header, numberToDial, from tropo.

[12/21/10 3:01:42 PM] Zhao Lu: ok will try

[12/21/10 3:02:03 PM] John Dyer: I updated the docs few weeks ago, so the requirement for x- is in there now

[12/21/10 3:02:29 PM] John Dyer: http://phono.com/docs#customheaders

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