[Asterisk-Users] Simple php script to monitor asterisk calls

Mojo with Horan & Company, LLC mojo at horanappraisals.com
Tue Mar 14 16:07:04 MST 2006


I guess I should mention that this assumes a situation where there are a 
few Zap, SIP, and possibly IAX2 channels converging.  This might be a 
little confused if all the lines are Zap or SIP exclusively.  This is 
untested.

Mojo with Horan & Company, LLC wrote:
> Hiya, hope I don't bore anybody with this.  There are certainly a lot of 
> monitor-y things out there and they just didn't fit my need, so maybe 
> this will fit someone's besides mine.
> 
> http://horanappraisals.com/asterisk/pbxmonitor/ contains two files.  one 
> is a php script called pbxmonitor, and one is a flat file of extensions 
> to extension name mappings of internal users.  It contains example data 
> that needs editing to fit your scenario.
> 
> so the pbxmonitor.db might have (separated by tabs):
> SIP/2000	Receptionist
> SIP/2001	Username 2
> SIP/2002	Username 3
> 
> an internal call might say:
> Username 2 talking to Receptionist
> 
> an outgoing call might say:
> Username 3 talking to 18005551212
> 
> an incoming call (already answered) might say:
> 18005551212 talking to Receptionist
> 
> It's pretty self explanatory I guess.  Run it and hope it does stuff.
> 
> so, pbxmonitor, in our application, is called from watch, like so:
> 
> watch -t -n 1 pbxmonitor
> 
> but you could implement it into a refreshing webpage or otherwise parse 
> it for your needs.
> 
> [sidenote]
> We use putty to connect to the asterisk box, and there's an account 
> called monitor with a key login instead of password login, and the 
> monitor user's .bashrc runs this watch line at startup, followed by an 
> exit.  I call tell putty to auto login a username, and via the command 
> line, make it load this connection at startup without asking for any 
> info, so it's pretty seamless for the end user.  But all that is neither 
> here nor there related to my post.
> [/sidenote]
> 
> I don't have parked calls in yet, but will soon.  I don't have meetme 
> conferences in soon, don't know if I will.  It doesn't do non-bridged 
> calls yet, this will be soon, as it is important to us.  This should 
> give indications of people checking their voicemail, people in echo 
> rooms and meetme conferences, and people in IVR things. Not sure what 
> else I'll have in it eventually, we'll see.  It's only tested with SIP, 
> IAX should work but dunno. I'll post back when I improve it.
> 
> Comments, suggestions welcome!
> 
> Moj
> 
> 

-- 
Mojo <mojo at horanappraisals.com>
Office Manger, Horan & Company, LLC
(907) 747-6666 x112



More information about the asterisk-users mailing list