This commit is contained in:
parent
0650def87d
commit
bf51f8effe
@ -215,24 +215,24 @@ DEBUGC(DBCLASS_PLUGIN,"sort: i1=%i, i=%i", i1, i2);
|
|||||||
// sort by (1)client-id, (2)call-id, (3)stream number
|
// sort by (1)client-id, (2)call-id, (3)stream number
|
||||||
|
|
||||||
// check client-id
|
// check client-id
|
||||||
sts = memcmp(&rtp_proxytable[i1].client_id,
|
sts = strncmp(rtp_proxytable[i1].client_id.idstring,
|
||||||
&rtp_proxytable[i2].client_id,
|
rtp_proxytable[i2].client_id.idstring,
|
||||||
sizeof(client_id_t));
|
CLIENT_ID_SIZE);
|
||||||
DEBUGC(DBCLASS_PLUGIN,"sort: memcmp client_id=%i", sts);
|
DEBUGC(DBCLASS_PLUGIN,"sort: strncmp client_id=%i", sts);
|
||||||
if (sts != 0) return sts;
|
if (sts != 0) return sts;
|
||||||
|
|
||||||
// check call-id host
|
// check call-id host
|
||||||
sts = memcmp(&rtp_proxytable[i1].callid_host,
|
sts = strncmp(rtp_proxytable[i1].callid_host,
|
||||||
&rtp_proxytable[i2].callid_host,
|
rtp_proxytable[i2].callid_host,
|
||||||
CALLIDHOST_SIZE);
|
CALLIDHOST_SIZE);
|
||||||
DEBUGC(DBCLASS_PLUGIN,"sort: memcmp callid_host=%i", sts);
|
DEBUGC(DBCLASS_PLUGIN,"sort: strncmp callid_host=%i", sts);
|
||||||
if (sts != 0) return sts;
|
if (sts != 0) return sts;
|
||||||
|
|
||||||
// check call-id number
|
// check call-id number
|
||||||
sts = memcmp(&rtp_proxytable[i1].callid_number,
|
sts = strncmp(rtp_proxytable[i1].callid_number,
|
||||||
&rtp_proxytable[i2].callid_number,
|
rtp_proxytable[i2].callid_number,
|
||||||
CALLIDNUM_SIZE);
|
CALLIDNUM_SIZE);
|
||||||
DEBUGC(DBCLASS_PLUGIN,"sort: memcmp callid_number=%i", sts);
|
DEBUGC(DBCLASS_PLUGIN,"sort: strncmp callid_number=%i", sts);
|
||||||
if (sts != 0) return sts;
|
if (sts != 0) return sts;
|
||||||
|
|
||||||
// check media stream number
|
// check media stream number
|
||||||
@ -387,27 +387,28 @@ DEBUGC(DBCLASS_PLUGIN,"calculate: idx[%i] -> rtpproxytable[%i]", i, idx_to_rtp_p
|
|||||||
if (i == 1) { stats_num_calls++; stats_num_act_clients++;}
|
if (i == 1) { stats_num_calls++; stats_num_act_clients++;}
|
||||||
// change of call-id? -> +1 call
|
// change of call-id? -> +1 call
|
||||||
// check call-id host
|
// check call-id host
|
||||||
sts = memcmp(&rtp_proxytable[idx_to_rtp_proxytable[i]].callid_host,
|
sts = strncmp(rtp_proxytable[idx_to_rtp_proxytable[i]].callid_host,
|
||||||
&rtp_proxytable[idx_to_rtp_proxytable[i-1]].callid_host,
|
rtp_proxytable[idx_to_rtp_proxytable[i-1]].callid_host,
|
||||||
CALLIDHOST_SIZE);
|
CALLIDHOST_SIZE);
|
||||||
DEBUGC(DBCLASS_PLUGIN,"calc: memcmp callid_host=%i", sts);
|
DEBUGC(DBCLASS_PLUGIN,"calc: strncmp callid_host=%i", sts);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
stats_num_calls++;
|
stats_num_calls++;
|
||||||
} else {
|
} else {
|
||||||
// check call-id number
|
// check call-id number
|
||||||
sts = memcmp(&rtp_proxytable[idx_to_rtp_proxytable[i]].callid_number,
|
sts = strncmp(rtp_proxytable[idx_to_rtp_proxytable[i]].callid_number,
|
||||||
&rtp_proxytable[idx_to_rtp_proxytable[i-1]].callid_number,
|
rtp_proxytable[idx_to_rtp_proxytable[i-1]].callid_number,
|
||||||
CALLIDNUM_SIZE);
|
CALLIDNUM_SIZE);
|
||||||
DEBUGC(DBCLASS_PLUGIN,"calc: memcmp callid_number=%i", sts);
|
DEBUGC(DBCLASS_PLUGIN,"calc: strncmp callid_number=%i", sts);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
stats_num_calls++;
|
stats_num_calls++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//&&& use client_id.idstring only, otherwise wrong counting...
|
||||||
// change of client-id -> +1 client
|
// change of client-id -> +1 client
|
||||||
sts = memcmp(&rtp_proxytable[idx_to_rtp_proxytable[i]].client_id,
|
sts = strncmp(rtp_proxytable[idx_to_rtp_proxytable[i]].client_id.idstring,
|
||||||
&rtp_proxytable[idx_to_rtp_proxytable[i-1]].client_id,
|
rtp_proxytable[idx_to_rtp_proxytable[i-1]].client_id.idstring,
|
||||||
sizeof(client_id_t));
|
CLIENT_ID_SIZE);
|
||||||
DEBUGC(DBCLASS_PLUGIN,"calc: memcmp client_id=%i", sts);
|
DEBUGC(DBCLASS_PLUGIN,"calc: strncmp client_id=%i", sts);
|
||||||
if (sts != 0) {
|
if (sts != 0) {
|
||||||
stats_num_act_clients++;
|
stats_num_act_clients++;
|
||||||
}
|
}
|
||||||
@ -431,6 +432,7 @@ static void stats_to_file(void) {
|
|||||||
FILE *stream;
|
FILE *stream;
|
||||||
char remip[16];
|
char remip[16];
|
||||||
char lclip[16];
|
char lclip[16];
|
||||||
|
time_t now;
|
||||||
|
|
||||||
if (plugin_cfg.filename) {
|
if (plugin_cfg.filename) {
|
||||||
DEBUGC(DBCLASS_PLUGIN,"opening stats file for write");
|
DEBUGC(DBCLASS_PLUGIN,"opening stats file for write");
|
||||||
@ -450,8 +452,10 @@ static void stats_to_file(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// write header
|
// write header
|
||||||
|
time(&now);
|
||||||
|
fprintf(stream, "Date: %s\n", asctime(localtime(&now)));
|
||||||
fprintf(stream, "Summary\n-------\n");
|
fprintf(stream, "Summary\n-------\n");
|
||||||
|
|
||||||
fprintf(stream, "registered Clients: %6i\n", stats_num_reg_clients);
|
fprintf(stream, "registered Clients: %6i\n", stats_num_reg_clients);
|
||||||
fprintf(stream, "active Clients: %6i\n", stats_num_act_clients);
|
fprintf(stream, "active Clients: %6i\n", stats_num_act_clients);
|
||||||
fprintf(stream, "active Calls: %6i\n", stats_num_calls);
|
fprintf(stream, "active Calls: %6i\n", stats_num_calls);
|
||||||
|
|||||||
@ -118,7 +118,7 @@ int rtp_relay_init( void ) {
|
|||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
pthread_attr_getstacksize (&attr, &stacksize);
|
pthread_attr_getstacksize (&attr, &stacksize);
|
||||||
INFO("Current thread stacksize is %lu kB",(stacksize/1024));
|
INFO("Current thread stacksize is %u kB",(stacksize/1024));
|
||||||
|
|
||||||
/* experimental feature:
|
/* experimental feature:
|
||||||
* reduce the thread stack size to reduce the overall
|
* reduce the thread stack size to reduce the overall
|
||||||
@ -132,7 +132,7 @@ int rtp_relay_init( void ) {
|
|||||||
if (configuration.thread_stack_size > 0) {
|
if (configuration.thread_stack_size > 0) {
|
||||||
stacksize = configuration.thread_stack_size*1024;
|
stacksize = configuration.thread_stack_size*1024;
|
||||||
pthread_attr_setstacksize (&attr, stacksize);
|
pthread_attr_setstacksize (&attr, stacksize);
|
||||||
INFO("Setting new thread stacksize to %i kB",stacksize/1024);
|
INFO("Setting new thread stacksize to %u kB",stacksize/1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUGC(DBCLASS_RTP,"create thread");
|
DEBUGC(DBCLASS_RTP,"create thread");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user