
var aio = require('asterisk.io'),
    agi = null;

agi = aio.agi(3007);

agi.on('error', function(err){
    throw err;
});

agi.on('listening', function(){
    console.log('listening on port 3007');
});

agi.on('close', function(){
    console.log('close');
});

agi.on('connection', function(agiHandler){  
  console.log(agiHandler);
  agiHandler.close();
});
@@ -302,16 +302,18 @@
 ler)%7B  %0A
+  
   consol
@@ -331,16 +331,23 @@
 ndler);%0A
+    %0A  
   agiHan
@@ -356,13 +356,456 @@
 er.c
-lose(
+ommand('ANSWER', function(code, result, data)%7B%0A        console.log(code, result, data);%0A        %0A        agiHandler.command('Say Date %221414330073%22 %22%22', function(code, result, data)%7B%0A            console.log(code, result, data);%0A%0A            agiHandler.command('RECORD FILE /tmp/2 wav # 10000 0 1 2', function(code, result, data)%7B%0A                console.log(code, result, data);%0A%0A                agiHandler.close();%0A            %7D);%0A        %7D);%0A    %7D
 );%0A%7D

add commands