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
current_calls = {"provider"=>"Internal", "start_time"=>"2011-07-25 16:29:29", "duration"=>"60", "to_caller_id_number"=>"7003", "state"=>"leaving_voicemail", "from_caller_id_name"=>"CC Agent Station", "to_caller_id_name"=>"tttttt aaaaaaaaa", "format"=>"slin", "from_caller_id_number"=>"4100", "id"=>"Local/4100~1122@pre_process_call_api-cf84,1"} | |
{"provider"=>"Internal", "start_time"=>"2011-07-25 16:29:29", "duration"=>"60", "to_caller_id_number"=>"4100", "state"=>"leaving_voicemail", "from_caller_id_name"=>"CC Agent Station", "to_caller_id_name"=>"CC Agent Station", "format"=>"slin", "from_caller_id_number"=>"4100", "id"=>"Local/4100~1122@pre_process_call_api-cf84,2"} | |
def getlist | |
current_calls = currentcalls.current_calls.current_call | |
a = current_calls.select {|h| h["to_caller_id_number"] == "7003" } | |
puts a | |
end |
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
routes.rb | |
match "/incomings?:incoming" => "incomings#create" | |
Started GET "/incomings/new?cid_number=7003&exten_number=5001" for 10.10.5.240 at 2011-07-26 12:22:32 +0100 | |
Processing by IncomingsController#new as HTML | |
Parameters: {"cid_number"=>"7003", "exten_number"=>"5001"} | |
SQL (0.3ms) BEGIN | |
SQL (2.0ms) describe `incomings` | |
AREL (0.7ms) INSERT INTO `incomings` (`cid_number`, `exten_number`, `created_at`, `updated_at`, `exten_id`) VALUES ('7003', '5001', '2011-07-26 11:22:32', '2011-07-26 11:22:32', NULL) |
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
17 def new | |
18 @incoming = Incoming.create({:exten_number => params[:exten_number], :cid_number => params[:cid_number]}) | |
19 | |
20 if @incoming.update_attributes(params[:incoming]) | |
21 | |
22 faye = Faye::Client.new('http://0.0.0.0:9292/faye') | |
23 EM.run { | |
24 faye.publish("/incomings", 'text' => 'Update html view!') | |
25 } | |
26 end |
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
1 $(function(){ | |
2 var client = new Faye.Client('http://10.10.5.96:9292/faye'); | |
3 client.subscribe("/incomings", function(data) { | |
4 | |
5 var a = (data.exten_id); | |
6 | |
7 a.dialog(); | |
8 } | |
9 | |
10 }); |
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
require 'rubygems' | |
require 'typhoeus' | |
require 'json' | |
request = Typhoeus::Request.new("http://10.10.5.240/json",:username => 'admin', :password => 'Passw0rd', | |
:body => "{'request': {'method': 'switchvox.extensions.getInfo', 'parameters' {'extensions': [ '5001' ]}} | |
}", | |
:headers => {'Content-Type' => 'application/json',:Accept => "application/json"}, | |
:method => :post) | |
hydra = Typhoeus::Hydra.new |
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
$(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({ |
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
$(function(){ | |
var client = new Faye.Client('http://10.10.5.96:9292/faye'); | |
client.subscribe("/incomings", function(data) { | |
var a = (data.caller_number); | |
var b = new String(data.caller_name); | |
var c = new String($('#agentExten').text()); | |
var d = (data.exten_id); | |
var e = (data.caller_id) | |
var f = "<a href= 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=EditView&return_module=Contacts&return_action=index'>create contact</a>" | |
var j = "<a href=" + 'http://10.10.5.104:8080/wakanow/index.php?module=Contacts&action=DetailView&record=' + e + ">" + b + "</a>" |
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
Started GET "/incomings/new?cid_number=08023139525&exten_number=4601" for 10.10.5.240 at 2011-08-09 14:48:00 +0100 | |
LoadError (no such file to load -- /home/zeep/Desktop/vas/vas/app/controllers/incomings_controller.rb): | |
Error during failsafe response: no such file to load -- action_view/template/error |
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
[#<SugarCRM::Namespace0::Contact accept_status_id: nil, accept_status_name: nil, account_id: "c448f92c-3d6e-3a91-7c55-4e06df0429ec", account_name: "nnamdi okpala", alt_address_city: "", alt_address_country: "", alt_address_postalcode: "", alt_address_state: "", alt_address_street: "", alt_address_street_2: nil, alt_address_street_3: nil, assigned_user_id: "1", assigned_user_name: "Super Administrator", assistant: "", assistant_phone: "", birthdate: nil, c_accept_status_fields: " ...", campaign_id: "", campaign_name: "", created_by: "1", created_by_name: "Super Administrator", cstm_contact_loyalty_number_c: "", cstm_contact_loyalty_points_c: "", cstm_contact_loyalty_type_c: "", cstm_contacts_agency_c: "Wakanow.com", cstm_contacts_agency_id_c: "", cstm_customer_id_c: "492", cstm_frequent_flyer_airline1_c: "", cstm_frequent_flyer_airline2_c: "", cstm_frequent_flyer_airline3_c: "", cstm_frequent_flyer_airline4_c: "", cstm_frequent_flyer_c: false, cstm_frequent_flyer_id1_c: "", cstm_frequent_flyer_id2_c: "", cstm |
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
searcharray = [["yahoo.com", "3d6e-3a91-7c55-4e06df0429ec", "nni oka"], ["yahoo.com", "c0d9-0aec-c897-4e06e64b7230", "Nndi Oor"], ["gmail.com", "6f56-fa39-a30f-4e06f2e55182", "Nnamdi Okafor"], ["yahoo.fr", "bb64-b53b-2c14-4e07061ef525", "mae"], ["yahoo.com", "7bae-94dd-74aa-4e071a03a701", "Dadi Osme"], ["hotmail.com", "8b0d-95a8-11fc-4e07214884de", "Nnamdi Ekezie"], ["nyahoo.com", "6452-3b59-98d9-4e072b9b331a", "sui nu"]] | |
test = $.each( searcharray, function(i, val) { | |
$.each( val, function(x, l) { | |
$(val).text("i" + l); | |
alert("Index #" + l); | |
}); | |