Actions

Difference between revisions of "Elevator alarm to external phone with voice identifcation"

From Zenitel Wiki

(Event 4: Dials next phone number)
(Event 3: Call setup event. Sets up external phonecall if the line is free)
Line 85: Line 85:
 
===Event 3: Call setup event. Sets up external phonecall if the line is free ===
 
===Event 3: Call setup event. Sets up external phonecall if the line is free ===
  
This is the event that  sets up the telephone call. First, it check if the telephone line is free ([[%tin]]). If it is busy, the timer ([[SET TIMER|$ST]]) is restarted (5.0 sec), and this same event will be triggered again in 5.0 seconds to check if the line now is free.
+
This is the event that  sets up the telephone call. First, it check if the telephone line is free ([[%tin]]). If it is busy, the timer ([[SET TIMER|$ST]]) is restarted (10.0 sec), and this same event will be triggered again in 10 seconds to check if the line now is free.
  
 
If the telephone line is free, the acknowledge flag ([[UDD|UDD 500]]) is set to "Not yet acknowledged" (0). A new "redial" timer (40.0 sec), using 9901 as "label" is started. If this timer is not stopped by operator acknowwledgement (event 6), it will trigger the "Call setup" event when it times out, causing redial of next phone number in line.  
 
If the telephone line is free, the acknowledge flag ([[UDD|UDD 500]]) is set to "Not yet acknowledged" (0). A new "redial" timer (40.0 sec), using 9901 as "label" is started. If this timer is not stopped by operator acknowwledgement (event 6), it will trigger the "Call setup" event when it times out, causing redial of next phone number in line.  
Line 99: Line 99:
 
  IF %op(%tin(100),=,1)
 
  IF %op(%tin(100),=,1)
 
  LOG "The gateway is busy, %1.dir %1.nam will try again in 5 seconds"
 
  LOG "The gateway is busy, %1.dir %1.nam will try again in 5 seconds"
  $ST L%1.dir W50 L9900
+
  $ST L%1.dir W100 L9900
 
  stop
 
  stop
 
  ENDIF
 
  ENDIF

Revision as of 13:58, 8 August 2013

Forwarding of Call Request to external telephone

This article describes how elevator alarms can be routed to external telephones. When the telephone operator answers the call, the location of the alarm will be played as a voice message. The operator must acknowledge the alarm by pressing a digit, and two-way voice communication is established between the operator and the elevator.

If there are multiple alarms at the same time, the system will put the calls in queue, and set up calls one by one to the telephone as soon as the line becomes free. When an elevator station is put in queue, a message "Your call is registered, please wait" will be played to the elevator. The actual phrasing of the message can be modified.

In the configuration below there is a possibility of defining up to 6 different telephone numbers. If the first number is not acknowleding the call within a preset time, the second number will be called, and so on, until the call is acknowledged.


The call to the telephone will be activated only if there is a free telephone line. If all available lines are busy, the system will retry every 5 seconds until a line is free. If there are several Call Requests at the same time, they will be queued in the AlphaCom and handled one by one. The macro %tin (Trunk In Use) is used to check if there are any free lines.


Configuration

Prerequisites

Telephone gateway:

  • The SIP Gateway must be AudioCodes MP114/118, as the functionality depends on certain properties of this gateway. The SIP gateway should be configured as described in the relevant AlphaWiki article.

Parameters used in the configuration examples:

  • Station 5152: A dummy station, receiving call requests from the elevators
  • UDP group 1: Elevator stations must be included in UDP group 1
  • Directory Number 9534: An event trigger number, dialled by the elevator stations to generate the call
  • UDD 500: Flag saying if the call has been acknowledged. 1=acknowledged. 0=Not acknowledged
  • UDD 501: A counter keeping track of which phone number to dial next

You can choose to use other parameters, but then you must study the configuration details below carefully, and adjust the configuration accordingly.

Licenses:

Software requirement:

  • AMC 11.2.3.3 or newer.

Elevator station configuration

In AlphaPro, Users & Stations window, select the elevator station from the list box, press the button DAK, and program the call button to dial the Event Trigger number 9534.

Program the call button to dial Event Trigger 9534


If the call button must be pressed for a certain time before the call is triggered, please see article Delayed call.


Include all elevator stations in UDP group 1. In AlphaPro, Users & Stations window, select the tab UDP, and tick UDP 1. Press the button UDP Text to change the text to an appropriate description, say "Lifts".

Include all elevator stations in UDP group 1


About the Event Handler programming

A number of events must be added. In AlphaPro, Exchange & System -> Events, press Insert to add a new event.

In the events a number of LOG commands are included. They are not required for the functionality, but are usefull during test and debugging, as well as a documentation of the elevator alarm calls made in the system.

Event 1: Sends Call Request to Dummy when call button is pressed

The elevator station is configured to dial event trigger 9534 when the button is pressed. This will trigger the event below, which will send a Call Request ($SM) to a dummy station. The dummy number can be any station directory number in the exchange that is not in use. In this article station 5152 on physical 552 is used.

Event Owner: Stations w. UDP. ID: 1 (Elevator stations)
Event Type:  15 - Event Trigger Feature
Sub Event:   0
When Change To: ON
When Related To: Directory Number. Id: 9534
Action:
$SM L%1.dir L5152
LOG "Lift alarm triggered by %1.dir %1.nam"

Event 2: Dummy receives the call request and triggers the "Call setup event"

When the dummy receives the call request from the elevator, a 1.0 sec timer is started ($ST), using 9900 as a reference number or "label". When this timer times out, it will trigger "event 3", which actually sets up the telephone call. When the call request is deleted, which happens when the call is acknowledged by the operator in "event 6", the timer is stopped.

Event Owner: Station Id - 552 (Dummy station)
Event Type:  10 - Received mail
Sub Event:   0
When Change To: ON or OFF
When Related To: All
Action:
$ST L%2.dir W%chg(10,0) L9900
IF %chg(1,0)
LOG "Station %2.dir %2.nam is put in call queue"
stop
ENDIF
LOG "Station %2.dir %2.nam is removed from call queue"

Event 3: Call setup event. Sets up external phonecall if the line is free

This is the event that sets up the telephone call. First, it check if the telephone line is free (%tin). If it is busy, the timer ($ST) is restarted (10.0 sec), and this same event will be triggered again in 10 seconds to check if the line now is free.

If the telephone line is free, the acknowledge flag (UDD 500) is set to "Not yet acknowledged" (0). A new "redial" timer (40.0 sec), using 9901 as "label" is started. If this timer is not stopped by operator acknowwledgement (event 6), it will trigger the "Call setup" event when it times out, causing redial of next phone number in line.

The counter that keeps track of which telephone number to dial (UDD 501) is incremented by 1. The elevator station is cancelled ($C) (in case the station is already active in a call), and after 0.6 second delay (pause) to make sure the station has returned to idle, the telephone number is dialed. ($PD). Which of the six phone numbers to dial depends on the value of the counter. A new call will start with phone number one, if not acknowledged it will try phone number 2 etc. If phone number 6 fails, it will start all over again.

Event Owner: Stations w. UDP. ID: 1 (Elevator stations)
Event Type:  21 - Event Timeout
Sub Event:   0
When Change To: ON
When Related To: Directory Number, Id = 9900
Action:
IF %op(%tin(100),=,1)
LOG "The gateway is busy, %1.dir %1.nam will try again in 5 seconds"
$ST L%1.dir W100 L9900
stop
ENDIF
LOG "The gateway is free"
WUDD 500 0
$ST L%1.dir W400 L9901
WUDD 501 %op(%udd(501),+,1)
$C L%1.dir
pause
pause
pause
pause
pause
pause
IF %op(%udd(501),=,1)
LOG "Station %1.dir %1.nam is dialing phone #1"
$PD %1.ref "0W87654321"
ENDIF
IF %op(%udd(501),=,2)
LOG "Station %1.dir %1.nam is dialing phone #2"
$PD %1.ref "0W87654322"
ENDIF
IF %op(%udd(501),=,3)
LOG "Station %1.dir %1.nam is dialing phone #3"
$PD %1.ref "0W87654323"
ENDIF
IF %op(%udd(501),=,4)
LOG "Station %1.dir %1.nam is dialing phone #4"
$PD %1.ref "0W87654324"
ENDIF
IF %op(%udd(501),=,5)
LOG "Station %1.dir %1.nam is dialing phone #5"
$PD %1.ref "0W87654325"
ENDIF
IF %op(%udd(1),=,6)
LOG "Station %1.dir %1.nam is dialing phone #6"
$PD %1.ref "0W87654326"
WUDD 501 0
ENDIF


About the expression "IF %op(%tin(100),>=,1)":

  • 100 = the node number of the SIP Trunk used by the AudioCodes MP114/118. Change if required.
  • 1 = There is one phone line connected to the SIP Gateway. If multiple lines are connected to the MP114/118 gateway, you need to change this number accordingly.

Telephone numbers to dial:

  • The expression "$PD %1.ref "0W87654321"" means dial 0, then 1 second delay (W), then dial phone number 87654321. Substitute 87654321 with the actual phone number. Also if the prefix code to the gatway is different than "0", change it accordingly.
  • If only one telephone number should be dialed, enter the same number on all six entries.
  • If two different phone numbers should be dialed, enter the first number on entry #1, #3 and #5, and the second number on entry #2, #4 and #6.
  • If three different phone numbers should be dialed, enter the first number on entry #1 and #4, the second number on entry #2 and #5, and the third number on entry #3 and #6

Event 4: Dials next phone number

If a telephone call was not acknowledged by an operator in due time, this event will be triggered. The current call is cancelled, and a timer (2.0 sec) that retriggers the "Call setup event" is started.

Event Owner: Stations w. UDP. ID: 1 (Elevator stations)
Event Type:  21 - Event Timeout
Sub Event:   0
When Change To: ON
When Related To: Directory Number, Id = 9901
Action:
$C L%1.dir
$ST L%1.dir W20 L9900
LOG "The phonecall timed out. Trying again.."

Event 5: Play voice message to phone operator when the call is answered

(when speech is detected)

This event is used for selective dialing to MOTOTRBO radios. The event collects the digits dialed while connected to the IP-ARIO (dirno 5). It checks that the digit pressed is between 0 and 9, and collects 4 digits, assuming that the Radio ID is a 4-digit number. (The line "WUDD 500 4" can be modified if the Radio ID consists of less or more digits). When four digits are collected, it will send an "AT+CCR" command on the EDO port, setting up a private call to the selected radio ID. The PTT (RCO 22) is pulsed to establish the call, and the digit counter (UDD 501) and the collected number (UDD 502) is cleared.

Event Owner: Stations w. UDP. ID: 1 (Elevator stations)
Event Type:  36 - SIP Progress Event
Sub Event:   20
When Change To: ON
When Related To: All
Action:
IF %udd(500)
stop
ENDIF
LOG "Speech from the telephone is detected. Play ACK voice message twice to the phone"
$SVP_ST L%1.dir U30 U%1.phy U1 U2

Event 6: Call acknowledement

(when speech is detected)

This event is used for selective dialing to MOTOTRBO radios. The event collects the digits dialed while connected to the IP-ARIO (dirno 5). It checks that the digit pressed is between 0 and 9, and collects 4 digits, assuming that the Radio ID is a 4-digit number. (The line "WUDD 500 4" can be modified if the Radio ID consists of less or more digits). When four digits are collected, it will send an "AT+CCR" command on the EDO port, setting up a private call to the selected radio ID. The PTT (RCO 22) is pulsed to establish the call, and the digit counter (UDD 501) and the collected number (UDD 502) is cleared.

Event Owner: Stations w. UDP. ID: 1 (Elevator stations)
Event Type:  15 - Event Trigger Feature
Sub Event:   0
When Change To: ON
When Related To: All
Action:
$ST L%1.dir W0 L9900
$ST L%1.dir W0 L9901
WUDD 500 1
WUDD 501 0
$CANM L%1.dir L102
LOG "The call is acknowledged."