Add Estonian tone zone (bug #3589)
[asterisk/asterisk.git] / muted.c
diff --git a/muted.c b/muted.c
index a039fb4..28f3e04 100755 (executable)
--- a/muted.c
+++ b/muted.c
@@ -3,7 +3,7 @@
  *
  * Specially written for Malcolm Davenport, but I think I'll use it too
  *
- * Copyright (C) 2004, Digium Inc.
+ * Copyright (C)  2004 - 2005, Digium Inc.
  *
  * Mark Spencer <markster@digium.com>
  *
@@ -535,8 +535,16 @@ int main(int argc, char *argv[])
        if (needfork)
                daemon(0,0);
        for(;;) {
-               if (wait_event())
-                       exit(1);
+               if (wait_event()) {
+                       fclose(astf);
+                       while(connect_asterisk()) {
+                               sleep(5);
+                       }
+                       if (login_asterisk()) {
+                               fclose(astf);
+                               exit(1);
+                       }
+               }
        }
        exit(0);
 }