Xcap pres rules

Version 8 (Adrian Georgescu, 03/14/2009 09:55 am) → Version 9/12 (Adrian Georgescu, 03/31/2009 03:09 pm)

== xcap_pres_rules ==

[[TOC(SipTesting*, sip_*, xcap*,depth=2)]]

To use this script you must to have a valid [wiki:SipSettingsAPI configuration].

=== Description ===

{{{
adigeo@ag-imac3:~$xcap_pres_rules adigeo@ag-imac3:~/work/pypjua/scripts$./xcap_pres_rules.py -h
Usage: xcap_pres_rules xcap_pres_rules.py [options]

This example script will use the specified SIP account to manage presence
rules via XCAP. The program will quit when CTRL+D is pressed.

Options:
-h, --help show this help message and exit
-a ACCOUNT_NAME, --account-name=ACCOUNT_NAME NAME, --account-name=NAME
The account name from which to read account settings.
Corresponds to section Account_NAME in the
configuration file. If not supplied, the section
Account will be read.
--sip-address=SIP_ADDRESS
SIP address
of the account user in the form user@domain
-p PASSWORD, --password=PASSWORD
Password
to use. use to authenticate the local account.
This overrides the setting from the config file.

-s, --show-xml Show -n DISPLAY_NAME, --display-name=DISPLAY_NAME
Display name to use for
the presence rules XML whenever it is changed and local account. This
at start-up. overrides the setting from the config file.
-x XCAP_ROOT, --xcap-root=XCAP_ROOT
The XCAP root to use to access the pres-rules document
for authorizing subscriptions to presence.

}}}

=== Example ===

{{{
adigeo@ag-imac3:~$xcap_pres_rules ag-oxygen:~ adigeo$ xcap_pres_rules
Accounts available: 'alice', 'ew', 'gert', 'mrg', 'tf', 'umts', 'unet', default
Using default account: 31208005169@ag-projects.com

Retrieving current presence rules from https://xcap.sipthor.net/xcap-root/
Allowed watchers:
2233350608@sip2sip.info
31208005163@ag-projects.com
31208005166@ag-projects.com
31208005167@ag-projects.com
adi@umts.ro
alice@example.com
317105169@eurovoice.ro
bob@example.com
Blocked watchers:
test1@merge.net.nl
Polite-blocked watchers:
Press (a) to allow, (d) to deny, (p) to politely block a new watcher or (r) to remove a watcher from the rules.
(s) will show the presence rules xml.
a
watcher> abc@example.com
Watcher sip:abc@example.com is now authorized
}}}