return;
if (p[0] < 2)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("bearer", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 2)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("hlc", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] > 8)
{
- PERROR("IE too long (%d).\n", p[0]);
+ add_trace("callid", "error", "IE too long (len=%d)", p[0]);
return;
}
return;
if (p[0] < 2)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("called_pn", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("calling_pn", "error", "IE too short (len=%d)", p[0]);
return;
}
{
if (p[0] < 2)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("calling_pn", "error", "IE too short (len=%d)", p[0]);
return;
}
*present = (p[2]&0x60) >> 5;
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);
+ add_trace("calling_pn", "number", "%s", number);
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("connect_pn", "error", "IE too short (len=%d)", p[0]);
return;
}
{
if (p[0] < 2)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("connect_pn", "error", "IE too short (len=%d)", p[0]);
return;
}
*present = (p[2]&0x60) >> 5;
return;
if (p[0] < 2)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("cause", "error", "IE too short (len=%d)", p[0]);
return;
}
}
add_trace("channel_id", "exclusive", "%d", exclusive);
- add_trace("channel_id", "channel", "%d", channel);
+ 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)
{
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("channel_id", "error", "IE too short (len=%d)", p[0]);
return;
}
if (p[1] & 0x40)
{
- PERROR("refering to channels of other interfaces is not supported.\n");
+ add_trace("channel_id", "error", "refering to channels of other interfaces is not supported");
return;
}
if (p[1] & 0x04)
{
- PERROR("using d-channel is not supported.\n");
+ add_trace("channel_id", "error", "using d-channel is not supported");
return;
}
/* BRI */
if (p[1] & 0x20)
{
- PERROR("extended channel ID with non PRI interface.\n");
+ add_trace("channel_id", "error", "extended channel ID with non PRI interface");
return;
}
*channel = p[1] & 0x03;
/* PRI */
if (p[0] < 1)
{
- PERROR("IE too short for PRI (%d).\n", p[0]);
+
+ add_trace("channel_id", "error", "IE too short for PRI (len=%d)", p[0]);
return;
}
if (!(p[1] & 0x20))
{
- PERROR("basic channel ID with PRI interface.\n");
+ add_trace("channel_id", "error", "basic channel ID with PRI interface");
return;
}
if ((p[1]&0x03) == 0x00)
}
if (p[0] < 3)
{
- PERROR("%s: ERROR: IE too short for PRI with channel(%d).\n", __FUNCTION__, p[0]);
+ add_trace("channel_id", "error", "IE too short for PRI with channel (len=%d)", p[0]);
return;
}
if (p[2] & 0x10)
{
- PERROR("channel map not supported.\n");
+ add_trace("channel_id", "error", "channel map not supported");
return;
}
*channel = p[3] & 0x7f;
if (*channel<1 | *channel==16)
{
- PERROR("PRI interface channel out of range (%d).\n", *channel);
+ add_trace("channel_id", "error", "PRI interface channel out of range (%d)", *channel);
return;
}
}
add_trace("channel_id", "exclusive", "%d", *exclusive);
- add_trace("channel_id", "channel", "%d", *channel);
+ 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;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("display", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("keypad", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("notify", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("progress", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("redir'ing", "error", "IE too short (len=%d)", p[0]);
return;
}
return;
if (p[0] < 1)
{
- PERROR("IE too short (%d).\n", p[0]);
+ add_trace("redir'tion", "error", "IE too short (len=%d)", p[0]);
return;
}
}
-/* facility for siemens CENTEX (known parts implemented only) */
-void Pdss1::enc_facility_centrex(unsigned char **ntmode, msg_t *msg, unsigned char *cnip, int setup)
-{
- unsigned char centrex[256];
- int i = 0;
-
- if (!cnip)
- return;
-
- /* centrex facility */
- centrex[i++] = CENTREX_FAC;
- centrex[i++] = CENTREX_ID;
-
- /* cnip */
- if (strlen((char *)cnip) > 15)
- {
- PDEBUG(DEBUG_PORT, "%s: CNIP/CONP text too long (max 13 chars), cutting.\n");
- cnip[15] = '\0';
- }
- // dunno what the 8 bytes mean
- if (setup)
- {
- centrex[i++] = 0x17;
- centrex[i++] = 0x02;
- centrex[i++] = 0x02;
- centrex[i++] = 0x44;
- centrex[i++] = 0x18;
- centrex[i++] = 0x02;
- centrex[i++] = 0x01;
- centrex[i++] = 0x09;
- } else
- {
- centrex[i++] = 0x18;
- centrex[i++] = 0x02;
- centrex[i++] = 0x02;
- centrex[i++] = 0x81;
- centrex[i++] = 0x09;
- centrex[i++] = 0x02;
- centrex[i++] = 0x01;
- centrex[i++] = 0x0a;
- }
-
- centrex[i++] = 0x80;
- centrex[i++] = strlen((char *)cnip);
- UCPY((char *)(¢rex[i]), (char *)cnip);
- i += strlen((char *)cnip);
- add_trace("facility", "cnip", "%s", cnip);
-
- /* encode facility */
- enc_ie_facility(ntmode, msg, centrex, i);
-}
-
void Pdss1::dec_facility_centrex(unsigned char *p, Q931_info_t *qi, unsigned char *cnip, int cnip_len)
{
unsigned char centrex[256];
UPRINT(debug+(j*3), " %02x", centrex[i+1+j]);
i++;
}
- add_trace("facility", "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];
}