Index: gw/bb_smscconn.c
===================================================================
RCS file: /home/cvs/gateway/gw/bb_smscconn.c,v
retrieving revision 1.101
diff -a -u -r1.101 bb_smscconn.c
--- gw/bb_smscconn.c	6 May 2009 18:47:34 -0000	1.101
+++ gw/bb_smscconn.c	9 Jun 2009 17:20:13 -0000
@@ -131,7 +131,7 @@
 static regex_t *white_list_regex;
 static regex_t *black_list_regex;
 
-static long router_thread = -1;
+extern long router_thread;
 
 /* message resend */
 static long sms_resend_frequency;
@@ -586,6 +586,22 @@
  *
  */
 
+void start_router()
+{
+    int i, len = gwlist_len(smsc_list);
+    SMSCConn *conn;
+
+    for (i = 0; i < len; i++)
+    {
+        conn = gwlist_get(smsc_list, i);
+        if (!(conn->status == SMSCCONN_ACTIVE &&
+              octstr_str_compare(conn->name, "FAKE") == 0))
+              return;
+    }
+    if ((router_thread = gwthread_create(sms_router, NULL)) == -1)
+        panic(0, "Failed to start a new thread for SMS routing");
+}
+
 int smsc2_start(Cfg *cfg)
 {
     CfgGroup *grp;
Index: gw/bearerbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/bearerbox.c,v
retrieving revision 1.169
diff -a -u -r1.169 bearerbox.c
--- gw/bearerbox.c	12 Jan 2009 16:46:56 -0000	1.169
+++ gw/bearerbox.c	9 Jun 2009 17:20:14 -0000
@@ -140,6 +140,8 @@
 static time_t start_time;
 volatile sig_atomic_t restart = 0;
 
+/* Outgoing sms router */
+long router_thread = -1;
 
 /* to avoid copied code */
 
@@ -639,7 +641,6 @@
         info(0, "Gateway is now ISOLATED by startup arguments");
         gwlist_remove_producer(suspended);
     } else {
-        smsc2_resume();
         gwlist_remove_producer(suspended);	
         gwlist_remove_producer(isolated);
     }
@@ -657,6 +658,9 @@
         gwthread_sleep(10.0);
         /* debug("bb", 0, "Main Thread: woken up."); */
 
+        if (router_thread < 0 && bb_status != BB_ISOLATED)
+           start_router();
+
         if (bb_todo == 0) {
             continue;
         }
