Sep
06
2010
0

How to use PHP to reboot a Poycom SIP Phone

I’m knee deep into writing Voice Provision .04(VP4) for VoiceIP Solutions.  Why write another Asterisk GUI?  Because the Trixbox and Elastix software is way to convoluted and makes customization difficult.  They are not well documented and don’t attribute credit back to Asterisk or Digium.

Standard Asterisk scripting and basic macro’s are easier to setup, maintain, develop and troubleshoot.  What I require is a basic PHP SIP/IAX2 user manager that stays out of the dial plan. It must be specifically designed to manage Polycom phones.  This is why I’ve been locked in my room the last 4 weeks and haven’t done any recent articles.  My apologies.

The goals for VP4 are simple, Dynamic realtime SIP user management and standard Asterisk dial plan work via the extensions.conf.  Since VoiceIP Solutions is a certified Polycom reseller, VP4 will include several functions for generating Polycom configuration files and allowing remote reboots of the phones.  In this post I will provide a example of PHP function that reboots a Polycom SoundPoint IP phone by sending a SIP Notify message.

This post assumes you have a basic grasp on LAMP(Linux Apache MySQL PHP).  Also you need a working registered Polycom phone provisioned via a boot server of some kind(HTTP,FTP, TFTP,etc…).  I have a tutorial on that here.

Goals of this Post:
– Install PHP-SIP class from Google Code
– provide example function in PHP

(more…)

Sep
21
2009
0

PHP array example

Hello all. It’s been a few weeks since I posted… I’ve been teaching myself PHP to create a web interface for a Asterisk based project I’m working on. My goal is to create a LAMP(Linux, Apache, MySQL, PHP) web managment tool for creating calling cards for use with Asterisk. The project is called ACCWA(pronounced aqua), the Asterisk Calling Card Web Administration tool. As I put this altogether I will keep my loyal readers updated about what I’ve learned about PHP.

Today I will cover Arrays. PHP handles arrays in manner similar to PERL. Each value can have an optional indice. In my example below, we simply have a list with no idiceses.

example:

<?php

$myarray[]=”hi” ;
$myarray[]=”how” ;
$myarray[]=”are” ;
$myarray[]=”you?” ;

// Now we will ‘echo’ each value in the array
foreach ($myarray as $i) {
echo “$i ” ; }

?>

output of myarray.php:

Above we did two simple task. First we defined a list of words in our array, then we echo’ed each one individually with the ‘foreach’ function. Very similar to BASH.  Your PHP page should display:

hi how are you?