SipPayloadsApi

Version 14 (Adrian Georgescu, 05/20/2010 12:59 pm)

1 1 Adrian Georgescu
= Payloads API =
2 1 Adrian Georgescu
3 11 Adrian Georgescu
[[TOC(SipPayloadsApi*, depth=2)]]
4 1 Adrian Georgescu
5 1 Adrian Georgescu
The following modules are used for parsing and generating bodies carried using
6 1 Adrian Georgescu
SIP PUBLISH/SUBSCRIBE/NOTIFY methods that have been designed for
7 1 Adrian Georgescu
asynchronous event notifications to convey in real-time state and other
8 1 Adrian Georgescu
information between end-points. 
9 1 Adrian Georgescu
10 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
11 1 Adrian Georgescu
advanced form, presence can provide rich state information including but not
12 1 Adrian Georgescu
limited to user mood, geo-location, environment, noise level and type of
13 1 Adrian Georgescu
communication desired. The information can be disseminated based on a
14 1 Adrian Georgescu
granular policy which allows end-users to decide who has access to which
15 1 Adrian Georgescu
part of the published information.
16 1 Adrian Georgescu
17 1 Adrian Georgescu
These applications are used by the SIP core [wiki:SipCoreApiDocumentation#Publication Publication] and [wiki:SipCoreApiDocumentation#Subscription Subscription] classes.
18 1 Adrian Georgescu
19 1 Adrian Georgescu
== Common Policy ==
20 1 Adrian Georgescu
21 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/policy.py]
22 1 Adrian Georgescu
23 1 Adrian Georgescu
Generic data types to be used in policy applications, according to [http://tools.ietf.org/html/rfc4745 RFC 4745].
24 1 Adrian Georgescu
25 6 Adrian Georgescu
=== Example ===
26 1 Adrian Georgescu
27 1 Adrian Georgescu
{{{
28 1 Adrian Georgescu
>>> alice = IdentityOne('sip:alice@example.com')
29 1 Adrian Georgescu
>>> carol = IdentityOne('tel:+1-212-555-1234')
30 1 Adrian Georgescu
>>> bob = IdentityOne('mailto:bob@example.net')
31 1 Adrian Georgescu
>>> print carol
32 1 Adrian Georgescu
tel:+1-212-555-1234
33 1 Adrian Georgescu
>>> id = Identity([alice, bob])
34 1 Adrian Georgescu
>>> print id
35 1 Adrian Georgescu
Identity([IdentityOne('sip:alice@example.com'), IdentityOne('mailto:bob@example.net')])
36 1 Adrian Georgescu
>>> id[1:1] = [carol]
37 1 Adrian Georgescu
>>> print id
38 1 Adrian Georgescu
Identity([IdentityOne('sip:alice@example.com'), IdentityOne('tel:+1-212-555-1234'), IdentityOne('mailto:bob@example.net')])
39 1 Adrian Georgescu
>>> conditions = Conditions([id])
40 1 Adrian Georgescu
>>> rule = Rule(id='f3g44r1', conditions=conditions, actions=Actions(), transformations=Transformations())
41 1 Adrian Georgescu
>>> ruleset = RuleSet()
42 1 Adrian Georgescu
>>> ruleset.append(rule)
43 1 Adrian Georgescu
>>> print ruleset.toxml(pretty_print=True)
44 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
45 1 Adrian Georgescu
<cp:ruleset xmlns:cp="urn:ietf:params:xml:ns:common-policy">
46 1 Adrian Georgescu
  <cp:rule id="f3g44r1">
47 1 Adrian Georgescu
    <cp:conditions>
48 1 Adrian Georgescu
      <cp:identity>
49 1 Adrian Georgescu
        <cp:one id="sip:alice@example.com"/>
50 1 Adrian Georgescu
        <cp:one id="mailto:bob@example.net"/>
51 1 Adrian Georgescu
        <cp:one id="tel:+1-212-555-1234"/>
52 1 Adrian Georgescu
      </cp:identity>
53 1 Adrian Georgescu
    </cp:conditions>
54 1 Adrian Georgescu
    <cp:actions/>
55 1 Adrian Georgescu
    <cp:transformations/>
56 1 Adrian Georgescu
  </cp:rule>
57 1 Adrian Georgescu
</cp:ruleset>
58 1 Adrian Georgescu
<BLANKLINE>
59 1 Adrian Georgescu
}}}
60 1 Adrian Georgescu
61 1 Adrian Georgescu
== Pres-rules ==
62 1 Adrian Georgescu
63 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/presrules.py]
64 5 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 6 Adrian Georgescu
=== Example ===
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 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/resourcelists.py]
115 5 Adrian Georgescu
116 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].
117 1 Adrian Georgescu
118 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.
119 1 Adrian Georgescu
120 1 Adrian Georgescu
=== Generation ===
121 1 Adrian Georgescu
122 1 Adrian Georgescu
{{{
123 1 Adrian Georgescu
>>> bill = Entry('sip:bill@example.com', display_name = 'Bill Doe')
124 1 Adrian Georgescu
>>> petri = EntryRef('some/ref')
125 1 Adrian Georgescu
>>> friends = List([bill, petri])
126 1 Adrian Georgescu
>>> rl = ResourceLists([friends])
127 1 Adrian Georgescu
>>> print rl.toxml(pretty_print=True)
128 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
129 1 Adrian Georgescu
<rl:resource-lists xmlns:rl="urn:ietf:params:xml:ns:resource-lists">
130 1 Adrian Georgescu
  <rl:list>
131 1 Adrian Georgescu
    <rl:entry uri="sip:bill@example.com">
132 1 Adrian Georgescu
      <rl:display-name>Bill Doe</rl:display-name>
133 1 Adrian Georgescu
    </rl:entry>
134 1 Adrian Georgescu
    <rl:entry-ref ref="some/ref"/>
135 1 Adrian Georgescu
  </rl:list>
136 1 Adrian Georgescu
</rl:resource-lists>
137 1 Adrian Georgescu
<BLANKLINE>
138 1 Adrian Georgescu
}}}
139 1 Adrian Georgescu
140 1 Adrian Georgescu
toxml() wraps etree.tostring() and accepts all its arguments (like pretty_print).
141 1 Adrian Georgescu
142 1 Adrian Georgescu
=== Parsing ===
143 1 Adrian Georgescu
144 1 Adrian Georgescu
{{{
145 1 Adrian Georgescu
>>> r = ResourceLists.parse(example_from_section_3_3_rfc)
146 1 Adrian Georgescu
>>> len(r)
147 1 Adrian Georgescu
1
148 1 Adrian Georgescu
149 1 Adrian Georgescu
>>> friends = r[0]
150 1 Adrian Georgescu
>>> friends.name
151 1 Adrian Georgescu
'friends'
152 1 Adrian Georgescu
153 1 Adrian Georgescu
>>> bill = friends[0]
154 1 Adrian Georgescu
>>> bill.uri
155 1 Adrian Georgescu
'sip:bill@example.com'
156 1 Adrian Georgescu
>>> print bill.display_name
157 1 Adrian Georgescu
Bill Doe
158 1 Adrian Georgescu
159 1 Adrian Georgescu
>>> close_friends = friends[2]
160 1 Adrian Georgescu
>>> print close_friends[0]
161 1 Adrian Georgescu
"Joe Smith" <sip:joe@example.com>
162 1 Adrian Georgescu
>>> print close_friends[2].display_name
163 1 Adrian Georgescu
Marketing
164 1 Adrian Georgescu
}}}
165 1 Adrian Georgescu
166 1 Adrian Georgescu
167 1 Adrian Georgescu
== RLS Services ==
168 1 Adrian Georgescu
169 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/rlsservices.py]
170 5 Adrian Georgescu
171 1 Adrian Georgescu
Parses and builds application/rls-services+xml documents according to [http://tools.ietf.org/html/rfc4826  RFC 4826].
172 1 Adrian Georgescu
173 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.
174 1 Adrian Georgescu
175 3 Adrian Georgescu
=== Generation ===
176 3 Adrian Georgescu
177 1 Adrian Georgescu
{{{
178 1 Adrian Georgescu
>>> buddies = Service('sip:mybuddies@example.com', 'http://xcap.example.com/xxx', ['presence'])
179 1 Adrian Georgescu
>>> marketing = Service('sip:marketing@example.com')
180 1 Adrian Georgescu
>>> marketing.list = RLSList([Entry('sip:joe@example.com'), Entry('sip:sudhir@example.com')])
181 1 Adrian Georgescu
>>> marketing.packages = ['presence']
182 1 Adrian Georgescu
>>> rls = RLSServices([buddies, marketing])
183 1 Adrian Georgescu
>>> print rls.toxml(pretty_print=True)
184 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
185 1 Adrian Georgescu
<rls-services xmlns:rl="urn:ietf:params:xml:ns:resource-lists" xmlns="urn:ietf:params:xml:ns:rls-services">
186 1 Adrian Georgescu
  <service uri="sip:mybuddies@example.com">
187 1 Adrian Georgescu
    <resource-list>http://xcap.example.com/xxx</resource-list>
188 1 Adrian Georgescu
    <packages>
189 1 Adrian Georgescu
      <package>presence</package>
190 1 Adrian Georgescu
    </packages>
191 1 Adrian Georgescu
  </service>
192 1 Adrian Georgescu
  <service uri="sip:marketing@example.com">
193 1 Adrian Georgescu
    <list>
194 1 Adrian Georgescu
      <rl:entry uri="sip:joe@example.com"/>
195 1 Adrian Georgescu
      <rl:entry uri="sip:sudhir@example.com"/>
196 1 Adrian Georgescu
    </list>
197 1 Adrian Georgescu
    <packages>
198 1 Adrian Georgescu
      <package>presence</package>
199 1 Adrian Georgescu
    </packages>
200 1 Adrian Georgescu
  </service>
201 1 Adrian Georgescu
</rls-services>
202 1 Adrian Georgescu
<BLANKLINE>
203 1 Adrian Georgescu
204 3 Adrian Georgescu
=== Parsing ===
205 1 Adrian Georgescu
206 1 Adrian Georgescu
>>> rls = RLSServices.parse(example_from_section_4_3_rfc)
207 1 Adrian Georgescu
>>> len(rls)
208 1 Adrian Georgescu
2
209 1 Adrian Georgescu
210 1 Adrian Georgescu
>>> rls[0].uri
211 1 Adrian Georgescu
'sip:mybuddies@example.com'
212 1 Adrian Georgescu
213 1 Adrian Georgescu
>>> print rls[0].list
214 1 Adrian Georgescu
http://xcap.example.com/xxx
215 1 Adrian Georgescu
216 1 Adrian Georgescu
>>> print rls[0].packages[0]
217 1 Adrian Georgescu
presence
218 1 Adrian Georgescu
219 1 Adrian Georgescu
220 1 Adrian Georgescu
>>> rls[1].uri
221 1 Adrian Georgescu
'sip:marketing@example.com'
222 1 Adrian Georgescu
223 1 Adrian Georgescu
>>> assert len(rls[1].packages) == 1 and rls[1].packages[0] == 'presence'
224 1 Adrian Georgescu
225 1 Adrian Georgescu
}}}
226 1 Adrian Georgescu
227 1 Adrian Georgescu
== Presence Data Model ==
228 1 Adrian Georgescu
229 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/presdm.py]
230 5 Adrian Georgescu
231 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.
232 1 Adrian Georgescu
233 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.
234 1 Adrian Georgescu
235 6 Adrian Georgescu
=== Example ===
236 1 Adrian Georgescu
237 1 Adrian Georgescu
{{{
238 1 Adrian Georgescu
>>> from datetime import datetime
239 1 Adrian Georgescu
>>> pidf = PIDF('pres:someone@example.com')
240 1 Adrian Georgescu
>>> status = Status(basic=Basic('open'))
241 1 Adrian Georgescu
>>> contact = Contact('im:someone@mobilecarrier.net')
242 1 Adrian Georgescu
>>> contact.priority = "0.8"
243 1 Adrian Georgescu
>>> tuple1 = Service('bs35r9', notes=[ServiceNote("Don't Disturb Please!"), ServiceNote("Ne derangez pas, s'il vous plait", lang="fr")], status=status)
244 1 Adrian Georgescu
>>> tuple1.contact = contact
245 1 Adrian Georgescu
>>> tuple1.timestamp = Timestamp(datetime(2008, 9, 11, 20, 42, 03))
246 1 Adrian Georgescu
>>> tuple2 = Service('eg92n8', status=Status(basic=Basic('open')), contact=Contact('mailto:someone@example.com'))
247 1 Adrian Georgescu
>>> tuple2.contact.priority = "1.0"
248 1 Adrian Georgescu
>>> pidf.notes.add(Note("I'll be in Tokyo next week"))
249 1 Adrian Georgescu
>>> pidf.append(tuple1)
250 1 Adrian Georgescu
>>> pidf.append(tuple2)
251 1 Adrian Georgescu
>>> print pidf.toxml(pretty_print=True)
252 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
253 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"
254 1 Adrian Georgescu
  <tuple id="bs35r9">
255 1 Adrian Georgescu
    <status>
256 1 Adrian Georgescu
      <basic>open</basic>
257 1 Adrian Georgescu
    </status>
258 1 Adrian Georgescu
    <contact priority="0.8">im:someone@mobilecarrier.net</contact>
259 1 Adrian Georgescu
    <note>Don't Disturb Please!</note>
260 1 Adrian Georgescu
    <note xml:lang="fr">Ne derangez pas, s'il vous plait</note>
261 1 Adrian Georgescu
    <timestamp>2008-09-11T20:42:03Z</timestamp>
262 1 Adrian Georgescu
  </tuple>
263 1 Adrian Georgescu
  <tuple id="eg92n8">
264 1 Adrian Georgescu
    <status>
265 1 Adrian Georgescu
      <basic>open</basic>
266 1 Adrian Georgescu
    </status>
267 1 Adrian Georgescu
    <contact priority="1.0">mailto:someone@example.com</contact>
268 1 Adrian Georgescu
  </tuple>
269 1 Adrian Georgescu
  <note>I'll be in Tokyo next week</note>
270 1 Adrian Georgescu
</presence>
271 1 Adrian Georgescu
<BLANKLINE>
272 1 Adrian Georgescu
}}}
273 1 Adrian Georgescu
274 1 Adrian Georgescu
== Rich Presence Extension ==
275 1 Adrian Georgescu
276 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/rpid.py]
277 5 Adrian Georgescu
278 7 Adrian Georgescu
RPID handling according to [http://tools.ietf.org/html/rfc4480 RFC 4480]. This module provides an extension to PIDF to support rich presence.
279 1 Adrian Georgescu
280 1 Adrian Georgescu
{{{
281 1 Adrian Georgescu
__all__ = ['_rpid_namespace_',
282 1 Adrian Georgescu
           'ActivityElement',
283 1 Adrian Georgescu
           'MoodElement',
284 1 Adrian Georgescu
           'PlaceTypeElement',
285 1 Adrian Georgescu
           'PrivacyElement',
286 1 Adrian Georgescu
           'SphereElement',
287 1 Adrian Georgescu
           'RPIDNote',
288 1 Adrian Georgescu
           'Activities',
289 1 Adrian Georgescu
           'Mood',
290 1 Adrian Georgescu
           'PlaceIs',
291 1 Adrian Georgescu
           'AudioPlaceInformation',
292 1 Adrian Georgescu
           'VideoPlaceInformation',
293 1 Adrian Georgescu
           'TextPlaceInformation',
294 1 Adrian Georgescu
           'PlaceType',
295 1 Adrian Georgescu
           'AudioPrivacy',
296 1 Adrian Georgescu
           'TextPrivacy',
297 1 Adrian Georgescu
           'VideoPrivacy',
298 1 Adrian Georgescu
           'Privacy',
299 1 Adrian Georgescu
           'Relationship',
300 1 Adrian Georgescu
           'ServiceClass',
301 1 Adrian Georgescu
           'Sphere',
302 1 Adrian Georgescu
           'StatusIcon',
303 1 Adrian Georgescu
           'TimeOffset',
304 1 Adrian Georgescu
           'UserInput',
305 1 Adrian Georgescu
           'Class',
306 1 Adrian Georgescu
           'Other']
307 1 Adrian Georgescu
308 1 Adrian Georgescu
}}}
309 1 Adrian Georgescu
310 1 Adrian Georgescu
== Watcher-info ==
311 1 Adrian Georgescu
312 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/watcherinfo.py]
313 5 Adrian Georgescu
314 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].
315 1 Adrian Georgescu
316 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.
317 1 Adrian Georgescu
318 6 Adrian Georgescu
=== Example ===
319 1 Adrian Georgescu
320 1 Adrian Georgescu
{{{
321 1 Adrian Georgescu
>>> winfo_doc='''<?xml version="1.0"?>
322 1 Adrian Georgescu
... <watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo"
323 1 Adrian Georgescu
...              version="0" state="full">
324 1 Adrian Georgescu
...   <watcher-list resource="sip:professor@example.net" package="presence">
325 1 Adrian Georgescu
...     <watcher status="active"
326 1 Adrian Georgescu
...              id="8ajksjda7s"
327 1 Adrian Georgescu
...              duration-subscribed="509"
328 1 Adrian Georgescu
...              event="approved" >sip:userA@example.net</watcher>
329 1 Adrian Georgescu
...     <watcher status="pending"
330 1 Adrian Georgescu
...              id="hh8juja87s997-ass7"
331 1 Adrian Georgescu
...              display-name="Mr. Subscriber"
332 1 Adrian Georgescu
...              event="subscribe">sip:userB@example.org</watcher>
333 1 Adrian Georgescu
...   </watcher-list>
334 1 Adrian Georgescu
... </watcherinfo>'''
335 1 Adrian Georgescu
>>> winfo = WatcherInfo()
336 1 Adrian Georgescu
337 1 Adrian Georgescu
The return value of winfo.update() is a dictionary containing WatcherList objects
338 1 Adrian Georgescu
as keys and lists of the updated watchers as values.
339 1 Adrian Georgescu
340 1 Adrian Georgescu
>>> updated = winfo.update(winfo_doc)
341 1 Adrian Georgescu
>>> len(updated['sip:professor@example.net'])
342 1 Adrian Georgescu
2
343 1 Adrian Georgescu
344 1 Adrian Georgescu
winfo.pending, winfo.terminated and winfo.active are dictionaries indexed by
345 1 Adrian Georgescu
WatcherList objects as keys and lists of Wacher objects as values.
346 1 Adrian Georgescu
347 1 Adrian Georgescu
>>> print winfo.pending['sip:professor@example.net'][0]
348 1 Adrian Georgescu
"Mr. Subscriber" <sip:userB@example.org>
349 1 Adrian Georgescu
>>> print winfo.pending['sip:professor@example.net'][1]
350 1 Adrian Georgescu
Traceback (most recent call last):
351 1 Adrian Georgescu
  File "<stdin>", line 1, in <module>
352 1 Adrian Georgescu
IndexError: list index out of range
353 1 Adrian Georgescu
>>> print winfo.active['sip:professor@example.net'][0]
354 1 Adrian Georgescu
sip:userA@example.net
355 1 Adrian Georgescu
>>> len(winfo.terminated['sip:professor@example.net'])
356 1 Adrian Georgescu
0
357 1 Adrian Georgescu
358 1 Adrian Georgescu
winfo.wlists is the list of WatcherList objects
359 1 Adrian Georgescu
360 1 Adrian Georgescu
>>> list(winfo.wlists[0].active) == list(winfo.active['sip:professor@example.net'])
361 1 Adrian Georgescu
True
362 1 Adrian Georgescu
363 1 Adrian Georgescu
See the classes for more information.
364 1 Adrian Georgescu
}}}
365 1 Adrian Georgescu
366 1 Adrian Georgescu
367 1 Adrian Georgescu
== XCAP-diff ==
368 1 Adrian Georgescu
369 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/xcapdiff.py]
370 1 Adrian Georgescu
371 14 Adrian Georgescu
This module allows parsing and building xcap-diff documents according to RFC5874.
372 1 Adrian Georgescu
373 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.
374 1 Adrian Georgescu
375 11 Adrian Georgescu
{{{
376 12 Adrian Georgescu
__all__ = ['namespace', 
377 12 Adrian Georgescu
    'XCAPDiffApplication', 
378 12 Adrian Georgescu
    'BodyNotChanged', 
379 12 Adrian Georgescu
    'Document', 
380 12 Adrian Georgescu
    'Element', 
381 12 Adrian Georgescu
    'Attribute', 
382 12 Adrian Georgescu
    'XCAPDiff']
383 11 Adrian Georgescu
}}}
384 1 Adrian Georgescu
385 1 Adrian Georgescu
== Is-composing ==
386 5 Adrian Georgescu
387 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/iscomposing.py]
388 1 Adrian Georgescu
389 1 Adrian Georgescu
This module parses and produces isComposing messages according to RFC3994.
390 1 Adrian Georgescu
391 1 Adrian Georgescu
{{{
392 12 Adrian Georgescu
__all__ = ['namespace', 
393 12 Adrian Georgescu
    'IsComposingApplication', 
394 12 Adrian Georgescu
    'State', 
395 12 Adrian Georgescu
    'LastActive', 
396 12 Adrian Georgescu
    'ContentType', 
397 12 Adrian Georgescu
    'Refresh', 
398 12 Adrian Georgescu
    'IsComposingMessage']
399 11 Adrian Georgescu
}}}
400 11 Adrian Georgescu
401 5 Adrian Georgescu
== Message Summary ==
402 5 Adrian Georgescu
403 5 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/messagesummary.py]
404 5 Adrian Georgescu
405 5 Adrian Georgescu
This module parses and produces message-summary messages according to RF3842.
406 1 Adrian Georgescu
407 11 Adrian Georgescu
408 10 Adrian Georgescu
== User Agent Capability ==
409 8 Adrian Georgescu
410 8 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/caps.py]
411 8 Adrian Georgescu
412 8 Adrian Georgescu
User Agent Capability Extension handling according to RFC5196
413 8 Adrian Georgescu
414 8 Adrian Georgescu
This module provides an extension to PIDF to describe a user-agent capabilities in the PIDF documents.
415 1 Adrian Georgescu
416 11 Adrian Georgescu
{{{
417 11 Adrian Georgescu
__all__ = ['caps_namespace',
418 11 Adrian Georgescu
            'Audio',
419 11 Adrian Georgescu
            'Application',
420 11 Adrian Georgescu
            'Data',
421 11 Adrian Georgescu
            'Control',
422 11 Adrian Georgescu
            'Video',
423 11 Adrian Georgescu
            'Video',
424 11 Adrian Georgescu
            'Text',
425 11 Adrian Georgescu
            'Message',
426 11 Adrian Georgescu
            'Type',
427 11 Adrian Georgescu
            'Automata',
428 11 Adrian Georgescu
            'Class',
429 11 Adrian Georgescu
            'ClassPersonal',
430 11 Adrian Georgescu
            'ClassBusiness',
431 11 Adrian Georgescu
            'Duplex',
432 11 Adrian Georgescu
            'DuplexFull',
433 11 Adrian Georgescu
            'DuplexHalf',
434 11 Adrian Georgescu
            'DuplexReceiveOnly',
435 11 Adrian Georgescu
            'DuplexSendOnly',
436 11 Adrian Georgescu
            'Description',
437 11 Adrian Georgescu
            'EventPackages',
438 11 Adrian Georgescu
            'EventConference',
439 11 Adrian Georgescu
            'EventDialog',
440 11 Adrian Georgescu
            'EventKpml',
441 11 Adrian Georgescu
            'EventMessageSummary',
442 11 Adrian Georgescu
            'EventPocSettings',
443 11 Adrian Georgescu
            'EventPresence',
444 11 Adrian Georgescu
            'EventReg',
445 11 Adrian Georgescu
            'EventRefer',
446 11 Adrian Georgescu
            'EventSiemensRtpStats',
447 11 Adrian Georgescu
            'EventSpiritsIndps',
448 11 Adrian Georgescu
            'EventSpiritsUserProf',
449 11 Adrian Georgescu
            'EventWinfo',
450 11 Adrian Georgescu
            'Priority',
451 11 Adrian Georgescu
            'PriorityLowerthan',
452 11 Adrian Georgescu
            'PriorityHigherthan',
453 11 Adrian Georgescu
            'PriorityEquals',
454 11 Adrian Georgescu
            'PriorityRange',
455 11 Adrian Georgescu
            'Methods',
456 11 Adrian Georgescu
            'MethodAck',
457 11 Adrian Georgescu
            'MethodBye',
458 11 Adrian Georgescu
            'MethodCancel',
459 11 Adrian Georgescu
            'MethodInfo',
460 11 Adrian Georgescu
            'MethodInvite',
461 11 Adrian Georgescu
            'MethodMessage',
462 11 Adrian Georgescu
            'MethodNotify',
463 11 Adrian Georgescu
            'MethodOptions',
464 11 Adrian Georgescu
            'MethodPrack',
465 11 Adrian Georgescu
            'MethodPublish',
466 11 Adrian Georgescu
            'MethodRefer',
467 11 Adrian Georgescu
            'MethodRegister',
468 11 Adrian Georgescu
            'MethodSubscribe',
469 11 Adrian Georgescu
            'MethodUpdate',
470 11 Adrian Georgescu
            'Extensions',
471 11 Adrian Georgescu
            'ExtensionRel100',
472 11 Adrian Georgescu
            'ExtensionEarlySession',
473 11 Adrian Georgescu
            'ExtensionEventList',
474 11 Adrian Georgescu
            'ExtensionFromChange',
475 11 Adrian Georgescu
            'ExtensionGruu',
476 11 Adrian Georgescu
            'ExtensionHistinfo',
477 11 Adrian Georgescu
            'ExtensionJoin',
478 11 Adrian Georgescu
            'ExtensionNoRefSub',
479 11 Adrian Georgescu
            'ExtensionPath',
480 11 Adrian Georgescu
            'ExtensionPrecondition',
481 11 Adrian Georgescu
            'ExtensionPref',
482 11 Adrian Georgescu
            'ExtensionPrivacy',
483 11 Adrian Georgescu
            'ExtensionRecipientListInvite',
484 11 Adrian Georgescu
            'ExtensionRecipientListSubscribe',
485 11 Adrian Georgescu
            'ExtensionReplaces',
486 11 Adrian Georgescu
            'ExtensionResourcePriority',
487 11 Adrian Georgescu
            'ExtensionSdpAnat',
488 11 Adrian Georgescu
            'ExtensionSecAgree',
489 11 Adrian Georgescu
            'ExtensionTdialog',
490 11 Adrian Georgescu
            'ExtensionTimer',
491 11 Adrian Georgescu
            'Schemes',
492 11 Adrian Georgescu
            'Scheme',
493 11 Adrian Georgescu
            'Actor',
494 11 Adrian Georgescu
            'ActorPrincipal',
495 11 Adrian Georgescu
            'ActorAttendant',
496 11 Adrian Georgescu
            'ActorMsgTaker',
497 11 Adrian Georgescu
            'ActorInformation',
498 11 Adrian Georgescu
            'IsFocus',
499 11 Adrian Georgescu
            'Languages',
500 11 Adrian Georgescu
            'Language',
501 11 Adrian Georgescu
            'Servcaps',
502 11 Adrian Georgescu
            'Mobility',
503 11 Adrian Georgescu
            'MobilityFixed',
504 11 Adrian Georgescu
            'MobilityMobile',
505 11 Adrian Georgescu
            'Devcaps',
506 11 Adrian Georgescu
            'ServcapsExtension',
507 11 Adrian Georgescu
            'EventPackagesExtension',
508 11 Adrian Georgescu
            'PriorityExtension',
509 11 Adrian Georgescu
            'MethodsExtension',
510 11 Adrian Georgescu
            'ExtensionsExtension',
511 11 Adrian Georgescu
            'DevcapsExtension',
512 11 Adrian Georgescu
            'MobilityExtension']
513 11 Adrian Georgescu
}}}
514 11 Adrian Georgescu
515 8 Adrian Georgescu
== CIPID ==
516 8 Adrian Georgescu
517 8 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/cipid.py]
518 8 Adrian Georgescu
519 1 Adrian Georgescu
CIPID handling according to RFC4482. This module provides an extension to PIDF to provide additional contact information about a presentity.
520 11 Adrian Georgescu
521 11 Adrian Georgescu
{{{
522 13 Adrian Georgescu
__all__ = ['cipid_namespace', 
523 13 Adrian Georgescu
    'Card', 
524 13 Adrian Georgescu
    'DisplayName', 
525 13 Adrian Georgescu
    'Homepage', 
526 13 Adrian Georgescu
    'Icon', 
527 13 Adrian Georgescu
    'Map', 
528 13 Adrian Georgescu
    'Sound']
529 11 Adrian Georgescu
}}}
530 11 Adrian Georgescu
531 11 Adrian Georgescu
== Conference ==
532 11 Adrian Georgescu
533 11 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/conference.py]
534 11 Adrian Georgescu
535 11 Adrian Georgescu
Parses and produces conference-info messages according to RFC4575.
536 11 Adrian Georgescu
537 11 Adrian Georgescu
{{{
538 11 Adrian Georgescu
__all__ = ['namespace',
539 11 Adrian Georgescu
        'ConferenceApplication',
540 11 Adrian Georgescu
        'ConferenceDescription',
541 11 Adrian Georgescu
        'ConfUris',
542 11 Adrian Georgescu
        'ConfUrisEntry',
543 11 Adrian Georgescu
        'ServiceUris',
544 11 Adrian Georgescu
        'ServiceUrisEntry',
545 11 Adrian Georgescu
        'UrisTypeModified',
546 11 Adrian Georgescu
        'UrisTypeEntry',
547 11 Adrian Georgescu
        'AvailableMedia',
548 11 Adrian Georgescu
        'AvailableMediaEntry',
549 11 Adrian Georgescu
        'Users',
550 11 Adrian Georgescu
        'User',
551 11 Adrian Georgescu
        'AssociatedAors',
552 11 Adrian Georgescu
        'Roles',
553 11 Adrian Georgescu
        'Role',
554 11 Adrian Georgescu
        'Endpoint',
555 11 Adrian Georgescu
        'CallInfo',
556 11 Adrian Georgescu
        'Sip',
557 11 Adrian Georgescu
        'Referred',
558 11 Adrian Georgescu
        'JoiningInfo',
559 11 Adrian Georgescu
        'DisconnectionInfo',
560 11 Adrian Georgescu
        'HostInfo',
561 11 Adrian Georgescu
        'HostInfoUris',
562 11 Adrian Georgescu
        'ConferenceState',
563 11 Adrian Georgescu
        'SidebarsByRef',
564 11 Adrian Georgescu
        'SidebarsByVal',
565 11 Adrian Georgescu
        'Conference',
566 11 Adrian Georgescu
        'ConferenceDescriptionExtension']
567 11 Adrian Georgescu
}}}
568 11 Adrian Georgescu
569 11 Adrian Georgescu
== Dialog Info ==
570 11 Adrian Georgescu
571 11 Adrian Georgescu
Implemented in [browser:sipsimple/payloads/dialoginfo.py]
572 11 Adrian Georgescu
573 11 Adrian Georgescu
Parses and produces conference-info messages according to RFC4575.
574 11 Adrian Georgescu
575 11 Adrian Georgescu
{{{
576 11 Adrian Georgescu
577 11 Adrian Georgescu
__all__ = ['namespace',
578 11 Adrian Georgescu
        'DialogInfoApplication',
579 11 Adrian Georgescu
        'DialogState',
580 11 Adrian Georgescu
        'Replaces',
581 11 Adrian Georgescu
        'ReferredBy',
582 11 Adrian Georgescu
        'Identity',
583 11 Adrian Georgescu
        'Param',
584 11 Adrian Georgescu
        'Target',
585 11 Adrian Georgescu
        'Local',
586 11 Adrian Georgescu
        'Remote',
587 11 Adrian Georgescu
        'Dialog',
588 11 Adrian Georgescu
        'DialogInfo']
589 11 Adrian Georgescu
}}}