summaryrefslogtreecommitdiffstats
path: root/example/ss.c
blob: eac93911c657601918de5d797edae24f50e650f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>

#include <dect/libdect.h>
#include "common.h"

static void mnss_setup_ind(struct dect_handle *dh, struct dect_ss_endpoint *sse,
			   struct dect_mnss_param *param)
{

}

static void mnss_facility_ind(struct dect_handle *dh, struct dect_ss_endpoint *sse,
			      struct dect_mnss_param *param)
{

}

static void mnss_release_ind(struct dect_handle *dh, struct dect_ss_endpoint *sse,
			     struct dect_mnss_param *param)

{

}

static void dect_invoke_ss(struct dect_handle *dh, const struct dect_ipui *ipui)
{
	struct dect_ss_endpoint *sse;
	struct dect_ie_events_notification events_notification;
	struct dect_mnss_param param = {
		.events_notification	= &events_notification,
	};

	sse = dect_ss_endpoint_alloc(dh, ipui);
	if (sse == NULL)
		return;

	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;

	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 = {
	.mnss_setup_ind		= mnss_setup_ind,
	.mnss_facility_ind	= mnss_facility_ind,
	.mnss_release_ind	= mnss_release_ind,
};

static struct dect_ops ops = {
	.ss_ops			= &ss_ops,
};

int main(int argc, char **argv)
{
	dect_common_init(&ops, argv[1]);

	dect_invoke_ss(dh, &ipui);
	dect_event_loop();

	dect_common_cleanup(dh);
	return 0;
}