OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
5-12
Opening a Session
Using the Gateway Password
The gateway password protects the GPI gateway from unauthorized use. If a password
has been configured for the GATEWAY object, you must specify the password in
gateway-password; otherwise, the GPI service does not establish a session with the
OSI/MHS MTA.
Using the Gateway Instance Name
The GPI service maintains but does not use the gateway instance name. You can use
the name as a label for logging, tracing, or archiving purposes.
Using the Session Identifier
The session identifier is generated by the GPI service. You use the session identifier to
specify the session when calling the following GPI procedures:
Using the Local Environment
The environment object contains attributes that represent the ADMD name and country
name configured for the local MTA. It can also contain an optional attribute that
represents a PRMD identifier. When the GPI service creates certain classes of objects
with defaults, the environment object attributes are inserted automatically.
The environment object is returned by GPI_OPEN_ for use by the client program.
Generally speaking, the client program can use the object’s attributes in two ways:
•
To insert into objects of certain classes that have not been created with default
attributes
•
To determine whether or not an object originated at the local MTA
Note that the client program cannot modify any of the attributes of the environment
object or gain access to the object after the session ends.
Example: Opening a Session
The following TAL example shows a call to GPI_OPEN_ . Several of the parameters
are defined with initial values. Note that the values for gateway-name and
gateway-instance-name are padded with trailing blanks to 32 characters.
Data declarations:
INT
status, -- STATUS code
session, -- Session identifier
GPI_CLOSE_ GPI_OM_CREATE_
GPI_OM_COPY_ GPI_MT_WAIT_
GPI_MT_FINISH_TRANSFER_IN_ GPI_MT_TRANSFER_OUT_
GPI_MT_START_TRANSFER_IN_