void on_report_send_with_rtcp_xr_remote(const LinphoneCall *call, SalStreamType stream_type, const LinphoneContent *content){ char * body = (char*)linphone_content_get_buffer(content); reporting_session_report_t * report = call->log->reporting.reports[stream_type]; on_report_send_mandatory(call,stream_type,content); if (report->remote_metrics.rtcp_sr_count+report->remote_metrics.rtcp_xr_count>0){ BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteMetrics:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "Timestamps:")); on_report_send_verify_metrics(&report->remote_metrics,body); } }
char * on_report_send_verify_metrics(const reporting_content_metrics_t *metrics, char * body){ if (metrics->rtcp_xr_count){ CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SessionDesc:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "JitterBuffer:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PacketLoss:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "QualityEst:")); } if (metrics->rtcp_sr_count){ CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "Delay:")); } return body; }
static void strstr_func() { char text[1024] = "`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:ZXCVBNM<>?\0"; /* Same string at Head */ char* str = __strstr(text, "`1234567890"); assert_memory_equal(str, "`1234567890", strlen("`1234567890")); /* Middle */ str = __strstr(text, "-=qwertyuiop[]asdfghjk"); assert_memory_equal(str, "-=qwertyuiop[]asdfghjk", strlen("-=qwertyuiop[]asdfghjk")); /* Tail */ str = __strstr(text, "-=qwertyuiop[]asdfghjk"); assert_memory_equal(str, "-=qwertyuiop[]asdfghjk", strlen("-=qwertyuiop[]asdfghjk")); /* All */ str = __strstr(text, "`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:ZXCVBNM<>?\0"); assert_memory_equal(str, text, strlen(text)); /* Not matched */ str = __strstr(text, "11`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_\0"); assert_null(str); }
T_ULONG CString::Find(const T_STRING & sValue) const { return (__strstr(m_String, C_STR(sValue))); } // Find
void on_report_send_mandatory(const LinphoneCall *call, SalStreamType stream_type, const LinphoneContent *content){ char * body = (char *)linphone_content_get_buffer(content); char * remote_metrics_start = __strstr(body, "RemoteMetrics:"); reporting_session_report_t * report = call->log->reporting.reports[stream_type]; MediaStream * ms; if (stream_type == LINPHONE_CALL_STATS_AUDIO){ ms = (MediaStream*)call->audiostream; }else{ ms = (MediaStream*)call->videostream; } BC_ASSERT_TRUE( __strstr(body, "VQIntervalReport\r\n") == body || __strstr(body, "VQSessionReport\r\n") == body || __strstr(body, "VQSessionReport: CallTerm\r\n") == body ); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "CallID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "OrigID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalGroup:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteGroup:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalAddr:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "IP=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PORT=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SSRC=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteAddr:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "IP=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PORT=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SSRC=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalMetrics:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "Timestamps:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "START=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "STOP=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SessionDesc:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PT=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PD=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SR=")); /* We should have not reached RemoteMetrics section yet */ BC_ASSERT_TRUE(!remote_metrics_start || body < remote_metrics_start); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "DialogID:")); if (report->remote_metrics.rtcp_sr_count>0&&ms!=NULL&&ms->rc!=NULL){ /* Hack: reset rtcp_sr_count to 0 because in case of interval reports, we need one RTCP SR by interval. */ report->remote_metrics.rtcp_sr_count=0; BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "AdaptiveAlg:")); } }
void on_report_send_mandatory(const LinphoneCall *call, int stream_type, const LinphoneContent *content){ const MediaStream * ms = ((stream_type == LINPHONE_CALL_STATS_AUDIO)?&call->audiostream->ms:&call->videostream->ms); char * body = (char *)content->data; char * remote_metrics_start = __strstr(body, "RemoteMetrics:"); reporting_session_report_t * report = call->log->reporting.reports[stream_type]; CU_ASSERT_TRUE( __strstr(body, "VQIntervalReport\r\n") == body || __strstr(body, "VQSessionReport\r\n") == body || __strstr(body, "VQSessionReport: CallTerm\r\n") == body ); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "CallID:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalID:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteID:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "OrigID:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalGroup:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteGroup:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalAddr:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "IP=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PORT=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SSRC=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteAddr:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "IP=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PORT=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SSRC=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalMetrics:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "Timestamps:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "START=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "STOP=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SessionDesc:")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PT=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PD=")); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SR=")); /* We should have not reached RemoteMetrics section yet */ CU_ASSERT_TRUE(!remote_metrics_start || body < remote_metrics_start); CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "DialogID:")); if (report->remote_metrics.rtcp_sr_count&&ms->rc!=NULL){ CU_ASSERT_PTR_NOT_NULL(body=__strstr(body, "AdaptiveAlg:")); } }
void on_report_send_mandatory(const LinphoneCall *call, SalStreamType stream_type, const LinphoneContent *content){ char * body = (char *)linphone_content_get_buffer(content); char * remote_metrics_start = __strstr(body, "RemoteMetrics:"); BC_ASSERT_TRUE( __strstr(body, "VQIntervalReport\r\n") == body || __strstr(body, "VQSessionReport\r\n") == body || __strstr(body, "VQSessionReport: CallTerm\r\n") == body ); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "CallID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "OrigID:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalGroup:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteGroup:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalAddr:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "IP=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PORT=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SSRC=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "RemoteAddr:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "IP=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PORT=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SSRC=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "LocalMetrics:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "Timestamps:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "START=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "STOP=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SessionDesc:")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PT=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "PD=")); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "SR=")); /* We should have not reached RemoteMetrics section yet */ BC_ASSERT_TRUE(!remote_metrics_start || body < remote_metrics_start); BC_ASSERT_PTR_NOT_NULL(body=__strstr(body, "DialogID:")); }