OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
5-11
Opening a Session
Opening a Session
You call the GPI_OPEN_ procedure to establish a session with the GPI service. A
session is created by linking internal processes that allow communication between the
client program and OSI/MHS MTA.
Parameters for GPI_OPEN_ are:
gateway-name (input)
gateway-instance-name (input)
session (output)
environment (output)
MHS-mgr-name (input)
MHS-mgr-name-length (input)
gateway-password (input; optional)
gateway-password-length (input; optional)
gateway-name specifies the name configured for the OSI/MHS GATEWAY object
(gateway) to which the session will connect.
gateway-instance-name specifies a name that uniquely identifies the session.
The name is used strictly for the purposes of the client program, as described later.
MHS-mgr-name specifies the name of the MHS manager that controls the MTA to
which the client will communicate. The MHS manager specified must have configured
the GATEWAY object specified by gateway-name.
MHS-mgr-name-length specifies the length (in octets) of the MHS-mgr-name
string.
gateway-password specifies the password configured as an attribute to the
GATEWAY object to which the session will connect. If no password has been
configured for the GATEWAY object, gateway-password is ignored by the GPI
service and can be omitted.
gateway-password-length specifies the length (in octets) of the gateway-
password string. If you specify gateway-password, you must specify
gateway-password-length. If you omit gateway-password, you can omit
gateway-password-length or specify a value of 0.
session is a valid session identifier that the GPI generates if the call establishes a
session successfully. If the call does not succeed, this parameter is unchanged.
environment is the object identifier of an object that represents the local
environment. If the call does not succeed, this parameter is unchanged.
Note. Because GPI_OPEN_ involves considerable internal processing, the time to complete
GPI_OPEN_ might be significantly longer than that to complete other GPI procedures.
Note. See the OSI/MHS Configuration and Management Manual for more information about
GATEWAY objects, the MHS manager process, and gateway passwords.