OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
B-15
descriptor_list[] =
{
MH_T_ADMD_NAME, OM_S_PRINTABLE_STRING,{ 11 , "POSTMASTER1"
},
MH_T_COUNTRY_NAME, OM_S_PRINTABLE_STRING,{ 2 , "US" },
MH_T_PRMD_IDENTIFIER, OM_S_PRINTABLE_STRING,{ 11 , "DEVELOPMENT"
},
MH_T_ACTION, OM_S_ENUMERATION, { MH_AC_RELAYED },
/********************************************************************/
/* WARNING!! */
/* The MH_T_ARRIVAL_TIME should be set to the current time */
/* or a time in the future to keep the message from being */
/* non-delivered due to timeout of the message. The null */
/* value below works since the message is being looped back */
/* to the originator. The UTC time string formats are as */
/* follows: */
/* */
/* YYMMDDHHMMZ Year Month Day Hour Minute followed by the */
/* letter 'Z', use Greenwich Mean Time (GMT). */
/* YYMMDDHHMMSSZ as above with optional seconds, */
/* use Greenwich Mean Time (GMT). */
/* YYMMDDHHMMSS-HHMM string can end with + or - HHMM for time */
/* zone deviation from GMT time */
/* use local-time where */
/* local-time +/- deviation = GMT */
/********************************************************************/
MH_T_ARRIVAL_TIME, OM_S_UTC_TIME_STRING, { 0 , "\0" }
};
printf (" Create the object\n");
local_rc = GPI_OM_CREATE_ ( MH_C_EXTERNAL_TRACE_ENTRY,
OM_FALSE, /* Without defined initial */
/* values */
&local_object,
root_id, /* Root object identifier */
); /* Session not necessary */
if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
{
if ( local_rc == ZGPI_RC_WARNING )
printf (" WARNING! number: %d \n", local_rc );
printf (" Insert all required attributes\n");
local_rc = GPI_OM_INSERT_ ( local_object,
IGNORED_FOR_SINGLE_VALUED_ATT,
descriptor_list,
descriptor_count);
if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
{
if ( local_rc == ZGPI_RC_WARNING )
printf (" WARNING! number: %d \n", local_rc );
printf (" Insert the object into the root
object\n");
descriptor_count = 1;
descriptor_list[0].type = MH_T_EXTERNAL_TRACE_INFO;
descriptor_list[0].syntax = OM_S_OBJECT;
descriptor_list[0].value.object.padding = 0;
descriptor_list[0].value.object.object = local_object;
local_rc = GPI_OM_INSERT_ ( root_id, /* Root object */
IGNORED_FOR_SINGLE_VALUED_ATT,