/* * This file is part of Smsq. * * Smsq is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Smsq is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Smsq; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Peter Harper * * $Id: smsq.h,v 1.1 2003/12/02 06:17:38 rmello Exp $ */ #ifndef _SMSQ_H #define _SMSQ_H #include #include "gsm0338.h" #define Version "1.3" #define DEBUG 1 /* * Queue type definitions */ #define SMSQ_SUBMIT_TYPE_ID 0 #define SMSQ_SUBMIT_TYPE_NAME "sms_sub" /* * TP masks */ #define TP_REPLY_PATH 128 #define TP_UDHI 64 #define TP_STATUS_REP 32 #define TP_VAL_PER_NONE 0 #define TP_VAL_PER_REL 16 #define TP_VAL_PER_ABS 16 | 8 #define TP_REJ_DUP 4 #define TP_TYPE_SUBMIT 1 #define DCS_CLASS0 16 | 0 #define DCS_CLASS1 16 | 1 #define DCS_CLASS2 16 | 2 #define DCS_CLASS3 16 | 3 #define DCS_DEFAULT 0 #define DCS_8BIT 4 #define DCS_UCS 8 #define DCS_RESERVED 12 /* * Queue data structures. * NB: Any changes in these data structures *MUST* be reflected in the * smsq_construct_sms_out and smsq_construct_sms_in functions. */ struct smsc_tm { int tm_sec; /* seconds */ int tm_min; /* minutes */ int tm_hour; /* hours */ int tm_mday; /* day of the month */ int tm_mon; /* month */ int tm_year; /* full year */ int tm_tz; /* timezome, relation to GMT */ }; struct smsq_sms_submit { int type_of_number; int numbering_plan_id; char dest_address[14]; char src_address[14]; int protocol_id; int data_coding_scheme; unsigned char validity_period; unsigned char tp_mask; int message_ref; int safe_stored_p; unsigned char user_data[165]; // Should be 160, but just being safe. int user_data_len; int unpacked_data_len; struct tm timestamp; struct smsc_tm smsc_timestamp; int success_callback_p; int fail_callback_p; char success_callback[128]; char fail_callback[128]; int del_attempt_count; }; /* * Function prototypes. */ extern int smsq_set_group_process_p(struct q_group *group_ptr, int can_process_p); int smsq_submit_sms(struct q_group *group_ptr, char *msg_id_ptr, int type_of_number, int numbering_plan_id, char *dest_address, char *src_address, int protocol_id, int data_coding_scheme, unsigned char validity_period, unsigned char tp_mask, int message_ref, int safe_stored_p, unsigned char *user_data, int user_data_len, int unpacked_data_len, struct smsc_tm *smsc_timestamp, char *fail_callback, char *success_callback); extern int smsq_submit_8bit(struct q_group *group_ptr, char *msg_id_ptr, char *msisdn_ptr, char *src_msisdn_ptr, unsigned char *message_ptr, int message_size, int unpacked_size, int tp_flags, int data_coding_scheme, struct smsc_tm *smsc_timestamp, char *fail_callback, char *success_callback); extern int smsq_submit_ascii(struct q_group *group_ptr, char *msg_id_ptr, char *msisdn_ptr, char *src_msisdn_ptr, char *message_ptr, struct smsc_tm *smsc_timestamp, char *fail_callback, char *success_callback); struct q_message * smsq_get_msg_and_set_status(struct q_group *group_ptr, int cur_status, int new_status); int smsq_set_msg_status(char *msg_id_ptr, struct q_group *group_ptr, int status); int smsq_group_empty_p(struct q_group *group_ptr); #endif