Cursos Asterisk en México

text2wav no reproduce

Colapsar

Anuncio

Colapsar
No hay anuncio todavía.
X
 
  • Filtrar
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes

  • text2wav no reproduce

    Hola

    estoy tratando de utilizar Festival dentro de un AGI y no he podido hacerlo funcionar, Festival me funciona perfecto si lo hago en una extensión custom, al marcarla me lee perfectamente el texto que le ponga pero al utilizar la funcion text2wav de phpagi no se escucha nada, les pongo el código abajo para ver si alguien me puede ayudar

    saludos

    #!/usr/bin/php -q
    <?php
    include 'phpagi.php';
    $agi = new AGI();
    $agi->answer();
    $agi->text2wav("prueba con festival");
    $agi->hangup();
    ?>

  • #2
    res_agi esta instalado? tienes bien configurado tu phpagi? que dice el debug de asterisk?
    Hector Alvarez
    dCAP Certified #2199
    http://mx.linkedin.com/in/alvarezhector/

    Comentario


    • #3
      Siempre puedes usar el $agi->exec() para mandar llamar la aplicación de Festival tal como lo harías desde el plan de llamadas convencional.
      dCAP Christian Cabrera R.
      Para aprender a usar Asterisk, asiste a uno de mis cursos Asterisk
      Si deseas asesoría pagada, por favor contáctame

      Comentario


      • #4
        Buenas tardes Christian

        PHPAGI funciona correctamente, de hecho tengo otras aplicaciones funcionando y a una de ellas es a la cual quiero meterle que lea una direccion que estoy sacando de una base de datos, intenté tambien con exec pero solo me leia la primer palabra, lo puse así

        $agi->exec(festival,"prueba de audio con festival");

        esta linea solo me reproduce prueba y el resto lo ignora.

        en el debug arroja esto

        Verbosity is at least 3
        == Using SIP RTP TOS bits 184
        == Using SIP RTP CoS mark 5
        -- Executing [301@from-internal:1] AGI("SIP/200-00000016", "audio.php") in new stack
        -- Launched AGI Script /var/lib/asterisk/agi-bin/audio.php
        -- <SIP/200-00000016>AGI Script audio.php completed, returning 4
        == Spawn extension (from-internal, 301, 1) exited non-zero on 'SIP/200-00000016'
        -- Executing [h@from-internal:1] Macro("SIP/200-00000016", "hangupcall") in new stack
        -- Executing [s@macro-hangupcall:1] GotoIf("SIP/200-00000016", "1?endmixmoncheck") in new stack
        -- Goto (macro-hangupcall,s,9)
        -- Executing [s@macro-hangupcall:9] NoOp("SIP/200-00000016", "End of MIXMON check") in new stack
        -- Executing [s@macro-hangupcall:10] GotoIf("SIP/200-00000016", "1?nomeetmemon") in new stack
        -- Goto (macro-hangupcall,s,15)
        -- Executing [s@macro-hangupcall:15] NoOp("SIP/200-00000016", "MEETME_RECORDINGFILE=") in new stack
        -- Executing [s@macro-hangupcall:16] GotoIf("SIP/200-00000016", "1?noautomon") in new stack
        -- Goto (macro-hangupcall,s,18)
        -- Executing [s@macro-hangupcall:18] NoOp("SIP/200-00000016", "TOUCH_MONITOR_OUTPUT=") in new stack
        -- Executing [s@macro-hangupcall:19] GotoIf("SIP/200-00000016", "1?noautomon2") in new stack
        -- Goto (macro-hangupcall,s,25)
        -- Executing [s@macro-hangupcall:25] NoOp("SIP/200-00000016", "MONITOR_FILENAME=") in new stack
        -- Executing [s@macro-hangupcall:26] GotoIf("SIP/200-00000016", "1?skiprg") in new stack
        -- Goto (macro-hangupcall,s,29)
        -- Executing [s@macro-hangupcall:29] GotoIf("SIP/200-00000016", "1?skipblkvm") in new stack
        -- Goto (macro-hangupcall,s,32)
        -- Executing [s@macro-hangupcall:32] GotoIf("SIP/200-00000016", "1?theend") in new stack
        -- Goto (macro-hangupcall,s,34)
        -- Executing [s@macro-hangupcall:34] Hangup("SIP/200-00000016", "") in new stack
        == Spawn extension (macro-hangupcall, s, 34) exited non-zero on 'SIP/200-00000016' in macro 'hangupcall'
        == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/200-00000016'

        Comentario


        • #5
          Habilita el debug de AGI para ver que pasa en el script.

          Comentario


          • #6
            Hola Navismo

            esto es lo que sale en el debug del AGI

            AGI Debugging Enabled
            == Using SIP RTP TOS bits 184
            == Using SIP RTP CoS mark 5
            -- Executing [301@from-internal:1] AGI("SIP/200-00000017", "audio.php") in new stack
            -- Launched AGI Script /var/lib/asterisk/agi-bin/audio.php
            <SIP/200-00000017>AGI Tx >> agi_request: audio.php
            <SIP/200-00000017>AGI Tx >> agi_channel: SIP/200-00000017
            <SIP/200-00000017>AGI Tx >> agi_language: es
            <SIP/200-00000017>AGI Tx >> agi_type: SIP
            <SIP/200-00000017>AGI Tx >> agi_uniqueid: 1377112152.23
            <SIP/200-00000017>AGI Tx >> agi_version: 1.8.11.0
            <SIP/200-00000017>AGI Tx >> agi_callerid: 200
            <SIP/200-00000017>AGI Tx >> agi_calleridname: device
            <SIP/200-00000017>AGI Tx >> agi_callingpres: 0
            <SIP/200-00000017>AGI Tx >> agi_callingani2: 0
            <SIP/200-00000017>AGI Tx >> agi_callington: 0
            <SIP/200-00000017>AGI Tx >> agi_callingtns: 0
            <SIP/200-00000017>AGI Tx >> agi_dnid: 301
            <SIP/200-00000017>AGI Tx >> agi_rdnis: unknown
            <SIP/200-00000017>AGI Tx >> agi_context: from-internal
            <SIP/200-00000017>AGI Tx >> agi_extension: 301
            <SIP/200-00000017>AGI Tx >> agi_priority: 1
            <SIP/200-00000017>AGI Tx >> agi_enhanced: 0.0
            <SIP/200-00000017>AGI Tx >> agi_accountcode:
            <SIP/200-00000017>AGI Tx >> agi_threadid: 1085536576
            <SIP/200-00000017>AGI Tx >>
            <SIP/200-00000017>AGI Rx << ANSWER
            <SIP/200-00000017>AGI Tx >> 200 result=0
            <SIP/200-00000017>AGI Rx << STREAM FILE /var/spool/asterisk//tmp//text2wav_56eee4fee60632144e24a5f0e431ae19 "" 0
            <SIP/200-00000017>AGI Tx >> 200 result=0 endpos=0
            <SIP/200-00000017>AGI Rx << HANGUP
            <SIP/200-00000017>AGI Tx >> 200 result=1
            -- <SIP/200-00000017>AGI Script audio.php completed, returning 4

            Comentario


            • #7
              En la línea que pones:

              $agi->exec(festival,"prueba de audio con festival");

              Puede que Asterisk no esté partiendo bien las palabras. Prueba con esto:

              $agi->exec(festival,"'prueba de audio con festival'"); // Aqui metí el texto entre ' '

              o con esto:

              $agi->exec(festival,"prueba\ de\ audio\ con\ festival"); // Escapar los espacios en blanco con \

              a ver como te va
              dCAP Christian Cabrera R.
              Para aprender a usar Asterisk, asiste a uno de mis cursos Asterisk
              Si deseas asesoría pagada, por favor contáctame

              Comentario


              • #8
                También checa si este audio todavía existe y si contiene sonido. /var/spool/asterisk//tmp//text2wav_56eee4fee60632144e24a5f0e431ae19

                En todo caso si desde el dialplan si funciona el festival, entra a tu AGI, obtén el texto y mándalo como variable a tu plan de marcado para que festival lo use.

                Comentario


                • #9
                  revise y el archivo existe con el texto que quiero sea leido, ¿no tiene nada que ver que la carpeta tmp tenga dos veces la diagonal?

                  probé el exec con la diagonal invertida en lugar de espacios en blanco y funcionó bien

                  Comentario


                  • #10
                    Generalmente Linux ignora la doble diagonal. Que hay acerca de los permisos y el dueño del audio con respecto al de asterisk?

                    Comentario


                    • #11
                      El usuario propietario y el grupo propietario de los archivos son aqsterisk

                      [root@pbxobr ~]# ls /var/spool/asterisk/tmp/ -l
                      total 20
                      -rw-r--r-- 1 asterisk asterisk 19 ago 21 2013 text2wav_01594d09dbe60e5234bbdcb0505eb3c2.txt
                      -rw-r--r-- 1 asterisk asterisk 19 ago 21 2013 text2wav_56eee4fee60632144e24a5f0e431ae19.txt
                      -rw-r--r-- 1 asterisk asterisk 19 ago 21 2013 text2wav_78067b9043a2789133c2c0f7ab58fb17.txt
                      -rw-r--r-- 1 asterisk asterisk 19 ago 21 2013 text2wav_cbd9b93132a6b07380fac27ef8b2518f.txt
                      -rw-r--r-- 1 asterisk asterisk 21 ago 21 2013 text2wav_fc6ac8390db331cbf8750b4a422af634.txt
                      [root@pbxobr ~]#

                      Comentario

                      Principales Usuarios Activos

                      Colapsar

                      No hay usuarios activos superiores.
                      Trabajando...
                      X