Fixes in current Version
- Changed isdninfo to misdn_info.
+- Fixed some trace bugs.
}
if (ifmsn)
{
- start_trace(0, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, DIRECTION_IN, 0, 0, "SCREEN (found in MSN list)");
+ start_trace(-1, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, DIRECTION_IN, 0, 0, "SCREEN (found in MSN list)");
add_trace("msn", NULL, "%s", id);
end_trace();
}
if (!ifmsn && msn1) // not in list, first msn given
{
- start_trace(0, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, DIRECTION_IN, 0, 0, "SCREEN (not found in MSN list)");
+ start_trace(-1, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, DIRECTION_IN, 0, 0, "SCREEN (not found in MSN list)");
add_trace("msn", "given", "%s", id);
add_trace("msn", "used", "%s", msn1);
end_trace();
}
if (ifscreen) // match
{
- start_trace(0, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, out?DIRECTION_OUT:DIRECTION_IN, 0, 0, "SCREEN (found in screen list)");
+ start_trace(-1, interface, numberrize_callerinfo(id, *type, options.national, options.international), NULL, out?DIRECTION_OUT:DIRECTION_IN, 0, 0, "SCREEN (found in screen list)");
switch(*type)
{
case INFO_NTYPE_UNKNOWN:
color(white);
if (m[i].u.i.block >= 2)
{
- SPRINT(buffer, "%s (port %d: %s)%s", m[i].u.i.interface_name, m[i].u.i.portnum, m[i].u.i.portname, (m[i].u.i.extension)?" extension":"");
+ if (m[i].u.i.portnum < 0)
+ SPRINT(buffer, "%s (port ?: %s)%s", m[i].u.i.interface_name, m[i].u.i.portname, (m[i].u.i.extension)?" extension":"");
+ else
+ SPRINT(buffer, "%s (port %d: %s)%s", m[i].u.i.interface_name, m[i].u.i.portnum, m[i].u.i.portname, (m[i].u.i.extension)?" extension":"");
addstr(buffer);
color(red);
addstr(" not loaded");
memset(&msg, 0, sizeof(msg));
msg.message = ADMIN_TRACE_REQUEST;
msg.u.trace_req.detail = 3;
+ msg.u.trace_req.port = -1;
/* parse args */
i = 2;
switch(l3m->type)
{
case MPH_ACTIVATE_IND:
- l1l2l3_trace_header(mISDNport, NULL, L1_ACTIVATE_IND, DIRECTION_IN);
- end_trace();
- mISDNport->l1link = 1;
+ if (mISDNport->l1link != 1)
+ {
+ l1l2l3_trace_header(mISDNport, NULL, L1_ACTIVATE_IND, DIRECTION_IN);
+ end_trace();
+ mISDNport->l1link = 1;
+ }
break;
case MPH_DEACTIVATE_IND:
- l1l2l3_trace_header(mISDNport, NULL, L1_DEACTIVATE_IND, DIRECTION_IN);
- end_trace();
- mISDNport->l1link = 0;
+ if (mISDNport->l1link != 0)
+ {
+ l1l2l3_trace_header(mISDNport, NULL, L1_DEACTIVATE_IND, DIRECTION_IN);
+ end_trace();
+ mISDNport->l1link = 0;
+ }
break;
case MPH_INFORMATION_IND:
}
if (port == cnt)
{
- PERROR_RUNTIME("Port name '%s' no found, use 'misdn_info' tool to list all existing ports.\n", portname);
+ PERROR_RUNTIME("Port name '%s' not found, use 'misdn_info' tool to list all existing ports.\n", portname);
return(NULL);
}
// note: 'port' has still the port number
/*** main loop ***/
SPRINT(tracetext, "%s %s started, waiting for calls...", NAME, VERSION_STRING);
- start_trace(0, NULL, NULL, NULL, 0, 0, 0, tracetext);
+ start_trace(-1, NULL, NULL, NULL, 0, 0, 0, tracetext);
printf("%s\n", tracetext);
end_trace();
GET_NOW();
}
SPRINT(tracetext, "%s terminated", NAME);
printf("%s\n", tracetext);
- start_trace(0, NULL, NULL, NULL, 0, 0, 0, tracetext);
+ start_trace(-1, NULL, NULL, NULL, 0, 0, 0, tracetext);
if (quit)
add_trace((char *)"signal", NULL, "%d", quit);
end_trace();
if (b) \
{ \
SPRINT(tracetext, a, NAME); \
- start_trace(0, NULL, NULL, NULL, 0, 0, 0, tracetext); \
+ start_trace(-1, NULL, NULL, NULL, 0, 0, 0, tracetext); \
if (ret) add_trace("blocks", NULL, "%d", b); \
end_trace(); \
printf("\n******************************\n\007"); \
/* free remote joins */
if (admin->remote_name[0])
{
- start_trace(0,
+ start_trace(-1,
NULL,
NULL,
NULL,
apppbx->e_callback = 0;
apppbx->e_action = NULL;
apppbx->release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL);
- start_trace(0,
+ start_trace(-1,
NULL,
numberrize_callerinfo(apppbx->e_callerinfo.id, apppbx->e_callerinfo.ntype, options.national, options.international),
apppbx->e_dialinginfo.id,
}
/* set remote socket instance */
SCPY(admin->remote_name, msg->param.hello.application);
- start_trace(0,
+ start_trace(-1,
NULL,
NULL,
NULL,
return(NULL);
/* filter trace */
- if (port && trace.port)
+ if (port >= 0 && trace.port >= 0)
if (port != trace.port) return(NULL);
if (interface) if (interface[0] && trace.interface[0])
if (!!strcasecmp(interface, trace.interface)) return(NULL);
{
SCAT(trace_string, "------------------------------------------------------------------------------\n");
/* "Port: 1 (BRI PTMP TE)" */
- if (trace.port)
+ if (trace.port >= 0)
{
mISDNport = mISDNport_first;
while(mISDNport)
switch(detail)
{
case 1: /* brief */
- if (trace.port)
+ if (trace.port >= 0)
{
SPRINT(buffer, " port %d", trace.port);
SCAT(trace_string, buffer);
if (options.deb || options.log[0])
{
- string = print_trace(1, 0, NULL, NULL, NULL, 0);
+ string = print_trace(1, -1, NULL, NULL, NULL, 0);
if (string)
{
/* process debug */
static void vbox_trace_header(class VBoxPort *vbox, const char *message, int direction)
{
/* init trace with given values */
- start_trace(0,
+ start_trace(-1,
NULL,
vbox?numberrize_callerinfo(vbox->p_callerinfo.id, vbox->p_callerinfo.ntype, options.national, options.international):NULL,
vbox?vbox->p_dialinginfo.id:NULL,