falconia has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/44002?usp=email )


Change subject: mgw: add mgw-type selection between rtpbridge and transcoder
......................................................................

mgw: add mgw-type selection between rtpbridge and transcoder

Hera TC MGW is an alternative MGW implementation intended for use
with OsmoMSC.  Unlike standard OsmoMGW, the new MGW incorporates
speech transcoder functionality, acting as a software equivalent
of a traditional GSM TRAU.  Add ability to drive this alternative
MGW, selected via new vty setting mgw-type.

While Hera TC MGW is primarily intended to function as a transcoder,
it also has a pass-through mode for GSM speech codecs, and CSD is
always handled as no-delay pass-through, with possibility of
TW-TS-007 de/compression.  Therefore, if hera-tc-mgw is substituted
for osmo-mgw at an OsmoMSC site without any further changes, the
new MGW will operate in non-transcoding mode.  To make use of the
primarily intended speech transcoding functionality, further changes
are needed:

1) The working plan at Themyscira Wireless is to develop a new MNCC
   alternative (TWCC) by which ThemWi MSC back end will interface
   to osmo-msc front end; the BE will then use this interface to
   tell osmo-msc what codecs to configure on the CN side of its MGW,
   including PCMU or PCMA.

2) Those who prefer the MNCC-with-SDP paradigm (merged in the summer
   of 2023) over TWCC paradigm should be able to put together a
   configuration in which an external MNCC requests the use of PCMU
   or PCMA codec via SDP, and osmo-msc operating with hera-tc-mgw
   should be able to fulfill such request.

Depends: I713147d6567fb30de09b2272478d717093d6170e (osmo-mgw.git)
Change-Id: I095ab75b65f57583ab7f579ba419bbfbfa686afa
---
M TODO-RELEASE
M include/osmocom/msc/gsm_data.h
M src/libmsc/call_leg.c
M src/libmsc/msc_vty.c
M tests/test_nodes.vty
5 files changed, 31 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/02/44002/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0a167bd..f4b5220 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -10,3 +10,4 @@
 libosmo-sigtran >2.3.0                  OSMO_SCCP_REL_REASON_NSU_*
 libosmo-sigtran >2.3.0                  OSMO_SCCP_RETURN_REASON_*, 
osmo_sccp_return_reason_name()
 libosmo-mgcp-client    >1.16.0         x_side[] in struct mgcp_conn_peer
+libosmo-mgcp-client    >1.16.0         mgcp_client_transcoder_wildcard()
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 80a7854..0c198bd 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -283,6 +283,13 @@
         */
        uint8_t tw_rtp_formats;

+       /* OsmoMSC requires an associated MGCP-speaking MGW, but it can now be
+        * one of two types: either rtpbridge (standard OsmoMGW) or transcoder
+        * (Themyscira Wireless add-ons to Osmocom CNI suite).  The selection
+        * is configured via vty.
+        */
+       bool use_transcoder_mgw;
+
        /* Whether to use call waiting on the network */
        bool call_waiting;

diff --git a/src/libmsc/call_leg.c b/src/libmsc/call_leg.c
index 59f2f63..ad9f9e2 100644
--- a/src/libmsc/call_leg.c
+++ b/src/libmsc/call_leg.c
@@ -290,14 +290,20 @@

        if (!cl->mgw_endpoint) {
                struct mgcp_client *mgcp_client = 
mgcp_client_pool_get(gsmnet->mgw.mgw_pool);
+               const char *mgw_wildcard;
+
                if (!mgcp_client) {
                        LOG_CALL_LEG(cl, LOGL_ERROR,
                                     "cannot ensure MGW endpoint -- no MGW 
configured, check configuration!\n");
                        return -ENODEV;
                }
+               if (gsmnet->use_transcoder_mgw)
+                       mgw_wildcard = 
mgcp_client_transcoder_wildcard(mgcp_client);
+               else
+                       mgw_wildcard = 
mgcp_client_rtpbridge_wildcard(mgcp_client);
                cl->mgw_endpoint = osmo_mgcpc_ep_alloc(cl->fi, 
CALL_LEG_EV_MGW_ENDPOINT_GONE,
                                                       mgcp_client, 
gsmnet->mgw.tdefs, cl->fi->id,
-                                                      "%s", 
mgcp_client_rtpbridge_wildcard(mgcp_client));
+                                                      "%s", mgw_wildcard);
        }
        if (!cl->mgw_endpoint) {
                LOG_CALL_LEG(cl, LOGL_ERROR, "failed to setup MGW endpoint\n");
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index a5de12f..6faaf0e 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -724,6 +724,17 @@
        return CMD_SUCCESS;
 }

+DEFUN(cfg_msc_mgw_type,
+      cfg_msc_mgw_type_cmd,
+      "mgw-type (rtpbridge|transcoder)",
+      "Type of Media Gateway to be used\n"
+      "Symmetric RTP bridge (Osmocom standard)\n"
+      "Asymmetric transcoding MGW\n")
+{
+       gsmnet->use_transcoder_mgw = (strcmp(argv[0], "transcoder") == 0);
+       return CMD_SUCCESS;
+}
+
 #define NRI_STR "Mapping of Network Resource Indicators to this MSC, for MSC 
pooling\n"
 DEFUN(cfg_msc_nri_bitlen, cfg_msc_nri_bitlen_cmd,
       "nri bitlen <0-15>",
@@ -863,6 +874,9 @@
                vty_out(vty, "%s", VTY_NEWLINE);
        }

+       if (gsmnet->use_transcoder_mgw)
+               vty_out(vty, " mgw-type transcoder%s", VTY_NEWLINE);
+
        mgcp_client_config_write(vty, " ");

        neighbor_ident_vty_write(vty);
@@ -2163,6 +2177,7 @@
        install_element(MSC_NODE, &cfg_msc_osmux_cmd);
        install_element(MSC_NODE, &cfg_msc_twformat_cmd);
        install_element(MSC_NODE, &cfg_msc_no_twformat_cmd);
+       install_element(MSC_NODE, &cfg_msc_mgw_type_cmd);
        install_element(MSC_NODE, &cfg_msc_handover_number_range_cmd);
        install_element(MSC_NODE, &cfg_msc_nri_bitlen_cmd);
        install_element(MSC_NODE, &cfg_msc_nri_add_cmd);
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index 7ce141a..723d2e9 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -69,6 +69,7 @@
   osmux (on|off|only)
   tw-rtp-formats (fr|hr|amr|csd) [(fr|hr|amr|csd)] [(fr|hr|amr|csd)] 
[(fr|hr|amr|csd)]
   no tw-rtp-formats
+  mgw-type (rtpbridge|transcoder)
   handover-number range MSISDN_FIRST MSISDN_LAST
   nri bitlen <0-15>
   nri add <0-32767> [<0-32767>]

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/44002?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I095ab75b65f57583ab7f579ba419bbfbfa686afa
Gerrit-Change-Number: 44002
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <[email protected]>

Reply via email to