@ -106,15 +106,15 @@ void statistics_update_foreignown_inc(struct call* c) {
}
}
void statistics_update_oneway ( struct call * c ) {
void statistics_update_oneway ( struct call * c ) {
struct packet_stream * ps = NULL , * ps2 = NULL ;
struct call_monologue * ml ;
struct call_monologue * ml ;
struct call_media * md ;
struct call_media * md ;
GList * k , * o ;
GList * k , * o ;
int found = 0 ;
GList * l ;
GList * l ;
if ( IS_OWN_CALL ( c ) ) {
// --- for statistics getting one way stream or no relay at all
// --- for statistics getting one way stream or no relay at all
int total_nopacket_relayed_sess = 0 ;
unsigned int total_nopacket_relayed_sess = 0 ;
struct packet_stream * ps , * ps2 ;
for ( l = c - > monologues . head ; l ; l = l - > next ) {
for ( l = c - > monologues . head ; l ; l = l - > next ) {
ml = l - > data ;
ml = l - > data ;
@ -127,34 +127,29 @@ void statistics_update_oneway(struct call* c) {
ps = o - > data ;
ps = o - > data ;
if ( PS_ISSET ( ps , RTP ) ) {
if ( PS_ISSET ( ps , RTP ) ) {
// --- only RTP is interesting
// --- only RTP is interesting
found = 1 ;
goto found ;
break ;
}
}
}
}
if ( found ) { break ; }
}
}
if ( ! found )
continue ;
ps = NULL ;
if ( ps ) {
found : ;
struct sink_handler * sh = g_queue_peek_head ( & ps - > rtp_sinks ) ;
struct sink_handler * sh = g_queue_peek_head ( & ps - > rtp_sinks ) ;
ps2 = sh ? sh - > sink : NULL ;
ps2 = sh ? sh - > sink : NULL ;
}
if ( ! ps2 )
continue ;
if ( ps & & ps2 & & atomic64_get ( & ps2 - > stats . packets ) = = 0 ) {
if ( atomic64_get ( & ps2 - > stats . packets ) = = 0 ) {
if ( atomic64_get ( & ps - > stats . packets ) ! = 0 & & IS_OWN_CALL ( c ) ) {
if ( atomic64_get ( & ps - > stats . packets ) ! = 0 )
if ( atomic64_get ( & ps - > stats . packets ) ! = 0 )
RTPE_STATS_INC ( oneway_stream_sess ) ;
RTPE_STATS_INC ( oneway_stream_sess ) ;
}
else
else {
total_nopacket_relayed_sess + + ;
total_nopacket_relayed_sess + + ;
}
}
}
}
}
if ( IS_OWN_CALL ( c ) )
RTPE_STATS_ADD ( nopacket_relayed_sess , total_nopacket_relayed_sess / 2 ) ;
RTPE_STATS_ADD ( nopacket_relayed_sess , total_nopacket_relayed_sess / 2 ) ;
}
if ( c - > monologues . head ) {
if ( c - > monologues . head ) {
ml = c - > monologues . head - > data ;
ml = c - > monologues . head - > data ;