# -*- encoding: utf-8 -*- # stub: bougyman-freeswitcher 0.1.4 ruby lib Gem::Specification.new do |s| s.name = "bougyman-freeswitcher".freeze s.version = "0.1.4".freeze s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Jayson Vaughn".freeze, "Michael Fellinger".freeze, "Kevin Berry".freeze, "TJ Vanderpoel".freeze] s.date = "2009-05-11" s.description = "========================================================= FreeSWITCHeR Copyright (c) 2009 The Rubyists (Jayson Vaughn, Tj Vanderpoel, Michael Fellinger, Kevin Berry) Distributed under the terms of the MIT License. ========================================================== ABOUT ----- A ruby library for interacting with the \"FreeSWITCH\" (http://www.freeswitch.org) opensource telephony platform REQUIREMENTS ------------ - ruby (>= 1.8) - eventmachine (If you wish to use Outbound and Inbound listener) USAGE ----- An Outbound Event Listener Example that reads and returns DTMF input: -------------------------------------------------------------------- Simply just create a subclass of FSR::Listner::Outbound and all new calls/sessions will invoke the \"session_initiated\" callback method. * NOTE: FSR uses blocks within the 'session_inititated' method to ensure that the next \"freeswich command\" is not executed until the previous \"Freeswitch command\" has finished. This is kicked off by \"answer do\" require 'fsr' require 'fsr/listener/outbound' class OutboundDemo < FSR::Listener::Outbound def session_initiated exten = @session.headers[:caller_caller_id_number] FSR::Log.info \"*** Answering incoming call from \#{exten}\" answer do FSR::Log.info \"***Reading DTMF from \#{exten}\" read(\"/home/freeswitch/freeswitch/sounds/music/8000/sweet.wav\", 4, 10, \"input\", 7000) do FSR::Log.info \"*** Updating session for \#{exten}\" update_session do FSR::Log.info \"***Success, grabbed \#{@session.headers[:variable_input].strip} from \#{exten}\" hangup #Hangup the call end end end end end FSR.start_oes! OutboundDemo, :port => 8084, :host => \"127.0.0.1\" An Inbound Event Socket Listener example using FreeSWITCHeR's hook system: -------------------------------------------------------------------------- require 'pp' require 'fsr' require \"fsr/listener/inbound\" # EXAMPLE 1 # This adds a hook on CHANNEL_CREATE events. You can also create a method to handle the event you're after. See the next example FSL::Inbound.add_event_hook(:CHANNEL_CREATE) {|event| FSR::Log.info \"*** [\#{event.content[:unique_id]}] Channel created - greetings from the hook!\" } # EXAMPLE 2 # Define a method to handle CHANNEL_HANGUP events. def custom_channel_hangup_handler(event) FSR::Log.info \"*** [\#{event.content[:unique_id]}] Channel hangup. The event:\" pp event end # This adds a hook for EXAMPLE 2 FSL::Inbound.add_event_hook(:CHANNEL_HANGUP) {|event| custom_channel_hangup_handler(event) } # Start FSR Inbound Listener FSR.start_ies!(FSL::Inbound, :host => \"localhost\", :port => 8021) An Inbound Event Socket Listener example using the on_event callback method instead of hooks: --------------------------------------------------------------------------------------------- require 'pp' require 'fsr' require \"fsr/listener/inbound\" class IesDemo < FSR::Listener::Inbound def on_event(event) pp event.headers pp event.content[:event_name] end end FSR.start_ies!(IesDemo, :host => \"localhost\", :port => 8021) An example of using FSR::CommandSocket to originate a new call in irb: ---------------------------------------------------------------------- irb(main):001:0> require 'fsr' => true irb(main):002:0> FSR.load_all_commands => [:sofia, :originate] irb(main):003:0> sock = FSR::CommandSocket.new => #, @port=\"8021\", @auth=\"ClueCon\"> irb(main):007:0> sock.originate(:target => 'sofia/gateway/carlos/8179395222', :endpoint => FSR::App::Bridge.new(\"user/bougyman\")).run => {\"Job-UUID\"=>\"732075a4-7dd5-4258-b124-6284a82a5ae7\", \"body\"=>\"\", \"Content-Type\"=>\"command/reply\", \"Reply-Text\"=>\"+OK Job-UUID: 732075a4-7dd5-4258-b124-6284a82a5ae7\"} SUPPORT ------- Home page at http://code.rubyists.com/projects/fs #rubyists on FreeNode".freeze s.email = "FreeSWITCHeR@rubyists.com".freeze s.files = [".gitignore".freeze, "AUTHORS".freeze, "CHANGELOG".freeze, "License.txt".freeze, "MANIFEST".freeze, "NEWS".freeze, "README".freeze, "Rakefile".freeze, "examples/bin/cmd_demo.rb".freeze, "examples/bin/dtmf_test.rb".freeze, "examples/bin/ies_demo.rb".freeze, "examples/bin/ies_demo_with_hook.rb".freeze, "examples/bin/oes_demo.rb".freeze, "examples/dtmf_test.rb".freeze, "examples/ies_demo.rb".freeze, "examples/ies_demo_with_hook.rb".freeze, "examples/inbound_event_socket.rb".freeze, "examples/inbound_socket_events.rb".freeze, "examples/outbound_event_socket.rb".freeze, "freeswitcher.gemspec".freeze, "lib/fsr.rb".freeze, "lib/fsr/app.rb".freeze, "lib/fsr/app/answer.rb".freeze, "lib/fsr/app/bridge.rb".freeze, "lib/fsr/app/conference.rb".freeze, "lib/fsr/app/fifo.rb".freeze, "lib/fsr/app/fs_break.rb".freeze, "lib/fsr/app/fs_sleep.rb".freeze, "lib/fsr/app/hangup.rb".freeze, "lib/fsr/app/limit.rb".freeze, "lib/fsr/app/log.rb".freeze, "lib/fsr/app/play_and_get_digits.rb".freeze, "lib/fsr/app/playback.rb".freeze, "lib/fsr/app/read.rb".freeze, "lib/fsr/app/set.rb".freeze, "lib/fsr/app/speak.rb".freeze, "lib/fsr/app/transfer.rb".freeze, "lib/fsr/app/uuid_dump.rb".freeze, "lib/fsr/app/uuid_getvar.rb".freeze, "lib/fsr/app/uuid_setvar.rb".freeze, "lib/fsr/cmd.rb".freeze, "lib/fsr/cmd/calls.rb".freeze, "lib/fsr/cmd/fsctl.rb".freeze, "lib/fsr/cmd/originate.rb".freeze, "lib/fsr/cmd/sofia.rb".freeze, "lib/fsr/cmd/sofia/profile.rb".freeze, "lib/fsr/cmd/sofia/status.rb".freeze, "lib/fsr/cmd/sofia_contact.rb".freeze, "lib/fsr/cmd/status.rb".freeze, "lib/fsr/command_socket.rb".freeze, "lib/fsr/database.rb".freeze, "lib/fsr/database/call_limit.rb".freeze, "lib/fsr/database/core.rb".freeze, "lib/fsr/database/sofia_reg_external.rb".freeze, "lib/fsr/database/sofia_reg_internal.rb".freeze, "lib/fsr/database/voicemail_default.rb".freeze, "lib/fsr/event_socket.rb".freeze, "lib/fsr/fake_socket.rb".freeze, "lib/fsr/listener.rb".freeze, "lib/fsr/listener/header_and_content_response.rb".freeze, "lib/fsr/listener/inbound.rb".freeze, "lib/fsr/listener/inbound/event.rb".freeze, "lib/fsr/listener/outbound.rb".freeze, "lib/fsr/listener/outbound.rb.orig".freeze, "lib/fsr/model/call.rb".freeze, "lib/fsr/version.rb".freeze, "spec/fsr/app.rb".freeze, "spec/fsr/app/bridge.rb".freeze, "spec/fsr/app/conference.rb".freeze, "spec/fsr/app/fifo.rb".freeze, "spec/fsr/app/hangup.rb".freeze, "spec/fsr/app/limit.rb".freeze, "spec/fsr/app/log.rb".freeze, "spec/fsr/app/play_and_get_digits.rb".freeze, "spec/fsr/app/playback.rb".freeze, "spec/fsr/app/set.rb".freeze, "spec/fsr/app/transfer.rb".freeze, "spec/fsr/cmd.rb".freeze, "spec/fsr/cmd/calls.rb".freeze, "spec/fsr/cmd/originate.rb".freeze, "spec/fsr/cmd/sofia.rb".freeze, "spec/fsr/cmd/sofia/profile.rb".freeze, "spec/fsr/listener.rb".freeze, "spec/fsr/listener/inbound.rb".freeze, "spec/fsr/listener/outbound.rb".freeze, "spec/fsr/loading.rb".freeze, "spec/helper.rb".freeze, "tasks/authors.rake".freeze, "tasks/bacon.rake".freeze, "tasks/changelog.rake".freeze, "tasks/copyright.rake".freeze, "tasks/gem.rake".freeze, "tasks/gem_installer.rake".freeze, "tasks/install_dependencies.rake".freeze, "tasks/manifest.rake".freeze, "tasks/rcov.rake".freeze, "tasks/release.rake".freeze, "tasks/reversion.rake".freeze, "tasks/setup.rake".freeze, "tasks/spec.rake".freeze, "tasks/yard.rake".freeze] s.homepage = "http://code.rubyists.com/projects/fs".freeze s.post_install_message = "=========================================================\nFreeSWITCHeR\nCopyright (c) 2009 The Rubyists (Jayson Vaughn, Tj Vanderpoel, Michael Fellinger, Kevin Berry) \nDistributed under the terms of the MIT License.\n==========================================================\n\nABOUT\n-----\nA ruby library for interacting with the \"FreeSWITCH\" (http://www.freeswitch.org) opensource telephony platform\n\nREQUIREMENTS\n------------\n- ruby (>= 1.8)\n- eventmachine (If you wish to use Outbound and Inbound listener)\n\nUSAGE\n-----\n\nAn Outbound Event Listener Example that reads and returns DTMF input:\n--------------------------------------------------------------------\n\nSimply just create a subclass of FSR::Listner::Outbound and all\nnew calls/sessions will invoke the \"session_initiated\" callback method.\n\n * NOTE: FSR uses blocks within the 'session_inititated' method to ensure \n that the next \"freeswich command\" is not executed until the previous \n \"Freeswitch command\" has finished. This is kicked off by \"answer do\"\n\n require 'fsr'\n require 'fsr/listener/outbound'\n\n class OutboundDemo < FSR::Listener::Outbound\n\n def session_initiated\n exten = @session.headers[:caller_caller_id_number]\n FSR::Log.info \"*** Answering incoming call from \#{exten}\"\n\n answer do\n FSR::Log.info \"***Reading DTMF from \#{exten}\"\n read(\"/home/freeswitch/freeswitch/sounds/music/8000/sweet.wav\", 4, 10, \"input\", 7000) do\n FSR::Log.info \"*** Updating session for \#{exten}\"\n update_session do\n FSR::Log.info \"***Success, grabbed \#{@session.headers[:variable_input].strip} from \#{exten}\"\n hangup #Hangup the call\n end\n end\n end\n\n end\n\n end\n\n FSR.start_oes! OutboundDemo, :port => 8084, :host => \"127.0.0.1\"\n\n\nAn Inbound Event Socket Listener example using FreeSWITCHeR's hook system:\n--------------------------------------------------------------------------\n\n require 'pp'\n require 'fsr'\n require \"fsr/listener/inbound\"\n\n # EXAMPLE 1 \n # This adds a hook on CHANNEL_CREATE events. You can also create a method to handle the event you're after. See the next example\n FSL::Inbound.add_event_hook(:CHANNEL_CREATE) {|event| FSR::Log.info \"*** [\#{event.content[:unique_id]}] Channel created - greetings from the hook!\" }\n\n # EXAMPLE 2\n # Define a method to handle CHANNEL_HANGUP events.\n def custom_channel_hangup_handler(event)\n FSR::Log.info \"*** [\#{event.content[:unique_id]}] Channel hangup. The event:\"\n pp event\n end\n\n # This adds a hook for EXAMPLE 2\n FSL::Inbound.add_event_hook(:CHANNEL_HANGUP) {|event| custom_channel_hangup_handler(event) }\n\n\n # Start FSR Inbound Listener\n FSR.start_ies!(FSL::Inbound, :host => \"localhost\", :port => 8021)\n\n\nAn Inbound Event Socket Listener example using the on_event callback method instead of hooks:\n---------------------------------------------------------------------------------------------\n\n require 'pp'\n require 'fsr'\n require \"fsr/listener/inbound\"\n\n\n class IesDemo < FSR::Listener::Inbound\n\n def on_event(event)\n pp event.headers\n pp event.content[:event_name]\n end\n\n end\n\n FSR.start_ies!(IesDemo, :host => \"localhost\", :port => 8021)\n\n\nAn example of using FSR::CommandSocket to originate a new call in irb:\n----------------------------------------------------------------------\n\n irb(main):001:0> require 'fsr'\n => true\n\n irb(main):002:0> FSR.load_all_commands\n => [:sofia, :originate]\n\n irb(main):003:0> sock = FSR::CommandSocket.new\n => #, @port=\"8021\", @auth=\"ClueCon\">\n\n irb(main):007:0> sock.originate(:target => 'sofia/gateway/carlos/8179395222', :endpoint => FSR::App::Bridge.new(\"user/bougyman\")).run\n => {\"Job-UUID\"=>\"732075a4-7dd5-4258-b124-6284a82a5ae7\", \"body\"=>\"\", \"Content-Type\"=>\"command/reply\", \"Reply-Text\"=>\"+OK Job-UUID: 732075a4-7dd5-4258-b124-6284a82a5ae7\"}\n\n\n\nSUPPORT\n-------\nHome page at http://code.rubyists.com/projects/fs\n#rubyists on FreeNode\n".freeze s.rubygems_version = "3.5.10".freeze s.summary = "A library for interacting with the \"FreeSWITCH\":http://freeswitch.org telephony platform".freeze s.test_files = ["spec/fsr/app.rb".freeze, "spec/fsr/app/bridge.rb".freeze, "spec/fsr/app/conference.rb".freeze, "spec/fsr/app/fifo.rb".freeze, "spec/fsr/app/hangup.rb".freeze, "spec/fsr/app/limit.rb".freeze, "spec/fsr/app/log.rb".freeze, "spec/fsr/app/play_and_get_digits.rb".freeze, "spec/fsr/app/playback.rb".freeze, "spec/fsr/app/set.rb".freeze, "spec/fsr/app/transfer.rb".freeze, "spec/fsr/cmd.rb".freeze, "spec/fsr/cmd/calls.rb".freeze, "spec/fsr/cmd/originate.rb".freeze, "spec/fsr/cmd/sofia.rb".freeze, "spec/fsr/cmd/sofia/profile.rb".freeze, "spec/fsr/listener.rb".freeze, "spec/fsr/listener/inbound.rb".freeze, "spec/fsr/listener/outbound.rb".freeze, "spec/fsr/loading.rb".freeze] s.specification_version = 2 s.add_runtime_dependency(%q.freeze, [">= 0".freeze]) end