Howto:Working with multiple Door Cameras
This information applies to
- V10 and innovaphone PBX platform
- innovaphone phones supporting video
- web server running PHP 5
some innovaphone phones support display of a door phone camera picture (see Howto:Door Phone with Video in V10 and later). However, only one camera is supported. This article describes a solution for use of multiple door cameras.
When multiple door cameras are used, the standard mechanism described in Howto:Door Phone with Video in V10 and later is not sufficient, as the URL used in the phone is static and will always show the same door camera. Instead, the image should switch from one camera to the next continuously. Also, when the operator is called by the door phone, the picture from the calling door should be shown always and the phone UI should switch to the Video app. This can be achieved using this SOAP-based utility.
- A web server running PHP5. A Linux Application Platform is fine, but any other PHP platform should do too. (Remark: V13 Application Platform does not provide any PHP server.)
- For the switch to video app feature, you need at least script version 1005 and telephone firmware which includes fix 17611 - Phones: Remote Control Facility "switch2App" (that is, v12r2 - beta 1 (125048) or later).
- If the PBXs have configured DNS names, the web server must be able to resolve these, as SOAP may need to connect to slave PBXs using the configured DNS-Names.
- Download the complete file package of scripts and files described in this article.
Unpack the downloaded file (see #Download). Copy the content of the
Solution/sources directory (including the sub directories) to your web server.
On a Linux Application Platform
To install the utility on a Linux Application Platform , you may proceed as follows
- open the LAP's file system using a SFTP client such as e.g. WinSCP (if you have not yet changed it, the default credentials will be
root/iplinux, see Concept Linux Application Platform). Note that you must use SFTP rather than WebDAV, as WebDAV will not give access to the executable web server files
- create the new directory called
- copy the files
DoorControl.phpto the new directory
- create a subdirectoy
- change to this directory
- copy the file
innopbx.class.phpto the new directory
- create the new directory called
- log in to the LAP's admin UI (if you have not yet changed it, the default credentials will be
admin/linux, see Concept Linux Application Platform)
- go to Administration/Web Server/Change web server properties and public access to the web/webdav
doorcontrolto Public Web Paths
- log in the LAP's root shell (using e.g. putty, if you have not yet changed it, the default credentials will be
root/iplinux, see Concept Linux Application Platform)
- change owner of
doorcontroland all its sub -directories to
chown -R www-data doorcontrol)
After you have finished the configuration open your web browser and go to
http://your-web-server-name-or-ip/path-you-installed-the-toolto/DoorControl.php?debug. You should see something like
number seconds since last switch ... switching to next name-of-door ...
Configuration needs to be done in the
doors.xml file that comes with the
DoorControl.php script and on the phone that is used to monitor the door video(s).
When the switch to video app function is used (see below), additional configuration on the PBX is required.
The utility comes with a working sample configuration (in
doors.xml). This file must reside in the same directory you installed the PHP script (
DoorControl.php) too. The sample file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
pbx="184.108.40.206" pbxhttp="demo" pbxpw="demo" pbxuser="_TAPI_" interval="5" switch="false"
<door name="door" url="http://wiki.innovaphone.com/images/innoWiki.png"/> <door name="behnke" url="https://www.innovaphone.com/content/images/innovaphone-slider-uc.png" proxy="true" content-type="image/png"/>
The root tag
doors has a few attributes which define the PBX access (used to determine if a phone is being called by a door phone):
- the IP address of the PBX
- the HTTP user to be used to access the SOAP service on the PBX (usually the Name' of a PBX user object with minimum Groups/Call Forwards only access right or the admin user of the box)
- the password of the HTTP user
- the Long Name of a user object that is used to access the SOAP service on the PBX
Also, the interval between switching the available door cams must be defined
- the number of seconds the utility will wait before switching to the next camera
Finally, you can optionally have the phone switch to the video app automatically:
false. If set to true, the script will notify the phone when it detects a call from a door, so that the phone switches to the video app. This requires a fix within firmware v12r2 beta 1 or later. Also it requires at least script version 1004.
door defines an available door camera.
- the URL to retrieve a single picture from this camera. You must use the single-picture URL here (usually ending in
.jpg), not the picture stream (
.mjpg). Otherwise, the phone will never switch to the next camera.
- the Name of the PBX user object the door phone is registered with
Proxy Access to Door Camera
In normal operation, this script will not deliver the door cam image itself to the caller. Instead, it will tell the calling client the URL where the current door cam image can be retrieved (using a
HTTP/1.1 307 Temporary Redirect response with a
Location: ... header). The phone will then refer to this URL and retrieve the image itself.
However, in rare situations this may not work (e.g. AXIS cameras are known to be incompatible with the HTTP client built-in to the innovaphone phone when the image requires authentication). In this case, the script behaviour can be modified so that the image actually is retrieved by the script and then returned to the caller.
- if this is set to
true, the image will be retrieved by the script and returned to the caller directly
- if authentication is required by the camera and proxy mode is used, you can provide the authentication user-name here
- if authentication is required by the camera and proxy mode is used, you can provide the authentication password here
- you can optionally specify the value used for the
Content-Type:HTTP header (normally not necessary)
- proxy-skip-ssl-verify [since build 1009]
- if this is set to
true, SSL-Certificate of the given
urlwill not be verified
- proxy-resize [since build 1009]
- if this is set to
true, the big pictures will be resized for IP-Phone. The size is depending on the phone model and does not need to be configured. You can use this method if your camera is not able to provide small images. Please note that this increases the resource usage on your webserver and should only be used if your camera does not support the resize process itself.
The door operators phone (that is, the phone that shall monitor the video image of the door(s)) needs some configuration as follows.
The Background Image property in Phone/Preferences must be set to the DoorControl.php script on your web server. It supports the following arguments
id=operator, the Long Name of the PBX user object the retrieving phone is registered with. The script will use this name to query the PBX if the phone is currently being called by a door phone. (Special chars have to be encoded)
hw=0090333e0c57, the Hardware Id used to register the operator's phone (optional, may be omitted if the operator does not have multiple registrations or mobility). Requires at least script version 1004 (Special chars have to be encoded)
- if this is set, the script will not deliver the requested picture but will spit out some debug information
Please note that you must also add the query arguments not processed by the
DoorPhone.php script but by the phone itself, namely
refresh=1, see Background Image in Reference11r1:Phone/Preferences and Howto:Door Phone with Video in V10 and later
So you may end up with something like
Picture Sources with Password Protection
If your camera is password protected, you must configure its URL and password in Services/HTTP/Client/Authenticated URLs.
If you want to serve this function to multiple Agents (e.g. over a Waiting queue), you have to use a separate Mobility Object per agent and configure the doorcall-trigger on each agent separately
From build 1005 on, the script can also switch the active app page on the door operator phone when a call from a door comes in. This feature requires additional configuration on the PBX.
- create a PBX Voicemail object (you could set Long name and Name to
- in the 'Voicemail tab, tick the Trace check-mark
- furthermore, set the Script URL to something like
- open the
switchops.xmlscript itself and fix the url found in the string argument of the
lib-strcattag near line 23 so that it points to your installed
<lib-strcat out-string="$url" string="http://220.127.116.11/doorcontrol/DoorControl.php?switchapp=1&h323=" string2="$leg2-name-enc"/>
- note that anything including and behind
/DoorControl.php?must stay unchanged!
- add a Forking for the PBX user running the door operator phone towards the newly created Voicemail object
- it is ok for the new Voicemail object to have no Number property, so you can target the Forking to its Name
You can debug the retrieval of the image files using a normal brwoser. If you enter the URL to the script in to the address bar of your browser
http://my.door.tld/path-on-web-server/DoorControl.php, the browser will retrieve the current image. If you add a
?debug=1 argument, as in
http://my.door.tld/path-on-web-server/DoorControl.php?debug=1, you will see various debug messages instead of the picture.
Debugging the switch to video app function is a bit more tricky. You proceed as follows:
- clear all trace flags on the PBX where the voicemail PBX object is installed
- tick the Trace flag in the Voicemail tab of this Voicemail PBX object
- check if the forking is configured correctly
- look at the PBX Calls screen (or at the PBX calls logging)
- from a door, call the door operator
- the call should trigger a call to the Voicemail object while the door operators phone is ringing
- obtain the PBX trace
- it should look something like
- The Voicemail PBX object gets call
1:1224:494:0 - vm(T):new vm=doorcall-trigger 1:1224:494:1 - script='http://172.16.100.202:8080/wiki-src/sample/DoorControl/sample/sources/switchops.xml'
- it determines the name of the door operator and constructs proper arguments for the switchapp call
1:1231:137:2 - iprt.30.0(DBG):call diverting name: 1:1231:137:3 - iprt.30.0(DBG):doorOp 1:1231:137:4 - iprt.30.0(DBG):http://172.16.100.202:8080/wiki-src/sample/DoorControl/sample/sources/DoorControl.php?switchapp=1&h323=doorOp ... 1:1231:664:0 - iprt.30.1(T):running file='http://172.16.100.202:8080/wiki-src/sample/DoorControl/sample/sources/switchops.xml' ver=
- finally it receives confirmation from the script that some calls have been switched
1:1231:664:1 - iprt.30.1(DBG):switchops.xml: switched 1 call(s) for door 'DoorOp'
Error: Allocation limit exceded
The filesize is too big for the Phone and will be rejected. Reduce the filesize via URI if your camera support this. (eg. image.jpg?size=640x480)
If your camera does not support the resize process, you can use the
proxy-resize method described above.
Error: bad state XML
Remove state.xml from doorcontrol folder, after that you get a correct error message if you reload the Doorcontrol.php in Webbrowser
Wrong Caller Name
- Forking to a VM Object without mobility object (license required) will display the name of the forking target in the caller display and his callist. (To prevent this behavior, use a mobility object for the forking to
3rd party SOAP Application show multiple calls
Some SOAP applications show a permanent call to the doorcall-trigger, even though the agent on the desk phone has already picked up.
To turn this off, the solution must be adjusted as follows:
You have to edit the switchops.xml and add a <pbx-disc /> at the end of the function Main
<voicemail xmlns="http://www.innovaphone.com/xsd/vm.xsd"> <function define="Main"> ... <exec url="$url"/> <pbx-disc /> </function>
Additional you have to update the Forking configuration of the agent, use a Mobility or UC License for the Agent and create (or use an existing) Mobility Object in your PBX.
Configure the Object and Min-Alert=1 in the forking of the agent.