Questions tagged [agi]

The Asterisk Gateway Interface (AGI) is a CGI-like protocol for executing external programs within Asterisk dialplan.

The Asterisk Gateway Interface (AGI) is a CGI-like protocol for executing external programs within Asterisk dialplan.

The programs are called with the AGI dialplan command and then exchange a series of AGI protocol commands with the Asterisk server on STDIN and STDOUT.

207 questions
2
votes
3 answers

How to integrate Asterisk server with external relational database, like mysql?

My objectives: Client(SIP phone, i use 3CX phone) dial to asterisk server, asterisk then connect with external relational database(not located in the same place with asterisk server), and if database response something, asterisk server play a voice…
Michael Lai
  • 177
  • 2
  • 6
  • 15
1
vote
9 answers

Asterisk AGI framework for IVR; Adhearsion alternative?

I am trying to get started writing scalable, telecom-grade applications with Asterisk and Ruby. I had originally intended to use the Adhearsion framework for this, but it does not have the required maturity and its documentation is severely…
Ted B
  • 131
  • 2
  • 6
1
vote
1 answer

create AGIScript in classLibrary project

I have a simple project create with c# (.Net Core 6.0) I create a AGIScript class with Asternet and recieve the data from asterisk server. it's working well, As long as both are in the same project (exe project). public void ListenToAgi() { var…
AminRostami
  • 2,585
  • 3
  • 29
  • 45
1
vote
2 answers

How to write an AGI Script

I am fairly new to the Asterisk Gateway Interface. Couple of questions. What language would be suggested to start out with. My end goal is to have a script that automatically page when a call is parked. In esscence, the operator would park the…
Phill Fernandes
  • 57
  • 3
  • 11
1
vote
1 answer

How do I pass variables between dialplan and agi script in asterisk

I want to be able to pass the extension entered by a caller to the agi script and after it is manupulate I would like the agi script to send the result back to the dial plan as a variable. Can anyone give me an example of how to achive this in any…
user902263
1
vote
0 answers

Asterisk EAGI audio while running AMD or other asterisk app via "EXEC"

Is it possible to use "AMD" to detect silence in EAGI script and receive the audio on fd 3 at the same time? Is this scenario supported or I am doing something wrong? Simple demonstration bash script, which is run as EAGI(/home/agi/eagi.sh) from…
Marki555
  • 6,434
  • 3
  • 37
  • 59
1
vote
2 answers

Getting information from asterisk (freepbx) on call end , and passing it to php file

I am trying to pass some call information, to an api-script if the call is answered following variables will be needed: Caller ID Time Call Started Time Call Ended Total Call Duration Conclusion type (1= Completed, so the call went through,…
Ble
  • 101
  • 1
  • 12
1
vote
1 answer

Asterisk AGI script falls when caller hangup

I'm having the simple AGI script, I need to dial 101 extension by calling 6666 number and calculate answered time after call. Everything works fine when callee hangup, but when caller hangup agi script falls with returning 4. Sorry for my…
1
vote
0 answers

Browse back and forth by mysqli_fetch_array

How can you make whether case 1 goes to the next result case 2 goes to the previous result Thanks a lot (I'm still a little new, any help will be received)
libel
  • 13
  • 4
1
vote
1 answer

How to use Asterisk AGI with python3?

Using Asterisk 16.2.1 my AGI script (at the bottom) works with python2 #!/usr/bin/env python2, but not with python3 #!/usr/bin/env python3. I do not even get as far as agi.verbose("python agi started") (with python3), so I assume it has something…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
1
vote
1 answer

How to use $agi->get_data with multiple audio files

In Playback, Background, Read we can combine audio files with &, like file1&file2. In PHPAgi instead of Read, I use $agi->get_data, but its look like accept only one file! I also tried to play audio with Background before calling get_data: …
MeTe-30
  • 2,512
  • 2
  • 21
  • 30
1
vote
1 answer

Would it be possible to play an audio directly from memory?

I am currently using Microsoft TTS, I get streaming audio, saved to a file and then send the command to Asterisk in "Stream File". Follow: .... response = requests.post(url, data=body, headers=headers) self.print("Got wave response") with…
luisdemarchi
  • 1,402
  • 19
  • 29
1
vote
1 answer

Asterisk AGI and Mysql string variabile

I can not solve a problem, The purpose of the script is to identify the context number. Below is the asterisk dial plan extensions.conf exten => 1234,1,Answer() same => n,Set(NUM2CALL=Hello, your number is eight) same => n,NOOP(${NUM2CALL}) same =>…
Andrei
  • 63
  • 10
1
vote
3 answers

Asterisk AGI runs in console mode only

I am trying to run a python script by calling it in the asterisk AGI Interface. I have had this running in a test environment but cannot seem to get this to run on Ubuntu 18.04. I can get the AGI script to run when I start asterisk with "sudo…
Matt Saiko
  • 31
  • 8
1
vote
2 answers

Asterisk 13 , agi 'DIALSTATUS' not work

i was setup a new Rasperry Pi 3 Plus with Stretch, php7 and Asterisk 13 via apt-get etc... so i have a problem with that $agi->get_variable('DIALSTATUS'); i got a no usefull data some like this with print_r Array([code] => 200,[result] => 1,[data]…
user7505956
1 2
3
13 14