aboutsummaryrefslogtreecommitdiffstats
path: root/src/hlr_ussd.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-07-29 16:14:48 +0200
committerHarald Welte <laforge@gnumonks.org>2018-07-30 17:43:10 +0200
commitdab544e14bedb990a3cbcc0df53a97d1bb24e973 (patch)
tree5a892918ab5c4e1c001c2361f8957b63ac615082 /src/hlr_ussd.h
parent7d29d59292c5357537665fdf3a1f2022c79ae604 (diff)
USSD: Add support for internal USSD handlers
There are some requests that are best served inside the HLR, as it has access to subscriber information such as MSISDN and IMSI. This unfortunately required quite some restructuring of the USSD related structures including the VTY syntax for adding routes. The default config file has been updated to replicate the *#100# built-in behavior of old OsmoNITB. Closes: OS#2566 Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9
Diffstat (limited to 'src/hlr_ussd.h')
-rw-r--r--src/hlr_ussd.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h
index 433a7f2..d1b9fe0 100644
--- a/src/hlr_ussd.h
+++ b/src/hlr_ussd.h
@@ -5,11 +5,15 @@
struct osmo_gsup_conn;
-struct hlr_euse_route {
- /* hlr_euse.routes */
+struct hlr_ussd_route {
+ /* g_hlr.routes */
struct llist_head list;
- struct hlr_euse *euse;
const char *prefix;
+ bool is_external;
+ union {
+ struct hlr_euse *euse;
+ const struct hlr_iuse *iuse;
+ } u;
};
struct hlr_euse {
@@ -20,21 +24,34 @@ struct hlr_euse {
const char *name;
/* human-readable description */
const char *description;
- /* list of hlr_euse_route */
- struct llist_head routes;
/* GSUP connection to the EUSE, if any */
struct osmo_gsup_conn *conn;
};
-
struct hlr_euse *euse_find(struct hlr *hlr, const char *name);
struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name);
void euse_del(struct hlr_euse *euse);
-struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix);
-struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix);
-void euse_route_del(struct hlr_euse_route *rt);
+const struct hlr_iuse *iuse_find(const char *name);
+
+struct hlr_ussd_route *ussd_route_find_prefix(struct hlr *hlr, const char *prefix);
+struct hlr_ussd_route *ussd_route_prefix_alloc_int(struct hlr *hlr, const char *prefix,
+ const struct hlr_iuse *iuse);
+struct hlr_ussd_route *ussd_route_prefix_alloc_ext(struct hlr *hlr, const char *prefix,
+ struct hlr_euse *euse);
+void ussd_route_del(struct hlr_ussd_route *rt);
int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup);
int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup);
+
+struct ss_session;
+struct ss_request;
+
+/* Internal USSD Handler */
+struct hlr_iuse {
+ const char *name;
+ /* call-back to be called for any incoming USSD messages for this IUSE */
+ int (*handle_ussd)(struct osmo_gsup_conn *conn, struct ss_session *ss,
+ const struct osmo_gsup_message *gsup, const struct ss_request *req);
+};