Howto:Working with multiple Door Cameras: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
Line 87: Line 87:
'''Proxy Access to Door Camera '''
'''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 <code>HTTP/1.1 307 Temporary Redirect</code> response with a <code>Location: ...</code> header).  The phone will then refer to this URL and retrieve the image itself.   
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 <code>HTTP/1.1 307 Temporary Redirect</code> response with a <code>Location: ...</code> header).  The phone will then refer to this URL and retrieve the image itself.   


However, in rare situations this may not work (e.g. [http://www.axis.com/global/en 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.
However, in rare situations this may not work (e.g. [http://www.axis.com/global/en 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.

Revision as of 08:29, 29 June 2016

Applies To

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.


More Information

Overview

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. This can be achieved using a this SOAP-based utility.

Prerequisites

This SOAP script requires a web server running PHP5. A Linux Application Platform is fine, but any other PHP platform should do too.

Download

Installation

Unpack the downloaded file (see #Download). Copy the content of the Solution/sources directory (including the sub directories) to your web server.

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
...

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 admin/linux, 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 doorcontrol underneath the /var/www/innovaphone directory.
    • copy the files doors.xml, state.xml, DoorControl.xml to the new directory
    • create a subdirectoy /doorcontrol/classes
    • change to this directory
    • copy the file innopbx.class.php to the new directory
  • 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/WebServer/Change web server properties and public access to the web/webdav
    • add doorcontrol to 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)
    • cd to /var/www/innovaphone
    • change owner of update and all its sub -directories to www-data (e.g. chown -R www-data doorcontrol)

If you now type http://lap-ip-addr/doorcontrol/DoorControl.php?debug, you should see the message mentioned above.

Configuration

doors.xml

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"?> <doors

   pbx="145.253.157.200"
   pbxhttp="demo"
   pbxpw="demo"
   pbxuser="_TAPI_"
   interval="5"

>

   <door
       url="http://rax1.bsn.net/axis-cgi/jpg/image.cgi"
       name="door"/>
   <door
       url="http://172.16.100.209/axis-cgi/jpg/image.cgi"
       name="behnke"
       proxy="true"
       user="root"
       pw="pwd"
       content-type="image/png"
   />

</doors>

doors

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):

pbx
the IP address of the PBX
pbxhttp
the HTTP user to be used to access the SOAP service on the PBX (usually the Name' of a PBX user object or the admin user)
pbxpw
the password of the HTTP user
pbxuser
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

interval
the number of seconds the utility will wait before switchign to the next camera
door

Each sub-tag door defines an available door camera.

url
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.
name
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.

proxy
if this is set to true, the image will be retrieved by the script and returned to the caller directly
user
if authentication is required by the camera and proxy mode is used, you can provide the authentication user-name here
pw
if authentication is required by the camera and proxy mode is used, you can provide the authentication password here
content-type
you can optionally specify the value used for the Content-Type: HTTP header (normally not necessary)

Phone

The Background Image property in Phone/Preferences must be set to the DoorControl.php script on your web server. It supports 2 arguments

id
e.g. id=operator, the 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.
debug
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
e.g. 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 http://my.door.tld/path-on-web-server/DoorControl.php?refresh=1&id=operator.


Picture Sources with Password Protection

If your camera is password protected, you must configure its URL and password in Services/HTTP/Client/Authenticated URLs.

Related Articles

Howto:Door Phone with Video in V10 and later