Re: [Asterisk-Users] AGI.pm wait_for_digit() not working for me!!!

2004-05-11 Thread Andy Powell
Ok,

the first think to do is check the permissions on the conf-background.agi ..asterisk 
needs to be able to run it ...

The code I've listed below works fine for me:

#!/usr/bin/perl

use Asterisk::AGI;

$AGI = new Asterisk::AGI;
%input = $AGI->ReadParse();

$soundpath = "/var/lib/asterisk/sounds/";
$timeout = 10;


while(1)
{
$input = chr($AGI->wait_for_digit($timeout));

if ($input eq "*")
{
$AGI->stream_file("$soundpath/banana-phone-song");
}

if ($input eq "1")
{
exit 0;
}

}




*** REPLY SEPARATOR  ***

On 11/05/2004 at 10:52 Atif wrote:

>Hello everybody!!!
>
>
>
>I really need your help guys, I am using the AGI mode in meetme
>application,
>and  I want that AGI should wait for an input from the client/user i.e. a
>digit and then proceed, but I have used that AGI function
>agi->wait_for_digit(), but no usemy agi just passes, or ignores this
>function,
>
>where AGI should stop here and wait for the input
>
>
>
>.my extension in my dialplan.
>
>exten => 21,1,answer
>
>exten => 21,2,meetme(21|pb)
>
>
>
>..and here is my AGI...
>
>#!/usr/bin/perl -w
>
>#use strict;
>
>
>
>$aginame="conf-background.agi";
>
>use File::Copy cp;
>
>use Asterisk::AGI;
>
>$AGI = new Asterisk::AGI;
>
>my %input = $AGI->ReadParse();
>
>
>
>$char=0;
>
>
>
>#while(1)
>
>{
>
>
>
>#$AGI->exec('WaitExten','25000');
>
>#$char = $AGI->receive_char('600');
>
>$char=chr($AGI->wait_for_digit('600'));
>
>
>
>print STDERR "input form rec char : $char\n";
>
>
>
>if($char eq "*")
>
>{
>
>print STDERR "Dialing your number\n";
>
>$srcfile="/tmp/mycall";
>
>$dstfile="/var/spool/asterisk/outgoing/mycall";
>
>open(MYCALL,">$srcfile") || die "Cant't open file :$srcfile
>$!\n";
>
>print MYCALL "Channel:IAX2/bali:[EMAIL PROTECTED]/[EMAIL PROTECTED]";
>
>print MYCALL "MaxRetries:2\n";
>
>print MYCALL "RetryTime:60\n";
>
>print MYCALL "WaitTime:30\n";
>
>print MYCALL "Context:atif\n";
>
>print MYCALL "Extension:22\n";
>
>print MYCALL "Priority:1\n";
>
>close MYCALL;
>
>#   cp($srcfile,$dstfile);
>
>print STDERR "dialing complete...\n";
>
>}
>
>
>___
>Asterisk-Users mailing list
>[EMAIL PROTECTED]
>http://lists.digium.com/mailman/listinfo/asterisk-users
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] AGI.pm?

2003-07-23 Thread John Laur
> I've seen references to this module in the mailing list archives, but
it
> isn't in the 0.4.0 tarball, nor is it in CVS. I can roll my own and
was
> planning to do so anyhow, but that doesn't seem to make a lot of sense
> if it already exists. Am I not looking somewhere I should be looking?
Most
> of the Google hits just point to the mailing list.

The asterisk-perl tools written by James Golovich are at:

http://asterisk.gnuinter.net/

The following modules are available:

Asterisk::Outgoing - manipulate spool files for pbx_spool
Asterisk::Manager  - talk to the manager interface
Asterisk::AGI  - helpful routines to simplify writing AGI's

For those of you using it, but not checking the site regularly, version
0.07 was released recently on 09-Jul to fix bugs, add a new AGI command,
and add MD5 authentication to the Asterisk::Manager.

Also note that I'm just posting this for the benefit of the list
readers. I don't have anything to do with the software itself other than
that I am a happy user. Asterisk::Manager rocks!

John



___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users