Function :
 CAI_createConversationFactory


Deprecated! see CAI_createConversationFactory_SI


 
Description


This function creates a new Conversation factory.
Conversations will later be created directly from the Conversation Factory: this process is purely local, no message is sent to the host, thus saving resources.
Once it is created, the Conversation Factory will never time out.

If the FastOpen method is used (boolean bindToHost = false), another transaction is saved each time an open is made.

 
API : Application Programming Interface

 CaiErr CAI_createConversationFactory (
	CAI_Connection  
  	CAI_Authentication 
	CAI_ConversationFactory 



*in_connection,
*in_authentication, 
**o_factory);
   

 

Field Descriptions

Parameter In/Out Description
in_connection In A pointer to a structure in which the TCP/IP parameters used for the connection to the APIv2 server are stored.
in_authentication In A pointer to a structure containing the APIv2 authentication parameters.
o_factory Out A reference to a pointer to the factory that is being created. The pointer (*o_factory) must be initialized to NULL.
 

 

Structure Definition

This structure is composed of the TCP/IP parameters used for the connection to the APIv2 server. It must be initialized with the CAI_initConnection function.
typedef struct
{
	unsigned char	*tcp_server;
	unsigned int	port_number;
} CAI_Connection;

tcp_server is the IP address of the APIv2 Server. 
port_number is the port number used in the TCP/IP connection.

 

This structure is composed of all the "classic" APIv2 authentication parameters. It must be initialized with the CAI_initAuthentication function.

corporate_id is the corporate identifier. user_id is the user identifier. password is the password of the user.
typedef struct
{
	unsigned char	*corporate_id;
	unsigned char	*user_id;
	unsigned char	*password;
} CAI_Authentication;
 

Example

 

CaiErr cai_err = CAI_OK;
CAI_CustomSign customsign;
CAI_Connection connection;
CAI_Authentication authentication;
CAI_ConversationFactory *factory = NULL;


CAI_initConnection(&connection);
CAI_initAuthentication(&authentication);

connection.tcp_server = (unsigned char *) "123.123.123.123";
connection.port_number = 12345;

authentication.corporate_id= (unsigned char *) "AMADEUS";
authentication.user_id=      (unsigned char *) "AMADEUS";
authentication.password=     (unsigned char *) "AMADEUS";

printf("Creating the conversation Factory ...\n");

cai_err = CAI_createConversationFactory(&connection,
                      &authentication,
                      &factory);