[paging] Assign the subscriber to the channel first...
Assign the GSM subscriber to the lchan and then inform
the paging layer and dispatch a signal. This makes sure
that lchan is updated with the right kind of information.
diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c
index 4d77d5d..0d889fb 100644
--- a/src/gsm_04_08.c
+++ b/src/gsm_04_08.c
@@ -700,6 +700,13 @@
DEBUGP(DRR, "<- Channel was requested by %s\n",
subscr->name ? subscr->name : subscr->imsi);
+ if (!msg->lchan->subscr)
+ msg->lchan->subscr = subscr;
+ else if (msg->lchan->subscr != subscr) {
+ DEBUGP(DRR, "<- Channel already owned by someone else?\n");
+ subscr_put(subscr);
+ }
+
struct paging_signal_data sig_data = {
.data = {
.area = S_PAGING,
@@ -711,13 +718,6 @@
dispatch_signal(&sig_data.data);
paging_request_stop(msg->trx->bts, subscr);
- if (!msg->lchan->subscr)
- msg->lchan->subscr = subscr;
- else if (msg->lchan->subscr != subscr) {
- DEBUGP(DRR, "<- Channel already owned by someone else?\n");
- subscr_put(subscr);
- }
-
/* FIXME: somehow signal the completion of the PAGING to
* the entity that requested the paging */