diff src/g23m-gsm/cc/cc_cfk.c @ 301:4bb5772a05a3

AT%SPVER: new command for setting custom speech version lists The speech version list in the Bearer Capability IE tells the network which speech codecs are supported by the MS, and in which order of preference. The standard behaviour is to list all codecs that are supported by the hw+fw platform, and the standard preference order is newer over older, FR over HR. But sometimes it is desirable (for network testing) to artificially restrict which codecs the test MS will declare as supported, and/or to list them in some peculiar non-standard order of preference. Add a new private AT command, AT%SPVER, allowing the user to set and clear custom speech version lists for the Bearer Capability IE composer in CC.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 May 2023 21:43:10 +0000
parents fa8dc04885d8
children
line wrap: on
line diff
--- a/src/g23m-gsm/cc/cc_cfk.c	Tue Dec 13 02:44:01 2022 +0000
+++ b/src/g23m-gsm/cc/cc_cfk.c	Sun May 21 21:43:10 2023 +0000
@@ -40,6 +40,9 @@
 #include "tok.h"
 #include "cc.h"
 
+/* FreeCalypso addition */
+#include "cl_user_spver.h"
+
 /*==== EXPORT =====================================================*/
 
 /*==== PROTOTYPE ==================================================*/
@@ -610,7 +613,8 @@
   UBYTE index, prio;
   const UBYTE codec_prio[5] = {M_CC_SPEECH_VERS_AMR_FR, M_CC_SPEECH_VERS_AMR_HR, M_CC_SPEECH_VERS_EFR,
                                M_CC_SPEECH_VERS_FR, M_CC_SPEECH_VERS_HR};
-        UBYTE codec_val[5]  = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+  UBYTE codec_val[5]  = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+  UBYTE user_spver_set, user_spver_rcr;
 
   TRACE_FUNCTION ("cc_set_radio_channel_requirement()");
 
@@ -687,6 +691,11 @@
           } /* switch (codec_prio[prio])*/
         } /* for */
 
+	/* FreeCalypso addition: user override of codec priority list */
+	user_spver_set = cl_user_spver_get(codec_val, &user_spver_rcr);
+	if (user_spver_set == CL_USER_SPVER_IS_SET)
+		bearer_cap->rad_chan_req = user_spver_rcr;
+
         if (bcpara->bearer_serv EQ MNCC_BEARER_SERV_SPEECH_CTM OR
             bcpara->bearer_serv EQ MNCC_BEARER_SERV_AUX_SPEECH_CTM)
         {