CaiErr cai_err = CAI_OK;
CAI_Conversation *conversation = NULL;
CAI_CustomSign customsign;
CAI_Connection_SI connection;
CAI_Authentication authentication;
CAI_OpenType open_type;
CAI_ConversationFactory *factory = NULL;
printf("*****************************************************\n");
printf("* Creating the conversation Factory ... *\n");
printf("*****************************************************\n");
CAI_initCustomSign(&customsign);
CAI_initConnection_SI(&connection);
CAI_initAuthentication(&authentication);
CAI_initOpenType(&open_type);
/* Initialize the connection parameters */
cai_err = CAI_getConnectionInfoFromINI(iniFile, &connection);
checkErr(cai_err, "getConnectionInfoFromINI", NULL, NULL, NULL);
authentication.corporate_id = (unsigned char *) "Corpo"; /* no longer needed */
authentication.user_id = (unsigned char *) "User";
authentication.password = (unsigned char *) "Secret";
open_type.bind_host_resource = 0; /* no longer needed */
open_type.custom_sign = &customsign;
cai_err = CAI_createConversationFactory_SI(&connection, &authentication, &factory);
checkErr(cai_err, "createConversationFactory", NULL, &factory, NULL);
printf("*****************************************************\n");
printf("* Opening a conversation from the Factory ... *\n");
printf("*****************************************************\n");
cai_err = CAI_openConversationFromFactory(factory, &open_type, &conversation);
checkErr(cai_err, "openConversationFromFactory", &conversation, &factory, NULL);
|