diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-05 13:13:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-05 13:13:29 +0000 |
commit | 51197efdfb417a9388a7f5f46b51ffe3077d9b24 (patch) | |
tree | 1acf82f5ff957955c715c4f59d25740b86ffea1b /src/include | |
parent | ac3a1c494fd48fc1d01fcc4eafa0b3f4878f5441 (diff) | |
download | gnunet-51197efdfb417a9388a7f5f46b51ffe3077d9b24.tar.gz gnunet-51197efdfb417a9388a7f5f46b51ffe3077d9b24.zip |
-removing old legacy conversation API
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_conversation_service.h | 226 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 109 |
2 files changed, 28 insertions, 307 deletions
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h index 248a66325..3c3112745 100644 --- a/src/include/gnunet_conversation_service.h +++ b/src/include/gnunet_conversation_service.h | |||
@@ -25,6 +25,26 @@ | |||
25 | * @author Andreas Fuchs | 25 | * @author Andreas Fuchs |
26 | * @author Christian Grothoff | 26 | * @author Christian Grothoff |
27 | * | 27 | * |
28 | * | ||
29 | * NOTE: This API is deliberately deceptively simple; the idea | ||
30 | * is that advanced features (such as answering machines) will | ||
31 | * be done with a separate service (an answering machine service) | ||
32 | * with its own APIs; the speaker/microphone abstractions are | ||
33 | * used to facilitate plugging in custom logic for implementing | ||
34 | * such a service later by creating "software" versions of | ||
35 | * speakers and microphones that record to disk or play a file. | ||
36 | * Notifications about missed calls should similarly be done | ||
37 | * using a separate service; CONVERSATION is supposed to be just | ||
38 | * the "bare bones" voice service. | ||
39 | * | ||
40 | * Meta data passing is supported so that advanced services | ||
41 | * can identify themselves appropriately. | ||
42 | * | ||
43 | * As this is supposed to be a "secure" service, caller ID is of | ||
44 | * course provided as part of the basic implementation, as only the | ||
45 | * CONVERSATION service can know for sure who it is that we are | ||
46 | * talking to. | ||
47 | * | ||
28 | * TODO: | 48 | * TODO: |
29 | * - call waiting | 49 | * - call waiting |
30 | * - put on hold | 50 | * - put on hold |
@@ -41,206 +61,6 @@ extern "C" | |||
41 | #endif | 61 | #endif |
42 | 62 | ||
43 | #include "gnunet_util_lib.h" | 63 | #include "gnunet_util_lib.h" |
44 | |||
45 | /** | ||
46 | * Version of the conversation API. | ||
47 | */ | ||
48 | #define GNUNET_CONVERSATION_VERSION 0x00000001 | ||
49 | |||
50 | |||
51 | enum GNUNET_CONVERSATION_RejectReason | ||
52 | { | ||
53 | GNUNET_CONVERSATION_REJECT_REASON_GENERIC = 0, | ||
54 | GNUNET_CONVERSATION_REJECT_REASON_NOT_AVAILABLE, | ||
55 | GNUNET_CONVERSATION_REJECT_REASON_NO_CLIENT, | ||
56 | GNUNET_CONVERSATION_REJECT_REASON_ACTIVE_CALL, | ||
57 | GNUNET_CONVERSATION_REJECT_REASON_NOT_WANTED, | ||
58 | GNUNET_CONVERSATION_REJECT_REASON_NO_ANSWER | ||
59 | |||
60 | }; | ||
61 | |||
62 | |||
63 | enum GNUNET_CONVERSATION_NotificationType | ||
64 | { | ||
65 | GNUNET_CONVERSATION_NT_SERVICE_BLOCKED = 0, | ||
66 | GNUNET_CONVERSATION_NT_NO_PEER, | ||
67 | GNUNET_CONVERSATION_NT_NO_ANSWER, | ||
68 | GNUNET_CONVERSATION_NT_AVAILABLE_AGAIN, | ||
69 | GNUNET_CONVERSATION_NT_CALL_ACCEPTED, | ||
70 | GNUNET_CONVERSATION_NT_CALL_TERMINATED | ||
71 | }; | ||
72 | |||
73 | |||
74 | /** | ||
75 | * | ||
76 | */ | ||
77 | struct GNUNET_CONVERSATION_MissedCall | ||
78 | { | ||
79 | struct GNUNET_PeerIdentity peer; | ||
80 | struct GNUNET_TIME_Absolute time; | ||
81 | }; | ||
82 | |||
83 | |||
84 | struct GNUNET_CONVERSATION_MissedCallNotification | ||
85 | { | ||
86 | int number; | ||
87 | struct GNUNET_CONVERSATION_MissedCall *calls; | ||
88 | }; | ||
89 | |||
90 | struct GNUNET_CONVERSATION_CallInformation; | ||
91 | |||
92 | struct GNUNET_CONVERSATION_Handle; | ||
93 | |||
94 | |||
95 | /** | ||
96 | * Method called whenever a call is incoming | ||
97 | * | ||
98 | * @param cls closure | ||
99 | * @param handle to the conversation session | ||
100 | * @param caller peer that calls you | ||
101 | */ | ||
102 | typedef void (GNUNET_CONVERSATION_CallHandler) (void *cls, | ||
103 | struct GNUNET_CONVERSATION_Handle *handle, | ||
104 | const struct GNUNET_PeerIdentity *caller); | ||
105 | |||
106 | |||
107 | /** | ||
108 | * Method called whenever a call is rejected | ||
109 | * | ||
110 | * @param cls closure | ||
111 | * @param handle to the conversation session | ||
112 | * @param reason reason given for rejecting the call | ||
113 | * @param peer peer that rejected your call | ||
114 | */ | ||
115 | typedef void (GNUNET_CONVERSATION_RejectHandler) (void *cls, | ||
116 | struct GNUNET_CONVERSATION_Handle *handle, | ||
117 | enum GNUNET_CONVERSATION_RejectReason reason, | ||
118 | const struct GNUNET_PeerIdentity *peer); | ||
119 | |||
120 | |||
121 | /** | ||
122 | * Method called whenever a notification is there | ||
123 | * | ||
124 | * @param cls closure | ||
125 | * @param handle to the conversation session | ||
126 | * @param type the type of the notification | ||
127 | * @param peer peer that the notification is about | ||
128 | */ | ||
129 | typedef void (GNUNET_CONVERSATION_NotificationHandler) (void *cls, | ||
130 | struct GNUNET_CONVERSATION_Handle *handle, | ||
131 | enum GNUNET_CONVERSATION_NotificationType type, | ||
132 | const struct GNUNET_PeerIdentity *peer); | ||
133 | |||
134 | |||
135 | /** | ||
136 | * Method called whenever a notification for missed calls is there | ||
137 | * | ||
138 | * @param cls closure | ||
139 | * @param handle to the conversation session | ||
140 | * @param missed_calls a list of missed calls | ||
141 | */ | ||
142 | typedef void (GNUNET_CONVERSATION_MissedCallHandler) (void *cls, | ||
143 | struct GNUNET_CONVERSATION_Handle *handle, | ||
144 | struct GNUNET_CONVERSATION_MissedCallNotification *missed_calls); | ||
145 | |||
146 | |||
147 | /** | ||
148 | * Connect to the VoIP service | ||
149 | * | ||
150 | * @param cfg configuration | ||
151 | * @param cls NULL | ||
152 | * @param call_handler the callback which is called when a call is incoming | ||
153 | * @param reject_handler the callback which is called when a call is rejected | ||
154 | * @param notification_handler the callback which is called when there is a notification | ||
155 | * @param missed_call_handler the callback which is called when the service notifies the client about missed clients | ||
156 | * @return handle to the connection to the conversation service | ||
157 | */ | ||
158 | struct GNUNET_CONVERSATION_Handle * | ||
159 | GNUNET_CONVERSATION_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
160 | void *cls, | ||
161 | GNUNET_CONVERSATION_CallHandler call_handler, | ||
162 | GNUNET_CONVERSATION_RejectHandler reject_handler, | ||
163 | GNUNET_CONVERSATION_NotificationHandler notification_handler, | ||
164 | GNUNET_CONVERSATION_MissedCallHandler missed_call_handler); | ||
165 | |||
166 | |||
167 | /** | ||
168 | * Disconnect from the VoIP service | ||
169 | * | ||
170 | * @param handle handle to the VoIP connection | ||
171 | */ | ||
172 | void | ||
173 | GNUNET_CONVERSATION_disconnect (struct GNUNET_CONVERSATION_Handle *handle); | ||
174 | |||
175 | |||
176 | /** | ||
177 | * Establish a call | ||
178 | * | ||
179 | * @param handle handle to the VoIP connection | ||
180 | * @param callee the peer (PeerIdentity or GNS name) to call | ||
181 | * @param doGnsLookup 0 = no GNS lookup or 1 = GNS lookup | ||
182 | */ | ||
183 | void | ||
184 | GNUNET_CONVERSATION_call (struct GNUNET_CONVERSATION_Handle *handle, | ||
185 | const char *callee, | ||
186 | int doGnsLookup); | ||
187 | |||
188 | |||
189 | /** | ||
190 | * Terminate the active call | ||
191 | * | ||
192 | * @param handle handle to the VoIP connection | ||
193 | */ | ||
194 | void | ||
195 | GNUNET_CONVERSATION_hangup (struct GNUNET_CONVERSATION_Handle *handle); | ||
196 | |||
197 | |||
198 | /** | ||
199 | * Accept an incoming call | ||
200 | * | ||
201 | * @param handle handle to the VoIP connection | ||
202 | */ | ||
203 | void | ||
204 | GNUNET_CONVERSATION_accept (struct GNUNET_CONVERSATION_Handle *handle); | ||
205 | |||
206 | |||
207 | /** | ||
208 | * Reject an incoming call | ||
209 | * | ||
210 | * @param handle handle to the VoIP connection | ||
211 | */ | ||
212 | void | ||
213 | GNUNET_CONVERSATION_reject (struct GNUNET_CONVERSATION_Handle *handle); | ||
214 | |||
215 | |||
216 | |||
217 | //////////////////////////////////////////////////////////////////// | ||
218 | ////////////////////////// NEW API ///////////////////////////////// | ||
219 | //////////////////////////////////////////////////////////////////// | ||
220 | |||
221 | /* | ||
222 | NOTE: This API is deliberately deceptively simple; the idea | ||
223 | is that advanced features (such as answering machines) will | ||
224 | be done with a separate service (an answering machine service) | ||
225 | with its own APIs; the speaker/microphone abstractions are | ||
226 | used to facilitate plugging in custom logic for implementing | ||
227 | such a service later by creating "software" versions of | ||
228 | speakers and microphones that record to disk or play a file. | ||
229 | Notifications about missed calls should similarly be done | ||
230 | using a separate service; CONVERSATION is supposed to be just | ||
231 | the "bare bones" voice service. | ||
232 | |||
233 | Meta data passing is supported so that advanced services | ||
234 | can identify themselves appropriately. | ||
235 | |||
236 | As this is supposed to be a "secure" service, caller ID is of | ||
237 | course provided as part of the basic implementation, as only the | ||
238 | CONVERSATION service can know for sure who it is that we are | ||
239 | talking to. | ||
240 | */ | ||
241 | |||
242 | |||
243 | #include "gnunet_util_lib.h" | ||
244 | #include "gnunet_identity_service.h" | 64 | #include "gnunet_identity_service.h" |
245 | #include "gnunet_namestore_service.h" | 65 | #include "gnunet_namestore_service.h" |
246 | #include "gnunet_speaker_lib.h" | 66 | #include "gnunet_speaker_lib.h" |
@@ -248,6 +68,12 @@ GNUNET_CONVERSATION_reject (struct GNUNET_CONVERSATION_Handle *handle); | |||
248 | 68 | ||
249 | 69 | ||
250 | /** | 70 | /** |
71 | * Version of the conversation API. | ||
72 | */ | ||
73 | #define GNUNET_CONVERSATION_VERSION 0x00000002 | ||
74 | |||
75 | |||
76 | /** | ||
251 | * Information about the current status of a call. Each call | 77 | * Information about the current status of a call. Each call |
252 | * progresses from ring over ready to terminated. Steps may | 78 | * progresses from ring over ready to terminated. Steps may |
253 | * be skipped. | 79 | * be skipped. |
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 4d07c7712..5380e0987 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -2122,114 +2122,9 @@ extern "C" | |||
2122 | ******************************************************************************/ | 2122 | ******************************************************************************/ |
2123 | 2123 | ||
2124 | /** | 2124 | /** |
2125 | * Client <-> Server message to initiate a new call | ||
2126 | */ | ||
2127 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_INITIATE 730 | ||
2128 | |||
2129 | /** | ||
2130 | * Client <-> Server meessage to accept an incoming call | ||
2131 | */ | ||
2132 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT 731 | ||
2133 | |||
2134 | /** | ||
2135 | * Client <-> Server message to reject an incoming call | ||
2136 | */ | ||
2137 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT 732 | ||
2138 | |||
2139 | /** | ||
2140 | * Client <-> Server message to terminate a call | ||
2141 | */ | ||
2142 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE 733 | ||
2143 | |||
2144 | /** | ||
2145 | * Client <-> Server message to initiate a new call | ||
2146 | */ | ||
2147 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST 734 | ||
2148 | |||
2149 | /** | ||
2150 | * Server <-> Client message to initiate a new call | ||
2151 | */ | ||
2152 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_INITIATE 735 | ||
2153 | |||
2154 | /** | ||
2155 | * Server <-> Client meessage to accept an incoming call | ||
2156 | */ | ||
2157 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_ACCEPT 736 | ||
2158 | |||
2159 | /** | ||
2160 | * Server <-> Client message to reject an incoming call | ||
2161 | */ | ||
2162 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_REJECT 737 | ||
2163 | |||
2164 | /** | ||
2165 | * Server <-> Client message to terminat a call | ||
2166 | */ | ||
2167 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_TERMINATE 738 | ||
2168 | |||
2169 | /** | ||
2170 | * Server <-> Client message to signalize the client that the service is already in use | ||
2171 | */ | ||
2172 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SERVICE_BLOCKED 739 | ||
2173 | |||
2174 | /** | ||
2175 | * Server <-> Client message to signalize the client that the called peer is not connected | ||
2176 | */ | ||
2177 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_NOT_CONNECTED 740 | ||
2178 | |||
2179 | /** | ||
2180 | * Server <-> Client message to signalize the client that called peer does not answer | ||
2181 | */ | ||
2182 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_NO_ANSWER 741 | ||
2183 | |||
2184 | /** | ||
2185 | * Server <-> Client message to notify client of missed call | ||
2186 | */ | ||
2187 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_MISSED_CALL 742 | ||
2188 | |||
2189 | /** | ||
2190 | * Server <-> Client message to signalize the client that there occured an error | ||
2191 | */ | ||
2192 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR 743 | ||
2193 | |||
2194 | /** | ||
2195 | * Server <-> Client message to notify client of peer being available | ||
2196 | */ | ||
2197 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE 744 | ||
2198 | |||
2199 | /** | ||
2200 | * Mesh message to sinal the remote peer the wish to initiate a new call | ||
2201 | */ | ||
2202 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_INITIATE 745 | ||
2203 | |||
2204 | /** | ||
2205 | * Mesh message to signal the remote peer the acceptance of an initiated call | ||
2206 | */ | ||
2207 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT 746 | ||
2208 | |||
2209 | /** | ||
2210 | * Mesh message to reject an a wish to initiate a new call | ||
2211 | */ | ||
2212 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT 747 | ||
2213 | |||
2214 | /** | ||
2215 | * Mesh message to signal a remote peer the terminatation of a call | ||
2216 | */ | ||
2217 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE 748 | ||
2218 | |||
2219 | /** | ||
2220 | * Server <-> Client message to notify client of peer being available | ||
2221 | */ | ||
2222 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE 749 | ||
2223 | |||
2224 | |||
2225 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_TEST 750 | ||
2226 | |||
2227 | |||
2228 | |||
2229 | /** | ||
2230 | * Message to transmit the audio between helper and speaker/microphone library. | 2125 | * Message to transmit the audio between helper and speaker/microphone library. |
2231 | */ | 2126 | */ |
2232 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO 751 | 2127 | #define GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO 730 |
2233 | 2128 | ||
2234 | /** | 2129 | /** |
2235 | * Client -> Server message register a phone. | 2130 | * Client -> Server message register a phone. |
@@ -2307,7 +2202,7 @@ extern "C" | |||
2307 | /** | 2202 | /** |
2308 | * Multicast message from the origin to all members. | 2203 | * Multicast message from the origin to all members. |
2309 | */ | 2204 | */ |
2310 | #define GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE 760 | 2205 | #define GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE 750 |
2311 | 2206 | ||
2312 | /** | 2207 | /** |
2313 | * A unicast message from a group member to the origin. | 2208 | * A unicast message from a group member to the origin. |