Huge thanks to Joshua Colp for mirroring services

Asterisk PHP Peer Status

Share on Twitter Digg this story Click to view a printable version Tue, 01 Sep 2009 20:46:02 -0300

thumnail

I was looking through Google analytics and noticed quite a few people searching for Asterisk PHP Peer Status, so I decided it might be something useful to provide to you :)

Basically what the script does is connect to Asterisk via the Manager, log in, check the status of a peer, and then runs some code based on the result.

The example makes a phone call to a number and plays the tt-monkeys file if there is a problem - you could run this from cron every minute and have it call you :)

It's pretty much just a basic example of using PHP with the Asterisk manager without using any external libraries - there are possibly better ways to do it, but I could only allocate 5 minutes of time to the task :)

Anyway, you can view the code here:

peer-status.phps

It's released as public domain - do what you like with it, there's no warranty of any kind - if it makes your head explode, it's not my fault :)

Enjoy, and if you have any questions, post them as comments to the article and I'll get them answered for you!


You haven't voted yet! Vote:
Current Rating: 8/10 (8 votes)

Comments (3 posted)


CommentTakes Ext As Variable
Written by Chilling_Silence (September 15, 2009, 10:38 am)

Have slightly modified the code so it's easier to check on-the-fly @ http://pastie.org/616802


CommentBenicar
Written by benicar (November 6, 2009, 10:46 pm)

Hi, nice site design


CommentNagios
Written by Matt Riddell - http://www.venturevoip.com (January 5, 2010, 12:57 pm)

Yeah totally - glad I can help :)

Comments
Name:
Subject:
Website:
Message: 

Similar Articles (Based on Title)

*-Dev: Peer weekend improvements - February 14, 2005
Olle has posted details of some changes in HEAD over the weekend.

Small PHP script for displaying * CID database in Cisco 7940/60 XML - February 8, 2005
Stefan Gofferje has posted details of a PHP script he has developed.

VoIP-Info: MSN PHP - May 22, 2005
There is a nice description of how to get MSN Messenger working with Asterisk (via messages of incoming calls etc) available on the Wiki.

PHP C Extension to connect to manager interface - January 3, 2007
Moises Silva has posted details of a PHP C extension for connecting to the Asterisk Manager.

new res_js example order status checking script. - July 1, 2005
BKW has posted details of a new example of the usage of res_js on PBXFreeware.org.

*-ss7: libss7: Status update (ANSI works) - September 14, 2006
Matthew Fredrickson from Digium has posted an update on the ss7 capabilities for Asterisk.

voip-info.org status update - March 16, 2007
VoIP-Info has posted details on their failure.

Codename Pineapple - Chan_sip3 - status - May 16, 2007
Olle has posted an update on the next version of Chan_sip for Asterisk.

Asterisk status in Debian - October 8, 2007
Faidon has posted a note on the state of the Asterisk packages for Debian.

current status of policy for managing headers - November 21, 2007
Luigi has posted a list of the uses of various header files in Asterisk.

The status of Appconference - March 19, 2009
Erik Bunce has taken over the position of maintainer of app_conference.

Switchvox reports for queue status and history - September 8, 2009
Chromis has posted some details on their successful Switchvox install.

Asterisk on Windows - September 11, 2004
COLinux package which runs Asterisk on Windows


Original Content (C) 2004-2010 Matt Riddell
Back 5  Feed Add
to
Google Subscribe with Bloglines
Go to today

Icons by: FastIcon.com


Asterisk and Kamailio (openser) realtime integration
August 5, 2010 Average Vote: 10
Daniel-Constantin Mierla posted a writeup on combining Asterisk and Kamailio.

AstriDevCon: October 29th, Washington DC
August 23, 2010 Average Vote: 10
John Todd has posted a note about the AstriDevCon conference which occurs within the Astricon conference.

VoIP-Info: FFasterisk Video file converter
August 25, 2006 Average Vote: 10
The wiki has a link to a new piece of software for converting video to the format required for Asterisk.

Code Review: SRTP support for Asterisk
March 12, 2009 Average Vote: 10
Terry Wilson has moved his SRTP branch onto the Digium review board.

The Everything Asterisk Video Collection
August 5, 2010 Average Vote: 10
Steven Sokol has posted a blog entry on Asterisk Video Resources.

Voip-Forum: Lots of new articles
March 12, 2005 Average Vote: 10
Oej's Voip-Forum.com site has posted lots of new news articles while I've been away. Hopefully you found them via the asterisk-docs site. If not I've bookmarked them for you.

Interview with Mark Spencer
November 26, 2004 Average Vote: 9.9
We have managed to get an interview with Mark Spencer AKA Markster. Mark Spencer is the creator of Asterisk and by far the most active developer.

Asterisk and Kamailio realtime integration tutorial
May 24, 2010 Average Vote: 9.9
Daniel-Constantin Mierla has posted a link to a tutorial on integrating Asterisk and Kamailio using realtime.

Asterisk IPv6 update
February 1, 2010 Average Vote: 9.8
Olle has posted an update on IPV6 in Asterisk and a link to a blog post of his.

Proposal for T.38 transparent gateway design in Asterisk
April 29, 2010 Average Vote: 9.8
Kevin Fleming has posted a proposed design for a transparent T.38 gateway for Asterisk:

Back to life
July 21, 2010 Average Vote: 9.8
Hey all - I am back online after some pretty big projects which have taken all my time. Will be updating the Asterisk news over the next few days.

GUI changes from Trixbox, FreePBX, 2600hz, BlueBox
September 1, 2010 Average Vote: 9.8
Ok, bear with me on this one. If you understand all the ramifications, FreePBX has split to a new project called BlueBox contained within the 2600hz project. This obviously has implications for Trixbox that uses FreePBX to provide quite a bit of functionality.

Announcing Adhearsion 0.8.5
August 25, 2010 Average Vote: 9.8
Ben Klang has posted a note about the latest release of Adhearsion - a framework for developing Asterisk based solutions using Ruby.

app_swift v2.0 released
July 21, 2010 Average Vote: 9.8
Like a few of these news stories that I will be posting over the next couple of days this is a little old - hope it is not something you have already seen. This one is for a new version of the app_swift text-to-speech module for Asterisk 1.2, 1.4, and 1.6.

Monitoring Asterisk with Munin
January 7, 2010 Average Vote: 9.7
I had a few requests for these munin plugins after some discussion on one of the Asterisk lists and thought people might like them.


libpri 1.4.11.4 Now Available
September 3, 2010
The Asterisk Development Team has announced the release of libpri 1.4.11.4.

New CDR Stats Package
September 1, 2010
This one has been a long time coming. A new CDR stats package from Star2Billing to replace the 7 year old stalwart for viewing Asterisk call detail records.

GUI changes from Trixbox, FreePBX, 2600hz, BlueBox
September 1, 2010
Ok, bear with me on this one. If you understand all the ramifications, FreePBX has split to a new project called BlueBox contained within the 2600hz project. This obviously has implications for Trixbox that uses FreePBX to provide quite a bit of functionality.

RazorQuotePBP Asterisk Payment Module
August 31, 2010
RazorQuote has sent us a press release about the launch of RazorQuotePBP, a native Asterisk module that allows any Asterisk connected device to accept credit card payments.

CloudVox: Install an open source Asterisk phone app and get 250 dollars
August 30, 2010
CloudVox is running a competition for people to receive 250 dollars for writing up some documentation for Open Source applications on CloudVox - first in first served.

AstriCon approaches
August 25, 2010
John Todd has posted a note about the upcoming AstriCon conference in Washington, DC, and the innovation awards.

Announcing Adhearsion 0.8.5
August 25, 2010
Ben Klang has posted a note about the latest release of Adhearsion - a framework for developing Asterisk based solutions using Ruby.

Asterisk 1.8.0-beta4 Now Available
August 25, 2010
The Asterisk Development Team has announced the release of Asterisk 1.8.0-beta4.

AstriDevCon: October 29th, Washington DC
August 23, 2010
John Todd has posted a note about the AstriDevCon conference which occurs within the Astricon conference.

The XV Commandments of IVR
August 17, 2010
An update on the 15 tips for creating effective IVR systems by Allison Smith - the Voice of Asterisk.