summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--example/ss.c15
-rw-r--r--include/dect/ie.h6
-rw-r--r--src/mm.c2
-rw-r--r--src/s_msg.c40
-rw-r--r--src/ss.c2
5 files changed, 59 insertions, 6 deletions
diff --git a/example/ss.c b/example/ss.c
index f45e9f6..eac9391 100644
--- a/example/ss.c
+++ b/example/ss.c
@@ -29,18 +29,25 @@ static void mnss_release_ind(struct dect_handle *dh, struct dect_ss_endpoint *ss
static void dect_invoke_ss(struct dect_handle *dh, const struct dect_ipui *ipui)
{
struct dect_ss_endpoint *sse;
- struct dect_ie_feature_activate feature_activate;
+ struct dect_ie_events_notification events_notification;
struct dect_mnss_param param = {
- .feature_activate = &feature_activate,
+ .events_notification = &events_notification,
};
sse = dect_ss_endpoint_alloc(dh, ipui);
if (sse == NULL)
return;
- feature_activate.feature = DECT_FEATURE_INDICATION_OF_SUBSCRIBER_NUMBER;
+ events_notification.num = 2;
+ events_notification.events[0].type = DECT_EVENT_MISSED_CALL;
+ events_notification.events[0].subtype = DECT_EVENT_MISSED_CALL_VOICE;
+ events_notification.events[0].multiplicity = 10;
- dect_mnss_setup_req(dh, sse, &param);
+ events_notification.events[1].type = DECT_EVENT_MESSAGE_WAITING;
+ events_notification.events[1].subtype = DECT_EVENT_MESSAGE_WAITING_VOICE;
+ events_notification.events[1].multiplicity = 10;
+
+ dect_mnss_facility_req(dh, sse, &param);
}
static struct dect_ss_ops ss_ops = {
diff --git a/include/dect/ie.h b/include/dect/ie.h
index 3de3f3f..50b6e92 100644
--- a/include/dect/ie.h
+++ b/include/dect/ie.h
@@ -2128,6 +2128,12 @@ enum dect_event_web_content_subtypes {
/** <<EVENTS-NOTIFICATION>> IE */
struct dect_ie_events_notification {
struct dect_ie_common common;
+ unsigned int num;
+ struct {
+ enum dect_event_types type;
+ uint8_t subtype;
+ uint8_t multiplicity;
+ } events[8];
};
/**
diff --git a/src/mm.c b/src/mm.c
index dd70322..98dc38b 100644
--- a/src/mm.c
+++ b/src/mm.c
@@ -1015,7 +1015,7 @@ static void dect_mm_rcv_authentication_reject(struct dect_handle *dh,
struct dect_mm_authenticate_param *param;
mm_debug(mme, "AUTHENTICATION-REJECT");
- if (mpr->type == DECT_MMP_KEY_ALLOCATION)
+ if (mp->type == DECT_MMP_KEY_ALLOCATION)
mp = mpr;
else if (mp->type != DECT_MMP_AUTHENTICATE)
return;
diff --git a/src/s_msg.c b/src/s_msg.c
index e8561c1..267be9f 100644
--- a/src/s_msg.c
+++ b/src/s_msg.c
@@ -2024,6 +2024,44 @@ static int dect_sfmt_build_codec_list(struct dect_sfmt_ie *dst,
return 0;
}
+static const struct dect_trans_tbl dect_event_types[] = {
+ TRANS_TBL(DECT_EVENT_MESSAGE_WAITING, "Message waiting"),
+ TRANS_TBL(DECT_EVENT_MISSED_CALL, "Missed call"),
+ TRANS_TBL(DECT_EVENT_WEB_CONTENT, "Web content"),
+ TRANS_TBL(DECT_EVENT_LIST_CHANGE_INDICATION, "List change indication"),
+};
+
+static void dect_sfmt_dump_events_notification(const struct dect_ie_common *_ie)
+{
+ struct dect_ie_events_notification *ie = dect_ie_container(ie, _ie);
+ unsigned int i;
+ char buf[128];
+
+ for (i = 0; i < ie->num; i++) {
+ sfmt_debug("\tEvent %u:\n", i + 1);
+ sfmt_debug("\t Event type: %s\n",
+ dect_val2str(dect_event_types, buf, ie->events[i].type));
+ sfmt_debug("\t Event subtype: %u\n", ie->events[i].subtype);
+ sfmt_debug("\t Event multiplicity: %u\n", ie->events[i].multiplicity);
+ }
+}
+
+static int dect_sfmt_build_events_notification(struct dect_sfmt_ie *dst,
+ const struct dect_ie_common *ie)
+{
+ struct dect_ie_events_notification *src = dect_ie_container(src, ie);
+ unsigned int n = 2, i;
+
+ for (i = 0; i < src->num; i++) {
+ dst->data[n++] = src->events[i].type;
+ dst->data[n++] = src->events[i].subtype | DECT_OCTET_GROUP_END;
+ dst->data[n++] = src->events[i].multiplicity | DECT_OCTET_GROUP_END;
+ }
+
+ dst->len = n;
+ return 0;
+}
+
static const struct dect_ie_handler {
const char *name;
size_t size;
@@ -2394,6 +2432,8 @@ static const struct dect_ie_handler {
[DECT_IE_EVENTS_NOTIFICATION] = {
.name = "EVENTS-NOTIFICATION",
.size = sizeof(struct dect_ie_events_notification),
+ .build = dect_sfmt_build_events_notification,
+ .dump = dect_sfmt_dump_events_notification,
},
[DECT_IE_CALL_INFORMATION] = {
.name = "CALL-INFORMATION",
diff --git a/src/ss.c b/src/ss.c
index ce37666..d8f64f9 100644
--- a/src/ss.c
+++ b/src/ss.c
@@ -157,7 +157,7 @@ int dect_mnss_setup_req(struct dect_handle *dh, struct dect_ss_endpoint *sse,
goto err1;
if (dh->mode == DECT_MODE_PP) {
- portable_identity.type = DECT_PORTABLE_ID_TYPE_IPUI;
+ portable_identity.type = DECT_PORTABLE_ID_TYPE_IPEI;
portable_identity.ipui = sse->ipui;
msg.portable_identity = &portable_identity;
}