GSM BS: Release all calls in case the connection to OpenBSC disappears
[lcr.git] / main.c
diff --git a/main.c b/main.c
index 98be1c0..b9e836c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -364,7 +364,7 @@ int main(int argc, char *argv[])
        }
 
 #if defined WITH_GSM_BS || defined WITH_GSM_MS
-       /* handle gsm */
+       /* init gsm */
        if (options.gsm && gsm_init()) {
                fprintf(stderr, "GSM initialization failed.\n");
                goto free;
@@ -469,10 +469,6 @@ int main(int argc, char *argv[])
                if (options.gsm) {
                        if (handle_gsm())
                                all_idle = 0;
-#ifdef WITH_GSM_BS
-                       if (handle_gsm_bs())
-                               all_idle = 0;
-#endif
 #ifdef WITH_GSM_MS
                        if (handle_gsm_ms())
                                all_idle = 0;
@@ -602,6 +598,10 @@ free:
 #endif
        }
 
+       /* close loopback, if used by GSM or remote */
+       if (mISDNloop.sock > -1)
+               mISDNloop_close();
+
        /* display memory leak */
 #define MEMCHECK(a, b) \
        if (b) { \