Actions

Difference between revisions of "Event Handler"

From Zenitel Wiki

(Single Station Events)
 
(436 intermediate revisions by 11 users not shown)
Line 1: Line 1:
== The AlphaCom Event Handler ==
+
{{AI}}
 
+
[[Image:Eventhandler.gif|right|thumb|Event Handler - Block Diagram]]
 
+
The ICX-AlphaCom and AlphaCom XE servers are intercom servers of which the main task is to enable uni- and bi-directional speech. In order to be able to meet as many customer requirements as possible when it comes to special features an '''Event Handler''' has been implemented. The underlying idea is that by customer-programming this event handler functionality can be implemented which is not part of the standard [[AlphaCom Feature List|feature list]]. The event handler is unique in the world of intercom. It is what gives the server its flexibility and makes it possible to meet most, if not all, customer requirements.<br /> The Event Handler is based on the software concept that when the intercom functions run, they report 'events' to a part of the software called the Event Handler. The event can be described as a trigger that sets off an action in the system depending on the information entered in [[AlphaPro]], the programming tool for the ICX-AlphaCom. In this way, the Event Handler provides a powerful engineering tool for configuring system behavior to meet requirements from customers.  
The AlphaCom exchange is an intercom exchange of which the main task is to enable uni- and bi-directional speech. In order to be able to meet as many customer requirements as possible when it comes to special features an 'Event Handler' has been implemented. The underlying idea is that by customer-programming this event handler functionality can be implemented which is not part of the standard feature list. The event handler is unique in the world of intercom. It is what gives the exchange its flexibility and makes it possible to meet most, if not all, customer requirements.<br /> The Event Handler is based on the software concept that when the intercom functions run, they report 'events' to a part of the software called the Event Handler. The event can be described as a trigger that sets off an action in the system depending on the information entered in AlphaPro, the programming tool for the AlphaCom exchange. In this way, the Event Handler provides a powerful engineering tool for configuring system behaviour to meet requirements from customers.  
 
 
 
The basic idea can be illustrated as follows:
 
 
 
[[Image:Eventhandler.gif]]
 
 
 
  
 
Actions can be simple, just to operate a relay under certain circumstances. Actions can also be programmed using a scripting language and can include conditional statements. An action can itself trigger a new event, making it possible to start a chain of actions.  
 
Actions can be simple, just to operate a relay under certain circumstances. Actions can also be programmed using a scripting language and can include conditional statements. An action can itself trigger a new event, making it possible to start a chain of actions.  
  
'''The Event types'''
+
== The principle ==
* [[Event 01: Audio]]
+
=== Events ===
* [[Event 02: Door opening – During connection]]
+
'''Events''' are generated inside the ICX-AlphaCom software when interesting things happen. Events follows a fixed format, with the following parameters:
* [[Event 03: Door opening – Automatic lock]]
+
* Owner
 
+
* Event type
 +
* State change : ON/OFF
 +
* Related-to
  
'''Contents of the Event Handler technical description'''  
+
The '''owner''' is source which triggers the event. The following possible owners are defined:
* [[Event Handler#The principal|The principal]]
 
* [[Event Handler#Events|Events]]
 
  
* [[Event Handler#Event triggers which have a station as event owner|Event triggers which have a station as event owner]]
+
* A single '''station'''
** [[Event Handler#Audio : type 01|Audio : type 01]]
+
* A '''group of stations''' ([[UDP group]]) with common behavior
** Door opening – During connection : type 02
+
* The '''[[Scheduler (Event Type)|scheduler]]''', the internal ICX-AlphaCom realtime clock
** Door opening – Automatic lock : type 03
+
* '''[[External Data Input]]''', a data port set up to receive ASCII text strings from external devices
** Station in use : type 04
 
** Microphone open : type 05
 
** Priority mail present : type 06
 
** Conversation – Incoming : type 07
 
** Conversation – Outgoing : type 08
 
** Private ringing mode : type 09
 
** Received mail : type 10
 
** Call requester mode : type 11
 
** Priority mail in idle : type 12
 
** Faulty station line : type 13
 
** Event Trigger Feature : type 15
 
** Simplex Conference Audio : type 16
 
** Simplex Conference Member : type 17<
 
** Open Duplex Conf. Ringing : type 18
 
** Open Duplex Conf. Connection : type 19
 
** Mail Timeout : type 20
 
** Event Timeout : type 21
 
** New Current mail in station queue : type 23<
 
** New first mail in station queue : type 24
 
** Event Trigger with User Parameter : type 25
 
** Event Trigger Start with User Parameter : type 26
 
** System Event : type 27</span>]
 
  
* Scheduling
+
The '''Event type''' is a number which tell what sort of event occurred. Event type is divided into a  '''Main event''' and [[Sub-Event (Event Handler)|Sub-Event]]. Main events are listed below. Only some of the Main events use the Sub-Event. In the case of the scheduler the event is the ‘minute tick’.
  
* Event actions
+
'''State change''': Most of the events are modeled as a state which goes ON and OFF. But some events does not fit to that concept, then only a ON event is reported.
** RCO
 
** Action strings
 
** Commands
 
** Parameters and macro operations
 
** Statements
 
  
'''Event Handler technical description'''
+
'''Related-to''' is specific for the feature which reports the event. It can be the other station in a conversation, or the sending station of a mail or CallRequest.
  
===The principal===
+
For some features in AlphaNet, the owner of an event can be in a different node. Then the [[EVENT REPORT]] message sent to the owning exchange, where the event is processed. [[Conversation Outgoing (Event Type)|Conversation Outgoing]] is an example of such an event.
An event has an owner, the source which triggers the event. The following possible owners are defined:
 
  
* A station. It is possible to group stations together by a UDP-flag in order to give such a group common behaviour.
+
===Event Rules===
* The scheduler, the internal AlphaCom clock which generates a ‘tick’ every minute.
+
Event handler Rules are what you program in the [[Exchange_%26_System_%28AlphaPro%29#Events|Event Handler window]] in AlphaPro. An Eventhandler Rule has two main parts:
 +
* A '''condition''', which matches specific Events
 +
* An '''action''', which specifies what should happen when a Event matches a Condition.  
  
In the case of the scheduler the event is the ‘minute tick’. Stations can trigger many different types of event.<br /> Many events can trigger an action when the event is activated and when the event is de-activated, for instance event type 07: Conversation – Incoming. The On/Off action can be differentiated by the ‘When Change To’ flag.<br /> Events can be, but don't have to be, related to a specific directory number or a group of stations, for instance:
+
Stations can trigger many different types of event.<br /> Many events can trigger an action when the event is activated and when the event is de-activated, for instance event type 07: Conversation – Incoming. The On/Off action can be differentiated by the ‘When Change To’ flag.<br /> Events can be, but don't have to be, related to a specific directory number or a group of stations, for instance:
  
 
* Owner: Station 1
 
* Owner: Station 1
Line 74: Line 42:
  
 
In this case the relay connected to RCO 2 will only be activated if 'Station 1' is in conversation with a station with directory nr 102, AND if Station 1 was the station which made the call. If 'Related to' was not specified, that same relay would be activated on any call which Station 1 would make.
 
In this case the relay connected to RCO 2 will only be activated if 'Station 1' is in conversation with a station with directory nr 102, AND if Station 1 was the station which made the call. If 'Related to' was not specified, that same relay would be activated on any call which Station 1 would make.
 
===Events===
 
An event is a trigger that sets off an action in the system. An event can be:
 
 
* An internal audio event in the program
 
* An event triggered by some external device
 
* An exchange feature
 
* An internal error report (for instance 'station disconnected')
 
* A data protocol command
 
 
An event can set off an action that can control:
 
 
* Some external hardware through an RCO output
 
* A defined action or a set of actions in the system software
 
* A data command to the exchange itself (this gives the possibility to use all AlphaNet dataprotocol commands to control what happens)
 
* A data command to another exchange
 
* A data command to external equipment
 
  
 
== Events Types ==
 
== Events Types ==
 
+
The list shows the available '''event types''', grouped by function.<br><br>
The event types listed by
 
 
 
=== Single Station Events ===
 
  
 
{| border="1"
 
{| border="1"
! style="background:#ffdead;" width="180" |Event Type
+
! style="background:#ffdead;" width="220" |'''Event Type'''
! style="background:#ffdead;" width="70" |No.
+
! style="background:#ffdead;" width="70" |'''No.'''
! style="background:#ffdead;" width="500" |When triggered
+
! style="background:#ffdead;" width="500" |'''When triggered'''
 +
|-
 +
|colspan="3"|'''''Single Station Events'''''
 +
|-
 +
| align=center |[[Audio (Event Type)|Audio]] || align=center | 01 || When audio is played in the speaker
 +
|-
 +
| align=center | [[Door Opening - Automatic Lock (Event Type)|Door Open - Automatic Lock]] || align=center | 03 || When the Code Lock [[AlphaCom Feature List|feature]] is dialed
 +
|-
 +
| align=center | [[Station in Use (Event Type)|Station in Use]] || align=center | 04 || When a station becomes busy or free
 +
|-
 +
| align=center | [[Microphone Open (Event Type)|Microphone Open]] || align=center | 05 || When the microphone is alive
 +
|-
 +
| align=center | [[Faulty Station Line (Event Type)|Faulty Station Line]] || align=center | 13 || When a station is reported faulty or OK
 +
|-
 +
| align=center | [[M-key (Event Type)|M-key]] || align=center | 31 || When the M-key is pressed or released
 +
|-
 +
| align=center | [[Off-hook (Event Type)|Off-hook]] || align=center | 32 || When the handset is lifted or replaced
 +
|-
 +
| align=center | [[C-key (Event Type)|C-key]] || align=center | 35 || When C-key is pressed or released
 +
|-
 +
| align=center | [[Feature From Idle (Event Type)|Feature From Idle]] || align=center | 37 || When a feature is dialed from idle
 +
|-
 +
| align=center | [[Additional call info (Event Type)|Additional call info]] || align=center | 39 || Feature status, such as: User denied access, call to busy station, etc.
 +
|-
 +
| align=center | [[Station Fault (Event Type)|Station Fault]] || align=center | 43 || Reports various station and ENA amplifier errors
 +
|-
 +
|colspan="3"|'''''Conversation Events'''''
 +
|-
 +
| align=center |[[Conversation Incoming (Event Type)|Conversation Incoming]] || align=center | 07 || When a call is received
 +
|-
 +
| align=center | [[Conversation Outgoing (Event Type)|Conversation Outgoing]] || align=center | 08 || When a call is made
 +
|-
 +
| align=center |[[Conversation (Event Type)|Conversation]] || align=center | 44 || When a call is received
 +
|-
 +
| align=center | [[Private Ringing mode (Event Type)|Private Ringing mode]] || align=center | 09 || During private ringing for ''incoming'' call
 +
|-
 +
| align=center | [[Private Ringing Outgoing(Event Type)|Private Ringing Outgoing]] || align=center | 33 || During private ringing for ''outgoing'' call
 +
|-
 +
| align=center | [[Door Opening - During Conversation (Event Type)|Door Opening - During Conv.]] || align=center | 02 || When door opening feature (digit 6) is activated during conversation
 +
|-
 +
| align=center | [[SIP progress (Event Type)|SIP progress event]] || align=center | 36 || During setup of call to SIP trunk
 +
|-
 +
| align=center | [[Recording Event (Event Type)|Recording]] || align=center | 40 || Control recording session
 +
|-
 +
|colspan="3"|'''''Mail (Call Queue) Events'''''
 +
|-
 +
| align=center |[[Received Mail (Event Type)|Received Mail]] || align=center | 10 || When a [[mail]] or a [[call request]] is received
 +
|-
 +
| align=center | [[Call Requester Mode (Event Type)|Call Requester Mode]] || align=center | 11 || When a station sends a [[Call Request]]
 +
|-
 +
| align=center | [[Priority Mail Present (Event Type)|Priority Mail Present]] || align=center | 06 || When a mail with priority level 100 (programmable) is present in the mail queue
 +
|-
 +
| align=center | [[Priority Mail in Idle (Event Type)|Priority Mail in Idle]] || align=center | 12 || When a priority mail is present, and the station is not in conversation
 +
|-
 +
| align=center | [[Mail Timeout (Event Type)|Mail Timeout]] || align=center | 20 || When a mail times out
 +
|-
 +
| align=center | [[New Current Mail (Event Type)|New Current Mail]] || align=center | 23 || When the current mail in the queue is changed
 +
|-
 +
| align=center | [[New First Mail (Event Type)|New First Mail]] || align=center | 24 || When a new mail arrives first in the queue
 +
|-
 +
|colspan="3"|'''''Group & Conference Events'''''
 +
|-
 +
| align=center |[[Simplex Conference Audio (Event Type)|Simplex Conference Audio]] || align=center | 16 || When listening to [[simplex conference]], and the [[AUDIO_DETECT|$VOX]] command is activated
 +
|-
 +
| align=center | [[Simplex Conference Member (Event Type)|Simplex Conference Member]] || align=center | 17 || When a station joins a [[simplex conference]]
 +
|-
 +
| align=center | [[Open Duplex Conference Ringing (Event Type)|Open Duplex Conf. Ringing]] || align=center | 18 || During ringing to an [[open duplex conference]]
 +
|-
 +
| align=center | [[Open Duplex Conference Connect (Event Type)|Open Duplex Conf. Connect]] || align=center | 19 || When a station connects to an [[open duplex conference]]
 +
|-
 +
| align=center | [[Dynamic group inclusion (Event Type)|Dynamic group inclusion]] || align=center | 38 || NOT IN USE
 +
|-
 +
|colspan="3"|'''''Event Triggers'''''
 +
|-
 +
| align=center |[[Event Trigger (Event Type)|Event Trigger]] || align=center | 15 || When dialing a [[directory number]] with [[AlphaCom Feature List|feature number]] 52, 85, 95 or 105
 +
|-
 +
| align=center | [[Event Trigger with parameter (Event Type)|Event Trigger with parameter]] || align=center | 25 || When dialing Event Trigger [[AlphaCom Feature List|feature]] 95 or 105, preceded by a directory number or digit
 +
|-
 +
| align=center | [[Start: Event Trigger with parameter (Event Type)|Start: Event Trigger with param.]] || align=center | 26 || When dialing a [[directory number]] with [[AlphaCom Feature List|feature number]] 95
 +
|-
 +
| align=center | [[Event Timeout (Event Type)|Event Timeout]] || align=center | 21 || When a timer started by the [[SET_TIMER|$ST]] command expires
 +
|-
 +
| align=center | [[Station Input or Station DAK key (Event Type)|Station Input or Station DAK key]] || align=center | 30 || When a station input or [[DAK]] key is pressed
 +
|-
 +
|colspan="3"|'''''Scheduling'''''
 +
|-
 +
| align=center |[[Scheduler (Event Type)|Scheduler (Minute Tick)]] || align=center | 22 || When matching the specified date (or weekdays) and time
 +
|-
 +
|colspan="3"|'''''EDI - External Data Input'''''
 
|-
 
|-
| align=center |[[Event Type - Audio|Audio]] || align=center | 01 || Whenever audio is played in the speaker
+
| align=center |[[External Data Input]] || align=center | 28 || When receiving ASCII data on EDI port
 
|-
 
|-
| align=center | [[Event Type - Door Opening - Automatick Lock|Door Open - Automatick Lock]] || align=center | 03 || When a access control code is dialed
+
|colspan="3"|'''''System Events'''''
 
|-
 
|-
| align=center | [[Event Type - Station in Use|Station in Use]] || align=center | 04 || When a station becomes busy or free
+
| align=center |[[System Status (Event Type)|System Status]] || align=center | 27 || When a [[device]] is reported up or down
 
|-
 
|-
| align=center | [[Event Type - Microphone Open|Microphone Open]] || align=center | 05 || When the microphone is alive
+
| align=center | [[AlphaNet Link (Event Type)|AlphaNet Link]] || align=center | 29 || When an AlphaNet link is reported up or down
 
|-
 
|-
| align=center | [[Event Type - Faulty Station Line|Faulty Station Line]] || align=center | 13 || When a station is reported faulty or OK
+
| align=center | [[Board Status (Event Type)|Board Status]] || align=center | 34 || When a board is reported up or down
 
|-
 
|-
 
|}
 
|}
Line 117: Line 153:
 
<br>
 
<br>
  
=== Conversation Events ===
+
== Action Commands ==
 +
There are two types of '''Action Commands''' which can be used by the Event Handler, [[#Built-In Action Commands|Built-In Action Commands]] and [[#Data Protocol Commands|Data Protocol Commands]].
 +
 
 +
Both types of commands can include parameters and macros (e.g. %1.dir and %clk(8))
 +
=== Built-In Action Commands ===
 +
'''Built-in Action Commands''' are three- or four-letter commands. The commands are case-insensitive as from AMC 08.20. Most of the Built-In commands also have a Data Protocol implementation.
  
 
{| border="1"
 
{| border="1"
! style="background:#ffdead;" width="180" |Event Type
+
! style="background:#ffdead;" width="100" |Command
! style="background:#ffdead;" width="70" |No.
+
! style="background:#ffdead;" width="400" |Description
! style="background:#ffdead;" width="500" |When triggered
+
! style="background:#ffdead;" width="100" |From AMC ver.
 +
|-
 +
| align=center |[[PRS - Program to Station|PRS]] || Audio Program to Station || &nbsp;
 +
|-
 +
| align=center |[[PRG - Program to Group|PRG]] || Audio Program to Group || &nbsp;
 +
|-
 +
| align=center | [[CNG - Simplex Conference to Group|CNG]] || Simplex Conference to Group || &nbsp;
 +
|-
 +
| align=center | [[MST - Mail to Station|MST]] || Mail to Station || &nbsp;
 +
|-
 +
| align=center | [[MGR - Mail to Group|MGR]] || Mail to Group || &nbsp;
 
|-
 
|-
| align=center |[[Event Type - Conversation Incoming|Conversation Incoming]] || align=center | 07 || When a call is received
+
| align=center | [[MPP - Mail to Pocket Pager|MPP]] || Mail to Pocket Pager || &nbsp;
 
|-
 
|-
| align=center | [[Event Type - Conversation Outgoing|Conversation Outgoing]] || align=center | 08 || When a call is made
+
| align=center | [[AMS - Alarm Message to Station|AMS]] || Alarm Message to Station || &nbsp;
 
|-
 
|-
| align=center | [[Event Type - Private Ringing mode|Private Ringing mode]] || align=center | 09 || During private ringing
+
| align=center | [[AMG - Alarm Message to Group|AMG]] || Alarm Message to Group || &nbsp;
 
|-
 
|-
| align=center | [[Event Type - Door Opening|Door Opening]] || align=center | 02 || When door opening (6) feature is activated
+
| align=center | [[RCO - Set Remote Control Output|RCO]] || Set Remote Control Output || &nbsp;
 
|-
 
|-
 +
| align=center | [[EDO]] || Send text to serial port External Data Output EDO 1 - 4 || &nbsp;
 +
|-
 +
| align=center | [[LOG - Send text to exchange’s log port (including date/time) |LOG]] || Send text to exchange’s log port (including date/time) || &nbsp;
 +
|-
 +
| align=center | [[IND - Indicator control for CRMIV LEDs, buzzer etc. |IND]] || Indicator control for CRMIV LEDs, buzzer etc. || AMC 07.20
 +
|-
 +
| align=center | [[IND - Indicator control for CRMIV LEDs, buzzer etc. |GIND]] || Indicator control to a group of station . || AMC 11.02
 +
|-
 +
| align=center | [[OWN - Modify Event Owner (%1) and/or Related_To (%2) values |OWN]] || Modify Event Owner (%1) and/or Related_To (%2) values || AMC 07.60
 +
|-
 +
| align=center | [[wudd|WUDD]] || Write a value to an User Defined Data UDD || &nbsp;
 +
|-
 +
| align=center | [[Tmp_statement|TMP]] || Write a string to a temporary variable || &nbsp;
 +
|-
 +
| align=center |[[PAUSE]] || Pauses the event handler command interpreter for 100 ms || AMC 08.20
 +
|-
 +
| align=center |[[IF/ENDIF]] || Conditional statement ||AMC 08.20
 +
|-
 +
| align=center | [[STOP]] || Stops the execution of the rest of the action string || AMC 08.20
 +
|-
 +
| align=center | [[LOOP/ENDLOOP]] || Looping statement || AMC 11.00
 +
|-
 +
| align=center | [[BREAK (Event action)|BREAK]] || Break out of Loop || AMC 11.00
 
|}
 
|}
 
<br>
 
<br>
 
<br>
 
<br>
 
=== Mail (call Queue) Events ===
 
 
 
=== Conference Events ===
 
 
=== Event Triggers ===
 
 
=== Scheduling ===
 
 
=== System Events ===
 
 
== Action Commands ==
 
 
=== Built-In Commands ===
 
  
 
=== Data Protocol Commands ===
 
=== Data Protocol Commands ===
  
== Parameters and Macros ==
+
'''Data Protocol Commands''' are using ACDP commands on the [[Stentofon Simple Link Layer|Simple Link Layer]] format. The commands begin with $ or @.
  
=== Parameters ===
+
The most relevant data protocol commands for the Event Handler and for [[RCI]]s are listed in the table below. Follow this link for a complete list of [[AlphaNet_Data_Protocol#Message_Formats_-_Grouped_by_Function|all Data Protocol Commands]]
  
=== Macros ===
 
  
 +
{| border="1"
 +
! style="background:#ffdead;" width="170" |Message
 +
! style="background:#ffdead;" width="70" |Short name
 +
! style="background:#ffdead;" width="70" |Message no, Hex
 +
! style="background:#ffdead;" width="600" |Description
 +
|-
 +
| colspan=4|'''''Station Connect Operations'''''
 +
|-
 +
| [[CALL_SETUP]] ||align=center|CALL||align=center|0x0008||Sets up a conversation between two users
 +
|-
 +
| [[DISCON_ST]] || align=center| &nbsp; ||align=center|0x008E||Disconnect station from ongoing feature 
 +
|-
 +
| [[PAR_RING]] ||align=center| &nbsp;||align=center|0x0098|| Add a Parallel Ringer station to a call in ringing state
 +
|-
 +
| colspan=4|'''''Station Keyboard & Display emulation'''''
 +
|-
 +
| [[DIAL_DIGITS]] ||align=center|DD||align=center|0x0050|| Simulate digit dialing from a station
 +
|-
 +
| [[DIAL_DAK]] || align=center|&nbsp;||align=center|0x0094||Dial DAK on a station
 +
|-
 +
| [[PLAY_DAK]] || align=center|PD||align=center|0x009C||"Dial sequence" for playback.
 +
|-
 +
| [[M_KEY]] ||align=center|M||align=center|0x0054|| Order station to press M-key
 +
|-
 +
| [[M_KEY_RELEASE]] ||align=center|MREL||align=center|0x0055|| Order station to release M-key
 +
|-
 +
| [[C_KEY]] ||align=center| C || align=center|0x0058||Order station to press C-key
 +
|-
 +
| [[DISPLAY_TEXT]] ||align=center| DSPL || align=center|0x005A|| Send text and control characters to a station
 +
|-
 +
| colspan=4|'''''Station Features and Status'''''
 +
|-
 +
| [[PROGRAM]] ||align=center|PROG||align=center|0x0001|| Set audio program for single station or a predefined group of stations
 +
|-
 +
| [[PROG_CONF]] ||align=center|CONF||align=center|0x0004|| Set Simplex conference for predefined group of stations or a single station
 +
|-
 +
| [[CONF_TALK]] ||align=center|&nbsp;||align=center|0x008B|| Set Simplex conference speaker
 +
|-
 +
| [[CONF_TALK_STOP]] ||align=center|&nbsp;||align=center|0x008C|| Stop station form feeding Simplex conference
 +
|-
 +
| [[O_DUPL_CONF]] ||align=center| ODC||align=center|0x006F||Include/exclude a station or a group into/from an Open Duplex Conference
 +
|-
 +
| [[ALARM_MSG]] ||align=center|ALRM||align=center|0x0007|| Set up (or disconnect) an ASVP Alarm message to a single station or a predefined group of stations
 +
|-
 +
| [[CALL_TRANSFER]] ||align=center|TRF||align=center|0x0044|| Set or remove call transfer for a station
 +
|-
 +
| [[SET_REQ_TRANSF]] ||align=center|SCRT||align=center|0x002B|| Set transfer of Call Request for an intercom station
 +
|-
 +
| [[SET_ABSENCE]] ||align=center| SABS||align=center|0x0028|| Set absence status for an intercom station
 +
|-
 +
| [[WAKE_UP]] ||align=center|&nbsp;||align=center|0x0047|| Register or remove wake­up request
 +
|-
 +
| [[SET_GRP_FILT]] ||align=center|GFLT||align=center|0x007D|| Set group call filter for a station
 +
|-
 +
| [[GROUP_MEMBERSHIP]] || align=center|GRM||align=center|0x0081||Set group membership in NVRAM for a station
 +
|-
 +
| [[SET_STATION_COS]] ||align=center|SSC||align=center|0x0090|| Set COS membership in NVRAM for a station
 +
|-
 +
| [[MODIFY_COS_CONTENTS]] ||align=center|MCC||align=center|0x0091|| Modify feature membership in COS in NVRAM
 +
|-
 +
| [[TEMP_PROG]] ||align=center|TPROG||align=center|0x0096|| Temporarily "mute" program distribution to a station
 +
|-
 +
| [[VOLUME|VOL]]|| align=center | &nbsp;|| align=center | 0x009B || Set station volume
 +
|-
 +
| [[SET_RCO]] || align=center|SET||align=center|0x0018||Activate IP Station output
 +
|-
 +
| [[SC|SILENT CALL]] ||align=center|SC||align=center|0x0077|| Set a station in silence call mode for next feature activated
 +
|-
 +
| colspan=4|'''''Station Mail Operations'''''
 +
|-
 +
| [[SEND_MAIL]] || align=center|SM ||align=center|0x0031||Send a mail message to an intercom station
 +
|-
 +
| [[SEND_TXT_MAIL]] ||align=center|STM||align=center|0x0032|| Send a mail message with free text to an intercom station
 +
|-
 +
| [[CANCEL_MAIL]] ||align=center|CANM||align=center|0x0065|| Delete one or more mail/call request/alarm messages queued at a station
 +
|-
 +
| [[SET_MAIL_TIMEOUT]] ||align=center|SMT||align=center|0x0082|| Set the timer of a mail queue entry
 +
|-
 +
| [[COPY_MAIL]] || align=center|CPYM||align=center|0x0083||Send a copy of a mail in own queue to a new destination (station or group)
 +
|-
 +
| [[MAILQ_NAVIG]] ||&nbsp;||align=center|0x008D|| Do operation on mail queue, or step current mail in mail queue
 +
|-
 +
| [[DELETE_MAIL]] ||align=center|DELM||align=center|0x0034|| Delete a mail entry in the queue for an intercom station
 +
|-
 +
| colspan=4|'''''General Exchange Control'''''
 +
|-
 +
| [[SET_SYSTEM_TIME]] ||align=center|SST||align=center|0x0027|| Set the internal clock to the given date and time
 +
|-
 +
| [[PUT_STRING]] ||align=center|PUT||align=center|0x0073||Output String to Exchange serial port after adding appropriate framing depending on selected port
 +
|-
 +
| [[LOG_STRING]] || align=center|LOG||align=center|0x0075||Output String to System Log
 +
|-
 +
| [[EXECUTE_COMMAND]] ||align=center|X||align=center|0x004F|| Send a command string to the exchange to be executed there
 +
|-
 +
| [[EVENT_REPORT]] || align=center|ER||align=center|0x0067||Report an event to the event/action system
 +
|-
 +
| [[SET_TIMER]] ||align=center|ST||align=center|0x008F|| Start or stop a timer
 +
|-
 +
| [[WRITE_USER_DEF_DATA]] ||align=center|WUDD||align=center|0x008A|| Write User Defined Data (UDD)
 +
|-
 +
| [[SET_DIRNO_TXT]] ||align=center|SDT||align=center|0x0077|| Change the display text of a directory number (station or feature)
 +
|-
 +
| [[SMALL_RESET]] ||&nbsp;||align=center|0x00BC|| Simulates Small Reset sent from ICX-AlphaCom web interface
 +
|-
 +
|}
  
== Statements ==
+
<br>
 +
<br>
  
===Event triggers which have a station as event owner===
+
== Context Parameters and macros ==
====<u>Audio : type 01</u>====
 
The audio events are intended for PA control or mobile radio keying, that is, as an extension to the audio function of the 'owner' station. Normally the action for this event is the operation of an RCO. The Audio event is divided into a number of sub-events, which are closely related to each other, and which can be combined to operate the same RCO.
 
User Defined Properties (UDP's) cannot be used with Audio events.
 
Audio events are not associated with a 'related to' number.
 
In AlphaPro the sub-events can be selected after clicking the 'Details'-button.
 
  
* Always: Both incoming and outgoing calls:
+
[[#Action Commands|Action commands]] used in the Event Handler can contain '''context parameters''' and '''macros'''. They both return a value.
** Simplex listen (release own M-key, or conversation partner presses the M-key)
 
** Tones
 
** Sending Gong (this station makes a group call)
 
** Voice message
 
  
The station state must be: Handset ON or Volume / Handset override.
+
'''Context Parameters''' are related to the actual event, and refer to the involved station(s) or functions. A parameter always starts with the character "%". Context parameters are useful for defining the action of a rule where the condition is a [[UDP_group]].
  
Application:
+
*'''%1''': the parameter is associated with the ''Owner'' field
 +
*'''%2''': the parameter is associated with the ''Related to'' field
 +
*'''%3''': the parameter is associated with the ''When change to'' field
  
* Non-selective mobile radio, PA
+
A '''macro''' is unrelated to the event itself. It reads information from the memory (nvram) or performs a calculation. Also a macro always starts with the character "%".
* Incoming call:
 
* Incoming Simplex listen (release own M-key, or conversation partner presses the M-key)
 
* Tones
 
  
The station state must be:
+
Macros and parameters can be nested freely, and makes it possible to build complicated expressions.
  
* Incoming call
+
=== List of context parameters ===
* Handset ON or Volume/Handset Override
 
 
 
Note: The event is reported OFF (and stays OFF) if the user touches any key or the handset. This is called 'take down', as it is intended to transfer an incoming call from an external RCO-controlled speaker to the station’s internal speaker when the user touches any key or the handset.
 
  
* Private ringing: Incoming call only:
+
{| border="1" class="sortable"
* Ringing tone (on/off for each tone period)
+
! style="background:#ffdead;" width="80" |Parameter
  The station state must be:
+
! style="background:#ffdead;" width="80" |Short name
* Incoming call
+
! style="background:#ffdead;" width="500" |Returned value
  * Handset ON or Volume/Handset Override
+
! style="background:#ffdead;" width="100" |From version
 +
|-
 +
| align=center | [[%1.phy]] || align=center | %1p || The [[physical number]] || AMC 07.20
 +
|-
 +
| align=center | [[%1.dir]] || align=center | %1d || The [[directory number]] || &nbsp;
 +
|-
 +
| align=center | [[%1.nam]] || align=center | %1n || The name (display text) || AMC 08.00
 +
|-
 +
| align=center | [[%1.exp]] || align=center | %1e || The [[Users_%26_Stations_%28AlphaPro%29#UDP|User defined parameter]] || &nbsp;
 +
|-
 +
| align=center | [[%1.udp]] || align=center | &nbsp; || The [[UDP group]] memberships for station|| AMC 10.21
 +
|-
 +
| align=center | [[%1.dak]] || align=center | %1k ||  The number of the DAK key containing a specified string || AMC 08.00
 +
|-
 +
| align=center | [[%1.nod]] || align=center | &nbsp; || The [[node]] number || AMC 08.03
 +
|-
 +
| align=center | %1.ref || align=center | &nbsp; || The [[node]] and [[directory number]] as a complete [[NET_OBJ_REF]].<br>%1.ref is equivalent to "L(%1.nod) %1.dir" || AMC 08.20
 +
|-
 +
| align=center | [[%1.mpri]] || align=center | &nbsp; || Priority of the [[mail]]. Available in mail related ON events only || AMC 08.20
 +
|-
 +
| align=center | [[%1.mfre]] || align=center | &nbsp; || Free-text of station mail if available, else ”-”. Available in mail related events only
 +
  || &nbsp;
 +
|-
 +
| align=center | %1.tag || align=center | &nbsp; || Mail tag. Unique mail identification. Available in mail related events only || AMC 08.10
 +
|-
 +
| align=center | [[%1.dev]] || align=center | &nbsp; || The [[Device]] number || AMC 09.03
 +
|-
 +
| align=center | [[%1.brd]] || align=center | &nbsp; || The board number (1 - 25)|| AMC 09.03
 +
|-
 +
| align=center | [[%1.port]] || align=center | &nbsp; || The port (1 - 32) within board|| AMC 09.03
 +
|-
 +
| align=center | %3.chg<br> [[%chg]]|| align=center | %3c || %chg(ON_txt,OFF_txt) returns "ON_txt" when the event goes ON, "OFF_txt" when the event goes OFF<br>Example: LOG “Door %1.dir is %chg(OPEN ,CLOSED)“<br>Result, event ON:  - “Door 123 is OPEN  ”<br>Result, event OFF: - “Door 123 is CLOSED”
 +
|| AMC 07.20
 +
|-
 +
| align=center | %3.rft<br> %rft || align=center | %3r || Action command parameter which substitutes the parameter with a text describing the on/off transition of the event. Some events can be reported many times (e.g. line errors), and it's possible to have different actions depending on if this is the first time, or a Refresh.<br> %rft(normal_text,refresh_text) returns <refresh_text> if this is a refresh transition. <normal_text> otherwise. || &nbsp;
 +
|-
 +
| align=center | [[%sev]] || &nbsp; ||Read sub-event number || AMC 09.03
 +
|-
 +
| align=center | [[Edi (macro)|%edi]] || &nbsp; ||Read EDI text input || AMC 10.00
 +
|-
 +
| align=center | [[%1.fea]] || align=center | &nbsp; || Feature of directory number|| AMC 13.1.3.1
 +
|-
  
Application:
+
|}
 +
<br>
  
* Lamp for incoming call, flashing with the tone bursts
+
'''Note''': %2 can be used instead of %1. %2 will refer to the 'Related To' field instead of the 'Owner' field.
* Voice paging:
 
* Receiving Gong
 
* Voice Paging
 
The station state must be:
 
* Handset ON or Volume/Handset Override
 
  
* Audio program:
+
=== List of macros ===
The station state must be:
 
* Handset ON or Volume/Handset Override
 
* Program conference:
 
  
* Program conference, when another station feeds it with audio (M-key pressed)
+
{| border="1" class="sortable"
  The station state must be:
+
! style="background:#ffdead;" width="200" |Macro
  * Handset ON or Volume/Handset Override
+
! style="background:#ffdead;" width="400" |Description
 
+
! style="background:#ffdead;" width="150" |From version
====<u>Door opening – During connection : type 02</u>====  
+
|-
The action is on the owner, when digit 6 is pressed on the related station.<br /> The event reports an ON and an OFF transition. ON when digit 6 is pressed on the related station, OFF after a period as set for the timer ‘RCO pulse time’.<br /> If 'Related to' is not defined, all stations can open the door. If 'Related to' is defined only the related station (either single or part of a UDP-group) can open the door.
+
| align=center | [[%op]] || Macro for numeric calculations || AMC 08.20
 
+
|-
<u><span lang="EN-US">Door opening – Automatic lock : type 03</span></u><span lang="EN-US"><br /> This owner dials a directory number with feature 59 (code lock).<br /> The event reports an ON and an OFF transition. ON when the feature is dialled, OFF after a period as set for the timer ‘RCO pulse time’.<br /> This event has no ‘related to’ relationship. </span>
+
| align=center | [[%udd]] || Read [[User Defined Data - UDD|a UDD (User Defined Data variable)]] || AMC 08.20
 
+
|-
<u><span lang="EN-US">Station in use : type 04</span></u><span lang="EN-US"><br /> Whenever the station is busy.<br /> This event has no ‘related to’ relationship. </span>
+
| align=center | [[%tmp]] || Read Temporary variable || AMC 10.00
 
+
|-
<u><span lang="EN-US">Microphone open : type 05</span></u><span lang="EN-US"><br /> Whenever the station LED is lit. <br /> Do not use this to indicate conversation, as the event will go OFF in many situations; also, it will be ON when feeding a Group Call, Simplex Conference etc.<br /> This event has no ‘related to’ relationship. </span>
+
| align=center | [[%sng]] || Find next group which station is member of  || AMC 08.20
 
+
|-
<u><span lang="EN-US">Priority mail present : type 06</span></u><span lang="EN-US"><br /> There is at least one mail with priority above 100 (programmable as a global value ‘Priority Mail Queue Indication’) in the mail queue of the owner.<br /></span>Notes:
+
| align=center | [[%gns]] || Find next member station of group  || AMC 08.20
 
+
|-
* <span lang="EN-US">The event occurs every time a mail enters the queue, that is, there are many ON events followed by one OFF. </span>
+
| align=center | [[%ges]] || Find next station of [[Mutual exclusion group]]  || AMC 11.0.3.0
* <span lang="EN-US">The event also stays ON during connections. Not well suited as a buzzer control. </span>
+
|-
* <span lang="EN-US">The event can be temporarily switched OFF/ON by dialling 7882 (which toggles the event). It will then stay OFF until the mail queue is emptied, and another priority mail arrives. </span>
+
| align=center | [[%sgm]] || Is station member of group  || AMC 08.20
 
+
|-
<span lang="EN-US">This event has no ‘related to’ relationship. </span>
+
| align=center | [[%clk]] || Read current date and time on format yyyy-mm-dd hh:mm:ss || AMC 08.20
 
+
|-
<u><span lang="EN-US">Conversation – Incoming : type 07</span></u><span lang="EN-US"><br /> This event reports ON when a connection is established and OFF on disconnection. The event is reported when the owner receives a call. The event can be related to specific calling stations. </span>
+
| align=center | [[%clk|%clkyear]] || Read current year || AMC 08.20
 
+
|-
<u><span lang="EN-US">Conversation – Outgoing : type 08</span></u><span lang="EN-US"><br /> This event reports ON when a connection is established and OFF on disconnection. The event is reported when the owner makes a call. The event can be related to specific called stations. </span>
+
| align=center | [[%clk|%clkmon]] || Read current month || AMC 08.20
 
+
|-
<u><span lang="EN-US">Private ringing mode : type 09</span></u><span lang="EN-US"><br /> Incoming private ringing (or call transfer ringing). The event goes ON at the start of the ringing, and OFF when the station enters conversation, or ringing stops due to time-out or C-key.<br /> The event can be related to specific calling stations. </span>
+
| align=center | [[%clk|%clkday]] || Read current day || AMC 08.20
 
+
|-
<u><span lang="EN-US">Received mail : type 10</span></u><span lang="EN-US"><br /> Occurs for each mail entering the owner station queue. The event goes ON when the mail is put into the queue, and OFF when removed from the queue.<br /> The event can be related to specific stations sending mail. </span>
+
| align=center | [[%clk|%clkhour]] || Read current hour || AMC 08.20
 
+
|-
<u><span lang="EN-US">Call requester mode : type 11</span></u><span lang="EN-US"><br /> Occurs when this station dials a Call Request, which sends a mail to another station’s mail queue. The event goes ON when the station has been put into the queue, and OFF when either the entry is deleted from the queue, or the station has been used for something. This event is then active while the station has voice message/flash/ringing.<br /> As the event is reported OFF as soon as the station is used for anything, even if only the C-key has been pressed, this event cannot be used to reliably indicate whether this station has originated a call request which has not been answered yet.<br /> The event can be related to specific stations in which queue the mail is put. As from AMC-software 9.05 the 'related to' parameter can be a UDP-flag. </span>
+
| align=center | [[%clk|%clkmin]] || Read current minute || AMC 08.20
 
+
|-
<u><span lang="EN-US">Priority mail in idle : type 12</span></u><span lang="EN-US"><br /> Behaves as ‘priority mail present’ above, but is switched OFF during connections and back ON every time the station becomes idle. As such it is well suited to switch on and off audible indicators, which should be silent during an established connection.<br /> This event has no ‘related to’ relationship. </span>
+
| align=center | [[%clk|%clksec]] || Read current second || AMC 08.20
 
+
|-
<u><span lang="EN-US">Faulty station line : type 13</span></u><span lang="EN-US"><br /> Occurs if the owner’s line monitoring has found a problem or if the whole line board becomes faulty.<br /> There is also a ‘faulty station’ indication on the exchange level, which becomes active if one or more stations are faulty. The main difference is that this event also reports the OFF status (indication that the problem has been resolved), while the report on exchange level only reports the event ON status.<br /> This event has no ‘related to’ relationship. </span>
+
| align=center | [[%clk|%clkwday]] || Read current day of week (1 = Monday, 7 = Sunday) || AMC 08.20
 
+
|-
<u><span lang="EN-US">Event Trigger Feature : type 15</span></u><span lang="EN-US"><br /> The owner station dials a directory number with feature 52 (event trigger without tone) or 85 (event trigger with cancel tone) which triggers the defined events. When the event is triggered by physically dialling the ‘related to’ directory number, the event can only report an ON status. If the event is triggered from a data protocol message, it is also possible to report an OFF status.<br /> The field ‘sub-type’ can be used to group event triggers. This field is associated with the parameter (ID) field of the feature. This means that a number of event trigger directory numbers can be defined with the same parameter. If the ‘related to’ field is set to ‘ALL’ and the ‘sub-type’ field is set to that same parameter value, all these directory numbers will trigger the same event.<br /> When used in conjunction with the data protocol message $ER, the owner does not need to be a physical station, but can be a dummy (non-existent) station. This can be useful when an RCI needs to trigger a lengthy action string, which exceeds the allowed length for the RCI action string itself. The action string for the RCI can then be an event report on a dummy station, where the real actions are performed on the event trigger on this dummy station.<br /> The event is also triggered on dialling a directory number with feature 95 (Event trigger with user parameter). In this case the event reports ON when the event directory number has been dialled and OFF when the event is ‘disconnected’. In the case of feature 95, this is useful functionality. Feature 95 directory numbers do not disconnect immediately after connection (like feature 52 or 85 directory numbers), but either time out after 20 seconds, or can be disconnected via a data protocol message $DISCON_ST.<br /> The event must be related to a directory number which triggers the event. </span>
+
| align=center | [[%clk|%1.clk, %1.clkyear]] etc || Read the scheduling tick time || AMC 08.20
 
+
|-
<u><span lang="EN-US">Simplex Conference Audio : type 16</span></u><span lang="EN-US"><br /> Occurs on all stations which are members of a simplex conference, when audio is present in the conference. Normally, the event is triggered by an RCI with a $VOX data protocol message in the action string.<br /> The ‘related to’ directory number must be the directory number of the relevant simplex conference. </span>
+
| align=center | [[%gnv]] || The value of the NVRAM-parameter || AMC 09.05
 
+
|-
<u><span lang="EN-US">Simplex Conference Member : type 17</span></u><span lang="EN-US"><br /> Occurs when this station joins or leaves a simplex conference. </span>
+
| align=center | [[%scutc]] || String extraction by character position  || AMC 10.00
 
+
|-
* <span lang="EN-US">Sub-event 0 = Audio via station line card (ASLT, etc.) </span>
+
| align=center | [[%scutf]] || String extraction by field number || AMC 10.00
* <span lang="EN-US">Sub-event 1 = Audio via AGA conference circuit. </span>
+
|-
 
+
| align=center | [[%sscan]] || String extraction by text scan || AMC 10.00
<span lang="EN-US">The ‘related to’ directory number must be the directory number of the relevant simplex conference. </span>
+
|-
 
+
| align=center | [[%scmp]] || String compare || AMC 10.00
<u><span lang="EN-US">Open Duplex Conf. Ringing : type 18</span></u><span lang="EN-US"><br /> Incoming ringing when a station is included in an Open Duplex Conference by another station.<br /> The event goes ON at the start of the ringing, and OFF when the handset is lifted, or ringing times out.<br /> The ‘related to’ directory number must be the directory number of the relevant open duplex conference. </span>
+
|-
 
+
| align=center | [[%strlen]] || Return length of a string || AMC 11.1.3.0
<u><span lang="EN-US">Open Duplex Conf. Connection : type 19</span></u><span lang="EN-US"><br /> During connection, i.e. conference audio open.<br /> The ‘related to’ directory number must be the directory number of the relevant open duplex conference. </span>
+
|-
 
+
| align=center | [[%lbd]] ||  Return local board of the AMC card || AMC 10.53
<u><span lang="EN-US">Mail Timeout : type 20</span></u><span lang="EN-US"><br /> A timer can be set on a mail event by using the command $SMT (SET_MAIL_TIMEOUT). When the timer expires a ‘Mail Timeout’ event is reported. The event must have an owner. The timer can be set with a ‘related to’ parameter. This parameter is reported and can be used as the %2 parameter in an action string.<br /> This event can be used for instance to higher the priority level of a call request, if the request is not ansered within a certain period. This period is set by the time-parameter of the $SMT-command. </span>
+
|-
 
+
| align=center | [[%prog]] || Return current program active on a station. 0 = no program || AMC 10.53
<u><span lang="EN-US">Event Timeout : type 21</span></u><span lang="EN-US"><br /> A timer can be set with the data protocol command $ST (SET_TIMER). When the timer expires, the event ‘Event Timeout’ is reported. The event must have an owner. If a time out period not intended for a specific station is required, a dummy station can be used as owner.<br /> The timer can be set with a ‘related to’ parameter. This parameter is reported and can be used as the %2 parameter in an action string. </span>
+
|-
 
+
| align=center | [[Dfmt (macro)|%dfmt]] || Convert decimal value to hex, octal or ASCII || AMC 11.0.1.2
<u><span lang="EN-US">New Current mail in station queue : type 23</span></u><span lang="EN-US"><br /> An event is reported each time the current mail in a station queue is changed. Reported both when change due to manual browsing or due to a new high priority mail first in queue, or that the current mail is deleted. The ON report is sent 0,5 second after browsing to a new mail element. The event is also repeated when stopping at the end of the queue. The event is reported OFF when the current mail is left due to any reason. <br /> %1 is the queuing station, %2 is the mail sender. %TAG included. <br /> The delay on the on-report is programmable in NVRAM: timeouts.mail_event_delay </span>
+
|-
 
+
| align=center | %1.pag<br>%2.pag ||  %1.pag returns the A-subscriber pager id.<br> %2.pag returns the B-subscriber pager id || AMC 10.30
<u><span lang="EN-US">New first mail in station queue : type 24</span></u><span lang="EN-US"><br /> Reported when a new mail arrives first in a stations queue. Only reported ON. Will not be reported when the second mail becomes first because the first was deleted. It can be used to start a buzzer when the first request arrives, or when a higher priority request arrives.<br /> %1 is the queuing station; %2 is the mail sender. %TAG included. </span>
+
|-
 
+
| align=center | [[%paf]] || Read PA failure state ([[IP-ARIO]]) || AMC 11.2.3.1
<u><span lang="EN-US">Event Trigger with User Parameter : type 25</span></u><span lang="EN-US"><br /> This event can be triggered from directory numbers associated with different features. </span>The behaviour is different for these 2 features.
+
|-
 
+
| align=center | [[%pai]] || Read default DAK index of PA failure state ([[IP-ARIO]]) || AMC 11.2.3.1
* <span lang="EN-US">Feature 95, which allows the user (the event owner) to dial a directory number as parameter: The user first dials the feature code for the event trigger. Then the user is supposed to dial a directory number. After the directory number is dialled, this event is triggered. The %1 parameter is the station where the function is dialled; %2 is the dialled directory number. </span>
+
|-
 
+
| align=center | [[%pap]] || Read default Mail priority of PA failure state ([[IP-ARIO]]) || AMC 11.2.3.1
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">The event sub-type in the Event Report is set to the value of the parameter-attribute of the Event Trigger directory number. This can be used to define several user-defined actions. </span></span>
+
|-
 
+
| align=center | [[%prci]] || Read physical rci state of an IP Station or [[IP-ARIO]] rci || AMC 11.2.3.1
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">The feature does not disconnect after the event has been triggered. The station just hangs silently, until it disconnects after 20 seconds. The data protocol message $DISCON_ST can be used to make the station disconnect with the selected tone. The Event Handler programmer can then control the feedback to the user, using this message in combination with the $DISPLAY_TEXT message. </span></span>
+
|-
 
+
| align=center | [[%prco]] || Read physical rco state of an IP Station or [[IP-ARIO]] rco || AMC 11.2.3.1
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">The user can also dial more than one directory number. An event is triggered for each directory number dialled; %2 is the dialled directory number. This can be used to make 'dynamic grouping' functions, </span></span>[mk:@MSITStore:C:\Program%20Files\AlphaPro1024\Help\AlphaProHelp.chm::/../../Apollo/HTM_help/acapplications.htm#DynGrpCalls <span lang="EN-US">see example</span>]<span lang="EN-US">. </span>
+
|-
 
+
| align=center | [[%rphy]] || Read physical number from directory number || AMC 11.2.3.1
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">An Event Report is also generated immediately after the initial feature code is dialled: ‘Event Trigger Start with User Parameter’, see below. </span></span>
+
|-
 
+
| align=center | [[%rdir]] || Read directory number from physical number || AMC 11.2.3.1
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">The Event Trigger Feature number 15 event is also reported, with the %2 parameter set to the directory number of the event trigger feature. The events reports ON when the event trigger has been dialled and OFF when the feature is disconnected (the Event sub-type is always ‘0’). </span></span>
+
|-
 
+
| align=center | [[%tin]] || Returns current number of trunk channels in use towards a specific trunk || AMC 11.2.3.3
* <span lang="EN-US">Feature 105. When activating this feature all succeeding digits are reported to the event handler and trigger this event where the event sub-type is equal to the digits dialled 0-9. The event is ON as long as the station key is down and reported OFF when key is released, which can for instance be used for camera control from the station keyboard, </span>[mk:@MSITStore:C:\Program%20Files\AlphaPro1024\Help\AlphaProHelp.chm::/../../Apollo/HTM_help/acapplications.htm#CCTVintegration <span lang="EN-US">see example</span>]<span lang="EN-US">. </span>
+
|-
 
+
| align=center | [[%syse]] || Returns state of system event || AMC 11.2.3.4
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">Directory numbers assigned FEAT_DIGIT_EVENT (105) with the parameter-attribute set to ‘0’ display the digit while it is held down in the second line of the station display; if the parameter-attribute is different from ‘0’ the display is not updated and can be updated by the event handler to indicate ‘left’, ‘up’, ‘on’, etc…. </span></span>
+
|-
 
+
| align=center | [[%nip]] || Return IP address of remote node || AMC 11.2.3.4
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">The features times out after 20 seconds after the last pressed digit. </span></span>
+
|-
 
+
| align=center | [[%rn]] || Return node number of a directory number || AMC 11.2.3.4
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">The digit press on a CRM4 is only reported ON for a few hundred milliseconds. The digit release is handled by the internal station software and is not dependent on the physical length of the button press. </span></span>
+
|-
 
+
| align=center | [[%vol]] || Return station current volume setting || AMC 11.2.3.11
<u><span lang="EN-US">Event Trigger Start with User Parameter : type 26</span></u><span lang="EN-US"><br /> An event trigger feature, triggered after dialling a directory number with feature 95. It is closely associated with the event trigger as described above. <br /> It is generated immediately after the initial feature code is dialled. The %1 parameter is the station where the function is dialled (the owner). If the station has mail in its queue, the %2 parameter is set to the sender of the current mail. Otherwise %2 is empty. </span>
+
|-
 
+
| align=center | [[%syspar]] || Return state of system parameter || AMC 11.5.3.4
<u><span lang="EN-US">System Event : type 27</span></u><span lang="EN-US"><br /> Event type 27 is triggered by system events. In the AMC software, %1 is hardcoded to physical station 1. The event does not recognise a 'related to' parameter. In AlphaPro 'When Related To' must be set to 'All'.<br /> - Sub-event 1-208 are used for device up/down reports.<br /> - Sub-events 65-68 (exchange modules) use the global timer 'start_evn_delay' (default value '1') before the event is triggered ON. There is no delay for the event OFF trigger. The ON event is triggered when all cards are scanned.<br /> - Sub-events 210-217 are used for serial ports 1-7 up/down reports, but only for ports in multi-module or AlphaNet mode. </span>
+
|-
 
+
| align=center | [[%sfg]] || Return failure state of IP stations in a station group || AMC 12.5.3.0
'''<span lang="EN-US">Scheduling</span>'''<span lang="EN-US"><br /> Scheduling is to program the AlphaCom to do actions at specified hours, weekdays or dates.<br /> Scheduling is an extension to the Event Handler and is defined as type 22.<br /> Each minute a MINUTE_TICK event is generated, with the current time as parameter. Scheduling rules consists of a time condition and a normal Event Handler action. </span>There are two variants of time conditions:
+
|-
 
+
| align=center | [[%mcm]] || Return the physical number of the Mix Controller associated to the Mixer Channel || AMC 12.3.3.1
* <span lang="EN-US">Date and time: yy-mm-dd hh:mm. Each digit can be a wild card *, matching all tick-values in that position.<br /> Example: The rule '**-**-** 12:00' will be triggered every day at 12:00. </span>
+
|-
* <span lang="EN-US">List of weekdays and a time: mtwtfss hh:mm. In AlphaPro there is a checkbox for each weekday. Each digit in the time can be a wild card *.<br /> Example: The rule mtwtf-- **-**-** **:00 will be triggered every hour Monday to Friday. </span>
+
| align=center | [[%sxc]] || Return the simplex conference channel number that the station is listening to. || AMC 12.3.3.1
 
+
|-
<span lang="EN-US">For each MINUTE_TICK event the tick time is matched against all scheduling rules. All matching rules are executed. <br /> During normal operation the minute tick is executed between 1 and 2 seconds after start of the minute. <br /> In order to not miss important actions while the exchange is down, or if the clock is moved forward, there is a time catch-up mechanism to handle this. </span>
+
| align=center | [[%busy]] || Return the busy/free state of a station. ||  ICX 1.0.3.1, AMC 13.1.3.3
 
+
|-
* <span lang="EN-US">The last generated minute tick is stored in NVRAM. </span>
+
| align=center | [[%tnsf]] || Return the first parameter of a directory number. ||  ICX 1.0.3.1, AMC 13.1.3.3
* <span lang="EN-US">Up to 24 hours are caught up after a power off, or after the real-time clock has been set forward. <br /> -One minute tick is generated every second until the scheduling tick time has caught up with real time (can take up to 24 minutes). During this period the scheduling time is different from real time. </span>
+
|-
* <span lang="EN-US">During normal operation the MINUTE_TICK event is generated with the change-flag set to ON. During catch-up the change is set to OFF. In this way catch-up ticks can be filtered away. The %chg() parameter can be used in the action string to test if it is a normal operation or catch-up. </span>
+
| align=center | [[%tnss]] || Return the second parameter of a directory number. ||  ICX 1.0.3.1, AMC 13.1.3.3
* <span lang="EN-US">As from AMC software version 9.05 it is possible to use the 'When Change To' flag to trigger the event depending on the type of minute tick:<br /> - ON : the event will be triggered on 'real' ticks<br /> - OFF : the event will be triggered on 'catch-up' ticks<br /> - ON or OFF : the event will be triggered on both types of ticks. </span>
+
|-
* <span lang="EN-US">If the clock is set backwards, (e.g. daylight saving time at autumn), the scheduling time is set back immediately, and the ticks are performed as normal during the overlapping period. </span>
+
| align=center | [[%tnst]] || Return the third parameter of a directory number. ||  ICX 1.0.3.1, AMC 13.1.3.3
* <span lang="EN-US">%1.clk, %1.clkmin %1.clkhour parameters etc. will return the scheduling tick time, not the real time if used within a Scheduling action. </span>
+
|-
* <span lang="EN-US">%clk (without the '1.') will always return the real time. </span>
+
| align=center | [[%mch]] || Return the first station-channel (phy) related to the mixer_station (phy) that is member of the conference (no 1-99). ||  ICX 1.0.3.1, AMC 13.1.3.3
 
+
|-
<span lang="EN-US">In AlphaPro the time and date of an event is stored in the 'ID' and 'related to' fields. In this case 'ID' and 'related to' must be viewed in a different way compared to when the owner of an event is a station. 'ID' and 'related to' are merely a convenient place to store the parameters. </span>
+
|}
 
+
<br>
'''<span lang="EN-US">Event actions</span>'''<span lang="EN-US"><br /> There are 2 types of action: </span>
+
<br>
  
* <span lang="EN-US">An action string which can be entered in the ‘Command-filed’ as ASCII characters </span>
+
=== Formatting ===
* An action on an RCO
+
Text adjustment parameters can be added to all %xxx macros
 +
;%xxx(width,filler)
 +
:'''width''': Length of field
 +
::If ‘<’ is put immediately after the width, it means left-adjustment. Default is right adjustment
 +
:'''filler''': If width is wider than the returned value, the specified filler character is filled in
 +
::Typical fillers are
 +
:::”  ” (space)
 +
:::”0” (leading zero)
 +
:::”F” (MPC protocol)
 +
::The filler can be omitted: %xxx(width). Then ”  ” (space) will be used as filler if required. It is not allowed with space between the formatting parameters
  
<u><span lang="EN-US">RCO</span></u><span lang="EN-US"><br /> When an RCO is selected from the drop-down list, the event will operate that specific RCO. The RCO-status will follow the 'change'-status as follows: </span>
 
  
* <span lang="EN-US">'ON' selected: The RCO will be made active when the ON-action of the event is triggered </span>
+
'''Examples:'''
* <span lang="EN-US">'OFF' selected: The RCO will be de-activated when the OFF-action of the event is triggered </span>
 
* <span lang="EN-US">'ON or OFF' selected: The RCO status will follow the 'change'-status; activated for ON, de-activated for OFF </span>
 
  
<u><span lang="EN-US">Action strings</span></u><span lang="EN-US"><br /> As an alternative to the above RCO-operation it is also possible to enter a command-string in the action-field.<br /></span>An action string can contain:
+
'''%1.dir'''
 +
Minimum:        %1.dir        - Example result:  “123”
 +
MPC format:      %1.dir(4,F)  - Example result:  “F123”
 +
Two last digits: %1.dir(2)    - Example result: “23”
  
* <span lang="EN-US">Command (internal commands and data protocol messages) </span>
+
'''%1.nam'''
* Parameters and Macro operations
+
Minimum:          %1.nam      - “Mr. Smith”
* Statements and Conditions
+
5 last characters: %1.nam(5)   - “Smith”
 +
12 char, right :  %1.nam(12)  - “  Mr. Smith”
 +
12 char, left :    %1.nam(12<) - “Mr. Smith  ”
  
<span lang="EN-US">Action strings are stored in multiples of 16 bytes. A new action string always starts on a 16-byte boundary. This means that if all action strings have a maximum of 16 characters, it is possible to define 2000 action strings. </span>
+
[[%udd]] (assuming decimal value 65 is stored in UDD 12)
 +
%udd(12)        - “65”
 +
%udd(12,4)      - “  65”
 +
%udd(12,4<)      - “65  ” 
 +
%udd(12,4,f)    - “ff65” 
 +
%udd(12,4<,f)    - “65ff”
  
<u><span lang="EN-US">Commands</span></u><span lang="EN-US"><br /> The commands can be internal commands and data protocol messages. </span>The internal commands are:
+
'''%clk'''
 +
Minimum:          %clk      - “2009-10-16 12:59:35”
 +
8 last characters: %clk(8)  - “12:59:35”
 +
10 char, left :    %clk(10<) - “2009-10-16”
  
* PRS - Program to Station
+
===Free text===
* PRG - Program to Group
+
A free text in built-in event handler commands are written in double quotes "".
* CNG - Conference to Group
 
* MST - Mail to Station
 
* MGR - Mail to Group
 
* MPP - Mail to Pocket Pager
 
* AMS - Alarm Message to Station
 
* AMG - Alarm Message to Group
 
* RCO - set Remote Control Output
 
* <span lang="EN-US">EDO - send text to serial port (External Data Out) </span>
 
  
<font face="Symbol"><font size="10.0pt">·</font></font><span dir="LTR">text is enclosed between "" </span>
+
<br<br>
  
<span lang="EN-US"><font face="Symbol"><font size="10.0pt">·</font></font></span><span dir="LTR"><span lang="EN-US">Non printable ASCII characters can be inserted in the text:<br /> \xyy : yy is any ASCII value in HEX<br /> \r = RETURN<br /> \n = linefeed<br /> \t = tab </span></span>
+
=== Comments ===
 +
The Event Handler allows line comments by prefixing the line with an exclamation mark (!).
  
* <span lang="EN-US">LOG - send text to exchange’s log port (printed with date/time) </span>
+
Any line in the event handler starting with ! will not be executed. This does not support inline comments.
* <span lang="EN-US">IND - indicator control for CRM4 keyboard LEDs etc. </span>
 
* <span lang="EN-US">OWN - modify event’s owner and related to values </span>
 
* <span lang="EN-US">WUDD - WUDD index value : Command string action to write a value to User Defined Data. The value is changed immediately, before the next statement is executed. This command can only be used to change values in the local exchange. To write data in the User Defined Data area of a remote exchange, the data protocol message $WUDD should be used: </span>
 
  
<font face="Symbol"><font size="10.0pt">·</font></font><span dir="LTR">$WUDD UINT2 index, UINT2 value </span>
+
{{note|Comments are supported as from AlphaCom sw 13.1.3.1}}
  
<u><span lang="EN-US">Parameters and macro operations</span></u><span lang="EN-US"><br /> Parameters and macro operations in an action string are preceded by the '%'-sign. They both return a value.<br /> %xxx() macros can be nested freely, building complicated expressions.<br /> Some parameter-types are associated with the owner, the 'related to' field or the change flag; this is indicated by '%n', where 'n' can have the value 1, 2 or 3: </span>
+
Example:
 +
IF %busy(4)
 +
!Station 4 is busy
 +
stop
 +
ENDIF
 +
!Station 4 is free
 +
$CALL L101 L104
  
* <span lang="EN-US">%1: the parameter is associated with the owner field </span>
+
<br><br>
* <span lang="EN-US">%2: the parameter is associated with the 'related to' field </span>
 
* <span lang="EN-US">%3: the parameter is associated with the change flag </span>
 
  
Parameters and macro’s:
+
===Escape sequences===
 +
[[Character escape codes|Escape sequences]] can be used for two purposes:
 +
* to use non-printable characters in action strings
 +
* quoting: ignore special meaning of a character in eventhandler parser.
  
* <span lang="EN-US">%n.dir(length,filler) : <br /> - n can be 1 or 2<br /> - empty () can be omitted; %n.dir is equivalent to %n.dir()<br /> - shortform: %nd </span>
+
Some frequently used escape sequences:
* <span lang="EN-US">%n.phy(length,filler)<br /> - n can be 1 or 2<br /> - empty () can be omitted; %n.phy is equivalent to %n.phy() </span>
+
\r = Carriage Return
* <span lang="EN-US">%n.nod()<br /> - n can be 1 or 2 </span>
+
\n = Line Feed
* <span lang="EN-US">%n.ref<br /> - n can be 1 or 2 </span>
+
\xhh = hh is any ASCII value in HEX
* <span lang="EN-US">%n.nam(length,filler) : returns the display text<br /> - n can be 1 or 2<br /> - shortform: %nn </span>
 
* <span lang="EN-US">%n.dak(DAK search string,D_10 range)<br /> - n can be 1 or 2 </span>
 
* <span lang="EN-US">%n.exp : External Feature Parameter<br /> - n can be 1 or 2 </span>
 
* <span lang="EN-US">%n.DEV : returns the device number (as from AMC 9.03).<br /> - n can be 1 or 2<br /> - if n equals 2, it will work only if the 'related to' parameter is a station in the same node </span>
 
* <span lang="EN-US">%n.BRD : returns the board number (as from AMC 9.03).<br /> - n can be 1 or 2<br /> - if n equals 2, it will work only if the 'related to' parameter is a station in the same node </span>
 
* <span lang="EN-US">%n.PORT : returns the port number (as from AMC 9.03).<br /> - n can be 1 or 2<br /> - if n equals 2, it will work only if the 'related to' parameter is a station in the same node </span>
 
* <span lang="EN-US">%3.chg(on_text,off_text)<br /> - %3.chg(,) can be shorted to %chg(,) </span>
 
* <span lang="EN-US">%3.RFT(normal_text,refresh_text) : Action command parameter which substitutes the parameter with a text describing the on/off transition of the event. Some events can be reported many times (e.g. line errors), and it's possible to have different actions depending on if this is the first time, or a ReFresh.<br /> - can be shorted to %3r(on_text,off_text) </span>
 
* <span lang="EN-US">%1.mpri : returns the priority of the mail </span>
 
* <span lang="EN-US">%1.mfre : returns the free text of a station mail if it is available, otherwise '-' </span>
 
* %1.tag : returns the mail tag
 
* <span lang="EN-US">%sng(station, group) : (Station Next Group). Returns the next group after group of which station is a member. Returns '0' if station is not a member of any (more) groups. %sng(station, 0) returns the first group of which station is a member.<br /> - group is 1 – 100, station is physical number 0 – 552. </span>
 
* <span lang="EN-US">%gns(group, station) : (Group Next Station). Returns the next station after station which is a member of group. Returns ‘0’ if no more members in group. %gns(group, 0) returns the first station in group. <br /></span>- group is 1 – 100<br /> - station is physical number 0 – 552.
 
* <span lang="EN-US">%sgm(station,group) (Station Group Membership). Returns '1' if station is a member of the group.<br /> - group is 1 – 100<br /> - station is physical number 0 – 552. </span>
 
* <span lang="EN-US">%UDD(index) : Command string macro to get the User Defined Data out of the location 'index'. </span>
 
* <span lang="EN-US">%SEV : Returns the sub-event number (in decimal format) of the event being processed. If the sub-type of en event is defined as 255, the main event will be triggered independent on the reported sub-type. If this is used with feature 105, 'Event trigger on dialling digits', %SEV will return the dialled digit. </span>(introduced in AMC software 9.03)
 
* <span lang="EN-US">%OP( , , ) : macro for numeric calculations. The general format is %OP(integer1,operator,integer2), no space is allowed between ',' and the operator. The operator can be:<br /> - + add<br /> - - subtract<br /> - * multiply<br /> - / divide<br /> - < less<br /> - <= less or equal<br /> - > greater<br /> - >= greater or equal<br /> - = equal<br /> - == equal<br /> - != not equal<br /> - << bit shift left / up<br /> - >> bit shift right / down<br /> - && logical and<br /> - || logical or<br /> - & bitwise and<br /> - | bitwise or<br /> - ! logical not of second operand<br /> - ^ bitwise xor </span>
 
* <span lang="EN-US">%clk<br /> - returns current date/time 2000-11-10 12:59:35 </span>
 
* %clkyear<br /> - returns current year: 2000
 
* %clkmon<br /> - returns current month: 11
 
* %clkday<br /> - returns current day: 10
 
* %clkhour<br /> - returns current hour: 12
 
* %clkmin<br /> - returns current minute: 59
 
* %clksec<br /> - returns current second: 35
 
* <span lang="EN-US">%clkwday<br /> - returns current day of week: 5 (1 = monday, 7 = sunday) </span>
 
* <span lang="EN-US">%1.clk, %1.clkmin %1.clkhour etc. will return the scheduling tick time, not the real time if used within a Scheduling action. </span>
 
* <span lang="EN-US">%GNV() : returns the value of the NVRAM-parameter, of which the address is specified in between () (as from AMC 9.05).<br /> - %GNV(1,3,54) returns the value of 'ex_profile.timeouts.th_conn_length' in AMC 9.05. Note that the address can be different in different AMC software versions. </span>
 
  
<u>Statements</u>
+
Some ASCII values:
 +
\x0D = Carriage Return (CR)
 +
\x0A = Line Feed (LF)
 +
\x02 = Start of Text (STX)
 +
\x03 = End of Text (ETX)
 +
\x06 = ACK
  
* <span lang="EN-US">PAUSE<br /> pauses the event handler command interpreter for 100ms </span>
+
Find more [[Character escape codes|Escape sequences]].
* <span lang="EN-US">IF/ENDIF<br /> Conditional statement. If the text/expression after the keyword IF evaluates to ‘0’, all following commands/statements are skipped until the keyword ENDIF is encountered; IF/ENDIF statements can be nested </span>
 
* <span lang="EN-US">STOP<br /> The statement STOP stops the execution of the action string. </span>Is only useful in front of the keyword ENDIF<br />
 
  
[[Category:Event Handler]]
+
[[Category: Event Handler]]

Latest revision as of 14:01, 21 November 2023

AI.png
Event Handler - Block Diagram

The ICX-AlphaCom and AlphaCom XE servers are intercom servers of which the main task is to enable uni- and bi-directional speech. In order to be able to meet as many customer requirements as possible when it comes to special features an Event Handler has been implemented. The underlying idea is that by customer-programming this event handler functionality can be implemented which is not part of the standard feature list. The event handler is unique in the world of intercom. It is what gives the server its flexibility and makes it possible to meet most, if not all, customer requirements.
The Event Handler is based on the software concept that when the intercom functions run, they report 'events' to a part of the software called the Event Handler. The event can be described as a trigger that sets off an action in the system depending on the information entered in AlphaPro, the programming tool for the ICX-AlphaCom. In this way, the Event Handler provides a powerful engineering tool for configuring system behavior to meet requirements from customers.

Actions can be simple, just to operate a relay under certain circumstances. Actions can also be programmed using a scripting language and can include conditional statements. An action can itself trigger a new event, making it possible to start a chain of actions.

The principle

Events

Events are generated inside the ICX-AlphaCom software when interesting things happen. Events follows a fixed format, with the following parameters:

  • Owner
  • Event type
  • State change : ON/OFF
  • Related-to

The owner is source which triggers the event. The following possible owners are defined:

  • A single station
  • A group of stations (UDP group) with common behavior
  • The scheduler, the internal ICX-AlphaCom realtime clock
  • External Data Input, a data port set up to receive ASCII text strings from external devices

The Event type is a number which tell what sort of event occurred. Event type is divided into a Main event and Sub-Event. Main events are listed below. Only some of the Main events use the Sub-Event. In the case of the scheduler the event is the ‘minute tick’.

State change: Most of the events are modeled as a state which goes ON and OFF. But some events does not fit to that concept, then only a ON event is reported.

Related-to is specific for the feature which reports the event. It can be the other station in a conversation, or the sending station of a mail or CallRequest.

For some features in AlphaNet, the owner of an event can be in a different node. Then the EVENT REPORT message sent to the owning exchange, where the event is processed. Conversation Outgoing is an example of such an event.

Event Rules

Event handler Rules are what you program in the Event Handler window in AlphaPro. An Eventhandler Rule has two main parts:

  • A condition, which matches specific Events
  • An action, which specifies what should happen when a Event matches a Condition.

Stations can trigger many different types of event.
Many events can trigger an action when the event is activated and when the event is de-activated, for instance event type 07: Conversation – Incoming. The On/Off action can be differentiated by the ‘When Change To’ flag.
Events can be, but don't have to be, related to a specific directory number or a group of stations, for instance:

  • Owner: Station 1
  • Event: Conversation - Outgoing
  • Related to: Directory number 102
  • When change to: ON
  • Action: RCO 2 ON

In this case the relay connected to RCO 2 will only be activated if 'Station 1' is in conversation with a station with directory nr 102, AND if Station 1 was the station which made the call. If 'Related to' was not specified, that same relay would be activated on any call which Station 1 would make.

Events Types

The list shows the available event types, grouped by function.

Event Type No. When triggered
Single Station Events
Audio 01 When audio is played in the speaker
Door Open - Automatic Lock 03 When the Code Lock feature is dialed
Station in Use 04 When a station becomes busy or free
Microphone Open 05 When the microphone is alive
Faulty Station Line 13 When a station is reported faulty or OK
M-key 31 When the M-key is pressed or released
Off-hook 32 When the handset is lifted or replaced
C-key 35 When C-key is pressed or released
Feature From Idle 37 When a feature is dialed from idle
Additional call info 39 Feature status, such as: User denied access, call to busy station, etc.
Station Fault 43 Reports various station and ENA amplifier errors
Conversation Events
Conversation Incoming 07 When a call is received
Conversation Outgoing 08 When a call is made
Conversation 44 When a call is received
Private Ringing mode 09 During private ringing for incoming call
Private Ringing Outgoing 33 During private ringing for outgoing call
Door Opening - During Conv. 02 When door opening feature (digit 6) is activated during conversation
SIP progress event 36 During setup of call to SIP trunk
Recording 40 Control recording session
Mail (Call Queue) Events
Received Mail 10 When a mail or a call request is received
Call Requester Mode 11 When a station sends a Call Request
Priority Mail Present 06 When a mail with priority level 100 (programmable) is present in the mail queue
Priority Mail in Idle 12 When a priority mail is present, and the station is not in conversation
Mail Timeout 20 When a mail times out
New Current Mail 23 When the current mail in the queue is changed
New First Mail 24 When a new mail arrives first in the queue
Group & Conference Events
Simplex Conference Audio 16 When listening to simplex conference, and the $VOX command is activated
Simplex Conference Member 17 When a station joins a simplex conference
Open Duplex Conf. Ringing 18 During ringing to an open duplex conference
Open Duplex Conf. Connect 19 When a station connects to an open duplex conference
Dynamic group inclusion 38 NOT IN USE
Event Triggers
Event Trigger 15 When dialing a directory number with feature number 52, 85, 95 or 105
Event Trigger with parameter 25 When dialing Event Trigger feature 95 or 105, preceded by a directory number or digit
Start: Event Trigger with param. 26 When dialing a directory number with feature number 95
Event Timeout 21 When a timer started by the $ST command expires
Station Input or Station DAK key 30 When a station input or DAK key is pressed
Scheduling
Scheduler (Minute Tick) 22 When matching the specified date (or weekdays) and time
EDI - External Data Input
External Data Input 28 When receiving ASCII data on EDI port
System Events
System Status 27 When a device is reported up or down
AlphaNet Link 29 When an AlphaNet link is reported up or down
Board Status 34 When a board is reported up or down



Action Commands

There are two types of Action Commands which can be used by the Event Handler, Built-In Action Commands and Data Protocol Commands.

Both types of commands can include parameters and macros (e.g. %1.dir and %clk(8))

Built-In Action Commands

Built-in Action Commands are three- or four-letter commands. The commands are case-insensitive as from AMC 08.20. Most of the Built-In commands also have a Data Protocol implementation.

Command Description From AMC ver.
PRS Audio Program to Station  
PRG Audio Program to Group  
CNG Simplex Conference to Group  
MST Mail to Station  
MGR Mail to Group  
MPP Mail to Pocket Pager  
AMS Alarm Message to Station  
AMG Alarm Message to Group  
RCO Set Remote Control Output  
EDO Send text to serial port External Data Output EDO 1 - 4  
LOG Send text to exchange’s log port (including date/time)  
IND Indicator control for CRMIV LEDs, buzzer etc. AMC 07.20
GIND Indicator control to a group of station . AMC 11.02
OWN Modify Event Owner (%1) and/or Related_To (%2) values AMC 07.60
WUDD Write a value to an User Defined Data UDD  
TMP Write a string to a temporary variable  
PAUSE Pauses the event handler command interpreter for 100 ms AMC 08.20
IF/ENDIF Conditional statement AMC 08.20
STOP Stops the execution of the rest of the action string AMC 08.20
LOOP/ENDLOOP Looping statement AMC 11.00
BREAK Break out of Loop AMC 11.00



Data Protocol Commands

Data Protocol Commands are using ACDP commands on the Simple Link Layer format. The commands begin with $ or @.

The most relevant data protocol commands for the Event Handler and for RCIs are listed in the table below. Follow this link for a complete list of all Data Protocol Commands


Message Short name Message no, Hex Description
Station Connect Operations
CALL_SETUP CALL 0x0008 Sets up a conversation between two users
DISCON_ST   0x008E Disconnect station from ongoing feature
PAR_RING   0x0098 Add a Parallel Ringer station to a call in ringing state
Station Keyboard & Display emulation
DIAL_DIGITS DD 0x0050 Simulate digit dialing from a station
DIAL_DAK   0x0094 Dial DAK on a station
PLAY_DAK PD 0x009C "Dial sequence" for playback.
M_KEY M 0x0054 Order station to press M-key
M_KEY_RELEASE MREL 0x0055 Order station to release M-key
C_KEY C 0x0058 Order station to press C-key
DISPLAY_TEXT DSPL 0x005A Send text and control characters to a station
Station Features and Status
PROGRAM PROG 0x0001 Set audio program for single station or a predefined group of stations
PROG_CONF CONF 0x0004 Set Simplex conference for predefined group of stations or a single station
CONF_TALK   0x008B Set Simplex conference speaker
CONF_TALK_STOP   0x008C Stop station form feeding Simplex conference
O_DUPL_CONF ODC 0x006F Include/exclude a station or a group into/from an Open Duplex Conference
ALARM_MSG ALRM 0x0007 Set up (or disconnect) an ASVP Alarm message to a single station or a predefined group of stations
CALL_TRANSFER TRF 0x0044 Set or remove call transfer for a station
SET_REQ_TRANSF SCRT 0x002B Set transfer of Call Request for an intercom station
SET_ABSENCE SABS 0x0028 Set absence status for an intercom station
WAKE_UP   0x0047 Register or remove wake­up request
SET_GRP_FILT GFLT 0x007D Set group call filter for a station
GROUP_MEMBERSHIP GRM 0x0081 Set group membership in NVRAM for a station
SET_STATION_COS SSC 0x0090 Set COS membership in NVRAM for a station
MODIFY_COS_CONTENTS MCC 0x0091 Modify feature membership in COS in NVRAM
TEMP_PROG TPROG 0x0096 Temporarily "mute" program distribution to a station
VOL   0x009B Set station volume
SET_RCO SET 0x0018 Activate IP Station output
SILENT CALL SC 0x0077 Set a station in silence call mode for next feature activated
Station Mail Operations
SEND_MAIL SM 0x0031 Send a mail message to an intercom station
SEND_TXT_MAIL STM 0x0032 Send a mail message with free text to an intercom station
CANCEL_MAIL CANM 0x0065 Delete one or more mail/call request/alarm messages queued at a station
SET_MAIL_TIMEOUT SMT 0x0082 Set the timer of a mail queue entry
COPY_MAIL CPYM 0x0083 Send a copy of a mail in own queue to a new destination (station or group)
MAILQ_NAVIG   0x008D Do operation on mail queue, or step current mail in mail queue
DELETE_MAIL DELM 0x0034 Delete a mail entry in the queue for an intercom station
General Exchange Control
SET_SYSTEM_TIME SST 0x0027 Set the internal clock to the given date and time
PUT_STRING PUT 0x0073 Output String to Exchange serial port after adding appropriate framing depending on selected port
LOG_STRING LOG 0x0075 Output String to System Log
EXECUTE_COMMAND X 0x004F Send a command string to the exchange to be executed there
EVENT_REPORT ER 0x0067 Report an event to the event/action system
SET_TIMER ST 0x008F Start or stop a timer
WRITE_USER_DEF_DATA WUDD 0x008A Write User Defined Data (UDD)
SET_DIRNO_TXT SDT 0x0077 Change the display text of a directory number (station or feature)
SMALL_RESET   0x00BC Simulates Small Reset sent from ICX-AlphaCom web interface



Context Parameters and macros

Action commands used in the Event Handler can contain context parameters and macros. They both return a value.

Context Parameters are related to the actual event, and refer to the involved station(s) or functions. A parameter always starts with the character "%". Context parameters are useful for defining the action of a rule where the condition is a UDP_group.

  • %1: the parameter is associated with the Owner field
  • %2: the parameter is associated with the Related to field
  • %3: the parameter is associated with the When change to field

A macro is unrelated to the event itself. It reads information from the memory (nvram) or performs a calculation. Also a macro always starts with the character "%".

Macros and parameters can be nested freely, and makes it possible to build complicated expressions.

List of context parameters

Parameter Short name Returned value From version
%1.phy %1p The physical number AMC 07.20
%1.dir %1d The directory number  
%1.nam %1n The name (display text) AMC 08.00
%1.exp %1e The User defined parameter  
%1.udp   The UDP group memberships for station AMC 10.21
%1.dak %1k The number of the DAK key containing a specified string AMC 08.00
%1.nod   The node number AMC 08.03
%1.ref   The node and directory number as a complete NET_OBJ_REF.
%1.ref is equivalent to "L(%1.nod) %1.dir"
AMC 08.20
%1.mpri   Priority of the mail. Available in mail related ON events only AMC 08.20
%1.mfre   Free-text of station mail if available, else ”-”. Available in mail related events only  
%1.tag   Mail tag. Unique mail identification. Available in mail related events only AMC 08.10
%1.dev   The Device number AMC 09.03
%1.brd   The board number (1 - 25) AMC 09.03
%1.port   The port (1 - 32) within board AMC 09.03
%3.chg
%chg
%3c %chg(ON_txt,OFF_txt) returns "ON_txt" when the event goes ON, "OFF_txt" when the event goes OFF
Example: LOG “Door %1.dir is %chg(OPEN ,CLOSED)“
Result, event ON: - “Door 123 is OPEN ”
Result, event OFF: - “Door 123 is CLOSED”
AMC 07.20
%3.rft
%rft
%3r Action command parameter which substitutes the parameter with a text describing the on/off transition of the event. Some events can be reported many times (e.g. line errors), and it's possible to have different actions depending on if this is the first time, or a Refresh.
%rft(normal_text,refresh_text) returns <refresh_text> if this is a refresh transition. <normal_text> otherwise.
 
%sev   Read sub-event number AMC 09.03
%edi   Read EDI text input AMC 10.00
%1.fea   Feature of directory number AMC 13.1.3.1


Note: %2 can be used instead of %1. %2 will refer to the 'Related To' field instead of the 'Owner' field.

List of macros

Macro Description From version
%op Macro for numeric calculations AMC 08.20
%udd Read a UDD (User Defined Data variable) AMC 08.20
%tmp Read Temporary variable AMC 10.00
%sng Find next group which station is member of AMC 08.20
%gns Find next member station of group AMC 08.20
%ges Find next station of Mutual exclusion group AMC 11.0.3.0
%sgm Is station member of group AMC 08.20
%clk Read current date and time on format yyyy-mm-dd hh:mm:ss AMC 08.20
%clkyear Read current year AMC 08.20
%clkmon Read current month AMC 08.20
%clkday Read current day AMC 08.20
%clkhour Read current hour AMC 08.20
%clkmin Read current minute AMC 08.20
%clksec Read current second AMC 08.20
%clkwday Read current day of week (1 = Monday, 7 = Sunday) AMC 08.20
%1.clk, %1.clkyear etc Read the scheduling tick time AMC 08.20
%gnv The value of the NVRAM-parameter AMC 09.05
%scutc String extraction by character position AMC 10.00
%scutf String extraction by field number AMC 10.00
%sscan String extraction by text scan AMC 10.00
%scmp String compare AMC 10.00
%strlen Return length of a string AMC 11.1.3.0
%lbd Return local board of the AMC card AMC 10.53
%prog Return current program active on a station. 0 = no program AMC 10.53
%dfmt Convert decimal value to hex, octal or ASCII AMC 11.0.1.2
%1.pag
%2.pag
%1.pag returns the A-subscriber pager id.
%2.pag returns the B-subscriber pager id
AMC 10.30
%paf Read PA failure state (IP-ARIO) AMC 11.2.3.1
%pai Read default DAK index of PA failure state (IP-ARIO) AMC 11.2.3.1
%pap Read default Mail priority of PA failure state (IP-ARIO) AMC 11.2.3.1
%prci Read physical rci state of an IP Station or IP-ARIO rci AMC 11.2.3.1
%prco Read physical rco state of an IP Station or IP-ARIO rco AMC 11.2.3.1
%rphy Read physical number from directory number AMC 11.2.3.1
%rdir Read directory number from physical number AMC 11.2.3.1
%tin Returns current number of trunk channels in use towards a specific trunk AMC 11.2.3.3
%syse Returns state of system event AMC 11.2.3.4
%nip Return IP address of remote node AMC 11.2.3.4
%rn Return node number of a directory number AMC 11.2.3.4
%vol Return station current volume setting AMC 11.2.3.11
%syspar Return state of system parameter AMC 11.5.3.4
%sfg Return failure state of IP stations in a station group AMC 12.5.3.0
%mcm Return the physical number of the Mix Controller associated to the Mixer Channel AMC 12.3.3.1
%sxc Return the simplex conference channel number that the station is listening to. AMC 12.3.3.1
%busy Return the busy/free state of a station. ICX 1.0.3.1, AMC 13.1.3.3
%tnsf Return the first parameter of a directory number. ICX 1.0.3.1, AMC 13.1.3.3
%tnss Return the second parameter of a directory number. ICX 1.0.3.1, AMC 13.1.3.3
%tnst Return the third parameter of a directory number. ICX 1.0.3.1, AMC 13.1.3.3
%mch Return the first station-channel (phy) related to the mixer_station (phy) that is member of the conference (no 1-99). ICX 1.0.3.1, AMC 13.1.3.3



Formatting

Text adjustment parameters can be added to all %xxx macros

%xxx(width,filler)
width: Length of field
If ‘<’ is put immediately after the width, it means left-adjustment. Default is right adjustment
filler: If width is wider than the returned value, the specified filler character is filled in
Typical fillers are
” ” (space)
”0” (leading zero)
”F” (MPC protocol)
The filler can be omitted: %xxx(width). Then ” ” (space) will be used as filler if required. It is not allowed with space between the formatting parameters


Examples:

%1.dir

Minimum:         %1.dir        - Example result:  “123”
MPC format:      %1.dir(4,F)   - Example result:  “F123”
Two last digits: %1.dir(2)     - Example result:  “23”

%1.nam

Minimum:           %1.nam      - “Mr. Smith”
5 last characters: %1.nam(5)   - “Smith”
12 char, right :   %1.nam(12)  - “   Mr. Smith”
12 char, left :    %1.nam(12<) - “Mr. Smith   ”

%udd (assuming decimal value 65 is stored in UDD 12)

%udd(12)         - “65”
%udd(12,4)       - “  65”
%udd(12,4<)      - “65  ”  
%udd(12,4,f)     - “ff65”  
%udd(12,4<,f)    - “65ff”

%clk

Minimum:           %clk      - “2009-10-16 12:59:35”
8 last characters: %clk(8)   - “12:59:35”
10 char, left :    %clk(10<) - “2009-10-16”

Free text

A free text in built-in event handler commands are written in double quotes "".

<br

Comments

The Event Handler allows line comments by prefixing the line with an exclamation mark (!).

Any line in the event handler starting with ! will not be executed. This does not support inline comments.

Note icon Comments are supported as from AlphaCom sw 13.1.3.1


Example:

IF %busy(4)
!Station 4 is busy
stop
ENDIF
!Station 4 is free
$CALL L101 L104



Escape sequences

Escape sequences can be used for two purposes:

  • to use non-printable characters in action strings
  • quoting: ignore special meaning of a character in eventhandler parser.

Some frequently used escape sequences:

\r = Carriage Return
\n = Line Feed 
\xhh = hh is any ASCII value in HEX

Some ASCII values:

\x0D = Carriage Return (CR)
\x0A = Line Feed (LF)
\x02 = Start of Text (STX)
\x03 = End of Text (ETX)
\x06 = ACK

Find more Escape sequences.