How do third party module developersexposetheir resources via asterisk ARI?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Oct 17, 2013, at 11:01 AM, David M. Lee <dlee at digium.com> wrote:

> 
> On Oct 17, 2013, at 9:29 AM, Paul Albrecht <palbrecht at glccom.com> wrote:
> 
>> Is the ARI extendible as are other asterisk user interfaces like the CLI and AMI. That's the question. If not, why not?
> 
> 
> Sort of. It's designed to be modular and allow for extension, but it's not great for external module developers yet.
> 
> The current process is:
> 
> 1. Write a new API declaration (rest-api/api-docs/fizzbin.json)
> 2. Add your declaration to the master list (rest-api/resources.json)
> 3. Run 'make ari-stubs'
> 
> This will generate several files.
> * res/res_ari_fizzbin.c - Boiler plate code for parsing HTTP request, validating responses, etc.
> * res/ari/resource_fizzbin.h - Boiler plate header file
> * res/ari/resource_fizzbin.c - Implementation stubs
> 
> It will also update res/ari/ari_model_validators.h and res/ari/ari_model_validators.c with validators for your data models.
> 
> The res/ari/resource_fizzbin.c is the only one you modify. This is where you would implement your RESTful API.
> 
> I have a short list (in my head) of the changes that would be necessary to enable external ARI modules.
> 
> * Allow make_ari_stubs.py to be run against a single API declaration
>   * In this case, model generators should be embedded in the module, instead of being put in res_ari_model.c
> * Embed the API declaration in the generated res/res_ari_fizzbin.c
> * Serve /ari/api-docs out of the modules instead of from the filesystem
> * Build /ari/api-docs/resource.json dynamically from what's loaded instead of from the filesystem
> 

Thanks for the info. Maybe it should be in the wiki. That said, I would expect an interface to register/unregister resource. Also, changing a resource shouldn't require recompiling asterisk.

> -- 
> David M. Lee
> Digium, Inc. | Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> Check us out at:  www.digium.com  & www.asterisk.org
> 
> 
> _______________________________________________
> asterisk-app-dev mailing list
> asterisk-app-dev at lists.digium.com
> http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev




[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux