Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:59:43+00:00 2026-06-05T00:59:43+00:00

I want to make simple IVR using php in Asterisk. when i run php

  • 0

I want to make simple IVR using php in Asterisk. when i run php program individually , it works without any problem. but when i call it by AGI command in the Asterisk it does not works.
this is my php file :

#!/usr/bin/php -q
<?
 set_time_limit(30);
 require('phpagi.php');
 $agi = new AGI();
 $agi->answer();
 $file = '/var/www/html/test.txt';
 $current = file_get_contents($file);
 $current .= "Test\n";
 file_put_contents($file, $current);
 $agi->say_digits(1234);
 $agi->hangup();
 ?>

and this is Dialplan :

[testphp]
exten => 6565,1,Answer 
exten => 6565 2,Playback(Hello-World)
exten => 6565,3,AGI(testphp.php) 
exten => 6565 4,Playback(Hello-World)
exten => 6565,5,Hangup 

when i call 6565 by my phone , it only plays twice “Hello World” message!
php file permission is excutable.

I have installed Elastix(Asterisk) in VirtualBox.

What am I doing wrong?

please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:59:44+00:00Added an answer on June 5, 2026 at 12:59 am

    Do follwoing:

    1) stop asterisk

    asterisk -rx "core stop now"
    

    2) start it in ssh console

    asterisk -vvvgc
    

    3) enable asterisk AGI debug

    agi set debug on
    

    you will see error in your script. also check that selinux is off

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a simple program to make it run in the specific
I want to make a simple program that can restrict any communication over the
I want to make a simple news system using PHP and MySQL, right now
Basically I want to make simple toggle program (that will be mapped to some
I want to make a simple game: 2d, single-player, without tons of animations and
I want to make a simple program that sends random keystrokes to my other
I want to make simple Yes/No choiced MessageBox, but I think it is nonsense
i want to make a simple chess program. So far i've made the board
I just want to make a simple native query with EclipseLink, but I can't
I want to make some simple 2d games/clones (for Mac), but I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.