Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Existing Services

Phonebook

Here is an example of how to print the content of a phonebook named sales to stdout in CSV format

curl --insecure --basic -u superadmin [https://]{host}:8443/sipxconfig/rest/phonebook/sales

Placing calls

To test the service with curl use:

curl --insecure -X PUT [https://]{user}:{password}@{host}:8443/sipxconfig/rest/call/{number}

HTTP PUT to service URL will cause sipXconfig to place call to {number}.
The calls is placed using authorized user credentials. It works in the same way as click-to-call available on the user portal. User's phone rings first and, once someone answers, it places the call to {number}.

Version|4.2

New Services

General URL structure

Common prefix:

https://host.example.com:8443/sipxconfig/rest

Note: how to see inside the SSL with Wireshark is described here SipX_ConfigServer_Troubleshooting#Using_Wireshark_to_see_inside_the_box

Admin services

Accessible for users with admin priviledges:

/phonebook - GET, POST
/phonebook/{name} - GET, PUT, DELETE
/phone - POST
/auto-attendant/specialmode - GET
/auto-attendant/specialmode/{attendant} - PUT, DELETE

User services

Accessible for all users:

URI

Methods

Formats

/my/call/{to}
/call/{to}

PUT

Initiates the call from the user to {to} address.PUT method requires non empty body which is ignored.Supported as GET for clients that do not handle PUT.

/my/voicemail/pin/{pin}

PUT

changes user voicemail PIN

/my/forward

GET
PUT

retrieves (GET) or changes (PUT) user call forwardingXML,JSON

/my/feed/voicemail/{folder}

GET

voicemail folder presented as RSS feed

/my/phonebook

GET

JSON, XMLphonebook representation

/my/phonebook/entry/{entryId}

GET
PUT
DELETE

retrieves (GET), changes (PUT) and deletes (DELETE) entries in private phonebookXMLJSON

/my/contact-information

GET
PUT

retrieve and change contact info for the userXML,JSON

/my/search/phonebook?query={search-term}

GET

searching user phonebookXML

/my/mailbox/{user}/preferences/activegreeting
/my/mailbox/{user}/preferences/activegreeting/{greeting}

GET
PUT

retrieves and sets active greeting setting for a specific user
GET: XML, plain text (one of none, standard, outofoffice, extendedabsence)
PUT: plain text (one of none, standard, outofoffice, extendedabsence); an error 500 will be returned if the greeting is not one of the 4 strings

Adding new Services

sipXconfig used the RESTlet API to add RESTful services

Please note, due to a bug in RESTlet, it requires HTTP PUT request must have a body. You can add space, or anything to the body
to workaround it.

Service design

  • Identify resouces and design the resource structure
  • Determine which operations (GET, PUT, POST, DELETE) will be available for which resources
  • Map resources into URI structure
  • Determine representation for each resource (specific format XML/JSON)

Service implementation

  • Implement resources
  • :Each resource is an instance of restlet Resource class. Every RESTful function is mapped into one or more Resource methods. For example GET method is implemented by Resource.represent
  • :Resource instances are managed by Spring. You can inject any context or manager that is necessary to perform service operations. For example phonebook service delegates bulk of the work to PhonebookManager.
  • Write unit test for resource and representation
  • :Use mock objects to verify if injected managers' are used in expected way (for example does _POST really calls _save'' method with expected parameters?).
  • :For resources verify XML/JSON representation generation and parsing.
  • Implement representations
  • :sipXconfig services intended to be used pragmatically should at the minimum support XML and JSON representations. Read-only services marshal sipXconfig domain objects into representation.
  • Write service system tests
  • :Those are external tests written in Java/Ruby/Python that excersise the service. They are similar to UI tests.

Future Services

User ('my') services (those are services needed to implement functionality available through current user portal)

  • account - pin, voicemail e-mail,
  • voicemail - list, remove, delete, marked as saved
  • call list
  • speed dial
  • personal phonebook (initially read only - configured by administrator, later also should allow adding/syncing from other phonebook sources)
  • device/phones - monitoring registered devices
  • conference - monitoring, muting, isolating, inviting, initiating
  • personal attendant

Admin services:

  • users adding/removing/listing
  • phones adding/removing/configuring
  • lines (users-phones) associations - adding/removing/configuring

New developer services:

  • New or rewrite existing services implemented on TestPage.java
  • Phonebook for end user (would require changing acegi security configuration)

If you are thinking about implementing an external application interacting with sipXecs and you need a new service ask on the sipx-dev list.

  • No labels