Diffstat (limited to 'gammu/emb/gammu/smsd/smsdcore.h') (more/less context) (show whitespace changes)
-rw-r--r-- | gammu/emb/gammu/smsd/smsdcore.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gammu/emb/gammu/smsd/smsdcore.h b/gammu/emb/gammu/smsd/smsdcore.h index 23e402e..17ffe58 100644 --- a/gammu/emb/gammu/smsd/smsdcore.h +++ b/gammu/emb/gammu/smsd/smsdcore.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* (c) 2002-2003 by Marcin Wiacek and Joergen Thomsen */ | 1 | /* (c) 2002-2004 by Marcin Wiacek and Joergen Thomsen */ |
2 | 2 | ||
3 | #include "../../cfg/config.h" | 3 | #include "../../cfg/config.h" |
4 | #undef HAVE_MYSQL_MYSQL_H | 4 | |
5 | #ifdef HAVE_MYSQL_MYSQL_H | 5 | #ifdef HAVE_MYSQL_MYSQL_H |
6 | #ifdef WIN32 | 6 | #ifdef WIN32 |
7 | # include <mysql.h> | 7 | # include <mysql.h> |
8 | # include <mysqld_error.h> | 8 | # include <mysqld_error.h> |
9 | #else | 9 | #else |
10 | # include <mysql/mysql.h> | 10 | # include <mysql/mysql.h> |
@@ -21,37 +21,54 @@ void SMSDaemon (int argc, char *argv[]); | |||
21 | GSM_Error SMSDaemonSendSMS(char *service, char *filename, GSM_MultiSMSMessage *sms); | 21 | GSM_Error SMSDaemonSendSMS(char *service, char *filename, GSM_MultiSMSMessage *sms); |
22 | 22 | ||
23 | typedef struct { | 23 | typedef struct { |
24 | /* general options */ | 24 | /* general options */ |
25 | INI_Entry *IncludeNumbers, *ExcludeNumbers; | 25 | INI_Entry *IncludeNumbers, *ExcludeNumbers; |
26 | unsigned int commtimeout, sendtimeout, receivefrequency; | 26 | unsigned int commtimeout, sendtimeout, receivefrequency; |
27 | unsigned intresetfrequency; | ||
27 | unsigned char *deliveryreport, *logfilename, *PINCode; | 28 | unsigned char *deliveryreport, *logfilename, *PINCode; |
29 | unsigned char*PhoneID; | ||
28 | 30 | ||
29 | /* options for FILES */ | 31 | /* options for FILES */ |
30 | unsigned char *inboxpath, *outboxpath, *sentsmspath; | 32 | unsigned char *inboxpath, *outboxpath, *sentsmspath; |
31 | unsigned char *errorsmspath, *inboxformat, *transmitformat; | 33 | unsigned char *errorsmspath, *inboxformat, *transmitformat; |
32 | 34 | ||
33 | /* options for MYSQL */ | 35 | /* options for MYSQL */ |
34 | unsigned char *database, *user, *password; | 36 | unsigned char *database, *user, *password; |
35 | unsigned char*PC; | 37 | unsigned char *PC, *skipsmscnumber; |
36 | 38 | ||
37 | /* private variables required for work */ | 39 | /* private variables required for work */ |
38 | unsigned int retries; | 40 | int relativevalidity; |
41 | unsigned int retries, currdeliveryreport; | ||
39 | unsigned char SMSID[200], prevSMSID[200]; | 42 | unsigned char SMSID[200], prevSMSID[200]; |
43 | GSM_SMSCSMSC; | ||
40 | #ifdef HAVE_MYSQL_MYSQL_H | 44 | #ifdef HAVE_MYSQL_MYSQL_H |
41 | MYSQL DB; char DT[20]; | 45 | MYSQL DB; char DT[20]; |
42 | #endif | 46 | #endif |
43 | } GSM_SMSDConfig; | 47 | } GSM_SMSDConfig; |
44 | 48 | ||
49 | typedef enum { | ||
50 | SMSD_SEND_OK = 1, | ||
51 | SMSD_SEND_SENDING_ERROR, | ||
52 | SMSD_SEND_DELIVERY_PENDING, | ||
53 | SMSD_SEND_DELIVERY_FAILED, | ||
54 | SMSD_SEND_DELIVERY_OK, | ||
55 | SMSD_SEND_DELIVERY_UNKNOWN, | ||
56 | SMSD_SEND_ERROR | ||
57 | } GSM_SMSDSendingError; | ||
58 | |||
45 | typedef struct { | 59 | typedef struct { |
46 | GSM_Error (*Init) (GSM_SMSDConfig *Config); | 60 | GSM_Error (*Init) (GSM_SMSDConfig *Config); |
61 | GSM_Error(*InitAfterConnect) (GSM_SMSDConfig *Config); | ||
47 | GSM_Error(*SaveInboxSMS) (GSM_MultiSMSMessage sms, GSM_SMSDConfig *Config); | 62 | GSM_Error(*SaveInboxSMS) (GSM_MultiSMSMessage sms, GSM_SMSDConfig *Config); |
48 | GSM_Error(*FindOutboxSMS) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, unsigned char *ID); | 63 | GSM_Error(*FindOutboxSMS) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, unsigned char *ID); |
49 | GSM_Error (*MoveSMS) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, unsigned char *ID, bool alwaysDelete, bool sent); | 64 | GSM_Error (*MoveSMS) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, unsigned char *ID, bool alwaysDelete, bool sent); |
50 | GSM_Error(*CreateOutboxSMS) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config); | 65 | GSM_Error(*CreateOutboxSMS) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config); |
51 | GSM_Error(*AddSentSMSInfo) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, unsigned char *ID, int Part, bool OK); | 66 | GSM_Error(*AddSentSMSInfo) (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, unsigned char *ID, int Part, GSM_SMSDSendingError err, int TPMR); |
67 | GSM_Error(*RefreshSendStatus) (GSM_SMSDConfig *Config, unsigned char *ID); | ||
68 | GSM_Error(*RefreshPhoneStatus) (GSM_SMSDConfig *Config); | ||
52 | } GSM_SMSDService; | 69 | } GSM_SMSDService; |
53 | 70 | ||
54 | #ifdef __GNUC__ | 71 | #ifdef __GNUC__ |
55 | __attribute__((format(printf, 1, 2))) | 72 | __attribute__((format(printf, 1, 2))) |
56 | #endif | 73 | #endif |
57 | void WriteSMSDLog(char *format, ...); | 74 | void WriteSMSDLog(char *format, ...); |