--- 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) |