search for: agi_

Displaying 20 results from an estimated 20 matches for "agi_".

Did you mean: agi
2016 Jan 06
2
No joy with my first AGI Python script
...python import sys env = {} def comm(cmd): sys.stdout.write(cmd.strip() + '\n') sys.stdout.flush() return sys.stdin.readline().strip() while 1: line = sys.stdin.readline().strip() if line == '': break key,data = line.split(':') if key[:4] == 'agi_': key = key.strip()[4:] data = data.strip() if key: env[key] = data #comm("Verbose(0,pyast: %s)" % sys.argv) comm('SAY NUMBER 123 ""') sys.stderr.write("AGI Environment Dump:\n"); for key in env.keys(): sys.stderr.write(" -- %...
2006 Sep 14
4
WAIT FOR DIGIT not working
...-------- #!/usr/bin/perl use POSIX; $| = 1; sub trim { my @out = @_; for (@out) { s/^\s+//; s/\s+$//; } return wantarray ? @out : $out[0]; } while(<STDIN>) { chomp; last unless length($_); if (/^agi_(\w+)\:\s+(.*)$/) { $AGI{$1} = $2; } } print "EXEC Ringing\n"; print "EXEC Wait 1\n"; print "EXEC Answer\n"; print "EXEC Festival 'Please enter the extension you want to call'\n"; $target = ""; print "WAIT FOR D...
2003 Aug 25
2
SetVar on sample.call
...===================== #!/usr/bin/perl $|=1; while(<STDIN>) { chomp; last unless length($_); if (/^agi_(\w+)\:\s+(.*)$/) { $AGI{$1} = $2; } } sub checkresult { my ($res) = @_; my $retval;...
2006 Dec 18
2
AGI Help Please
...t_db() { $database="asteriskcdrdb"; include("./common.php"); include("./dbconnect.php"); } // parse agi headers into array while ($env=read()) { $env = str_replace("\"","",$env); $s = split(": ",$env); $agi[str_replace("agi_","",$s[0])] = trim($s[1]); if (($env == "") || ($env == "\n")) { break; } } // main program $clid = $agi[callerid]; connect_db(); $query1 = "SELECT * FROM cdr WHERE dst = '$clid' "; $query_result1 = @mysql_query($query1); $row_count...
2006 Jun 02
1
PHP-AGI help
...OSE \"$line\"\n"; } function write($line) { global $debug, $stdlog; if ($debug) fputs($stdlog, "write: $line\n"); echo $line."\n"; } // parse agi headers into array while ($env=read()) { $s = split(": ",$env); $agi[str_replace("agi_","",$s[[0])] = trim($s[[1]); if (($env == "") || ($env == "\n")) { break; } } $sender = "prospect@talktomehomes.com"; $recipient = "mwarren@cwgo.com"; $subject = "call from someone"; $header = "From: " ....
2007 Jun 22
2
STDERR in AGI
...File: /var/lig/asterisk/agi-bin/agi-test.py # # Description: An AGI Script # import sys env = {} tests = 0 while True: line = sys.stdin.readline().strip() if line == '': break key,data = line.split(':') if key[:4] != 'agi_': sys.stderr.write("Did not work!\n") sys.stderr.flush() continue key = key.strip() data = data.strip() if key != '': env[key] = data sys.stderr.write("AGI Environment Dump:\n")...
2003 Dec 29
1
Agent setup
Dear Group, I have been successful in setting up the Agents, queues and getting agents to log in. Is there a way that I could configure the system so that the agent is called back. i.e. the agent logs into the system, a call is destined for them and their phone rings. If some one has this setup I would be very interested in hearing from them. Warm Regards and Thanks --------------- Shad
2005 Oct 12
3
AGI and set_callerid for number and name
Hi, I've been trying to use the set_callerid function in the AGI. It sets the CallerIDname properly but I can't figure out how to set the CallerIDnumber. Is it at at possible ? Cheers. SL
2003 Nov 05
1
First AGI help..
...lling phone"\n"); // This doesn't fputs($out, "exec(Dial(sip/2012)\n"); fclose($in); fclose($out); fclose($err); ?> test2.pl script.. #!/usr/bin/perl # taken from a sample file.. $|=1; while(<STDIN>) { chomp; last unless length($_); if (/^agi_(\w+)\:\s+(.*)$/) { $AGI{$1} = $2; } } #This works.. print STDOUT "AGI Environment Dump:\n"; foreach $i (sort keys %AGI) { print STDOUT "Verbose \"-- $i = $AGI{$i}\"\n"; } # This does not start a call.. print STDOUT "exec(Dial(sip/...
2005 Aug 04
1
Callback question
Hi, I'm interested in a callback feature where I can dial my Asterisk, then hangup and Asterisk will call me back and I can then place phone calls or whatever I want to do. And also, if I've got voicemail I want Asterisk to call me back as well. Are there any scripts for this available? Any help would be apreciated! Best regards, Christian
2010 Jan 11
0
PHP-Script (AGI) doesn't finish after upgrading to 1.6.0.15
...ar/lib/asterisk/agi-bin/test.php ----------------------------------- #! /usr/bin/php -q <?php ob_implicit_flush(true); set_time_limit(6); error_reporting(0); $stdin=fopen("php://stdin","r"); while(!feof($stdin)){ $temp = fgets($stdin); if (preg_match("/agi_/",$temp)){ $temp = str_replace("\n","",$temp); $s = explode(":",$temp); if ($s[0]=="agi_callerid"){ $caller=trim($s[1]); } if ($s[0]==&q...
2003 Sep 25
2
VoiceMailMain skipping extension and password prompting
I would like to access VoiceMailMain2 skipping extension and password prompting if calling from a resource that has a mailbox defined. What variables can I use to retrieve the calling channel & calling extension (if it exists)? Here is what I'm trying to accomplish (of course ${CallingResourse.MailBox} is not a real way to retrieve this info)... exten =>
2007 Aug 24
0
MYSQL problem and configuration
...ine('STDERR',fopen('php://stderr','w'));}#retrieve all AGI variables from Asteriskwhile(!feof(STDIN)){ $temp=trim(fgets(STDIN,4096)); if(($temp=="")||($temp=="\n")) { break; } $s=split(":",$temp); $name=str_replace("agi_","",$s[0]); $agi[$name]=trim($s[1]);}return $agi;}function checkresult($res){ trim($res); if(preg_match('/^200/',$res)) { if(!preg_match('/result=(-?\d+)/',$res,$matches)) { fwrite(STDERR,"FAIL ($res)\n"); fflu...
2007 Nov 02
3
use dial plan passed arg value in C agi code
Hello * users, I know that passing variable in the AGI script is by exten => _.,1,AGI(simple_c_prgm|123|789) ; 123, 789 are arguments being passed and simple_c_prgm is C code Now how will I receive these variables within C code ? Is it by the same way arguments are passed in command line to C by using argc and argv or there is more to be done than that? Thanks Regards -- Arpit Mehta
2006 May 31
0
AGI MySql
...;The following is my AGI script done in perl > > > >#!/usr/bin/perl > > > >use strict; > >use DBI; > > > >$|=1; > > > >my %AGI; > > > >while(<STDIN>) { > > > > chop; > > last unless length($_); > > if (/^agi_(\w+)\:\s+(.*)$/) { > > $AGI{$1} = $2; > > } > > } > > > >my $ext = $AGI{extension}; > > > >if (!($ext)) { $ext = 10; } > > > >my $dbh = DBI->connect('dbi:mysql:voiceDb', 'test', 'test', >{PrintError=>0, > &...
2003 Jul 07
5
Direct entry to your own voice mailbox
Hi, There is any possibility to dial a specific extension and then enter in your own mailbox (the one defined for that specific SIP phone) without asking for the exxtension number but only for the password? I want to be the same extension for all phones, not a specific one for each of them. It is possible to have a time stamp in the recorded message? I want to know when the message has been
2005 Mar 27
6
pass caller ID to another application or machine.
I would like to have asterisk pass along the caller ID phone number to a database server on a my local network (the same network that the * server resides on ) so that our customer service app. can pull up customer data automatially. Asterisk passes along caller ID to the phones fine, can someone tell me how to make it pass this info to my database server? Any suggestions would be greatly
2003 Nov 10
3
AGI and PHP
...pose any inconvenience for use with * agi, so use it. $stdin = fopen('php://stdin', 'r'); $stdout = fopen('php://stdout', 'w'); $stdlog = fopen('my_agi.log', 'w'); 6. * always sends a bunch of info each time agi is called as follows: agi_request: test.php agi_channel: Zap/1-1 agi_language: en agi_type: Zap agi_callerid: agi_dnid: agi_context: default agi_extension: 1000 agi_priority: 1 . . if you need the info, save it; otherwise throw them away as follow...
2007 Sep 14
2
AGI script fails on IAX channels (from call file).
...agi|670507 ================= End Call File ======================== Perl AGI Scrip ============ test.agi ================================= #!/usr/bin/perl use strict; use Time::Local; $|=1; # Setup some variables my %AGI; my $DEBUG=1; my $DEBUGOUT = "filehandle"; my $debugfile="/tmp/agi_debug.log"; ############ check_result ########## # Use this to check the result of # # a sent command # # I pretty much stole this from # # the regular agi-test.agi # #################################### sub checkresult { my ($res) = @_; my $retval; chomp $res...
2003 Sep 19
7
AGI problem
Hi. I have the next configuration... I dial from my analog phone in the TDM400P to extension 102, and the second agi works about 1 out of 10 times, the other nine it gives me these error on the asterisk console: -- Starting simple switch on 'Zap/2-1' -- Executing Macro("Zap/2-1", "receivecall") in new stack -- Executing AGI("Zap/2-1",