[Asterisk-Users] IVR Questions?

Joe Dennick joe at dennick.net
Mon Oct 6 12:57:31 MST 2003


OK, I've been playing with it and I must be missing something.  Here's a
script that I've written:

#!/usr/bin/perl

use Asterisk::AGI;

$AGI = new Asterisk::AGI;

my $repid =
$AGI->get_data('sai-enter-rep_id', 50000, 5);

$AGI->say_digits($repid);

exit;

The script is called as part of Extension 501 (extensions.conf):

exten => 501,1,Wait(1)
exten =>
501,2,EAGI(/home/joed/asterisk-perl-0.08/examples/sai-get-repid.agi)
exten => 501,3,Wait(1)
exten => 501,4,Hangup

And the CLI Output looks like:

    -- Executing Wait("SIP/7002-7751", "1") in new stack
    -- Executing EAGI("SIP/7002-7751",
"/home/joed/asterisk-perl-0.08/examples/sai-get-repid.agi") in new stack
    -- Launched AGI Script
/home/joed/asterisk-perl-0.08/examples/sai-get-repid.agi
    -- Playing 'sai-enter-rep_id'
    -- AGI Script
/home/joed/asterisk-perl-0.08/examples/sai-get-repid.agi completed,
returning 0
    -- Executing Wait("SIP/7002-7751", "1") in new stack
    -- Executing Hangup("SIP/7002-7751", "") in new stack

So, I know that is sees the script, and the stream file for playback,
but I never hear the playback (Prompt to enter code), and I don't get
any error messages anywhere.

Does anyone have an idea of what I'm missing?

Thank you for your assistance!


-----Original Message-----
From: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of duncan
Sent: Monday, October 06, 2003 7:53 AM
To: asterisk-users at lists.digium.com
Subject: RE: [Asterisk-Users] IVR Questions?



>I failed to mention in my original post that I've looked at perl 
>through
>AGI, but haven't yet found a function that allows me to capture digits
to 
>a variable that I can then manipulate.  I probably should also mention 
>that I'm not a programmer-type, although I can usually muddle through 
>simple scripts for smaller uses like this one.  Can you suggest which 
>function I would use?

using the asterisk-perl module from http://asterisk.gnuinter.net/

you would use the get_data function:

my $captured_dtmfs = 
$AGI->get_data('/var/lib/asterisk/sounds/whatever','50000','4');

from the "show agi get data" help

show agi get data
Usage: GET DATA <file to be streamed> [timeout] [max digits]
          Stream the given file, and recieve DTMF data. Returns the
digits 
recieved from the channel at the other end.


hope this helps


duncan

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list