Unable to capture correct DTMF digits on server

I had recently purchased a DID number in Guatemala city and have setup a SIP line on my server in latin america. I am facing two issues here:

  1. When I place call on this number, I am experiencing latency of around 20-30 seconds intermittently. I have setup similar system in other countries as well but never faced such an issue.

  2. Also, when I am pressing digits from my mobile for some input, the digits are not captured on the server as I had actually pressed them. Some of the digits are repeated which I can see in asterisk cli and some are not received at all. Is this an issue of the line or my asterisk?

I am currently using Asterisk 10.12.0 on my server.

I assume you mean that you have a contract with a Guatemala ITSP to terminate incoming PSTN calls, in Guatemala, and forward them to you over SIP (with or without direct in dialing information).

What is the signalling system being used to convey the DTMF? If inband, what codec(s) are being used between the 3.1kHz audio part of the PSTN and your Asterisk box?

As you mentioned latency, do you have high packet losses?

High latency is probably due to buffer bloat somewhere on the path. although it could also be caused by TCP tunnelling over a high loss connection.