GSM: Remove obsolete "hr" option from interface.conf
authorAndreas Eversberg <jolly@eversberg.eu>
Tue, 25 Jun 2013 07:00:06 +0000 (09:00 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Tue, 15 Dec 2015 19:50:49 +0000 (20:50 +0100)
Half rate TCH is requested for MT calls, depending on the supported codecs
of the peer (RTP bridge) or our supported codecs (no RTP bridge).

default/interface.conf
gsm_bs.cpp
interface.c
interface.h

index 19c7a34..698e98c 100644 (file)
 # The MSN numbers will equal the subscriber number.
 #[GSM]
 #gsm-bs
-#hr
 #tones yes
 #earlyb no
 
index 7334242..6596411 100644 (file)
@@ -768,6 +768,7 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
        struct epoint_list *epointlist;
        struct gsm_mncc *mncc;
        struct interface *interface;
+       int page_with_tchh = 0;
 
        interface = getinterfacebyname(p_interface_name);
        if (!interface) {
@@ -817,10 +818,13 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
                gsm_trace_header(p_interface_name, this, 1 /* codec negotioation */, DIRECTION_NONE);
                for (i = 0; i < param->setup.rtpinfo.payloads; i++) {
                        switch (param->setup.rtpinfo.media_types[i]) {
-                       case MEDIA_TYPE_GSM:
-                       case MEDIA_TYPE_GSM_EFR:
                        case MEDIA_TYPE_AMR:
                        case MEDIA_TYPE_GSM_HR:
+                               /* because offered codecs are compatible with half rate, we can page with tchh */
+                               page_with_tchh = 1;
+                               // Fall through!
+                       case MEDIA_TYPE_GSM:
+                       case MEDIA_TYPE_GSM_EFR:
                                add_trace("rtp", "payload", "%s:%d supported", media_type2name(param->setup.rtpinfo.media_types[i]), param->setup.rtpinfo.payload_types[i]);
                                if (p_g_rtp_payloads < (int)sizeof(p_g_rtp_payload_types)) {
                                        p_g_rtp_media_types[p_g_rtp_payloads] = param->setup.rtpinfo.media_types[i];
@@ -845,6 +849,10 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
                        trigger_work(&p_g_delete);
                        return;
                }
+       } else {
+               /* since we support half rate compatible codecss, we can page with tchh */
+               if (p_g_hr_encoder || p_g_amr_encoder)
+                       page_with_tchh = 1;
        }
 
 //             SCPY(&p_m_tones_dir, param->setup.ext.tones_dir);
@@ -977,7 +985,12 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
                add_trace("redir", "number", "%s", mncc->redirecting.number);
        }
 
-       if (interface->gsm_bs_hr) {
+       /* if we support any half rate codec we page the mobile with TCH/H
+        * support indication. the mobile will reply paging with a channel
+        * request that indicates half rate support. if no SDCCH and TCH/F
+        * channel is available, BSC can assign a TCH/H channel, because it
+        * knows that the phone supports it. */
+       if (page_with_tchh) {
                add_trace("lchan", "type", "TCH/H or TCH/F");
                mncc->lchan_type = GSM_LCHAN_TCH_H;
        } else {
index 292c9aa..b2b6239 100644 (file)
@@ -922,17 +922,6 @@ static int inter_gsm_bs(struct interface *interface, char *filename, int line, c
        return(0);
 #endif
 }
-static int inter_gsm_bs_hr(struct interface *interface, char *filename, int line, char *parameter, char *value)
-{
-#ifndef WITH_GSM_BS
-       SPRINT(interface_error, "Error in %s (line %d): GSM BS side not compiled in.\n", filename, line);
-       return(-1);
-#else
-       interface->gsm_bs_hr = 1;
-
-       return(0);
-#endif
-}
 static int inter_gsm_ms(struct interface *interface, char *filename, int line, char *parameter, char *value)
 {
 #ifndef WITH_GSM_MS
@@ -1354,8 +1343,6 @@ struct interface_param interface_param[] = {
        ""},
        {"gsm-bs", &inter_gsm_bs, "",
        "Sets up GSM base station interface for using OpenBSC."},
-       {"hr", &inter_gsm_bs_hr, "",
-       "Enable and prefer half rate for mobile terminating calls."},
        {"gsm-ms", &inter_gsm_ms, "<socket>",
        "Sets up GSM mobile station interface for using Osmocom-BB.\n"
        "The name of the MS folows the interface name.\n"
index a4b4baa..1f9b4b0 100644 (file)
@@ -113,7 +113,6 @@ struct interface {
        char                    remote_context[128]; /* context feld to use for remote application */
 #ifdef WITH_GSM_BS
        int                     gsm_bs; /* interface is an GSM BS interface */
-       int                     gsm_bs_hr; /* prefer half rate for MOT calls */
 #if 0
        int                     gsm_bs_payloads;
        unsigned char           gsm_bs_payload_types[8];