add new routine to stop paging
diff --git a/include/openbsc/paging.h b/include/openbsc/paging.h
index a04a906..884d163 100644
--- a/include/openbsc/paging.h
+++ b/include/openbsc/paging.h
@@ -66,4 +66,7 @@
/* schedule paging request */
void page_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, int type);
+/* stop paging requests */
+void page_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr);
+
#endif
diff --git a/src/paging.c b/src/paging.c
index 29e97e5..40fe789 100644
--- a/src/paging.c
+++ b/src/paging.c
@@ -174,3 +174,23 @@
free(req);
return;
}
+
+/* we consciously ignore the type of the request here */
+void page_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr)
+{
+ struct paging_bts *bts_entry;
+ struct paging_request *req, *req2;
+
+ llist_for_each_entry(bts_entry, &managed_bts, bts_list) {
+ if (bts == bts_entry->bts)
+ break;
+ }
+ if (!bts_entry)
+ return;
+
+ llist_for_each_entry_safe(req, req2, &bts_entry->pending_requests,
+ entry) {
+ if (req->subscr == subscr)
+ llist_del(&req->entry);
+ }
+}