pfSense Support Subscription

Author Topic: VoIP degradation of quality  (Read 253 times)

0 Members and 1 Guest are viewing this topic.

Offline joelones

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
VoIP degradation of quality
« on: December 01, 2017, 02:31:30 pm »
I currently have an Asterisk Raspberry Pi box doing my VoIP behind of pfsense, incoming calls come in fine and all but what I do notice is the stuttering and clarity of the call degrades. More os, others, while talking to have remarked that my voice tends to degrade to that of a robot over time.

"Firewall Optimization Option" is set to Conservative in pfsense and I'm not port forward or anything else.

 On the Asterisk side registrations are set to 120s and my trunk with freephoneline.ca is set up as follows:

Code: [Select]
context=from-trunk
host=voip.freephoneline.ca
username=
secret=
type=friend
insecure=port,invite
dtmfmode=auto
disallow=all
allow=ulaw&g729
fromdomain=voip.freephoneline.ca
canreinvite=no
qualify=yes
nat=yes

Any random thoughts on what could be going on here?

Offline KOM

  • Hero Member
  • *****
  • Posts: 5402
  • Karma: +671/-19
    • View Profile
Re: VoIP degradation of quality
« Reply #1 on: December 01, 2017, 02:42:02 pm »
If the signalling and data flow are working and the only problem is poor call quality, you may have a local contention issue that can be solved by traffic shaping.  Is it always the same poor quality, or does it randomly change between good & bad?  What kind of link do you have, and how saturated is it?  If you have a fast link with lots of spare bandwidth, it might be your VoIP provider is oversubscribing their trunks.  I use smokeping to monitor how busy my VoIP provider's designated IP address is.  Regular packet loss is a clue that that IP might be too busy.

Offline joelones

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: VoIP degradation of quality
« Reply #2 on: December 01, 2017, 02:48:06 pm »
If the signalling and data flow are working and the only problem is poor call quality, you may have a local contention issue that can be solved by traffic shaping.  Is it always the same poor quality, or does it randomly change between good & bad?  What kind of link do you have, and how saturated is it?  If you have a fast link with lots of spare bandwidth, it might be your VoIP provider is oversubscribing their trunks.  I use smokeping to monitor how busy my VoIP provider's designated IP address is.  Regular packet loss is a clue that that IP might be too busy.

It randomly changes on me. I've got a 30Mbps connection and I'm not saturating my link. I'd put money on the VoIP provider being the culprit. Never heard of smokeping, difficult to use?

Offline KOM

  • Hero Member
  • *****
  • Posts: 5402
  • Karma: +671/-19
    • View Profile
Re: VoIP degradation of quality
« Reply #3 on: December 01, 2017, 02:53:56 pm »
Quote
Never heard of smokeping, difficult to use?

https://oss.oetiker.ch/smokeping/

You can install it on your pi as its already in the repo. You only need to edit the General and Targets files in /etc/smokeping/config.d
« Last Edit: December 01, 2017, 02:57:13 pm by KOM »

Offline virgiliomi

  • Sr. Member
  • ****
  • Posts: 553
  • Karma: +74/-4
    • View Profile
Re: VoIP degradation of quality
« Reply #4 on: December 02, 2017, 06:07:39 am »
Just a note though, that some larger VoIP services may use a single hostname, then rotate servers using SRV records under that hostname. In fact, the hostname that could be used could point to their website, but the SRV records within could point to their VoIP servers elsewhere, not even in the same physical location. That makes monitoring a bit harder.

If it's not your bandwidth that is the issue, other potential issues could be the audio format being used for the call - check your Pi's CPU usage during the call; it may be having to convert audio formats and could be falling behind over time - or issues on your provider's end. Try setting up a phone, SIP client, or ATA to point directly to your provider and see if it happens there as well.

Offline joelones

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: VoIP degradation of quality
« Reply #5 on: December 02, 2017, 11:35:18 am »
If it's not your bandwidth that is the issue, other potential issues could be the audio format being used for the call - check your Pi's CPU usage during the call; it may be having to convert audio formats and could be falling behind over time - or issues on your provider's end. Try setting up a phone, SIP client, or ATA to point directly to your provider and see if it happens there as well.

You could be on to something, I realize that I tend to experience the issue more so from my softphone on my desktop than I do with my other extensions which are on separate ATAs. Will try other softphone software and monitor the pi's cpu, and see. Thanks.

Offline virgiliomi

  • Sr. Member
  • ****
  • Posts: 553
  • Karma: +74/-4
    • View Profile
Re: VoIP degradation of quality
« Reply #6 on: December 02, 2017, 05:32:38 pm »
It could be the codec that your softphone is using. If you can change the codec order in the softphone, or change it to use the same codec that your ATAs are using, that might be a big help to keep the Pi from having to transcode the audio data.

Offline AndrewZ

  • Full Member
  • ***
  • Posts: 255
  • Karma: +19/-0
    • View Profile
Re: VoIP degradation of quality
« Reply #7 on: December 03, 2017, 11:45:38 am »
First of all make a clean test, without Asterisk & pfSense, with ATA or softphone on PC directly connected to ISP.
Make sure g729 is not used.
Then put pfSense back in line and test again, then add Asterisk and test again.

Offline joelones

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: VoIP degradation of quality
« Reply #8 on: December 07, 2017, 02:33:47 pm »
I've now encounter a much greater issue. I've just changed internet provider and now I'm no longer able to login into my voip service. Asterisk just reports:

Code: [Select]
[2017-12-07 15:31:21] NOTICE[1851] chan_sip.c:    -- Registration for 'XXXX@voip.freephoneline.ca' timed out, trying again (Attempt #4)
Retransmission timeout reached on transmission 54c74f50662fbd7743d6187a76a22e8a@127.0.1.1 for seqno 103 (Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 31999ms with no response

Ping voip.freephoneline.ca seems to be up and telnet voip.freephoneline.ca 5060 does not connect (I would assume it should?)

I also tried to run my Asterisk box via my vpn to PIA and still see the same issue, I don't thinks it's my provider blocking ports...

It was working well prior to the change of provider, not sure what could have happened. Any suggestion on how I could troubleshoot this? I don't think this is an issue with the voip service as I've checked their forums and I don't see an outage.
« Last Edit: December 07, 2017, 02:52:36 pm by joelones »

Offline AndrewZ

  • Full Member
  • ***
  • Posts: 255
  • Karma: +19/-0
    • View Profile
Re: VoIP degradation of quality
« Reply #9 on: December 07, 2017, 02:54:03 pm »
Any suggestion on how I could troubleshoot this?

Better to ask at Asterisk forum as there is no evidence that pfSense is guilty.
General advise - forget about generic Asterisk log and check your SIP signalling.