FastAGI

Help
2014-02-27
2014-03-21
  • Jorge Cadena Argote

    how to make a FastAGI with python 3?

     
    • Ralf Schlatterbeck

      On Thu, Feb 27, 2014 at 03:01:40PM +0000, Jorge Cadena Argote wrote:

      how to make a FastAGI with python 3?

      Sorry pyst doesn't support python 3 yet.

      Ralf

      Ralf Schlatterbeck email: ralf@zoo.priv.at

       
  • Jorge Cadena Argote

    well, never mind support for python3, as I can make a FastAGI, because he found the example does not work. any ideas to get started?

     
    • Ralf Schlatterbeck

      On Thu, Feb 27, 2014 at 04:42:52PM +0000, Jorge Cadena Argote wrote:

      well, never mind support for python3, as I can make a FastAGI, because
      he found the example does not work. any ideas to get started?

      You can use FastAGI similar to AGI, you can use inetd to run the remote
      AGI application.

      Since release 0.4 you're able to pass stdin, stdout, and stderr
      arguments to the constructor of AGI. By opening a file /dev/null and
      passing this as stderr you can redirect all the debug messages to
      /dev/null.

      If you need more help, please let me see the non-working code and how it
      fails.

      Ralf

      Ralf Schlatterbeck email: ralf@zoo.priv.at

       
  • Jorge Cadena Argote

    Hola, Ralf.
    FastAGI made ​​of, and works perfectly. but I can only have one call at a time. is the code I am using.

    class System(SocketServer.StreamRequestHandler):
        agi = ''
        agi_time = datetime.now()
        agi_version = "Billing - v0.1"
        var = {}
        _codigo_hangup = False
    
        def handle(self):
            print (" ==== Conexion ==== ")
            #print (self)
            self.agi=asterisk.agi.AGI(self.rfile, self.wfile)
            self.agi.verbose("Hola FastAGI, el servicio desde la ip -> %s" % self.client_address[0])
    
            self.agi.control_stream_file("demo-congrats")
    
    if __name__ == "__main__":
        HOST, PORT = "127.0.0.1", 9997
        print ( 'Inicio -- FastAGI, HOST: %s, POST: %s' % ( HOST, PORT ))
        logging.info( 'Inicio -- FastAGI, HOST: %s, PORT: %s' %( HOST, PORT ) )
        server = SocketServer.TCPServer((HOST, PORT), System)
        server.serve_forever()
    

    The problem is, that if I make a call, and perform other at the same time, the second call has to wait until after the first call to start the second call. I have been looking for information but I do not know what else.

    apologize so much trouble these days.

     
    • Ralf Schlatterbeck

      On Fri, Mar 14, 2014 at 05:21:51PM +0000, Jorge Cadena Argote wrote:

      Hola, Ralf.
      FastAGI made ??, and works perfectly. but I can only have
      one call at a time. is the code I am using.

      You need a mixin for SocketServer if you want to handle more than one
      concurrent connection.
      You may want to look into ForkingMixIn and ThreadingMixIn, see
      http://docs.python.org/2/library/socketserver.html

      Ralf

      Ralf Schlatterbeck email: ralf@zoo.priv.at

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks