SipPayloadsApi

Version 4 (Adrian Georgescu, 04/13/2010 10:38 am)

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