Using Asterisk PBX with Apache Proxy module

For the fun of it I wanted to try AJAM to view real time call progress data wrapped in a nice prototype.js driven GUI.

“If you want to integrate CGI’s, databases, PHP, etc. you will likely need to use a more traditional web server like Apache and link in your Asterisk micro HTTP server with something like this:
ProxyPass /asterisk http://localhost:8088/asterisk

Ok, by using this ProxyPass thingy, I´am able to use my own PHP scripts, yeah babe that´s what I want :)

FYI: I’am using Debian/4, Apache/2.2.3 and Asterisk/1.4.13

First you need to activate proxing in Apache by creating the following softlinks:
cd /etc/apache2/mods-enabled
ln -s ../mods-available/proxy.conf proxy.conf
ln -s ../mods-available/proxy.load proxy.load
ln -s ../mods-available/proxy_http.load proxy_http.load
ln -s ../mods-available/proxy_connect.load proxy_connect.load

The second step is to add the ProxyPass to your httpd.conf or vhost file:
<VirtualHost *:80>
ServerName asterisk.example.org
..
ProxyPass /proxy http://localhost:8088/asterisk
ProxyPassReverse /proxy http://localhost:8088/asterisk
</VirtualHost>

And finally reload apache with
/etc/init.d/apache2 reload

You should now be able to make requests to http://asterisk.example.org/proxy/static/ajamdemo.html which will be forwarded to http://localhost:8088/asterisk/static/ajamdemo.html

And it will look something like this:
Asterisk AJAM demo example

April 8th, 2008 - Posted in voIP | |

One Response to ' Using Asterisk PBX with Apache Proxy module '

Subscribe to comments with RSS or TrackBack to ' Using Asterisk PBX with Apache Proxy module '.

  1. without said,

    on November 2nd, 2016 at 1:20 pm

    Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up. Grrrr well I’m not writing all that over again. Anyway, just wanted to say superb blog!

Leave a reply