Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/linuxlist.h> |
| 4 | |
| 5 | struct msc_a; |
| 6 | struct vlr_subscr; |
| 7 | struct 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. */ |
| 11 | enum 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 | |
| 21 | extern const struct value_string paging_cause_names[]; |
| 22 | static 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. */ |
| 26 | typedef void (* paging_cb_t )(struct msc_a *msc_a, struct gsm_trans *trans); |
| 27 | |
| 28 | struct 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 | |
| 40 | struct 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); |
| 43 | void paging_request_remove(struct paging_request *pr); |
| 44 | |
| 45 | void paging_response(struct msc_a *msc_a); |
| 46 | void paging_expired(struct vlr_subscr *vsub); |