Displaying 20 results from an estimated 5000 matches similar to: "AGI Perl Question"
2004 Dec 28
0
Two problems with the Perl AGI
Hi,
I have a * 1.0.3 running on a Gentoo box and I installed Perl AGi from
http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz.
When I write this :
>#!/usr/bin/perl
>use Asterisk::AGI;
>my $AGI = new Asterisk::AGI;
>$AGI->exec ('Dial SIP/kphone1|30|tTr');
>my $duration = $AGI->get_variable('ANSWEREDTIME');
>print STDERR "\n duration :
2009 Apr 08
1
Perl AGI
Hi all,
I have the below peace of my AGI script...the problem here is that I cannot
fetch the extension value to inside the script and assign it to another
variable...I highlighted it in red
#!/usr/bin/perl
#use DBD::mysql;
use DBI;
use DBD::mysql;
use Asterisk::AGI;
############################
#To read asterisk variable values.
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
2004 Dec 10
0
AGI Perl
Hello,
I'm writing a AGI Perl script and use the following lines to initiate a
call :
$res = $AGI->exec("DIAL $dialstr");
And then :
$answeredtime = $AGI->get_variable("ANSWEREDTIME");
The problem is that I need to know immediately when the call has begun.
I can have the call duration & establishment time at the end of the call
but not in real time when it
2006 Mar 20
4
simple perl-agi - where's the error?
Hello!
I'm trying to setup a perl-deadagi, but my perl skills lack. can
someone tell me why the following code doesn't work:
#!/usr/bin/perl
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
$dialstring = $AGI->get_variable("DIALSTRING");
$res = $AGI->exec("DIAL $dialstring");
the asterisk output says:
AGI Rx << GET VARIABLE DIALSTRING
AGI Tx >> 200
2020 Jan 24
4
Perl AGI: read variable with quotes
Hi Gang
I have stumbled of this problem.
I need the P-Asserted-Identity header in an AGI scrip.
In the Dial-Plan I do:
same => n,Set(PAI=${PJSIP_HEADER(read,P-Asserted-Identity)})
In the AGI I do:
my $pai = $AGI->get_variable(PAI);
This works fine, unless the PAI contains quotes:
P-Asserted-Identity: <sip:1000 at 1.2.3.4:5060;user=phone>
I get "<sip:1000 at
2012 Feb 11
1
Asterisk perl AGI confusing variables
Hello all,
I'm struck with a very strange problem today. I've an AGI with some code
subroutine snippet as follows:
sub enable_sbc($) {
my $carrier = shift;
my $tmp = substr($carrier,1);
my $jkh = $tmp;
$server_port = $ast_agi->get_variable("SIPPEER($jkh,port)");
$ser_ip = $ast_agi->get_variable("SIPPEER($tmp,ip)");
2013 Sep 23
1
PJSIP question urgent
I cannot find in Asterisk 12, the channel variable ${CHANNEL(recvip)},
so if I use PJSIP, for scalability, how do I read what the signalling
IP where the inbound call is coming from and what is the inbound
codec?
You would think that the new channel would set those variables up, isn't it?
Philip Orleans
2020 Jan 24
0
Perl AGI: read variable with quotes
On Fri, 24 Jan 2020, Benoit Panizzon wrote:
> I have stumbled of this problem.
>
> I need the P-Asserted-Identity header in an AGI scrip.
>
> In the Dial-Plan I do:
>
> same => n,Set(PAI=${PJSIP_HEADER(read,P-Asserted-Identity)})
>
> In the AGI I do:
>
> my $pai = $AGI->get_variable(PAI);
>
> This works fine, unless the PAI contains quotes:
>
>
2011 Mar 05
2
Help Asterisk / API / Perl
Hi
i want use the API on my asterisk 1.6, but i have a small problems :
In extension, i start it :
exten => _X.,3,AGI(My-Script.agi)
The perl agi file are started without problems
but i want get into this script a lot of variable:
Type (SIP or IAX)
src (from cdr)
but that's don't work:
use Asterisk::AGI;
use lib "/var/lib/asterisk/agi-bin";
$AGI = new
2008 Mar 11
2
AGI - calling functions, CHANNEL STATUS broken?
Greetings,
I am writing an AGI script that needs to check on the idle/busy status
of a number of SIP peers (mostly SPA9xx phones, with a few Polycoms and
Snoms thrown in for fun).
Is it possible to call Asterisk functions (e.g. SIPPEER) from AGI
scripts? Based on my Googling, I would guess in the negative. I have
tried various permutations of Set() and Eval() without success.
I have also
2007 Sep 17
1
Problem with asterisk-perl-0.08 and Asterisk >= 1.2.20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I've been using for a long time asterisk-perl-0.08 for prepaid card
applications, and I've identified a problem with the last releases of
asterisk-1.2, installed with Trixbox.
The command get_variable() raises a signal SIGPIPE when it is called
(whatever the variable to get).
I made tests with Asterisk 1.2.20, 1.2.21 and 1.2.22, and I
2009 May 12
1
enum agi interesting problem
Hi,
I am having a strange problem with enum and AGI.
Here is what happens:
I have in my agi something like that:
foreach my $resolver ("e164.arpa", "e164.info", "e164.org") {
my @enums = get_enums($phone, $resolver);
foreach my $enum (@enums) {
$dialstring = $enum .
2005 May 30
0
perl agi : get_variable problem
Hi,
I'm developping some AGI in perl (5.8.6) on i386
using Asterisk 1.0.5.
I want to get some variables such as DIALSTATUS and ANSWEREDTIME
after a $AGI->exec("Dial", "dial_string");
but here is what i get actually:
DIALSTATUS=
DIALEDTIME=ANSWER
ANSWEREDTIME=18
I searched the archives and saw that $AGI->verbose could mess
the access to variables, but I don't use
2013 Apr 01
0
Getting DIALSTATUS via agi
Hi all,
Hopefully, I just need a second set of eyes on this one, but I just can't
figure out what I'm doing wrong. I'm using an agi script to dial a number,
check the dial result, and act accordingly.
The problem is that I'm not getting anything back from DIALSTATUS, or
HANGUPCAUSE.
Here is the relevant perl code:
===============================================================
2006 May 30
1
Asterisk::AGI and DIALEDTIME
Hi List,
In one of my AGIs (using DeadAGI) I grab the answered time using:
my $res = $agi->exec ("DIAL $dialstring");
my $answeredtime = $agi->get_variable ("ANSWEREDTIME");
However this information differs from what's written in the Master.csv
file (which happens to be the correct value!)
Any ideas why?
I'm using asterisk 1.2.7.1 and the
2014 Jun 18
1
PJSIP question
A few months ago I started using and had to abandon PJSIP because my
dialplan could not read the inbound signalling IP address, which I can
read now in Asterisk11 using CHANNEL(recvip). My app relies on this
information. The
question is, is it possible now access the signalling IP of an
incoming SIP call using PJSIP?
Philip
2011 Aug 25
1
security: SIP header spoofing CHANNEL(recvip)?
I am currently suffering various SIP attacks. I am using the following
extension to record the caller's IP address:
exten => h,n,set(CDR(srcip)=${CHANNEL(recvip)})
However, in recent attacks, this IP address is not correct, and I
believe that they are spoofing it. I am using asterisk 1.6.2.15.
Does the CHANNEL(recvip) variable record IP show in the SIP header
instead of the real, UDP
2005 Oct 13
1
AGI Variable problem
Hello all,
I try to use a agi script to get a variable from * und put them into a
script which gives me another variablke and put this in *.
My problem is now it seems the var ID is empty coz i always jump into
the result 0 loop.
The $MSN should be in the SetCIDNum.
#!/usr/bin/php -q
<?php
include("/var/lib/asterisk/agi-bin/phpagi.php");
$agi = new AGI();
$ID =
2016 Oct 10
2
AGI: How to break out of AGI when stream_file escape_digits are detected in middle of long sequence of files?
For reasons best known to myself, I call a python agi (PYST2 - love
it!) which streams a series of very short files in quick succession.
Like this:
escape_digits = str("0")
agi.stream_file(promptFile,escape_digits)
and this is what I see on the AGI debug:
<Local/s at root-00000061;2>AGI Tx >> 200 result=0 endpos=6784
<Local/s at root-00000061;2>AGI Rx <<
2010 Jul 27
2
Urgent help = RUBY & AGI
Here's something that should be easy for RUBY pro's.
Here is a script:
1.times do
r = $agi.exec('DIAL',
SIP/voipuser&Zap/32&Zap/33&Zap/34&Zap/35)
r = $agi.get_variable('DIALSTATUS')
# $agi.set_variable(' WHOANSWERED