l10n: sync translations with transifex.net
[siplcs.git] / src / core / sipe.h
blob624dee492727b05f072ce568d983ca334f50007a
1 /**
2 * @file sipe.h
4 * pidgin-sipe
6 * Copyright (C) 2010-11 SIPE Project <http://sipe.sourceforge.net/>
7 * Copyright (C) 2008 Novell, Inc.
8 * Copyright (C) 2007 Anibal Avelar <avelar@gmail.com>
9 * Copyright (C) 2005 Thomas Butter <butter@uni-mannheim.de>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Interface dependencies:
29 * <time.h>
30 * <glib.h>
33 /* Forward declarations */
34 struct sipmsg;
35 struct _PurpleAccount;
36 struct _PurpleConnection;
37 struct _PurpleGroup;
38 struct sipe_core_private;
39 struct transaction;
40 struct transaction_payload;
42 /** MS-PRES publication */
43 struct sipe_publication {
44 gchar *category;
45 guint instance;
46 guint container;
47 guint version;
48 /** for 'state' category */
49 int availability;
50 /** for 'state:calendarState' category */
51 char *cal_event_hash;
52 /** for 'note' category */
53 gchar *note;
54 /** for 'calendarData' category; 300(Team) container */
55 char *working_hours_xml_str;
56 char *fb_start_str;
57 char *free_busy_base64;
60 struct sipe_account_data {
61 struct _PurpleConnection *gc;
62 gchar *authdomain;
63 gchar *authuser;
64 gchar *password;
65 /** Allowed server events to subscribe. From register OK response. */
66 GSList *allow_events;
67 struct sip_csta *csta; /* For RCC - Remote Call Control */
68 gboolean subscribed_buddies; /* whether subscribed to buddies presence */
69 gboolean access_level_set; /* whether basic access level set */
70 gboolean initial_state_published; /* whether we published our initial state */
71 GSList *our_publication_keys; /* [MS-PRES] */
72 GHashTable *our_publications; /* [MS-PRES] */
73 GHashTable *user_state_publications; /* [MS-PRES] */
74 int contacts_delta;
75 int acl_delta;
76 int presence_method_version;
77 time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES];
78 gchar *status;
79 gboolean is_oof_note;
80 gchar *note;
81 time_t note_since;
82 time_t idle_switch;
83 gboolean batched_support; /*if there is support for batched subscription*/
84 GSList *containers; /* MS-PRES containers */
85 struct _PurpleAccount *account;
86 gchar *regcallid;
87 GSList *groups;
88 struct sipe_calendar *cal;
89 gchar *email;
90 /** 2005 Custom XML piece.
91 * Possibly set by other point of presence or just other client at earlier time.
92 * It should be preserved/modified, not overwritten. This implies subscription
93 * to self-contasct.
94 * This XML keeps OC2005:
95 * - User note
96 * - OOF flag
97 * - User status
99 gchar *user_states;
102 struct sipe_auth_job {
103 gchar *who;
104 struct sipe_core_private *sipe_private;
107 struct group_user_context {
108 gchar * group_name;
109 gchar * user_name;
112 GSList * slist_insert_unique_sorted(GSList *list, gpointer data, GCompareFunc func);
115 * Publishes self status
116 * based on own calendar information,
117 * our Calendar information - FreeBusy, WorkingHours,
118 * OOF note.
120 * For 2007+
122 void
123 publish_calendar_status_self(struct sipe_core_private *sipe_private,
124 void *unused);
127 * For 2005-
129 void
130 send_presence_soap(struct sipe_core_private *sipe_private,
131 gboolean do_publish_calendar);
134 * THE BIG SPLIT - temporary interfaces
136 * Previously private functions in sipe.c that are
137 * - waiting to be factored out to an appropriate module
138 * - are needed by the already created new modules
141 /* pier11:
143 * Since SIP (RFC3261) is extensible by its design,
144 * and MS specs prove just that (they all are defined as SIP extensions),
145 * it make sense to split functionality by extension (or close extension group).
146 * For example: conference, presence (MS-PRES), etc.
148 * This way our code will not be monolithic, but potentially _reusable_. May be
149 * a top of other SIP core, and/or other front-end (Telepathy framework?).
152 /* ??? module */
153 void sipe_connection_cleanup(struct sipe_core_private *sipe_private);
154 void sipe_buddy_free_all(struct sipe_core_private *sipe_private);
156 /* sipe-notify? */
157 void process_incoming_notify(struct sipe_core_private *sipe_private,
158 struct sipmsg *msg,
159 gboolean request,
160 gboolean benotify);
162 /* sipe-soap? */
163 void send_soap_request_with_cb(struct sipe_core_private *sipe_private,
164 gchar *from0,
165 gchar *body,
166 gboolean (*callbackb) (struct sipe_core_private *, struct sipmsg *,struct transaction *),
167 struct transaction_payload *payload);
169 void send_soap_request(struct sipe_core_private *sipe_private, gchar *body);
171 /*** THE BIG SPLIT END ***/
174 * Publishes categories.
175 * @param uri (%s) Self URI. Ex.: sip:alice7@boston.local
176 * @param publications (%s) XML publications
178 #define SIPE_SEND_PRESENCE \
179 "<publish xmlns=\"http://schemas.microsoft.com/2006/09/sip/rich-presence\">"\
180 "<publications uri=\"%s\">"\
181 "%s"\
182 "</publications>"\
183 "</publish>"
186 * Publishes 'device' category.
187 * @param instance (%u) Ex.: 1938468728
188 * @param version (%u) Ex.: 1
189 * @param endpointId (%s) Ex.: C707E38E-1E10-5413-94D9-ECAC260A0269
190 * @param uri (%s) Self URI. Ex.: sip:alice7@boston.local
191 * @param timezone (%s) Ex.: 00:00:00+01:00
192 * @param machineName (%s) Ex.: BOSTON-OCS07
194 #define SIPE_PUB_XML_DEVICE \
195 "<publication categoryName=\"device\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
196 "<device xmlns=\"http://schemas.microsoft.com/2006/09/sip/device\" endpointId=\"%s\">"\
197 "<capabilities preferred=\"false\" uri=\"%s\">"\
198 "<text capture=\"true\" render=\"true\" publish=\"false\"/>"\
199 "<gifInk capture=\"false\" render=\"true\" publish=\"false\"/>"\
200 "<isfInk capture=\"false\" render=\"true\" publish=\"false\"/>"\
201 "</capabilities>"\
202 "<timezone>%s</timezone>"\
203 "<machineName>%s</machineName>"\
204 "</device>"\
205 "</publication>"
208 * Publishes 'machineState' category.
209 * @param instance (%u) Ex.: 926460663
210 * @param version (%u) Ex.: 22
211 * @param availability (%d) Ex.: 3500
212 * @param instance (%u) Ex.: 926460663
213 * @param version (%u) Ex.: 22
214 * @param availability (%d) Ex.: 3500
216 #define SIPE_PUB_XML_STATE_MACHINE \
217 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
218 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"machineState\">"\
219 "<availability>%d</availability>"\
220 "<endpointLocation/>"\
221 "</state>"\
222 "</publication>"\
223 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\">"\
224 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"machineState\">"\
225 "<availability>%d</availability>"\
226 "<endpointLocation/>"\
227 "</state>"\
228 "</publication>"
231 * Publishes 'userState' category.
232 * @param instance (%u) User. Ex.: 536870912
233 * @param version (%u) User Container 2. Ex.: 22
234 * @param availability (%d) User Container 2. Ex.: 15500
235 * @param instance (%u) User. Ex.: 536870912
236 * @param version (%u) User Container 3.Ex.: 22
237 * @param availability (%d) User Container 3. Ex.: 15500
239 #define SIPE_PUB_XML_STATE_USER \
240 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"static\">"\
241 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"userState\">"\
242 "<availability>%d</availability>"\
243 "<endpointLocation/>"\
244 "</state>"\
245 "</publication>"\
246 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"static\">"\
247 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"userState\">"\
248 "<availability>%d</availability>"\
249 "<endpointLocation/>"\
250 "</state>"\
251 "</publication>"
254 * An availability XML entry for SIPE_PUB_XML_STATE_CALENDAR
255 * @param availability (%d) Ex.: 6500
257 #define SIPE_PUB_XML_STATE_CALENDAR_AVAIL \
258 "<availability>%d</availability>"
260 * An activity XML entry for SIPE_PUB_XML_STATE_CALENDAR
261 * @param token (%s) Ex.: in-a-meeting
262 * @param minAvailability_attr (%s) Ex.: minAvailability="6500"
263 * @param maxAvailability_attr (%s) Ex.: maxAvailability="8999" or none
265 #define SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY \
266 "<activity token=\"%s\" %s %s></activity>"
268 * Publishes 'calendarState' category.
269 * @param instance (%u) Ex.: 1339299275
270 * @param version (%u) Ex.: 1
271 * @param uri (%s) Ex.: john@contoso.com
272 * @param start_time_str (%s) Ex.: 2008-01-11T19:00:00Z
273 * @param availability (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_AVAIL
274 * @param activity (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY
275 * @param meeting_subject (%s) Ex.: Customer Meeting
276 * @param meeting_location (%s) Ex.: Conf Room 100
278 * @param instance (%u) Ex.: 1339299275
279 * @param version (%u) Ex.: 1
280 * @param uri (%s) Ex.: john@contoso.com
281 * @param start_time_str (%s) Ex.: 2008-01-11T19:00:00Z
282 * @param availability (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_AVAIL
283 * @param activity (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY
284 * @param meeting_subject (%s) Ex.: Customer Meeting
285 * @param meeting_location (%s) Ex.: Conf Room 100
287 #define SIPE_PUB_XML_STATE_CALENDAR \
288 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
289 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" uri=\"%s\" startTime=\"%s\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"calendarState\">"\
290 "%s"\
291 "%s"\
292 "<endpointLocation/>"\
293 "<meetingSubject>%s</meetingSubject>"\
294 "<meetingLocation>%s</meetingLocation>"\
295 "</state>"\
296 "</publication>"\
297 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\">"\
298 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" uri=\"%s\" startTime=\"%s\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"calendarState\">"\
299 "%s"\
300 "%s"\
301 "<endpointLocation/>"\
302 "<meetingSubject>%s</meetingSubject>"\
303 "<meetingLocation>%s</meetingLocation>"\
304 "</state>"\
305 "</publication>"
308 * Publishes to clear 'calendarState' category
309 * @param instance (%u) Ex.: 1251210982
310 * @param version (%u) Ex.: 1
312 #define SIPE_PUB_XML_STATE_CALENDAR_CLEAR \
313 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\" expires=\"0\"/>"\
314 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\" expires=\"0\"/>"
317 * Publishes to clear any category
318 * @param category_name (%s) Ex.: state
319 * @param instance (%u) Ex.: 536870912
320 * @param container (%u) Ex.: 3
321 * @param version (%u) Ex.: 1
322 * @param expireType (%s) Ex.: static
324 #define SIPE_PUB_XML_PUBLICATION_CLEAR \
325 "<publication categoryName=\"%s\" instance=\"%u\" container=\"%u\" version=\"%u\" expireType=\"%s\" expires=\"0\"/>"
328 * Publishes 'note' category.
329 * @param instance (%u) Ex.: 2135971629; 0 for personal
330 * @param container (%u) Ex.: 200
331 * @param version (%u) Ex.: 2
332 * @param type (%s) Ex.: personal or OOF
333 * @param startTime_attr (%s) Ex.: startTime="2008-01-11T19:00:00Z"
334 * @param endTime_attr (%s) Ex.: endTime="2008-01-15T19:00:00Z"
335 * @param body (%s) Ex.: In the office
337 #define SIPE_PUB_XML_NOTE \
338 "<publication categoryName=\"note\" instance=\"%u\" container=\"%u\" version=\"%d\" expireType=\"static\">"\
339 "<note xmlns=\"http://schemas.microsoft.com/2006/09/sip/note\">"\
340 "<body type=\"%s\" uri=\"\"%s%s>%s</body>"\
341 "</note>"\
342 "</publication>"
345 * Publishes 'calendarData' category's WorkingHours.
347 * @param version (%u) Ex.: 1
348 * @param email (%s) Ex.: alice@cosmo.local
349 * @param working_hours_xml_str (%s) Ex.: <WorkingHours xmlns=.....
351 * @param version (%u)
353 * @param version (%u)
354 * @param email (%s)
355 * @param working_hours_xml_str (%s)
357 * @param version (%u)
358 * @param email (%s)
359 * @param working_hours_xml_str (%s)
361 * @param version (%u)
362 * @param email (%s)
363 * @param working_hours_xml_str (%s)
365 * @param version (%u)
367 #define SIPE_PUB_XML_WORKING_HOURS \
368 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"1\" version=\"%d\" expireType=\"static\">"\
369 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
370 "</calendarData>"\
371 "</publication>"\
372 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"100\" version=\"%d\" expireType=\"static\">"\
373 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
374 "</publication>"\
375 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"200\" version=\"%d\" expireType=\"static\">"\
376 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
377 "</calendarData>"\
378 "</publication>"\
379 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"300\" version=\"%d\" expireType=\"static\">"\
380 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
381 "</calendarData>"\
382 "</publication>"\
383 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"400\" version=\"%d\" expireType=\"static\">"\
384 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
385 "</calendarData>"\
386 "</publication>"\
387 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"32000\" version=\"%d\" expireType=\"static\">"\
388 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
389 "</publication>"
392 * Publishes 'calendarData' category's FreeBusy.
394 * @param instance (%u) Ex.: 1300372959
395 * @param version (%u) Ex.: 1
397 * @param instance (%u) Ex.: 1300372959
398 * @param version (%u) Ex.: 1
400 * @param instance (%u) Ex.: 1300372959
401 * @param version (%u) Ex.: 1
402 * @param email (%s) Ex.: alice@cosmo.local
403 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
404 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
406 * @param instance (%u) Ex.: 1300372959
407 * @param version (%u) Ex.: 1
408 * @param email (%s) Ex.: alice@cosmo.local
409 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
410 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
412 * @param instance (%u) Ex.: 1300372959
413 * @param version (%u) Ex.: 1
414 * @param email (%s) Ex.: alice@cosmo.local
415 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
416 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
418 * @param instance (%u) Ex.: 1300372959
419 * @param version (%u) Ex.: 1
421 #define SIPE_PUB_XML_FREE_BUSY \
422 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"1\" version=\"%d\" expireType=\"endpoint\">"\
423 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
424 "</publication>"\
425 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"100\" version=\"%d\" expireType=\"endpoint\">"\
426 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
427 "</publication>"\
428 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"200\" version=\"%d\" expireType=\"endpoint\">"\
429 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
430 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
431 "</calendarData>"\
432 "</publication>"\
433 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"300\" version=\"%d\" expireType=\"endpoint\">"\
434 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
435 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
436 "</calendarData>"\
437 "</publication>"\
438 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"400\" version=\"%d\" expireType=\"endpoint\">"\
439 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
440 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
441 "</calendarData>"\
442 "</publication>"\
443 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"32000\" version=\"%d\" expireType=\"endpoint\">"\
444 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
445 "</publication>"
448 #define sipe_soap(method, body) \
449 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
450 "<SOAP-ENV:Body>" \
451 "<m:" method " xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
452 body \
453 "</m:" method ">" \
454 "</SOAP-ENV:Body>" \
455 "</SOAP-ENV:Envelope>"
457 #define SIPE_SOAP_SET_CONTACT sipe_soap("setContact", \
458 "<m:displayName>%s</m:displayName>"\
459 "<m:groups>%s</m:groups>"\
460 "<m:subscribed>%s</m:subscribed>"\
461 "<m:URI>%s</m:URI>"\
462 "<m:externalURI />"\
463 "<m:deltaNum>%d</m:deltaNum>")
465 #define SIPE_SOAP_DEL_CONTACT sipe_soap("deleteContact", \
466 "<m:URI>%s</m:URI>"\
467 "<m:deltaNum>%d</m:deltaNum>")
469 #define SIPE_SOAP_ADD_GROUP sipe_soap("addGroup", \
470 "<m:name>%s</m:name>"\
471 "<m:externalURI />"\
472 "<m:deltaNum>%d</m:deltaNum>")
474 #define SIPE_SOAP_MOD_GROUP sipe_soap("modifyGroup", \
475 "<m:groupID>%d</m:groupID>"\
476 "<m:name>%s</m:name>"\
477 "<m:externalURI />"\
478 "<m:deltaNum>%d</m:deltaNum>")
480 #define SIPE_SOAP_DEL_GROUP sipe_soap("deleteGroup", \
481 "<m:groupID>%d</m:groupID>"\
482 "<m:deltaNum>%d</m:deltaNum>")
484 // first/mask arg is sip:user@domain.com
485 // second/rights arg is AA for allow, BD for deny
486 #define SIPE_SOAP_ALLOW_DENY sipe_soap("setACE", \
487 "<m:type>USER</m:type>"\
488 "<m:mask>%s</m:mask>"\
489 "<m:rights>%s</m:rights>"\
490 "<m:deltaNum>%d</m:deltaNum>")
493 * Calendar publication entry. 2005 systems.
495 * @param legacy_dn (%s) Ex.: /o=EXCHANGE/ou=BTUK02/cn=Recipients/cn=AHHBTT
496 * @param fb_start_time_str (%s) Ex.: 2009-12-06T17:15:00Z
497 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAA......
499 #define SIPE_SOAP_SET_PRESENCE_CALENDAR \
500 "<calendarInfo xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" mailboxId=\"%s\" startTime=\"%s\" granularity=\"PT15M\">%s</calendarInfo>"
502 * Note publication entry. 2005 systems.
504 * @param note (%s) Ex.: Working from home
506 #define SIPE_SOAP_SET_PRESENCE_NOTE_XML "<note>%s</note>"
508 * Note's OOF publication entry. 2005 systems.
510 #define SIPE_SOAP_SET_PRESENCE_OOF_XML "<oof></oof>"
512 * States publication entry for User State. 2005 systems.
514 * @param avail (%d) Availability 2007-style. Ex.: 9500
515 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
516 * @param device_id (%s) epid. Ex.: 4c77e6ec72
517 * @param activity_token (%s) Ex.: do-not-disturb
519 #define SIPE_SOAP_SET_PRESENCE_STATES \
520 "<states>"\
521 "<state avail=\"%d\" since=\"%s\" validWith=\"any-device\" deviceId=\"%s\" set=\"manual\" xsi:type=\"userState\">%s</state>"\
522 "</states>"
524 * Presentity publication entry. 2005 systems.
526 * @param uri (%s) SIP URI without 'sip:' prefix. Ex.: fox@atlanta.local
527 * @param aggr_availability (%d) Ex.: 300
528 * @param aggr_activity (%d) Ex.: 600
529 * @param host_name (%s) Uppercased. Ex.: ATLANTA
530 * @param note_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_NOTE_XML
531 * @param oof_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_OOF_XML
532 * @param states_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_STATES
533 * @param calendar_info_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_CALENDAR
534 * @param device_id (%s) epid. Ex.: 4c77e6ec72
535 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
536 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
537 * @param user_input (%s) active, idle
539 #define SIPE_SOAP_SET_PRESENCE sipe_soap("setPresence", \
540 "<m:presentity xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" m:uri=\"sip:%s\">"\
541 "<m:availability m:aggregate=\"%d\"/>"\
542 "<m:activity m:aggregate=\"%d\"/>"\
543 "<deviceName xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" name=\"%s\"/>"\
544 "<rtc:devicedata xmlns:rtc=\"http://schemas.microsoft.com/winrtc/2002/11/sip\" namespace=\"rtcService\">"\
545 "<![CDATA[<caps><renders_gif/><renders_isf/></caps>]]></rtc:devicedata>"\
546 "<userInfo xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\">"\
547 "%s%s" \
548 "%s" \
549 "</userInfo>"\
550 "%s" \
551 "<device xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" deviceId=\"%s\" since=\"%s\" >"\
552 "<userInput since=\"%s\" >%s</userInput>"\
553 "</device>"\
554 "</m:presentity>")
556 #define SIPE_SOAP_SEARCH_CONTACT \
557 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
558 "<SOAP-ENV:Body>" \
559 "<m:directorySearch xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
560 "<m:filter m:href=\"#searchArray\"/>"\
561 "<m:maxResults>%d</m:maxResults>"\
562 "</m:directorySearch>"\
563 "<m:Array xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\" m:id=\"searchArray\">"\
564 "%s"\
565 "</m:Array>"\
566 "</SOAP-ENV:Body>"\
567 "</SOAP-ENV:Envelope>"
569 #define SIPE_SOAP_SEARCH_ROW "<m:row m:attrib=\"%s\" m:value=\"%s\"/>"