blob: 4de679df7099c925c682e5dca276a69b5bbc60fd [file] [log] [blame]
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01001#pragma once
2
3#include <osmocom/core/linuxlist.h>
4
5struct msc_a;
6struct vlr_subscr;
7struct gsm_trans;
8
9/* Modeled after the RANAP PagingCause; translates to enum sgsap_service_ind and BSSMAP Channel Needed (3GPP TS 48.008
10 * 3.2.2.36) by collapsing e.g. all call related paging causes to SGSAP_SERV_IND_CS_CALL, etc. */
11enum paging_cause {
12 PAGING_CAUSE_CALL_CONVERSATIONAL = 0,
13 PAGING_CAUSE_CALL_STREAMING,
14 PAGING_CAUSE_CALL_INTERACTIVE,
15 PAGING_CAUSE_CALL_BACKGROUND,
16 PAGING_CAUSE_SIGNALLING_LOW_PRIO,
17 PAGING_CAUSE_SIGNALLING_HIGH_PRIO,
18 PAGING_CAUSE_UNSPECIFIED,
19};
20
21extern const struct value_string paging_cause_names[];
22static inline const char *paging_cause_name(enum paging_cause val)
23{ return get_value_string(paging_cause_names, val); }
24
25/* A successful Paging will pass a valid msc_a, an expired paging will pass msc_a == NULL. */
26typedef void (* paging_cb_t )(struct msc_a *msc_a, struct gsm_trans *trans);
27
28struct paging_request {
29 struct llist_head entry;
30
31 /* human readable label to be able to log pending request kinds */
32 const char *label;
33 enum paging_cause cause;
34
35 /* the callback data */
36 paging_cb_t paging_cb;
37 struct gsm_trans *trans;
38};
39
40struct paging_request *paging_request_start(struct vlr_subscr *vsub, enum paging_cause cause,
41 paging_cb_t paging_cb, struct gsm_trans *trans,
42 const char *label);
43void paging_request_remove(struct paging_request *pr);
44
45void paging_response(struct msc_a *msc_a);
46void paging_expired(struct vlr_subscr *vsub);