Switchvox by Digium is a VOIP applicance which makes very complex and powerful phone system solutions easy to implement. It offers an API exposing many capabilities for integration with custom code.

The PHP inetgration class provided by Digium is very rudimentary and requires use of PECL extensions. I try to avoid anything PECL as it requires code to be compiled on the server and is therefore machine/environment specific. If you are working on a development team or use a code repository, it's better practice to keep all dependencies within each project, and PECL does not allow for this.

This class requires 2 PEAR classes to be available. I also prefer to keep PEAR code locally within a project by creating a project local working directory for PEAR, then overriding the base include path so that the project PEAR code is found, loads first, etc. This keeps all dependent code in the project. If there's interest, let me know and I'll post an article on how to do this, but it is not required to use this class.

Our switchvox integration offers the following:

  • does not require PECL code, only 2 PEAR libraries
  • is accessed as a singleton class, so it is easier to access in code
  • improve error logging, fixes bugs in their sample code, etc

 Review notes in the code for requirements, usage and sample code.