2005-04-14 14:45:48 +00:00
|
|
|
/*
|
|
|
|
* Mbuni - Open Source MMS Gateway
|
|
|
|
*
|
|
|
|
* MMS Relay, implements message routing
|
|
|
|
*
|
|
|
|
* 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)
|
|
|
|
*/
|
2008-09-01 15:18:43 +00:00
|
|
|
#include "mmsc.h"
|
2005-04-14 14:45:48 +00:00
|
|
|
|
|
|
|
|
2008-09-01 15:18:43 +00:00
|
|
|
static long qthread = -1;
|
2005-04-14 14:45:48 +00:00
|
|
|
|
2005-04-15 08:21:23 +00:00
|
|
|
static int rstop = 0; /* Set to 1 to stop relay. */
|
2005-04-14 14:45:48 +00:00
|
|
|
|
2008-09-01 15:18:43 +00:00
|
|
|
int mmsrelay()
|
2007-08-29 10:14:45 +00:00
|
|
|
{
|
2005-04-14 14:45:48 +00:00
|
|
|
|
2005-04-18 04:16:15 +00:00
|
|
|
info(0, " " MM_NAME " MMSC Relay version %s starting", MMSC_VERSION);
|
2005-04-14 14:45:48 +00:00
|
|
|
|
|
|
|
/* Start global queue runner. */
|
|
|
|
info(0, "Starting Global Queue Runner...");
|
2005-04-15 08:21:23 +00:00
|
|
|
qthread = gwthread_create((gwthread_func_t *)mbuni_global_queue_runner, &rstop);
|
2008-09-01 15:18:43 +00:00
|
|
|
|
2005-04-14 14:45:48 +00:00
|
|
|
/* Start the local queue runner. */
|
|
|
|
info(0, "Starting Local Queue Runner...");
|
2005-04-15 08:21:23 +00:00
|
|
|
mbuni_mm1_queue_runner(&rstop);
|
2005-04-14 14:45:48 +00:00
|
|
|
|
2008-07-10 09:46:58 +00:00
|
|
|
gwthread_join(qthread); /* Wait for it to die... */
|
2008-09-01 15:18:43 +00:00
|
|
|
info(0, "MMSC Relay MM1 queue runner terminates...");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
2008-07-10 09:46:58 +00:00
|
|
|
|
2008-09-01 15:18:43 +00:00
|
|
|
int stop_mmsrelay(void)
|
|
|
|
{
|
|
|
|
rstop = 1;
|
|
|
|
info(0, "Mmsrelay: Queue runners shutdown, cleanup commenced...");
|
2005-04-14 14:45:48 +00:00
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-01 15:18:43 +00:00
|
|
|
|