6 * Copyright (C) 2008 Novell, Inc.
7 * Copyright (C) 2007 Anibal Avelar <avelar@gmail.com>
8 * Copyright (C) 2005 Thomas Butter <butter@uni-mannheim.de>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef _PIDGIN_SIPE_H
26 #define _PIDGIN_SIPE_H
36 #include "circbuffer.h"
48 #define SIPE_UNUSED_PARAMETER __attribute__((unused))
50 #define SIMPLE_BUF_INC 4096
52 #define SIPE_TYPING_RECV_TIMEOUT 6
53 #define SIPE_TYPING_SEND_TIMEOUT 4
58 gchar
*meeting_subject
;
59 gchar
*meeting_location
;
63 /* Calendar related fields */
64 gchar
*cal_start_time
;
66 gchar
*cal_free_busy_base64
;
68 /* for 2005 systems */
70 time_t user_avail_since
;
71 time_t activity_since
;
72 const char *last_non_cal_status_id
;
73 gchar
*last_non_cal_activity
;
75 struct sipe_cal_working_hours
*cal_working_hours
;
79 /** flag to control sending 'context' element in 2007 subscriptions */
85 SipSecContext gssapi_context
;
100 } sipe_transport_type
;
102 struct sipe_service_data
{
104 const char *transport
;
105 sipe_transport_type type
;
108 const struct sipe_service_data
*current_service
;
110 /** MS-PRES publication */
111 struct sipe_publication
{
116 /** for 'state' category */
118 /** for 'state:calendarState' category */
119 char *cal_event_hash
;
120 /** for 'note' category */
122 /** for 'calendarData' category; 300(Team) container */
123 char *working_hours_xml_str
;
125 char *free_busy_base64
;
128 /** MS-PRES container */
129 struct sipe_container
{
134 /** MS-PRES container member */
135 struct sipe_container_member
{
136 /** user, domain, sameEnterprise, federated, publicCloud; everyone */
141 struct sipe_account_data
{
142 PurpleConnection
*gc
;
149 gchar
*focus_factory_uri
;
150 /** Allowed server events to subscribe. From register OK response. */
151 GSList
*allow_events
;
152 PurpleDnsQueryData
*query_data
;
153 PurpleSrvQueryData
*srv_query_data
;
154 const struct sipe_service_data
*service_data
;
155 PurpleNetworkListenData
*listen_data
;
158 time_t last_keepalive
;
159 int registerstatus
; /* 0 nothing, 1 first registration send, 2 auth received, 3 registered */
160 struct sip_auth registrar
;
161 struct sip_auth proxy
;
162 struct sip_csta
*csta
; /* For RCC - Remote Call Control */
163 gboolean reregister_set
; /* whether reregister timer set */
164 gboolean reauthenticate_set
; /* whether reauthenticate timer set */
165 gboolean subscribed
; /* whether subscribed to events, except buddies presence */
166 gboolean subscribed_buddies
; /* whether subscribed to buddies presence */
167 gboolean access_level_set
; /* whether basic access level set */
168 gboolean initial_state_published
; /* whether we published our initial state */
169 GSList
*our_publication_keys
; /* [MS-PRES] */
170 GHashTable
*our_publications
; /* [MS-PRES] */
171 GHashTable
*subscriptions
;
177 int presence_method_version
;
183 gchar
*server_version
;
184 gboolean ocs2007
; /*if there is support for batched category subscription [SIP-PRES]*/
185 gboolean batched_support
; /*if there is support for batched subscription*/
186 GSList
*containers
; /* MS-PRES containers */
189 guint keepalive_timeout
;
192 PurpleAccount
*account
;
193 PurpleCircBuffer
*txbuf
;
196 GSList
*transactions
;
200 sipe_transport_type transport
;
201 gboolean auto_transport
;
202 PurpleSslConnection
*gsc
;
203 struct sockaddr
*serveraddr
;
205 int realport
; /* port and hostname from SRV record */
206 gboolean processing_input
;
207 struct sipe_ews
*ews
;
209 /** 2005 Custom XML piece.
210 * Possibly set by other point of presence or just other client at earlier time.
211 * It should be preserved/modified, not overwritten. This implies subscription
213 * This XML keeps OC2005:
221 struct sip_connection
{
229 struct sipe_auth_job
{
231 struct sipe_account_data
* sip
;
236 typedef gboolean (*TransCallback
) (struct sipe_account_data
*, struct sipmsg
*, struct transaction
*);
238 struct transaction_payload
{
239 GDestroyNotify destroy
;
246 int transport
; /* 0 = tcp, 1 = udp */
248 /** Not yet perfect, but surely better then plain CSeq
249 * Format is: <Call-ID><CSeq>
250 * (RFC3261 17.2.3 for matching server transactions: Request-URI, To tag, From tag, Call-ID, CSeq, and top Via)
254 TransCallback callback
;
255 struct transaction_payload
*payload
;
258 typedef void (*Action
) (struct sipe_account_data
*, void *);
261 * Do schedule action for execution in the future.
262 * Non repetitive execution.
264 * @param name of action (will be copied)
265 * @param timeout in seconds
266 * @param action callback function
267 * @param destroy payload destroy function
269 * @param payload callback data (can be NULL, otherwise caller must allocate memory)
272 sipe_schedule_action(const gchar
*name
,
275 GDestroyNotify destroy
,
276 struct sipe_account_data
*sip
,
282 PurpleGroup
*purple_group
;
285 struct group_user_context
{
290 GSList
* slist_insert_unique_sorted(GSList
*list
, gpointer data
, GCompareFunc func
);
292 GList
*sipe_actions(PurplePlugin
*plugin
, gpointer context
);
294 gboolean
purple_init_plugin(PurplePlugin
*plugin
);
297 * Publishes self status
298 * based on own calendar information,
299 * our Calendar information - FreeBusy, WorkingHours,
305 publish_calendar_status_self(struct sipe_account_data
*sip
);
311 send_presence_soap(struct sipe_account_data
*sip
,
312 gboolean do_publish_calendar
);
315 * THE BIG SPLIT - temporary interfaces
317 * Previously private functions in sipe.c that are
318 * - waiting to be factored out to an appropriate module
319 * - are needed by the already created new modules
324 * Since SIP (RFC3261) is extensible by its design,
325 * and MS specs prove just that (they all are defined as SIP extensions),
326 * it make sense to split functionality by extension (or close extension group).
327 * For example: conference, presence (MS-PRES), etc.
329 * This way our code will not be monolithic, but potentially _reusable_. May be
330 * a top of other SIP core, and/or other front-end (Telepathy framework?).
332 /* Forward declarations */
336 /* SIP send module? */
338 send_sip_request(PurpleConnection
*gc
, const gchar
*method
,
339 const gchar
*url
, const gchar
*to
, const gchar
*addheaders
,
340 const gchar
*body
, struct sip_dialog
*dialog
, TransCallback tc
);
342 send_sip_response(PurpleConnection
*gc
, struct sipmsg
*msg
, int code
,
343 const char *text
, const char *body
);
345 sipe_invite(struct sipe_account_data
*sip
, struct sip_session
*session
,
346 const gchar
*who
, const gchar
*msg_body
,
347 const gchar
*referred_by
, const gboolean is_triggered
);
349 gboolean
process_subscribe_response(struct sipe_account_data
*sip
,
351 struct transaction
*tc
);
354 sipe_invite_to_chat(struct sipe_account_data
*sip
,
355 struct sip_session
*session
,
357 /* Session module? */
359 sipe_present_message_undelivered_err(struct sipe_account_data
*sip
,
360 struct sip_session
*session
,
363 const gchar
*message
);
366 sipe_present_info(struct sipe_account_data
*sip
,
367 struct sip_session
*session
,
368 const gchar
*message
);
372 sipe_process_pending_invite_queue(struct sipe_account_data
*sip
,
373 struct sip_session
*session
);
375 /*** THE BIG SPLIT END ***/
377 #define SIPE_XML_DATE_PATTERN "%Y-%m-%dT%H:%M:%SZ"
379 #define SIPE_INVITE_TEXT "ms-text-format: text/plain; charset=UTF-8%s;ms-body=%s\r\n"
381 #define SIPE_SEND_TYPING \
382 "<?xml version=\"1.0\"?>"\
383 "<KeyboardActivity>"\
384 "<status status=\"type\" />"\
385 "</KeyboardActivity>"
388 * Publishes categories.
389 * @param uri (%s) Self URI. Ex.: sip:alice7@boston.local
390 * @param publications (%s) XML publications
392 #define SIPE_SEND_PRESENCE \
393 "<publish xmlns=\"http://schemas.microsoft.com/2006/09/sip/rich-presence\">"\
394 "<publications uri=\"%s\">"\
400 * Publishes 'device' category.
401 * @param instance (%u) Ex.: 1938468728
402 * @param version (%u) Ex.: 1
403 * @param endpointId (%s) Ex.: C707E38E-1E10-5413-94D9-ECAC260A0269
404 * @param uri (%s) Self URI. Ex.: sip:alice7@boston.local
405 * @param timezone (%s) Ex.: 00:00:00+01:00
406 * @param machineName (%s) Ex.: BOSTON-OCS07
408 #define SIPE_PUB_XML_DEVICE \
409 "<publication categoryName=\"device\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
410 "<device xmlns=\"http://schemas.microsoft.com/2006/09/sip/device\" endpointId=\"%s\">"\
411 "<capabilities preferred=\"false\" uri=\"%s\">"\
412 "<text capture=\"true\" render=\"true\" publish=\"false\"/>"\
413 "<gifInk capture=\"false\" render=\"true\" publish=\"false\"/>"\
414 "<isfInk capture=\"false\" render=\"true\" publish=\"false\"/>"\
416 "<timezone>%s</timezone>"\
417 "<machineName>%s</machineName>"\
422 * Publishes 'machineState' category.
423 * @param instance (%u) Ex.: 926460663
424 * @param version (%u) Ex.: 22
425 * @param availability (%d) Ex.: 3500
426 * @param instance (%u) Ex.: 926460663
427 * @param version (%u) Ex.: 22
428 * @param availability (%d) Ex.: 3500
430 #define SIPE_PUB_XML_STATE_MACHINE \
431 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
432 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"machineState\">"\
433 "<availability>%d</availability>"\
434 "<endpointLocation/>"\
437 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\">"\
438 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"machineState\">"\
439 "<availability>%d</availability>"\
440 "<endpointLocation/>"\
445 * Publishes 'userState' category.
446 * @param instance (%u) User. Ex.: 536870912
447 * @param version (%u) User Container 2. Ex.: 22
448 * @param availability (%d) User Container 2. Ex.: 15500
449 * @param instance (%u) User. Ex.: 536870912
450 * @param version (%u) User Container 3.Ex.: 22
451 * @param availability (%d) User Container 3. Ex.: 15500
453 #define SIPE_PUB_XML_STATE_USER \
454 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"static\">"\
455 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"userState\">"\
456 "<availability>%d</availability>"\
457 "<endpointLocation/>"\
460 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"static\">"\
461 "<state xmlns=\"http://schemas.microsoft.com/2006/09/sip/state\" manual=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"userState\">"\
462 "<availability>%d</availability>"\
463 "<endpointLocation/>"\
468 * An availability XML entry for SIPE_PUB_XML_STATE_CALENDAR
469 * @param availability (%d) Ex.: 6500
471 #define SIPE_PUB_XML_STATE_CALENDAR_AVAIL \
472 "<availability>%d</availability>"
474 * An activity XML entry for SIPE_PUB_XML_STATE_CALENDAR
475 * @param token (%s) Ex.: in-a-meeting
476 * @param minAvailability_attr (%s) Ex.: minAvailability="6500"
477 * @param maxAvailability_attr (%s) Ex.: maxAvailability="8999" or none
479 #define SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY \
480 "<activity token=\"%s\" %s %s></activity>"
482 * Publishes 'calendarState' category.
483 * @param instance (%u) Ex.: 1339299275
484 * @param version (%u) Ex.: 1
485 * @param uri (%s) Ex.: john@contoso.com
486 * @param start_time_str (%s) Ex.: 2008-01-11T19:00:00Z
487 * @param availability (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_AVAIL
488 * @param activity (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY
489 * @param meeting_subject (%s) Ex.: Customer Meeting
490 * @param meeting_location (%s) Ex.: Conf Room 100
492 * @param instance (%u) Ex.: 1339299275
493 * @param version (%u) Ex.: 1
494 * @param uri (%s) Ex.: john@contoso.com
495 * @param start_time_str (%s) Ex.: 2008-01-11T19:00:00Z
496 * @param availability (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_AVAIL
497 * @param activity (%s) XML string as SIPE_PUB_XML_STATE_CALENDAR_ACTIVITY
498 * @param meeting_subject (%s) Ex.: Customer Meeting
499 * @param meeting_location (%s) Ex.: Conf Room 100
501 #define SIPE_PUB_XML_STATE_CALENDAR \
502 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\">"\
503 "<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\">"\
506 "<endpointLocation/>"\
507 "<meetingSubject>%s</meetingSubject>"\
508 "<meetingLocation>%s</meetingLocation>"\
511 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\">"\
512 "<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\">"\
515 "<endpointLocation/>"\
516 "<meetingSubject>%s</meetingSubject>"\
517 "<meetingLocation>%s</meetingLocation>"\
522 * Publishes to clear 'calendarState' category
523 * @param instance (%u) Ex.: 1251210982
524 * @param version (%u) Ex.: 1
526 #define SIPE_PUB_XML_STATE_CALENDAR_CLEAR \
527 "<publication categoryName=\"state\" instance=\"%u\" container=\"2\" version=\"%u\" expireType=\"endpoint\" expires=\"0\"/>"\
528 "<publication categoryName=\"state\" instance=\"%u\" container=\"3\" version=\"%u\" expireType=\"endpoint\" expires=\"0\"/>"
532 * Publishes 'note' category.
533 * @param instance (%u) Ex.: 2135971629; 0 for personal
534 * @param version (%u) Ex.: 2
535 * @param type (%s) Ex.: personal or OOF
536 * @param body (%s) Ex.: In the office
538 * @param instance (%u) Ex.: 2135971629; 0 for personal
539 * @param version (%u) Ex.: 2
540 * @param type (%s) Ex.: personal or OOF
541 * @param body (%s) Ex.: In the office
543 * @param instance (%u) Ex.: 2135971629; 0 for personal
544 * @param version (%u) Ex.: 2
545 * @param type (%s) Ex.: personal or OOF
546 * @param body (%s) Ex.: In the office
548 #define SIPE_PUB_XML_NOTE \
549 "<publication categoryName=\"note\" instance=\"%u\" container=\"200\" version=\"%d\" expireType=\"static\">"\
550 "<note xmlns=\"http://schemas.microsoft.com/2006/09/sip/note\">"\
551 "<body type=\"%s\" uri=\"\">%s</body>"\
554 "<publication categoryName=\"note\" instance=\"%u\" container=\"300\" version=\"%d\" expireType=\"static\">"\
555 "<note xmlns=\"http://schemas.microsoft.com/2006/09/sip/note\">"\
556 "<body type=\"%s\" uri=\"\">%s</body>"\
559 "<publication categoryName=\"note\" instance=\"%u\" container=\"400\" version=\"%d\" expireType=\"static\">"\
560 "<note xmlns=\"http://schemas.microsoft.com/2006/09/sip/note\">"\
561 "<body type=\"%s\" uri=\"\">%s</body>"\
566 * Publishes 'calendarData' category's WorkingHours.
568 * @param version (%u) Ex.: 1
569 * @param email (%s) Ex.: alice@cosmo.local
570 * @param working_hours_xml_str (%s) Ex.: <WorkingHours xmlns=.....
572 * @param version (%u)
574 * @param version (%u)
576 * @param working_hours_xml_str (%s)
578 * @param version (%u)
580 * @param working_hours_xml_str (%s)
582 * @param version (%u)
584 * @param working_hours_xml_str (%s)
586 * @param version (%u)
588 #define SIPE_PUB_XML_WORKING_HOURS \
589 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"1\" version=\"%d\" expireType=\"static\">"\
590 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
593 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"100\" version=\"%d\" expireType=\"static\">"\
594 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
596 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"200\" version=\"%d\" expireType=\"static\">"\
597 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
600 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"300\" version=\"%d\" expireType=\"static\">"\
601 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
604 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"400\" version=\"%d\" expireType=\"static\">"\
605 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">%s"\
608 "<publication categoryName=\"calendarData\" instance=\"0\" container=\"32000\" version=\"%d\" expireType=\"static\">"\
609 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
613 * Publishes 'calendarData' category's FreeBusy.
615 * @param instance (%u) Ex.: 1300372959
616 * @param version (%u) Ex.: 1
618 * @param instance (%u) Ex.: 1300372959
619 * @param version (%u) Ex.: 1
621 * @param instance (%u) Ex.: 1300372959
622 * @param version (%u) Ex.: 1
623 * @param email (%s) Ex.: alice@cosmo.local
624 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
625 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
627 * @param instance (%u) Ex.: 1300372959
628 * @param version (%u) Ex.: 1
629 * @param email (%s) Ex.: alice@cosmo.local
630 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
631 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
633 * @param instance (%u) Ex.: 1300372959
634 * @param version (%u) Ex.: 1
635 * @param email (%s) Ex.: alice@cosmo.local
636 * @param fb_start_time_str (%s) Ex.: 2009-12-03T00:00:00Z
637 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAAAAAA.....
639 * @param instance (%u) Ex.: 1300372959
640 * @param version (%u) Ex.: 1
642 #define SIPE_PUB_XML_FREE_BUSY \
643 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"1\" version=\"%d\" expireType=\"endpoint\">"\
644 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
646 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"100\" version=\"%d\" expireType=\"endpoint\">"\
647 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
649 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"200\" version=\"%d\" expireType=\"endpoint\">"\
650 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
651 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
654 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"300\" version=\"%d\" expireType=\"endpoint\">"\
655 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
656 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
659 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"400\" version=\"%d\" expireType=\"endpoint\">"\
660 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\" mailboxID=\"%s\">"\
661 "<freeBusy startTime=\"%s\" granularity=\"PT15M\" encodingVersion=\"1\">%s</freeBusy>"\
664 "<publication categoryName=\"calendarData\" instance=\"%u\" container=\"32000\" version=\"%d\" expireType=\"endpoint\">"\
665 "<calendarData xmlns=\"http://schemas.microsoft.com/2006/09/sip/calendarData\"/>"\
669 #define sipe_soap(method, body) \
670 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
672 "<m:" method " xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
676 "</SOAP-ENV:Envelope>"
678 #define SIPE_SOAP_SET_CONTACT sipe_soap("setContact", \
679 "<m:displayName>%s</m:displayName>"\
680 "<m:groups>%s</m:groups>"\
681 "<m:subscribed>%s</m:subscribed>"\
684 "<m:deltaNum>%d</m:deltaNum>")
686 #define SIPE_SOAP_DEL_CONTACT sipe_soap("deleteContact", \
688 "<m:deltaNum>%d</m:deltaNum>")
690 #define SIPE_SOAP_ADD_GROUP sipe_soap("addGroup", \
691 "<m:name>%s</m:name>"\
693 "<m:deltaNum>%d</m:deltaNum>")
695 #define SIPE_SOAP_MOD_GROUP sipe_soap("modifyGroup", \
696 "<m:groupID>%d</m:groupID>"\
697 "<m:name>%s</m:name>"\
699 "<m:deltaNum>%d</m:deltaNum>")
701 #define SIPE_SOAP_DEL_GROUP sipe_soap("deleteGroup", \
702 "<m:groupID>%d</m:groupID>"\
703 "<m:deltaNum>%d</m:deltaNum>")
705 // first/mask arg is sip:user@domain.com
706 // second/rights arg is AA for allow, BD for deny
707 #define SIPE_SOAP_ALLOW_DENY sipe_soap("setACE", \
708 "<m:type>USER</m:type>"\
709 "<m:mask>%s</m:mask>"\
710 "<m:rights>%s</m:rights>"\
711 "<m:deltaNum>%d</m:deltaNum>")
714 * Calendar publication entry. 2005 systems.
716 * @param legacy_dn (%s) Ex.: /o=EXCHANGE/ou=BTUK02/cn=Recipients/cn=AHHBTT
717 * @param fb_start_time_str (%s) Ex.: 2009-12-06T17:15:00Z
718 * @param free_busy_base64 (%s) Ex.: AAAAAAAAAAAAAAAAA......
720 #define SIPE_SOAP_SET_PRESENCE_CALENDAR \
721 "<calendarInfo xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" mailboxId=\"%s\" startTime=\"%s\" granularity=\"PT15M\">%s</calendarInfo>"
723 * Note publication entry. 2005 systems.
725 * @param note (%s) Ex.: Working from home
727 #define SIPE_SOAP_SET_PRESENCE_NOTE_XML "<note>%s</note>"
729 * Note's OOF publication entry. 2005 systems.
731 #define SIPE_SOAP_SET_PRESENCE_OOF_XML "<oof></oof>"
733 * States publication entry for User State. 2005 systems.
735 * @param avail (%d) Availability 2007-style. Ex.: 9500
736 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
737 * @param device_id (%s) epid. Ex.: 4c77e6ec72
738 * @param activity_token (%s) Ex.: do-not-disturb
740 #define SIPE_SOAP_SET_PRESENCE_STATES \
742 "<state avail=\"%d\" since=\"%s\" validWith=\"any-device\" deviceId=\"%s\" set=\"manual\" xsi:type=\"userState\">%s</state>"\
745 * Presentity publication entry. 2005 systems.
747 * @param uri (%s) SIP URI without 'sip:' prefix. Ex.: fox@atlanta.local
748 * @param aggr_availability (%d) Ex.: 300
749 * @param aggr_activity (%d) Ex.: 600
750 * @param host_name (%s) Uppercased. Ex.: ATLANTA
751 * @param note_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_NOTE_XML
752 * @param oof_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_OOF_XML
753 * @param states_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_STATES
754 * @param calendar_info_xml_str (%s) XML string as SIPE_SOAP_SET_PRESENCE_CALENDAR
755 * @param device_id (%s) epid. Ex.: 4c77e6ec72
756 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
757 * @param since_time_str (%s) Ex.: 2010-01-13T10:30:05Z
758 * @param user_input (%s) active, idle
760 #define SIPE_SOAP_SET_PRESENCE sipe_soap("setPresence", \
761 "<m:presentity xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" m:uri=\"sip:%s\">"\
762 "<m:availability m:aggregate=\"%d\"/>"\
763 "<m:activity m:aggregate=\"%d\"/>"\
764 "<deviceName xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" name=\"%s\"/>"\
765 "<rtc:devicedata xmlns:rtc=\"http://schemas.microsoft.com/winrtc/2002/11/sip\" namespace=\"rtcService\">"\
766 "<![CDATA[<caps><renders_gif/><renders_isf/></caps>]]></rtc:devicedata>"\
767 "<userInfo xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\">"\
772 "<device xmlns=\"http://schemas.microsoft.com/2002/09/sip/presence\" deviceId=\"%s\" since=\"%s\" >"\
773 "<userInput since=\"%s\" >%s</userInput>"\
777 #define SIPE_SOAP_SEARCH_CONTACT \
778 "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
780 "<m:directorySearch xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\">" \
781 "<m:filter m:href=\"#searchArray\"/>"\
782 "<m:maxResults>%d</m:maxResults>"\
783 "</m:directorySearch>"\
784 "<m:Array xmlns:m=\"http://schemas.microsoft.com/winrtc/2002/11/sip\" m:id=\"searchArray\">"\
788 "</SOAP-ENV:Envelope>"
790 #define SIPE_SOAP_SEARCH_ROW "<m:row m:attrib=\"%s\" m:value=\"%s\"/>"
792 #endif /* _PIDGIN_SIPE_H */