lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38107?usp=email )
Change subject: libvlr: replace direct call of paging_expired() into a callback ......................................................................
libvlr: replace direct call of paging_expired() into a callback
libmsc internal functions shouldn't be called from within the libvlr. Re-use the paging callback with an osmocom specific indication to inform it to cancel paging.
Change-Id: I7a3d15e8f0fb51c6b32add2de5024fc4d599ecf0 --- M include/osmocom/msc/sgs_iface.h M include/osmocom/msc/vlr_sgs.h M src/libmsc/paging.c M src/libmsc/sgs_iface.c M src/libvlr/vlr_sgs_fsm.c 5 files changed, 13 insertions(+), 9 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve daniel: Looks good to me, approved Jenkins Builder: Verified
diff --git a/include/osmocom/msc/sgs_iface.h b/include/osmocom/msc/sgs_iface.h index a319663..b5ff489 100644 --- a/include/osmocom/msc/sgs_iface.h +++ b/include/osmocom/msc/sgs_iface.h @@ -86,7 +86,7 @@ struct sgs_state *sgs_iface_init(void *ctx, struct gsm_network *network); int sgs_iface_rx(struct sgs_connection *sgc, struct msgb *msg); enum sgsap_service_ind sgs_serv_ind_from_paging_cause(enum paging_cause); -int sgs_iface_tx_paging(struct vlr_subscr *vsub, enum sgsap_service_ind serv_ind); +int sgs_iface_paging_cb(struct vlr_subscr *vsub, enum sgsap_service_ind serv_ind); int sgs_iface_tx_dtap_ud(struct msc_a *msc_a, struct msgb *msg); void sgs_iface_tx_release(struct vlr_subscr *vsub); void sgs_iface_tx_serv_abrt(struct vlr_subscr *vsub); diff --git a/include/osmocom/msc/vlr_sgs.h b/include/osmocom/msc/vlr_sgs.h index aade5d3..7193fa5 100644 --- a/include/osmocom/msc/vlr_sgs.h +++ b/include/osmocom/msc/vlr_sgs.h @@ -81,7 +81,7 @@ typedef void (*vlr_sgs_lu_response_cb_t) (struct sgs_lu_response *response);
/* This callback function is called in cases where a paging request is required - * after the LU is completed */ + * after the LU is completed or when a paging expired */ typedef int (*vlr_sgs_lu_paging_cb_t) (struct vlr_subscr *vsub, enum sgsap_service_ind serv_ind);
/* This callback function is called to send the MM info to the UE. */ diff --git a/src/libmsc/paging.c b/src/libmsc/paging.c index 9b3dad5..6e3d20e 100644 --- a/src/libmsc/paging.c +++ b/src/libmsc/paging.c @@ -71,7 +71,7 @@ case OSMO_RAT_UTRAN_IU: return ran_peers_down_paging(net->iu.sri, CELL_IDENT_LAC, vsub, pr->cause); case OSMO_RAT_EUTRAN_SGS: - return sgs_iface_tx_paging(vsub, sgs_serv_ind_from_paging_cause(pr->cause)); + return sgs_iface_paging_cb(vsub, sgs_serv_ind_from_paging_cause(pr->cause)); default: LOG_PAGING(vsub, pr, LOGL_ERROR, "Cannot page, subscriber not attached\n"); return -EINVAL; diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index a845ab8..0147d3f 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -466,16 +466,21 @@ } }
-/*! Page UE through SGs interface +/*! Page UE through SGs interface or inform about an expired paging * \param[in] vsub subscriber context * \param[in] serv_ind service indicator (sms or voide) * \returns 0 in case of success, -EINVAL in case of error. */ -int sgs_iface_tx_paging(struct vlr_subscr *vsub, enum sgsap_service_ind serv_ind) +int sgs_iface_paging_cb(struct vlr_subscr *vsub, enum sgsap_service_ind serv_ind) { struct msgb *resp; struct gsm29118_paging_req paging_params; struct sgs_mme_ctx *mme;
+ if (serv_ind == SGSAP_SERV_IND_PAGING_TIMEOUT) { + paging_expired(vsub); + return 0; + } + /* See also: 3GPP TS 29.118, chapter 5.1.2.2 Paging Initiation */ if (vsub->sgs_fsm->state == SGS_UE_ST_NULL && vsub->conf_by_radio_contact_ind == true) { LOGPFSMSL(vsub->sgs_fsm, DPAG, LOGL_ERROR, "Will not Page (conf_by_radio_contact_ind == true)\n"); @@ -662,7 +667,7 @@ /* Perform actual location update */ memcpy(vlr_sgs_cfg.timer, sgc->sgs->cfg.timer, sizeof(vlr_sgs_cfg.timer)); memcpy(vlr_sgs_cfg.counter, sgc->sgs->cfg.counter, sizeof(vlr_sgs_cfg.counter)); - rc = vlr_sgs_loc_update(gsm_network->vlr, &vlr_sgs_cfg, sgs_tx_loc_upd_resp_cb, sgs_iface_tx_paging, + rc = vlr_sgs_loc_update(gsm_network->vlr, &vlr_sgs_cfg, sgs_tx_loc_upd_resp_cb, sgs_iface_paging_cb, sgs_tx_mm_info_cb, mme_name, type, imsi, &new_lai, last_eutran_plmn); if (rc != 0) { resp = gsm29118_create_lu_rej(imsi, SGSAP_SGS_CAUSE_IMSI_UNKNOWN, NULL); diff --git a/src/libvlr/vlr_sgs_fsm.c b/src/libvlr/vlr_sgs_fsm.c index 2771cf5..9aac74b 100644 --- a/src/libvlr/vlr_sgs_fsm.c +++ b/src/libvlr/vlr_sgs_fsm.c @@ -24,7 +24,6 @@ #include <osmocom/msc/debug.h> #include <osmocom/msc/vlr.h> #include <osmocom/msc/vlr_sgs.h> -#include <osmocom/msc/paging.h>
#include "vlr_sgs_fsm.h" #include "vlr_core.h" @@ -64,8 +63,8 @@ vlr_subscr_set_last_used_eutran_plmn_id(vsub, NULL);
/* Make sure any ongoing paging is aborted. */ - if (vsub->cs.is_paging) - paging_expired(vsub); + if (vsub->cs.is_paging && vsub->sgs.paging_cb) + vsub->sgs.paging_cb(vsub, SGSAP_SERV_IND_PAGING_TIMEOUT);
/* Ensure that Ts5 (pending paging via SGs) is deleted */ if (vlr_sgs_pag_pend(vsub))