Adhearsion

Материал из Xgu.ru

Перейти к: навигация, поиск


Adhearsion — фреймворк для создания VoIP-приложений. Фреймворк написан на языке Ruby.

Пример кода, IVR-меню[1]:

class MyController < Adhearsion::CallController
  def run
    answer
    menu "Where can we take you today?",
         :timeout => 8.seconds, :tries => 3 do
      match 1, BooController
      match '2', MyOtherController
      match 3, 4, { pass YetAnotherController }
      match 5, FooController
      match 6..10 do |dialed|
        say_dialed dialed
      end
 
      timeout { do_this_on_timeout }
 
      invalid do
        invoke InvalidController
      end
 
      failure do
        speak 'Goodbye'
        hangup
      end
    end
 
    speak "This code gets executed unless #pass is used"
  end
 
  def say_dialed(dialed)
    speak "#{dialed} was dialed"
  end
 
  def do_this_on_timeout
    speak 'Timeout'
  end

[править] Дополнительная информация

[править] Примечания

  1. ↑ http://adhearsion.com/docs/call-controllers
Источник — «http://xgu.ru/wiki/Adhearsion»
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Can't contact the database server: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (localhost))


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.