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 3 Next »

Asterisk Client Library Generator

Generator for client libraries for Asterisk's REST API which is provided by res_http_stasis.

Languages

  • Python
  • JavaScript
  • Perl
  • format such that additional language support is not difficult.

Name For Python Library

Suggestions have included the following. Still open for debate. Erin wishes we could use the same name for libraries written in multiple languages.

  • AsteriskPy
  • AsterPy, AstraPy
  • AsteRESTpy
  • PAsteREST
  • AsteREST

Library structure

  • Top-level library or object or structure
    • Asterisk.get_info()
    • Endpoints.get_endpoints()
    • Channels.get_channels()
    • Bridges.get_bridges()
    • Recordings.get_recordings()
    • Endpoint.get_endpoint(id)
    • Channel.get_channel(id)
    • Bridges.get_bridge(id)
    • Recordings.get_recording(id)
    • add_event_handler(event_name, function)
    • remove_event_handler(event_name, function)
  • Each object in the Swagger resource files
    • Methods listed therein
    • Relevant object attribute getters
    • add_event_handler(event_name, function)
    • remove_event_handler(event_name, function)

Events/messages/callbacks/pub-sub

  • Methods that can should return an object
  • Methods that can't return an object but finish synchronously should return true/false.
  • Methods that can't finish synchronously should have a topic to which subscriptions could be made
    • Should these functions accept an optional function and perform the subscribe internally? This would save the developer from having to remember method->topic relationships. Sort of self-documenting code.

Project location and directory structure

This project is located on GitHub. Inside asterisk_rest_libraries

  • No labels