Howto:Working with multiple Door Cameras: Difference between revisions
(→Phone) |
|||
Line 32: | Line 32: | ||
* 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 <code>root/iplinux</code>, see [[Reference10:Concept_Linux_Application_Platform#Default_Credentials | 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 | * 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 <code>root/iplinux</code>, see [[Reference10:Concept_Linux_Application_Platform#Default_Credentials | 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 <code>doorcontrol</code> underneath the <code>/var/www/innovaphone</code> directory. | ** create the new directory called <code>doorcontrol</code> underneath the <code>/var/www/innovaphone</code> directory. | ||
** copy the files doors.xml, state.xml, DoorControl.php to the new directory | ** copy the files <code>doors.xml</code>, <code>state.xml</code>, <code>switchops.xml</code> and <code>DoorControl.php</code> to the new directory | ||
** create a subdirectoy <code>/doorcontrol/classes</code> | ** create a subdirectoy <code>/doorcontrol/classes</code> | ||
** change to this directory | ** change to this directory | ||
** copy the file innopbx.class.php to the new directory | ** copy the file <code>innopbx.class.php</code> to the new directory | ||
* log in to the LAP's admin UI (if you have not yet changed it, the default credentials will be <code>admin/linux</code>, see [[Reference10:Concept_Linux_Application_Platform#Default_Credentials | Concept Linux Application Platform]]) | * log in to the LAP's admin UI (if you have not yet changed it, the default credentials will be <code>admin/linux</code>, see [[Reference10:Concept_Linux_Application_Platform#Default_Credentials | Concept Linux Application Platform]]) | ||
** go to ''Administration/Web Server/Change web server properties and public access to the web/webdav'' | ** go to ''Administration/Web Server/Change web server properties and public access to the web/webdav'' |
Revision as of 17:16, 13 March 2017
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
- http://download.innovaphone.com/ice/wiki-src#doorcontrol - download the complete file package of scripts and files described in this article.
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
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
doorcontrol
underneath the/var/www/innovaphone
directory. - copy the files
doors.xml
,state.xml
,switchops.xml
andDoorControl.php
to the new directory - create a subdirectoy
/doorcontrol/classes
- change to this directory
- copy the file
innopbx.class.php
to 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
- 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
doorcontrol
and all its sub -directories towww-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
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 above), additional configuration on the PBX is required.
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"
switch="false"
>
<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
Finally, you can optionally have the phone switch to the video app automatically:
- switch
true
orfalse
. 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 fix Remote Control Facility "switch2App" and therefore firmware v12r2 beta 1 or later. Also it requires at least script version 1004.
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 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 2 arguments
- id
- e.g.
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. - hw
- e.g.
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 - 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&hw=009033000000
.
Picture Sources with Password Protection
If your camera is password protected, you must configure its URL and password in Services/HTTP/Client/Authenticated URLs.
PBX
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
doorcall-trigger
for example) - in the 'Voicemail tab, tick the Trace check-mark
- furthermore, set the Script URL to something like
http://my.door.tld/path-on-web-server/switchops.xml
- open the
switchops.xml
script itself and fix the url found in the string argument of thelib-strcat
tag near line 23 so that it points to your installedDoorControl.php
, e.g.
<lib-strcat out-string="$url" string="http://172.16.100.202:8080/wiki-src/sample/DoorControl/sample/sources/DoorControl.php?switchapp=1&h323=" string2="$leg2-name-enc"/>
- into
<lib-strcat out-string="$url" string="http://my.door.tld/path-on-web-server/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