[asterisk-users] AGI problem using mono (.Net)

Luis Morales fastonion at gmail.com
Tue Mar 3 09:36:51 CST 2009


Hi douglas,

I made an AGI script with curl  in my dial-plan. Take a look:

[custom-login]
exten => s,1,Set(LOGINOK=0)
exten => s,2,Read(codigo|custom/codigo|4||3|3)
exten => s,3,Read(clave|custom/clave|4||3|3)
exten => s,4,Set(LOGINOK=${CURL(http://<URL>/cgi-bin/login.pl?codigo=${codigo}&clave=${clave})})
exten => s,5,Set(TRY=$[${TRY} + 1])
exten => s,6,GotoIf($[${TRY} > 2]?custom-finish,s,1:)
exten => s,7,GotoIf($[${LOGINOK} = 0]?custom-login,s,4:)
exten => s,8,GotoIf($[${LOGINOK} = 1]?custom-ok,s,1:)

login.pl
------------------------------------------------------------------------------------------------------
#!/usr/bin/perl

use CGI qw/:standard/;
use strict;

my $codigo = (param('codigo') ne undef) ? param('codigo') : 0;
my $clave = (param('clave') ne undef) ? param('clave') : 0;
my $i = 0;

$i = ($codigo eq $clave) ? 1 : 0;

print "Content-type: text/html\n\n";
print "$i";
------------------------------------------------------------------------------------------------------

Now you can use asterisk+curl to send and receive data. If you are
working with .net you can make web services integration + asterisk +
curl

Have an nice day,

Regards,

Luis Morales
On Thu, Feb 26, 2009 at 2:07 PM, Douglas Mortensen
<doug at impalanetworks.com> wrote:
> Steve:
> =========================
> Thanks for the info on the agi debug command. We'll see what information
> we can garner with that. Thanks also for the advanced logging info.
>
> Unfortunately, we are pretty aware of how AGI works (at least at the
> level that you explained it). Thanks for the illustrations though.
>
> Also thanks for the info regarding the 1 active request at a time. We
> appreciate the information.
>
>
>
> Luis:
> =========================
> I'm not sure that we can use curl in our situation. We are querying an
> Microsoft SQL 2005 database server directly from the asterisk box. It
> doesn't look like curl support SQL. Let me know if I am not
> understanding your suggestion.
>
> -
> Doug Mortensen
> Network Consultant
> Impala Networks Inc
> CCNA, MCP, Security+
> Linux+, Network+, A+
> .
> www.impalanetworks.com
> P: (505) 327-7300
> F: (505) 327-7545
>
>
>
> _______________________________________________
> - Show quoted text -
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
---------------------------------------------------------------------------------
Luis Morales
Consultor de Tecnologia
Cel: +(58)416-4242091
---------------------------------------------------------------------------------
"Empieza por hacer lo necesario, luego lo que es posible... y de
pronto estarás haciendo lo imposible"

Leonardo Da'Vinci
---------------------------------------------------------------------------------



More information about the asterisk-users mailing list