Voice is not clear with Asterisk server


Hi Friends,

       I tried to connect two Analog phones and a SJPhone(Softphone) to Asterisk server. Here all three phones are registering with the server properly. And i gave the option as [b]directmedia=no[/b] that means all RTP packets should pass through Asterisk server. 

       Here two analog phones are in one network and SJphone is in different network. I am connecting these two networks to the Asterisk server. 

        When i give the option [b]directmedia=yes[/b] i can hear the voice clearly, between both sides from SJPhone to analog phone and between analog phones also.  But when i give the option [b]directmedia=no[/b] the voice is getting noise and fluctuated. 

       Can any one tell me what was the problem.

Naga Vardhan.


Overloaded network or trying to run Asterisk on hardware that is doing other work.


Hi David,

         Is there any other solution to make it work.



Find the specific cause and remove it, e.g. reduce the loading on the network, prioritise RTP traffic on the network, run Asterisk on real hardware, rather than a virtual machine, etc.


It’s worth checking for packet loss (ping) from each location to the server and also check the asterisk network interface for errors (using ifconfig for example).



      I check the network connectivity, i am getting all packets using ping command. The problem i am getting, when i redirect the RTP packets through Asterisk server.



In that case the server itself is overloaded.


Note that, with ping, 100% return is not sufficient. They have to return quickly as well.


Hi David,

           I am running only two analog phones, and one server. In that case how it will get overloaded.



Use the same codec on both phone.
Do not make asterisk transcode.



       I'll explain the exact setup. I have a board named HONT, to that HONT 5 Ethernet ports among them only 1 ether net port using, 2 RJ 45 connectors to connect analog phones. I have a configuration file to configure VoIP, which is there in board. In that configuration file i am configuring the extension, line number, and codec type and server settings. I am giving same codec name on both lines. 

      Now i am configuring the optical data path from HONT to OLT (Optical Line Termination). And from OLT to one of the Ethernet interfaces of PC where Asterisk server is running. 

      Now when i call from one analog phone to another, the RTP packets should go through the Asterisk server. There exactly i am getting the problem.



Typical reason for overloading the server would be running it on a virtual machine.

However, if that is not the case, what timing source do you have configured? (However simple calls shouldn’t need a timing source.)

Failing that, you are going to have to get a packet capture on the Asterisk machine and analyze it for packet loss, jitter, etc., using something like Wireshark.


I suspect there is a network negotiation issue on that server. Have you tried calling the default demo to see if it sounds clear? Once again - try running “ifconfig” to see if there are any errors on the network interface.


Hi Friends,

       Now i can call each other (SIP clients), such that all RTP traffic pass through Asterisk server. But the problem is that if i can call in one direction i can get clear voice. But if i call in other direction i am not getting voice clearly.

      Suppose i have two extensions, 121 and 122. If i call from 121 to 122 i can get good voice quality. But if call from 122 to 121 i am not able to get good voice quality.

      Is this the issue with codecs that i am using. I am using PCMA and PCMU.



I don’t believe there are any current bugs in those two codecs, and they are low cost codecs in terms of CPU usage. Transcoding between the two will cause some distortion, but that should not be noticeable and is the same as you would get with a pure PSTN call from the USA to Europe.


Hi Friends,

        I am working with Asterisk server. I am connecting two analog phones to one of ONT board.   The board has an IP address and the two phones working with two extensions as 277 and 278.

        Now i am trying to pass the all RTP packets through Asterisk server. When i call one extensions to another, the first few words(the first two hello's) are getting clear and from there i am getting noise and the voice is getting delay.

         Even i change the Jitter option. Even then i am not able to over come this problem. 

        Is there another way to over this problem.



There is not enough information. Asterisk doesn’t normally have this problem.

Do you have a timing source configured for Asterisk? This shouldn’t be needed, for a simple call, with no silence suppression, but you never know.

There is no standard fix, because this is not a standard problem.