50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/*
|
|
* 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)
|
|
*/
|
|
#include "mmsc.h"
|
|
|
|
|
|
static long qthread = -1;
|
|
|
|
static int rstop = 0; /* Set to 1 to stop relay. */
|
|
|
|
int mmsrelay()
|
|
{
|
|
|
|
info(0, " " MM_NAME " MMSC Relay version %s starting", MMSC_VERSION);
|
|
|
|
/* Start global queue runner. */
|
|
info(0, "Starting Global Queue Runner...");
|
|
qthread = gwthread_create((gwthread_func_t *)mbuni_global_queue_runner, &rstop);
|
|
|
|
/* Start the local queue runner. */
|
|
info(0, "Starting Local Queue Runner...");
|
|
mbuni_mm1_queue_runner(&rstop);
|
|
|
|
gwthread_join(qthread); /* Wait for it to die... */
|
|
info(0, "MMSC Relay MM1 queue runner terminates...");
|
|
return 0;
|
|
|
|
}
|
|
|
|
int stop_mmsrelay(void)
|
|
{
|
|
rstop = 1;
|
|
info(0, "Mmsrelay: Queue runners shutdown, cleanup commenced...");
|
|
return 0;
|
|
};
|
|
|
|
|
|
|
|
|
|
|