SI Migration
available starting proxy v.29.0



Using the Conversation Factory for SI migration


The conversation factory will be used as the entry point for SI migration while initiating a conversation via the CAI_createConversationFactory_SI new function provided.

This function is equivalent to the common CAI_createConversationFactory but uses a new CAI_Connection_SI input structure in order to be able to provide several {IP, endpoints} values .
Also custom sign-in parameters (such as office, duty-code, ...) will eventually have to be provided at openConversation time. It is recommended to store the connection (and sign-in) parameters in a .ini and in this respect a .ini parsing API is provided in the proxy to automatically fill connection and sign-in structures.

There will be 2 phases for this migration:


First phase - Updating to SI factory

For this first phase it is only required to implement the use of CAI_createConversationFactory_SI (thus use the CAI_Connection_SI input structure).
Note: A .INI file use is recommended for connection parameters and API parsing functions are provided (see later section ".INI file handling").

A logical scenario from a Local User Application to open a conversation from the SI factory, request information, and close a conversation follows.
We are here hilighting the differences with a common scenario:

CAI_Connection_SI myCnx;
CAI_CustomSign myCustomSign;

CAI_Authentication myAuth;
CAI_OpenType open_type;


CAI_initOpenType(&open_type);
CAI_initCustomSign(&myCustomsign);

CAI_initAuthentication(&myAuth);
myAuth.corporate_id= (unsigned char *) corpid;
myAuth.user_id=(unsigned char *) userid;
myAuth.password=(unsigned char *) password;

cai_err = CAI_getConnectionInfoFromINI(iniFile,&myCnx);

cai_err = CAI_getCustomSignInfoFromINI(iniFile,"Office1",&myCustomSign);

/*Note: here possible modification of the customSign structure for changePOS users*/

open_type.custom_sign = &myCustomSign;

cai_err =  CAI_createConversationFactory_SI(&myCnx, &myAuth,&factory);
cai_err = CAI_openConversationFromFactory(factory,&open_type,&conversation);
...
closeConversation(Conversation_handle)
It is possible to perform transactions in parallel using several conversations.

Note: The retrieve of custom sign-in parameters here is not required for the first phase.
Indeed the .INI for first phase does not need to contain any custom-sign information. The CAI_getCustomSignInfoFromINI function simply does not fill any field of the CAI_CustomSign structure. However in preparation for the final phase, it could be added to avoid updating the application.

Caution for "CustomSign" users: The CAI_getCustomSignInfoFromINI function first calls CAI_initCustomSign and thus reset all its content to 0. Be sure to call it before any manual modification of the CAI_CustomSign structure.

 
Final phase - Providing custom sign-in parameters

The final phase is not ready yet on Amadeus' side.
We released these functions so that APIv2 customers have time to migrate their application to the new functions.


INI file handling with API Functions

There should be two different types of information in the .INI file:
  • Connection parameters
  • Custom sign-in parameters (it will be used in the final phase)
    Available functions are thus:

  • CAI_getConnectionInfoFromINI(char * ini_name, CAI_Connection_SI *myCnx);
    Parses a .ini configuration file and loads data into a CAI_Connection_SI structure

  • CAI_displayConnectionInfo(CAI_Connection_SI *myCnx);

  • CAI_getCustomSignInfoFromINI(char * ini_name,char * label, CAI_CustomSign *myCustomSign);
    Parses a .ini configuration file and loads data into a CAI_CustomSign structure.
    Note: The label parameter allows to organise several 'CAI_CustomSign's in a hierarchical (tree-like) manner in one .ini file. (label is usually the office)

  • CAI_displayCustomSignInfo(CAI_CustomSign *myCustomSign);


INI file samples

.INI file sample:

# This is an example of ini file for APIv2 Gateway Connections
# to the Amadeus test system.

# TCP/IP Connection information

[CAI_Connection_SI]
tcp_connection_type = 0        ; type 0 connection to Gateway
tcp_connection_nb = 1

[CAI_Connection0]
tcp_server = 195.27.163.89
port_number = 20002

# Custom sign information (empty)

[CAI_CustomSign]