Project

General

Profile

XCAP RLS services » History » Version 5

Adrian Georgescu, 01/10/2009 11:40 AM

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