2005-09-02 11:41:28 +00:00
|
|
|
/*
|
|
|
|
* Mbuni - Open Source MMS Gateway
|
|
|
|
*
|
|
|
|
* MMSBOX CFG: MMC configuration and misc. functions
|
|
|
|
*
|
2007-09-19 13:06:26 +00:00
|
|
|
* Copyright (C) 2003 - 2007, Digital Solutions Ltd. - http://www.dsmagic.com
|
2005-09-02 11:41:28 +00:00
|
|
|
*
|
|
|
|
* Paul Bagyenda <bagyenda@dsmagic.com>
|
|
|
|
*
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
|
|
|
*/
|
|
|
|
#ifndef __MMSBOX_CFG_INCLUDED__
|
|
|
|
#define __MMSBOX_CFG_INCLUDED__
|
|
|
|
#include "mms_util.h"
|
2007-07-17 08:26:38 +00:00
|
|
|
#include "mmsbox_mt_filter.h"
|
2007-08-20 11:49:30 +00:00
|
|
|
#include "mms_queue.h"
|
2007-09-17 13:07:30 +00:00
|
|
|
#include "mmsbox_resolve.h"
|
2007-08-20 11:49:30 +00:00
|
|
|
|
2007-09-19 13:06:26 +00:00
|
|
|
#include "mmsbox_mmsc.h"
|
|
|
|
|
2005-09-02 11:41:28 +00:00
|
|
|
typedef struct MmscGrp {
|
|
|
|
Octstr *id; /* MMSC id (for logging). */
|
2007-04-02 05:29:00 +00:00
|
|
|
Octstr *group_id; /* GROUP MMSC id (used for qf). */
|
2005-09-02 11:41:28 +00:00
|
|
|
Octstr *mmsc_url; /* URL at which MMSC can be reached. */
|
|
|
|
struct {
|
|
|
|
Octstr *user, *pass;
|
2005-09-07 10:10:41 +00:00
|
|
|
Octstr *allow_ip;
|
|
|
|
Octstr *deny_ip;
|
2005-09-02 11:41:28 +00:00
|
|
|
long port;
|
|
|
|
} incoming; /* user, pass, port (and whether SSL) that MMSC uses to connect to us. */
|
2005-09-07 10:10:41 +00:00
|
|
|
Octstr *allowed_prefix, *denied_prefix;
|
2007-12-15 08:40:22 +00:00
|
|
|
Octstr *allowed_sender_prefix, *denied_sender_prefix;
|
2007-09-19 13:06:26 +00:00
|
|
|
enum {UNKNOWN_MMSC = -1, CUSTOM_MMSC, SOAP_MMSC, EAIF_MMSC} type; /* type of connection. */
|
2008-02-14 14:46:21 +00:00
|
|
|
double throughput; /* Max send rate. */
|
2005-09-02 11:41:28 +00:00
|
|
|
long threadid; /* handler thread. */
|
2005-09-07 10:10:41 +00:00
|
|
|
|
2007-08-27 10:16:26 +00:00
|
|
|
int reroute; /* whether messages from this mmsc are re-routed outwards. */
|
|
|
|
Octstr *reroute_mmsc_id;
|
2007-11-07 07:53:29 +00:00
|
|
|
|
|
|
|
int reroute_mod_subject; /* Set to true if we'll change subject line on reroute. */
|
2007-04-10 09:56:46 +00:00
|
|
|
MM7Version_t ver; /* supported MM7/SOAP version. */
|
2007-07-17 08:26:38 +00:00
|
|
|
int use_mt_filter; /* whether to use MT filter on this connection. */
|
2005-09-07 10:10:41 +00:00
|
|
|
Mutex *mutex;
|
2007-09-19 13:06:26 +00:00
|
|
|
|
|
|
|
MmsBoxMmscFuncs *fns; /* pointer to functions for handling this mmsc connection type */
|
|
|
|
Octstr *settings; /* settings for the above module. */
|
|
|
|
void *data; /* data for above module. */
|
|
|
|
int custom_started; /* set to 1 if custom mmc started. */
|
2005-09-02 11:41:28 +00:00
|
|
|
} MmscGrp;
|
|
|
|
|
|
|
|
typedef struct MmsServiceUrlParam {
|
|
|
|
Octstr *name;
|
2005-09-15 07:57:56 +00:00
|
|
|
enum {NO_PART, AUDIO_PART, IMAGE_PART, VIDEO_PART,
|
2005-09-02 11:41:28 +00:00
|
|
|
TEXT_PART, SMIL_PART , OTHER_PART,
|
2007-07-09 16:43:42 +00:00
|
|
|
ANY_PART, WHOLE_BINARY, KEYWORD_PART} type;
|
2005-09-02 11:41:28 +00:00
|
|
|
Octstr *value; /* for generic value (type == NO_PART),
|
2007-05-09 11:14:21 +00:00
|
|
|
* or for value that follows spec (e.g. %Tisatest is allowed)
|
|
|
|
*/
|
2005-09-02 11:41:28 +00:00
|
|
|
} MmsServiceUrlParam;
|
|
|
|
|
|
|
|
typedef struct MmsService {
|
|
|
|
Octstr *name; /* name of service. */
|
|
|
|
int isdefault;
|
|
|
|
int omitempty;
|
2006-05-03 13:52:40 +00:00
|
|
|
int noreply;
|
2005-09-02 11:41:28 +00:00
|
|
|
int accept_x_headers;
|
2006-05-03 13:52:40 +00:00
|
|
|
List *passthro_headers;
|
|
|
|
|
2005-09-02 11:41:28 +00:00
|
|
|
int assume_plain_text;
|
|
|
|
List *keywords; /* List of keywords matched. */
|
|
|
|
enum {TRANS_TYPE_GET_URL, TRANS_TYPE_POST_URL, TRANS_TYPE_FILE, TRANS_TYPE_EXEC,
|
|
|
|
TRANS_TYPE_TEXT} type;
|
2005-09-07 10:10:41 +00:00
|
|
|
Octstr *url; /* The value. */
|
2005-09-02 11:41:28 +00:00
|
|
|
List *params; /* of MmsServiceUrlParam */
|
|
|
|
|
|
|
|
Octstr *faked_sender;
|
|
|
|
List *allowed_mmscs; /* List of MMSCs allowed to access this service (by ID). */
|
2006-08-11 10:05:46 +00:00
|
|
|
List *denied_mmscs; /* List of MMSCs allowed to access this service (by ID). */
|
|
|
|
Octstr *service_code; /* Service code (MM7/SOAP only) */
|
2007-12-15 08:40:22 +00:00
|
|
|
|
|
|
|
Octstr *allowed_receiver_prefix, *denied_receiver_prefix;
|
2005-09-02 11:41:28 +00:00
|
|
|
} MmsService;
|
|
|
|
|
|
|
|
typedef struct SendMmsUser {
|
|
|
|
Octstr *user, *pass;
|
|
|
|
Octstr *faked_sender;
|
2005-09-07 10:10:41 +00:00
|
|
|
Octstr *dlr_url, *rr_url;
|
2005-09-02 11:41:28 +00:00
|
|
|
} SendMmsUser;
|
|
|
|
|
|
|
|
/* Basic settings for the mmsbox. */
|
|
|
|
extern List *sendmms_users; /* list of SendMmsUser structs */
|
|
|
|
extern List *mms_services; /* list of MMS Services */
|
2005-09-07 10:10:41 +00:00
|
|
|
extern List *mmscs; /* MMSC list. Perhaps turn into a Dict instead? */
|
|
|
|
extern Octstr *incoming_qdir, *outgoing_qdir, *dlr_dir;
|
|
|
|
extern Octstr *unified_prefix;
|
2007-09-17 13:07:30 +00:00
|
|
|
extern long mmsbox_maxsendattempts, mmsbox_send_back_off, default_msgexpiry;
|
2005-09-09 13:11:38 +00:00
|
|
|
extern long maxthreads;
|
|
|
|
extern double queue_interval;
|
2005-09-02 11:41:28 +00:00
|
|
|
extern struct SendMmsPortInfo {
|
|
|
|
long port; /* Might be ssl-ed. */
|
|
|
|
Octstr *allow_ip;
|
|
|
|
Octstr *deny_ip;
|
|
|
|
} sendmms_port;
|
|
|
|
|
2007-07-17 08:26:38 +00:00
|
|
|
extern struct MmsBoxMTfilter *mt_filter;
|
2007-08-20 11:49:30 +00:00
|
|
|
extern MmsQueueHandlerFuncs *qfs;
|
2007-07-19 19:45:24 +00:00
|
|
|
extern int mt_multipart;
|
2007-09-17 13:07:30 +00:00
|
|
|
|
|
|
|
extern MmsBoxResolverFuncStruct *rfs; /* resolver functions. */
|
|
|
|
extern void *rfs_data;
|
|
|
|
extern Octstr *rfs_settings;
|
|
|
|
|
|
|
|
|
2006-02-17 11:48:33 +00:00
|
|
|
extern int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func);
|
2007-12-15 08:40:22 +00:00
|
|
|
extern MmscGrp *get_handler_mmc(Octstr *id, Octstr *to, Octstr *from);
|
2007-09-17 13:07:30 +00:00
|
|
|
|
|
|
|
extern Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m,
|
|
|
|
Octstr **mmc_id);
|
2005-09-02 11:41:28 +00:00
|
|
|
#endif
|