XCAP API

Table of Contents

  1. Description
    1. Background
    2. Features
    3. Documentation
    4. Support
    5. Authors
    6. Acknowledgments
  2. Audio device sharing on Linux
    1. Using dmix and dsnoop ALSA plugins
    2. Using PulseAudio
  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. AudioMixer
      20. MixerPort
      21. WaveFile
      22. RecordingWaveFile
      23. ToneGenerator
  6. Developer Guide
    1. Prerequisites
    2. Integration with other applications or libraries
      1. Sample Code
    3. Low Level API
  7. Features
    1. General Features
    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 Stable Version
    3. Tar Archives
    4. Debian Packages
      1. Debian Unstable (Sid)
      2. Debian Stable (Lenny)
      3. Ubuntu Karmic (9.10)
      4. Ubuntu Lucid (10.04)
    5. Version Control Repository
      1. SIP SIMPLE client SDK
      2. Command Line Tools
    6. Building Instructions
    7. Audio Device Sharing
    8. Testing
  9. MSRP API
    1. URI
    2. MSRPRelaySettings
    3. ConnectorDirect
    4. ConnectorRelay
    5. AcceptorDirect
    6. AcceptorRelay
    7. MSRPTransport
    8. MSRPData
    9. OutgoingFile
    10. MSRPSession
    11. MSRPServer
    12. 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
    13. Logging
    14. ACM
    15. Examples
      1. Creating an outbound connection
      2. Waiting for an inbound connection
  10. Middleware API
    1. SIPApplication
    2. 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
    3. Address Resolution
      1. DNS Lookup
      2. Route
    4. SIP Accounts
      1. AccountManager
      2. Account
      3. BonjourAccount
    5. Audio
      1. IAudioPort
      2. AudioDevice
      3. AudioBridge
      4. WavePlayer
      5. WaveRecorder
    6. Conference
      1. AudioConference
  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
    1. Sample Code
  13. Support
    1. Contributing
  14. Testing
    1. Configuration
    2. Accounts
    3. Register
    4. Audio
    5. Instant Messaging
    6. Presence
  15. Uninstall guide
    1. Clean Build Directory
    2. Manual Removal
    3. Debian Package
  16. 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)