Call Us Today! 877.742.2583




Page tree
Skip to end of metadata
Go to start of metadata

About

Example of quick and nasty auto-provisioning, dynamic directories, and queues for Snom and Polycom.

Last updated 2013.05.18 by wikimedia user Alexcrow

 

 Click here to expand Table of Contents

 

 


Introduction

We have an LDAP server which we use for organisation-wide directory services. It stores extension numbers for users as telephoneNumber and we store a team identifier in departmentNumber. We match this team id against one stored against every customer's phone number in the customer database (Interbase/Firebird in the examples but of course this can be changed).

We wanted to provide the following services:

  • Hot–desking for Snom and Polycom phones
  • Provisioning phones
  • Customer Service number to direct callers by Caller ID to appropriate team.

Beware, the PHP code is ugly and nasty, especially its eschewing the use of the XML libraries in preference to "echo". View it at your own risk!

Prerequisites

mod_curl, mod_xml_curl, mod_httapi should all be enabled.

Dialplan

Hotdesk Provisioning

We need two elements to our hotdesking dialplan. The first is to set up a "restricted" dialplan for phones that are not yet logged in. Users can log in at one phone, multiple phones, dial 999 and reboot their phone.

Note that this is in a new context, "restricted":

Restricted Context Examples

Logout

 

In the default context, we need to add another dialplan to allow logout (either from the user's extension or from another extension)

Logout Dialplan Examples

Voicemail Authentication

 

Note in both diaplans we check the user's voicemail PIN for auth.

Customer Service number

Customer Service Number

 

DHCP settings

For Snom, add a DHCP directive like:

option tftp-server-name "http://webserver/provision/index.php?mac={mac}&manuf=snom";

For Polycom:

option tftp-server-name "http://webserver/provision/";

Apache rewrite rules Setup

We need to add a rewrite rule for the Polycom phones so we can generate a valid URL for the <mac>.cfg and <mac>-settings.cfg files.

Apache Rewrite Rules for Polycoms

 

mod_xml_curl Setup

Set up the bindings for directory and configuration:

 

mod_xml_curl Configuration

PHP Examples

Queues

Configuration for Queues (/var/www/config/index.php):

PHP Queue Configuration Example  Expand source

LDAP Functions

 

LDAP functions (/var/www/ldapstuff/ldapfuncs.php):

PHP LDAP Example  Expand source

Provisioning

 

Provisioning script (/var/www/provision/index.php):

PHP Provisioning Example  Expand source

Directory Functions

 

Directory stuff (/var/www/xmlcurldir/index.php):

PHP Directory Examples  Expand source

Queue Routing

 

Direct incoming calls to the right queue - please note I've had to remove the query data from the query_ib function. The query should return just the department as stored in your customer database and a Caller Name (/var/www/teamdial/teamdial.php):

PHP Script writeDialResponse  Expand source

 

 

--Alexcrow 13:01, 18 May 2013 (UTC)

 

2 Comments

  1. "export to PDF" is terrible! Please check

    to word - is even worse!

    1. I checked. You are correct, it is terrible.