6 * Copyright (C) 2010 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:
33 /* Forward declarations */
35 struct _PurpleAccount
;
36 struct _PurpleConnection
;
38 struct sip_sec_context
;
39 struct sipe_core_private
;
41 #define SIPE_TYPING_RECV_TIMEOUT 6
42 #define SIPE_TYPING_SEND_TIMEOUT 4
46 struct sip_sec_context
*gssapi_context
;
58 /** MS-PRES publication */
59 struct sipe_publication
{
64 /** for 'state' category */
66 /** for 'state:calendarState' category */
68 /** for 'note' category */
70 /** for 'calendarData' category; 300(Team) container */
71 char *working_hours_xml_str
;
73 char *free_busy_base64
;
76 /** MS-PRES container */
77 struct sipe_container
{
82 /** MS-PRES container member */
83 struct sipe_container_member
{
84 /** user, domain, sameEnterprise, federated, publicCloud; everyone */
89 struct sipe_account_data
{
90 /* back pointer to new data structure */
91 struct sipe_core_public
*public;
92 /* same, but reduces need for casting and increases type safety */
93 struct sipe_core_private
*private;
95 struct _PurpleConnection
*gc
;
101 gchar
*focus_factory_uri
;
102 /** Allowed server events to subscribe. From register OK response. */
103 GSList
*allow_events
;
105 int registerstatus
; /* 0 nothing, 1 first registration send, 2 auth received, 3 registered */
106 struct sip_auth registrar
;
107 struct sip_auth proxy
;
108 struct sip_csta
*csta
; /* For RCC - Remote Call Control */
109 gboolean reregister_set
; /* whether reregister timer set */
110 gboolean reauthenticate_set
; /* whether reauthenticate timer set */
111 gboolean subscribed
; /* whether subscribed to events, except buddies presence */
112 gboolean subscribed_buddies
; /* whether subscribed to buddies presence */
113 gboolean access_level_set
; /* whether basic access level set */
114 gboolean initial_state_published
; /* whether we published our initial state */
115 GSList
*our_publication_keys
; /* [MS-PRES] */
116 GHashTable
*our_publications
; /* [MS-PRES] */
117 GHashTable
*user_state_publications
; /* [MS-PRES] */
118 GHashTable
*subscriptions
;
121 int presence_method_version
;
122 time_t do_not_publish
[SIPE_ACTIVITY_NUM_TYPES
];
124 gboolean is_oof_note
;
129 gchar
*server_version
;
130 gboolean ocs2007
; /*if there is support for batched category subscription [SIP-PRES]*/
131 gboolean batched_support
; /*if there is support for batched subscription*/
132 GSList
*containers
; /* MS-PRES containers */
133 struct _PurpleAccount
*account
;
135 GSList
*transactions
;
138 GHashTable
*filetransfers
;
139 gboolean processing_input
;
140 struct sipe_calendar
*cal
;
142 /** 2005 Custom XML piece.
143 * Possibly set by other point of presence or just other client at earlier time.
144 * It should be preserved/modified, not overwritten. This implies subscription
146 * This XML keeps OC2005:
154 struct sipe_auth_job
{
156 struct sipe_account_data
* sip
;
159 typedef void (*Action
) (struct sipe_core_private
*, void *);
162 * Do schedule action for execution in the future.
163 * Non repetitive execution.
165 * @param name of action (will be copied)
166 * @param timeout in seconds
167 * @param action callback function
168 * @param destroy payload destroy function
169 * @param sipe_core_private
170 * @param payload callback data (can be NULL, otherwise caller must allocate memory)
173 sipe_schedule_action(const gchar
*name
,
176 GDestroyNotify destroy
,
177 struct sipe_core_private
*sipe_private
,
183 struct _PurpleGroup
*purple_group
;
186 struct group_user_context
{
191 GSList
* slist_insert_unique_sorted(GSList
*list
, gpointer data
, GCompareFunc func
);
194 * Publishes self status
195 * based on own calendar information,
196 * our Calendar information - FreeBusy, WorkingHours,
202 publish_calendar_status_self(struct sipe_core_private
*sipe_private
,
209 send_presence_soap(struct sipe_account_data
*sip
,
210 gboolean do_publish_calendar
);
213 * THE BIG SPLIT - temporary interfaces
215 * Previously private functions in sipe.c that are
216 * - waiting to be factored out to an appropriate module
217 * - are needed by the already created new modules
222 * Since SIP (RFC3261) is extensible by its design,
223 * and MS specs prove just that (they all are defined as SIP extensions),
224 * it make sense to split functionality by extension (or close extension group).
225 * For example: conference, presence (MS-PRES), etc.
227 * This way our code will not be monolithic, but potentially _reusable_. May be
228 * a top of other SIP core, and/or other front-end (Telepathy framework?).
230 /* Forward declarations */
236 sipe_invite(struct sipe_account_data
*sip
, struct sip_session
*session
,
237 const gchar
*who
, const gchar
*msg_body
, const gchar
*msg_content_type
,
238 const gchar
*referred_by
, const gboolean is_triggered
);
240 void sipe_make_signature(struct sipe_account_data
*sip
,
242 gchar
*auth_header(struct sipe_account_data
*sip
,
243 struct sip_auth
*auth
, struct sipmsg
* msg
);
244 const char*sipe_get_useragent(struct sipe_account_data
*sip
);
245 void process_input_message(struct sipe_account_data
*sip
,
247 gboolean
process_register_response(struct sipe_account_data
*sip
,
249 struct transaction
*trans
);
250 gboolean
process_subscribe_response(struct sipe_account_data
*sip
,
252 struct transaction
*trans
);
255 sipe_invite_to_chat(struct sipe_account_data
*sip
,
256 struct sip_session
*session
,
258 /* Session module? */
260 sipe_present_message_undelivered_err(struct sipe_account_data
*sip
,
261 struct sip_session
*session
,
265 const gchar
*message
);
268 sipe_present_info(struct sipe_account_data
*sip
,
269 struct sip_session
*session
,
270 const gchar
*message
);
274 sipe_process_pending_invite_queue(struct sipe_account_data
*sip
,
275 struct sip_session
*session
);
278 sipe_im_process_queue (struct sipe_account_data
* sip
, struct sip_session
* session
);
281 /*** THE BIG SPLIT END ***/
283 #define SIPE_INVITE_TEXT "ms-text-format: %s; charset=UTF-8%s;ms-body=%s\r\n"
285 #define SIPE_SEND_TYPING \
286 "<?xml version=\"1.0\"?>"\
287 "<KeyboardActivity>"\
288 "<status status=\"type\" />"\
289 "</KeyboardActivity>"
292 * Publishes categories.
293 * @param uri (%s) Self URI. Ex.: sip:alice7@boston.local
294 * @param publications (%s) XML publications
296 #define SIPE_SEND_PRESENCE \
297 "<publish xmlns=\"http://schemas.microsoft.com/2006/09/sip/rich-presence\">"\
298 "<publications uri=\"%s\">"\
304 * Publishes 'device' category.
305 * @param instance (%u) Ex.: 1938468728
306 * @param version (%u) Ex.: 1
307 * @param endpointId (%s) Ex.: C707E38E-1E10-5413-94D9-ECAC260A0269
308 * @param uri (%s) Self URI. Ex.: sip:alice7@boston.local
309 * @param timezone (%s) Ex.: 00:00:00+01:00
310 * @param machineName (%s) Ex.: BOSTON-OCS07
312 #define SIPE_PUB_XML_DEVICE \
313 "<publication categoryName=\"device\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
314 "<device xmlns=\"http://schemas.microsoft.com/2006/09/sip/device\" endpointId=\"%s\">"\
315 "<capabilities preferred=\"false\" uri=\"%s\">"\
316 "<text capture=\"true\" render=\"true\" publish=\"false\"/>"\
317 "<gifInk capture=\"false\" render=\"true\" publish=\"false\"/>"\
318 "<isfInk capture=\"false\" render=\"true\" publish=\"false\"/>"\
320 "<timezone>%s</timezone>"\
321 "<machineName>%s</machineName>"\
326 * Publishes 'machineState' category.
327 * @param instance (%u) Ex.: 926460663
328 * @param version (%u) Ex.: 22
329 * @param availability (%d) Ex.: 3500
330 * @param instance (%u) Ex.: 926460663
331 * @param version (%u) Ex.: 22
332 * @param availability (%d) Ex.: 3500
334 #define SIPE_PUB_XML_STATE_MACHINE \
335 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
336 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"machineState\">"\
337 "<availability>%d</availability>"\
338 "<endpointLocation/>"\
341 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\">"\
342 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"machineState\">"\
343 "<availability>%d</availability>"\
344 "<endpointLocation/>"\
349 * Publishes 'userState' category.
350 * @param instance (%u) User. Ex.: 536870912
351 * @param version (%u) User Container 2. Ex.: 22
352 * @param availability (%d) User Container 2. Ex.: 15500
353 * @param instance (%u) User. Ex.: 536870912
354 * @param version (%u) User Container 3.Ex.: 22
355 * @param availability (%d) User Container 3. Ex.: 15500
357 #define SIPE_PUB_XML_STATE_USER \
358 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"static\">"\
359 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"userState\">"\
360 "<availability>%d</availability>"\
361 "<endpointLocation/>"\
364 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"static\">"\
365 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"userState\">"\
366 "<availability>%d</availability>"\
367 "<endpointLocation/>"\
372 * An availability XML entry for SIPE_PUB_XML_STATE_CALENDAR
373 * @param availability (%d) Ex.: 6500
375 #define SIPE_PUB_XML_STATE_CALENDAR_AVAIL \
376 "<availability>%d</availability>"
378 * An activity XML entry for SIPE_PUB_XML_STATE_CALENDAR
379 * @param token (%s) Ex.: in-a-meeting
380 * @param minAvailability_attr (%s) Ex.: minAvailability="6500"
381 * @param maxAvailability_attr (%s) Ex.: maxAvailability="8999" or none
383 #define SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY \
384 "<activity token=\"%s\" %s %s></activity>"
386 * Publishes 'calendarState' category.
387 * @param instance (%u) Ex.: 1339299275
388 * @param version (%u) Ex.: 1
389 * @param uri (%s) Ex.: john@contoso.com
390 * @param start_time_str (%s) Ex.: 2008-01-11T19:00:00Z
391 * @param availability (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_AVAIL
392 * @param activity (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY
393 * @param meeting_subject (%s) Ex.: Customer Meeting
394 * @param meeting_location (%s) Ex.: Conf Room 100
396 * @param instance (%u) Ex.: 1339299275
397 * @param version (%u) Ex.: 1
398 * @param uri (%s) Ex.: john@contoso.com
399 * @param start_time_str (%s) Ex.: 2008-01-11T19:00:00Z
400 * @param availability (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_AVAIL
401 * @param activity (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY
402 * @param meeting_subject (%s) Ex.: Customer Meeting
403 * @param meeting_location (%s) Ex.: Conf Room 100
405 #define SIPE_PUB_XML_STATE_CALENDAR \
406 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
407 "<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\">"\
410 "<endpointLocation/>"\
411 "<meetingSubject>%s</meetingSubject>"\
412 "<meetingLocation>%s</meetingLocation>"\
415 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\">"\
416 "<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\">"\
419 "<endpointLocation/>"\
420 "<meetingSubject>%s</meetingSubject>"\
421 "<meetingLocation>%s</meetingLocation>"\
426 * Publishes to clear 'calendarState' category
427 * @param instance (%u) Ex.: 1251210982
428 * @param version (%u) Ex.: 1
430 #define SIPE_PUB_XML_STATE_CALENDAR_CLEAR \
431 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\" expires=\"0\"/>"\
432 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\" expires=\"0\"/>"
435 * Publishes to clear any category
436 * @param category_name (%s) Ex.: state
437 * @param instance (%u) Ex.: 536870912
438 * @param container (%u) Ex.: 3
439 * @param version (%u) Ex.: 1
440 * @param expireType (%s) Ex.: static
442 #define SIPE_PUB_XML_PUBLICATION_CLEAR \
443 "<publication categoryName=\"%s\" instance=\"%u\" container=\"%u\" version=\"%u\" expireType=\"%s\" expires=\"0\"/>"
446 * Publishes 'note' category.
447 * @param instance (%u) Ex.: 2135971629; 0 for personal
448 * @param container (%u) Ex.: 200
449 * @param version (%u) Ex.: 2
450 * @param type (%s) Ex.: personal or OOF
451 * @param startTime_attr (%s) Ex.: startTime="2008-01-11T19:00:00Z"
452 * @param endTime_attr (%s) Ex.: endTime="2008-01-15T19:00:00Z"
453 * @param body (%s) Ex.: In the office
455 #define SIPE_PUB_XML_NOTE \
456 "<publication categoryName=\"note\" instance=\"%u\" container=\"%u\" version=\"%d\" expireType=\"static\">"\
457 "<note xmlns=\"http://schemas.microsoft.com/2006/09/sip/note\">"\
458 "<body type=\"%s\" uri=\"\"%s%s>%s</body>"\
463 * Publishes 'calendarData' category's WorkingHours.
465 * @param version (%u) Ex.: 1
466 * @param email (%s) Ex.: alice@cosmo.local
467 * @param working_hours_xml_str (%s) Ex.: <WorkingHours xmlns=.....
469 * @param version (%u)
471 * @param version (%u)
473 * @param working_hours_xml_str (%s)
475 * @param version (%u)
477 * @param working_hours_xml_str (%s)
479 * @param version (%u)
481 * @param working_hours_xml_str (%s)
483 * @param version (%u)
485 #define SIPE_PUB_XML_WORKING_HOURS \
486 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"1\" version=\"%d\" expireType=\"static\">"\
487 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
490 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"100\" version=\"%d\" expireType=\"static\">"\
491 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
493 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"200\" version=\"%d\" expireType=\"static\">"\
494 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
497 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"300\" version=\"%d\" expireType=\"static\">"\
498 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
501 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"400\" version=\"%d\" expireType=\"static\">"\
502 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
505 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"32000\" version=\"%d\" expireType=\"static\">"\
506 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
510 * Publishes 'calendarData' category's FreeBusy.
512 * @param instance (%u) Ex.: 1300372959
513 * @param version (%u) Ex.: 1
515 * @param instance (%u) Ex.: 1300372959
516 * @param version (%u) Ex.: 1
518 * @param instance (%u) Ex.: 1300372959
519 * @param version (%u) Ex.: 1
520 * @param email (%s) Ex.: alice@cosmo.local
521 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
522 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
524 * @param instance (%u) Ex.: 1300372959
525 * @param version (%u) Ex.: 1
526 * @param email (%s) Ex.: alice@cosmo.local
527 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
528 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
530 * @param instance (%u) Ex.: 1300372959
531 * @param version (%u) Ex.: 1
532 * @param email (%s) Ex.: alice@cosmo.local
533 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
534 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
536 * @param instance (%u) Ex.: 1300372959
537 * @param version (%u) Ex.: 1
539 #define SIPE_PUB_XML_FREE_BUSY \
540 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"1\" version=\"%d\" expireType=\"endpoint\">"\
541 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
543 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"100\" version=\"%d\" expireType=\"endpoint\">"\
544 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
546 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"200\" version=\"%d\" expireType=\"endpoint\">"\
547 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
548 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
551 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"300\" version=\"%d\" expireType=\"endpoint\">"\
552 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
553 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
556 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"400\" version=\"%d\" expireType=\"endpoint\">"\
557 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
558 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
561 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"32000\" version=\"%d\" expireType=\"endpoint\">"\
562 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
566 #define sipe_soap(method, body) \
567 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
569 "<m:" method " xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
573 "</SOAP-ENV:Envelope>"
575 #define SIPE_SOAP_SET_CONTACT sipe_soap("setContact", \
576 "<m:displayName>%s</m:displayName>"\
577 "<m:groups>%s</m:groups>"\
578 "<m:subscribed>%s</m:subscribed>"\
581 "<m:deltaNum>%d</m:deltaNum>")
583 #define SIPE_SOAP_DEL_CONTACT sipe_soap("deleteContact", \
585 "<m:deltaNum>%d</m:deltaNum>")
587 #define SIPE_SOAP_ADD_GROUP sipe_soap("addGroup", \
588 "<m:name>%s</m:name>"\
590 "<m:deltaNum>%d</m:deltaNum>")
592 #define SIPE_SOAP_MOD_GROUP sipe_soap("modifyGroup", \
593 "<m:groupID>%d</m:groupID>"\
594 "<m:name>%s</m:name>"\
596 "<m:deltaNum>%d</m:deltaNum>")
598 #define SIPE_SOAP_DEL_GROUP sipe_soap("deleteGroup", \
599 "<m:groupID>%d</m:groupID>"\
600 "<m:deltaNum>%d</m:deltaNum>")
602 // first/mask arg is sip:user@domain.com
603 // second/rights arg is AA for allow, BD for deny
604 #define SIPE_SOAP_ALLOW_DENY sipe_soap("setACE", \
605 "<m:type>USER</m:type>"\
606 "<m:mask>%s</m:mask>"\
607 "<m:rights>%s</m:rights>"\
608 "<m:deltaNum>%d</m:deltaNum>")
611 * Calendar publication entry. 2005 systems.
613 * @param legacy_dn (%s) Ex.: /o=EXCHANGE/ou=BTUK02/cn=Recipients/cn=AHHBTT
614 * @param fb_start_time_str (%s) Ex.: 2009-12-06T17:15:00Z
615 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAA......
617 #define SIPE_SOAP_SET_PRESENCE_CALENDAR \
618 "<calendarInfo xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" mailboxId=\"%s\" startTime=\"%s\" granularity=\"PT15M\">%s</calendarInfo>"
620 * Note publication entry. 2005 systems.
622 * @param note (%s) Ex.: Working from home
624 #define SIPE_SOAP_SET_PRESENCE_NOTE_XML "<note>%s</note>"
626 * Note's OOF publication entry. 2005 systems.
628 #define SIPE_SOAP_SET_PRESENCE_OOF_XML "<oof></oof>"
630 * States publication entry for User State. 2005 systems.
632 * @param avail (%d) Availability 2007-style. Ex.: 9500
633 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
634 * @param device_id (%s) epid. Ex.: 4c77e6ec72
635 * @param activity_token (%s) Ex.: do-not-disturb
637 #define SIPE_SOAP_SET_PRESENCE_STATES \
639 "<state avail=\"%d\" since=\"%s\" validWith=\"any-device\" deviceId=\"%s\" set=\"manual\" xsi:type=\"userState\">%s</state>"\
642 * Presentity publication entry. 2005 systems.
644 * @param uri (%s) SIP URI without 'sip:' prefix. Ex.: fox@atlanta.local
645 * @param aggr_availability (%d) Ex.: 300
646 * @param aggr_activity (%d) Ex.: 600
647 * @param host_name (%s) Uppercased. Ex.: ATLANTA
648 * @param note_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_NOTE_XML
649 * @param oof_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_OOF_XML
650 * @param states_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_STATES
651 * @param calendar_info_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_CALENDAR
652 * @param device_id (%s) epid. Ex.: 4c77e6ec72
653 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
654 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
655 * @param user_input (%s) active, idle
657 #define SIPE_SOAP_SET_PRESENCE sipe_soap("setPresence", \
658 "<m:presentity xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" m:uri=\"sip:%s\">"\
659 "<m:availability m:aggregate=\"%d\"/>"\
660 "<m:activity m:aggregate=\"%d\"/>"\
661 "<deviceName xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" name=\"%s\"/>"\
662 "<rtc:devicedata xmlns:rtc=\"http://schemas.microsoft.com/winrtc/2002/11/sip\" namespace=\"rtcService\">"\
663 "<![CDATA[<caps><renders_gif/><renders_isf/></caps>]]></rtc:devicedata>"\
664 "<userInfo xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\">"\
669 "<device xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" deviceId=\"%s\" since=\"%s\" >"\
670 "<userInput since=\"%s\" >%s</userInput>"\
674 #define SIPE_SOAP_SEARCH_CONTACT \
675 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
677 "<m:directorySearch xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
678 "<m:filter m:href=\"#searchArray\"/>"\
679 "<m:maxResults>%d</m:maxResults>"\
680 "</m:directorySearch>"\
681 "<m:Array xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\" m:id=\"searchArray\">"\
685 "</SOAP-ENV:Envelope>"
687 #define SIPE_SOAP_SEARCH_ROW "<m:row m:attrib=\"%s\" m:value=\"%s\"/>"