fixed trace bug
authorSuper User <root@isdn.jolly.ten>
Thu, 24 Jul 2008 16:24:20 +0000 (18:24 +0200)
committerSuper User <root@isdn.jolly.ten>
Thu, 24 Jul 2008 16:24:20 +0000 (18:24 +0200)
added ast_setstate after pbx_start()
modified:   chan_lcr.c
modified:   mISDN.cpp
modified:   trace.h

chan_lcr.c
mISDN.cpp
trace.h

index 2790cf4..7eabe0e 100644 (file)
@@ -690,6 +690,7 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
 
                /* change state */
                call->state = CHAN_LCR_STATE_IN_PROCEEDING;
 
                /* change state */
                call->state = CHAN_LCR_STATE_IN_PROCEEDING;
+               ast_setstate(ast, AST_STATE_OFFHOOK);
 
                goto start;
        }
 
                goto start;
        }
@@ -704,6 +705,7 @@ static void lcr_start_pbx(struct chan_call *call, struct ast_channel *ast, int c
 
                /* change state */
                call->state = CHAN_LCR_STATE_IN_DIALING;
 
                /* change state */
                call->state = CHAN_LCR_STATE_IN_DIALING;
+               ast_setstate(ast, AST_STATE_OFFHOOK);
 
                /* if match, start pbx */
                if (ast_exists_extension(ast, ast->context, ast->exten, 1, call->oad)) {
 
                /* if match, start pbx */
                if (ast_exists_extension(ast, ast->context, ast->exten, 1, call->oad)) {
index e8a71cc..df550ae 100644 (file)
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -2001,9 +2001,9 @@ int mISDN_handler(void)
                                break;
 
                                case MT_L2RELEASE:
                                break;
 
                                case MT_L2RELEASE:
-                               l1l2l3_trace_header(mISDNport, NULL, L2_RELEASE_IND, DIRECTION_IN);
                                if (!mISDNport->l2establish)
                                {
                                if (!mISDNport->l2establish)
                                {
+                                       l1l2l3_trace_header(mISDNport, NULL, L2_RELEASE_IND, DIRECTION_IN);
                                        add_trace("tei", NULL, "%d", l3m->pid);
                                        end_trace();
                                }
                                        add_trace("tei", NULL, "%d", l3m->pid);
                                        end_trace();
                                }
diff --git a/trace.h b/trace.h
index c0fcab0..4c82fa4 100644 (file)
--- a/trace.h
+++ b/trace.h
@@ -133,9 +133,9 @@ struct trace {
 //#define CATEGORY_BC  0x04 check lcradmin help
 
 
 //#define CATEGORY_BC  0x04 check lcradmin help
 
 
-#define start_trace(port, interface, caller, dialing, direction, category, serial, name) _start_trace(__FUNCTION__, __LINE__, port, interface, caller, dialing, direction, category, serial, name)
-#define add_trace(name, sub, fmt, arg...) _add_trace(__FUNCTION__, __LINE__, name, sub, fmt, ## arg)
-#define end_trace() _end_trace(__FUNCTION__, __LINE__)
+#define start_trace(port, interface, caller, dialing, direction, category, serial, name) _start_trace(__FILE__, __LINE__, port, interface, caller, dialing, direction, category, serial, name)
+#define add_trace(name, sub, fmt, arg...) _add_trace(__FILE__, __LINE__, name, sub, fmt, ## arg)
+#define end_trace() _end_trace(__FILE__, __LINE__)
 void _start_trace(const char *__file, int line, int port, struct interface *interface, char *caller, char *dialing, int direction, int category, int serial, char *name);
 void _add_trace(const char *__file, int line, char *name, char *sub, const char *fmt, ...);
 void _end_trace(const char *__file, int line);
 void _start_trace(const char *__file, int line, int port, struct interface *interface, char *caller, char *dialing, int direction, int category, int serial, char *name);
 void _add_trace(const char *__file, int line, char *name, char *sub, const char *fmt, ...);
 void _end_trace(const char *__file, int line);