diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-02-16 22:52:23 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-02-16 22:52:23 +0000 |
commit | 09e38afbcc9d62f75eae8867abe0d62678adef0f (patch) | |
tree | 6c8c384db2326867f65a2f2df868a6a0fffe4bcd /src/paging.c | |
parent | e1b1338c8875be9dfa5c7a76b20204faacbc79d6 (diff) |
* introduce a callback function when paging completes (I know this is somewhat of an overlap
with the signals, but I think paging always has one reason and thus one caller wants to
get notified about completion, including a caller-specific context, etc)
* introduce TLV parser definitions for GSM 04.08
* parse and generate BCD number IE's for 04.08 call control
Diffstat (limited to 'src/paging.c')
-rw-r--r-- | src/paging.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/paging.c b/src/paging.c index 8597463ec..e220fb877 100644 --- a/src/paging.c +++ b/src/paging.c @@ -192,10 +192,15 @@ static void paging_T3113_expired(void *data) sig_data.lchan = NULL, dispatch_signal(SS_PAGING, S_PAGING_COMPLETED, &sig_data); + if (req->cbfn) + req->cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, NULL, req, + req->cbfn_param); paging_remove_request(&req->bts->paging, req); } -void paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, int type) { +void paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, + int type, gsm_cbfn *cbfn, void *data) +{ struct gsm_bts_paging_state *bts_entry = &bts->paging; struct gsm_paging_request *req; @@ -209,6 +214,8 @@ void paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, int type req->subscr = subscr_get(subscr); req->bts = bts; req->chan_type = type; + req->cbfn = cbfn; + req->cbfn_param = data; req->T3113.cb = paging_T3113_expired; req->T3113.data = req; schedule_timer(&req->T3113, T3113_VALUE); @@ -224,6 +231,9 @@ void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr) llist_for_each_entry_safe(req, req2, &bts_entry->pending_requests, entry) { if (req->subscr == subscr) { + if (req->cbfn) + req->cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_SUCCEEDED, + NULL, req, req->cbfn_param); paging_remove_request(&bts->paging, req); break; } |