TIPS Configuring AJAM (Asynch Javascript Asterisk Manager)

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
I'm brand new to PIAF and am trying to setup AJAM, but I'm not having any luck despite several hours of trying and searching. (I found a similar question on this forum, but it wasn't really resolved ...)
http://pbxinaflash.com/community/in...ronous-javascript-asterisk-manager-ajam.1437/

So .. is it possible to use AJAM w/PIAF - and if so how?

My Environ:
* PIAF Installed Version = 2.0.6.4 under *VIRTUALBOX*
* FreePBX Version = 2.11.0.11
* Running Asterisk Version = 11.6.0
 

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
Well...after a lot of trial and error I ultimately decided my install was hosed. Though I did manage to enable web access, I kept getting http 404 errors when I tried to access the AJAM demo app or login into the manager interface.

What tipped me off that something had gone awry was when I checked the http server status, a lot of the expected URI's (for AJAM) were missing. I've no idea why they went missing, but that did explain the 404 errors:

root@pbx:/$ asterisk -rx "http show status"
HTTP Server Status:
Prefix: /asterisk
Server Enabled and Bound to 0.0.0.0:8088
Enabled URI’s:
/asterisk/httpstatus => Asterisk HTTP General Status
/asterisk/phoneprov/… => Asterisk HTTP Phone Provisioning Tool
/asterisk/manager => HTML Manager Event Interface <=== missing
/asterisk/rawman => Raw HTTP Manager Event Interface <=== missing
/asterisk/static/… => Asterisk HTTP Static Delivery
/asterisk/mxml => XML Manager Event Interface <=== missing
....

I finally gave up trying to fix my install and started over. I loaded the PIAF-2.0.6.4.5-VirtualMachine .ova file into VirtualBox, modified the two config files and restarted asterisk. Afterward, I tested it from CURL it worked - finally! Now I just have to figure out why I can't access it from outside localhost, but hopefully that'll be easier :)

In case it helps anyone, here are my config files:


manager.conf
Code:
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
displayconnects=no ;only effects 1.6+
webenabled = yes
 
[admin]
secret = xxxxx
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
permit=192.168.4.100/255.255.255.0
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
writetimeout = 5000
 
#include manager_additional.conf
#include manager_custom.conf

http.conf (abbreviated)
Code:
enabled=yes
bindaddr=0.0.0.0
prefix=asterisk
enablestatic=yes

PIAF
Code:
  x  PIAF Installed Version  = 2.0.6.4 under *VIRTUALBOX*              x
  x  FreePBX Version          = 2.11.0.11                              x
  x  Running Asterisk Version = 11.5.1                                  x
  x  Asterisk Source Version  = 11.5.1                                  x
  x  Dahdi Source Version    = 2.7.0.1                                x
  x  Libpri Source Version    = 1.4.14                                  x
  x  IP Address              = 192.168.4.102 on eth0                  x
  x  Operating System        = CentOS release 6.4 (Final)              x
  x  Kernel Version          = 2.6.32-358.23.2.el6.i686 - 32 Bit      x
  x                                                                    x
  mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

CURL Test:
Results:
Code:
root@pbx:/ $ curl -I -L http://localhost:8088/asterisk/manager?action=login&username=admin&secret=xxxxxxxx
[1] 3475
[2] 3476
root@pbx:/ $ HTTP/1.1 200 OK
Server: Asterisk/11.5.1
Date: Wed, 04 Dec 2013 11:12:29 GMT
Connection: close
Cache-Control: no-cache, no-store
Content-Length: 877
Content-type: text/html
Cache-Control: no-cache;
....
 

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
Thanks for chiming in. Right now I'm just setting it up on a closed dev box, but you raise some valid points about security. I'll have to talk to our network guy about this.

> Whenever I setup AMI or AJAM, I always bind the services to the local IP address of the PBX, not 'localhost' and not '0.0.0.0'.

So I'm curious ... how then do your external applications access AMI/AJAM?
 

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
I always bind the services to the local IP address of the PBX, not 'localhost' and not '0.0.0.0'.

Ah, okay that makes sense. Thanks for the very detailed explanation! I'm still easing my way into this, so its good to have a clearer picture of how the various pieces fit together. You've totally made day :) Cheers
 

pbxtest

Member
Joined
Nov 29, 2013
Messages
49
Reaction score
6
Yeah, in all my reading this week I remember something about potential issues when changing the bind ip in manager.conf. Looking at the comments in the config file, I guess it makes sense since it's used by both the GUI and AJAM. I'm not real clear on "bindaddr" usage either so hopefully someone else can shed some light on that.
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top