Telephony/Action

Actions are performed when a call enters the system through a Did, and will usually result in the call reaching an account. There are various action types (property Type) which all have their specific values. “Argument” can be set to different values in specific cases as described below:

  • announce: Will read a Telephony/Audio file to the caller, then move forward to the next action.
  • menu: Will read a Telephony/Audio file to the caller while allowing the user to input any digit (0-9 and *#) and move forward to the number in question. If the user press a non-assigned number the process will move to “invalid”. If the user presses nothing within 10 seconds, will move to “timeout”
  • time_condition: perform a check on current time. The following values can be set in Argument:
    • timezone: for example “Europe/Paris”, the time at which check is performed
    • time: Time condition in the form HH:MM:SS-HH:MM:SS. Seconds are optional. Multiple ranges can be set by either making time an array, or separating values with commas.
    • days_of_week: days in the week during which this condition is valid (any day will be valid if not specified). Comma separated value of mon tue wed thu fri sat sun. For example: “mon,tue,wed,thu,fri”.
  • set_display_name
    • display_name: name to be displayed on the phone when the call arrives
  • group: can be used to forward a call to multiple phones at the same time.
  • redirect
    • target: target phone number (can be a local line) that will receive the call
  • fax: This action will perform fax reception and should not be used on normal calls
  • callback: This will cause a call to the specified url to happen, and depending on the response the call will be affected. See Callback for details on the call. The following Arguments are to be passed:
    • url: url that will be called
    • token: A value that will be passed to the server in X-Auth-Token: HTTP header.
  • container
  • label
  • goto
  • hangup



Callback

Callback allows call to happen to a given URL.

 

Will receive details of the call as POST data, JSON format. “Call” contains details of the call, such as Mode (“incoming”), Caller_Num and Target (target of the call).

 

Response should be a JSON object (Mime type application/json), with at least one value “action” that is one of:

  • “continue”: continue processing call normally
  • “redirect”: redirect call to a provided “extension” number
  • “hangup” call (reason: call_rejected)

 

Example POST data sent to the callback:

{
	"Call":
	{
		"Mode": "incoming",
		"Caller_Num": "+33123456789",
		"Target": "+33923456789",
		"Telephony_Call__": "(call UUID)",
		"Originated": { "unix": 1512717181, … },
		… 
	}
}

Example response to the API:

{
	"Call":
	{
		"Mode": "incoming",
		"Caller_Num": "+33123456789",
		"Target": "+33923456789",
		"Telephony_Call__": "(call UUID)",
		"Originated": { "unix": 1512717181, … },
		… 
	}
}