API Interface

API Interface

This usage mode allows for the module actions to be performed ad hoc via the API interface, for example through the FreeSWITCH console, the Event Socket Library or from other modules (through switch_api_execute() calls etc.). Since the actions are executed outside of the scope of the channel, the phone number input will always be explicit. The syntax is as follows:

phonenumber <action(s)> <number> [parameter(s)]
  • actions - one or more (comma separated) actions to be executed;
  • number - phone number the actions will be executed against;
  • parameters - one or more (comma separated) parameters the actions will have to observe. When omitted, default values will be inferred from module’s configuration;

The result will be returned in the order of actions execution, for example:

freeswitch@test> phonenumber get_region_code,format,get_description_for_number 02076792000 default_region=GB,format=NATIONAL

GB
020 7679 2000
London