XCAP RLS services

Version 7 (Adrian Georgescu, 03/12/2009 08:09 pm) → Version 8/12 (Adrian Georgescu, 03/31/2009 03:10 pm)

== xcap_rls_services ==

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

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

=== Description ===

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.

Source code: [source:scripts/xcap_rls_services.py scripts/xcap_rls_services.py]

{{{
adigeo@ag-imac3:~$xcap_rls_services adigeo@ag-oxygen:~$xcap_rls_services -h
Usage: xcap_rls_services [options] [service URI]

This example script will use the specified SIP account to manage rls services
via XCAP. The program will quit when CTRL+D is pressed. You can specify the
service URI as an argument (if domain name is not specified, the user's domain
name will be used). If it is not specified, it defaults to username-
buddies@domain.

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.

-x XCAP_ROOT, --xcap-root=XCAP_ROOT
The XCAP root to use to access the rls-services
document to manage.
-s, --show-xml Show the presence rules RLS services XML whenever it is changed and
at start-up.


}}}

=== Example ===
{{{
adigeo@ag-imac3:~$xcap_rls_services

Accounts available: 'alice', 'bob', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'umts_test', 'unet', 'unet_test', default
Using default account: 31208005169@ag-projects.com
Retrieving current RLS services from https://xcap.sipthor.net/xcap-root/
Managing service URI sip:31208005169-buddies@ag-projects.com

Buddies:
adi@umts.ro
Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.
new buddy> alice@example.com

Buddy sip:alice@example.com has been added

Buddies:

alice@ag-projects.com adi@umts.ro
alice@example.com

Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.
new buddy> bob@example.com

Buddy sip:bob@example.com has been added

Buddies:
adi@umts.ro
alice@example.com
bob@example.com
Press (a) to add or (r) to remove a buddy. (s) will show the
RLS services xml. (d) will delete the currently selected service.
RLS services
document:
<?xml version='1.0' encoding='UTF-8'?>
<rls-services xmlns:rl="urn:ietf:params:xml:ns:resource-lists" xmlns="urn:ietf:params:xml:ns:rls-services">
<service uri="sip:31208005169-buddies@ag-projects.com">
<list>
<rl:entry uri="sip:adi@umts.ro"/>
<rl:entry uri="sip:alice@ag-projects.com"/> uri="sip:alice@example.com"/>
<rl:entry uri="sip:bob@example.com"/>

</list>
<packages>
<package>presence</package>
</packages>
</service>
</rls-services>

Buddies:
adi@umts.ro
alice@ag-projects.com alice@example.com
bob@example.com

Press (a) to add or (r) to remove a buddy. (s) will show the RLS services xml. (d) will delete the currently selected service.



}}}