UDP Server Module |
Top Previous Next |
This interface allows PageGate to function as a UDP server to receive UDP packets from a variety of sources. Messages received by this API are output to a directory as a text file that is then read in by the GetASCII API.
Step 1: Create a directory for the UDP Server
1) In Windows, create a new directory for the UDP Server. This can be any folder accessible to PageGate, whether on the local hard drive or by UNC path to a network resource. However, if PageGate will need to reference a network resource, the services relevant to these processes will need permission to access it. For more information, see the services section of the documentation. We recommend creating a directory called UDP as a sub-directory of PageGate's database directory (By default, c:\PageGateData\UDP\).
2) In Windows, browse in to the PageGate program directory.
3) Move the pgudpserver.exe and pgudp.ini files to the folder you created in step 1.
Step 2: Configure the UDP Server's settings
1) The first thing we'll need to do is modify the pgudp.ini file. Open the file in notepad.
To give you a little more information, this INI file controls the behavior of the UDP Server. If you are running the evaluation version, it will stop itself every 3-5 days, and/or after 500 messages, whichever comes first.
2) Configure the port the UDP server should listen to. By default, the port is set to 5002.
3) Change the OutputFolder= value to the directory you created in step 1. By default, C:\PageGateData\UDP\
4) Change the LogFolder= value to your logging directory. If you are unsure of what this folder is, open the PageGate Admin and go to the Program - Settings section. By default, C:\PageGateData\Logs\
5) Next, we'll need to set the end of record delimiter but let's go in to what that means first. When the UDP Server is receiving information, it doesn't really know what in the data is important; it's just receiving UDP packets of data. The end of record delimiter tells the UDP server that the expressed series of characters denotes a break in the data stream.
For example, the UDP server could receive a series of 5 packets: a) This is b) a c) test message # d) This is a new e) message
If you set EndOfRecordDelimiter = #, that tells the UDP server that everything before every # received is a data block to be parsed.
Put another way, the end of record delimiter tells the UDP server how to break down the information it's receiving in to processable chunks.
It's the "over" of a CB radio conversation.
5) Below that, there are RequiredText and RequiredTextOperator values that can be set.
RequiredText specifies text that must appear for a data block to be processed and you may specify multiple values by separating each with a | (pipe).
The RequiredTextOperator specifies whether you're using OR or AND logic.
For example, let's say you specify the following: RequiredText=alarm|notification RequiredTextOperator=AND
That tells the UDP server that both the words alarm AND notification need to appear in a received data block for that data block to be treated as a message to send.
As another example: RequiredText=alarm|alert RequiredTextOperator=OR
That tells the UDP server that either the words alarm or alert need to appear in a received data block for that data block to be treated as a message to send.
6) Next we have EndOfRecordTimeout, whose value is expressed in milliseconds. This value tells the UDP server how long to wait before timeout after receiving data, to accept a data record.
By default, this is set to 3000 milliseconds or 3 seconds.
7) RejectOnTimeout determines whether timeouts should post a rejection notice or not. By default, this is set to true.
8) AcceptResponse determines what the UDP server will echo to the sending system upon acceptance of a data block.
9) RejectResponse determines what the UDP server will echo to the sending system upon rejection of a data block.
10) Last, we have two optional settins: StaticRecipient and StaticSender
StaticRecipient allows you to specify the name of a specific recipient or group in PageGate that ALL traffic from the UDP server should be passed through.
StaticSender allows you to hard code a sender's name that should be associated with ALL traffic from the UDP server.
11) Save the .ini file and close notepad.
Step 3: Run the UDP Server
1) Open a command prompt with elevated permission.
2) Change directory to the UDP Server's program directory. By default, c:\PageGateData\UDP\
3) Type the following and hit enter: pgudpserver /install
4) Exit the command prompt.
5) Open the Services list in Windows.
6) Go in to the Properties of the PageGate UDP Server service.
7) Change the Startup Type to Automatic and Start the Service.
Step 4: Configure the GetASCII API to process the UDP Server's messages
1) Go to Interfaces - GetASCII - Settings.
2) Set the 'Polling Directory' to the output folder. By default, C:\PageGateData\UDP\
3) Check Enabled.
4) Click Apply.
5) Go to Program - Settings.
6) In the 'Run on this server' section, check GetASCII
7) Click Apply.
8) If prompted for credentials, leave them blank and click Apply again.
Note: If you are already using the GetASCII module, you can use the Advanced Polling Files section to specify the UDP Server's output folder as a secondary polling location. The File(s) value will need to be set to *.asc and it is a Standard file type. |