Wideband recording in G722 with Asterisk

Hi everyone,

please help me settle a disagreement that I have with a colleague over the capabilities of Asterisk recording. We are running Asterisk via ECS on AWS, and in principle, everything works fine. However, when we try to record calls over G722/Wideband and we record to a .wav16 file, the significant frequency is always capped at 4k, not at 8k (as we hoped) although the sample rate is correctly set at 16k. Note that the calls themselves indeed use G722/Wideband as desired, it is just the recording that falls flat.

My colleague says that this is something that we might be able to fix in Asterisk, while I think that G722/Wideband is not capable of recording such a significant frequency and that we cannot hope for anything better unless we use a different codec. The question now is who is right, and can we fix that? Any input and information is appreciated.

Here is our pjsip.conf:

[global]
type=global
user_agent=Asterisk

[sbc1]
type=endpoint
context=sip-incoming-sbc1
disallow=all
allow=g722
allow=alaw
allow=ulaw
aors=sbc1
media_encryption=sdes
media_encryption_optimistic=yes
transport=transport-tls
direct_media=no
dtmf_mode=rfc4733
rtp_symmetric=yes
send_pai=yes

[sbc1]
type=aor
contact=sip:${SBC_HOST_1}:5740
qualify_frequency=30

[sbc1]
type=identify
endpoint=sbc1
match=${SBC_HOST_1}
srv_lookups=no

Here is our extensions.conf:

[globals]
CONSOLE=Console/dsp
TRUNKMSD=1

[sip-incoming-sbc1]
exten => +49891234567,1,AGI(/var/lib/asterisk/agi-bin/sps_iav.agi)

;Callback Context:
[sip-outgoing]
exten => _X.,1,AGI(/var/lib/asterisk/agi-bin/sps_iav.agi)

In the sps_iav.agi script, we have some recording that we want to do using the following code; note that recordFilePath refers to a .wav16 file (which sets the sample rate correctly at 16k):

agi.execute(“EXEC Record”, recordFilePath + “,99,1200000,k”)

What do you mean by significant frequency, and how are you doing the measurements? For standard PSTN codecs, the specification upper limit is 3.4kHz, because room is needed for anti-aliasing filters, and for G.722, it will be something like 7kHz. There should be no significant energy in the spectrum at 8kHz.

If you are testing a frequency that should be handled, try using “core show translation paths” to see if an inappropriate intermediate format would be used: