XCAP API

Table of Contents

  1. Description
    1. Background
    2. License
    3. Features
    4. Documentation
    5. Support
    6. Authors
    7. Acknowledgments
  2. Audio device sharing on Linux
    1. The Linux audio jungle
    2. Using dmix and dsnoop ALSA plugins
    3. Using PulseAudio
    4. Using PulseAudio with KDE
    5. Changing Devices fail
  3. Configuration API
    1. Architecture
      1. ConfigurationManager
      2. SettingsObject
      3. Setting
      4. SettingsGroup
      5. SettingsObjectExtension
      6. Backend API
    2. Middleware Settings
      1. General
      2. Account
      3. BonjourAccount
    3. SIPClients Settings
      1. General
      2. Account
      3. BonjourAccount
  4. Contributions
  5. SIP Core API
    1. Introduction
    2. PJSIP library
    3. Architecture
    4. Integration
    5. Components
      1. Engine
      2. SIPURI
      3. Credentials
      4. Invitation
      5. SDPSession
      6. SDPMediaStream
      7. SDPConnection
      8. SDPAttributeList
      9. SDPAttribute
      10. RTPTransport
      11. AudioTransport
      12. Request
      13. IncomingRequest
      14. Message
      15. Registration
      16. Publication
      17. Subscription
      18. IncomingSubscription
      19. Referral
      20. IncomingReferral
      21. AudioMixer
      22. MixerPort
      23. WaveFile
      24. RecordingWaveFile
      25. ToneGenerator
  6. SIP SIMPLE SDK Integration Guide
    1. Current Status
    2. Installation Instructions
    3. API Documentation
    4. Usage Instructions
      1. Deployment Scenarios
    5. Sample Code
      1. Hello World Program
      2. Full Demo Programs
      3. Finished Products
    6. Non-Python environments
      1. Cocoa Objective C
      2. Qt Framework
      3. Web Browser Plugin
      4. C Language
      5. Java Language
      6. Translating into other languages
  7. Features
    1. General
    2. Implemented Standards
      1. SIP Signaling
      2. Address Resolution
      3. NAT Traversal
      4. Voice over IP
      5. Instant Messaging
      6. Desktop Sharing
      7. Conferencing
      8. Presence
  8. Installation
    1. Prerequisites
    2. Current Version
    3. Tar Archives
    4. Debian Packages
      1. Debian Stable (Squeeze)
      2. Debian Unstable (Sid)
      3. Ubuntu Lucid (10.04)
      4. Ubuntu Maverick (10.10)
      5. Ubuntu Natty (11.04)
      6. Ubuntu Oneiric (11.10)
    5. Version Control Repository
      1. SIP SIMPLE client SDK
      2. Command Line Tools
    6. Dependencies
    7. Building Instructions
    8. Audio Device Sharing
    9. Testing
  9. MSRP API
    1. URI
    2. MSRPRelaySettings
    3. ConnectorDirect
    4. AcceptorDirect
    5. RelayConnection
    6. MSRPTransport
    7. MSRPData
    8. OutgoingFile
    9. MSRPSession
    10. MSRPServer
    11. Headers
      1. ToPathHeader
      2. FromPathHeader
      3. MessageIDHeader
      4. SuccessReportHeader
      5. FailureReportHeader
      6. ByteRangeHeader
      7. StatusHeader
      8. ExpiresHeader
      9. MinExpiresHeader
      10. MaxExpiresHeader
      11. UsePathHeader
      12. WWWAuthenticateHeader
      13. AuthorizationHeader
      14. AuthenticationInfoHeader
      15. ContentTypeHeader
      16. ContentIDHeader
      17. ContentDescriptionHeader
      18. ContentDispositionHeader
    12. Logging
    13. Examples
      1. Creating an outbound connection
      2. Waiting for an inbound connection
  10. Middleware API
    1. SIPApplication
    2. Storage API
      1. API Definition
      2. Provided implementations
    3. SIP Sessions
      1. SessionManager
      2. Session
      3. IMediaStream
      4. MediaStreamRegistry
      5. MediaStreamRegistrar
      6. AudioStream
      7. MSRPStreamBase
      8. ChatStream
      9. FileSelector
      10. FileTransferStream
      11. IDesktopSharingHandler
      12. InternalVNCViewerHandler
      13. InternalVNCServerHandler
      14. ExternalVNCViewerHandler
      15. ExternalVNCServerHandler
      16. DesktopSharingStream
      17. ConferenceHandler
    4. Address Resolution
      1. DNS Manager
      2. DNS Lookup
      3. Route
    5. SIP Accounts
      1. AccountManager
      2. Account
      3. BonjourAccount
    6. Audio
      1. IAudioPort
      2. AudioDevice
      3. AudioBridge
      4. WavePlayer
      5. WaveRecorder
    7. Conference
      1. AudioConference
    8. XCAP support
      1. Contact
      2. Service
      3. Policy
      4. CatchAllCondition
      5. DomainCondition
      6. DomainException
      7. UserException
      8. PresencePolicy
      9. DialoginfoPolicy
      10. Icon
      11. OfflineStatus
      12. XCAPManager
  11. Payloads API
    1. Common Policy
      1. Example
    2. Pres-rules
      1. Example
    3. Resource Lists
      1. Generation
      2. Parsing
    4. RLS Services
      1. Generation
    5. Presence Data Model
      1. Example
    6. Rich Presence Extension
    7. Watcher-info
      1. Example
    8. XCAP-diff
    9. Is-composing
    10. Message Summary
    11. User Agent Capability
    12. CIPID
    13. Conference
    14. Dialog Info
  12. Status
    1. Roadmap
    2. Progress Timeline
  13. Projects using SIP SIMPLE Client SDK
    1. Sample Code
  14. Device Management
    1. GetDevices
    2. SetDevice
  15. Account Management
    1. AddAccount
    2. DeleteAccount
    3. UpdateAccount
    4. GetAccounts
  16. Sessions
    1. Outgoing Session
    2. Incoming Session
    3. Notifications
  17. Support
    1. Contributing
  18. Testing
    1. Configuration
    2. Accounts
    3. Register
    4. Audio
    5. Instant Messaging
    6. Presence
  19. Uninstall guide
    1. Clean Build Directory
    2. Manual Removal
    3. Debian Package
  20. XCAP API
    1. Components
    2. Usage

XCAP protocol allows a client to read, write, and modify application configuration data stored in XML format on a server. XCAP maps XML document sub-trees and element attributes to HTTP URIs, so that these components can be directly accessed by clients using HTTP protocol. An XCAP server is used by XCAP clients to store data like buddy lists and presence policy in combination with a SIP Presence server that supports PUBLISH, SUBSCRIBE and NOTIFY methods to provide a complete SIP SIMPLE solution.

XCAP client is implemented by  python-xcaplib. The library provides xcaplib.client.XCAPClient class which is an HTTP client with an interface better suited for XCAP servers. The library also provides a version of XCAPClient (xcaplib.green.XCAPClient) built on top of eventlet, which may be used in twisted reactor.

Components

get(self, application, node=None, etag=None, headers=None)
Make an HTTP GET request to the resource identified by application and node. Return a Resource instance on success. Raise HTTPError if the operation was unsuccessful.
put(self, application, resource, node=None, etag=None, headers=None)
Make an HTTP PUT request to the resource identified by application and node. Use resource as a request body. Raise HTTPError is the operation was unsuccessful.
delete(self, application, node=None, etag=None, headers=None)
Make an HTTP DELETE request to the resource identified by application and node. Raise HTTPError if the operation was unsuccessful.

Usage

client = XCAPClient(xcap_root, xcap_user_id, password=password)
document = file('examples/resource-lists.xml').read()

# put the document on the server
client.put('resource-lists', document)

# read the document from the server
got = client.get('resource-lists')

# get a specific element within a document
element = client.get('resource-lists', '/resource-lists/list/entry/display-name')

# get an attribute:
res = client.get('resource-lists', '/resource-lists/list/entry/@uri')

# replace an element conditionally, based on the etag
client.put('resource-lists', '<entry uri="sip:bob@example.com"><display-name>The Bob</display-name></entry>',
           '/resource-lists/list/entry[@uri="sip:bob@example.com"]', etag=stored_etag)

# delete an element
client.delete('resource-lists', node_selector, etag=res.etag)