Sha256: c31f520c2ed5a052adcad4a1411e9d1177b562b85166cd917a64c7676b5f3172

Contents?: true

Size: 601 Bytes

Versions: 9

Compression:

Stored size: 601 Bytes

Contents

#!/usr/bin/env ruby

require File.join(File.dirname(__FILE__), "..", 'lib', 'fsr')
require "fsr/listener/outbound"
$stdout.flush

class InboundCallerId < FSR::Listener::Outbound

  def session_initiated
    caller_number = @session.headers[:caller_caller_id_number]
    FSR::Log.info "*** Answering incoming call from #{exten}"

    answer do
      # Lookup number in the database
      caller_name = Ldap.find(telephoneNumber: caller_number).givenName
      set(caller_caller_id_name: caller_name) { continue }
    end

  end

end

FSR.start_oes! InboundCallerId, :port => 8084, :host => "127.0.0.1"

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
freeswitcher-0.8.0 examples/inbound_callerid_app.rb
freeswitcher-0.7.1 examples/inbound_callerid_app.rb
freeswitcher-0.7.0 examples/inbound_callerid_app.rb
freeswitcher-0.6.18 examples/inbound_callerid_app.rb
freeswitcher-0.6.17 examples/inbound_callerid_app.rb
freeswitcher-0.6.16 examples/inbound_callerid_app.rb
freeswitcher-0.6.15 examples/inbound_callerid_app.rb
freeswitcher-0.6.14 examples/inbound_callerid_app.rb
freeswitcher-0.6.13 examples/inbound_callerid_app.rb