Call Us Today! 877.742.2583




Page tree
Skip to end of metadata
Go to start of metadata

About

This module provides an HTTP based Telephony API using a standard FreeSWITCH application interface as well as a cached http file format interface.

 Click here to expand Table of Contents

Usage

The file format plugin can be used like this:

 

This syntax is valid anywhere a filename parameter is requested in FreeSWITCH. If your URL contains query parameters (after a "?"), use

 

The available parameters are: file, profile, method, name.


The application is called like this:

 

The target url is expected to be a CGI returning text/xml using the documentation below.

The format is roughly as described below (We could use a DTD maybe).

 

The profile name must be chosen to bind to a preset series of settings and permissions to use as a basis for the client session. It's chosen from the specified params or from the channel variable using the keyname 'httapi_profile' and if not specified will default to 'default' Any params specified in the initial data of the application encased in curly braces {} will be parsed into the initial parameters similar to originate. These params remain set until the call ends and are supplied as form elements on each hit to the HTTP server. If the permissions allow, a <params> tag is parsed from the resulting document and set into this data set and will be mirrored back on subsequent http posts. Also, if the permissions allow, a <variables> tag is parsed the same way to set channel variables. The <work> tag is required and contains one or more of the supported command tags that generally manipulate the call behavior. The application will continue to do the task in the work section until an error is encountered or when an action from the work tag warrants it. If the session exits the httapi app without hanging up it can do other tasks and make another call to httapi and the session data will remain preserved.

Example

 


Note that the value from bind strip is returned to the same page as the parameter exten (taken from name in playback).

Binding

Several of the work tags that indicate they support bindings can contain one or more bind tags that function in similar fashion to bind_digit_action

 

NOTE : Srigg reported that multiple <bind strip> tags are needed when you want it to post digits after the timeout expired (in fact, as many tags as the quantity of digits expected)

Work Tag


Configuration


Answer and Early Media

When to answer

You don't need to answer the call in the dialplan before calling into httapi. These both extensions below will make httapi requests to my application:

You can play back sounds or 'say' something without explicitly 'answering' the call. But the call is early media only and in this state you won't be able to collect dtmf, for example. If you want to interact with the call you have to answer then since early media is an intermediate state and doesn't mean the call will stay alive for much long.

Answering calls

You can answer the call with <application name="answer"/> but by default there's no permission to run the 'answer' application from httapi script so you need to enable it in httapi.conf.xml.