PegCount dialogs;
PegCount ignoreChannels;
PegCount ignoreSessions;
- PegCount requests[NUM_OF_REQUEST_TYPES];
- PegCount responses[NUM_OF_RESPONSE_TYPES];
+ PegCount requests; // [NUM_OF_REQUEST_TYPES]; // FIXIT-L support this
+ PegCount responses; // [NUM_OF_RESPONSE_TYPES]; // FIXIT-L support this
};
extern THREAD_LOCAL SIP_Stats sip_stats;
}
methodFlag = sipMsg->methodFlag;
+#if 1
+ sip_stats.requests++;
+#else
sip_stats.requests[TOTAL_REQUESTS]++;
if (methodFlag > 0)
sip_stats.requests[methodFlag]++;
+#endif
switch (methodFlag)
{
case SIP_METHOD_INVITE:
assert (NULL != sipMsg);
statusType = sipMsg->status_code / 100;
+#if 1
+ sip_stats.responses++;
+#else
sip_stats.responses[TOTAL_RESPONSES]++;
if (statusType < NUM_OF_RESPONSE_TYPES)
sip_stats.responses[statusType]++;
+#endif
if (NULL == dialog)
return false;
THREAD_LOCAL SIP_Stats sip_stats;
-const PegInfo sip_pegs[] =
+static const PegInfo sip_pegs[] =
{
{ "sessions", "total sessions" },
{ "events", "events generated" },
{ "dialogs", "total dialogs" },
- { "ignoreChannels", "total channels ignored" },
- { "ignoreSessions", "total sessions ignored" },
+ { "ignored channels", "total channels ignored" },
+ { "ignored sessions", "total sessions ignored" },
{ "requests", "total requests" },
{ "responses", "total responses" },
{ nullptr, nullptr }
{ return sip_pegs; }
PegCount* SipModule::get_counts() const
-{ return (PegCount*)&sipstats; }
+{ return (PegCount*)&sip_stats; }
ProfileStats* SipModule::get_profile() const
{ return &sipPerfStats; }
********************************************************************/
static int sip_find_linebreak(const char* start, char* end, char** lineEnd)
{
- int numCRLF;
- char* s = (char*)start;
+ int numCRLF = 0;
*lineEnd = NULL;
- numCRLF = 0;
+
if (start >= end)
- return 0;
+ return numCRLF;
+
+ char* s = (char*)start;
while ((s < end) && !('\r' ==*s || '\n' == *s))
{
}
if (s == end)
- return 0;
+ return numCRLF;
s++;
numCRLF = 1;
char* next;
char* start;
int numOfLineBreaks;
+
+#ifdef DEBUG_MSGS
length = end - buff;
DEBUG_WRAP(DebugMessage(DEBUG_SIP, "Body length: %d\n", length); );
DEBUG_WRAP(DebugMessage(DEBUG_SIP, "Body line: %.*s\n", length, buff); );
+#endif
// Initialize it
*bodyEnd = end;