traud / asterisk-amr

Asterisk 13 transcoding module: AMR-WB
The Unlicense
32 stars 19 forks source link

Interoperability: Snom #9

Closed traud closed 2 years ago

traud commented 7 years ago

With a Snom phone, AMR(-WB) comes not built-in but must be licensed. I do not know how to buy such a license because I got my one for interoperability testing. When AMR(-WB) was enabled successfully, you see ‘Features:G.722.2,AMR-NB’ in Web interface → (Status) System Information → Production Information.

The following issues are known as of firmware 8.9.3.60 (May 2017):

  1. (inbound) AMR must be rtpmap 116
  2. (inbound) AMR-WB must be rtpmap 117
  3. (inbound) mode-set=0,1,2 is interpreted as mode-set=0 (first listed mode is taken, rest ignored)
  4. (outbound) mode-set is not mentioned in fmtp although you are able to control the mode from the Web interface, for example amrwb-2 sends mode 2 and amr-0 sends mode 0
  5. Change-Mode Requests (within a call) are ignored because Snom sends only in one mode actually.
  6. (inbound) mode=1 in fmtp is ignored, only Bandwidth-Efficient mode is used

I reported those issue back in February 2017.

You are able to workaround issue 1 and 2:

--- main/rtp_engine.c   (Asterisk 13.15.1; after codec_amr.patch)
+++ main/rtp_engine.c   (working copy)
@@ -2187,2 +2187,2 @@
-   add_static_payload(116, ast_format_g719, 0);
-   add_static_payload(117, ast_format_speex16, 0);
+   add_static_payload(116, ast_format_amr, 0);
+   add_static_payload(117, ast_format_amrwb, 0);
@@ -2196,2 +2196,2 @@
-   add_static_payload(-1, ast_format_amr, 0);
-   add_static_payload(-1, ast_format_amrwb, 0);
+   add_static_payload(-1, ast_format_g719, 0);
+   add_static_payload(-1, ast_format_speex16, 0);

You are able to workaround issue 3 by sending the list of modes from the highest to the lowest instead, see res/res_format_attr_amr.c:amr_generate_sdp_fmtp. However, this is just cosmetic because the Snom does not adapt to that mode either, it simply sends the mode which was set in the Web interface, even if that is higher than offered by the remote peer. Issue 4 removes the possibility to control the resulting mode, because Asterisk answers with the highest possible mode. Therefore the upper-most used bandwidth cannot be controlled from within the Snom phone. Furthermore, the sound quality is asymmetric because on default Snom sends the lowest mode 0.

Issue 6 is a severe issue because in can lead to no audio when the remote party supports just the Octet-Aligned mode – Snom establishes the call but both parties talk in a different format.

As workaround and because Snom supports Opus-Codec and G.722, I recommend to disallow AMR(-WB) either A) in the Snom phone by not going for a AMR(-WB) license, B) in the Snom phone by editing the audio codecs in Web Interface → Identity → RTP, or C) in Asterisk for the peer which connected to a Snom phone.

traud commented 2 years ago

On 5th of February, 2021, Snom ended its AMR(-WB) endeavors. Therefore, this issue gets closed as not resolved.