I am trying to use Asterisk to measure round trip delays in telephony networks. The basic idea is to make automated test calls from one Asterisk server connected via ISDN to another Asterisk server connected to a GSM network. The calls originate on ISDN and I use the Monitor dialplan application to record incoming and outgoing audio. Once the call is established I use the Playback application to send a reference audio signal to the GSM Asterisk server. The GSM server uses the Echo dialplan application to loop back the received audio. By comparing the incoming and outgoing audio files on the ISDN side it should be possible to determine the round trip delay in the voice channel.
The test signal is a series of 100ms 440Hz sine waves - 100ms silence. I can then detect the edges in both incoming and ougoing recordings. The difference is the round trip delay.
However, I receive choppy sound from the Echo application on the GSM side. Some of the sine waves are missing or are heavily distorted. I already have disabled echo cancellation on the Junghanns GSM card. On the ISDN side I use a Fritz! ISDN card going through the CAPI driver. I tried the following variations to narrow down the problem:
- I also used Monitor() on the GSM side to see if the signal comes in distorted. Before starting the Echo() application I start the Monitor() application. Both incoming and outgoing signals are distorted exactly the same way.
- If I only Monitor() on the GSM side without doing the Echo() the incoming signal is fine.
So it seems that the Echo() application affects both the incoming and outgoing audio and it seems to be that the audio leaves the ISDN side OK. I also see the same problem when I call the GSM side with my cell phone, so it also seems independent of the ISDN side.
Can someone help me to understand why the sound looped back by the Echo() application is so choppy? Is this a performance problem? Does Asterisk itself include echo cancellation when bridging the audio? The CPU and IO load is very low on the Asterisk doing the Echo().
Any help is highly appreciated.