Re: My TGI/Perl works BUT...

David Sugar <[email protected]>
Newsgroups gmane.comp.gnu.bayonne.devel
Organization GNU Project
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hmm...normally stdout points to the fifo when your perl app runs, so the
set command really just expands into a perl "print" statment.  What
happens if you do a print "SET&0&result&200\n" directly in your tgi app?

Michel Think wrote:
> Hi everyone,
> 
> My Bayonne server version is 1.2.13. I work with soundcard for the moment.
> 
> In my script, I make a TGI call to a perl script :
> 
> ---------------
> set %v1 10
> set %v2 20
> libexec 30 mytgi.pl %v1 %v2
> 
> slog "Result = " %result
> 
> hangup
> exit
> -----------
> 
> 
> In mytgi.pl, I make a multiplication between %v1 and %v2 :
> 
> -----------
> #!/usr/bin/perl
> 
> use lib '/usr/local/libexec/bayonne/';
> use TGI;
> 
> $a = $TGI::QUERY{'v1'};
> 
> $b = $TGI::QUERY{'v2'};
> 
> $res = $a * $b;
> 
> TGI::set("result",$res);
> 
> exit
> ---------------
> 
> When I start my bayonne server, it only works fine for the first
> (phone)call! After
> the first call, "result" is empty! Here are some traces:
> 
> --------------------
> First call:
> 
> tgi: cmd=mytgi.pl query=v1=10&v2=20 digits= clid=UNKNOWN dnid=UNKNOWN
> fifo: cmd=SET&0&result&200
> fifo: cmd=wait 0 5621
> fifo: cmd=exit 0 0
> dummy(0): Result = 200
> 
> Second Call:
> 
> dummy0: step/start...
> tgi: cmd=mytgi.pl query=v1=10&v2=20 digits= clid=UNKNOWN dnid=UNKNOWN
> fifo: cmd=wait 0 5623
> fifo: cmd=exit 0 0
> dummy(0): Result= :
> 
> --------------
> 
>>From the trace above, it seems that in the second call, "TGI::set" doesn't
> work...why? 
> 
> However, if I hang up (restart or stop/start) the bayonne server process, It
> will work again for the first call and not for the following calls...
> 
> Besides, I noticed that if I made two different TGI calls the second TGI
> call wouldn't work even though it is another perl script)
> 
> (for example :
> ...
> libexec 30 mytgi.pl %v1 %v2
> slog ....
> libexec 30 ttggii.pl %v3 %v4
> ...)
> 
> My questions are simple ;-) :
> 
> What am I doing wrong? what should I correct in my
> scripts? and Why?
> 
> 
> Thanks you !
> 
> 
> (Ps: I did the same kind of script with bayonne 1.2.12 and it worked...)
> 
> 
> _______________________________________________
> Bayonne-devel mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/bayonne-devel
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCZQv+JlWtSTiTVsYRAjCgAKCkItraKEEcPZ5xiw3E9SNgl6JtwQCdHBhP
ahzYIiRIUf8P5bxQVfuDCPk=
=MlqW
-----END PGP SIGNATURE-----

_______________________________________________
Bayonne-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bayonne-devel
dyfet.vcf (text/x-vcard, 299 B)
begin:vcard
fn:David Sugar
n:Sugar;David
org:GNU Project
adr:;;23 Olin Drive;Cape May Court House;NJ;08210;USA
email;internet:[email protected]
tel;home:+1 609 465 5336
tel;cell:+1 609 408 7488
note:AIM: gnutelephony
x-mozilla-html:FALSE
url:http://www.gnu.org/software/bayonne
version:2.1
end:vcard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.