Actions

Difference between revisions of "External Data Input"

From Zenitel Wiki

Line 64: Line 64:
 
*disconnect,101,103
 
*disconnect,101,103
 
:-Generates internal <br\>command $C L101 <br\>and $C L103
 
:-Generates internal <br\>command $C L101 <br\>and $C L103
 +
 +
EDI - External Data Input (3).jpg

Revision as of 14:44, 3 July 2007

Event description

Event Owner: EDI Text Config
Event type: External Data Input
Sub-Event: 1 – 4: specifies which EDI port. 0: matches all ports
When Change to ON: When valid data is received on EDI port
When Change to OFF: N/A
When Related to: N/A
  • Input message
- The EDI port is defined in the ‘Serial Ports’ Setup
- The input message must have a termination character. Max 128 char.
- Parsing the content is done in the action string
  • Context parameters
- %edi is the input text where termination character is excluded
- %sev is the EDI port (sub-event)
  • Operator macros
- %scutc(string,start-pos,lenght)
  • Extract substring by byte (character) position
  • Example: %scutc(0123456789,2,3) returns 234
  • Example: %scutc(%edi,4,3) returns 3 characters from the input string, starting from char 5
- %scutf(string, delimiter, field-no)
  • Extract field, fields defined by delimiter character
  • delimiter is a single char, possibly escaped. Example: Tab= \t ‘,’ = \,
  • Optionally followed by + sign to indicate that more than one delimiter character is allowed between fields
  • field-no is a integer number, counting starts from zero!
  • Example: %scutf(%edi, +,3) extract field number 3; fields separated by any number of spaces
  • Example: %scutf(%edi,\,,3)extract field number 3; fields separated by commas
- %sscan(string, search-string)
  • Scan for string, extract rest of string after first match
  • Example: If %sscan(%edi,connect) Check if text has the string “connect”
- %scmp(string1,string2)

Compare strings. Return “1” if equal, empty string if not

  • Temporary variables
-Temporary variables (strings), numbered 0 to 9
-Lives only within the action string
-Set temporary variable: TMP 0 "<string>"
-Read temporary variable: %tmp(0)
  • The rules below will allow you to issue commands to EDI port like this:
  • connect,101,103
-Generates internal <br\>command $CALL <br\>L101 L103
  • disconnect,101,103
-Generates internal <br\>command $C L101 <br\>and $C L103

EDI - External Data Input (3).jpg