Asterisk Callme Architecture with PHP AGI

Asterisk Callme :: The open PBX

Asterisk Callme :: The open PBX

Extensions Configuration


exten => s,1,AGI(callme.php|${CNUM})

CNUM is the variable passed to callme AGI Script

Callme.php Agi Script

* Author Arun Raj R
* @package phpAGI_for Call me
* @version 1.0
$agi = new AGI();
$cid = $argv[1];
$agi->exec(“Dial Zap/g0/”.$cid, null);


PHP File to run callme service request


$number2 = $_REQUEST[num2’];
$asm = new AGI_AsteriskManager();
$asm->connect(“localhost”, “username”, “password”);
$number = “Zap/g0/”.$number1;
$asm->send_request(‘Originate’, array(‘Channel’ => “$number”, ‘Context’ => “callme”, ‘Priority’ => 1, ‘Async’ => true,’callerid’=>”$number1″,’Variable’=>’cnum=’.$number2,

me : yeay its me arun

Tagged with: ,
3 comments on “Asterisk Callme Architecture with PHP AGI
  1. Christian says:

    I have tried your solution into a trixbox but i have ever Permission denied error if i print the result of the send_request method.

    I have not Zap channel but only SIP channel

    and i have a little changed your scripts according to my configuration.

    Can you help me?

    thanks in advance

  2. R Arun Raj says:

    Hi Christian,

    you have to set up 777 permission to files and folders used by our AGI program

    just try and let me knowv

  3. Miqdad says:


    Can you please help me to catch the output of

    $agi->exec(“Dial Zap/g0/”.$cid, null);

    I just want to handle

    $result = $agi->exec(“Dial Zap/g0/”.$cid, null);
    if($result == "No ANswer"){


    like this…

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.