summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorAndreas Eversberg2009-05-11 11:07:58 +0200
committerAndreas Eversberg2009-05-11 11:07:58 +0200
commit20a671d76854520ad9d5ea9d481e008240465e62 (patch)
treefbfd12696b1d31b347e85442f1e9ed37ccfda0d8 /main.c
parentApplied patch by Daniel: "execute"-action can now be performed on call init o... (diff)
downloadlcr-20a671d76854520ad9d5ea9d481e008240465e62.tar.gz
lcr-20a671d76854520ad9d5ea9d481e008240465e62.tar.xz
lcr-20a671d76854520ad9d5ea9d481e008240465e62.zip
Added GSM network support.
This turns LCR into a GSM mobile switching center. More infos will follow.
Diffstat (limited to 'main.c')
-rw-r--r--main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/main.c b/main.c
index 51da4a1..522b214 100644
--- a/main.c
+++ b/main.c
@@ -394,6 +394,21 @@ int main(int argc, char *argv[])
goto free;
}
+#ifdef WITH_GSM
+ /* handle gsm */
+ if (options.gsm && gsm_init())
+ {
+ fprintf(stderr, "GSM initialization failed.\n");
+ goto free;
+ }
+#else
+ if (options.gsm)
+ {
+ fprintf(stderr, "GSM is enabled, but not compiled. Use --with-gsm while configure!\n");
+ goto free;
+ }
+#endif
+
/* read interfaces and open ports */
if (!read_interfaces())
{
@@ -614,6 +629,15 @@ BUDETECT
all_idle = 0;
BUDETECT
+#ifdef WITH_GSM
+ /* handle gsm */
+ if (options.gsm)
+ while(handle_gsm())
+ all_idle = 0;
+#endif
+
+BUDETECT
+
#if 0
/* check for child to exit (eliminate zombies) */
if (waitpid(-1, NULL, WNOHANG) > 0)
@@ -746,6 +770,12 @@ free:
if (created_misdn)
mISDN_deinitialize();
+#ifdef WITH_GSM
+ /* free gsm */
+ if (options.gsm)
+ gsm_exit(0);
+#endif
+
/* display memory leak */
#define MEMCHECK(a, b) \
if (b) \