fix and work
[lcr.git] / chan_lcr.c
index 16bb96a..fa37ef6 100644 (file)
@@ -447,6 +447,7 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
                        CDEBUG(call, ast, "Got 'sending complete', but extension '%s' will not match at context '%s' - releasing.\n", ast->exten, ast->context);
                        cause = 1;
                        goto release;
+               }
                if (!ast_exists_extension(ast, ast->context, ast->exten, 1, call->oad))
                {
                        CDEBUG(call, ast, "Got 'sending complete', but extension '%s' would match at context '%s', if more digits would be dialed - releasing.\n", ast->exten, ast->context);
@@ -748,12 +749,13 @@ static void lcr_in_release(struct chan_call *call, int message_type, union param
  */
 static void lcr_in_information(struct chan_call *call, int message_type, union parameter *param)
 {
+       struct ast_channel *ast = call->ast;
        struct ast_frame fr;
        char *p;
 
        CDEBUG(call, call->ast, "Incomming information from LCR. (dialing=%d)\n", param->information.id);
        
-       if (!call->ast) return;
+       if (!ast) return;
 
        /* pbx not started */
        if (!call->pbx_started)
@@ -1649,7 +1651,7 @@ enum ast_bridge_result lcr_bridge(struct ast_channel *ast1,
        struct ast_frame        *f;
        int                     bridge_id;
 
-       CDEBUG(NULL, ast, "Received briding request from Asterisk.\n");
+       CDEBUG(NULL, NULL, "Received briding request from Asterisk.\n");
        
        /* join via dsp (if the channels are currently open) */
        ast_mutex_lock(&chan_lock);
@@ -1676,7 +1678,7 @@ enum ast_bridge_result lcr_bridge(struct ast_channel *ast1,
                who = ast_waitfor_n(carr, 2, &to);
 
                if (!who) {
-                       CDEBUG(NULL, ast, "Empty read on bridge, breaking out.\n");
+                       CDEBUG(NULL, NULL, "Empty read on bridge, breaking out.\n");
                        break;
                }
                f = ast_read(who);
@@ -1704,7 +1706,7 @@ enum ast_bridge_result lcr_bridge(struct ast_channel *ast1,
     
        }
        
-       CDEBUG(NULL, ast, "Releasing bride.\n");
+       CDEBUG(NULL, NULL, "Releasing bride.\n");
 
        /* split channels */
        ast_mutex_lock(&chan_lock);
@@ -1851,9 +1853,9 @@ int load_module(void)
 {
        int i;
 
-       for (i = 0, i < 256, i++)
+       for (i = 0; i < 256; i++)
                flip_bits[i] = (i>>7) | ((i>>5)&2) | ((i>>3)&4) | ((i>>1)&8)
-                         || = (i<<7) | ((i&2)<<5) | ((i&4)<<3) | ((i&8)<<1);
+                           || (i<<7) | ((i&2)<<5) | ((i&4)<<3) | ((i&8)<<1);
 
        ast_mutex_init(&chan_lock);
        ast_mutex_init(&log_lock);
@@ -1944,7 +1946,7 @@ int unload_module(void)
        return 0;
 }
 
-static int reload_module(void)
+int reload_module(void)
 {
 //     reload_config();
        return 0;
@@ -1978,12 +1980,4 @@ char *key(void)
        return ASTERISK_GPL_KEY;
 }
 
-#define AST_MODULE "chan_lcr"
-AST_MODULE_INFO(ASTERISK_GPL_KEY,
-                                AST_MODFLAG_DEFAULT,
-                                "Channel driver for LCR",
-                                .load = load_module,
-                                .unload = unload_module,
-                                .reload = reload_module,
-                           );