May 10, 2019 Originate a call from Asterisk using PHP and Asterisk Manager Interface - originatecall.php. Originate a call from Asterisk using PHP and Asterisk Manager Interface - originatecall.php. Skip to content. All gists Back to GitHub.
This was originally hosted at Google Project Code hosting but has been moved to GitHub to make it easier or people to do with as they please.
However, it is no longer actively developed by me (the original author).
The Asterisk Manager PHP API enables a developer to control their Asterisk PBX system from a PHP application. Allowing for call origination, monitoring, queue management, etc. Other examples include:
- Adding handset to a queue.
- Monitoring a channel.
- Originating a call.
- Getting server status.
- Closing channels.
This was originally developed to help integrate PHP-driven CRM systems in the lending industry into the Asterisk PBX.
Example
I'm trying to make a checker script to check if the IP asterisk have Asterisk Call Manager.
I did it by make php script and using curl - the result and the response was
It's good for right now, it's expected.
The other expected is that I should send action in request as the massage said. So how can i send action like this:
Timo
25.2k1010 gold badges6060 silver badges6767 bronze badges
Mohammed NagyMohammed Nagy
2 Answers
I highly recommend you use already writed library
For php that is phpagi libs.
In this example you not respect protocol. Protocol say have be Action.
arheopsarheops12.6k11 gold badge1111 silver badges2323 bronze badges
I built a click 2 call script in php and it working but I am not able to find a variable to be sent to AMI along the call file which should disconnect the call after a specific time. i.e. I want to set 5 minutes as a max window for any call to happen and in case call is still on asterisk should disconnect the call.
my code is: I am looking for a variable to be added along with socket which can disconnect the call if length is more than 5 minutes.
Rajat HandaRajat Handa