Interface de voz

Post on 25-May-2015

501 views 0 download

Transcript of Interface de voz

Intranet UniEE:Interface de voz

IES Uni Eibar-Ermua y eFaber

Noviembre de 2007, Ermua-Eibar

¿Qué es VoIP?

Ejemplos

... y 1000s más

La voz como interface

Ventajas

Popularidad

Innovación

¿Como es posible?

Web stack (SO, BD, RoR)

VoIP (Asterisk)

Ancho de banda

Los IVR dejan mucho que desear

Asterisk (conceptos)

Centralita Open Source (PBX)

Protocolos: SIP, IAX

Proveedores

http://asterisk.org

Componentes

Clientes VoIP

Terminación

DID

Red PSTN

SIP, IAX

ZAP

SIP, IAX

SIP, IAX

Cliente softphone

Cliente hardware

Números públicos

DID y SIP URI

Demo

Acceso con el número público: 943 xxxxxx

Aspectos técnicos

Arquitectura

Proveedores

Stack de software

AGI y AMI

Asterisk Gateway Interface

Asterisk Manager Interface

Telegraph

MVC

respond_to

http://telegraph.rubyforge.org

Telegraph y AGI

exten => 105, 1, AGI(agi://127.0.0.1/my_route?param1=value)

wants.voice do render_voice do |voice| voice.play “hello-world” voice.link_to_dtmf 'bank-lineitem-menu' do link 1, :action=>"new" link 2, :action=>"list" link 3, :action=>"index" end end end

Demo

def show_notas

@alumno = Alumno.find_by_dni(params[:dni])

@notas = @alumno.notas_ultima_evaluacionend

<% @notas.each do |nota| %>

<tr>

<td class="list"><%= nota.asignatura %></td> <td class="list"><%= nota.nota %></td>

</tr> <% end %>

Ejemplo de voice view

Uso de Telegraph

$ script/plugin install svn://rubyforge.org/var/svn/telegraph/trunk

en /etc/asterisk/extensions.conf:exten => 777,1, AGI(agi://192.168.1.1:4574/alumnos/index)

en app/controllers/alumnos_controller.rb:def index

respond_to do |wants| wants.html { render }

wants.voice { render_voice { |voice| voice.play_sound "hello-world" }

}

endend

Telegraph: configuración

$ vi config/telegraph.yaml

development: agi_server: 127.0.0.1

agi_port: 4574 ami_server: druby://localhost:9000

outgoing_call_path: /var/spool/asterisk/outgoing

wakeup_call_path: /var/spool/asterisk/wakeups sound_path: /var/lib/asterisk/sounds

recording_path: /var/lib/asterisk/sounds

$ script/agi_server

respond_to

def index

respond_to do |wants|

wants.html { render } wants.voice { render_voice }

end end

$ vi app/views/alumnos/index.voice

voice.play_sound "hello-world"

index

# index.rhtml

<h1>Consultas</h1>

<ul> <li> <%= link_to "Faltas", :action=>"faltas" %> </li>

<li> <%= link_to "Notas", :action=>"notas" %> </li></ul>

# index.voice

voice.play_sound 'thank-you-for-calling'

voice.link_to_dtmf 'presione1-2' do link 1, :controller => "alumnos", :action => "faltas"

link 2, :action => "notas"end

formulario

# notas.rhtml

<h1>Consultar notas</h1>

<% form_tag '/alumnos/show_notas' do %> DNI: <%= text_field_tag 'dni' %>

<%= submit_tag 'Ver notas' %><% end %>

# notas.voice

voice.form :url=>{:controller => 'alumnos', :action=>'show_notas'} do |form| form.numeric_input 'dni', 'dni', :max_digits=>8

end

resultados

# show_notas rhtml

<h3>Notas de <%= @alumno.nombre %></h3>

<table class="list"> <% @notas.each do |nota| %>

<tr> <td class="list"><%= nota.asignatura %></td>

<td class="list"><%= nota.nota %></td>

</tr> <% end %>

</table>

# show.voice

@notas.each do |nota|

voice.play nota.asignatura.to_slug voice.play nota.nota

end sleep 2.seconds

voice.play "vm-goodbye"

No hay que pasarse

Web vs Mobile web vs Voz

ej: 466453.com

Contacto:

IES Uni EE BHIAvenida Otaola, 29 20600 EIBAR Telf: 943-20.84.44 Fax: 943-20.31.96 E-mail: uni@iesunibhi.com http://www.iesunibhi.com

Bº Ongarai s/n 48260 ERMUA (Bizkaia) Telf: 943-17.62.57 Fax: 943-17.64.50 E-mail: uni@iesunibhi.com http://www.iesunibhi.com

eFaber S.L.Máximo Aguirre 11, 5 izq 48011 Bilbao Telf: 94 4723589 E-mail: info@efaber.ney http://www.efaber.net