Code Monkey home page Code Monkey logo

phpagi's Introduction

PHPAGI README

Welcome to PHPAGI.

phpagi is a set of PHP classes for use in developing applications with the Asterisk Gateway Interface, and is licensed under the GNU Lesser General Public License (see COPYING for terms).

This release (version 2) of the phpagi classes is a significant overhaul from the old version 1 library. API functions have been renamed and restructured.

Version 1 of phpagi is no longer supported, but will continue to be available for historical purposes. We strongly encourage you to migrate to this new version.

If you have developed software based around phpagi, we'd like to hear from you! Drop us a note, and indicate whether you'd like us to list your application on our website.

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require welltime/phpagi ^2.20

or add

"welltime/phpagi": "^2.20"

to the require section of your composer.json file.

FILES

  • phpagi.php - The main phpagi class.

  • phpagi-asmanager.php - The Asterisk Manager class.

  • phpagi-fastagi.php - FastAGI class.

  • docs/ - README files for the classes.

  • api-docs/ - API Documentation (html)

DOCS

  • README.phpagi - The main phpagi README

  • README.phpagi-asmanager - The phpagi asterisk manager README

  • README.phpagi-fastagi - phpagi fastagi README

  • CHANGELOG - Change Log.

  • phpagi.conf - An example configuration file for phpagi.

  • fastagi.xinetd - xinetd.conf sample configuration for fastagi

SUPPORT

Support for phpagi is available from the project website.

phpagi's People

Contributors

alexeevdv avatar arbuzov avatar bdido86 avatar codelingobot avatar dmitrymcn avatar freess avatar ipoddubny avatar nedlosster avatar ricventu avatar sebastianberm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phpagi's Issues

not compatible with asterisk 16

Hello!

Previously asterisk sent --END command

action_command_cleanup:

    close(fd);
    unlink(template);
    astman_append(s, "--END COMMAND--\r\n\r\n");
    
    ast_free(buf);
    ast_free(final_buf);

which php-agi waits for

while(substr($buff, 0, 6) != '--END ')

but now there is no such code

action_command_cleanup:
astman_append(s, "\r\n");

    close(fd);
    unlink(template);

    ast_free(buf);
    ast_free(final_buf);

So php-agi does not work with asterisk 16.. :-(

get_variables and set_variables isseue in phpagi with asterisk 18.22

Hello,
I am usign phpagi 2.20 with php 8 and asterisk 18.22
when set and get variables run in the agi script, the results show that theya re set with some value, but upon checking its data part of the array, it is usually empty/null..

Due to this, i am unable to push data in my database tables...

phpagi_error_handler

Hi,

PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function phpagi_error_handler(), 4 passed and exactly 5 expected in /var/lib/asterisk/agi-bin/phpagi.php:1759
Stack trace:
#0 /var/lib/asterisk/agi-bin/phpagi.php(196): phpagi_error_handler()
#1 /var/lib/asterisk/agi-bin/test.agi(11): AGI->__construct()
#2 {main}
  thrown in /var/lib/asterisk/agi-bin/phpagi.php on line 1759

Is this library compatible with PHP 8?

Script wont die

Not sure if this is because of initd or phpagi but if you are using fastagi via xinetd and php is doing something for instance if you are playing a sound file, you have a sleep(10) etc. then even after hangup the php script will still be running. It seems that even after the tcp socket between xinted and asterisk is torn down xinetd keeps the php file running.

Cannot redeclare class AGI_AsteriskManager

We downloaded latest phpagi 2.2. But when we are excuting our php file we are getting this error.

Cannot redeclare class AGI_AsteriskManager in /var/lib/asterisk/agi-bin/phpagi-asmanager.php on line 867
Here is our php file code

!/usr/bin/php -q

answer(); $agi->say_number("1234"); // speaks the number 1234 $agi->say_digits("1234"); // speaks the digits 1, 2, 3 and 4. //$cid = $agi->parse_callerid(); $agi->text2wav("Hello"); $agi->text2wav('Goodbye'); // $agi->hangup(); ?>

Difficulties on how to use. Namespace?

Hello people.
I'm trying to use this project (having loaded through composer) but I cannot reference the classes properly as they do not have a namespace. I'm I doing something wrong?

Composer support

Would be great to have ability to install this package with Composer. As it became a de facto standard in PHP world.

PHPAGI get value in a variable

Hi all,
I am trying to get queue member list in .php using $agi->get_variable("QUEUE_MEMBER_LIST(washingtonflyer)"); which retrive queue member list.�
i want to save that value in a veriable. but it is not saving�. please help me here. following is my config.

exten => s,1,Answer
exten => s,2,AGI(/scripts/getagent.php)
exten => s,3,Noop(${agent1})

require_once("phpagi/phpagi.php");
$agi = new AGI();
$agent = $agi->get_variable("QUEUE_MEMBER_LIST(washingtonflyer)");
$agi->set_variable('agent',$agent1)

<SIP/3289-00000010>AGI Tx >> 200 result=1 (Local/9308@agent,Local/9311@agent,Local/9301@agent,Local/9315@agent,Local/9305@agent,Local/9309@agent,Local/9312@agent,Local/9302@agent,Local/9306@agent,Local/9313@agent,Local/9303@agent,Local/9307@agent,Local/9310@agent,Local/9314@agent,Local/9304@agent)
<SIP/3289-00000010>AGI Rx << SET VARIABLE a ""
<SIP/3289-00000010>AGI Tx >> 200 result=1
-- <SIP/3289-00000010>AGI Script /scripts/check_agent2.php completed, returning 0
-- Executing [s@washingtonflyer:3] NoOp("SIP/3289-00000010", "") in new stack
-- Auto fallthrough, channel 'SIP/3289-00000010' status is 'UNKNOWN'

GET FULL VARIABLE

The AGI syntax for get_fullvariable is wrong, it currently is
GET VARIABLE FULL xx
while it should be
GET FULL VARIABLE
Easy fix on line 454 of phpagi.php

problem with $_ENV superglobal

On some PHP configurations $_ENV is empty. It depends on this setting: http://us.php.net/manual/en/ini.core.php#ini.variables-order

That is what http://php.net/manual/ru/reserved.variables.environment.php tells us:

If your $_ENV array is mysteriously empty, but you still see the variables when calling getenv() or in your phpinfo(), check your http://us.php.net/manual/en/ini.core.php#ini.variables-order ini setting to ensure it includes "E" in the string.

http://us3.php.net/manual/en/function.getenv.php should be used instead. It is supported on all php configurations since 4.x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.