Project

General

Profile

XCAP-samples » History » Version 7

Adrian Georgescu, 12/13/2012 09:34 AM

1 3 Adrian Georgescu
h1. XCAP samples
2 1 Adrian Georgescu
3 2 Adrian Georgescu
h2. Presence rules
4 1 Adrian Georgescu
5
<pre>
6
<?xml version="1.0" ?>
7
<cp:ruleset xmlns:cp="urn:ietf:params:xml:ns:common-policy" xmlns:ocp="urn:oma:xml:xdm:common-policy" xmlns:pr="urn:ietf:params:xml:ns:pres-rules">
8
	<cp:rule id="wp_prs_grantedcontacts">
9
		<cp:conditions>
10
			<ocp:external-list>
11
				<ocp:entry anc="https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22oma_grantedcontacts%22%5D"/>
12
			</ocp:external-list>
13
		</cp:conditions>
14
		<cp:actions>
15
			<pr:sub-handling>
16
				allow
17
			</pr:sub-handling>
18
		</cp:actions>
19
	</cp:rule>
20
	<cp:rule id="wp_prs_blockedcontacts">
21
		<cp:conditions>
22
			<ocp:external-list>
23
				<ocp:entry anc="https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22oma_blockedcontacts%22%5D"/>
24
			</ocp:external-list>
25
		</cp:conditions>
26
		<cp:actions>
27
			<pr:sub-handling>
28
				polite-block
29
			</pr:sub-handling>
30
		</cp:actions>
31
	</cp:rule>
32
	<cp:rule id="wp_prs_unlisted">
33
		<cp:conditions>
34
			<ocp:other-identity/>
35
		</cp:conditions>
36
		<cp:actions>
37
			<pr:sub-handling>
38
				confirm
39
			</pr:sub-handling>
40
		</cp:actions>
41
	</cp:rule>
42
	<cp:rule id="wp_prs_block_anonymous">
43
		<cp:conditions>
44
			<ocp:anonymous-request/>
45
		</cp:conditions>
46
		<cp:actions>
47
			<pr:sub-handling>
48
				block
49
			</pr:sub-handling>
50
		</cp:actions>
51
	</cp:rule>
52
	<cp:rule id="wp_prs_allow_own">
53
		<cp:conditions>
54
			<cp:identity>
55
				<cp:one id="sip%3Aag%40test.sip2sip.info"/>
56
			</cp:identity>
57
		</cp:conditions>
58
		<cp:actions>
59
			<pr:sub-handling>
60
				allow
61
			</pr:sub-handling>
62
		</cp:actions>
63
	</cp:rule>
64
</cp:ruleset>
65
</pre>
66 4 Adrian Georgescu
67
h2. RLS services
68
69
<pre>
70
<?xml version="1.0" ?>
71
<rls-services xmlns="urn:ietf:params:xml:ns:rls-services">
72
	<service uri="sip%3Aag%2Bpresence%40test.sip2sip.info">
73
		<resource-list>
74
			https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22sipsimple_presence_rls%22%5D
75
		</resource-list>
76
		<packages>
77
			<package>
78
				presence
79
			</package>
80
		</packages>
81
	</service>
82
	<service uri="sip%3Aag%2Bdialog%40test.sip2sip.info">
83
		<resource-list>
84
			https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22sipsimple_dialog_rls%22%5D
85
		</resource-list>
86
		<packages>
87
			<package>
88
				dialog
89
			</package>
90
		</packages>
91
	</service>
92
</rls-services>
93
</pre>
94 5 Adrian Georgescu
95
h2. Status icon
96
97
<pre>
98
<?xml version='1.0' encoding='UTF-8'?>
99
<content xmlns="urn:oma:xml:prs:pres-content"><mime-type>image/png</mime-type><encoding>base64</encoding><data>iVBORw0KGgoAAAANSUhEUgAAAEkAAABJCAIAAAD+EZyLAAAl10lEQVRoBVWb2Y8l133fa791116n
100
Z+lZOTMiOaQoSqIoyQYs2Q8K5E0ykCDIS/KYfyDIW/6GwO8BogCxFQRGNsVJ5NixY4EyKXPRUCJn
101
4Uz39PS+3L59t9qXfL6nekSlpud23apT5/yW72891fb3v/ul2q7s2rEsy+ZX7VQ2pzq3LMfc4otr
102
rlVcsbmh8QzQtbquzYke18M8pGfNcJ1Y3Kis86/Nrdq2eJyRzUK1FmIYY5jZcisIqLjY/GtuVVbt
103
W35plc1gLrIuj3DdtiFSRPOsjgqC9LuuK08cWO75DY12LKc0N/UBlZ/T5XBa85AebK7DKfzq4Dnb
104
hTixwrq63wzhvsi0HbNq7XBSlPO0iOdJmZVpnjPAC/xuN+z3Qt9zCrcUNfxAFoRpLn2prJLlEUsF
105
...
106
iSDi1AJEJkMAk8EagYW9Q/O3j+dwg0IpUK6BFweywGv/P8HB6Yn10+vLAAAAAElFTkSuQmCC
107
</data></content>
108
</pre>
109 6 Adrian Georgescu
110
h2. Resource lists
111
112
<pre>
113
<?xml version="1.0" ?>
114
<rl:resource-lists xmlns:addressbook="urn:ag-projects:xml:ns:addressbook" xmlns:blink="urn:ag-projects:blink:xml:ns:addressbook" xmlns:rl="urn:ietf:params:xml:ns:resource-lists">
115
	<rl:list name="oma_buddylist"/>
116
	<rl:list name="oma_grantedcontacts">
117
		<rl:entry uri="saghul%40gmail.com"/>
118
	</rl:list>
119
	<rl:list name="oma_blockedcontacts">
120
		<rl:entry uri="saghul2%40test.sip2sip.info"/>
121
	</rl:list>
122
	<rl:list name="oma_allcontacts">
123
		<rl:external anchor="https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22oma_buddylist%22%5D"/>
124
		<rl:external anchor="https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22oma_grantedcontacts%22%5D"/>
125
		<rl:external anchor="https%3A//xcap.test.sipthor.net/xcap-root/resource-lists/users/sip%3Aag%40test.sip2sip.info/index/%7E%7E/resource-lists/list%5B%40name%3D%22oma_blockedcontacts%22%5D"/>
126
	</rl:list>
127
	<rl:list name="sipsimple_presence_rls">
128
		<rl:entry uri="saghul%40test.sip2sip.info"/>
129
	</rl:list>
130
	<rl:list name="sipsimple_addressbook">
131
		<addressbook:contact id="id1341072133147342303365">
132
			<addressbook:name>
133
				Saul Ibarra
134
			</addressbook:name>
135
			<addressbook:uris>
136
				<addressbook:uri id="id1343985390914325976718" type="SIP" uri="saul%40ag-projects.com">
137
					<blink:attributes/>
138
				</addressbook:uri>
139
				<addressbook:uri id="id1343985390914934732740" type="XMPP" uri="saghul%40jit.si">
140
					<blink:attributes/>
141
				</addressbook:uri>
142
				<addressbook:uri id="id1343985390915549658015" type="XMPP" uri="saghul%40gmail.com">
143
					<blink:attributes/>
144
				</addressbook:uri>
145
				<addressbook:uri id="id1346858434767006537914" type="SIP" uri="saghul%40sip2sip.info">
146
					<blink:attributes/>
147
				</addressbook:uri>
148
				<addressbook:uri id="id1352399317853493372140" type="SIP" uri="saghul%40test.sip2sip.info">
149
					<blink:attributes/>
150
				</addressbook:uri>
151
				<addressbook:uri id="id1354399366159710946049" type="SIP" uri="31208005163%40ag-projects.com">
152
					<blink:attributes/>
153
				</addressbook:uri>
154
			</addressbook:uris>
155
			<addressbook:dialog>
156
				<addressbook:policy>
157
					block
158
				</addressbook:policy>
159
				<addressbook:subscribe>
160
					false
161
				</addressbook:subscribe>
162
			</addressbook:dialog>
163
			<addressbook:presence>
164
				<addressbook:policy>
165
					allow
166
				</addressbook:policy>
167
				<addressbook:subscribe>
168
					true
169
				</addressbook:subscribe>
170
			</addressbook:presence>
171
			<blink:attributes>
172
				<blink:attribute name="default_uri" nil="true"/>
173
				<blink:attribute name="auto_answer">
174
					False
175
				</blink:attribute>
176
				<blink:attribute name="preferred_media">
177
					chat
178
				</blink:attribute>
179
				<blink:attribute name="icon" nil="true"/>
180
			</blink:attributes>
181
		</addressbook:contact>
182
	</rl:list>
183
</rl:resource-lists>
184
</pre>
185 7 Adrian Georgescu
186
h2. PIDF
187
188
<pre>
189
Content-Type: application/pidf+xml
190
191
<?xml version="1.0"?>
192
<presence xmlns="urn:ietf:params:xml:ns:pidf" entity="sip:ag@test.sip2sip.info">
193
  <tuple xmlns="urn:ietf:params:xml:ns:pidf" xmlns:agp-pidf="urn:ag-projects:xml:ns:pidf" xmlns:c="urn:ietf:params:xml:ns:pidf:cipid" xmlns:caps="urn:ietf:params:xml:ns:pidf:caps" xmlns:agp-caps="urn:ag-projects:xml:ns:pidf:caps" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" id="SID-f4649f87-1aa3-44ec-ab49-d0464528d706">
194
    <status>
195
      <basic>open</basic>
196
      <agp-pidf:extended>away</agp-pidf:extended>
197
    </status>
198
    <c:display-name>Adrian Georgescu</c:display-name>
199
    <c:map>Netherlands/Haarlem</c:map>
200
    <c:icon>https%3A//xcap.test.sipthor.net/xcap-root/org.openmobilealliance.pres-content/users/sip%3Aag%40test.sip2sip.info/oma_status-icon/index</c:icon>
201
    <c:homepage>http%3A//georgescu.info</c:homepage>
202
    <agp-pidf:device-info id="f4649f87-1aa3-44ec-ab49-d0464528d706">
203
      <agp-pidf:description>imac3-2</agp-pidf:description>
204
      <agp-pidf:user-agent>Blink Pro 2.0.0 (MacOSX)</agp-pidf:user-agent>
205
      <agp-pidf:time-offset>120</agp-pidf:time-offset>
206
    </agp-pidf:device-info>
207
    <caps:servcaps>
208
      <caps:audio>true</caps:audio>
209
      <caps:message>true</caps:message>
210
      <caps:text>true</caps:text>
211
      <agp-caps:file-transfer>true</agp-caps:file-transfer>
212
      <agp-caps:screen-sharing>true</agp-caps:screen-sharing>
213
    </caps:servcaps>
214
    <rpid:user-input idle-threshold="600">active</rpid:user-input>
215
    <dm:deviceID>f4649f87-1aa3-44ec-ab49-d0464528d706</dm:deviceID>
216
    <contact>sip%3Aag%40test.sip2sip.info</contact>
217
    <note/>
218
    <timestamp>2012-09-21T12:53:57.802353+02:00</timestamp>
219
  </tuple>
220
  <dm:person xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" id="PID-5c82e1b170c9aa1a670c4388052657f2">
221
    <rpid:time-offset>120</rpid:time-offset>
222
    <dm:timestamp>2012-09-21T12:53:57.802353+02:00</dm:timestamp>
223
  </dm:person>
224
  <dm:device xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" id="DID-f4649f87-1aa3-44ec-ab49-d0464528d706">
225
    <dm:deviceID>f4649f87-1aa3-44ec-ab49-d0464528d706</dm:deviceID>
226
    <dm:note>Blink Pro 2.0.0 (MacOSX) at imac3-2</dm:note>
227
    <dm:timestamp>2012-09-21T12:53:57.802353+02:00</dm:timestamp>
228
  </dm:device>
229
</presence>
230
</pre>