diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-29 11:17:18 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2010-01-01 10:59:19 +0100 |
commit | 83579ca8ff706cd2d5ed27a10fa90129bdd943f4 (patch) | |
tree | be943b24ea38bbd4d6382b6651e6c95e0d373c2d /openbsc/src | |
parent | f31e4745bb32d120f55d8442669d666d88619fa0 (diff) |
keep 'silent call' state in struct lchan
This enables us to reliably detect if a lchan is part of a silent
call or not.
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/chan_alloc.c | 2 | ||||
-rw-r--r-- | openbsc/src/silent_call.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c index 8141e4774..48f87f211 100644 --- a/openbsc/src/chan_alloc.c +++ b/openbsc/src/chan_alloc.c @@ -302,6 +302,8 @@ void lchan_free(struct gsm_lchan *lchan) 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 82b656327..500d1873d 100644 --- a/openbsc/src/silent_call.c +++ b/openbsc/src/silent_call.c @@ -53,6 +53,7 @@ static int paging_cb_silent(unsigned int hooknum, unsigned int event, 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 @@ int gsm_silent_call_stop(struct gsm_subscriber *subscr) 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; |