Processing replies with GetASCII

Top  Previous  Next

This is an example of how EMAG WCTP reply messages can be processed with the GetASCII API.

Step 1: Configure GetASCII to process the received data

1)Open PG Admin.

 

2)Expand Interfaces - GetAscii - Settings - Advanced Polling

 

3)Click Files.

 

4)Click Add.

 

5)Specify the following and click Apply:

Recipient: *

From: Leave Blank

File(s): *.asc

Path: The path to the folder webdata.exe is stored in on the web server.

Example: \\WebServer01\pgscripts\

File Type: Custom

 

 

NOTE: If you will be implementing a filtering system, you will do so at this point. For more information, please see PageGate's Filter Script documentation.

 

6)Go to Interfaces - GetAscii - Settings - Advanced Polling - Record

 

7)Specify the following and click Apply:

Start Pattern: *

Start Offset: 0

 

End Pattern: ~

End Offset: 0


 

8)Go to Interfaces - GetAscii - Settings - Advanced Polling - Recipient. This section tells PageGate where in the data to look for the recipient or group this reply should go to.

9)Select 'Dynamic Recipient' and configure the parameters.

Start Pattern: This value determines the first character in the recipient block.

Since we're working with WCTP, you could key off of senderID="Value" to auto-respond to the person that sent the message.

 

You would use senderID=" as the Start Pattern.

 

Start Offset: The number of characters in the start pattern: 10

 

End Pattern: This value determines the last character in the recipient block.

Since we're working with WCTP and are using senderID=" as the Start Pattern, you would use " as the End Pattern.

 

End Offset: The negative value of the number of characters in the End Pattern: -1


 

10) Go to Interfaces - GetAscii - Settings - Advanced Polling - Sender. This section tells PageGate where in the data to look for the sender value.

11) Select 'Static Sender' and specify a sender value.

12) Go to Interfaces - GetAscii - Settings - Advanced Polling - Message. This section tells PageGate what in the data should be considered the message and also allows for basic reformatting of messages.

13) Select 'Dynamic Message' and configure the parameters. If you want everything in the received data to be considered the message, you would use a Start Pattern of * and an End Pattern of ~ with both Offsets set to 0.

Start Pattern: <wctp-Alphanumeric>

Start Offset: 19

 

End Pattern: </wctp-Alphanumeric>

End Offset: -20


 

The lookup table enables PageGate to perform basic search and replace commands. This allows you to interchange or translate values as needed.

 

To enable this feature, check Use Lookup Table and click Edit Table.

 

For more information, please see the lookup table section of the documentation.