}
if (complete)
- printisdn(" complete=%d\n", complete);
-
- if (complete)
{
+ add_trace("complete", NULL, NULL);
p = msg_put(msg, 1);
if (p_m_d_ntmode)
{
*complete = 1;
if (*complete)
- printisdn(" complete=%d\n", *complete);
+ add_trace("complete", NULL, NULL);
}
multi = -1;
}
- printisdn(" coding=%d capability=%d mode=%d rate=%d multi=%d user=%d\n", coding, capability, mode, rate, multi, user);
+ add_trace("bearer", "coding", "%d", coding);
+ add_trace("bearer", "capability", "%d", capability);
+ add_trace("bearer", "mode", "%d", mode);
+ add_trace("bearer", "rate", "%d", rate);
+ add_trace("bearer", "multi", "%d", multi);
+ add_trace("bearer", "user", "%d", user);
l = 2 + (multi>=0) + (user>=0);
p = msg_put(msg, l+2);
*user = p[3] & 0x1f;
}
- printisdn(" coding=%d capability=%d mode=%d rate=%d multi=%d user=%d\n", *coding, *capability, *mode, *rate, *multi, *user);
+ add_trace("bearer", "coding", "%d", *coding);
+ add_trace("bearer", "capability", "%d", *capability);
+ add_trace("bearer", "mode", "%d", *mode);
+ add_trace("bearer", "rate", "%d", *rate);
+ add_trace("bearer", "multi", "%d", *multi);
+ add_trace("bearer", "user", "%d", *user);
}
return;
}
- printisdn(" coding=%d interpretation=%d presentation=%d hlc=%d exthlc=%d\n", coding, interpretation, presentation, hlc, exthlc);
+ add_trace("hlc", "coding", "%d", coding);
+ add_trace("hlc", "interpretation", "%d", interpretation);
+ add_trace("hlc", "presentation", "%d", presentation);
+ add_trace("hlc", "hlc", "%d", hlc);
+ if (exthlc >= 0)
+ add_trace("hlc", "exthlc", "%d", exthlc);
l = 2 + (exthlc>=0);
p = msg_put(msg, l+2);
*exthlc = p[3] & 0x7f;
}
- printisdn(" coding=%d interpretation=%d presentation=%d hlc=%d exthlc=%d\n", *coding, *interpretation, *presentation, *hlc, *exthlc);
+ add_trace("hlc", "coding", "%d", *coding);
+ add_trace("hlc", "interpretation", "%d", *interpretation);
+ add_trace("hlc", "presentation", "%d", *presentation);
+ add_trace("hlc", "hlc", "%d", *hlc);
+ if (*exthlc >= 0)
+ add_trace("hlc", "exthlc", "%d", *exthlc);
}
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
int l;
- char debug[25];
+ char buffer[25];
int i;
if (!callid || callid_len<=0)
{
return;
}
- if (callid_len>8)
+ if (callid_len > 8)
{
PERROR("callid_len(%d) is out of range.\n", callid_len);
return;
i = 0;
while(i < callid_len)
{
- UPRINT(debug+(i*3), " %02x", callid[i]);
+ UPRINT(buffer+(i*3), " %02x", callid[i]);
i++;
}
- printisdn(" callid%s\n", debug);
+ add_trace("callid", NULL, "%s", buffer[0]?buffer+1:"<none>");
l = callid_len;
p = msg_put(msg, l+2);
void Pdss1::dec_ie_call_id(unsigned char *p, Q931_info_t *qi, unsigned char *callid, int *callid_len)
{
- char debug[25];
+ char buffer[25];
int i;
*callid_len = -1;
i = 0;
while(i < *callid_len)
{
- UPRINT(debug+(i*3), " %02x", callid[i]);
+ UPRINT(buffer+(i*3), " %02x", callid[i]);
i++;
}
- printisdn(" callid%s\n", debug);
+ add_trace("callid", NULL, "%s", buffer[0]?buffer+1:"<none>");
}
return;
}
- printisdn(" type=%d plan=%d number='%s'\n", type, plan, number);
+ add_trace("called_pn", "type", "%d", type);
+ add_trace("called_pn", "plan", "%d", plan);
+ add_trace("called_pn", "number", "%s", number);
l = 1+strlen((char *)number);
p = msg_put(msg, l+2);
*plan = p[1] & 0xf;
strnncpy(number, p+2, p[0]-1, number_len);
- printisdn(" type=%d plan=%d number='%s'\n", *type, *plan, number);
+ add_trace("called_pn", "type", "%d", *type);
+ add_trace("called_pn", "plan", "%d", *plan);
+ add_trace("called_pn", "number", "%s", number);
}
return;
}
- printisdn(" type=%d plan=%d present=%d screen=%d number='%s'\n", type, plan, present, screen, number);
+ add_trace("calling_pn", "type", "%d", type);
+ add_trace("calling_pn", "plan", "%d", plan);
+ add_trace("calling_pn", "present", "%d", present);
+ add_trace("calling_pn", "screen", "%d", screen);
+ add_trace("calling_pn", "number", "%s", number);
l = 1;
if (number) if (number[0])
strnncpy(number, p+2, p[0]-1, number_len);
}
- printisdn(" type=%d plan=%d present=%d screen=%d number='%s'\n", *type, *plan, *present, *screen, number);
+ add_trace("calling_pn", "type", "%d", *type);
+ add_trace("calling_pn", "plan", "%d", *plan);
+ add_trace("calling_pn", "present", "%d", *present);
+ add_trace("calling_pn", "screen", "%d", *screen);
+ add_trace("calling_pn", "number", "%s", number);
}
return;
}
- printisdn(" type=%d plan=%d present=%d screen=%d number='%s'\n", type, plan, present, screen, number);
+ add_trace("connect_pn", "type", "%d", type);
+ add_trace("connect_pn", "plan", "%d", plan);
+ add_trace("connect_pn", "present", "%d", present);
+ add_trace("connect_pn", "screen", "%d", screen);
+ add_trace("connect_pn", "number", "%s", number);
l = 1;
if (number) if (number[0])
strnncpy(number, p+2, p[0]-1, number_len);
}
- printisdn(" type=%d plan=%d present=%d screen=%d number='%s'\n", *type, *plan, *present, *screen, number);
+ add_trace("connect_pn", "type", "%d", *type);
+ add_trace("connect_pn", "plan", "%d", *plan);
+ add_trace("connect_pn", "present", "%d", *present);
+ add_trace("connect_pn", "screen", "%d", *screen);
+ add_trace("connect_pn", "number", "%s", number);
}
return;
}
- printisdn(" location=%d cause=%d\n", location, cause);
+ add_trace("cause", "location", "%d", location);
+ add_trace("cause", "value", "%d", cause);
l = 2;
p = msg_put(msg, l+2);
*location = p[1] & 0x0f;
*cause = p[2] & 0x7f;
- printisdn(" location=%d cause=%d\n", *location, *cause);
+ add_trace("cause", "location", "%d", *location);
+ add_trace("cause", "value", "%d", *cause);
}
return;
}
- printisdn(" exclusive=%d channel=%d\n", exclusive, channel);
+ add_trace("channel_id", "exclusive", "%d", exclusive);
+ switch(channel)
+ {
+ case CHANNEL_ANY:
+ add_trace("channel_id", "channel", "any channel");
+ break;
+ case CHANNEL_NO:
+ add_trace("channel_id", "channel", "no channel");
+ break;
+ default:
+ add_trace("channel_id", "channel", "%d", channel);
+ }
if (!pri)
{
}
}
- printisdn(" exclusive=%d channel=%d\n", *exclusive, *channel);
+ add_trace("channel_id", "exclusive", "%d", *exclusive);
+ switch(*channel)
+ {
+ case CHANNEL_ANY:
+ add_trace("channel_id", "channel", "any channel");
+ break;
+ case CHANNEL_NO:
+ add_trace("channel_id", "channel", "no channel");
+ break;
+ default:
+ add_trace("channel_id", "channel", "%d", *channel);
+ }
}
return;
}
- printisdn(" year=%d month=%d day=%d hour=%d minute=%d second=%d\n", tm->tm_year%100, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
+ add_trace("date", "day", "%d.%d.%d", tm->tm_mday, tm->tm_mon+1, tm->tm_year%100);
+ add_trace("date", "time", "%d:%d:%d", tm->tm_hour, tm->tm_min, tm->tm_sec);
l = 5 + (!no_seconds);
p = msg_put(msg, l+2);
display[80] = '\0';
}
- printisdn(" display='%s' (len=%d)\n", display, strlen((char *)display));
+ add_trace("display", NULL, "%s", display);
l = strlen((char *)display);
p = msg_put(msg, l+2);
strnncpy(display, p+1, p[0], display_len);
- printisdn(" display='%s'\n", display);
+ add_trace("display", NULL, "%s", display);
}
return;
}
- printisdn(" keypad='%s'\n", keypad);
+ add_trace("keypad", NULL, "%s", keypad);
l = strlen((char *)keypad);
p = msg_put(msg, l+2);
strnncpy(keypad, p+1, p[0], keypad_len);
- printisdn(" keypad='%s'\n", keypad);
+ add_trace("keypad", NULL, "%s", keypad);
}
return;
}
- printisdn(" notify=%d\n", notify);
+ add_trace("notify", NULL, "%d", notify);
l = 1;
p = msg_put(msg, l+2);
*notify = p[1] & 0x7f;
- printisdn(" notify=%d\n", *notify);
+ add_trace("notify", NULL, "%d", *notify);
}
return;
}
- printisdn(" coding=%d location=%d progress=%d\n", coding, location, progress);
+ add_trace("progress", "codeing", "%d", coding);
+ add_trace("progress", "location", "%d", location);
+ add_trace("progress", "indicator", "%d", progress);
l = 2;
p = msg_put(msg, l+2);
*location = p[1] & 0x0f;
*progress = p[2] & 0x7f;
- printisdn(" coding=%d location=%d progress=%d\n", *coding, *location, *progress);
+ add_trace("progress", "codeing", "%d", *coding);
+ add_trace("progress", "location", "%d", *location);
+ add_trace("progress", "indicator", "%d", *progress);
}
return;
}
- printisdn(" type=%d plan=%d present=%d screen=%d readon=%d number='%s'\n", type, plan, present, screen, reason, number);
+ add_trace("redir'ing", "type", "%d", type);
+ add_trace("redir'ing", "plan", "%d", plan);
+ add_trace("redir'ing", "present", "%d", present);
+ add_trace("redir'ing", "screen", "%d", screen);
+ add_trace("redir'ing", "reason", "%d", reason);
+ add_trace("redir'ing", "number", "%s", number);
l = 1;
if (number)
strnncpy(number, p+2, p[0]-1, number_len);
}
- printisdn(" type=%d plan=%d present=%d screen=%d reason=%d number='%s'\n", *type, *plan, *present, *screen, *reason, number);
+ add_trace("redir'ing", "type", "%d", *type);
+ add_trace("redir'ing", "plan", "%d", *plan);
+ add_trace("redir'ing", "present", "%d", *present);
+ add_trace("redir'ing", "screen", "%d", *screen);
+ add_trace("redir'ing", "reason", "%d", *reason);
+ add_trace("redir'ing", "number", "%s", number);
}
return;
}
- printisdn(" type=%d plan=%d present=%d number='%s'\n", type, plan, present, number);
+ add_trace("redir'tion", "type", "%d", type);
+ add_trace("redir'tion", "plan", "%d", plan);
+ add_trace("redir'tion", "present", "%d", present);
+ add_trace("redir'tion", "number", "%s", number);
l = 1;
if (number)
strnncpy(number, p+2, p[0]-1, number_len);
}
- printisdn(" type=%d plan=%d present=%d number='%s'\n", *type, *plan, *present, number);
+ add_trace("redir'tion", "type", "%d", *type);
+ add_trace("redir'tion", "plan", "%d", *plan);
+ add_trace("redir'tion", "present", "%d", *present);
+ add_trace("redir'tion", "number", "%s", number);
}
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
int l;
- char debug[768];
+ char buffer[768];
int i;
if (!facility || facility_len<=0)
i = 0;
while(i < facility_len)
{
- UPRINT(debug+(i*3), " %02x", facility[i]);
+ UPRINT(buffer+(i*3), " %02x", facility[i]);
i++;
}
- printisdn(" facility%s\n", debug);
+ add_trace("facility", NULL, "%s", buffer+1);
l = facility_len;
p = msg_put(msg, l+2);
}
debug[i*3] = '\0';
- printisdn(" facility%s\n", debug);
+ add_trace("facility", NULL, "%s", debug[0]?debug+1:"<none>");
}
centrex[i++] = strlen((char *)cnip);
UCPY((char *)(¢rex[i]), (char *)cnip);
i += strlen((char *)cnip);
- printisdn(" cnip='%s'\n", cnip);
+ add_trace("facility", "cnip", "%s", cnip);
/* encode facility */
enc_ie_facility(ntmode, msg, centrex, i);
{
case 0x80:
strnncpy(cnip, ¢rex[i+2], centrex[i+1], cnip_len);
- printisdn(" CENTREX cnip='%s'\n", cnip);
+ add_trace("facility", "cnip", "%s", cnip);
break;
default:
UPRINT(debug+(j*3), " %02x", centrex[i+1+j]);
i++;
}
- printisdn(" CENTREX unknown=0x%2x len=%d%s\n", centrex[i], centrex[i+1], debug);
+ add_trace("facility", "CENTREX", "unknown=0x%02x len=%d%s\n", centrex[i], centrex[i+1], debug);
}
i += 1+centrex[i+1];
}
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
int l;
- char debug[768];
+ char buffer[768];
int i;
if (protocol<0 || protocol>127)
i = 0;
while(i < user_len)
{
- UPRINT(debug+(i*3), " %02x", user[i]);
+ UPRINT(buffer+(i*3), " %02x", user[i]);
i++;
}
- printisdn(" protocol=%d user-user%s\n", protocol, debug);
+ add_trace("useruser", "protocol", "%d", protocol);
+ add_trace("useruser", "value", "%s", buffer);
l = user_len;
p = msg_put(msg, l+3);
void Pdss1::dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, unsigned char *user, int *user_len)
{
- char debug[768];
+ char buffer[768];
int i;
*user_len = 0;
i = 0;
while(i < *user_len)
{
- UPRINT(debug+(i*3), " %02x", user[i]);
+ UPRINT(buffer+(i*3), " %02x", user[i]);
i++;
}
- debug[i*3] = '\0';
+ buffer[i*3] = '\0';
- printisdn(" protocol=%d user-user%s\n", *protocol, debug);
+ add_trace("useruser", "protocol", "%d", *protocol);
+ add_trace("useruser", "value", "%s", buffer);
}