help need with the silent_call function in OsmoMSC/BSC

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Mihai Ordean m.ordean at cs.bham.ac.uk
Mon Oct 22 18:39:39 UTC 2018


Hey

Thanks for the suggestion!

I finally had some time for a bit more debugging and was able to make
silent_call work. As it turns out, aside from reverting the silent call
patch from (https://gerrit.osmocom.org/#/c/openbsc/+/1930/) some changes
had to be made to subscr_conn.c to enable the fsm transitions suggested
for silent_call i.e. SUBSCR_CONN_S_NEW to SUBSCR_CONN_S_COMMUNICATING.

If anyone is interested, I'm attaching the patch against the latest git
version (f6400737).

Mihai

On 15/10/2018 11:57, nhofmeyr at sysmocom.de wrote:
> On Fri, Oct 12, 2018 at 04:35:04PM +0100, Mihai Ordean wrote:
>> Now I want to enable the silent_call functionality to begin testing but
>> I can't seem able to do so.
> 
> Historically, the silent call feature was an important part of the Osmocom
> heritage: IIRC demonstrating a silent call to locate a phone was one of the
> important early goals of implementing osmo-nitb aka bsc_hack in the first
> place, and from there things have evolved to the multi component externally
> compatible stack we have today.
> 
> But, these days, I don't know of anyone testing on a regular basis whether
> silent call works, be it manually or automatically. Typically that is a
> guarantee for bit rot and breakage.
> 
> I'm fairly certain that is, sadly, the case with the silent call feature. It
> should work, but one refactoring or the other has broken it.
> 
> Looking at the log, I believe the fix is fairly trivial:
> 
> Today's MSC strictly monitors connections by subscribers, and first ensures
> they get accepted (in terms of authentication), and then ensures that they
> establish some sort of meaningful request/response interaction.
> 
> So I think all we need is that in paging_cb_silent(), we transition the conn
> FSM from SUBSCR_CONN_S_ACCEPTED to SUBSCR_CONN_S_COMMUNICATING, to stop the
> timer that watches validity. See msc_subscr_conn_communicating().
> 
> It would be excellent if you could try to implement and test yourself. If you
> need help, do ask again.
> 
> ~N
> 
-------------- next part --------------
--- a/src/libmsc/silent_call.c
+++ b/src/libmsc/silent_call.c
@@ -74,7 +74,7 @@
 	return rc;
 }
 
-#if 0
+
 /* receive a layer 3 message from a silent call */
 int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg)
 {
@@ -117,7 +117,7 @@
 	LOGP(DLSMS, LOGL_INFO, "Rerouting L3 message from a silent call.\n");
 	return 1;
 }
-#endif
+
 
 
 /* initiate a silent call with a given subscriber */


--- a/include/osmocom/msc/silent_call.h
+++ b/include/osmocom/msc/silent_call.h
@@ -7,9 +7,7 @@
                                  void *data, int type);
 extern int gsm_silent_call_stop(struct vlr_subscr *vsub);
 
-#if 0
 extern int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg);
 extern int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg);
-#endif
 
 #endif /* _SILENT_CALL_H */



--- a/src/libmsc/gsm_04_08.c
+++ a/src/libmsc/gsm_04_08.c
@@ -1470,10 +1470,8 @@
 		return -EACCES;
 	}
 
-#if 0
 	if (silent_call_reroute(conn, msg))
 		return silent_call_rx(conn, msg);
-#endif
 
 	switch (pdisc) {
 	case GSM48_PDISC_CC:

--- a/src/libmsc/subscr_conn.c
+++ b/src/libmsc/subscr_conn.c
@@ -111,8 +111,12 @@
 	LOGPFSML(fi, LOGL_NOTICE, "Close event, cause: %s\n", gsm48_reject_value_name(*cause));
 }
 
+
+
 static void subscr_conn_fsm_new(struct osmo_fsm_inst *fi, uint32_t event, void *data)
 {
+	struct gsm_subscriber_connection *conn = fi->priv;
+
 	switch (event) {
 	case SUBSCR_CONN_E_COMPLETE_LAYER_3:
 		osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_AUTH_CIPH, SUBSCR_CONN_TIMEOUT, 0);
@@ -120,8 +124,14 @@
 
 	case SUBSCR_CONN_E_ACCEPTED:
 		evaluate_acceptance_outcome(fi, true);
-		osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, SUBSCR_CONN_TIMEOUT, 0);
-		return;
+		if (conn->silent_call == 1){
+			osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_COMMUNICATING, 0, 0);
+			return;
+		}
+		else {
+			osmo_fsm_inst_state_chg(fi, SUBSCR_CONN_S_ACCEPTED, SUBSCR_CONN_TIMEOUT, 0);
+			return;
+		}
 
 	case SUBSCR_CONN_E_MO_CLOSE:
 	case SUBSCR_CONN_E_CN_CLOSE:
@@ -309,6 +319,10 @@
 		/* no-op */
 		return;
 
+	case SUBSCR_CONN_E_COMPLETE_LAYER_3:
+		/* no-op */
+		return;
+
 	case SUBSCR_CONN_E_MO_CLOSE:
 	case SUBSCR_CONN_E_CN_CLOSE:
 		log_close_event(fi, event, data);
@@ -408,11 +422,13 @@
 	[SUBSCR_CONN_S_NEW] = {
 		.name = OSMO_STRINGIFY(SUBSCR_CONN_S_NEW),
 		.in_event_mask = S(SUBSCR_CONN_E_COMPLETE_LAYER_3) |
+				 S(SUBSCR_CONN_E_COMMUNICATING) |
 				 S(SUBSCR_CONN_E_ACCEPTED) |
 				 S(SUBSCR_CONN_E_MO_CLOSE) |
 				 S(SUBSCR_CONN_E_CN_CLOSE) |
 				 S(SUBSCR_CONN_E_UNUSED),
 		.out_state_mask = S(SUBSCR_CONN_S_AUTH_CIPH) |
+				  S(SUBSCR_CONN_S_COMMUNICATING) |
 				  S(SUBSCR_CONN_S_ACCEPTED) |
 				  S(SUBSCR_CONN_S_RELEASING),
 		.action = subscr_conn_fsm_new,
@@ -443,7 +459,7 @@
 		/* allow everything to release for any odd behavior */
 		.in_event_mask = S(SUBSCR_CONN_E_COMPLETE_LAYER_3) |
 				 S(SUBSCR_CONN_E_COMMUNICATING) |
-		                 S(SUBSCR_CONN_E_RELEASE_WHEN_UNUSED) |
+				 S(SUBSCR_CONN_E_RELEASE_WHEN_UNUSED) |
 				 S(SUBSCR_CONN_E_ACCEPTED) |
 				 S(SUBSCR_CONN_E_MO_CLOSE) |
 				 S(SUBSCR_CONN_E_CN_CLOSE) |
@@ -457,6 +473,7 @@
 		.name = OSMO_STRINGIFY(SUBSCR_CONN_S_COMMUNICATING),
 		/* allow everything to release for any odd behavior */
 		.in_event_mask = S(SUBSCR_CONN_E_RELEASE_WHEN_UNUSED) |
+				 S(SUBSCR_CONN_E_COMPLETE_LAYER_3) |
 				 S(SUBSCR_CONN_E_ACCEPTED) |
 				 S(SUBSCR_CONN_E_COMMUNICATING) |
 				 S(SUBSCR_CONN_E_MO_CLOSE) |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m_ordean.vcf
Type: text/x-vcard
Size: 4 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20181022/67d0627d/attachment.vcf>


More information about the OpenBSC mailing list