84 lines
2.8 KiB
C
84 lines
2.8 KiB
C
/*
|
|
* Mbuni - Open Source MMS Gateway
|
|
*
|
|
* MMSBOX CFG: MMC configuration and misc. functions
|
|
*
|
|
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
|
*
|
|
* 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"
|
|
|
|
typedef struct MmscGrp {
|
|
Octstr *id; /* MMSC id (for logging). */
|
|
Octstr *mmsc_url; /* URL at which MMSC can be reached. */
|
|
struct {
|
|
Octstr *user, *pass;
|
|
Octstr *allow_ip;
|
|
Octstr *deny_ip;
|
|
long port;
|
|
} incoming; /* user, pass, port (and whether SSL) that MMSC uses to connect to us. */
|
|
Octstr *allowed_prefix, *denied_prefix;
|
|
enum {UNKNOWN_MMSC, SOAP_MMSC, EAIF_MMSC} type; /* type of connection. */
|
|
long throughput; /* Max send rate. */
|
|
long threadid; /* handler thread. */
|
|
|
|
Mutex *mutex;
|
|
} MmscGrp;
|
|
|
|
typedef struct MmsServiceUrlParam {
|
|
Octstr *name;
|
|
enum {NO_PART, AUDIO_PART, IMAGE_PART, VIDEO_PART,
|
|
TEXT_PART, SMIL_PART , OTHER_PART,
|
|
ANY_PART, WHOLE_BINARY} type;
|
|
Octstr *value; /* for generic value (type == NO_PART),
|
|
* or for value that follows spec (e.g. %Tisatest is allowed) */
|
|
} MmsServiceUrlParam;
|
|
|
|
typedef struct MmsService {
|
|
Octstr *name; /* name of service. */
|
|
int isdefault;
|
|
int omitempty;
|
|
int accept_x_headers;
|
|
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;
|
|
Octstr *url; /* The value. */
|
|
List *params; /* of MmsServiceUrlParam */
|
|
|
|
Octstr *faked_sender;
|
|
List *allowed_mmscs; /* List of MMSCs allowed to access this service (by ID). */
|
|
List *denied_mmscs; /* List of MMSCs allowed to access this service (by ID). */
|
|
} MmsService;
|
|
|
|
typedef struct SendMmsUser {
|
|
Octstr *user, *pass;
|
|
Octstr *faked_sender;
|
|
Octstr *dlr_url, *rr_url;
|
|
} SendMmsUser;
|
|
|
|
/* Basic settings for the mmsbox. */
|
|
extern List *sendmms_users; /* list of SendMmsUser structs */
|
|
extern List *mms_services; /* list of MMS Services */
|
|
extern List *mmscs; /* MMSC list. Perhaps turn into a Dict instead? */
|
|
extern Octstr *incoming_qdir, *outgoing_qdir, *dlr_dir;
|
|
extern Octstr *unified_prefix;
|
|
extern long mmsbox_maxsendattempts, mmsbox_send_back_off;
|
|
extern long maxthreads;
|
|
extern double queue_interval;
|
|
extern struct SendMmsPortInfo {
|
|
long port; /* Might be ssl-ed. */
|
|
Octstr *allow_ip;
|
|
Octstr *deny_ip;
|
|
} sendmms_port;
|
|
|
|
|
|
extern int mms_load_mmsbox_settings(Cfg *cfg, gwthread_func_t *mmsc_handler_func);
|
|
#endif
|