1 /* 2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX 3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO 4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A 5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS 6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS 7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE 8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE 9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS 10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. 11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. 12 */ 13 14 15 16 #ifndef _XTAPI_H 17 #define _XTAPI_H 18 19 #include "comm.h" 20 21 // Error Codes ---------------------------------------------------------------- 22 23 #define XTAPI_SUCCESS 0 24 #define XTAPI_GENERAL_ERR -1 25 #define XTAPI_BUSY -2 26 #define XTAPI_NODEVICES -3 27 #define XTAPI_INCOMPATIBLE_VERSION -4 28 #define XTAPI_OUT_OF_MEMORY -5 29 #define XTAPI_OUT_OF_RESOURCES -6 30 #define XTAPI_NOT_SUPPORTED -7 31 #define XTAPI_APPCONFLICT -8 32 #define XTAPI_NOTLOCKED -9 33 #define XTAPI_NOTOPEN -10 34 #define XTAPI_FAIL -127 35 36 37 // Device Types --------------------------------------------------------------- 38 39 #define XTAPI_MODEM_DEVICE 1 40 41 42 // XTAPI messages ------------------------------------------------------------- 43 44 #define XTAPI_LINE_IDLE 1 45 #define XTAPI_LINE_DIALTONE 2 46 #define XTAPI_LINE_DIALING 3 47 #define XTAPI_LINE_RINGBACK 4 48 #define XTAPI_LINE_BUSY 5 49 #define XTAPI_LINE_FEEDBACK 6 // failed to connect. phone company stuff 50 #define XTAPI_LINE_CONNECTED 7 51 #define XTAPI_LINE_DISCONNECTED 8 52 #define XTAPI_LINE_PROCEEDING 9 53 #define XTAPI_LINE_RINGING 10 54 #define XTAPI_LINE_UNDEFINED 127 55 56 57 // Data structures ------------------------------------------------------------ 58 59 typedef struct tagTapiDevice { 60 uint id; 61 uint type; 62 uint apiver; 63 uint min_baud; 64 uint max_baud; 65 } TapiDevice; 66 67 68 // Functions ------------------------------------------------------------------ 69 70 int xtapi_init(char *appname, int *numdevs); 71 int xtapi_shutdown(); 72 int xtapi_enumdevices(TapiDevice *dev, int num); 73 int xtapi_lock(TapiDevice *dev); 74 int xtapi_unlock(TapiDevice *dev); 75 76 int xtapi_device_dialout(char *phonenum); 77 int xtapi_device_dialin(); 78 int xtapi_device_answer(); 79 int xtapi_device_poll_callstate(uint *state); 80 int xtapi_device_create_comm_object(COMM_OBJ *commobj); 81 int xtapi_device_hangup(); 82 83 #endif 84