Mean Opinion Score (MOS) Calculation of Asterisk VoIP calls

Spread the love

Asterisk MOS calculation using Channel Stats

If you running asterisk box as PBX or call center server, you might want to know the quality of the calls. In the VoIP world, We often use Mean Opinion Score or MOS as a call quality metric for VoIP calls.  So in this tutorial we will try to calculate the MOS of Asterisk Calls.

What is MOS ( Mean Opinion Score ) :

MOS score is the Call quality score which is calculated by considering Network related things like Latency, Packet Loss and Jitter. MOS score is a value between the 1 and 5.

MOS value of 1 ( one ) is unacceptable call, and MOS value of three 3 means Okay and MOS value of 5 means Excellent call quality.

MOS Value Quality
5 Excellent
4 Good
3 Fair
2 Poor
1 Bad

There are many algorithms used to calculate the MOS values but I came across one Algorithm from PingPlotter. I tested with few calls and found it is working good.

Calculating the MOS for Asterisk Calls :

Asterisk provides few RTCP statistics in the Dialplan. We can get those RTCP statistics by calling  channel  dialplan function. Usually, I calculate the call quality at the hang-up extension i.e at 'h'  extension of Asterisk Dialplan.

So go ahead and add the following extension in the desired context.

Here is the sample output:

RTCP Values :

Here we have two legs for our call, One is between the Caller to Asterisk and then Asterisk to Callee.

Note: In above example call, I generated call using Asterisk Call file. So Receiving end, don’t have many values.

Receiver End :

ssrc  means our ( Receiver) ssrc
rxcount  means the number of packets received.
lp means lost packets/Lost packets
rxjitter means our calculated jitter(rx)/Jitter

Sender End:

themssrc means their ssrc
txcount means transmitted packets/Sent packet
rlp means remote lost packets/Lost packets
txjitter means reported jitter of the other end/Jitter

Round Trip Time :

rtt – round trip time/RTT

Now we can pass these values to any AGI Script to calculate the MOS using following formula.

The formula to calculate the MOS ( Mean Opinion Score ) for VoIP and Asterisk Calls :

Here is the PingPlotter formula to calculate the MoS score.

 

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer, Presently working as a Software Engineer. I love Linux and Open Source. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply