XCAP RLS services

Version 7 (Adrian Georgescu, 03/12/2009 08:09 pm)

1 2 Adrian Georgescu
== xcap_rls_services ==
2 2 Adrian Georgescu
3 6 Adrian Georgescu
[[TOC(SipTesting*, sip_*, xcap*,depth=2)]]
4 6 Adrian Georgescu
5 7 Adrian Georgescu
To use this script you must to have a valid [wiki:SipSettingsAPI configuration].
6 2 Adrian Georgescu
7 2 Adrian Georgescu
=== Description ===
8 2 Adrian Georgescu
9 3 Adrian Georgescu
This script adds and removed buddies in the RLS services XCAP document. Can be used to prepare the buddy list prior to execute [source:scripts/sip_subscribe_rls.py scripts/sip_subscribe_rls.py] script. 
10 2 Adrian Georgescu
11 2 Adrian Georgescu
Source code: [source:scripts/xcap_rls_services.py scripts/xcap_rls_services.py]
12 2 Adrian Georgescu
13 2 Adrian Georgescu
{{{
14 2 Adrian Georgescu
adigeo@ag-oxygen:~$xcap_rls_services -h
15 2 Adrian Georgescu
Usage: xcap_rls_services [options] [service URI]
16 2 Adrian Georgescu
17 2 Adrian Georgescu
This example script will use the specified SIP account to manage rls services
18 2 Adrian Georgescu
via XCAP. The program will quit when CTRL+D is pressed. You can specify the
19 2 Adrian Georgescu
service URI as an argument (if domain name is not specified, the user's domain
20 2 Adrian Georgescu
name will be used). If it is not specified, it defaults to username-
21 2 Adrian Georgescu
buddies@domain.
22 2 Adrian Georgescu
23 2 Adrian Georgescu
Options:
24 2 Adrian Georgescu
  -h, --help            show this help message and exit
25 2 Adrian Georgescu
  -a NAME, --account-name=NAME
26 2 Adrian Georgescu
                        The account name from which to read account settings.
27 2 Adrian Georgescu
                        Corresponds to section Account_NAME in the
28 2 Adrian Georgescu
                        configuration file. If not supplied, the section
29 2 Adrian Georgescu
                        Account will be read.
30 2 Adrian Georgescu
  --sip-address=SIP_ADDRESS
31 2 Adrian Georgescu
                        SIP address of the user in the form user@domain
32 2 Adrian Georgescu
  -p PASSWORD, --password=PASSWORD
33 2 Adrian Georgescu
                        Password to use to authenticate the local account.
34 2 Adrian Georgescu
                        This overrides the setting from the config file.
35 2 Adrian Georgescu
  -x XCAP_ROOT, --xcap-root=XCAP_ROOT
36 2 Adrian Georgescu
                        The XCAP root to use to access the rls-services
37 2 Adrian Georgescu
                        document to manage.
38 2 Adrian Georgescu
  -s, --show-xml        Show the RLS services XML whenever it is changed and
39 2 Adrian Georgescu
                        at start-up.
40 2 Adrian Georgescu
}}}
41 4 Adrian Georgescu
42 4 Adrian Georgescu
=== Example ===
43 4 Adrian Georgescu
{{{
44 4 Adrian Georgescu
adigeo@ag-imac3:~$xcap_rls_services 
45 4 Adrian Georgescu
Accounts available: 'alice', 'bob', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'umts_test', 'unet', 'unet_test', default
46 4 Adrian Georgescu
Using default account: 31208005169@ag-projects.com
47 4 Adrian Georgescu
Retrieving current RLS services from https://xcap.sipthor.net/xcap-root/
48 4 Adrian Georgescu
Managing service URI sip:31208005169-buddies@ag-projects.com
49 4 Adrian Georgescu
50 4 Adrian Georgescu
Buddies:
51 4 Adrian Georgescu
	adi@umts.ro
52 4 Adrian Georgescu
Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.
53 4 Adrian Georgescu
new buddy> alice@example.com
54 4 Adrian Georgescu
55 4 Adrian Georgescu
Buddy sip:alice@example.com has been added
56 4 Adrian Georgescu
57 4 Adrian Georgescu
Buddies:
58 4 Adrian Georgescu
	adi@umts.ro
59 4 Adrian Georgescu
	alice@example.com
60 4 Adrian Georgescu
Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.
61 4 Adrian Georgescu
new buddy> bob@example.com
62 4 Adrian Georgescu
63 4 Adrian Georgescu
Buddy sip:bob@example.com has been added
64 4 Adrian Georgescu
65 4 Adrian Georgescu
Buddies:
66 4 Adrian Georgescu
	adi@umts.ro
67 4 Adrian Georgescu
	alice@example.com
68 4 Adrian Georgescu
	bob@example.com
69 4 Adrian Georgescu
Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.
70 4 Adrian Georgescu
RLS services document:
71 4 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
72 4 Adrian Georgescu
<rls-services xmlns:rl="urn:ietf:params:xml:ns:resource-lists" xmlns="urn:ietf:params:xml:ns:rls-services">
73 4 Adrian Georgescu
  <service uri="sip:31208005169-buddies@ag-projects.com">
74 4 Adrian Georgescu
    <list>
75 4 Adrian Georgescu
      <rl:entry uri="sip:adi@umts.ro"/>
76 4 Adrian Georgescu
      <rl:entry uri="sip:alice@example.com"/>
77 4 Adrian Georgescu
      <rl:entry uri="sip:bob@example.com"/>
78 4 Adrian Georgescu
    </list>
79 4 Adrian Georgescu
    <packages>
80 4 Adrian Georgescu
      <package>presence</package>
81 4 Adrian Georgescu
    </packages>
82 4 Adrian Georgescu
  </service>
83 4 Adrian Georgescu
</rls-services>
84 4 Adrian Georgescu
85 4 Adrian Georgescu
86 4 Adrian Georgescu
Buddies:
87 4 Adrian Georgescu
	adi@umts.ro
88 4 Adrian Georgescu
	alice@example.com
89 4 Adrian Georgescu
	bob@example.com
90 4 Adrian Georgescu
Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.
91 4 Adrian Georgescu
92 4 Adrian Georgescu
}}}