is this for php? 

----- Original Message ----- 
From: "federico fetto" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, November 19, 2008 8:41 AM
Subject: Re: [asterisk-users] Monitoring


> On Wed, 19 Nov 2008 15:17:50 +0200
> "Hakan C" <[EMAIL PROTECTED]> wrote:
> 
>> Hey Jon,
>> 
>> You are asking something too specific.
>> If you want to monitor your PRI, its not so difficult to script.
>> 
>> <?
>> $checkPRI = exec("asterisk -rx 'pri show spans'");
>> if (ereg('/^Down/', $checkPRI, $match) {
>> echo "OMG, someone call the ambulance\r\n";
>> echo $match;
>> } else {
>> echo "working...";
>> }
>> ?>
> 
> Or better (imo):
> <?
> $checkPRI = exec("asterisk -rx 'pri show spans'");
> if (ereg('/^Up/', $checkPRI, $match) {
> echo "working...";
> } else {
> echo "OMG, someone call the ambulance\r\n";
> echo $match;
> }
> ?>
> 
> Bye
> Federico Fetto
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>


_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to