00001 /* 00002 * $Id: sms_funcs.h 4585 2008-08-06 08:20:30Z klaus_darilion $ 00003 * 00004 * Copyright (C) 2001-2003 FhG Fokus 00005 * 00006 * This file is part of Kamailio, a free SIP server. 00007 * 00008 * Kamailio is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version 00012 * 00013 * Kamailio is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 00024 #ifndef _SMS_FUNCS_H 00025 #define _SMS_FUNCS_H 00026 00027 #include "../../parser/msg_parser.h" 00028 #include "../../str.h" 00029 #include <termios.h> 00030 #include "../tm/tm_load.h" 00031 00032 00033 #define MAX_MODEMS 5 /* max number of modems */ 00034 #define MAX_NETWORKS 5 /* max number of networks */ 00035 00036 #define MAX_CHAR_BUF 128 /* max length of character buffer */ 00037 #define MAX_CONFIG_PARAM 1024 /* max length of a config parameter */ 00038 #define MAX_SMS_LENGTH 160 00039 #define MAX_SMS_PARTS 4 /* maximum number of parts for a sms */ 00040 #define MAX_QUEUED_MESSAGES 100 /* maximum nr of messages waiting to send */ 00041 00042 #define SMS_HDR_BF_ADDR "From " 00043 #define SMS_HDR_BF_ADDR_LEN (sizeof(SMS_HDR_BF_ADDR)-1) 00044 #define SMS_HDR_AF_ADDR " (if you reply DO NOT remove it)\r\n\r\n" 00045 #define SMS_HDR_AF_ADDR_LEN (sizeof(SMS_HDR_AF_ADDR)-1) 00046 #define SMS_FOOTER "\r\n\r\n[Kamailio.ORG]" 00047 #define SMS_FOOTER_LEN (sizeof(SMS_FOOTER)-1) 00048 #define SMS_EDGE_PART "( / )" 00049 #define SMS_EDGE_PART_LEN (sizeof(SMS_EDGE_PART)-1) 00050 #define SMS_TRUNCATED "(truncated)" 00051 #define SMS_TRUNCATED_LEN (sizeof(SMS_TRUNCATED)-1) 00052 00053 #define TIME_LEN 8 /* xx-xx-xx */ 00054 #define DATE_LEN TIME_LEN 00055 00056 #define NO_REPORT 0 00057 #define SMS_REPORT 1 00058 #define CDS_REPORT 2 00059 00060 struct network { 00061 char name[MAX_CHAR_BUF+1]; 00062 int max_sms_per_call; 00063 int pipe_out; 00064 }; 00065 00066 struct modem { 00067 char name[MAX_CHAR_BUF+1]; 00068 char device[MAX_CHAR_BUF+1]; 00069 char pin[MAX_CHAR_BUF+1]; 00070 char smsc[MAX_CHAR_BUF+1]; 00071 int net_list[MAX_NETWORKS]; 00072 struct termios oldtio; 00073 int mode; 00074 int retry; 00075 int looping_interval; 00076 int fd; 00077 int baudrate; 00078 }; 00079 00080 struct sms_msg { 00081 str text; 00082 str to; 00083 str from; 00084 int ref; 00085 }; 00086 00087 struct incame_sms { 00088 char sender[31]; 00089 char name[64]; 00090 char date[DATE_LEN]; 00091 char time[TIME_LEN]; 00092 char ascii[500]; 00093 char smsc[31]; 00094 int userdatalength; 00095 int is_statusreport; 00096 int sms_id; 00097 }; 00098 00099 00100 extern struct modem modems[MAX_MODEMS]; 00101 extern struct network networks[MAX_NETWORKS]; 00102 extern int net_pipes_in[MAX_NETWORKS]; 00103 extern int nr_of_networks; 00104 extern int nr_of_modems; 00105 extern int max_sms_parts; 00106 extern str domain; 00107 extern int *queued_msgs; 00108 extern int use_contact; 00109 extern int sms_report_type; 00110 extern struct tm_binds tmb; 00111 00112 void modem_process(struct modem*); 00113 int push_on_network(struct sip_msg*, int); 00114 00115 00116 #endif 00117
1.5.6