Help investigating internal sound delay

Hi to all,
I hope to find someone that can point me to the right direction and fix this annoyng problem.
I’m a senior IT in italy and in the last mounths I builded up a freepbx system for a 60 employers call center with 4 trunks. Due some pjsip needed features I have complete disabled chan_sip, so every trunk and extensions is chan_pjsip. Everythink works good, but I have this annoying problem with internal calls delay (and external but that the fact that I have this problem even for internal calls, make me thinks that is not related to some trunk configuration).
This is what happens:
ext100 calls ext101, voice is very good and instantly, after let’s say 50 seconds the voice delay about 2 seconds. sometimes delays istantly.
in every trunk,sip configuration and fanvil ipphone I have this order of codec
using a different codec order doesn’t fix the issue.
Maybe someone can suggest a kind of log to report so I find a starting point. I’m not sure but I think that this is related to transcoding and codecs.
I know that this is not a freepbx support forum but I didn’t receive response for my problem in many forums and maybe here I can find a solution.
asterisk is 13.17.2 and freepbx is FreePBX
many thanks

investigating I found that the delay come when there is a ring coming from outside or during 4 or 5 calls, but is very strange cause network have a lot of available bandwith and cpu ram are always at 30%…


As I understood, you are experiencing delays both for internal and external calls, correct?
Have you tried the following:

  • For internal calls, bypass Asterisk for media processing by setting direct_media=no for extensions?
  • Align on the codecs between endpoint so that the transcoding does not occur?

Does the issue persist after these manipulations?

1 Like

after a lot of researches I found that enabling a lot of blf in my network introduces a voice delay during external calls ringing. deativating blf on 2/3 of my ip phones fixed the issue. I have around 40 total fanvil X4g and 30 that rings all simultaneously with 30blf keys in every phone so around 120blf keys. network is GB and firmware version the latest. This is a production call center and external calls rings continuously so this delay is not acceptable. any idea to fix this?

A friendly reminder The option is directmedia, Also BLF add more traffic to your network as devices creceive notification of state changes for the subscribed to extension in the form of SIP NOTIFY, but dont think this will impact the network to add some latency on the media stream, have you enabled the rtp set debug on

thanks for your reply, codecs are in same order in all places(trunka pjsip conf extension and fanvil phones) like this
this order is suggest by my voip provider.
directmedia is already no by default in pjsip and as I already wrote sip_chan is completely disabled. I have made some rtp inspection through tcp dump and wireshark to view some packet loss or jitter or anything else but everything looks perfect. I think that maybe is an issue on fanvil phones, maybe the cpu of the phone itself is working in a bad way when there is so much blf sip notify. I think this because the problem occours only during the ringing, let’s suppose that 100 calls are running all together without ringing, everything will work flawless but if an external ring changes the blf key status I will have 1 second of delay for every incoming ring and slowly the delay will disappear after stops ringing, in example if I disable the call waiting feature seems to fix a little the problem. for now I have disabled all blf and everything is perfect. maybe 30 blf keys are too much for these phones and yes the delay occours in internal calls I have made ridiculous tests to hear my voice beetween two internal phones during an external ring.