Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6356

to look at the new patch set (#3).

Add VTY command to configure destination MSISDN for emergency calls

As in GSM/3GPP networks emergency calls carry no explicit destination
number/address, add a VTY commadn to patch in some destination handler
in the EMERGENCY SETUP before delivering to [internal or external] MNCC.

Change-Id: I7c9f43ba312fadda2b9a9483b3cf50e4abca9599
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/gsm_04_08.c
M src/libmsc/msc_vty.c
3 files changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/6356/3

diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 3f322b3..06328dc 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -413,6 +413,11 @@
                struct llist_head bscs;
                struct osmo_sccp_instance *sccp;
        } a;
+
+       struct {
+               /* MSISDN to which to route MO emergency calls */
+               char *route_to_msisdn;
+       } emergency;
 };
 
 struct osmo_esme;
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 76f8c79..7b6e94a 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1645,6 +1645,14 @@
        if (msg_type == GSM48_MT_CC_EMERG_SETUP) {
                setup.fields |= MNCC_F_EMERGENCY;
                setup.emergency = 1;
+               /* use destination number as configured by user (if any) */
+               if (trans->net->emergency.route_to_msisdn) {
+                       setup.fields |= MNCC_F_CALLED;
+                       setup.called.type = 0; /* unknown */
+                       setup.called.plan = 0; /* unknown */
+                       OSMO_STRLCPY_ARRAY(setup.called.number,
+                                          
trans->net->emergency.route_to_msisdn);
+               }
        }
 
        /* use subscriber as calling party number */
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index faf17ec..ad4014d 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -125,6 +125,20 @@
        return CMD_SUCCESS;
 }
 
+DEFUN(cfg_msc_emergency_msisdn, cfg_msc_emergency_msisdn_cmd,
+      "emergency-call route-to-msisdn MSISDN",
+      "Configure Emergency Call Behaviour\n"
+      "MSISDN to which Emergency Calls are Dispatched\n"
+      "MSISDN (E.164 Phone Number)\n")
+{
+       struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+       osmo_talloc_replace_string(gsmnet, &gsmnet->emergency.route_to_msisdn, 
argv[0]);
+
+       return CMD_SUCCESS;
+}
+
+
 static int config_write_msc(struct vty *vty)
 {
        struct gsm_network *gsmnet = gsmnet_from_vty(vty);
@@ -148,6 +162,11 @@
 
        if (gsmnet->paging_response_timer != MSC_PAGING_RESPONSE_TIMER_DEFAULT)
                vty_out(vty, " paging response-timer %u%s", 
gsmnet->paging_response_timer, VTY_NEWLINE);
+
+       if (gsmnet->emergency.route_to_msisdn) {
+               vty_out(vty, " emergency-call route-to-msisdn %s%s",
+                       gsmnet->emergency.route_to_msisdn, VTY_NEWLINE);
+       }
 
        mgcp_client_config_write(vty, " ");
 #ifdef BUILD_IU
@@ -196,6 +215,11 @@
                vty_out(vty, " periodic location update %u%s",
                        gsmnet->t3212 * 6, VTY_NEWLINE);
 
+       if (gsmnet->emergency.route_to_msisdn) {
+               vty_out(vty, " emergency-call route-to-msisdn %s%s",
+                       gsmnet->emergency.route_to_msisdn, VTY_NEWLINE);
+       }
+
        return CMD_SUCCESS;
 }
 
@@ -212,6 +236,7 @@
        install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd);
        install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd);
        install_element(MSC_NODE, &cfg_msc_paging_response_timer_cmd);
+       install_element(MSC_NODE, &cfg_msc_emergency_msisdn_cmd);
 
        mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf);
 #ifdef BUILD_IU

-- 
To view, visit https://gerrit.osmocom.org/6356
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7c9f43ba312fadda2b9a9483b3cf50e4abca9599
Gerrit-PatchSet: 3
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to