SipPayloadsApi

Version 1 (Adrian Georgescu, 04/13/2010 10:21 am)

1 1 Adrian Georgescu
= Payloads API =
2 1 Adrian Georgescu
3 1 Adrian Georgescu
[[TOC(SipPayloadsApi*, depth=3)]]
4 1 Adrian Georgescu
5 1 Adrian Georgescu
Presence applications provide non-SIP functionality that are required for
6 1 Adrian Georgescu
implementing a feature-rich SIP SIMPLE client.  
7 1 Adrian Georgescu
8 1 Adrian Georgescu
The following modules are used for parsing and generating bodies carried using
9 1 Adrian Georgescu
SIP PUBLISH/SUBSCRIBE/NOTIFY methods that have been designed for
10 1 Adrian Georgescu
asynchronous event notifications to convey in real-time state and other
11 1 Adrian Georgescu
information between end-points. 
12 1 Adrian Georgescu
13 1 Adrian Georgescu
An example of state information is presence, which in its basic form provides user availability information based on end-user choice. In its
14 1 Adrian Georgescu
advanced form, presence can provide rich state information including but not
15 1 Adrian Georgescu
limited to user mood, geo-location, environment, noise level and type of
16 1 Adrian Georgescu
communication desired. The information can be disseminated based on a
17 1 Adrian Georgescu
granular policy which allows end-users to decide who has access to which
18 1 Adrian Georgescu
part of the published information.
19 1 Adrian Georgescu
20 1 Adrian Georgescu
These applications are used by the SIP core [wiki:SipCoreApiDocumentation#Publication Publication] and [wiki:SipCoreApiDocumentation#Subscription Subscription] classes.
21 1 Adrian Georgescu
22 1 Adrian Georgescu
== Common Policy ==
23 1 Adrian Georgescu
24 1 Adrian Georgescu
Generic data types to be used in policy applications, according to [http://tools.ietf.org/html/rfc4745 RFC 4745].
25 1 Adrian Georgescu
26 1 Adrian Georgescu
Example usage:
27 1 Adrian Georgescu
28 1 Adrian Georgescu
{{{
29 1 Adrian Georgescu
>>> alice = IdentityOne('sip:alice@example.com')
30 1 Adrian Georgescu
>>> carol = IdentityOne('tel:+1-212-555-1234')
31 1 Adrian Georgescu
>>> bob = IdentityOne('mailto:bob@example.net')
32 1 Adrian Georgescu
>>> print carol
33 1 Adrian Georgescu
tel:+1-212-555-1234
34 1 Adrian Georgescu
>>> id = Identity([alice, bob])
35 1 Adrian Georgescu
>>> print id
36 1 Adrian Georgescu
Identity([IdentityOne('sip:alice@example.com'), IdentityOne('mailto:bob@example.net')])
37 1 Adrian Georgescu
>>> id[1:1] = [carol]
38 1 Adrian Georgescu
>>> print id
39 1 Adrian Georgescu
Identity([IdentityOne('sip:alice@example.com'), IdentityOne('tel:+1-212-555-1234'), IdentityOne('mailto:bob@example.net')])
40 1 Adrian Georgescu
>>> conditions = Conditions([id])
41 1 Adrian Georgescu
>>> rule = Rule(id='f3g44r1', conditions=conditions, actions=Actions(), transformations=Transformations())
42 1 Adrian Georgescu
>>> ruleset = RuleSet()
43 1 Adrian Georgescu
>>> ruleset.append(rule)
44 1 Adrian Georgescu
>>> print ruleset.toxml(pretty_print=True)
45 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
46 1 Adrian Georgescu
<cp:ruleset xmlns:cp="urn:ietf:params:xml:ns:common-policy">
47 1 Adrian Georgescu
  <cp:rule id="f3g44r1">
48 1 Adrian Georgescu
    <cp:conditions>
49 1 Adrian Georgescu
      <cp:identity>
50 1 Adrian Georgescu
        <cp:one id="sip:alice@example.com"/>
51 1 Adrian Georgescu
        <cp:one id="mailto:bob@example.net"/>
52 1 Adrian Georgescu
        <cp:one id="tel:+1-212-555-1234"/>
53 1 Adrian Georgescu
      </cp:identity>
54 1 Adrian Georgescu
    </cp:conditions>
55 1 Adrian Georgescu
    <cp:actions/>
56 1 Adrian Georgescu
    <cp:transformations/>
57 1 Adrian Georgescu
  </cp:rule>
58 1 Adrian Georgescu
</cp:ruleset>
59 1 Adrian Georgescu
<BLANKLINE>
60 1 Adrian Georgescu
}}}
61 1 Adrian Georgescu
62 1 Adrian Georgescu
== Pres-rules ==
63 1 Adrian Georgescu
64 1 Adrian Georgescu
Parses and produces Presence Authorization Rules documents according to [http://tools.ietf.org/html/rfc5025 RFC 5025].
65 1 Adrian Georgescu
66 1 Adrian Georgescu
Authorization rules are stored on the XCAP server. The presence rules are generated either based on user initiative or as a response to a new subscription signaled by a change in the watcherinfo application.
67 1 Adrian Georgescu
68 1 Adrian Georgescu
Example usage:
69 1 Adrian Georgescu
70 1 Adrian Georgescu
{{{
71 1 Adrian Georgescu
>>> conditions = Conditions([Identity([IdentityOne('sip:user@example.com')])])
72 1 Adrian Georgescu
>>> actions = Actions([SubHandling('allow')])
73 1 Adrian Georgescu
>>> transformations = Transformations()
74 1 Adrian Georgescu
>>> psrv = ProvideServices(provides=[ServiceURIScheme('sip'), ServiceURIScheme('mailto')])
75 1 Adrian Georgescu
>>> ppers = ProvidePersons(all=True)
76 1 Adrian Georgescu
>>> transformations[0:0] = [psrv, ppers]
77 1 Adrian Georgescu
>>> transformations.append(ProvideActivities('true'))
78 1 Adrian Georgescu
>>> transformations.append(ProvideUserInput('bare'))
79 1 Adrian Georgescu
>>> transformations.append(ProvideUnknownAttribute(ns='urn:vendor-specific:foo-namespace', name='foo', value='true'))
80 1 Adrian Georgescu
>>> rule = Rule(id='a', conditions=conditions, actions=actions, transformations=transformations)
81 1 Adrian Georgescu
>>> prules = PresRules([rule])
82 1 Adrian Georgescu
>>> print prules.toxml(pretty_print=True)
83 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
84 1 Adrian Georgescu
<cp:ruleset xmlns:pr="urn:ietf:params:xml:ns:pres-rules" xmlns:cp="urn:ietf:params:xml:ns:common-policy">
85 1 Adrian Georgescu
  <cp:rule id="a">
86 1 Adrian Georgescu
    <cp:conditions>
87 1 Adrian Georgescu
      <cp:identity>
88 1 Adrian Georgescu
        <cp:one id="sip:user@example.com"/>
89 1 Adrian Georgescu
      </cp:identity>
90 1 Adrian Georgescu
    </cp:conditions>
91 1 Adrian Georgescu
    <cp:actions>
92 1 Adrian Georgescu
      <pr:sub-handling>allow</pr:sub-handling>
93 1 Adrian Georgescu
    </cp:actions>
94 1 Adrian Georgescu
    <cp:transformations>
95 1 Adrian Georgescu
      <pr:provide-services>
96 1 Adrian Georgescu
        <pr:service-uri-scheme>sip</pr:service-uri-scheme>
97 1 Adrian Georgescu
        <pr:service-uri-scheme>mailto</pr:service-uri-scheme>
98 1 Adrian Georgescu
      </pr:provide-services>
99 1 Adrian Georgescu
      <pr:provide-persons>
100 1 Adrian Georgescu
        <pr:all-persons/>
101 1 Adrian Georgescu
      </pr:provide-persons>
102 1 Adrian Georgescu
      <pr:provide-activities>true</pr:provide-activities>
103 1 Adrian Georgescu
      <pr:provide-user-input>bare</pr:provide-user-input>
104 1 Adrian Georgescu
      <pr:provide-unknown-attribute ns="urn:vendor-specific:foo-namespace" name="foo">true</pr:provide-unknown-attribute>
105 1 Adrian Georgescu
    </cp:transformations>
106 1 Adrian Georgescu
  </cp:rule>
107 1 Adrian Georgescu
</cp:ruleset>
108 1 Adrian Georgescu
<BLANKLINE>
109 1 Adrian Georgescu
}}}
110 1 Adrian Georgescu
111 1 Adrian Georgescu
== Resource Lists ==
112 1 Adrian Georgescu
113 1 Adrian Georgescu
This module provides convenient classes to parse and generate resource-lists documents as described in [http://tools.ietf.org/html/rfc4826 RFC 4826].
114 1 Adrian Georgescu
115 1 Adrian Georgescu
Used for server side storage of presence related buddy lists using XCAP protocol. The SIP clients maintain the resource-lists on the XCAP server which provides persisten storage and aggregation point for multiple devices.
116 1 Adrian Georgescu
117 1 Adrian Georgescu
=== Generation ===
118 1 Adrian Georgescu
119 1 Adrian Georgescu
{{{
120 1 Adrian Georgescu
>>> bill = Entry('sip:bill@example.com', display_name = 'Bill Doe')
121 1 Adrian Georgescu
>>> petri = EntryRef('some/ref')
122 1 Adrian Georgescu
>>> friends = List([bill, petri])
123 1 Adrian Georgescu
>>> rl = ResourceLists([friends])
124 1 Adrian Georgescu
>>> print rl.toxml(pretty_print=True)
125 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
126 1 Adrian Georgescu
<rl:resource-lists xmlns:rl="urn:ietf:params:xml:ns:resource-lists">
127 1 Adrian Georgescu
  <rl:list>
128 1 Adrian Georgescu
    <rl:entry uri="sip:bill@example.com">
129 1 Adrian Georgescu
      <rl:display-name>Bill Doe</rl:display-name>
130 1 Adrian Georgescu
    </rl:entry>
131 1 Adrian Georgescu
    <rl:entry-ref ref="some/ref"/>
132 1 Adrian Georgescu
  </rl:list>
133 1 Adrian Georgescu
</rl:resource-lists>
134 1 Adrian Georgescu
<BLANKLINE>
135 1 Adrian Georgescu
}}}
136 1 Adrian Georgescu
137 1 Adrian Georgescu
toxml() wraps etree.tostring() and accepts all its arguments (like pretty_print).
138 1 Adrian Georgescu
139 1 Adrian Georgescu
=== Parsing ===
140 1 Adrian Georgescu
141 1 Adrian Georgescu
{{{
142 1 Adrian Georgescu
>>> r = ResourceLists.parse(example_from_section_3_3_rfc)
143 1 Adrian Georgescu
>>> len(r)
144 1 Adrian Georgescu
1
145 1 Adrian Georgescu
146 1 Adrian Georgescu
>>> friends = r[0]
147 1 Adrian Georgescu
>>> friends.name
148 1 Adrian Georgescu
'friends'
149 1 Adrian Georgescu
150 1 Adrian Georgescu
>>> bill = friends[0]
151 1 Adrian Georgescu
>>> bill.uri
152 1 Adrian Georgescu
'sip:bill@example.com'
153 1 Adrian Georgescu
>>> print bill.display_name
154 1 Adrian Georgescu
Bill Doe
155 1 Adrian Georgescu
156 1 Adrian Georgescu
>>> close_friends = friends[2]
157 1 Adrian Georgescu
>>> print close_friends[0]
158 1 Adrian Georgescu
"Joe Smith" <sip:joe@example.com>
159 1 Adrian Georgescu
>>> print close_friends[2].display_name
160 1 Adrian Georgescu
Marketing
161 1 Adrian Georgescu
}}}
162 1 Adrian Georgescu
163 1 Adrian Georgescu
164 1 Adrian Georgescu
== RLS Services ==
165 1 Adrian Georgescu
166 1 Adrian Georgescu
Parses and builds application/rls-services+xml documents according to [http://tools.ietf.org/html/rfc4826  RFC 4826].
167 1 Adrian Georgescu
168 1 Adrian Georgescu
Used for delegating presence related works to the server. The client build rls-services lists with buddies and instructs the server to subscribe to the sip uris indicated in the lists. This way the client can save bandwidth as the server performs the signaling for subscription and collection of notifications and provides consolidated answers to the SIP user agent.
169 1 Adrian Georgescu
170 1 Adrian Georgescu
{{{
171 1 Adrian Georgescu
>>> buddies = Service('sip:mybuddies@example.com', 'http://xcap.example.com/xxx', ['presence'])
172 1 Adrian Georgescu
>>> marketing = Service('sip:marketing@example.com')
173 1 Adrian Georgescu
>>> marketing.list = RLSList([Entry('sip:joe@example.com'), Entry('sip:sudhir@example.com')])
174 1 Adrian Georgescu
>>> marketing.packages = ['presence']
175 1 Adrian Georgescu
>>> rls = RLSServices([buddies, marketing])
176 1 Adrian Georgescu
>>> print rls.toxml(pretty_print=True)
177 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
178 1 Adrian Georgescu
<rls-services xmlns:rl="urn:ietf:params:xml:ns:resource-lists" xmlns="urn:ietf:params:xml:ns:rls-services">
179 1 Adrian Georgescu
  <service uri="sip:mybuddies@example.com">
180 1 Adrian Georgescu
    <resource-list>http://xcap.example.com/xxx</resource-list>
181 1 Adrian Georgescu
    <packages>
182 1 Adrian Georgescu
      <package>presence</package>
183 1 Adrian Georgescu
    </packages>
184 1 Adrian Georgescu
  </service>
185 1 Adrian Georgescu
  <service uri="sip:marketing@example.com">
186 1 Adrian Georgescu
    <list>
187 1 Adrian Georgescu
      <rl:entry uri="sip:joe@example.com"/>
188 1 Adrian Georgescu
      <rl:entry uri="sip:sudhir@example.com"/>
189 1 Adrian Georgescu
    </list>
190 1 Adrian Georgescu
    <packages>
191 1 Adrian Georgescu
      <package>presence</package>
192 1 Adrian Georgescu
    </packages>
193 1 Adrian Georgescu
  </service>
194 1 Adrian Georgescu
</rls-services>
195 1 Adrian Georgescu
<BLANKLINE>
196 1 Adrian Georgescu
197 1 Adrian Georgescu
198 1 Adrian Georgescu
>>> rls = RLSServices.parse(example_from_section_4_3_rfc)
199 1 Adrian Georgescu
>>> len(rls)
200 1 Adrian Georgescu
2
201 1 Adrian Georgescu
202 1 Adrian Georgescu
>>> rls[0].uri
203 1 Adrian Georgescu
'sip:mybuddies@example.com'
204 1 Adrian Georgescu
205 1 Adrian Georgescu
>>> print rls[0].list
206 1 Adrian Georgescu
http://xcap.example.com/xxx
207 1 Adrian Georgescu
208 1 Adrian Georgescu
>>> print rls[0].packages[0]
209 1 Adrian Georgescu
presence
210 1 Adrian Georgescu
211 1 Adrian Georgescu
212 1 Adrian Georgescu
>>> rls[1].uri
213 1 Adrian Georgescu
'sip:marketing@example.com'
214 1 Adrian Georgescu
215 1 Adrian Georgescu
>>> assert len(rls[1].packages) == 1 and rls[1].packages[0] == 'presence'
216 1 Adrian Georgescu
217 1 Adrian Georgescu
}}}
218 1 Adrian Georgescu
219 1 Adrian Georgescu
220 1 Adrian Georgescu
== Presence Data Model ==
221 1 Adrian Georgescu
222 1 Adrian Georgescu
PIDF handling according to [http://tools.ietf.org/html/rfc3863 RFC 3863] and [http://tools.ietf.org/html/rfc3379 RFC 3379]. This module provides classes to parse and generate PIDF documents.
223 1 Adrian Georgescu
224 1 Adrian Georgescu
Used to parse NOTIFY body for presence event and generate state information for use with PUBLISH method and to parse the state of buddy lists entries we have subscribed to. A SIP client typically instantiates a new PIDF object for itself and for each buddy it SUBSCRIBEs to and updates each object when a NOTIFY is received. The list of buddies is maintained using the resource-lists XCAP application.
225 1 Adrian Georgescu
226 1 Adrian Georgescu
Example usage:
227 1 Adrian Georgescu
228 1 Adrian Georgescu
{{{
229 1 Adrian Georgescu
>>> from datetime import datetime
230 1 Adrian Georgescu
>>> pidf = PIDF('pres:someone@example.com')
231 1 Adrian Georgescu
>>> status = Status(basic=Basic('open'))
232 1 Adrian Georgescu
>>> contact = Contact('im:someone@mobilecarrier.net')
233 1 Adrian Georgescu
>>> contact.priority = "0.8"
234 1 Adrian Georgescu
>>> tuple1 = Service('bs35r9', notes=[ServiceNote("Don't Disturb Please!"), ServiceNote("Ne derangez pas, s'il vous plait", lang="fr")], status=status)
235 1 Adrian Georgescu
>>> tuple1.contact = contact
236 1 Adrian Georgescu
>>> tuple1.timestamp = Timestamp(datetime(2008, 9, 11, 20, 42, 03))
237 1 Adrian Georgescu
>>> tuple2 = Service('eg92n8', status=Status(basic=Basic('open')), contact=Contact('mailto:someone@example.com'))
238 1 Adrian Georgescu
>>> tuple2.contact.priority = "1.0"
239 1 Adrian Georgescu
>>> pidf.notes.add(Note("I'll be in Tokyo next week"))
240 1 Adrian Georgescu
>>> pidf.append(tuple1)
241 1 Adrian Georgescu
>>> pidf.append(tuple2)
242 1 Adrian Georgescu
>>> print pidf.toxml(pretty_print=True)
243 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
244 1 Adrian Georgescu
<presence xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns="urn:ietf:params:xml:ns:pidf" entity="pres:someone@example.com"
245 1 Adrian Georgescu
  <tuple id="bs35r9">
246 1 Adrian Georgescu
    <status>
247 1 Adrian Georgescu
      <basic>open</basic>
248 1 Adrian Georgescu
    </status>
249 1 Adrian Georgescu
    <contact priority="0.8">im:someone@mobilecarrier.net</contact>
250 1 Adrian Georgescu
    <note>Don't Disturb Please!</note>
251 1 Adrian Georgescu
    <note xml:lang="fr">Ne derangez pas, s'il vous plait</note>
252 1 Adrian Georgescu
    <timestamp>2008-09-11T20:42:03Z</timestamp>
253 1 Adrian Georgescu
  </tuple>
254 1 Adrian Georgescu
  <tuple id="eg92n8">
255 1 Adrian Georgescu
    <status>
256 1 Adrian Georgescu
      <basic>open</basic>
257 1 Adrian Georgescu
    </status>
258 1 Adrian Georgescu
    <contact priority="1.0">mailto:someone@example.com</contact>
259 1 Adrian Georgescu
  </tuple>
260 1 Adrian Georgescu
  <note>I'll be in Tokyo next week</note>
261 1 Adrian Georgescu
</presence>
262 1 Adrian Georgescu
<BLANKLINE>
263 1 Adrian Georgescu
}}}
264 1 Adrian Georgescu
265 1 Adrian Georgescu
== Rich Presence Extension ==
266 1 Adrian Georgescu
267 1 Adrian Georgescu
RPID handling according to [http://tools.ietf.org/html/rfc4480 RFC 4480]. This module provides an extension to PIDF (module sipsimple.applications.presdm) to support rich presence.
268 1 Adrian Georgescu
269 1 Adrian Georgescu
{{{
270 1 Adrian Georgescu
__all__ = ['_rpid_namespace_',
271 1 Adrian Georgescu
           'ActivityElement',
272 1 Adrian Georgescu
           'MoodElement',
273 1 Adrian Georgescu
           'PlaceTypeElement',
274 1 Adrian Georgescu
           'PrivacyElement',
275 1 Adrian Georgescu
           'SphereElement',
276 1 Adrian Georgescu
           'RPIDNote',
277 1 Adrian Georgescu
           'Activities',
278 1 Adrian Georgescu
           'Mood',
279 1 Adrian Georgescu
           'PlaceIs',
280 1 Adrian Georgescu
           'AudioPlaceInformation',
281 1 Adrian Georgescu
           'VideoPlaceInformation',
282 1 Adrian Georgescu
           'TextPlaceInformation',
283 1 Adrian Georgescu
           'PlaceType',
284 1 Adrian Georgescu
           'AudioPrivacy',
285 1 Adrian Georgescu
           'TextPrivacy',
286 1 Adrian Georgescu
           'VideoPrivacy',
287 1 Adrian Georgescu
           'Privacy',
288 1 Adrian Georgescu
           'Relationship',
289 1 Adrian Georgescu
           'ServiceClass',
290 1 Adrian Georgescu
           'Sphere',
291 1 Adrian Georgescu
           'StatusIcon',
292 1 Adrian Georgescu
           'TimeOffset',
293 1 Adrian Georgescu
           'UserInput',
294 1 Adrian Georgescu
           'Class',
295 1 Adrian Georgescu
           'Other']
296 1 Adrian Georgescu
297 1 Adrian Georgescu
}}}
298 1 Adrian Georgescu
299 1 Adrian Georgescu
== Watcher-info ==
300 1 Adrian Georgescu
301 1 Adrian Georgescu
Parses application/watcherinfo+xml documents according to [http://tools.ietf.org/html/rfc3857 RFC 3857] and [http://tools.ietf.org/html/rfc3858 RFC3858].
302 1 Adrian Georgescu
303 1 Adrian Georgescu
Used for parsing of NOTIFY body for presence.winfo event. Used for keeping track of watchers that subscribed to our presentity. Based on this information the authorization rules can be managed using presrules.py. To retrieve this information the SIP client must subscribe to its own address for event presence.winfo.
304 1 Adrian Georgescu
305 1 Adrian Georgescu
306 1 Adrian Georgescu
Example:
307 1 Adrian Georgescu
308 1 Adrian Georgescu
{{{
309 1 Adrian Georgescu
>>> winfo_doc='''<?xml version="1.0"?>
310 1 Adrian Georgescu
... <watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo"
311 1 Adrian Georgescu
...              version="0" state="full">
312 1 Adrian Georgescu
...   <watcher-list resource="sip:professor@example.net" package="presence">
313 1 Adrian Georgescu
...     <watcher status="active"
314 1 Adrian Georgescu
...              id="8ajksjda7s"
315 1 Adrian Georgescu
...              duration-subscribed="509"
316 1 Adrian Georgescu
...              event="approved" >sip:userA@example.net</watcher>
317 1 Adrian Georgescu
...     <watcher status="pending"
318 1 Adrian Georgescu
...              id="hh8juja87s997-ass7"
319 1 Adrian Georgescu
...              display-name="Mr. Subscriber"
320 1 Adrian Georgescu
...              event="subscribe">sip:userB@example.org</watcher>
321 1 Adrian Georgescu
...   </watcher-list>
322 1 Adrian Georgescu
... </watcherinfo>'''
323 1 Adrian Georgescu
>>> winfo = WatcherInfo()
324 1 Adrian Georgescu
325 1 Adrian Georgescu
The return value of winfo.update() is a dictionary containing WatcherList objects
326 1 Adrian Georgescu
as keys and lists of the updated watchers as values.
327 1 Adrian Georgescu
328 1 Adrian Georgescu
>>> updated = winfo.update(winfo_doc)
329 1 Adrian Georgescu
>>> len(updated['sip:professor@example.net'])
330 1 Adrian Georgescu
2
331 1 Adrian Georgescu
332 1 Adrian Georgescu
winfo.pending, winfo.terminated and winfo.active are dictionaries indexed by
333 1 Adrian Georgescu
WatcherList objects as keys and lists of Wacher objects as values.
334 1 Adrian Georgescu
335 1 Adrian Georgescu
>>> print winfo.pending['sip:professor@example.net'][0]
336 1 Adrian Georgescu
"Mr. Subscriber" <sip:userB@example.org>
337 1 Adrian Georgescu
>>> print winfo.pending['sip:professor@example.net'][1]
338 1 Adrian Georgescu
Traceback (most recent call last):
339 1 Adrian Georgescu
  File "<stdin>", line 1, in <module>
340 1 Adrian Georgescu
IndexError: list index out of range
341 1 Adrian Georgescu
>>> print winfo.active['sip:professor@example.net'][0]
342 1 Adrian Georgescu
sip:userA@example.net
343 1 Adrian Georgescu
>>> len(winfo.terminated['sip:professor@example.net'])
344 1 Adrian Georgescu
0
345 1 Adrian Georgescu
346 1 Adrian Georgescu
winfo.wlists is the list of WatcherList objects
347 1 Adrian Georgescu
348 1 Adrian Georgescu
>>> list(winfo.wlists[0].active) == list(winfo.active['sip:professor@example.net'])
349 1 Adrian Georgescu
True
350 1 Adrian Georgescu
351 1 Adrian Georgescu
See the classes for more information.
352 1 Adrian Georgescu
}}}
353 1 Adrian Georgescu
354 1 Adrian Georgescu
355 1 Adrian Georgescu
== XCAP-diff ==
356 1 Adrian Georgescu
357 1 Adrian Georgescu
This module allows parsing and building xcap-diff documents according to draft-ietf-simple-xcap-diff.
358 1 Adrian Georgescu
359 1 Adrian Georgescu
Used to parse NOTIFY body for xcap-diff event. Used to detect changes in XCAP documents changed by other device configured for the same presentity.
360 1 Adrian Georgescu
361 1 Adrian Georgescu
362 1 Adrian Georgescu
== Is-composing ==
363 1 Adrian Georgescu
364 1 Adrian Georgescu
This module parses and produces isComposing messages according to RFC3994.