7

Click here to load reader

Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

Embed Size (px)

DESCRIPTION

This howto describes how easily one can enable VoIP QoS monitoring just by utilizing a SIP phone (in the example we used pjsip/pjsua) and Sevana NIQA for single-ended voice quality assessment to receive call MOS scores.

Citation preview

Page 1: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

Turn your free SIP softphone into a voicequality monitoring instrument with Sevana'sNIQA application.

The purpose of this quick howto document is to show that implementation of a voice qualitymonitoring system may be relatively simple. The most complicated task is to find an easy touse and cost effective solution that would provide a perceptual evaluation of voice/speechquality recorded by your SIP-system. However, Sevana NIQA was an easy choice.

We decided to use one of the most popular free SIP softphones – pjsip (www.pjsip.org).This is a cute, light, but powerful tool that can do the two main things required for creatinga VQM system:

• functionality to make SIP calls – obviously all SIP phones have this functionality• ability to play and record audio files

If you have a SIP software phone that supports these two features (and most likely any ofthem does) then by using Sevana's AQuA or NIQA product you can setup a simple VoiceQuality Monitoring (VQM) within a couple of minutes.

First of all you need to have a SIP account (although calling to an IP address is alsopossible). We have used free sip accounts provided by www.realsip.com. Then you shouldcreate a configuration file for your SIP-phone that will serve as an answering machine. Thisfile may be as simple as the following:

# we don't want the host's audio device#--null-audio

# SIP parameters--realm realsip.com--registrar sip:realsip.com # DNS SRV, or FQDN--id sip:[email protected] XXXXXX--password YYYYYY

# default of 55 will be rejected as being too short by sipX--reg-timeout 3600

# auto-answer all calls with "200 OK"--auto-answer 200

# limit call duration – this maybe actually important if you like toautomatically hang up after the test call is# finished#--duration 20

Page 2: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

# automatically loop incoming RTP to outgoing RTP – maybe usefulsometimes, but not this time#--auto-loop# mix WAV file into the audio stream--play-file AE1F5901.wav # This is the audio that is going to be playedto the calling party# we would recommnd using Sevana speech model file that AQuA cangenerate, but this time we have# chosen a sample test audio in French

# This command tells the softphone to record incoming calls intocall.wav file stored in the same folder--rec-file call.wav

# This is important command to tell the softphone that audio samplingrate should be 8kHz, because NIQA# product can test only speech signals at 8kHz (although AQuA can testany type of audio: voice, HD Voice# and even HD Audio)--clock-rate=8000

# This command tells the system to automatically play the audio file weset (in this case AE1F5901.wav)--auto-play

# And this command enables recording of incoming call--auto-rec

# These are two important commands that set level of details in the logfile (3 is just what we need, but you# can check pjsip manual for other options), and the call log will bestored in log.txt – perfect!--log-level=3--log-file=log.txt

Amazingly, but for a simple voice quality monitoring solution the server part is pretty muchready! Let's configure PJSIP for the calling party:

# SIP parameters--realm realsip.com--registrar sip:realsip.com # DNS SRV, or FQDN--id sip:[email protected] XXXXXXX--password YYYYYYY

# default of 55 will be rejected as being too short by sipX--reg-timeout 3600

Page 3: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

# limit call duration – alright, we want to hangup after 20 seconds--duration 20

# mix WAV file into the audio stream# Note, this is another audio that wll be played to our voice qualitymonitoring “server”--play-file test.wav

# And this call.wav will be stored on the client side--rec-file call.wav--clock-rate=8000--auto-play--auto-rec--log-level=3--log-file=log.txt

Now let's go for the first voice quality test! Yes, it's that simple:

On the server side run:

pjsua –config-file=config.cfg

Wait till the server boots and switches to waiting for a call status. And then on the clientside issue the command:

pjsua –config-file=config.cfg sip:[email protected]

You will see how the client will make a call, and the server will respond (even just bychanges in the command line windows of the server and the client). Then after 20 secondsthe calling party will hangup like it was written in the configuration file. Let's see what wehave got...

Client side:

We have a log.txt file containing important data about VoIP call parameters:

[DISCONNCTD] To:sip:[email protected];tag=5eca32938acd491c88739797ad3a3d09Call time: 00h:00m:20s, 1st res in 1191 ms, conn in 1193msSRTP status: Not active Crypto-suite: (null)#0 speex @16KHz, sendrecv, peer=192.168.0.190:4000RX pt=103, stat last update: 00h:00m:00.931s agototal 685pkt 45.3KB (72.7KB +IP hdr) @avg=17.9Kbps/28.7Kbpspkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)(msec) min avg max last devloss period: 0.000 0.000 0.000 0.000 0.000jitter : 0.000 17.254 57.000 19.250 5.127TX pt=103, ptime=20ms, stat last update: 00h:00m:01.941s agototal 700pkt 46.4KB (74.4KB +IP hdr) @avg 18.3Kbps/29.4Kbpspkt loss=1 (0.1%), dup=0 (0.0%), reorder=0 (0.0%)

Page 4: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

(msec) min avg max last devloss period: 20.000 20.000 20.000 20.000 0.000jitter : 0.000 22.700 35.437 21.750 12.653RTT msec : 2.563 5.744 12.999 3.082 4.237

And we also have call.wav, which contains the audio recorded on the server side.Now it's time to use Sevana NIQA to obtain a MOS score of the call:

niqa -rdf TstBase.nbf -gqa call.wav

And the result is:

Sevana NonIntrusive Audio Quality Analyzer - NIQA v.1.1.1.24.Copyright (c) 2010 by Sevana Oy, Finland. All rights reserved.---------------------------------------------------------------Database loaded!Quality of file 'C:\NIQA\SIP\call.wav' is 3.337179.Used next Asins: 'FFr4'Quality score calculated!

Wow! NIQA not only provided the MOS score (MOS = 3.34), but was also able to recognizethat it was a Female voice speaking in French (Ffr4). MOS score is pretty good, but themost important thing is that we can now create the first record of voice quality monitoring:

Total, pkt Total, KB Avg, Kbps Pkt loss Jitter,Avg. MOS

RX 685 45.3 17.9 28.7 0 17.254 3.34

TX 700 46.4 18.3 29.4 0.1 22.7

And another important characteristic: RTT msec : 2.563 5.744 12.999 3.082 4.237

So, we know quite a lot about the VoIP conditions of the incoming call as well as that thecall quality was good (MOS is quite high).

Server side:

Here we also have a log.txt file containing the same important data about VoIP callparameters:

[DISCONNCTD] To:<sip:[email protected]>;tag=6878cb877e224f89bbad8cbcb66df63bCall time: 00h:00m:20s, 1st res in 79 ms, conn in 297msSRTP status: Not active Crypto-suite: (null)#0 speex @16KHz, sendrecv, peer=192.168.0.167:4000RX pt=103, stat last update: 00h:00m:01.781s agototal 690pkt 45.7KB (73.3KB +IP hdr) @avg=18.0Kbps/28.9Kbpspkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)(msec) min avg max last devloss period: 0.000 0.000 0.000 0.000 0.000

Page 5: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

jitter : 0.562 23.396 221.500 221.500 6.725TX pt=103, ptime=20ms, stat last update: 00h:00m:04.953s agototal 700pkt 46.4KB (74.4KB +IP hdr) @avg 18.3Kbps/29.4Kbpspkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)(msec) min avg max last devloss period: 0.000 0.000 0.000 0.000 0.000jitter : 16.125 18.021 19.437 19.437 1.393RTT msec : 2.853 13.575 34.667 2.853 14.915

Now the same procedure with the call.wav file that was created on the server side:

niqa -rdf TstBase.nbf -gqa call.wav

And the result is:

Sevana NonIntrusive Audio Quality Analyzer - NIQA v.1.1.1.24.Copyright (c) 2010 by Sevana Oy, Finland. All rights reserved.---------------------------------------------------------------Database loaded!Quality of file 'C:\NIQA\SIP\call.wav' is 3.329050.Used next Asins: 'FFr4'Quality score calculated!

Alright, now we can build the same call quality monitoring record as we did for the callingparty:

Total, pkt Total, KB Avg, Kbps Pkt loss Jitter,Avg. MOS

RX 690 45.7 18.0 28.9 0 23.396 3.33

TX 700 46.4 18.3 29.4 0 18.021

Finally: RTT msec : 2.853 13.575 34.667 2.853 14.915

Calling party and called party voice quality records:

Now we can compare two records and evaluate what this gives to us:

Calling party:

Total, pkt Total, KB Avg, Kbps Pkt loss Jitter,Avg. MOS

Page 6: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

RX 685 45.3 17.9 28.7 0 17.254 3.34

TX 700 46.4 18.3 29.4 0.1 22.7

Called party:

Total, pkt Total, KB Avg, Kbps Pkt loss Jitter,Avg. MOS

RX 690 45.7 18.0 28.9 0 23.396 3.33

TX 700 46.4 18.3 29.4 0 18.021

As one can see there are not many differences and the quality score is quite good andstable both for transmitted and received audio, now how can we use these records for ourQoS analysis?

QoS Monitoring Solution

As long as the quality remains quite high this analysis and call quality data stored in adatabase (like MySQL f.e.) is not that useful, but how to detect that the quality went down?Only by R-value calculation is not the best approach, and therefore we suggest the followingcase for your consideration:

1. QoS monitoring system based on obtaining MOS scores provided by Sevana NIQAand VoIP parameters is running and storing call quality records for statistics

2. The system always monitors MOS value as the key voice quality indicator3. MOS score drops down, let's say below 24. The system searching for a call quality record with the highest MOS score and

matches its parameters against parameters of the “bad call”.5. The system immediately will be able to indicate what are the reasons for the quality

loss, because it can compare all main network parameters for high and low MOSscores.

6. The system will be able to continously provide speech quality scores for all calls thusallowing to visualize what trunks, routes, destinations are a matter of lower quality

What's the catch?

Well, there is no catch... Well, there is always a catch, but this time it's very simple:

We hope we have shown with this small howto a simple approach that will allow anybody tobuild his own QoS monitoring solution based just on a software SIP phone allowing tomonitor... not, not the voice or speech quality of VoIP calls, but:

1. how many times your VoIP customers are happy about your service

Page 7: Turn your sip_softphone_into_a_voice_quality_monitoring_instrument

2. what makes your customers unhappy in your service3. where is the problem that makes your customers unhappy4. where to search for the problem origin

And if you doubt that we can help really anybody to enable his own QoS monitoring, justthink of answering a couple of questions:

• Is it expensive is loosing customers due to making them unhappy of making calls inyour system?

• Is it important to be sure that your Service Level Agreement (SLA) is always valid?• Do you know enough about Sevana NIQA?• Have you contacted Sevana concerning using NIQA for your OoS system?

If you don't know answer even to just one of the questions, please contact us: give us acall, send an email, we'll get back to you immediately and we are sure you will be pleasedwith what our voice quality assessment software can do to keep your customers happy andyou aware of having control over your VoIP system.

We are sure that NIQA is just what youneed...

...because:

• Available for evaluation• Strong competitor for ITU P.563/P.564• Ability to be trained to detect reasons for quality loss• Ability to be trained for customer specific needs• Multi-platform• High performance• Outstanding pricing• Available as online service