Call Us Today! 877.742.2583




Page tree
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

Version 1 Next »

About

mod_abstraction links a new API function to another using a regular expression parser to adapt the provided arguments. It allows for simplified, standardized script replacement API.

Usage

This defines what API link should be created and what to do once executed.

<api name="user_name" description="Return Name for extension" syntax="<exten>" parse="(.*)" destination="user_data" argument="$1@default var effective_caller_id_name"/>

name - API name

description - API description

syntax - API Syntax

parse - Regex parsing the original argument provided

destination - The API name of the final api execution

argument - Format for the argument sent to the final API. You can use $1 $2 $3... from the () result of the parse regex

Security

With mod_event_socket per-user API restriction, this can be useful to limit the capabilities a user can have over some API commands by restricting certain parameters a user can do.

Notes

You MUST reload mod_abstraction when changing the XML to add or remove an API, or else they won't be created or removed. Destination settings and parsing can be changed in real time.

Examples

Here are 2 examples:

tts_path(<text>) could be rewritten to python(tts2wav <text>)

user_password(<id>) could be rewritten to user_data(<id> param password)

 

  • No labels