I
I
Igor2022-02-04 18:29:14
Asterisk
Igor, 2022-02-04 18:29:14

How to correctly calculate the quality of communication?

I found an article on Habré https://habr.com/ru/post/317746/
Interested in the mechanics / method of calculating the quality of communication.

According to the article, on the knee, using the formula R = 100 - (RTT / 10 + 2 * MaxLostPackets)
, I learned something like this
61fd46061fda2094067055.png

public function onRTCPReceived(EventMessage $event)
    {
        $channel = $event->getKey("Channel");
        
        if (!preg_match("/PJSIP\/\d+/s", $channel)) {
            return;
        }

        $this->channels[$channel] = [
            "From" => $event->getKey("From"),
            "Exten" => $event->getKey("Exten"),
            "SentPackets" => $event->getKey("SentPackets"),
            "SentOctets" => $event->getKey("SentOctets"),
            "Report0CumulativeLost" => $event->getKey("Report0CumulativeLost"),
            "RTT" => $event->getKey("RTT")
        ];

        // R = 100 - (RTT / 10 + 2 * MaxLostPackets)

        $this->table->setRows([]);
        $this->table->setHeaders([
            "Канал", "Качество"
        ]);
        foreach ($this->channels as $key => $item) {
            $r = 100 - ($item["RTT"] / 10+2* $item["Report0CumulativeLost"]);
            $this->table->addRow([
                $key, $r
            ]);
        }

        $this->output->write(sprintf("\033\143"));
        $this->table->render();
    }


Share experience who solved similar problems.
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question