Translating Messages Using a Translation DLL

At some point during processing of incoming or outgoing messages, the gateway must call the message translation framework to translate the message to the appropriate format. Typically this happens after the gateway determines that it can in fact process the message. Most gateways do some minimal verification of the input message, such as determining that it can parse the destination addresses, before calling the translation framework. If it determines that it cannot process a message, a gateway can reject the message and return an error report without ever calling the translation framework.

The gateway program calls the translation framework using the functions shown in the following table.

Function Action When called
HrConvInitGlobals Initializes common data areas. When the gateway starts.
HrConvInitInstance Creates a new instance of the translation framework. Each instance is single-threaded. Multiple instances can be used in separate threads. When new thread is created to perform translations.
HrConvConvert Performs a conversion. When each message is translated.
HrConvUninitInstance Disposes of a previously allocated translation framework instance. When a translation thread exits.

If HrConvConvert returns an error, or the gateway cannot otherwise convert the message, it should return a non-delivery report to the sender.