Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created July 29, 2011 09:17
Show Gist options
  • Select an option

  • Save bjhaid/1113498 to your computer and use it in GitHub Desktop.

Select an option

Save bjhaid/1113498 to your computer and use it in GitHub Desktop.
$(function(){
var client = new Faye.Client('http://10.10.5.163:9292/faye');
client.subscribe("/incomings", function(data) {
var a = (data.cid_number);
var b = (data.caller_name);
var c = new String($('#agentExten').text());
if (a == c) {
$("<div>").text("Incoming call from " + a + " " + c).dialog({
position: ['right','top'],
draggable: false,
modal: true,
});
}
});
$('#dial').click(function(){
sendValue($('#call').val());
});
function sendValue(str){$.post("http://10.10.5.163:3000/incomings/call/",{ sendValue: [str, div] }); } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment