Xcap pres rules

Version 7 (Adrian Georgescu, 02/23/2009 03:39 pm)

1 5 Adrian Georgescu
== xcap_pres_rules ==
2 1 Adrian Georgescu
3 7 Adrian Georgescu
[[TOC(SipTesting*, sip_*, xcap*,depth=2)]]
4 7 Adrian Georgescu
5 6 Adrian Georgescu
To use this script you must to have a valid [wiki:SipConfiguration configuration file].
6 1 Adrian Georgescu
7 5 Adrian Georgescu
=== Description ===
8 1 Adrian Georgescu
9 1 Adrian Georgescu
{{{
10 1 Adrian Georgescu
adigeo@ag-imac3:~/work/pypjua/scripts$./xcap_pres_rules.py -h
11 1 Adrian Georgescu
Usage: xcap_pres_rules.py [options]
12 1 Adrian Georgescu
13 1 Adrian Georgescu
This example script will use the specified SIP account to manage presence
14 1 Adrian Georgescu
rules via XCAP. The program will quit when CTRL+D is pressed.
15 1 Adrian Georgescu
16 1 Adrian Georgescu
Options:
17 1 Adrian Georgescu
  -h, --help            show this help message and exit
18 1 Adrian Georgescu
  -a NAME, --account-name=NAME
19 1 Adrian Georgescu
                        The account name from which to read account settings.
20 1 Adrian Georgescu
                        Corresponds to section Account_NAME in the
21 1 Adrian Georgescu
                        configuration file. If not supplied, the section
22 1 Adrian Georgescu
                        Account will be read.
23 1 Adrian Georgescu
  --sip-address=SIP_ADDRESS
24 1 Adrian Georgescu
                        SIP address of the user in the form user@domain
25 1 Adrian Georgescu
  -p PASSWORD, --password=PASSWORD
26 1 Adrian Georgescu
                        Password to use to authenticate the local account.
27 1 Adrian Georgescu
                        This overrides the setting from the config file.
28 1 Adrian Georgescu
  -n DISPLAY_NAME, --display-name=DISPLAY_NAME
29 1 Adrian Georgescu
                        Display name to use for the local account. This
30 1 Adrian Georgescu
                        overrides the setting from the config file.
31 1 Adrian Georgescu
  -x XCAP_ROOT, --xcap-root=XCAP_ROOT
32 1 Adrian Georgescu
                        The XCAP root to use to access the pres-rules document
33 1 Adrian Georgescu
                        for authorizing subscriptions to presence.
34 1 Adrian Georgescu
}}}
35 2 Adrian Georgescu
36 5 Adrian Georgescu
=== Example ===
37 2 Adrian Georgescu
38 2 Adrian Georgescu
{{{
39 5 Adrian Georgescu
ag-oxygen:~ adigeo$ xcap_pres_rules 
40 2 Adrian Georgescu
Accounts available: 'alice', 'ew', 'gert', 'mrg', 'tf', 'umts', 'unet', default
41 2 Adrian Georgescu
Using default account: 31208005169@ag-projects.com
42 2 Adrian Georgescu
Retrieving current presence rules from https://xcap.sipthor.net/xcap-root/
43 2 Adrian Georgescu
Allowed watchers:
44 2 Adrian Georgescu
	2233350608@sip2sip.info
45 2 Adrian Georgescu
	31208005163@ag-projects.com
46 2 Adrian Georgescu
	31208005166@ag-projects.com
47 2 Adrian Georgescu
	31208005167@ag-projects.com
48 2 Adrian Georgescu
	adi@umts.ro
49 2 Adrian Georgescu
	alice@example.com
50 2 Adrian Georgescu
	317105169@eurovoice.ro
51 2 Adrian Georgescu
	bob@example.com
52 2 Adrian Georgescu
Blocked watchers:
53 2 Adrian Georgescu
	test1@merge.net.nl
54 2 Adrian Georgescu
Polite-blocked watchers:
55 3 Adrian Georgescu
Press (a) to allow, (d) to deny, (p) to politely block a new watcher or (r) to remove a watcher from the rules. 
56 3 Adrian Georgescu
(s) will show the presence rules xml.
57 2 Adrian Georgescu
a
58 2 Adrian Georgescu
watcher> abc@example.com
59 2 Adrian Georgescu
Watcher sip:abc@example.com is now authorized
60 2 Adrian Georgescu
}}}