<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.9.1">
  <compounddef id="quality__reporting_8c" kind="file" language="C++">
    <compoundname>quality_reporting.c</compoundname>
    <includes refid="linphonecore_8h" local="yes">linphonecore.h</includes>
    <includes refid="private_8h" local="yes">private.h</includes>
    <includes local="yes">sal/sal.h</includes>
    <includes local="yes">ortp/rtpsession.h</includes>
    <includes local="no">math.h</includes>
    <incdepgraph>
      <node id="239">
        <label>quality_reporting.c</label>
        <link refid="quality_reporting.c"/>
        <childnode refid="240" relation="include">
        </childnode>
        <childnode refid="241" relation="include">
        </childnode>
        <childnode refid="242" relation="include">
        </childnode>
      </node>
      <node id="240">
        <label>sal/sal.h</label>
      </node>
      <node id="242">
        <label>math.h</label>
      </node>
      <node id="241">
        <label>ortp/rtpsession.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="define">
      <memberdef kind="define" id="quality__reporting_8c_1abfc3254581ced4d3d324064e1984f1cd" prot="public" static="no">
        <name>STR_REASSIGN</name>
        <param><defname>dest</defname></param>
        <param><defname>src</defname></param>
        <initializer>{\
	if (dest != NULL) \
		ms_free(dest); \
	dest = src; \
}</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="35" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="35" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1a3afe72c476ad45506fe5a8701a38d31b" prot="public" static="no">
        <name>APPEND_IF_NOT_NULL_STR</name>
        <param><defname>buffer</defname></param>
        <param><defname>size</defname></param>
        <param><defname>offset</defname></param>
        <param><defname>fmt</defname></param>
        <param><defname>arg</defname></param>
        <initializer>if (arg != NULL) append_to_buffer(buffer, size, offset, fmt, arg)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="105" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="105" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1a9379318c1713507db772d69d7e354d0d" prot="public" static="no">
        <name>APPEND_IF_NUM_IN_RANGE</name>
        <param><defname>buffer</defname></param>
        <param><defname>size</defname></param>
        <param><defname>offset</defname></param>
        <param><defname>fmt</defname></param>
        <param><defname>arg</defname></param>
        <param><defname>inf</defname></param>
        <param><defname>sup</defname></param>
        <initializer>if (inf &lt;= arg &amp;&amp; arg &lt;= sup) append_to_buffer(buffer, size, offset, fmt, arg)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="106" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="106" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1a164b3670e425075f84d1f6de4c62679f" prot="public" static="no">
        <name>APPEND_IF</name>
        <param><defname>buffer</defname></param>
        <param><defname>size</defname></param>
        <param><defname>offset</defname></param>
        <param><defname>fmt</defname></param>
        <param><defname>arg</defname></param>
        <param><defname>cond</defname></param>
        <initializer>if (cond) append_to_buffer(buffer, size, offset, fmt, arg)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="107" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="107" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1abb8e08d64efd0030ae3542140527494e" prot="public" static="no">
        <name>IF_NUM_IN_RANGE</name>
        <param><defname>num</defname></param>
        <param><defname>inf</defname></param>
        <param><defname>sup</defname></param>
        <param><defname>statement</defname></param>
        <initializer>if (inf &lt;= num &amp;&amp; num &lt;= sup) statement</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="108" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="108" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1aceac1dbfafdb3512e6c6bfa4af170843" prot="public" static="no">
        <name>METRICS_PACKET_LOSS</name>
        <initializer>1 &lt;&lt; 0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="110" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="110" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1af7a94134b3b6aa17d237e84de891b361" prot="public" static="no">
        <name>METRICS_QUALITY_ESTIMATES</name>
        <initializer>1 &lt;&lt; 1</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="111" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="111" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1ab20ba3d05539c8ac15bcf9d0af3b5a26" prot="public" static="no">
        <name>METRICS_SESSION_DESCRIPTION</name>
        <initializer>1 &lt;&lt; 2</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="112" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="112" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1af4ad614aeb1b7e8cb665c65747464a0e" prot="public" static="no">
        <name>METRICS_JITTER_BUFFER</name>
        <initializer>1 &lt;&lt; 3</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="113" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="113" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1a88e3d80a0abd71dc83efd95d744776bc" prot="public" static="no">
        <name>METRICS_DELAY</name>
        <initializer>1 &lt;&lt; 4</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="114" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="114" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="quality__reporting_8c_1a7a9f1eabbd435ce33b79857a21270c50" prot="public" static="no">
        <name>METRICS_SIGNAL</name>
        <initializer>1 &lt;&lt; 5</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="115" column="9" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="115" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="quality__reporting_8c_1ad3b0a1518142b2d66a8a30d09edfcc72" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>char *</type>
        <definition>static char* float_to_one_decimal_string</definition>
        <argsstring>(float f)</argsstring>
        <name>float_to_one_decimal_string</name>
        <param>
          <type>float</type>
          <declname>f</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="43" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="43" bodyend="50"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a826436e5f774f12e77d23b6eec98b222" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void append_to_buffer_valist</definition>
        <argsstring>(char **buff, size_t *buff_size, size_t *offset, const char *fmt, va_list args)</argsstring>
        <name>append_to_buffer_valist</name>
        <param>
          <type>char **</type>
          <declname>buff</declname>
        </param>
        <param>
          <type>size_t *</type>
          <declname>buff_size</declname>
        </param>
        <param>
          <type>size_t *</type>
          <declname>offset</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>fmt</declname>
        </param>
        <param>
          <type>va_list</type>
          <declname>args</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="52" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="52" bodyend="78"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1ac9e709680cb39838c7f0b384e77f7242" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void append_to_buffer</definition>
        <argsstring>(char **buff, size_t *buff_size, size_t *offset, const char *fmt,...)</argsstring>
        <name>append_to_buffer</name>
        <param>
          <type>char **</type>
          <declname>buff</declname>
        </param>
        <param>
          <type>size_t *</type>
          <declname>buff_size</declname>
        </param>
        <param>
          <type>size_t *</type>
          <declname>offset</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>fmt</declname>
        </param>
        <param>
          <type>...</type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="80" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="80" bodyend="85"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1acced409cc10febf9b3ad01ebfdb0a649" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void reset_avg_metrics</definition>
        <argsstring>(reporting_session_report_t *report)</argsstring>
        <name>reset_avg_metrics</name>
        <param>
          <type><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref> *</type>
          <declname>report</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="87" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="87" bodyend="103"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1ad32c98f29686563b383e1ddd49e100bc" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>uint8_t</type>
        <definition>static uint8_t are_metrics_filled</definition>
        <argsstring>(const reporting_content_metrics_t rm)</argsstring>
        <name>are_metrics_filled</name>
        <param>
          <type>const <ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref></type>
          <declname>rm</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="117" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="117" bodyend="150"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a66118abfa1602b4c981b8b05c4406afc" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>bool_t</type>
        <definition>static bool_t quality_reporting_enabled</definition>
        <argsstring>(const LinphoneCall *call)</argsstring>
        <name>quality_reporting_enabled</name>
        <param>
          <type>const <ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="152" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="152" bodyend="154"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1ae3f4c035b57a0375dfc345c2719d9450" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>bool_t</type>
        <definition>static bool_t media_report_enabled</definition>
        <argsstring>(LinphoneCall *call, int stats_type)</argsstring>
        <name>media_report_enabled</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>int</type>
          <declname>stats_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="156" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="156" bodyend="167"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a8aa936dd176b50fa28bfd28ad485e585" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void append_metrics_to_buffer</definition>
        <argsstring>(char **buffer, size_t *size, size_t *offset, const reporting_content_metrics_t rm)</argsstring>
        <name>append_metrics_to_buffer</name>
        <param>
          <type>char **</type>
          <declname>buffer</declname>
        </param>
        <param>
          <type>size_t *</type>
          <declname>size</declname>
        </param>
        <param>
          <type>size_t *</type>
          <declname>offset</declname>
        </param>
        <param>
          <type>const <ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref></type>
          <declname>rm</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="169" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="169" bodyend="263"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1acf40f9759540a476ab80e662872ee60d" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int send_report</definition>
        <argsstring>(LinphoneCall *call, reporting_session_report_t *report, const char *report_event)</argsstring>
        <name>send_report</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref> *</type>
          <declname>report</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>report_event</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="265" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="265" bodyend="390"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1af094452066b22881afdf062325f3b4ee" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>const SalStreamDescription *</type>
        <definition>static const SalStreamDescription* get_media_stream_for_desc</definition>
        <argsstring>(const SalMediaDescription *smd, SalStreamType sal_stream_type)</argsstring>
        <name>get_media_stream_for_desc</name>
        <param>
          <type>const SalMediaDescription *</type>
          <declname>smd</declname>
        </param>
        <param>
          <type>SalStreamType</type>
          <declname>sal_stream_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="392" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="392" bodyend="402"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a2d6f534c8e9c5c9b81d16f7f77f60b0d" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void update_ip</definition>
        <argsstring>(LinphoneCall *call, int stats_type)</argsstring>
        <name>update_ip</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>int</type>
          <declname>stats_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="404" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="404" bodyend="429"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a94f0be75e4416e03a69a6eb62ee02ed6" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void qos_analyzer_on_action_suggested</definition>
        <argsstring>(void *user_data, int datac, const char **datav)</argsstring>
        <name>qos_analyzer_on_action_suggested</name>
        <param>
          <type>void *</type>
          <declname>user_data</declname>
        </param>
        <param>
          <type>int</type>
          <declname>datac</declname>
        </param>
        <param>
          <type>const char **</type>
          <declname>datav</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="431" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="431" bodyend="471"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1af29968eec5228f1137b053bf0ddc9fac" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void linphone_reporting_update_ip</definition>
        <argsstring>(LinphoneCall *call)</argsstring>
        <name>linphone_reporting_update_ip</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Fill IP information about a given call. This function must be called each time call state is &apos;LinphoneCallStreamsRunning&apos; since IP might be updated (if we found a direct route between caller and callee for example). When call is starting, remote IP/port might be the proxy ones to which callee is registered <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="473" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="473" bodyend="477"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a0e864916f21e2cef3c51e09ae40226f3" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void linphone_reporting_update_media_info</definition>
        <argsstring>(LinphoneCall *call, int stats_type)</argsstring>
        <name>linphone_reporting_update_media_info</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>int</type>
          <declname>stats_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Fill media information about a given call. This function must be called before stopping the media stream. <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>stats_type</parametername>
</parameternamelist>
<parameterdescription>
<para>the media type (LINPHONE_CALL_STATS_AUDIO or LINPHONE_CALL_STATS_VIDEO) </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="479" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="479" bodyend="579"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a3a997d5566a12d31caf170f2bfb091e1" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>float</type>
        <definition>static float reporting_rand</definition>
        <argsstring>(float t)</argsstring>
        <name>reporting_rand</name>
        <param>
          <type>float</type>
          <declname>t</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="582" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="582" bodyend="584"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1afbd47cbf19fa6bf554c8974179dbd4c4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void linphone_reporting_on_rtcp_update</definition>
        <argsstring>(LinphoneCall *call, SalStreamType stats_type)</argsstring>
        <name>linphone_reporting_on_rtcp_update</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>SalStreamType</type>
          <declname>stats_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Update publish reports with newly sent/received RTCP-XR packets (if available). <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>stats_type</parametername>
</parameternamelist>
<parameterdescription>
<para>the media type </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
<para>&lt; received_rtcp field of LinphoneCallStats object has been updated</para><para>&lt; sent_rtcp field of LinphoneCallStats object has been updated</para><para>&lt; received_rtcp field of LinphoneCallStats object has been updated </para>        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="586" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="586" bodyend="648"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1ae8dd2bba96707e42e08c97c21c7533bc" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int publish_report</definition>
        <argsstring>(LinphoneCall *call, const char *event_type)</argsstring>
        <name>publish_report</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>event_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="650" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="650" bodyend="667"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a1cdab5c46f93d49a7cb7e6bbba3e2e78" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int linphone_reporting_publish_session_report</definition>
        <argsstring>(LinphoneCall *call, bool_t call_term)</argsstring>
        <name>linphone_reporting_publish_session_report</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>bool_t</type>
          <declname>call_term</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Publish a session report. This function should be called when session terminates, media change (codec change or session fork), session terminates due to no media packets being received. <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>call_term</parametername>
</parameternamelist>
<parameterdescription>
<para>whether the call has ended or is continuing</para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>error code. 0 for success, positive value otherwise. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="669" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="669" bodyend="672"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a38f64068d4ea7646198609aaaad88b70" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int linphone_reporting_publish_interval_report</definition>
        <argsstring>(LinphoneCall *call)</argsstring>
        <name>linphone_reporting_publish_interval_report</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Publish an interval report. This function should be used for periodic interval <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>error code. 0 for success, positive value otherwise. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="674" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="674" bodyend="676"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a8cd5cea438e0021ddca1dec6e2599e45" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>bool_t</type>
        <definition>static bool_t set_on_action_suggested_cb</definition>
        <argsstring>(MediaStream *stream, void(*on_action_suggested)(void *, int, const char **), void *u)</argsstring>
        <name>set_on_action_suggested_cb</name>
        <param>
          <type>MediaStream *</type>
          <declname>stream</declname>
        </param>
        <param>
          <type>void(*)(void *, int, const char **)</type>
          <declname>on_action_suggested</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>u</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="678" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="678" bodyend="689"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a20315dc8dac0cf69bcde674aabfaffe1" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void linphone_reporting_call_state_updated</definition>
        <argsstring>(LinphoneCall *call)</argsstring>
        <name>linphone_reporting_call_state_updated</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Update publish reports on call state change. <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="691" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="691" bodyend="727"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a872697caa60553cfdd05aa07b2e2e8c9" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref> *</type>
        <definition>reporting_session_report_t* linphone_reporting_new</definition>
        <argsstring>()</argsstring>
        <name>linphone_reporting_new</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="729" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="729" bodyend="759"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a3be58097f61046867797ba60ee7c951c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void linphone_reporting_destroy</definition>
        <argsstring>(reporting_session_report_t *report)</argsstring>
        <name>linphone_reporting_destroy</name>
        <param>
          <type><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref> *</type>
          <declname>report</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="761" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="761" bodyend="787"/>
      </memberdef>
      <memberdef kind="function" id="quality__reporting_8c_1a68c76b6f1c5e5f9575be2239a083cec0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void linphone_reporting_set_on_report_send</definition>
        <argsstring>(LinphoneCall *call, LinphoneQualityReportingReportSendCb cb)</argsstring>
        <name>linphone_reporting_set_on_report_send</name>
        <param>
          <type><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> *</type>
          <declname>call</declname>
        </param>
        <param>
          <type>LinphoneQualityReportingReportSendCb</type>
          <declname>cb</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Setter of the #LinphoneQualityReportingReportSendCb callback method which is notified each time a report will be submitted to the collector, if quality reporting is enabled <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>call</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref> object to consider </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>cb</parametername>
</parameternamelist>
<parameterdescription>
<para>#LinphoneQualityReportingReportSendCb callback function to notify </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" line="790" column="1" bodyfile="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c" bodystart="790" bodyend="792"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*</highlight></codeline>
<codeline lineno="2"><highlight class="comment">linphone</highlight></codeline>
<codeline lineno="3"><highlight class="comment">Copyright<sp/>(C)<sp/>2014<sp/>-<sp/>Belledonne<sp/>Communications,<sp/>Grenoble,<sp/>France</highlight></codeline>
<codeline lineno="4"><highlight class="comment"></highlight></codeline>
<codeline lineno="5"><highlight class="comment">This<sp/>program<sp/>is<sp/>free<sp/>software;<sp/>you<sp/>can<sp/>redistribute<sp/>it<sp/>and/or</highlight></codeline>
<codeline lineno="6"><highlight class="comment">modify<sp/>it<sp/>under<sp/>the<sp/>terms<sp/>of<sp/>the<sp/>GNU<sp/>General<sp/>Public<sp/>License</highlight></codeline>
<codeline lineno="7"><highlight class="comment">as<sp/>published<sp/>by<sp/>the<sp/>Free<sp/>Software<sp/>Foundation;<sp/>either<sp/>version<sp/>2</highlight></codeline>
<codeline lineno="8"><highlight class="comment">of<sp/>the<sp/>License,<sp/>or<sp/>(at<sp/>your<sp/>option)<sp/>any<sp/>later<sp/>version.</highlight></codeline>
<codeline lineno="9"><highlight class="comment"></highlight></codeline>
<codeline lineno="10"><highlight class="comment">This<sp/>program<sp/>is<sp/>distributed<sp/>in<sp/>the<sp/>hope<sp/>that<sp/>it<sp/>will<sp/>be<sp/>useful,</highlight></codeline>
<codeline lineno="11"><highlight class="comment">but<sp/>WITHOUT<sp/>ANY<sp/>WARRANTY;<sp/>without<sp/>even<sp/>the<sp/>implied<sp/>warranty<sp/>of</highlight></codeline>
<codeline lineno="12"><highlight class="comment">MERCHANTABILITY<sp/>or<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE.<sp/><sp/>See<sp/>the</highlight></codeline>
<codeline lineno="13"><highlight class="comment">GNU<sp/>General<sp/>Public<sp/>License<sp/>for<sp/>more<sp/>details.</highlight></codeline>
<codeline lineno="14"><highlight class="comment"></highlight></codeline>
<codeline lineno="15"><highlight class="comment">You<sp/>should<sp/>have<sp/>received<sp/>a<sp/>copy<sp/>of<sp/>the<sp/>GNU<sp/>General<sp/>Public<sp/>License</highlight></codeline>
<codeline lineno="16"><highlight class="comment">along<sp/>with<sp/>this<sp/>program;<sp/>if<sp/>not,<sp/>write<sp/>to<sp/>the<sp/>Free<sp/>Software</highlight></codeline>
<codeline lineno="17"><highlight class="comment">Foundation,<sp/>Inc.,<sp/>59<sp/>Temple<sp/>Place<sp/>-<sp/>Suite<sp/>330,<sp/>Boston,<sp/>MA<sp/><sp/>02111-1307,<sp/>USA.</highlight></codeline>
<codeline lineno="18"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>HAVE_CONFIG_H</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;config.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;linphonecore.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;private.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;sal/sal.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;ortp/rtpsession.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;math.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>TARGET_OS_IPHONE</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;sys/sysctl.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>STR_REASSIGN(dest,<sp/>src)<sp/>{\</highlight></codeline>
<codeline lineno="36"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(dest<sp/>!=<sp/>NULL)<sp/>\</highlight></codeline>
<codeline lineno="37"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(dest);<sp/>\</highlight></codeline>
<codeline lineno="38"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dest<sp/>=<sp/>src;<sp/>\</highlight></codeline>
<codeline lineno="39"><highlight class="preprocessor">}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight><highlight class="comment">/*since<sp/>printf<sp/>family<sp/>functions<sp/>are<sp/>LOCALE<sp/>dependent,<sp/>float<sp/>separator<sp/>may<sp/>differ</highlight></codeline>
<codeline lineno="42"><highlight class="comment">depending<sp/>on<sp/>the<sp/>user&apos;s<sp/>locale<sp/>(LC_NUMERIC<sp/>environment<sp/>var).*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>float_to_one_decimal_string(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>f)<sp/>{</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>rounded_f<sp/>=<sp/>floorf(f<sp/>*<sp/>10<sp/>+<sp/>.5f)<sp/>/<sp/>10;</highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>floor_part<sp/>=<sp/>(int)<sp/>rounded_f;</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>one_decimal_part<sp/>=<sp/>(int)floorf(10<sp/>*<sp/>(rounded_f<sp/>-<sp/>floor_part)<sp/>+<sp/>.5f);</highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%d.%d&quot;</highlight><highlight class="normal">,<sp/>floor_part,<sp/>one_decimal_part);</highlight></codeline>
<codeline lineno="50"><highlight class="normal">}</highlight></codeline>
<codeline lineno="51"><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>append_to_buffer_valist(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>**buff,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*buff_size,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*offset,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*fmt,<sp/>va_list<sp/>args)<sp/>{</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>belle_sip_error_code<sp/>ret;</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>prevoffset<sp/>=<sp/>*offset;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>#ifndef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_list<sp/>cap;</highlight><highlight class="comment">/*copy<sp/>of<sp/>our<sp/>argument<sp/>list:<sp/>a<sp/>va_list<sp/>cannot<sp/>be<sp/>re-used<sp/>(SIGSEGV<sp/>on<sp/>linux<sp/>64<sp/>bits)*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_copy(cap,args);</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>belle_sip_snprintf_valist(*buff,<sp/>*buff_size,<sp/>offset,<sp/>fmt,<sp/>cap);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_end(cap);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>#else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>belle_sip_snprintf_valist(*buff,<sp/>*buff_size,<sp/>offset,<sp/>fmt,<sp/>args);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*if<sp/>we<sp/>are<sp/>out<sp/>of<sp/>memory,<sp/>we<sp/>add<sp/>some<sp/>size<sp/>to<sp/>buffer*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>BELLE_SIP_BUFFER_OVERFLOW)<sp/>{</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*some<sp/>compilers<sp/>complain<sp/>that<sp/>size_t<sp/>cannot<sp/>be<sp/>formatted<sp/>as<sp/>unsigned<sp/>long,<sp/>hence<sp/>forcing<sp/>cast*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_warning(</highlight><highlight class="stringliteral">&quot;QualityReporting:<sp/>Buffer<sp/>was<sp/>too<sp/>small<sp/>to<sp/>contain<sp/>the<sp/>whole<sp/>report<sp/>-<sp/>increasing<sp/>its<sp/>size<sp/>from<sp/>%lu<sp/>to<sp/>%lu&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal">)*buff_size,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal">)*buff_size<sp/>+<sp/>2048);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*buff_size<sp/>+=<sp/>2048;</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*buff<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/>ms_realloc(*buff,<sp/>*buff_size);</highlight></codeline>
<codeline lineno="72"><highlight class="normal"></highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*offset<sp/>=<sp/>prevoffset;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*recall<sp/>itself<sp/>since<sp/>we<sp/>did<sp/>not<sp/>write<sp/>all<sp/>things<sp/>into<sp/>the<sp/>buffer<sp/>but</highlight></codeline>
<codeline lineno="75"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>only<sp/>a<sp/>part<sp/>of<sp/>it*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer_valist(buff,<sp/>buff_size,<sp/>offset,<sp/>fmt,<sp/>args);</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="78"><highlight class="normal">}</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>append_to_buffer(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>**buff,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*buff_size,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*offset,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*fmt,<sp/>...)<sp/>{</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_list<sp/>args;</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_start(args,<sp/>fmt);</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer_valist(buff,<sp/>buff_size,<sp/>offset,<sp/>fmt,<sp/>args);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>va_end(args);</highlight></codeline>
<codeline lineno="85"><highlight class="normal">}</highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>reset_avg_metrics(<ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>report){</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref><sp/>*<sp/>metrics[2]<sp/>=<sp/>{&amp;report-&gt;local_metrics,<sp/>&amp;report-&gt;remote_metrics};</highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>2;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;rtcp_sr_count<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;rtcp_xr_count<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;jitter_buffer.nominal<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;jitter_buffer.max<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="96"><highlight class="normal"></highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;quality_estimates.moslq<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;quality_estimates.moscq<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="99"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;delay.round_trip_delay<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;last_report_date<sp/>=<sp/>ms_time(NULL);</highlight></codeline>
<codeline lineno="103"><highlight class="normal">}</highlight></codeline>
<codeline lineno="104"><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/>fmt,<sp/>arg)<sp/>if<sp/>(arg<sp/>!=<sp/>NULL)<sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>fmt,<sp/>arg)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/>fmt,<sp/>arg,<sp/>inf,<sp/>sup)<sp/>if<sp/>(inf<sp/>&lt;=<sp/>arg<sp/>&amp;&amp;<sp/>arg<sp/>&lt;=<sp/>sup)<sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>fmt,<sp/>arg)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/>fmt,<sp/>arg,<sp/>cond)<sp/>if<sp/>(cond)<sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>fmt,<sp/>arg)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>IF_NUM_IN_RANGE(num,<sp/>inf,<sp/>sup,<sp/>statement)<sp/>if<sp/>(inf<sp/>&lt;=<sp/>num<sp/>&amp;&amp;<sp/>num<sp/>&lt;=<sp/>sup)<sp/>statement</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="109"><highlight class="normal"></highlight></codeline>
<codeline lineno="110"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>METRICS_PACKET_LOSS<sp/>1<sp/>&lt;&lt;<sp/>0</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="111"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>METRICS_QUALITY_ESTIMATES<sp/>1<sp/>&lt;&lt;<sp/>1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>METRICS_SESSION_DESCRIPTION<sp/>1<sp/>&lt;&lt;<sp/>2</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>METRICS_JITTER_BUFFER<sp/>1<sp/>&lt;&lt;<sp/>3</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>METRICS_DELAY<sp/>1<sp/>&lt;&lt;<sp/>4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>METRICS_SIGNAL<sp/>1<sp/>&lt;&lt;<sp/>5</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>uint8_t<sp/>are_metrics_filled(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref><sp/>rm)<sp/>{</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>uint8_t<sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="119"><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.packet_loss.network_packet_loss_rate,<sp/>0,<sp/>255,<sp/>ret|=METRICS_PACKET_LOSS);</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.packet_loss.jitter_buffer_discard_rate,<sp/>0,<sp/>255,<sp/>ret|=METRICS_PACKET_LOSS);</highlight></codeline>
<codeline lineno="122"><highlight class="normal"></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.session_description.payload_type<sp/>!=<sp/>-1)<sp/>ret|=METRICS_SESSION_DESCRIPTION;</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.session_description.payload_desc<sp/>!=<sp/>NULL)<sp/>ret|=METRICS_SESSION_DESCRIPTION;</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.session_description.sample_rate<sp/>!=<sp/>-1)<sp/>ret|=METRICS_SESSION_DESCRIPTION;</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.session_description.fmtp<sp/>!=<sp/>NULL)<sp/>ret|=METRICS_SESSION_DESCRIPTION;</highlight></codeline>
<codeline lineno="127"><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.jitter_buffer.adaptive,<sp/>0,<sp/>3,<sp/>ret|=METRICS_JITTER_BUFFER);</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.jitter_buffer.abs_max,<sp/>0,<sp/>65535,<sp/>ret|=METRICS_JITTER_BUFFER);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.delay.end_system_delay,<sp/>0,<sp/>65535,<sp/>ret|=METRICS_DELAY);</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.delay.interarrival_jitter,<sp/>0,<sp/>65535,<sp/>ret|=METRICS_DELAY);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.delay.mean_abs_jitter,<sp/>0,<sp/>65535,<sp/>ret|=METRICS_DELAY);</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.signal.level<sp/>!=<sp/>127)<sp/>ret|=METRICS_SIGNAL;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.signal.noise_level<sp/>!=<sp/>127)<sp/>ret|=METRICS_SIGNAL;</highlight></codeline>
<codeline lineno="137"><highlight class="normal"></highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.quality_estimates.moslq,<sp/>1,<sp/>5,<sp/>ret|=METRICS_QUALITY_ESTIMATES);</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.quality_estimates.moscq,<sp/>1,<sp/>5,<sp/>ret|=METRICS_QUALITY_ESTIMATES);</highlight></codeline>
<codeline lineno="140"><highlight class="normal"></highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.rtcp_xr_count&gt;0){</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.jitter_buffer.nominal/rm.rtcp_xr_count,<sp/>0,<sp/>65535,<sp/>ret|=METRICS_JITTER_BUFFER);</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.jitter_buffer.max/rm.rtcp_xr_count,<sp/>0,<sp/>65535,<sp/>ret|=METRICS_JITTER_BUFFER);</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.rtcp_sr_count+rm.rtcp_xr_count&gt;0){</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.delay.round_trip_delay/(rm.rtcp_sr_count+rm.rtcp_xr_count),<sp/>0,<sp/>65535,<sp/>ret|=METRICS_DELAY);</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="148"><highlight class="normal"></highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="150"><highlight class="normal">}</highlight></codeline>
<codeline lineno="151"><highlight class="normal"></highlight></codeline>
<codeline lineno="152"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>bool_t<sp/>quality_reporting_enabled(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*<sp/>call)<sp/>{</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(call-&gt;dest_proxy<sp/>!=<sp/>NULL<sp/>&amp;&amp;<sp/><ref refid="group__proxies_1gafa768bc49afd9c987d5676328ae71771" kindref="member">linphone_proxy_config_quality_reporting_enabled</ref>(call-&gt;dest_proxy));</highlight></codeline>
<codeline lineno="154"><highlight class="normal">}</highlight></codeline>
<codeline lineno="155"><highlight class="normal"></highlight></codeline>
<codeline lineno="156"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>bool_t<sp/>media_report_enabled(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*<sp/>call,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>stats_type){</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<sp/>quality_reporting_enabled(call))</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FALSE;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_VIDEO<sp/>&amp;&amp;<sp/>!<ref refid="group__call__control_1ga76c45eb46038b54a05325a61ca5908f4" kindref="member">linphone_call_params_video_enabled</ref>(<ref refid="group__call__control_1ga768bbd4e2869556bc23830a7b1e4eb5c" kindref="member">linphone_call_get_current_params</ref>(call)))</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FALSE;</highlight></codeline>
<codeline lineno="162"><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_TEXT<sp/>&amp;&amp;<sp/>!<ref refid="group__media__parameters_1gac93f1c5212a71362a315b6ed310ea9e8" kindref="member">linphone_call_params_realtime_text_enabled</ref>(<ref refid="group__call__control_1ga768bbd4e2869556bc23830a7b1e4eb5c" kindref="member">linphone_call_get_current_params</ref>(call)))</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FALSE;</highlight></codeline>
<codeline lineno="165"><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(call-&gt;log-&gt;reporting.reports[stats_type]<sp/>!=<sp/>NULL);</highlight></codeline>
<codeline lineno="167"><highlight class="normal">}</highlight></codeline>
<codeline lineno="168"><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>append_metrics_to_buffer(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>**<sp/>buffer,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*<sp/>size,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*<sp/>offset,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref><sp/>rm)<sp/>{</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>timestamps_start_str<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>timestamps_stop_str<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>network_packet_loss_rate_str<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>jitter_buffer_discard_rate_str<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*char<sp/>*<sp/>gap_loss_density_str<sp/>=<sp/>NULL;*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>moslq_str<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>moscq_str<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>uint8_t<sp/>available_metrics<sp/>=<sp/>are_metrics_filled(rm);</highlight></codeline>
<codeline lineno="178"><highlight class="normal"></highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.timestamps.start<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>timestamps_start_str<sp/>=<sp/>linphone_timestamp_to_rfc3339_string(rm.timestamps.start);</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.timestamps.stop<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>timestamps_stop_str<sp/>=<sp/>linphone_timestamp_to_rfc3339_string(rm.timestamps.stop);</highlight></codeline>
<codeline lineno="183"><highlight class="normal"></highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;Timestamps:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>START=%s&quot;</highlight><highlight class="normal">,<sp/>timestamps_start_str);</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>STOP=%s&quot;</highlight><highlight class="normal">,<sp/>timestamps_stop_str);</highlight></codeline>
<codeline lineno="187"><highlight class="normal"></highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((available_metrics<sp/>&amp;<sp/>METRICS_SESSION_DESCRIPTION)<sp/>!=<sp/>0){</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nSessionDesc:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>PT=%d&quot;</highlight><highlight class="normal">,<sp/>rm.session_description.payload_type,<sp/>rm.session_description.payload_type<sp/>!=<sp/>-1);</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>PD=%s&quot;</highlight><highlight class="normal">,<sp/>rm.session_description.payload_desc);</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>SR=%d&quot;</highlight><highlight class="normal">,<sp/>rm.session_description.sample_rate,<sp/>rm.session_description.sample_rate<sp/>!=<sp/>-1);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>FD=%d&quot;</highlight><highlight class="normal">,<sp/>rm.session_description.frame_duration,<sp/>rm.session_description.frame_duration<sp/>!=<sp/>-1);</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>FMTP=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>rm.session_description.fmtp);</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>PLC=%d&quot;</highlight><highlight class="normal">,<sp/>rm.session_description.packet_loss_concealment,<sp/>rm.session_description.packet_loss_concealment<sp/>!=<sp/>-1);</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="197"><highlight class="normal"></highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((available_metrics<sp/>&amp;<sp/>METRICS_JITTER_BUFFER)<sp/>!=<sp/>0){</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nJitterBuffer:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>JBA=%d&quot;</highlight><highlight class="normal">,<sp/>rm.jitter_buffer.adaptive,<sp/>0,<sp/>3);</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.rtcp_xr_count){</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>JBN=%d&quot;</highlight><highlight class="normal">,<sp/>rm.jitter_buffer.nominal/rm.rtcp_xr_count,<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>JBM=%d&quot;</highlight><highlight class="normal">,<sp/>rm.jitter_buffer.max/rm.rtcp_xr_count,<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>JBX=%d&quot;</highlight><highlight class="normal">,<sp/><sp/>rm.jitter_buffer.abs_max,<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="206"><highlight class="normal"></highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nPacketLoss:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.packet_loss.network_packet_loss_rate,<sp/>0,<sp/>255,<sp/>network_packet_loss_rate_str<sp/>=<sp/>float_to_one_decimal_string(rm.packet_loss.network_packet_loss_rate<sp/>/<sp/>256));</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.packet_loss.jitter_buffer_discard_rate,<sp/>0,<sp/>255,<sp/>jitter_buffer_discard_rate_str<sp/>=<sp/>float_to_one_decimal_string(rm.packet_loss.jitter_buffer_discard_rate<sp/>/<sp/>256));</highlight></codeline>
<codeline lineno="210"><highlight class="normal"></highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>NLR=%s&quot;</highlight><highlight class="normal">,<sp/>network_packet_loss_rate_str);</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>JDR=%s&quot;</highlight><highlight class="normal">,<sp/>jitter_buffer_discard_rate_str);</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="214"><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>&quot;\r\nBurstGapLoss:&quot;);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*IF_NUM_IN_RANGE(rm.burst_gap_loss.gap_loss_density,<sp/>0,<sp/>10,<sp/>gap_loss_density_str<sp/>=<sp/>float_to_one_decimal_string(rm.burst_gap_loss.gap_loss_density));*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>&quot;<sp/>BLD=%d&quot;,<sp/>rm.burst_gap_loss.burst_loss_density);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>&quot;<sp/>BD=%d&quot;,<sp/>rm.burst_gap_loss.burst_duration);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/>&quot;<sp/>GLD=%s&quot;,<sp/>gap_loss_density_str);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>&quot;<sp/>GD=%d&quot;,<sp/>rm.burst_gap_loss.gap_duration);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/>&quot;<sp/>GMIN=%d&quot;,<sp/>rm.burst_gap_loss.min_gap_threshold);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((available_metrics<sp/>&amp;<sp/>METRICS_DELAY)<sp/>!=<sp/>0){</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nDelay:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.rtcp_xr_count+rm.rtcp_sr_count){</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>RTD=%d&quot;</highlight><highlight class="normal">,<sp/>rm.delay.round_trip_delay/(rm.rtcp_xr_count+rm.rtcp_sr_count),<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>ESD=%d&quot;</highlight><highlight class="normal">,<sp/>rm.delay.end_system_delay,<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>IAJ=%d&quot;</highlight><highlight class="normal">,<sp/>rm.delay.interarrival_jitter,<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NUM_IN_RANGE(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>MAJ=%d&quot;</highlight><highlight class="normal">,<sp/>rm.delay.mean_abs_jitter,<sp/>0,<sp/>65535);</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="232"><highlight class="normal"></highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((available_metrics<sp/>&amp;<sp/>METRICS_SIGNAL)<sp/>!=<sp/>0){</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nSignal:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>SL=%d&quot;</highlight><highlight class="normal">,<sp/>rm.signal.level,<sp/>rm.signal.level<sp/>!=<sp/>127);</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>NL=%d&quot;</highlight><highlight class="normal">,<sp/>rm.signal.noise_level,<sp/>rm.signal.noise_level<sp/>!=<sp/>127);</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="238"><highlight class="normal"></highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*if<sp/>quality<sp/>estimates<sp/>metrics<sp/>are<sp/>available,<sp/>rtcp_xr_count<sp/>should<sp/>be<sp/>always<sp/>not<sp/>null*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((available_metrics<sp/>&amp;<sp/>METRICS_QUALITY_ESTIMATES)<sp/>!=<sp/>0){</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.quality_estimates.moslq,<sp/>1,<sp/>5,<sp/>moslq_str<sp/>=<sp/>float_to_one_decimal_string(rm.quality_estimates.moslq));</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IF_NUM_IN_RANGE(rm.quality_estimates.moscq,<sp/>1,<sp/>5,<sp/>moscq_str<sp/>=<sp/>float_to_one_decimal_string(rm.quality_estimates.moscq));</highlight></codeline>
<codeline lineno="243"><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nQualityEst:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>MOSLQ=%s&quot;</highlight><highlight class="normal">,<sp/>moslq_str);</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>MOSCQ=%s&quot;</highlight><highlight class="normal">,<sp/>moscq_str);</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="248"><highlight class="normal"></highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rm.user_agent!=NULL){</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\nLinphoneExt:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>UA=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>rm.user_agent);</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="253"><highlight class="normal"></highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(buffer,<sp/>size,<sp/>offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="255"><highlight class="normal"></highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(timestamps_start_str);</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(timestamps_stop_str);</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(network_packet_loss_rate_str);</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(jitter_buffer_discard_rate_str);</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*ms_free(gap_loss_density_str);*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(moslq_str);</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(moscq_str);</highlight></codeline>
<codeline lineno="263"><highlight class="normal">}</highlight></codeline>
<codeline lineno="264"><highlight class="normal"></highlight></codeline>
<codeline lineno="265"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>send_report(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref>*<sp/>call,<sp/><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>report,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>report_event)<sp/>{</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__misc_1gaec435ed53168e70535e64b69a906304b" kindref="member">LinphoneContent</ref><sp/>*content;</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>expires<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>offset<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>size<sp/>=<sp/>2048;</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>buffer;</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__event__api_1ga4befcba96583d9e9d9f2b775cccfb2b7" kindref="member">LinphoneEvent</ref><sp/>*lev;</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__linphone__address_1ga5af5a516ac253e3cda4f51b599a5385b" kindref="member">LinphoneAddress</ref><sp/>*request_uri;</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>domain;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>route;</highlight></codeline>
<codeline lineno="276"><highlight class="normal"></highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*if<sp/>we<sp/>are<sp/>on<sp/>a<sp/>low<sp/>bandwidth<sp/>network,<sp/>do<sp/>not<sp/>send<sp/>reports<sp/>to<sp/>not<sp/>overload<sp/>it*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__call__control_1gac3f7643e84b1afcfdcdcb6a19d821409" kindref="member">linphone_call_params_low_bandwidth_enabled</ref>(<ref refid="group__call__control_1ga768bbd4e2869556bc23830a7b1e4eb5c" kindref="member">linphone_call_get_current_params</ref>(call))){</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_warning(</highlight><highlight class="stringliteral">&quot;QualityReporting[%p]:<sp/>Avoid<sp/>sending<sp/>reports<sp/>on<sp/>low<sp/>bandwidth<sp/>network&quot;</highlight><highlight class="normal">,<sp/>call);</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">goto</highlight><highlight class="normal"><sp/>end;</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="283"><highlight class="normal"></highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*if<sp/>the<sp/>call<sp/>was<sp/>hung<sp/>up<sp/>too<sp/>early,<sp/>we<sp/>might<sp/>have<sp/>invalid<sp/>IPs<sp/>information</highlight></codeline>
<codeline lineno="285"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>in<sp/>that<sp/>case,<sp/>we<sp/>abort<sp/>the<sp/>report<sp/>since<sp/>it&apos;s<sp/>not<sp/>useful<sp/>data*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(report-&gt;info.local_addr.ip<sp/>==<sp/>NULL<sp/>||<sp/>strlen(report-&gt;info.local_addr.ip)<sp/>==<sp/>0</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>||<sp/>report-&gt;info.remote_addr.ip<sp/>==<sp/>NULL<sp/>||<sp/>strlen(report-&gt;info.remote_addr.ip)<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_warning(</highlight><highlight class="stringliteral">&quot;QualityReporting[%p]:<sp/>Trying<sp/>to<sp/>submit<sp/>a<sp/>%s<sp/>too<sp/>early<sp/>(call<sp/>duration:<sp/>%d<sp/>sec)<sp/>but<sp/>%s<sp/>IP<sp/>could<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;not<sp/>be<sp/>retrieved<sp/>so<sp/>dropping<sp/>this<sp/>report&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>call</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>report_event</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/><ref refid="group__call__control_1ga0ad1da7a56b11f5e0b2fe6f91d3d6bb5" kindref="member">linphone_call_get_duration</ref>(call)</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>(report-&gt;info.local_addr.ip<sp/>==<sp/>NULL<sp/>||<sp/>strlen(report-&gt;info.local_addr.ip)<sp/>==<sp/>0)<sp/>?<sp/></highlight><highlight class="stringliteral">&quot;local&quot;</highlight><highlight class="normal"><sp/>:<sp/></highlight><highlight class="stringliteral">&quot;remote&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">goto</highlight><highlight class="normal"><sp/>end;</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="297"><highlight class="normal"></highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buffer<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)<sp/>belle_sip_malloc(size);</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>content<sp/>=<sp/>linphone_content_new();</highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__misc_1ga66566afd0dfed5aa6ffeef8d01107115" kindref="member">linphone_content_set_type</ref>(content,<sp/></highlight><highlight class="stringliteral">&quot;application&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__misc_1gad108bbca12fa637acc4337bfdee84988" kindref="member">linphone_content_set_subtype</ref>(content,<sp/></highlight><highlight class="stringliteral">&quot;vq-rtcpxr&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="302"><highlight class="normal"></highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report_event);</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;CallID:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.call_id);</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;LocalID:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.local_addr.id);</highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;RemoteID:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.remote_addr.id);</highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;OrigID:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.orig_id);</highlight></codeline>
<codeline lineno="308"><highlight class="normal"></highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;LocalGroup:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.local_addr.group);</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;RemoteGroup:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.remote_addr.group);</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;LocalAddr:<sp/>IP=%s<sp/>PORT=%d<sp/>SSRC=%u\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.local_addr.ip,<sp/>report-&gt;info.local_addr.port,<sp/>report-&gt;info.local_addr.ssrc);</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;LocalMAC:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.local_addr.mac);</highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;RemoteAddr:<sp/>IP=%s<sp/>PORT=%d<sp/>SSRC=%u\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.remote_addr.ip,<sp/>report-&gt;info.remote_addr.port,<sp/>report-&gt;info.remote_addr.ssrc);</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;RemoteMAC:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.remote_addr.mac);</highlight></codeline>
<codeline lineno="315"><highlight class="normal"></highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;LocalMetrics:\r\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_metrics_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/>report-&gt;local_metrics);</highlight></codeline>
<codeline lineno="318"><highlight class="normal"></highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(are_metrics_filled(report-&gt;remote_metrics)!=0)<sp/>{</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;RemoteMetrics:\r\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_metrics_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/>report-&gt;remote_metrics);</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;DialogID:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>report-&gt;dialog_id);</highlight></codeline>
<codeline lineno="324"><highlight class="normal"></highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(report-&gt;qos_analyzer.timestamp!=NULL){</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;AdaptiveAlg:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>NAME=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.name);</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>TS=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.timestamp);</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>IN_LEG=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.input_leg);</highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>IN=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.input);</highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>OUT_LEG=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.output_leg);</highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;<sp/>OUT=\&quot;%s\&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.output);</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>append_to_buffer(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;\r\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="335"><highlight class="normal"></highlight></codeline>
<codeline lineno="336"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>TARGET_OS_IPHONE</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>namesize;</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*machine;</highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sysctlbyname(</highlight><highlight class="stringliteral">&quot;hw.machine&quot;</highlight><highlight class="normal">,<sp/>NULL,<sp/>&amp;namesize,<sp/>NULL,<sp/>0);</highlight></codeline>
<codeline lineno="341"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>machine<sp/>=<sp/>malloc(namesize);</highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sysctlbyname(</highlight><highlight class="stringliteral">&quot;hw.machine&quot;</highlight><highlight class="normal">,<sp/>machine,<sp/>&amp;namesize,<sp/>NULL,<sp/>0);</highlight></codeline>
<codeline lineno="343"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>APPEND_IF_NOT_NULL_STR(&amp;buffer,<sp/>&amp;size,<sp/>&amp;offset,<sp/></highlight><highlight class="stringliteral">&quot;Device:<sp/>%s\r\n&quot;</highlight><highlight class="normal">,<sp/>machine);</highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="345"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="346"><highlight class="normal"></highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__misc_1ga38a3adfd89fe3fc8e9bd51630a3080c9" kindref="member">linphone_content_set_buffer</ref>(content,<sp/>buffer,<sp/>strlen(buffer));</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(buffer);</highlight></codeline>
<codeline lineno="349"><highlight class="normal"></highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(call-&gt;log-&gt;reporting.on_report_sent<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>SalStreamType<sp/>type<sp/>=<sp/>report<sp/>==<sp/>call-&gt;log-&gt;reporting.reports[0]<sp/>?<sp/>LINPHONE_CALL_STATS_AUDIO<sp/>:<sp/>report<sp/>==<sp/>call-&gt;log-&gt;reporting.reports[1]<sp/>?<sp/>LINPHONE_CALL_STATS_VIDEO<sp/>:<sp/>LINPHONE_CALL_STATS_TEXT;</highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call-&gt;log-&gt;reporting.on_report_sent(call,<sp/>type,<sp/>content);</highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="354"><highlight class="normal"></highlight></codeline>
<codeline lineno="355"><highlight class="normal"></highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>route<sp/>=<sp/><ref refid="group__proxies_1ga1fcc3327df0fe15efb3b5a7f7f0d61cd" kindref="member">linphone_proxy_config_get_quality_reporting_collector</ref>(call-&gt;dest_proxy);</highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>domain<sp/>=<sp/>ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;sip:%s&quot;</highlight><highlight class="normal">,<sp/><ref refid="group__proxies_1ga946996ee0054eeb049fd1a360750b49e" kindref="member">linphone_proxy_config_get_domain</ref>(call-&gt;dest_proxy));</highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>request_uri<sp/>=<sp/><ref refid="group__linphone__address_1ga301c9884c0bc8b1050fe790d424e0b49" kindref="member">linphone_address_new</ref>(route<sp/>?<sp/>route<sp/>:<sp/>domain);</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(domain);</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lev=<ref refid="group__event__api_1ga61c9286b3c0ef0407140e9978c12e55a" kindref="member">linphone_core_create_publish</ref>(call-&gt;core,<sp/>request_uri,<sp/></highlight><highlight class="stringliteral">&quot;vq-rtcpxr&quot;</highlight><highlight class="normal">,<sp/>expires);</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(route)<sp/>{</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;Publishing<sp/>report<sp/>with<sp/>custom<sp/>route<sp/>%s&quot;</highlight><highlight class="normal">,<sp/>route);</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sal_op_set_route(lev-&gt;op,<sp/>route);</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="365"><highlight class="normal"></highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__event__api_1gae0974f02a99efad932a78e7a427f66f5" kindref="member">linphone_event_send_publish</ref>(lev,<sp/>content)<sp/>!=<sp/>0){</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__event__api_1ga6bc3c78014b8bece4512fecc2b94cd85" kindref="member">linphone_event_unref</ref>(lev);</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lev=NULL;</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret=4;</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>reset_avg_metrics(report);</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.timestamp,<sp/>NULL);</highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.input_leg,<sp/>NULL);</highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.input,<sp/>NULL);</highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.output_leg,<sp/>NULL);</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.output,<sp/>NULL);</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="378"><highlight class="normal"></highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__linphone__address_1ga5777f2976c71a48cf2b3f03c61818f13" kindref="member">linphone_address_destroy</ref>(request_uri);</highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__misc_1gade43cdd34f75b7dc7235eaf841878557" kindref="member">linphone_content_unref</ref>(content);</highlight></codeline>
<codeline lineno="381"><highlight class="normal"></highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>end:</highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_message(</highlight><highlight class="stringliteral">&quot;QualityReporting[%p]:<sp/>Send<sp/>&apos;%s&apos;<sp/>with<sp/>status<sp/>%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call,</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report_event,</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
<codeline lineno="388"><highlight class="normal"></highlight></codeline>
<codeline lineno="389"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="390"><highlight class="normal">}</highlight></codeline>
<codeline lineno="391"><highlight class="normal"></highlight></codeline>
<codeline lineno="392"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>SalStreamDescription<sp/>*<sp/>get_media_stream_for_desc(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>SalMediaDescription<sp/>*<sp/>smd,<sp/>SalStreamType<sp/>sal_stream_type)<sp/>{</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>count;</highlight></codeline>
<codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(smd<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(count<sp/>=<sp/>0;<sp/>count<sp/>&lt;<sp/>SAL_MEDIA_DESCRIPTION_MAX_STREAMS;<sp/>++count)<sp/>{</highlight></codeline>
<codeline lineno="396"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sal_stream_description_active(&amp;smd-&gt;streams[count])<sp/>&amp;&amp;<sp/>smd-&gt;streams[count].type<sp/>==<sp/>sal_stream_type)<sp/>{</highlight></codeline>
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>&amp;smd-&gt;streams[count];</highlight></codeline>
<codeline lineno="398"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="399"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="402"><highlight class="normal">}</highlight></codeline>
<codeline lineno="403"><highlight class="normal"></highlight></codeline>
<codeline lineno="404"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>update_ip(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*<sp/>call,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>stats_type)<sp/>{</highlight></codeline>
<codeline lineno="405"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>SalStreamType<sp/>sal_stream_type<sp/>=<sp/>stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_AUDIO<sp/>?<sp/>SalAudio<sp/>:<sp/>stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_VIDEO<sp/>?<sp/>SalVideo<sp/>:<sp/>SalText;</highlight></codeline>
<codeline lineno="406"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>SalStreamDescription<sp/>*<sp/>local_desc<sp/>=<sp/>get_media_stream_for_desc(call-&gt;localdesc,<sp/>sal_stream_type);</highlight></codeline>
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>SalStreamDescription<sp/>*<sp/>remote_desc<sp/>=<sp/>get_media_stream_for_desc(sal_call_get_remote_media_description(call-&gt;op),<sp/>sal_stream_type);</highlight></codeline>
<codeline lineno="408"><highlight class="normal"></highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(local_desc<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="410"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*since<sp/>this<sp/>function<sp/>might<sp/>be<sp/>called<sp/>for<sp/>video<sp/>stream<sp/>AFTER<sp/>it<sp/>has<sp/>been<sp/>uninitialized,<sp/>local<sp/>description<sp/>might</highlight></codeline>
<codeline lineno="411"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>be<sp/>invalid.<sp/>In<sp/>any<sp/>other<sp/>case,<sp/>IP/port<sp/>should<sp/>be<sp/>always<sp/>filled<sp/>and<sp/>valid*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(local_desc-&gt;rtp_addr)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="413"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call-&gt;log-&gt;reporting.reports[stats_type]-&gt;info.local_addr.port<sp/>=<sp/>local_desc-&gt;rtp_port;</highlight></codeline>
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(call-&gt;log-&gt;reporting.reports[stats_type]-&gt;info.local_addr.ip,<sp/>ms_strdup(local_desc-&gt;rtp_addr));</highlight></codeline>
<codeline lineno="415"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="417"><highlight class="normal"></highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(remote_desc<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="419"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*port<sp/>is<sp/>always<sp/>stored<sp/>in<sp/>stream<sp/>description<sp/>struct*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call-&gt;log-&gt;reporting.reports[stats_type]-&gt;info.remote_addr.port<sp/>=<sp/>remote_desc-&gt;rtp_port;</highlight></codeline>
<codeline lineno="421"><highlight class="normal"></highlight></codeline>
<codeline lineno="422"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*for<sp/>IP<sp/>it<sp/>can<sp/>be<sp/>not<sp/>set<sp/>if<sp/>we<sp/>are<sp/>using<sp/>a<sp/>direct<sp/>route*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(remote_desc-&gt;rtp_addr)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(call-&gt;log-&gt;reporting.reports[stats_type]-&gt;info.remote_addr.ip,<sp/>ms_strdup(remote_desc-&gt;rtp_addr));</highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(call-&gt;log-&gt;reporting.reports[stats_type]-&gt;info.remote_addr.ip,<sp/>ms_strdup(sal_call_get_remote_media_description(call-&gt;op)-&gt;addr));</highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="429"><highlight class="normal">}</highlight></codeline>
<codeline lineno="430"><highlight class="normal"></highlight></codeline>
<codeline lineno="431"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>qos_analyzer_on_action_suggested(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*user_data,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>datac,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">**<sp/>datav){</highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*report<sp/>=<sp/>(<ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref>*)user_data;</highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*call<sp/>=<sp/>report-&gt;call;</highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>appendbuf;</highlight></codeline>
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="436"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ptime<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>bitrate[3]<sp/>=<sp/>{-1,<sp/>-1,<sp/>-1};</highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>up_bw[3]<sp/>=<sp/>{-1,<sp/>-1,<sp/>-1};</highlight></codeline>
<codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>down_bw[3]<sp/>=<sp/>{-1,<sp/>-1,<sp/>-1};</highlight></codeline>
<codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MediaStream<sp/>*streams[3]<sp/>=<sp/>{<sp/>(MediaStream*)<sp/>call-&gt;audiostream,<sp/>(MediaStream<sp/>*)<sp/>call-&gt;videostream,<sp/>(MediaStream<sp/>*)<sp/>call-&gt;textstream<sp/>};</highlight></codeline>
<codeline lineno="441"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>3;<sp/>i++){</highlight></codeline>
<codeline lineno="442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(streams[i]<sp/>!=<sp/>NULL){</highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(streams[i]-&gt;encoder<sp/>!=<sp/>NULL){</highlight></codeline>
<codeline lineno="444"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ms_filter_has_method(streams[i]-&gt;encoder,MS_FILTER_GET_BITRATE)){</highlight></codeline>
<codeline lineno="445"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(streams[i]-&gt;encoder,MS_FILTER_GET_BITRATE,&amp;bitrate[i]);</highlight></codeline>
<codeline lineno="446"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>bitrate[i]<sp/>/=<sp/>1000;</highlight></codeline>
<codeline lineno="447"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="448"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="449"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>up_bw[i]<sp/>=<sp/>(int)(media_stream_get_up_bw(streams[i])/1000.f);</highlight></codeline>
<codeline lineno="450"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>down_bw[i]<sp/>=<sp/>(int)(media_stream_get_down_bw(streams[i])/1000.f);</highlight></codeline>
<codeline lineno="451"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="452"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="453"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(call-&gt;audiostream!=NULL){</highlight></codeline>
<codeline lineno="454"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(call-&gt;audiostream-&gt;ms.encoder!=NULL){</highlight></codeline>
<codeline lineno="455"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ms_filter_has_method(call-&gt;audiostream-&gt;ms.encoder,MS_AUDIO_ENCODER_GET_PTIME)){</highlight></codeline>
<codeline lineno="456"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_filter_call_method(call-&gt;audiostream-&gt;ms.encoder,MS_AUDIO_ENCODER_GET_PTIME,&amp;ptime);</highlight></codeline>
<codeline lineno="457"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="458"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="459"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="460"><highlight class="normal"></highlight></codeline>
<codeline lineno="461"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>appendbuf=ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s%d;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.timestamp?report-&gt;qos_analyzer.timestamp:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,<sp/>ms_time(0));</highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.timestamp,appendbuf);</highlight></codeline>
<codeline lineno="463"><highlight class="normal"></highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.input_leg,<sp/>ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s<sp/>aenc_ptime<sp/>aenc_br<sp/>a_dbw<sp/>a_ubw<sp/>venc_br<sp/>v_dbw<sp/>v_ubw<sp/>tenc_br<sp/>t_dbw<sp/>t_ubw&quot;</highlight><highlight class="normal">,<sp/>datav[0]));</highlight></codeline>
<codeline lineno="465"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>appendbuf=ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s%s<sp/>%d<sp/>%d<sp/>%d<sp/>%d<sp/>%d<sp/>%d<sp/>%d<sp/>%d<sp/>%d<sp/>%d;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.input?report-&gt;qos_analyzer.input:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,<sp/>datav[1],</highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ptime,<sp/>bitrate[0],<sp/>down_bw[0],<sp/>up_bw[0],<sp/>bitrate[1],<sp/>down_bw[1],<sp/>up_bw[1],<sp/>bitrate[2],<sp/>down_bw[2],<sp/>up_bw[2]);</highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.input,appendbuf);</highlight></codeline>
<codeline lineno="468"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.output_leg,<sp/>ms_strdup(datav[2]));</highlight></codeline>
<codeline lineno="469"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>appendbuf=ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s%s;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;qos_analyzer.output?report-&gt;qos_analyzer.output:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,<sp/>datav[3]);</highlight></codeline>
<codeline lineno="470"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.output,<sp/>appendbuf);</highlight></codeline>
<codeline lineno="471"><highlight class="normal">}</highlight></codeline>
<codeline lineno="472"><highlight class="normal"></highlight></codeline>
<codeline lineno="473"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>linphone_reporting_update_ip(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*<sp/>call)<sp/>{</highlight></codeline>
<codeline lineno="474"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>update_ip(call,<sp/>LINPHONE_CALL_STATS_AUDIO);</highlight></codeline>
<codeline lineno="475"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>update_ip(call,<sp/>LINPHONE_CALL_STATS_VIDEO);</highlight></codeline>
<codeline lineno="476"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>update_ip(call,<sp/>LINPHONE_CALL_STATS_TEXT);</highlight></codeline>
<codeline lineno="477"><highlight class="normal">}</highlight></codeline>
<codeline lineno="478"><highlight class="normal"></highlight></codeline>
<codeline lineno="479"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>linphone_reporting_update_media_info(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*<sp/>call,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>stats_type)<sp/>{</highlight></codeline>
<codeline lineno="480"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MediaStream<sp/>*<sp/>stream<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="481"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>PayloadType<sp/>*<sp/>local_payload<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="482"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>PayloadType<sp/>*<sp/>remote_payload<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="483"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__call__control_1gaa91f7e76e8f038ae9acdf42d1bc80a22" kindref="member">LinphoneCallParams</ref><sp/>*<sp/>current_params<sp/>=<sp/><ref refid="group__call__control_1ga768bbd4e2869556bc23830a7b1e4eb5c" kindref="member">linphone_call_get_current_params</ref>(call);</highlight></codeline>
<codeline lineno="484"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>report<sp/>=<sp/>call-&gt;log-&gt;reporting.reports[stats_type];</highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>dialog_id;</highlight></codeline>
<codeline lineno="486"><highlight class="normal"></highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>call-&gt;op<sp/>might<sp/>be<sp/>already<sp/>released<sp/>if<sp/>hanging<sp/>up<sp/>in<sp/>state<sp/>LinphoneCallOutgoingInit</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="488"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!media_report_enabled(call,<sp/>stats_type)<sp/>||<sp/>call-&gt;op<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="490"><highlight class="normal"></highlight></codeline>
<codeline lineno="491"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dialog_id<sp/>=<sp/>sal_op_get_dialog_id(call-&gt;op);</highlight></codeline>
<codeline lineno="492"><highlight class="normal"></highlight></codeline>
<codeline lineno="493"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.call_id,<sp/>ms_strdup(call-&gt;log-&gt;call_id));</highlight></codeline>
<codeline lineno="494"><highlight class="normal"></highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;local_metrics.user_agent,<sp/>ms_strdup(linphone_core_get_user_agent(call-&gt;core)));</highlight></codeline>
<codeline lineno="496"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;remote_metrics.user_agent,<sp/>ms_strdup(<ref refid="group__call__control_1ga33969d008c7faf43c9a38348f559269e" kindref="member">linphone_call_get_remote_user_agent</ref>(call)));</highlight></codeline>
<codeline lineno="497"><highlight class="normal"></highlight></codeline>
<codeline lineno="498"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>RFC<sp/>states:<sp/>&quot;LocalGroupID<sp/>provides<sp/>the<sp/>identification<sp/>for<sp/>the<sp/>purposes</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="499"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>of<sp/>aggregation<sp/>for<sp/>the<sp/>local<sp/>endpoint.&quot;.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="500"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.group,<sp/>ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s-%s-%s&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="501"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>dialog_id<sp/>?<sp/>dialog_id<sp/>:<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="502"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/></highlight><highlight class="stringliteral">&quot;local&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="503"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>report-&gt;local_metrics.user_agent<sp/>?<sp/>report-&gt;local_metrics.user_agent<sp/>:<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="504"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>)</highlight></codeline>
<codeline lineno="505"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
<codeline lineno="506"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.group,<sp/>ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s-%s-%s&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="507"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>dialog_id<sp/>?<sp/>dialog_id<sp/>:<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="508"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/></highlight><highlight class="stringliteral">&quot;remote&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="509"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>,<sp/>report-&gt;remote_metrics.user_agent<sp/>?<sp/>report-&gt;remote_metrics.user_agent<sp/>:<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="510"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>)</highlight></codeline>
<codeline lineno="511"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
<codeline lineno="512"><highlight class="normal"></highlight></codeline>
<codeline lineno="513"><highlight class="normal"></highlight></codeline>
<codeline lineno="514"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(call-&gt;dir<sp/>==<sp/><ref refid="group__call__logs_1ggaa3077de7d4214529094998ce441f61e1aa4030176bbddea10e361ce320946e202" kindref="member">LinphoneCallIncoming</ref>)<sp/>{</highlight></codeline>
<codeline lineno="515"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.id,<sp/><ref refid="group__linphone__address_1ga24c1a16f49f8b72f2bab65cc5d8a51af" kindref="member">linphone_address_as_string</ref>(call-&gt;log-&gt;from));</highlight></codeline>
<codeline lineno="516"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.id,<sp/><ref refid="group__linphone__address_1ga24c1a16f49f8b72f2bab65cc5d8a51af" kindref="member">linphone_address_as_string</ref>(call-&gt;log-&gt;to));</highlight></codeline>
<codeline lineno="517"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.orig_id,<sp/>ms_strdup(report-&gt;info.remote_addr.id));</highlight></codeline>
<codeline lineno="518"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="519"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.id,<sp/><ref refid="group__linphone__address_1ga24c1a16f49f8b72f2bab65cc5d8a51af" kindref="member">linphone_address_as_string</ref>(call-&gt;log-&gt;to));</highlight></codeline>
<codeline lineno="520"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.id,<sp/><ref refid="group__linphone__address_1ga24c1a16f49f8b72f2bab65cc5d8a51af" kindref="member">linphone_address_as_string</ref>(call-&gt;log-&gt;from));</highlight></codeline>
<codeline lineno="521"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.orig_id,<sp/>ms_strdup(report-&gt;info.local_addr.id));</highlight></codeline>
<codeline lineno="522"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="523"><highlight class="normal"></highlight></codeline>
<codeline lineno="524"><highlight class="normal"></highlight></codeline>
<codeline lineno="525"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;local_metrics.timestamps.start<sp/>=<sp/>call-&gt;log-&gt;start_date_time;</highlight></codeline>
<codeline lineno="526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;local_metrics.timestamps.stop<sp/>=<sp/>call-&gt;log-&gt;start_date_time<sp/>+<sp/><ref refid="group__call__control_1ga0ad1da7a56b11f5e0b2fe6f91d3d6bb5" kindref="member">linphone_call_get_duration</ref>(call);</highlight></codeline>
<codeline lineno="527"><highlight class="normal"></highlight></codeline>
<codeline lineno="528"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*we<sp/>use<sp/>same<sp/>timestamps<sp/>for<sp/>remote<sp/>too*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="529"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;remote_metrics.timestamps.start<sp/>=<sp/>call-&gt;log-&gt;start_date_time;</highlight></codeline>
<codeline lineno="530"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;remote_metrics.timestamps.stop<sp/>=<sp/>call-&gt;log-&gt;start_date_time<sp/>+<sp/><ref refid="group__call__control_1ga0ad1da7a56b11f5e0b2fe6f91d3d6bb5" kindref="member">linphone_call_get_duration</ref>(call);</highlight></codeline>
<codeline lineno="531"><highlight class="normal"></highlight></codeline>
<codeline lineno="532"><highlight class="normal"></highlight></codeline>
<codeline lineno="533"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*yet<sp/>we<sp/>use<sp/>the<sp/>same<sp/>payload<sp/>config<sp/>for<sp/>local<sp/>and<sp/>remote,<sp/>since<sp/>this<sp/>is<sp/>the<sp/>largest<sp/>use<sp/>case*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="534"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_AUDIO<sp/>&amp;&amp;<sp/>call-&gt;audiostream<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="535"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>stream<sp/>=<sp/>&amp;call-&gt;audiostream-&gt;ms;</highlight></codeline>
<codeline lineno="536"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>local_payload<sp/>=<sp/><ref refid="group__call__control_1gac7c352ef2c0c62a890fd870ffa7d0095" kindref="member">linphone_call_params_get_used_audio_codec</ref>(current_params);</highlight></codeline>
<codeline lineno="537"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>remote_payload<sp/>=<sp/>local_payload;</highlight></codeline>
<codeline lineno="538"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_VIDEO<sp/>&amp;&amp;<sp/>call-&gt;videostream<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="539"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>stream<sp/>=<sp/>&amp;call-&gt;videostream-&gt;ms;</highlight></codeline>
<codeline lineno="540"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>local_payload<sp/>=<sp/><ref refid="group__call__control_1ga7e40f1c18563b740cdf15d6a2c7f4fcf" kindref="member">linphone_call_params_get_used_video_codec</ref>(current_params);</highlight></codeline>
<codeline lineno="541"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>remote_payload<sp/>=<sp/>local_payload;</highlight></codeline>
<codeline lineno="542"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats_type<sp/>==<sp/>LINPHONE_CALL_STATS_TEXT<sp/>&amp;&amp;<sp/>call-&gt;textstream<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="543"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>stream<sp/>=<sp/>&amp;call-&gt;textstream-&gt;ms;</highlight></codeline>
<codeline lineno="544"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>local_payload<sp/>=<sp/><ref refid="group__call__control_1ga6f41e7ba60c99e0a853ccc574c3448f3" kindref="member">linphone_call_params_get_used_text_codec</ref>(current_params);</highlight></codeline>
<codeline lineno="545"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>remote_payload<sp/>=<sp/>local_payload;</highlight></codeline>
<codeline lineno="546"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="547"><highlight class="normal"></highlight></codeline>
<codeline lineno="548"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stream<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="549"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RtpSession<sp/>*<sp/>session<sp/>=<sp/>stream-&gt;sessions.rtp_session;</highlight></codeline>
<codeline lineno="550"><highlight class="normal"></highlight></codeline>
<codeline lineno="551"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;info.local_addr.ssrc<sp/>=<sp/>rtp_session_get_send_ssrc(session);</highlight></codeline>
<codeline lineno="552"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;info.remote_addr.ssrc<sp/>=<sp/>rtp_session_get_recv_ssrc(session);</highlight></codeline>
<codeline lineno="553"><highlight class="normal"></highlight></codeline>
<codeline lineno="554"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stream-&gt;qi<sp/>!=<sp/>NULL){</highlight></codeline>
<codeline lineno="555"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;local_metrics.quality_estimates.moslq<sp/>=<sp/>ms_quality_indicator_get_average_lq_rating(stream-&gt;qi)<sp/>&gt;=<sp/>0<sp/>?</highlight></codeline>
<codeline lineno="556"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MAX(1,<sp/>ms_quality_indicator_get_average_lq_rating(stream-&gt;qi))<sp/>:<sp/>-1;</highlight></codeline>
<codeline lineno="557"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;local_metrics.quality_estimates.moscq<sp/>=<sp/>ms_quality_indicator_get_average_rating(stream-&gt;qi)<sp/>&gt;=<sp/>0<sp/>?</highlight></codeline>
<codeline lineno="558"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MAX(1,<sp/>ms_quality_indicator_get_average_rating(stream-&gt;qi))<sp/>:<sp/>-1;</highlight></codeline>
<codeline lineno="559"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="560"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="561"><highlight class="normal"></highlight></codeline>
<codeline lineno="562"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;dialog_id,<sp/>ms_strdup_printf(</highlight><highlight class="stringliteral">&quot;%s;%u&quot;</highlight><highlight class="normal">,<sp/>dialog_id<sp/>?<sp/>dialog_id<sp/>:<sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,<sp/>report-&gt;info.local_addr.ssrc));</highlight></codeline>
<codeline lineno="563"><highlight class="normal"></highlight></codeline>
<codeline lineno="564"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(local_payload<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="565"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;local_metrics.session_description.payload_type<sp/>=<sp/>local_payload-&gt;type;</highlight></codeline>
<codeline lineno="566"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(local_payload-&gt;mime_type!=NULL)<sp/>STR_REASSIGN(report-&gt;local_metrics.session_description.payload_desc,<sp/>ms_strdup(local_payload-&gt;mime_type));</highlight></codeline>
<codeline lineno="567"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;local_metrics.session_description.sample_rate<sp/>=<sp/>local_payload-&gt;clock_rate;</highlight></codeline>
<codeline lineno="568"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(local_payload-&gt;recv_fmtp!=NULL)<sp/>STR_REASSIGN(report-&gt;local_metrics.session_description.fmtp,<sp/>ms_strdup(local_payload-&gt;recv_fmtp));</highlight></codeline>
<codeline lineno="569"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="570"><highlight class="normal"></highlight></codeline>
<codeline lineno="571"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(remote_payload<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="572"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;remote_metrics.session_description.payload_type<sp/>=<sp/>remote_payload-&gt;type;</highlight></codeline>
<codeline lineno="573"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;remote_metrics.session_description.payload_desc,<sp/>ms_strdup(remote_payload-&gt;mime_type));</highlight></codeline>
<codeline lineno="574"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report-&gt;remote_metrics.session_description.sample_rate<sp/>=<sp/>remote_payload-&gt;clock_rate;</highlight></codeline>
<codeline lineno="575"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;remote_metrics.session_description.fmtp,<sp/>ms_strdup(remote_payload-&gt;recv_fmtp));</highlight></codeline>
<codeline lineno="576"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="577"><highlight class="normal"></highlight></codeline>
<codeline lineno="578"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(dialog_id);</highlight></codeline>
<codeline lineno="579"><highlight class="normal">}</highlight></codeline>
<codeline lineno="580"><highlight class="normal"></highlight></codeline>
<codeline lineno="581"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>generate<sp/>random<sp/>float<sp/>in<sp/>interval<sp/>]<sp/>0.9<sp/>t<sp/>;<sp/>1.1<sp/>t<sp/>[*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="582"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>reporting_rand(</highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>t){</highlight></codeline>
<codeline lineno="583"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>t<sp/>*<sp/>(.2f<sp/>*<sp/>(rand()<sp/>/<sp/>(RAND_MAX<sp/>*<sp/>1.0f))<sp/>+<sp/>0.9f);</highlight></codeline>
<codeline lineno="584"><highlight class="normal">}</highlight></codeline>
<codeline lineno="585"><highlight class="normal"></highlight></codeline>
<codeline lineno="586"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>linphone_reporting_on_rtcp_update(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*call,<sp/>SalStreamType<sp/>stats_type)<sp/>{</highlight></codeline>
<codeline lineno="587"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>report<sp/>=<sp/>call-&gt;log-&gt;reporting.reports[stats_type];</highlight></codeline>
<codeline lineno="588"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref><sp/>*<sp/>metrics<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="589"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="struct__LinphoneCallStats" kindref="compound">LinphoneCallStats</ref><sp/>stats<sp/>=<sp/>call-&gt;stats[stats_type];</highlight></codeline>
<codeline lineno="590"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mblk_t<sp/>*block<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="591"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>report_interval;</highlight></codeline>
<codeline lineno="592"><highlight class="normal"></highlight></codeline>
<codeline lineno="593"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<sp/>media_report_enabled(call,stats_type))</highlight></codeline>
<codeline lineno="594"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="595"><highlight class="normal"></highlight></codeline>
<codeline lineno="596"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>report_interval<sp/>=<sp/><ref refid="group__proxies_1gab6eb2d0f234a917a55fff2e7dea55da8" kindref="member">linphone_proxy_config_get_quality_reporting_interval</ref>(call-&gt;dest_proxy);</highlight></codeline>
<codeline lineno="597"><highlight class="normal"></highlight></codeline>
<codeline lineno="598"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats.<ref refid="struct__LinphoneCallStats_1a8c4a17c47da3942990a657a72855acfd" kindref="member">updated</ref><sp/>==<sp/><ref refid="group__call__misc_1ga7bb50ca7cd1f49ebea13eec5136ef00e" kindref="member">LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE</ref>)<sp/>{</highlight></codeline>
<codeline lineno="599"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics<sp/>=<sp/>&amp;report-&gt;remote_metrics;</highlight></codeline>
<codeline lineno="600"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>block<sp/>=<sp/>stats.<ref refid="struct__LinphoneCallStats_1ae348f8e725ff57e8b43e1e48a7b9ad15" kindref="member">received_rtcp</ref>;</highlight></codeline>
<codeline lineno="601"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats.<ref refid="struct__LinphoneCallStats_1a8c4a17c47da3942990a657a72855acfd" kindref="member">updated</ref><sp/>==<sp/><ref refid="group__call__misc_1ga4418b7518b1479e9329b6de4129ed8c9" kindref="member">LINPHONE_CALL_STATS_SENT_RTCP_UPDATE</ref>)<sp/>{</highlight></codeline>
<codeline lineno="602"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics<sp/>=<sp/>&amp;report-&gt;local_metrics;</highlight></codeline>
<codeline lineno="603"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>block<sp/>=<sp/>stats.<ref refid="struct__LinphoneCallStats_1a6c4670ac143ef768db848ea7828b0f59" kindref="member">sent_rtcp</ref>;</highlight></codeline>
<codeline lineno="604"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="605"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">do</highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="606"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rtcp_is_XR(block)<sp/>&amp;&amp;<sp/>(rtcp_XR_get_block_type(block)<sp/>==<sp/>RTCP_XR_VOIP_METRICS)){</highlight></codeline>
<codeline lineno="607"><highlight class="normal"></highlight></codeline>
<codeline lineno="608"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>uint8_t<sp/>config<sp/>=<sp/>rtcp_XR_voip_metrics_get_rx_config(block);</highlight></codeline>
<codeline lineno="609"><highlight class="normal"></highlight></codeline>
<codeline lineno="610"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;rtcp_xr_count++;</highlight></codeline>
<codeline lineno="611"><highlight class="normal"></highlight></codeline>
<codeline lineno="612"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>for<sp/>local<sp/>mos<sp/>rating,<sp/>we&apos;ll<sp/>use<sp/>the<sp/>quality<sp/>indicator<sp/>directly</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="613"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>because<sp/>rtcp<sp/>XR<sp/>might<sp/>not<sp/>be<sp/>enabled</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="614"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stats.<ref refid="struct__LinphoneCallStats_1a8c4a17c47da3942990a657a72855acfd" kindref="member">updated</ref><sp/>==<sp/><ref refid="group__call__misc_1ga7bb50ca7cd1f49ebea13eec5136ef00e" kindref="member">LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE</ref>){</highlight></codeline>
<codeline lineno="615"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;quality_estimates.moslq<sp/>=<sp/>(rtcp_XR_voip_metrics_get_mos_lq(block)==127)<sp/>?</highlight></codeline>
<codeline lineno="616"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>127<sp/>:<sp/>rtcp_XR_voip_metrics_get_mos_lq(block)<sp/>/<sp/>10.f;</highlight></codeline>
<codeline lineno="617"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;quality_estimates.moscq<sp/>=<sp/>(rtcp_XR_voip_metrics_get_mos_cq(block)==127)<sp/>?</highlight></codeline>
<codeline lineno="618"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>127<sp/>:<sp/>rtcp_XR_voip_metrics_get_mos_cq(block)<sp/>/<sp/>10.f;</highlight></codeline>
<codeline lineno="619"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="620"><highlight class="normal"></highlight></codeline>
<codeline lineno="621"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;jitter_buffer.nominal<sp/>+=<sp/>rtcp_XR_voip_metrics_get_jb_nominal(block);</highlight></codeline>
<codeline lineno="622"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;jitter_buffer.max<sp/>+=<sp/>rtcp_XR_voip_metrics_get_jb_maximum(block);</highlight></codeline>
<codeline lineno="623"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;jitter_buffer.abs_max<sp/>=<sp/>rtcp_XR_voip_metrics_get_jb_abs_max(block);</highlight></codeline>
<codeline lineno="624"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;jitter_buffer.adaptive<sp/>=<sp/>(config<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>0x3;</highlight></codeline>
<codeline lineno="625"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;packet_loss.network_packet_loss_rate<sp/>=<sp/>rtcp_XR_voip_metrics_get_loss_rate(block);</highlight></codeline>
<codeline lineno="626"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;packet_loss.jitter_buffer_discard_rate<sp/>=<sp/>rtcp_XR_voip_metrics_get_discard_rate(block);</highlight></codeline>
<codeline lineno="627"><highlight class="normal"></highlight></codeline>
<codeline lineno="628"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;session_description.packet_loss_concealment<sp/>=<sp/>(config<sp/>&gt;&gt;<sp/>6)<sp/>&amp;<sp/>0x3;</highlight></codeline>
<codeline lineno="629"><highlight class="normal"></highlight></codeline>
<codeline lineno="630"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;delay.round_trip_delay<sp/>+=<sp/>rtcp_XR_voip_metrics_get_round_trip_delay(block);</highlight></codeline>
<codeline lineno="631"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rtcp_is_SR(block)){</highlight></codeline>
<codeline lineno="632"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MediaStream<sp/>*ms=(stats_type==0<sp/>?<sp/>&amp;call-&gt;audiostream-&gt;ms<sp/>:<sp/>&amp;call-&gt;videostream-&gt;ms);</highlight></codeline>
<codeline lineno="633"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>rtt<sp/>=<sp/>rtp_session_get_round_trip_propagation(ms-&gt;sessions.rtp_session);</highlight></codeline>
<codeline lineno="634"><highlight class="normal"></highlight></codeline>
<codeline lineno="635"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rtt<sp/>&gt;<sp/>1e-6){</highlight></codeline>
<codeline lineno="636"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;rtcp_sr_count++;</highlight></codeline>
<codeline lineno="637"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics-&gt;delay.round_trip_delay<sp/>+=<sp/>(int)(1000*rtt);</highlight></codeline>
<codeline lineno="638"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="639"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="640"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="keywordflow">while</highlight><highlight class="normal">(rtcp_next_packet(block));</highlight></codeline>
<codeline lineno="641"><highlight class="normal"></highlight></codeline>
<codeline lineno="642"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>check<sp/>if<sp/>we<sp/>should<sp/>send<sp/>an<sp/>interval<sp/>report<sp/>-<sp/>use<sp/>a<sp/>random<sp/>sending<sp/>time<sp/>to</highlight></codeline>
<codeline lineno="643"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dispatch<sp/>reports<sp/>and<sp/>avoid<sp/>sending<sp/>them<sp/>too<sp/>close<sp/>from<sp/>each<sp/>other<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="644"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((report_interval<sp/>&gt;<sp/>0)<sp/>&amp;&amp;<sp/>((float)(ms_time(NULL)<sp/>-<sp/>report-&gt;last_report_date)<sp/>&gt;<sp/>reporting_rand((</highlight><highlight class="keywordtype">float</highlight><highlight class="normal">)report_interval)))<sp/>{</highlight></codeline>
<codeline lineno="645"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>linphone_reporting_update_media_info(call,<sp/>stats_type);</highlight></codeline>
<codeline lineno="646"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>send_report(call,<sp/>report,<sp/></highlight><highlight class="stringliteral">&quot;VQIntervalReport&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="647"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="648"><highlight class="normal">}</highlight></codeline>
<codeline lineno="649"><highlight class="normal"></highlight></codeline>
<codeline lineno="650"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>publish_report(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*call,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*event_type){</highlight></codeline>
<codeline lineno="651"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="652"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="653"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>SAL_MEDIA_DESCRIPTION_MAX_STREAMS;<sp/>i++){</highlight></codeline>
<codeline lineno="654"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>stream_index<sp/>=<sp/>i<sp/>==<sp/>call-&gt;main_audio_stream_index<sp/>?<sp/>LINPHONE_CALL_STATS_AUDIO<sp/>:<sp/>call-&gt;main_video_stream_index<sp/>?<sp/>LINPHONE_CALL_STATS_VIDEO<sp/>:<sp/>LINPHONE_CALL_STATS_TEXT;</highlight></codeline>
<codeline lineno="655"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(media_report_enabled(call,<sp/>stream_index))<sp/>{</highlight></codeline>
<codeline lineno="656"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>sndret;</highlight></codeline>
<codeline lineno="657"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>linphone_reporting_update_media_info(call,<sp/>stream_index);</highlight></codeline>
<codeline lineno="658"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sndret=send_report(call,<sp/>call-&gt;log-&gt;reporting.reports[stream_index],<sp/>event_type);</highlight></codeline>
<codeline lineno="659"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sndret&gt;0){</highlight></codeline>
<codeline lineno="660"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>+=<sp/>10+(i+1)*sndret;</highlight></codeline>
<codeline lineno="661"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="662"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="663"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>+=<sp/>i+1;</highlight></codeline>
<codeline lineno="664"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="665"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="666"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="667"><highlight class="normal">}</highlight></codeline>
<codeline lineno="668"><highlight class="normal"></highlight></codeline>
<codeline lineno="669"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>linphone_reporting_publish_session_report(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref>*<sp/>call,<sp/>bool_t<sp/>call_term)<sp/>{</highlight></codeline>
<codeline lineno="670"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>session_type<sp/>=<sp/>call_term?</highlight><highlight class="stringliteral">&quot;VQSessionReport:<sp/>CallTerm&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;VQSessionReport&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="671"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>publish_report(call,<sp/>session_type);</highlight></codeline>
<codeline lineno="672"><highlight class="normal">}</highlight></codeline>
<codeline lineno="673"><highlight class="normal"></highlight></codeline>
<codeline lineno="674"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>linphone_reporting_publish_interval_report(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref>*<sp/>call)<sp/>{</highlight></codeline>
<codeline lineno="675"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>publish_report(call,<sp/></highlight><highlight class="stringliteral">&quot;VQIntervalReport&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="676"><highlight class="normal">}</highlight></codeline>
<codeline lineno="677"><highlight class="normal"></highlight></codeline>
<codeline lineno="678"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>bool_t<sp/>set_on_action_suggested_cb(MediaStream<sp/>*stream,</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>(*on_action_suggested)(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">**),</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*<sp/>u)<sp/>{</highlight></codeline>
<codeline lineno="679"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(stream&amp;&amp;stream-&gt;rc){</highlight></codeline>
<codeline lineno="680"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MSQosAnalyzer<sp/>*analyzer=ms_bitrate_controller_get_qos_analyzer(stream-&gt;rc);</highlight></codeline>
<codeline lineno="681"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(analyzer){</highlight></codeline>
<codeline lineno="682"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_qos_analyzer_set_on_action_suggested(analyzer,</highlight></codeline>
<codeline lineno="683"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>on_action_suggested,</highlight></codeline>
<codeline lineno="684"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>u);</highlight></codeline>
<codeline lineno="685"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>TRUE;</highlight></codeline>
<codeline lineno="686"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="687"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="688"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>FALSE;</highlight></codeline>
<codeline lineno="689"><highlight class="normal">}</highlight></codeline>
<codeline lineno="690"><highlight class="normal"></highlight></codeline>
<codeline lineno="691"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>linphone_reporting_call_state_updated(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*call){</highlight></codeline>
<codeline lineno="692"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__call__control_1ga37dad1a4f935d9cc26ec1f9d2b23691a" kindref="member">LinphoneCallState</ref><sp/>state=<ref refid="group__call__control_1ga4e66e41e6557ea35a07f266918741ffc" kindref="member">linphone_call_get_state</ref>(call);</highlight></codeline>
<codeline lineno="693"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(state<sp/>==<sp/><ref refid="group__call__control_1ggafc310fd9ba742f7730c632fd72b875eaac4a81296a6835482e65d51174eb16de4" kindref="member">LinphoneCallReleased</ref>||!quality_reporting_enabled(call)){</highlight></codeline>
<codeline lineno="694"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="695"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="696"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(state){</highlight></codeline>
<codeline lineno="697"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="group__call__control_1ggafc310fd9ba742f7730c632fd72b875eaacebe90cc045331e513d069872f9c84d3" kindref="member">LinphoneCallStreamsRunning</ref>:{</highlight></codeline>
<codeline lineno="698"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="699"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>MediaStream<sp/>*streams[3]<sp/>=<sp/>{<sp/>(MediaStream*)<sp/>call-&gt;audiostream,<sp/>(MediaStream<sp/>*)<sp/>call-&gt;videostream,<sp/>(MediaStream<sp/>*)<sp/>call-&gt;textstream<sp/>};</highlight></codeline>
<codeline lineno="700"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>SAL_MEDIA_DESCRIPTION_MAX_STREAMS;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="701"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>stream_index<sp/>=<sp/>i<sp/>==<sp/>call-&gt;main_audio_stream_index<sp/>?<sp/>LINPHONE_CALL_STATS_AUDIO<sp/>:<sp/>call-&gt;main_video_stream_index<sp/>?<sp/>LINPHONE_CALL_STATS_VIDEO<sp/>:<sp/>LINPHONE_CALL_STATS_TEXT;</highlight></codeline>
<codeline lineno="702"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>bool_t<sp/>enabled<sp/>=<sp/>media_report_enabled(call,<sp/>stream_index);</highlight></codeline>
<codeline lineno="703"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(enabled<sp/>&amp;&amp;<sp/>set_on_action_suggested_cb(streams[stream_index],<sp/>qos_analyzer_on_action_suggested,<sp/>call-&gt;log-&gt;reporting.reports[stream_index]))<sp/>{</highlight></codeline>
<codeline lineno="704"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call-&gt;log-&gt;reporting.reports[stream_index]-&gt;call=call;</highlight></codeline>
<codeline lineno="705"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(call-&gt;log-&gt;reporting.reports[stream_index]-&gt;qos_analyzer.name,<sp/>ms_strdup(ms_qos_analyzer_get_name(ms_bitrate_controller_get_qos_analyzer(streams[stream_index]-&gt;rc))));</highlight></codeline>
<codeline lineno="706"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="707"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="708"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>linphone_reporting_update_ip(call);</highlight></codeline>
<codeline lineno="709"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!media_report_enabled(call,<sp/>LINPHONE_CALL_STATS_VIDEO)<sp/>&amp;&amp;<sp/>call-&gt;log-&gt;reporting.was_video_running){</highlight></codeline>
<codeline lineno="710"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>send_report(call,<sp/>call-&gt;log-&gt;reporting.reports[LINPHONE_CALL_STATS_VIDEO],<sp/></highlight><highlight class="stringliteral">&quot;VQSessionReport&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="711"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="712"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call-&gt;log-&gt;reporting.was_video_running=media_report_enabled(call,<sp/>LINPHONE_CALL_STATS_VIDEO);</highlight></codeline>
<codeline lineno="713"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="714"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="715"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="group__call__control_1ggafc310fd9ba742f7730c632fd72b875eaafbeebb1285a2aab5d34e99d2e695e5be" kindref="member">LinphoneCallEnd</ref>:{</highlight></codeline>
<codeline lineno="716"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>set_on_action_suggested_cb(&amp;call-&gt;audiostream-&gt;ms,<sp/>NULL,<sp/>NULL);</highlight></codeline>
<codeline lineno="717"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>set_on_action_suggested_cb(&amp;call-&gt;videostream-&gt;ms,<sp/>NULL,<sp/>NULL);</highlight></codeline>
<codeline lineno="718"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(call-&gt;log-&gt;status==<ref refid="group__call__logs_1gga0896daf3cb167a43e357c3955ab33f3fa998fe35d090ed76fb89b23b3a8dfb0ff" kindref="member">LinphoneCallSuccess</ref><sp/>||<sp/>call-&gt;log-&gt;status==<ref refid="group__call__logs_1gga0896daf3cb167a43e357c3955ab33f3faeff436dddb49d4bf17d2e05a94b5bd59" kindref="member">LinphoneCallAborted</ref>){</highlight></codeline>
<codeline lineno="719"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>linphone_reporting_publish_session_report(call,<sp/>TRUE);</highlight></codeline>
<codeline lineno="720"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="721"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="722"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="723"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:{</highlight></codeline>
<codeline lineno="724"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="725"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="726"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="727"><highlight class="normal">}</highlight></codeline>
<codeline lineno="728"><highlight class="normal"></highlight></codeline>
<codeline lineno="729"><highlight class="normal"><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>linphone_reporting_new()<sp/>{</highlight></codeline>
<codeline lineno="730"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="731"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>rm<sp/>=<sp/>ms_new0(<ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref>,1);</highlight></codeline>
<codeline lineno="732"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structreporting__content__metrics" kindref="compound">reporting_content_metrics_t</ref><sp/>*<sp/>metrics[2]<sp/>=<sp/>{&amp;rm-&gt;local_metrics,<sp/>&amp;rm-&gt;remote_metrics};</highlight></codeline>
<codeline lineno="733"><highlight class="normal"></highlight></codeline>
<codeline lineno="734"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memset(rm,<sp/>0,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref>));</highlight></codeline>
<codeline lineno="735"><highlight class="normal"></highlight></codeline>
<codeline lineno="736"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>2;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="737"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;session_description.payload_type<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="738"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;session_description.sample_rate<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="739"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;session_description.frame_duration<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="740"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;session_description.packet_loss_concealment<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="741"><highlight class="normal"></highlight></codeline>
<codeline lineno="742"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;packet_loss.network_packet_loss_rate<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="743"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;packet_loss.jitter_buffer_discard_rate<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="744"><highlight class="normal"></highlight></codeline>
<codeline lineno="745"><highlight class="normal"></highlight></codeline>
<codeline lineno="746"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;jitter_buffer.adaptive<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="747"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;jitter_buffer.abs_max<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="748"><highlight class="normal"></highlight></codeline>
<codeline lineno="749"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;delay.end_system_delay<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="750"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;delay.interarrival_jitter<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="751"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;delay.mean_abs_jitter<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="752"><highlight class="normal"></highlight></codeline>
<codeline lineno="753"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;signal.level<sp/>=<sp/>127;</highlight></codeline>
<codeline lineno="754"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>metrics[i]-&gt;signal.noise_level<sp/>=<sp/>127;</highlight></codeline>
<codeline lineno="755"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="756"><highlight class="normal"></highlight></codeline>
<codeline lineno="757"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>reset_avg_metrics(rm);</highlight></codeline>
<codeline lineno="758"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>rm;</highlight></codeline>
<codeline lineno="759"><highlight class="normal">}</highlight></codeline>
<codeline lineno="760"><highlight class="normal"></highlight></codeline>
<codeline lineno="761"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>linphone_reporting_destroy(<ref refid="structreporting__session__report" kindref="compound">reporting_session_report_t</ref><sp/>*<sp/>report)<sp/>{</highlight></codeline>
<codeline lineno="762"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.call_id,<sp/>NULL);</highlight></codeline>
<codeline lineno="763"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.id,<sp/>NULL);</highlight></codeline>
<codeline lineno="764"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.id,<sp/>NULL);</highlight></codeline>
<codeline lineno="765"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.orig_id,<sp/>NULL);</highlight></codeline>
<codeline lineno="766"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.ip,<sp/>NULL);</highlight></codeline>
<codeline lineno="767"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.ip,<sp/>NULL);</highlight></codeline>
<codeline lineno="768"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.group,<sp/>NULL);</highlight></codeline>
<codeline lineno="769"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.group,<sp/>NULL);</highlight></codeline>
<codeline lineno="770"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.local_addr.mac,<sp/>NULL);</highlight></codeline>
<codeline lineno="771"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;info.remote_addr.mac,<sp/>NULL);</highlight></codeline>
<codeline lineno="772"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;dialog_id,<sp/>NULL);</highlight></codeline>
<codeline lineno="773"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;local_metrics.session_description.fmtp,<sp/>NULL);</highlight></codeline>
<codeline lineno="774"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;local_metrics.session_description.payload_desc,<sp/>NULL);</highlight></codeline>
<codeline lineno="775"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;local_metrics.user_agent,<sp/>NULL);</highlight></codeline>
<codeline lineno="776"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;remote_metrics.session_description.fmtp,<sp/>NULL);</highlight></codeline>
<codeline lineno="777"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;remote_metrics.session_description.payload_desc,<sp/>NULL);</highlight></codeline>
<codeline lineno="778"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;remote_metrics.user_agent,<sp/>NULL);</highlight></codeline>
<codeline lineno="779"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.name,<sp/>NULL);</highlight></codeline>
<codeline lineno="780"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.timestamp,<sp/>NULL);</highlight></codeline>
<codeline lineno="781"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.input_leg,<sp/>NULL);</highlight></codeline>
<codeline lineno="782"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.input,<sp/>NULL);</highlight></codeline>
<codeline lineno="783"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.output_leg,<sp/>NULL);</highlight></codeline>
<codeline lineno="784"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>STR_REASSIGN(report-&gt;qos_analyzer.output,<sp/>NULL);</highlight></codeline>
<codeline lineno="785"><highlight class="normal"></highlight></codeline>
<codeline lineno="786"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ms_free(report);</highlight></codeline>
<codeline lineno="787"><highlight class="normal">}</highlight></codeline>
<codeline lineno="788"><highlight class="normal"></highlight></codeline>
<codeline lineno="789"><highlight class="normal"></highlight></codeline>
<codeline lineno="790"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>linphone_reporting_set_on_report_send(<ref refid="group__call__control_1gac0a4861d7c4702c64f7106f2b893c69e" kindref="member">LinphoneCall</ref><sp/>*call,<sp/>LinphoneQualityReportingReportSendCb<sp/>cb){</highlight></codeline>
<codeline lineno="791"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>call-&gt;log-&gt;reporting.on_report_sent<sp/>=<sp/>cb;</highlight></codeline>
<codeline lineno="792"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/usr/src/slapt-src/network/linphone/linphone-3.9.1/coreapi/quality_reporting.c"/>
  </compounddef>
</doxygen>
