keep 'silent call' state in struct lchan
This enables us to reliably detect if a lchan is part of a silent
call or not.
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index 8141e47..48f87f2 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -302,6 +302,8 @@
for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++)
lchan->neigh_meas[i].arfcn = 0;
+ lchan->silent_call = 0;
+
/* FIXME: ts_free() the timeslot, if we're the last logical
* channel using it */
}
diff --git a/openbsc/src/silent_call.c b/openbsc/src/silent_call.c
index 82b6563..500d187 100644
--- a/openbsc/src/silent_call.c
+++ b/openbsc/src/silent_call.c
@@ -53,6 +53,7 @@
case GSM_PAGING_SUCCEEDED:
DEBUGPC(DSMS, "success, using Timeslot %u on ARFCN %u\n",
lchan->ts->nr, lchan->ts->trx->arfcn);
+ lchan->silent_call = 1;
/* increment lchan reference count */
dispatch_signal(SS_SCALL, S_SCALL_SUCCESS, &sigdata);
use_lchan(lchan);
@@ -86,7 +87,10 @@
if (!lchan)
return -EINVAL;
- /* FIXME: did we actually establish a silent call for this guy? */
+ /* did we actually establish a silent call for this guy? */
+ if (!lchan->silent_call)
+ return -EINVAL;
+
put_lchan(lchan);
return 0;