Welcome to jade’s manual!¶
Contents:
Glossary¶
Terms¶
- Timestamp
Requirement levels indicator¶
This document strives to adhere to RFC 2119. In particular should be noted tat:
MUST This word, or the terms “REQUIRED” or “SHALL”, mean that the definition is an absolute requirement of the specification.
MUST NOT This phrase, or the phrase “SHALL NOT”, mean that the definition is an absolute prohibition of the specification.
SHOULD This word, or the adjective “RECOMMENDED”, mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
SHOULD NOT This phrase, or the phrase “NOT RECOMMENDED” mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.
MAY This word, or the adjective “OPTIONAL”, mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option MUST be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality. In the same vein an implementation which does include a particular option MUST be prepared to interoperate with another implementation which does not include the option (except, of course, for the feature the option provides.)
Guidance in the use of these Imperatives
Imperatives of the type defined in this memo must be used with care and sparingly. In particular, they MUST only be used where it is actually required for interoperation or to limit behavior which has potential for causing harm (e.g., limiting retransmisssions) For example, they must not be used to try to impose a particular method on implementors where the method is not required for interoperability.
Security Considerations
These terms are frequently used to specify behavior with security implications. The effects on security of not implementing a MUST or SHOULD, or doing something the specification says MUST NOT or SHOULD NOT be done may be very subtle. Document authors should take the time to elaborate the security implications of not following recommendations or requirements as most implementors will not have had the benefit of the experience and discussion that produced the specification.
Introduction¶
This project is designed for asterisk call manager.
Provide useful APIs for call handling.
Installation¶
SSL certification¶
Need to create certification file for ssl connection.
$ sudo openssl req -subj '/CN=US/O=Jade project/C=US' -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /opt/etc/server.key -out /opt/etc/server.crt
$ cat /opt/etc/server.crt /opt/etc/server.key > /opt/etc/jade.pem
Asterisk¶
Required Asterisk-13.6 or later
Asterisk settings¶
Config manager.conf¶
Enable and set up the ami user.
/etc/asterisk/manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[admin]
secret = admin ; this is not secure. need to be changed.
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.0
read = all
write = all
Reload manager module
asterisk*CLI> module reload manager
Module 'manager' reloaded successfully.
asterisk*CLI> manager show user admin
username: admin
secret: <Set>
ACL: yes
read perm: system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate,agi,cc,aoc,test,security,message,all
write perm: system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate,agi,cc,aoc,test,security,message,all
displayconnects: yes
allowmultiplelogin: yes
Variables:
Config http.conf¶
Need to configure the http.conf options.
/etc/asterisk/http.conf
[general]
servername=Asterisk
enabled=yes
bindaddr=0.0.0.0
bindport=8088
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/opt/etc/jade.pem
Required libraries¶
libsqlite3
libevent2
libbsd
libjansson
libevhtp
libssl
libzmq5
libonig
Libevhtp¶
Insall libevhtp
$ mkdir -p /opt/src/libevhtp
$ curl -s https://codeload.github.com/criticalstack/libevhtp/tar.gz/1.2.16 | tar xz -C /opt/src/libevhtp --strip-components=1
$ cd /opt/src/libevhtp/build
$ cmake ..
$ make
$ make install
Libwebsockets¶
Install libwebsockets
$ mkdir -p /opt/src/libwebsockets
$ curl -s https://codeload.github.com/warmcat/libwebsockets/tar.gz/v2.4.2 | tar xz -C /opt/src/libwebsockets --strip-components=1
$ cd /opt/src/libwebsockets/build
$ cmake -DLWS_WITH_LIBEVENT=1 ../
$ make
$ make install
Install jade¶
$ cd <downloaded source directory>
$ cd src/
$ make
$ sudo mkdir -p /opt/bin
$ sudo mv jade_backend /opt/bin
Configuration¶
{
"serv_addr": "127.0.0.1",
"serv_port": "5038",
"username": "",
"password": "",
"loglevel": "7",
"general" : {
"result_filename" : "./outbound_result.json"
},
"database" : {
"name": "./database.db"
}
}
Structure¶
Basic structures¶
Agent status¶
Agent’s status.
Status | Detail |
---|---|
AGENT_LOGGEDOFF | Agent is not logged in. |
AGENT_IDLE | Agent is logged in status idle. |
AGENT_ONCALL | Agent is logged in and now on call. |
Device state¶
Device’s state
State | Detail |
---|---|
UNKNOWN | Device is valid but channel didn’t know state. |
NOT_INUSE | Device is not used. |
BUSY | Device is in use. |
INVALID | Device is invalid. |
UNAVAILABLE | Device is unavailable. |
RINGING | Device is ringing. |
RINGINUSE | Device is ringing and in use. |
ONHOLD | Device is on hold. |
API basics¶
API description¶
Title¶
The main category of API. Normally, it represents general API URI.
Purpose¶
The purpose of API.
Methods¶
List of supported command with simple description.
Method: <command>¶
Method description with command in detail. It shown also added version.
Call¶
Description of how to call this API. It will explain about method parameters and data parameters.
<method> <call URI>
<required data>
Method parameters
* method
: API calling method. i.e. GET, PUT, POST, …
* call URI
: URI. Uniform Resource Identifier
Data parameters
* required data
: Required data to call the API.
Returns¶
Description of reply. Described in detail. These are common return objects. This objects will not be explain again.
{
$defhdr,
"result": {
"message": "<message-name>",
"type": "<message-type>",
"timestamp": "<YYYY-mm-ddTHH:MM:SS.fffZ>"
}
}
message
: Represents message name. Fixed.type
: Represents message type. Fixed.timestamp
Denotes when the message has been created. See the Timestamp.
Example¶
Simple example of how to use the API. It would be little bit different with real response.
Normally, to test the API curl is used. curl is a tool to transfer data from or to a server, using one of the supported protocols. See detail at link below.
https://curl.haxx.se/docs/manpage.html
Some of APIs requires a returned uuid for the request. But one must expect that these information are only valid within the user sessions and are temporary.
API¶
/agents¶
Methods¶
GET : Get list of all agents info.
Method: GET¶
Get list of all agents info.
Call¶
GET /agents
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"id": "<string>"
},
...
]
}
}
list
: array of agents id.id
: agent id.
Example¶
$ curl -X GET 192.168.200.10:8081/agents
{
"api_ver": "0.1",
"result": {
"list": [
{
"id": "1001"
},
{
"id": "1002"
}
]
},
"statuscode": 200,
"timestamp": "2017-03-13T17:19:07.48261155Z"
}
/agents/¶
Methods¶
GET : Get agent’s detail info of given agent id.
Method: GET¶
Get agent’s detail info of given agent id.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"name": "<string>",
"status": "<string>",
"logged_in_time": <integer>,
"channel_name": "<string>",
"channel_state": <integer>,
"channel_state_desc": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"context": "<string>",
"exten": "<string>",
"priority": "<string>",
"account_code": "<string>",
"language": "<string>",
"unique_id": "<string>",
"linked_id": "<string>",
"tm_update": "<string>",
}
}
Return parameters
id
: Agent id.name
: Agent name.status
: Agent status. See detail Agent status.logged_in_time
: Logged in time.channel_name
: Agent channel’s name.channel_state
: Agent channel’s state.channel_state_desc
: Agent channel’s state description.caller_id_name
: Caller’s id name.caller_id_num
: Caller’s id number.connected_line_name
: Connected line name.connected_line_num
: Connected line number.context
: Context.exten
: Extension.priority
: Prioritycaller_id_name
: Caller’s id name.caller_id_num
: Caller’s id number.connected_line_name
: Caller’s line name.connected_line_num
: Caller’s line number.account_code
: Account code.language
: Language.unique_id
: Channel’s unique id.linked_id
: Channel’s linked id.
Example¶
$ curl -X GET 192.168.200.10:8081/agents/ -d '{"id": "1001"}'
{
"api_ver": "0.1",
"result": {
"account_code": "",
"caller_id_name": "300",
"caller_id_num": "300",
"channel_name": "SIP/300-00000425",
"channel_state": 6,
"channel_state_desc": "Up",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"context": "sample_agent_login",
"exten": "s",
"id": "1001",
"language": "en",
"linked_id": "1489423716.2037",
"logged_in_time": 1489423716,
"name": "Agent 1001",
"priority": "2",
"status": "AGENT_IDLE",
"tm_update": "2017-03-13T17:19:06.724533682Z",
"unique_id": "1489423716.2037"
},
"statuscode": 200,
"timestamp": "2017-03-13T17:20:01.778206702Z"
}
/device_states¶
Methods¶
GET : Get list of all device_state device info.
Method: GET¶
Get list of all device_state device info.
Call¶
GET /device_states
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"device": "<string>"
},
...
]
}
}
Return parameters
list
: array of channels.device
: device name.
Example¶
$ curl -X GET example.com:8081/device_states
{
"api_ver": "0.1",
"result": {
"list": [
{"device": "Agent:1001"},
...
]
},
"statuscode": 200,
"timestamp": "2017-04-04T23:09:36.539677164Z"
}
/device_states/¶
Methods¶
GET : Get device_state’s detail info of given info.
Method: GET¶
Get device_state’s detail info of given info.
Returns¶
{
$defhdr,
"reuslt": {
"device": "<string>",
"state": "<string>",
"tm_update": "2017-04-04T23:08:40.878892472Z"
}
}
Return parameters
device
: Device name.state
: Device state. See detail Device state.
Example¶
$ curl -X GET example.com/device_states/ -d \
'{"device": "Agent:1001"}'
{
"api_ver": "0.1",
"result": {
"device": "Agent:1001",
"state": "UNAVAILABLE",
"tm_update": "2017-04-04T23:08:40.878892472Z"
},
"statuscode": 200,
"timestamp": "2017-04-04T23:10:37.684581876Z"
}
/peers¶
Methods¶
GET : Get list of all peer info.
Method: GET¶
Get list of all peer info.
Call¶
GET /peers
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{"peer": "<string>"},
...
]
}
}
list
: array of peer entry info.peer
: Peer entry info.
Example¶
$ curl -X GET saturn.pchero21.com:8081/peers
{
"api_ver": "0.1",
"result": {
"list": [
{
"peer": "SIP/300"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-04-09T01:42:24.765567356Z"
}
/peers/¶
Methods¶
GET : Get peer detail info of given peer info.
Method: GET¶
Get peer detail info of given peer info.
Returns¶
{
$defhdr,
"reuslt": {
"peer": "<string>",
"status": "<string>",
"address": "<string>",
"monitor_status": "<string>",
"channel_type": "<string>",
"chan_object_type": "<string>",
"dynamic": "<string>",
"auto_comedia": "<string>",
"auto_force_port": "<string>",
"acl": "<string>",
"comedia": "<string>",
"description": "<string>",
"force_port": "<string>",
"realtime_device": "<string>",
"text_support": "<string>",
"video_support": "<string>",
"tm_update": "<timestamp>",
}
}
peer
: Peer name.status
: Peer’s status. See detail Peer status.address
: Registered peer’s address. “<ip>:<port>”monitor_status
: Peer monitoring status. See detail Peer monitoring status.dynamic
: Peer’s dynamic option value.auto_comedia
: Peer’s auto_comedia option value.auto_force_port
: Peer’s auto_force_port option value.acl
: Peer’s dynamic acl value.comedia
: Peer’s comedia option value.description
: Peer’s description option value.force_port
: Peer’s force_port option value.realtime_device
: Peer’s realtime_device option value.text_support
: Peer’s text support option value.video_support
: Peer’s video support option value.tm_update
: Updated timestamp.
Example¶
$ curl -X GET saturn.pchero21.com:8081/peers/ -d '{"peer": "agent-01"}'
{
"api_ver": "0.1",
"result": {
"acl": "no",
"address": "192.168.200.1:5060",
"auto_comedia": "yes",
"auto_force_port": "no",
"chan_object_type": "peer",
"channel_type": "SIP",
"comedia": "yes",
"description": "",
"dynamic": "yes",
"force_port": "no",
"monitor_status": "OK (22 ms)",
"peer": "SIP/agent-01",
"realtime_device": "no",
"status": "Registered",
"text_support": "no",
"tm_update": "2017-04-09T02:08:18.756977409Z",
"video_support": "no"
},
"statuscode": 200,
"timestamp": "2017-04-09T02:09:55.226677432Z"
}
/registries¶
Methods¶
GET : Get list of all registry accounts info.
Method: GET¶
Get list of all registry accounts info.
Call¶
GET /registries
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{"account": "<string>"},
...
]
}
}
list
: array of registry account.account
: Registry account info.
Example¶
$ curl -X GET 192.168.200.10:8081/registries
{
"api_ver": "0.1",
"result": {
"list": [
{"account": "2345@sip_proxy:5060"},
{"account": "1234@mysipprovider.com:5060"}
]
},
"statuscode": 200,
"timestamp": "2017-03-12T00:27:18.798367307Z"
}
/registries/¶
Methods¶
GET : Get registry detail info of given account info.
Method: GET¶
Get registry detail info of given account info.
Returns¶
{
$defhdr,
"reuslt": {
"account": "<string>",
"state": "<string>",
"username": "<string>",
"domain": "<string>",
"domain_port": <integer>,
"host": "<string>",
"port": <integer>,
"refresh": <integer>,
"registration_time": <integer>,
"tm_update": "<timestamp>"
}
}
account
: Registry’s account info.state
: state info.username
: Registry’s username.domain
: Registry’s domain info.domain_port
: Registry’s domain port.host
: Registry’s host info.port
: Registry’s port info.refresh
: Refresh.registration_time
: registration time.tm_update
: Updated timestamp.
Example¶
$ curl -X GET 192.168.200.10:8081/registries/ -d '{"account": "2345@sip_proxy"}'
{
"api_ver": "0.1",
"result": {
"account": "2345@sip_proxy",
"domain": "sip_proxy",
"domain_port": 5060,
"host": "sip_proxy",
"port": 5060,
"refresh": 120,
"registration_time": "0",
"state": "Request Sent",
"tm_update": "2017-03-09T09:12:06.652539075Z",
"username": "2345"
},
"statuscode": 200,
"timestamp": "2017-03-09T09:13:00.969355467Z"
}
/admin/core/channels¶
Methods¶
GET : Get list of all channels info.
Method: GET¶
Get list of all channels info.
Call¶
GET /admin/core/channels
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"unique_id": "<string>",
"linked_id": "<string>",
"channel": "<string>",
"channel_state": <integer>,
"channel_state_desc": "<string>",
"context": "<string>",
"exten": "<string>",
"priority": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"account_code": "<string>",
"language": "<string>",
"hangup_cause": <number>,
"hangup_cause_desc": "<string>",
"variables": {},
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of channels. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://192.168.200.10:8081/v1/admin/core/channels
{
"api_ver": "0.1",
"result": {
"list": [
{
"account_code": "",
"application": "Queue",
"application_data": "",
"bridge_id": null,
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000007",
"channel_state": 4,
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"context": "queue_sales",
"duration": null,
"exten": "s",
"hangup_cause": null,
"hangup_cause_desc": null,
"language": "en",
"linked_id": "1513946896.7",
"priority": "2",
"tm_update": "2017-12-22T12:48:17.211205731Z",
"unique_id": "1513946896.7",
"variables": {}
}
]
},
"statuscode": 200,
"timestamp": "2017-12-22T12:48:26.824442473Z"
}
/admin/core/channels/<detail>¶
Method: GET¶
Get channel’s detail info of given channel info.
Returns¶
{
$defhdr,
"reuslt": {
"unique_id": "<string>",
"linked_id": "<string>",
"channel": "<string>",
"channel_state": <integer>,
"channel_state_desc": "<string>",
"context": "<string>",
"exten": "<string>",
"priority": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"account_code": "<string>",
"language": "<string>",
"application": "<string>",
"application_data": "<string>",
"hangup_cause": <number>,
"hangup_cause_desc": "<string>",
"variables": {},
"tm_update": "<timestamp>"
}
}
Return parameters
unique_id
: Channel’s unique id.linked_id
: Channel’s linked id.channel
: Channel’s name.channel_state
: Channel’s state.channel_state_desc
: Channel’s state description.context
: Context.exten
: Extension.priority
: Prioritycaller_id_name
: Caller’s id name.caller_id_num
: Caller’s id number.connected_line_name
: Caller’s line name.connected_line_num
: Caller’s line number.account_code
: Account code.language
: Language.application
: Application name.application_data
: Application data.hangup_cause
: Hangup reason.hangup_cause_desc
: Hangup reason description.variables
: List of channel’s variables.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/channels/1513946896.7
{
"api_ver": "0.1",
"result": {
"account_code": "",
"application": "Queue",
"application_data": "",
"bridge_id": null,
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000007",
"channel_state": 4,
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"context": "queue_sales",
"duration": null,
"exten": "s",
"hangup_cause": null,
"hangup_cause_desc": null,
"language": "en",
"linked_id": "1513946896.7",
"priority": "2",
"tm_update": "2017-12-22T12:48:17.211205731Z",
"unique_id": "1513946896.7",
"variables": {}
},
"statuscode": 200,
"timestamp": "2017-12-22T12:49:31.608415721Z"
}
/admin/core/modules¶
Methods¶
GET : Get list of all modules info.
Method: GET¶
Get list of all modules info.
Call¶
GET /admin/core/modules
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"load": "<string>",
"name": "<string>",
"size": number,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of channels. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/modules
{
"api_ver": "0.1",
"result": {
"list": [
{
"load": "unknown",
"name": "app_voicemail",
"size": 1083280,
"tm_update": "2017-12-17T22:11:40.375546224Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-17T23:14:08.548863974Z"
}
/admin/core/modules/<detail>¶
Methods¶
GET : Get detail info of given module
POST : Load given module.
PUT : Reload given module.
DELETE : Unload given module.
Method: GET¶
Get list of all modules info.
Returns¶
{
$defhdr,
"reuslt": {
"load": "<string>",
"name": "<string>",
"size": number,
"tm_update": "<timestamp>"
}
}
load
: load status.name
: module name.size
: module size.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/modules/app_voicemail
{
"api_ver": "0.1",
"result": {
"load": "unknown",
"name": "app_voicemail",
"size": 1083280,
"tm_update": "2017-12-17T23:28:02.30024695Z"
},
"statuscode": 200,
"timestamp": "2017-12-17T23:28:07.214355673Z"
}
Method: POST¶
Load the given module.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X POST https://localhost:8081/v1/admin/core/modules/app_voicemail
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2017-12-17T23:35:07.579784864Z"
}
Method: PUT¶
Reload the given module.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/core/modules/app_voicemail
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2017-12-17T23:36:24.508748449Z"
}
/admin/core/systems¶
Methods¶
GET : Get list of all systems info.
Method: GET¶
Get list of all modules info.
Call¶
GET /admin/core/systems
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"id": "<string>",
"system_name": "<string>",
"ami_version": "<string>",
"ast_version": "<string>",
"cdr_enabled": "<string>",
"http_enabled": "<string>",
"current_calls": <number>,
"max_calls": <number>,
"max_file_handles": <number>,
"max_load_avg": <real>,
"real_time_enabled": "<string>",
"reload_date": "<string>",
"reload_time": "<string>",
"run_group": "<string>",
"run_user": "<string>",
"startup_date": "<string>",
"startup_time": "<string>",
"tm_update": "<string>"
},
...
]
}
}
list
: array of channels. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/systems
{
"api_ver": "0.1",
"result": {
"list": [
{
"ami_version": "4.0.0",
"ast_version": "GIT-master-e97e415M",
"cdr_enabled": "Yes",
"current_calls": 0,
"http_enabled": "No",
"id": "1",
"max_calls": 0,
"max_file_handles": 0,
"max_load_avg": 0.0,
"real_time_enabled": "No",
"reload_date": "2017-12-17",
"reload_time": "23:36:24",
"run_group": "",
"run_user": "",
"startup_date": "2017-12-17",
"startup_time": "10:17:20",
"system_name": "",
"tm_update": "2017-12-17T23:38:54.940300313Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-17T23:38:55.914253052Z"
}
/admin/core/systems/<detail>¶
Methods¶
GET : Get detail info of given system.
Method: GET¶
Get detail info of given system.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"system_name": "<string>",
"ami_version": "<string>",
"ast_version": "<string>",
"cdr_enabled": "<string>",
"http_enabled": "<string>",
"real_time_enabled": "<string>",
"current_calls": <number>,
"max_calls": <number>,
"max_file_handles": <number>,
"max_load_avg": <real>,
"reload_date": "<string>",
"reload_time": "<string>",
"run_group": "<string>",
"run_user": "<string>",
"startup_date": "<string>",
"startup_time": "<string>",
"tm_update": "<string>"
}
}
id
: system id.system_name
: system name.ami_version
: AMI version.ast_version
: Asterisk version.cdr_enabled
: Cdr enanbled or not. If enabled “Yes”.http_enabled
: http enabled or not. If enabled “Yes”.real_time_enabled
: real time enabled or not. If enabled “Yes”.current_calls
: Current call count.max_calls
: Maximum call count.max_file_handles
: Maximum file handle count.max_load_avg
: Max load average.reload_date
: Reloaded date.reload_time
: Reloaded time.run_group
: Process running group.run_user
: Process running user.startup_date
: Startup date.startup_time
: Startup time.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/core/systems/1
{
"api_ver": "0.1",
"result": {
"ami_version": "4.0.0",
"ast_version": "GIT-master-e97e415M",
"cdr_enabled": "Yes",
"current_calls": 0,
"http_enabled": "No",
"id": "1",
"max_calls": 0,
"max_file_handles": 0,
"max_load_avg": 0.0,
"real_time_enabled": "No",
"reload_date": "2017-12-17",
"reload_time": "23:36:24",
"run_group": "",
"run_user": "",
"startup_date": "2017-12-17",
"startup_time": "10:17:20",
"system_name": "",
"tm_update": "2017-12-17T23:42:16.933212413Z"
},
"statuscode": 200,
"timestamp": "2017-12-17T23:42:17.210353468Z"
}
/admin/dialplan/adps¶
Methods¶
GET : Get list of all adp(async dialplan)s info.
POST : Create new adp(async dialplan) info.
Method: GET¶
Get list of all adp(async dialplan)s info.
Call¶
GET /admin/dialplan/adps
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes. * See detail dialplans detail info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/dialplan/adps
{
"api_ver": "0.1",
"result": {
"list": [
{
"command": null,
"detail": null,
"dpma_uuid": "1d47735d-2265-463c-908a-d37dea085c21",
"name": "test_dialplan_1",
"sequence": 10,
"tm_create": "2018-01-23T01:05:53.878811167Z",
"tm_update": "2018-01-23T01:27:54.670312624Z",
"uuid": "91bba56b-7ec5-4fe2-a724-9f39d527da8c"
}
]
},
"statuscode": 200,
"timestamp": "2018-01-23T01:29:02.718231538Z"
}
Method: POST¶
Create new adp(async dialplan) info.
Call¶
POST /admin/dialplan/adps
{
...
}
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X POST https://localhost:8081/v1/admin/dialplan/adps -d
'{"name": "test_dialplan_1", "dpma_uuid":"1d47735d-2265-463c-908a-d37dea085c21", "sequence": 1}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:38:38.709550080Z"
}
/admin/dialplan/adps/<detail>¶
Methods¶
GET : Get async dialplan detail info of given detail.
PUT : Update async dialplan detail info of given detail.
DELETE : Delete the given async dialplan info.
Method: GET¶
Get async dialplan detail info of given detail.
Returns¶
{
$defhdr,
"reuslt": {
"uuid": "<string>",
"dpma_uuid": "<string>",
"sequence": <number>,
"name": "<string>",
"detail": "<string>",
"command": "<string>",
"tm_create": "<timestamp>",
"tm_update": "<timestamp>"
}
}
Return parameters
uuid
: dialplan uuid.dpma_uuid
: Dpma uuid.sequence
: Sequence.name
: Name.detail
: Detail info.command
: Command.tm_create
: timestamp.tm_update
: timestamp.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/adps/abde9ef2-7255-4e64-acbe-a6edb964c442
{
"api_ver": "0.1",
"result": {
"command": null,
"detail": null,
"dpma_uuid": "1d47735d-2265-463c-908a-d37dea085c21",
"name": "test_dialplan_1",
"sequence": 1,
"tm_create": "2018-01-23T01:38:38.698487606Z",
"tm_update": null,
"uuid": "abde9ef2-7255-4e64-acbe-a6edb964c442"
},
"statuscode": 200,
"timestamp": "2018-01-23T01:38:53.794937064Z"
}
Method: PUT¶
Update async dialplan detail info of given detail.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/dialplan/adps/91bba56b-7ec5-4fe2-a724-9f39d527da8c -d \
'{"uuid": "91bba56b-7ec5-4fe2-a724-9f39d527da8c", \
"dpma_uuid": "1d47735d-2265-463c-908a-d37dea085c21", "sequence": 10}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:27:54.683794074Z"
}
Method: DELETE¶
DELETE : Delete the given async dialplan info.
Call¶
DELETE /admin/dialplan/adps/<detail>
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/dialplan/adps/91bba56b-7ec5-4fe2-a724-9f39d527da8c
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:29:34.538575375Z"
}
/admin/dialplan/adpmas¶
Method: GET¶
Get list of all adpma info.
Call¶
GET /admin/dialplan/adpmas
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes. * See detail adpma detail info.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/adpmas
{
"api_ver": "0.1",
"result": {
"list": [
{
"detail": "test dpma dpma",
"name": "test dpma",
"tm_create": "2018-01-22T23:40:55.513269352Z",
"tm_update": null,
"uuid": "1d47735d-2265-463c-908a-d37dea085c21"
}
]
},
"statuscode": 200,
"timestamp": "2018-01-22T23:41:06.819146813Z"
}
Method: POST¶
Create new adpma info.
Call¶
POST /admin/dialplan/adpmas
{
...
}
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X POST https://localhost:8081/v1/admin/dialplan/adpmas -d '{"name": "test dpma", "detail": "test dpma dpma"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-22T23:40:55.524091997Z"
}
/admin/dialplan/adpmas/<detail>¶
Methods¶
GET : Get adpmas detail info of given detail.
PUT : Update adpmas detail info of given detail.
DELETE : Delete the given adpmas info.
Method: GET¶
Get adpma detail info of given detail.
Returns¶
{
$defhdr,
"reuslt": {
"uuid": "<string>",
"name": "<string>",
"detail": "<string>",
"tm_create": "<string>",
"tm_update": "<string>"
}
}
Return parameters
uuid
: adpma uuid.name
: Name.detail
: Detail info.tm_create
: timestamp.tm_update
: timestamp.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/adpmas/1d47735d-2265-463c-908a-d37dea085c21
{
"api_ver": "0.1",
"result": {
"detail": "test dpma dpma",
"name": "test dpma",
"tm_create": "2018-01-22T23:40:55.513269352Z",
"tm_update": null,
"uuid": "1d47735d-2265-463c-908a-d37dea085c21"
},
"statuscode": 200,
"timestamp": "2018-01-22T23:43:06.585017860Z"
}
Method: PUT¶
Update adpmas detail info of given detail.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/dialplan/adpmas/1d47735d-2265-463c-908a-d37dea085c21 -d
'{"name": "test change name" }'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-22T23:46:38.238159711Z"
}
Method: DELETE¶
DELETE : Delete the given adpma info.
Call¶
DELETE /admin/dialplan/adpmas/<detail>
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/dialplan/adpmas/1d47735d-2265-463c-908a-d37dea085c21
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-01-23T01:59:22.411717755Z"
}
/admin/dialplan/configurations/<detail>¶
Methods¶
GET: Get given dialplan configuration detail info.
PUT: Update given dialplan configuration detail info.
DELETE: Delete given dialplan configuration detail info.
Method: GET¶
Get given dialplan configuration detail info.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/configurations/extensions.conf\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"data": "...",
"name": "extensions.conf"
},
"statuscode": 200,
"timestamp": "2018-05-22T13:33:06.376506142Z"
}
Method: PUT¶
Update given dialplan configuration detail info.
Method: DELETE¶
Delete given dialplan configuration detail info.
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/dialplan/configurations/extensions.conf.2018-05-21T08:49:27.783332067Z\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-22T13:35:18.521871974Z"
}
/admin/dialplan/sdps¶
Methods¶
GET: Get all of dialplam’s static dialplans info.
Method: GET¶
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/sdps\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"list": [
{
"data": [
{
"exten": "> _X.,1,NoOp(jade-queue)"
},
{
"same": "> n,Queue(jade-queue)"
}
],
"name": "jade-queue"
},
{
"data": [],
"name": "jade_demo2"
},
{
"data": [
{
"exten": "> 100,1,NoOp(sample_park)"
},
{
"same": "> n,park()"
},
{
"exten": "> _X.,1,BackGround(demo-congrats)"
},
{
"same": "> n,Hangup()"
}
],
"name": "jade_demo"
},
{
"data": [],
"name": "jade_demo3"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-22T13:36:41.645574898Z"
}
/admin/dialplan/sdps/<detail>¶
Methods¶
Get: Get detail info of the given sdp.
PUT: Update detail info of the given sdp.
DELETE: Delete detail info of the given sdp.
Method: GET¶
Get detail info of the given sdp.
Example¶
$ curl -k https://localhost:8081/v1/admin/dialplan/sdps/jade_demo\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"data": [
{
"exten": "> 100,1,NoOp(sample_park)"
},
{
"same": "> n,park()"
},
{
"exten": "> _X.,1,BackGround(demo-congrats)"
},
{
"same": "> n,Hangup()"
}
],
"name": "jade_demo"
},
"statuscode": 200,
"timestamp": "2018-05-22T13:39:39.664914968Z"
}
/admin/info¶
Method: GET¶
Get current user’s info.
Example¶
$ curl -k https://localhost:8081/v1/admin/info\?authtoken=86f7c25d-54db-4ffd-9bf8-8f691fbb4b97
{
"api_ver": "0.1",
"result": {
"name": "Test Administrator",
"tm_create": "2018-04-28T05:03:36.560694725Z",
"tm_update": "2018-04-28T07:10:29.116108422Z",
"username": "admin",
"uuid": "ed629979-802b-40f0-9098-b30b2988f9b6"
},
"statuscode": 200,
"timestamp": "2018-05-22T13:42:29.17642767Z"
}
Method: PUT¶
Update current user’s info.
/admin/login¶
/admin/park/cfg_parkinglots¶
Method: GET¶
Get all of the config parkinglots info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/cfg_parkinglots\?authtoken=0e81eee1-f215-4397-ac99-e0de58b87b88
{
"api_ver": "0.1",
"result": {
"list": [
{
"data": {
"context": "teset",
"parkpos": "851-900"
},
"name": "test_park1"
},
{
"data": {},
"name": "jade-tesetqueue2"
},
{
"data": {
"comebackcontext": "edvinapark-timeout",
"comebackdialtime": "90",
"comebacktoorigin": "no",
"context": "edvina_park",
"findslot": "next",
"parkedmusicclass": "edvina",
"parkpos": "800-850"
},
"name": "edvina"
},
{
"data": {},
"name": "jade-testqueue2"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-22T14:09:47.561146235Z"
}
/admin/park/cfg_parkinglots/<detail>¶
Methods¶
GET: Get detail info of the given config parkinglot.
PUT: Update detail info of the given config parkinglot.
DELETE: Delete detail info of the given config parkinglot.
Method: GET¶
Get detail info of the given config parkinglot.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/cfg_parkinglots/edvina\?authtoken=0e81eee1-f215-4397-ac99-e0de58b87b88
{
"api_ver": "0.1",
"result": {
"data": {
"comebackcontext": "edvinapark-timeout",
"comebackdialtime": "90",
"comebacktoorigin": "no",
"context": "edvina_park",
"findslot": "next",
"parkedmusicclass": "edvina",
"parkpos": "800-850"
},
"name": "edvina"
},
"statuscode": 200,
"timestamp": "2018-05-22T14:14:53.789233359Z"
}
Method: PUT¶
Update detail info of the given config parkinglot.
Method: DELETE¶
Delete detail info of the given config parkinglot.
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/park/cfg_parkinglots/jade-tesetqueue2\?authtoken=0e81eee1-f215-4397-ac99-e0de58b87b88
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-22T14:17:32.187887090Z"
}
/admin/park/configurations¶
/admin/park/configurations/<detail>¶
/admin/park/parkedcalls¶
Methods¶
GET : Get list of all parked calls info.
Method: GET¶
Get list of all parked calls info.
Call¶
GET /admin/park/parkedcalls
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes. * See detail parkedcall detail info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/parkedcalls
{
"api_ver": "0.1",
"result": {
"list": [
{
"parkee_account_code": "",
"parkee_caller_id_name": "pjagent-01",
"parkee_caller_id_num": "pjagent-01",
"parkee_channel": "PJSIP/pjagent-01-00000044",
"parkee_channel_state": "6",
"parkee_channel_state_desc": "Up",
"parkee_connected_line_name": "<unknown>",
"parkee_connected_line_num": "<unknown>",
"parkee_context": "sample_park",
"parkee_exten": "s",
"parkee_linked_id": "1514423807.111",
"parkee_priority": "2",
"parkee_unique_id": "1514423807.111",
"parker_dial_string": "PJSIP/pjagent-01",
"parking_duration": 0,
"parking_lot": "default",
"parking_space": "701",
"parking_timeout": 45,
"tm_update": "2017-12-28T01:16:48.343347741Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-28T01:17:10.187476889Z"
}
/admin/park/parkedcalls/<detail>¶
Methods¶
GET : Get parked_call’s detail info of given info.
DELETE : Hangup the given parked call info.
Method: GET¶
Get parked_call’s detail info of given info.
Returns¶
{
$defhdr,
"reuslt": {
"parkee_unique_id": "<string>",
"parkee_linked_id": "<string>",
"parkee_channel": "<string>",
"parkee_channel_state": "<string>",
"parkee_channel_state_desc": "<string>",
"parkee_caller_id_name": "<string>",
"parkee_caller_id_num": "<string>",
"parkee_connected_line_name": "<string>",
"parkee_connected_line_num": "<string>,
"parkee_account_code": "<string>",
"parkee_context": "<string>",
"parkee_exten": "<string>",
"parkee_priority": "<string>",
"parker_dial_string": "<string>",
"parking_duration": <integer>,
"parking_lot": "<string>",
"parking_space": "<string>",
"parking_timeout": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
parkee_unique_id
: Parkee’s unique id.parkee_linked_id
: Parkee’s linked id.parkee_channel
: Parkee’s channel name.parkee_channel_state
: Parkee’s channele state.parkee_channel_state_desc
: Parkee’s channel state description.parkee_caller_id_name
: Parkee’s caller id name.parkee_caller_id_num
: Parkee’s caller id number.parkee_connected_line_name
: Parkee’s connected line name.parkee_connected_line_num
: Parkee’s connected line number.parkee_account_code
: Parkee’s account code.parkee_context
: Parkee’s current context.parkee_exten
: Parkee’s current exten.parkee_priority
: Parkee’s current priority.parker_dial_string
: Dial String that can be used to call back the parker on ParkingTimeout.parking_duration
: Time the parkee has been in the parking bridge since tm_update(in seconds).parking_lot
: Name of the parking lot that the parkee is parked in.parking_space
: Parking Space that the parkee is parked in.parking_timeout
: Time remaining until the parkee is forcefully removed from parking in seconds since tm_update.
Example¶
$ curl -X GET localhost:8081/park/parkedcalls/1514423984.115
{
"api_ver": "0.1",
"result": {
"parkee_account_code": "",
"parkee_caller_id_name": "pjagent-01",
"parkee_caller_id_num": "pjagent-01",
"parkee_channel": "PJSIP/pjagent-01-00000046",
"parkee_channel_state": "6",
"parkee_channel_state_desc": "Up",
"parkee_connected_line_name": "<unknown>",
"parkee_connected_line_num": "<unknown>",
"parkee_context": "sample_park",
"parkee_exten": "s",
"parkee_linked_id": "1514423984.115",
"parkee_priority": "2",
"parkee_unique_id": "1514423984.115",
"parker_dial_string": "PJSIP/pjagent-01",
"parking_duration": 0,
"parking_lot": "default",
"parking_space": "701",
"parking_timeout": 45,
"tm_update": "2017-12-28T01:19:44.271005802Z"
},
"statuscode": 200,
"timestamp": "2017-12-28T01:19:53.629685348Z"
}
/admin/park/parkinglots¶
Methods¶
GET : Get list of all parking lot info.
Method: GET¶
Get list of all parking lots info.
Call¶
GET /admin/park/parkinglots
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
...
},
...
]
}
}
Return parameters
list
: array of itmes.- See detail at parking lot detail info.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/parkinglots
{
"api_ver": "0.1",
"result": {
"list": [
{
"name": "default",
"start_space": "701",
"stop_spcae": "720",
"timeout": 45,
"tm_update": "2017-12-28T01:16:46.350523532Z"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-28T01:21:57.180448453Z"
}
/admin/park/parkinglots/<detail>¶
Methods¶
GET : Get parking lot’s detail info of given detail.
PUT : Update parking lot’s detail info of given detail.
DELETE : Delete the given parking lot info.
Method: GET¶
Get parking lot’s detail info of given info.
Call¶
GET /admin/park/parkinglots/<detail>
Method parameters
detail
: url encoded parking lot’s name.
Returns¶
{
$defhdr,
"reuslt": {
"name": "<string>",
"start_space": "<string>",
"stop_spcae": "<string>",
"timeout": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
name
: Parking lot’s name.start_space
: Parking lot’s start space.stop_spcae
: Parking lot’s stop space.timeout
: Timeout second in the parking lot.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/park/parkinglots/default
{
"api_ver": "0.1",
"result": {
"name": "default",
"start_space": "701",
"stop_spcae": "720",
"timeout": 45,
"tm_update": "2017-12-28T01:16:46.350523532Z"
},
"statuscode": 200,
"timestamp": "2017-12-28T01:25:47.123913131Z"
}
Method: PUT¶
Update parking lot’s detail info of given detail.
Call¶
PUT /admin/park/parkinglots/<detail>
{
...
}
Method parameters
detail
: url encoded parking lot’s name.
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X PUT https://localhost:8081/v1/admin/park/parkinglots/test_parkinglot -d \
'{"context": "> edvina_park", "parkpos": "> 800-900", "findslot": "> next", \
"comebacktoorigin": "no", "comebackdialtime": "90", \
"comebackcontext": "edvinapark-timeout", "parkedmusicclass": "edvina" }'
{
"api_ver": "0.1",
"timestamp": "2018-01-03T22:17:22.76376966Z",
"statuscode": 200
}
Method: DELETE¶
DELETE : Delete the given parking lot info.
Call¶
DELETE /admin/park/parkinglots/<detail>
Returns¶
{
$defhdr
}
Example¶
$ curl -k -X DELETE https://localhost:8081/v1/admin/park/parkinglots/test_parkinglot
{
"api_ver": "0.1",
"timestamp": "2018-01-03T21:50:01.672074605Z",
"statuscode": 200
}
/admin/pjsip/aors¶
Methods¶
GET : Get all list of aors.
Method: GET¶
GET : Get all list of aors.
Call¶
GET ^/admin/pjsip/aors
Returns¶
{
$defhdr,
"result": {
"list": [
{
"object_name": "<string>",
"object_type": "<string>",
"endpoint_name": "<string>",
"contacts": "<string>",
"contacts_registered": <number>,
"total_contacts": <number>,
"authenticate_qualify": "<string>",
"default_expiration": <number>,
"mailboxes": "<string>",
"max_contacts": <number>,
"maximum_expiration": <number>,
"minimum_expiration": <number>,
"outbound_proxy": "<string>",
"qualify_frequency": <number>,
"qualify_timeout": <number>,
"remove_existing": "<string>",
"support_path": "<string>",
"voicemail_extension": "<string>",
"tm_update": "<timestamp>"
},
...
]
}
}
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/aors
{
"api_ver": "0.1",
"result": {
"list": [
{
"authenticate_qualify": "false",
"contacts": "",
"contacts_registered": 0,
"default_expiration": 3600,
"endpoint_name": "199",
"mailboxes": "",
"max_contacts": 1,
"maximum_expiration": 7200,
"minimum_expiration": 60,
"object_name": "199",
"object_type": "aor",
"outbound_proxy": "",
"qualify_frequency": 0,
"qualify_timeout": 3,
"remove_existing": "true",
"support_path": "false",
"tm_update": "2017-12-19T20:03:34.948197060Z",
"total_contacts": 0,
"voicemail_extension": ""
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:03:41.263715886Z"
}
/admin/pjsip/aors/<detail>¶
Methods¶
GET : Get detail aor info of given aor info.
Method: GET¶
GET : Get detail aor info of given aor info.
Returns¶
{
$defhdr,
"reuslt": {
"object_name": "<string>",
"object_type": "<string>",
"endpoint_name": "<string>",
"contacts": "<string>",
"contacts_registered": <number>,
"total_contacts": <number>,
"authenticate_qualify": "<string>",
"default_expiration": <number>,
"mailboxes": "<string>",
"max_contacts": <number>,
"maximum_expiration": <number>,
"minimum_expiration": <number>,
"outbound_proxy": "<string>",
"qualify_frequency": <number>,
"qualify_timeout": <number>,
"remove_existing": "<string>",
"support_path": "<string>",
"voicemail_extension": "<string>",
"tm_update": "<timestamp>"
}
}
object_name
: aor name.object_type
: type. Always would be “aor”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/aors/pjagent-01
{
"api_ver": "0.1",
"result": {
"authenticate_qualify": "false",
"contacts": "pjagent-01/sip:35740219@10.12.118.159:49027",
"contacts_registered": 1,
"default_expiration": 3600,
"endpoint_name": "pjagent-01",
"mailboxes": "",
"max_contacts": 1,
"maximum_expiration": 7200,
"minimum_expiration": 60,
"object_name": "pjagent-01",
"object_type": "aor",
"outbound_proxy": "",
"qualify_frequency": 0,
"qualify_timeout": 3,
"remove_existing": "true",
"support_path": "false",
"tm_update": "2017-12-19T20:03:36.64487822Z",
"total_contacts": 1,
"voicemail_extension": ""
},
"statuscode": 200,
"timestamp": "2017-12-19T20:21:29.736727558Z"
}
/admin/pjsip/auth¶
Methods¶
GET : Get all list of auths.
Method: GET¶
GET : Get all list of auths.
Call¶
GET /admin/pjsip/auths
Returns¶
{
$defhdr,
"result": {
"list": [
{
"object_name": "<string>",
"object_type": "<string>",
"username": "<string>",
"auth_type": "<string>",
"password": "<string>",
"md5_cred": "<string>",
"realm": "<string>",
"nonce_lifetime": <number>,
"endpoint_name": "<string>",
"tm_update": "<timestamp>"
},
...
]
}
}
list
object_name
: auth name.object_type
: type. Always will be “auth”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/auths
{
"api_ver": "0.1",
"result": {
"list": [
{
"auth_type": "userpass",
"endpoint_name": "pjagent-01",
"md5_cred": "",
"nonce_lifetime": 32,
"object_name": "pjagent-01",
"object_type": "auth",
"password": "pjagent-01",
"realm": "",
"tm_update": "2017-12-19T20:03:36.42243261Z",
"username": "pjagent-01"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:26:09.770460034Z"
}
/admin/pjsip/auth/<detail>¶
Methods¶
GET : Get detail auth info of given auth info.
Method: GET¶
GET : Get detail auth info of given auth info.
Returns¶
{
$defhdr,
"reuslt": {
"object_name": "<string>",
"object_type": "<string>",
"username": "<string>",
"auth_type": "<string>",
"password": "<string>",
"md5_cred": "<string>",
"realm": "<string>",
"nonce_lifetime": <number>,
"endpoint_name": "<string>",
"tm_update": "<timestamp>"
}
}
object_name
: aor name.object_type
: type. Always would be “aor”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/auths/pjagent-01
{
"api_ver": "0.1",
"result": {
"auth_type": "userpass",
"endpoint_name": "pjagent-01",
"md5_cred": "",
"nonce_lifetime": 32,
"object_name": "pjagent-01",
"object_type": "auth",
"password": "pjagent-01",
"realm": "",
"tm_update": "2017-12-19T20:03:36.42243261Z",
"username": "pjagent-01"
},
"statuscode": 200,
"timestamp": "2017-12-19T20:34:54.165290324Z"
}
/admin/pjsip/configurations¶
/admin/pjsip/configurations/<detail>¶
/admin/pjsip/contacts¶
Methods¶
GET : Get all list of contacts.
Method: GET¶
GET : Get all list of contacts.
Call¶
GET /admin/pjsip/contacts
Returns¶
{
$defhdr,
"result": {
"list": [
{
"id": "<string>",
"call_id": "<string>",
"uri": "<string>",
"aor": "<string>",
"endpoint_name": "<string>",
"status": "<string>",
"qualify_frequency": 0,
"qualify_timout": 3,
"authentication_qualify": 0,
"outbound_proxy": "<string>",
"path": "<string>",
"reg_expire": 1513714265,
"round_trip_usec": "<string>",
"user_agent": "<string>",
"via_address": "<string>",
"tm_update": "<string>"
},
...
]
}
}
list
object_name
: auth name.object_type
: type. Always will be “auth”.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/contacts
{
"api_ver": "0.1",
"result": {
"list": [
{
"aor": "pjagent-01",
"authentication_qualify": 0,
"call_id": "c67ef58c-3b65-44cd-a9a8-784e2af542d3",
"endpoint_name": "pjagent-01",
"id": "pjagent-01;@116e48d167ff94856cbc9009cdc735b2",
"outbound_proxy": "",
"path": "",
"qualify_frequency": 0,
"qualify_timout": 3,
"reg_expire": 1513714265,
"round_trip_usec": "0",
"status": "Unknown",
"tm_update": "2017-12-19T20:29:36.751968068Z",
"uri": "sip:35740219@10.12.118.159:49027",
"user_agent": "Blink 3.0.3 (Linux)",
"via_address": "10.12.118.159:49027"
}
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:38:09.405901164Z"
}
/admin/pjsip/contacts/<detail>¶
Methods¶
GET : Get detail contact info of given contact info.
Method: GET¶
GET : Get detail contact info of given contact info.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"call_id": "<string>",
"uri": "<string>",
"aor": "<string>",
"endpoint_name": "<string>",
"status": "<string>",
"qualify_frequency": 0,
"qualify_timout": 3,
"authentication_qualify": 0,
"outbound_proxy": "<string>",
"path": "<string>",
"reg_expire": 1513714265,
"round_trip_usec": "<string>",
"user_agent": "<string>",
"via_address": "<string>",
"tm_update": "<string>"
}
}
Example¶
$ curl -X GET localhost:8081/pjsip/contacts/pjagent-01%3B%40116e48d167ff94856cbc9009cdc735b2
{
"api_ver": "0.1",
"result": {
"aor": "pjagent-01",
"authentication_qualify": 0,
"call_id": "c67ef58c-3b65-44cd-a9a8-784e2af542d3",
"endpoint_name": "pjagent-01",
"id": "pjagent-01;@116e48d167ff94856cbc9009cdc735b2",
"outbound_proxy": "",
"path": "",
"qualify_frequency": 0,
"qualify_timout": 3,
"reg_expire": 1513716547,
"round_trip_usec": "N/A",
"status": "Unknown",
"tm_update": "2017-12-19T20:45:42.698151858Z",
"uri": "sip:35740219@10.12.118.159:49027",
"user_agent": "Blink 3.0.3 (Linux)",
"via_address": "10.12.118.159:49027"
},
"statuscode": 200,
"timestamp": "2017-12-19T20:51:43.977637876Z"
}
/admin/pjsip/endpoints¶
Methods¶
GET : Get all list of endpoints.
Method: GET¶
GET : Get all list of endpoints.
Call¶
GET /admin/pjsip/endpoints
Returns¶
{
$defhdr,
"result": {
"list": [
{
...
},
...
]
}
}
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/endpoints
{
"api_ver": "0.1",
"result": {
"list": [
{
"account_code": "",
"acl": "",
"active_channels": "",
"aggregate_mwi": "true",
"allow": "(codec2|g723|ulaw|alaw|gsm|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|vp9|red|t140|t38|silk|silk|silk|silk)",
"allow_overlap": "true",
"allow_subscribe": "true",
"allow_transfer": "true",
"aors": "pjagent-01",
"asymmetric_rtp_codec": "false",
"auth": "pjagent-01",
"bind_rtp_to_media_address": "false",
"bundle": "false",
"call_group": "",
"caller_id": "<unknown>",
"caller_id_privacy": "allowed_not_screened",
"caller_id_tag": "",
"connected_line_method": "invite",
"contact_acl": "",
"context": "demo",
"cos_audio": 0,
"cos_video": 0,
"device_state": "Not in use",
"device_state_busy_at": 0,
"direct_media": "true",
"direct_media_glare_mitigation": "none",
"direct_media_method": "invite",
"disable_direct_media_on_nat": "false",
"disallow": "",
"dtls_ca_file": "",
"dtls_ca_path": "",
"dtls_cert_file": "",
"dtls_cipher": "",
"dtls_fingerprint": "SHA-256",
"dtls_private_key": "",
"dtls_rekey": 0,
"dtls_setup": "active",
"dtls_verify": "No",
"dtmf_mode": "rfc4733",
"fax_detect": "false",
"fax_detect_time": 0,
"force_avp": "false",
"force_rport": "true",
"from_domain": "",
"from_user": "",
"g_726_non_standard": "false",
"ice_support": "false",
"identify_by": "username,ip",
"inband_progress": "false",
"incoming_mwi_mailbox": "pjagent-01@vm-demo",
"language": "",
"mailboxes": "pjagent-01@vm-demo",
"max_audio_streams": 1,
"max_video_streams": 1,
"media_address": "",
"media_encryption": "no",
"media_encryption_optimistic": "false",
"media_use_received_transport": "false",
"message_context": "",
"moh_passthrough": "false",
"moh_suggest": "default",
"mwi_from_user": "",
"mwi_subscribe_replaces_unsolicited": "false",
"named_call_group": "",
"named_pickup_group": "",
"notify_early_inuse_ringing": "false",
"object_name": "pjagent-01",
"object_type": "endpoint",
"one_touch_recording": "false",
"outbound_auth": "",
"outbound_proxy": "",
"pickup_group": "",
"preferred_codec_only": "false",
"record_off_feature": "automixmon",
"record_on_feature": "automixmon",
"redirect_method": "",
"refer_blind_progress": "true",
"rel_100": "yes",
"rewrite_contact": "false",
"rpid_immediate": "false",
"rtcp_mux": "false",
"rtp_engine": "asterisk",
"rtp_ipv6": "false",
"rtp_keepalive": 0,
"rtp_symmetric": "false",
"rtp_timeout": 0,
"rtp_timeout_hold": 0,
"sdp_owner": "-",
"sdp_session": "Asterisk",
"send_diversion": "true",
"send_pai": "false",
"send_rpid": "false",
"set_var": "",
"srtp_tag32": "false",
"sub_min_expiry": "0",
"subscribe_context": "",
"t38_udptl": "false",
"t38_udptl_ec": "none",
"t38_udptl_ipv6": "false",
"t38_udptl_maxdatagram": 0,
"t38_udptl_nat": "false",
"timers": "yes",
"timers_min_se": "90",
"timers_sess_expires": 1800,
"tm_update": "2017-12-19T20:45:42.632334496Z",
"tone_zone": "",
"tos_audio": 0,
"tos_video": 0,
"transport": "transport-udp",
"trust_id_inbound": "false",
"trust_id_outbound": "false",
"use_avpf": "false",
"use_ptime": "false",
"user_eq_phone": "false",
"voicemail_extension": "",
"webrtc": "no"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-19T20:55:13.546370914Z"
}
/admin/pjsip/endpoints/<detail>¶
Methods¶
GET : Get detail endpoint info of given endpoint info.
Method: GET¶
GET : Get detail endpoint info of given endpoint info.
Returns¶
{
$defhdr,
"reuslt": {
...
}
}
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/pjsip/endpoints/pjagent-01
{
"api_ver": "0.1",
"result": {
"account_code": "",
"acl": "",
"active_channels": "",
"aggregate_mwi": "true",
"allow": "(codec2|g723|ulaw|alaw|gsm|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|jpeg|png|h261|h263|h263p|h264|mpeg4|vp8|vp9|red|t140|t38|silk|silk|silk|silk)",
"allow_overlap": "true",
"allow_subscribe": "true",
"allow_transfer": "true",
"aors": "pjagent-01",
"asymmetric_rtp_codec": "false",
"auth": "pjagent-01",
"bind_rtp_to_media_address": "false",
"bundle": "false",
"call_group": "",
"caller_id": "<unknown>",
"caller_id_privacy": "allowed_not_screened",
"caller_id_tag": "",
"connected_line_method": "invite",
"contact_acl": "",
"context": "demo",
"cos_audio": 0,
"cos_video": 0,
"device_state": "Not in use",
"device_state_busy_at": 0,
"direct_media": "true",
"direct_media_glare_mitigation": "none",
"direct_media_method": "invite",
"disable_direct_media_on_nat": "false",
"disallow": "",
"dtls_ca_file": "",
"dtls_ca_path": "",
"dtls_cert_file": "",
"dtls_cipher": "",
"dtls_fingerprint": "SHA-256",
"dtls_private_key": "",
"dtls_rekey": 0,
"dtls_setup": "active",
"dtls_verify": "No",
"dtmf_mode": "rfc4733",
"fax_detect": "false",
"fax_detect_time": 0,
"force_avp": "false",
"force_rport": "true",
"from_domain": "",
"from_user": "",
"g_726_non_standard": "false",
"ice_support": "false",
"identify_by": "username,ip",
"inband_progress": "false",
"incoming_mwi_mailbox": "pjagent-01@vm-demo",
"language": "",
"mailboxes": "pjagent-01@vm-demo",
"max_audio_streams": 1,
"max_video_streams": 1,
"media_address": "",
"media_encryption": "no",
"media_encryption_optimistic": "false",
"media_use_received_transport": "false",
"message_context": "",
"moh_passthrough": "false",
"moh_suggest": "default",
"mwi_from_user": "",
"mwi_subscribe_replaces_unsolicited": "false",
"named_call_group": "",
"named_pickup_group": "",
"notify_early_inuse_ringing": "false",
"object_name": "pjagent-01",
"object_type": "endpoint",
"one_touch_recording": "false",
"outbound_auth": "",
"outbound_proxy": "",
"pickup_group": "",
"preferred_codec_only": "false",
"record_off_feature": "automixmon",
"record_on_feature": "automixmon",
"redirect_method": "",
"refer_blind_progress": "true",
"rel_100": "yes",
"rewrite_contact": "false",
"rpid_immediate": "false",
"rtcp_mux": "false",
"rtp_engine": "asterisk",
"rtp_ipv6": "false",
"rtp_keepalive": 0,
"rtp_symmetric": "false",
"rtp_timeout": 0,
"rtp_timeout_hold": 0,
"sdp_owner": "-",
"sdp_session": "Asterisk",
"send_diversion": "true",
"send_pai": "false",
"send_rpid": "false",
"set_var": "",
"srtp_tag32": "false",
"sub_min_expiry": "0",
"subscribe_context": "",
"t38_udptl": "false",
"t38_udptl_ec": "none",
"t38_udptl_ipv6": "false",
"t38_udptl_maxdatagram": 0,
"t38_udptl_nat": "false",
"timers": "yes",
"timers_min_se": "90",
"timers_sess_expires": 1800,
"tm_update": "2017-12-19T20:45:42.632334496Z",
"tone_zone": "",
"tos_audio": 0,
"tos_video": 0,
"transport": "transport-udp",
"trust_id_inbound": "false",
"trust_id_outbound": "false",
"use_avpf": "false",
"use_ptime": "false",
"user_eq_phone": "false",
"voicemail_extension": "",
"webrtc": "no"
},
"statuscode": 200,
"timestamp": "2017-12-19T21:07:25.80668047Z"
}
/admin/pjsip/registration_outbounds¶
/admin/pjsip/registration_outbounds/<detail>¶
/admin/queue/cfg_queues¶
/admin/queue/cfg_queues/<detail>¶
/admin/queue/configurations¶
/admin/queue/configurations/<detail>¶
/admin/queue/entries¶
Methods¶
GET : Get list of all queue entries info.
Method: GET¶
Get list of all queue entries info.
Call¶
GET /admin/queue/entries
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"unique_id": "<string>",
"queue_name": "<string>",
"channel": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"position": <number>,
"wait": <number>,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of queue entries. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/entries
{
"api_ver": "0.1",
"result": {
"list": [
{
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000002",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"position": 1,
"queue_name": "sales_1",
"tm_update": "2017-12-18T00:23:39.821137155Z",
"unique_id": "1513556618.4",
"wait": null
}
]
},
"statuscode": 200,
"timestamp": "2017-12-18T00:23:40.94974824Z"
}
/admin/queue/entries/<detail>¶
Methods¶
GET : Get queue entry detail info of given queue entry info.
Method: GET¶
Get queue entry detail info of given queue entry info.
Returns¶
{
$defhdr,
"reuslt": {
"unique_id": "<string>",
"queue_name": "<string>",
"channel": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"position": <number>,
"wait": <number>,
"tm_update": "<timestamp>"
}
}
Return parameters
unique_id
: Unique id of channel.caller_id_num
: The name of the queue.channel
: Channel name.caller_id_name
: Caller’s name.caller_id_num
: Caller’s number.connected_line_name
: Connected line’s name.connected_line_num
: Connected line’s number.position
: Position in the queue.wait
: If set when paused, the reason the queue member was paused.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/entries/1513557067.6
{
"api_ver": "0.1",
"result": {
"caller_id_name": "pjagent-01",
"caller_id_num": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000004",
"connected_line_name": "<unknown>",
"connected_line_num": "<unknown>",
"position": 1,
"queue_name": "sales_1",
"tm_update": "2017-12-18T00:31:08.754950500Z",
"unique_id": "1513557067.6",
"wait": null
},
"statuscode": 200,
"timestamp": "2017-12-18T00:31:18.894580134Z"
}
/admin/queue/members¶
Methods¶
GET : Get list of all queue members info.
Method: GET¶
Get list of all queue members info.
Call¶
GET /admin/queue/members
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"id": "<string>",
"name": "<string>",
"queue_name": "<string>",
"status": <integer>,
"membership": "<string>",
"state_interface": "<string>",
"location": "<string>",
"paused": <integer>,
"paused_reason": "<string>",
"penalty": <integer>,
"calls_taken": <integer>,
"in_call": <integer>,
"last_call": <integer>,
"last_pause": <integer>,
"ring_inuse": <integer>,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of registry account. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/members
{
"api_ver": "0.1",
"result": {
"list": [
{
"id": "sip/agent-02@sales_1",
"calls_taken": 0,
"in_call": 0,
"last_call": 0,
"last_pause": 0,
"location": "sip/agent-02",
"membership": "dynamic",
"name": "sip/agent-02",
"paused": 0,
"paused_reason": "",
"penalty": 0,
"queue_name": "sales_1",
"ring_inuse": null,
"state_interface": "sip/agent-02",
"status": 4,
"tm_update": "2017-12-18T00:31:04.175880809Z"
},
...
]
},
"statuscode": 200,
"timestamp": "2017-12-18T00:34:45.370734689Z"
}
/admin/queue/members/<detail>¶
Methods¶
GET : Get queue member detail info of given queue member info.
Method: GET¶
Get queue member detail info of given queue member info.
Call¶
GET /admin/queue/members/<detail>?queue_name=<string>
Method parameters
detail
: member name.queue_name
: queue name.
Returns¶
{
$defhdr,
"reuslt": {
"id": "<string>",
"name": "<string>",
"queue_name": "<string>",
"status": <integer>,
"membership": "<string>",
"state_interface": "<string>",
"location": "<string>",
"paused": <integer>,
"paused_reason": "<string>",
"penalty": <integer>,
"calls_taken": <integer>,
"in_call": <integer>,
"last_call": <integer>,
"last_pause": <integer>,
"ring_inuse": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
* id
: member’s id.
name
: The name of the queue member.queue_name
: The name of the queue.status
: The numeric device state status of the queue member.membership
: Membership of queue member.state_interface
: Channel technology or location from which to read device state changes.location
: The queue member’s channel technology or location.paused
: Paused.paused_reason
: If set when paused, the reason the queue member was paused.penalty
: The penalty associated with the queue member.calls_taken
: The number of calls this queue member has serviced.in_call
: Set to 1 if member is in call. Set to 0 after LastCall time is updated.last_call
: The time this member last took a call, expressed in seconds since 00:00, Jan 1, 1970 UTC.last_pause
: The time when started last paused the queue member.ring_inuse
: Ring in use option.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/members/Agent%2F10001\?queue_name=sales_1
{
"api_ver": "0.1",
"result": {
"id": "Agent/10001@sales_1",
"calls_taken": 0,
"in_call": 0,
"last_call": 0,
"last_pause": 0,
"location": "Agent/10001",
"membership": "static",
"name": "Agent/10001",
"paused": 0,
"paused_reason": "",
"penalty": 0,
"queue_name": "sales_1",
"ring_inuse": null,
"state_interface": "Agent/10001",
"status": 4,
"tm_update": "2017-12-18T00:31:04.234368754Z"
},
"statuscode": 200,
"timestamp": "2017-12-18T00:38:27.704665757Z"
}
/admin/queue/queues¶
Methods¶
GET : Get list of all queues info.
Method: GET¶
Get list of all queues info
Call¶
GET /admin/queue/queues
Returns¶
{
$defhdr,
"reuslt": {
"list": [
{
"name": "<string>",
"strategy": "<string>",
"max": <integer>,
"weight": <integer>,
"calls": <integer>,
"completed": <integer>,
"abandoned": <integer>,
"hold_time": <integer>,
"talk_time": <integer>,
"service_level": <integer>,
"service_level_perf": <integer>,
"tm_update": "<timestamp>"
},
...
]
}
}
list
: array of registry account. * See detail at Method: GET.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/queues
{
"api_ver": "0.1",
"result": {
"list": [
{
"abandoned": 2,
"calls": 0,
"completed": 0,
"hold_time": 0,
"max": 0,
"name": "sales_1",
"service_level": 5,
"service_level_perf": 0.0,
"strategy": "ringall",
"talk_time": 0,
"tm_update": "2017-12-18T00:31:04.142068111Z",
"weight": 0
}
]
},
"statuscode": 200,
"timestamp": "2017-12-18T00:46:25.124236613Z"
}
/admin/queue/queues/<detail>¶
Methods¶
GET : Get queue detail info of given queue info.
Method: GET¶
Get queue detail info of given queue info.
Returns¶
{
$defhdr,
"reuslt": {
"name": "<string>",
"strategy": "<string>",
"max": <integer>,
"weight": <integer>,
"calls": <integer>,
"completed": <integer>,
"abandoned": <integer>,
"hold_time": <integer>,
"talk_time": <integer>,
"service_level": <integer>,
"service_level_perf": <integer>,
"tm_update": "<timestamp>"
}
}
Return parameters
name
: Queue name.strategy
: Call distribution.max
: Max waiting call count.weight
: Queue priority.calls
: Waiting call count.completed
: Completed call count.abandoned
: Abandoned call count.hold_time
: Average waiting time.talk_time
: Average talk time.service_level
: Service_level_perf interval time.service_leve_perf
: Service level performance.
Example¶
$ curl -k -X GET https://localhost:8081/v1/admin/queue/queues/sales_1
{
"api_ver": "0.1",
"result": {
"abandoned": 2,
"calls": 0,
"completed": 0,
"hold_time": 0,
"max": 0,
"name": "sales_1",
"service_level": 5,
"service_level_perf": 0.0,
"strategy": "ringall",
"talk_time": 0,
"tm_update": "2017-12-18T00:31:04.142068111Z",
"weight": 0
},
"statuscode": 200,
"timestamp": "2017-12-18T00:43:30.189014882Z"
}
/admin/user/users¶
Method: GET¶
Get the all users info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/admin/user/users\?authtoken=986d5648-3905-4def-8479-009b33939273
{
"api_ver": "0.1",
"result": {
"list": [
{
"name": "Test Administrator",
"password": "admin",
"tm_create": "2018-04-28T05:03:36.560694725Z",
"tm_update": "2018-04-28T07:10:29.116108422Z",
"username": "admin",
"uuid": "ed629979-802b-40f0-9098-b30b2988f9b6"
},
{
"name": "test1",
"password": "test1",
"tm_create": "2018-04-29T07:19:00.56688782Z",
"tm_update": "2018-05-02T16:18:36.730339477Z",
"username": "test1",
"uuid": "65abf0b4-9cd5-4bff-8ec9-c03c1aea22d4"
},
{
"name": "test2",
"password": "test2",
"tm_create": "2018-05-02T13:52:58.303710170Z",
"tm_update": "2018-05-03T03:55:08.886606228Z",
"username": "test2",
"uuid": "16d1e8ea-1331-4ba7-a371-2c6261e1ce33"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-03T08:46:52.150892217Z"
}
Method: POST¶
Create user info
Example¶
$ curl -k -X POST https://192.168.200.10:8081/v1/admin/user/users\?authtoken=986d5648-3905-4def-8479-009b33939273 -d '{"name": "test3", "password": "test3", "username": "test3"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-03T08:48:05.464359109Z"
}
/admin/user/users/<detail>¶
Methods¶
GET : Get the given detail user info.
PUT : Update the given detail user info.
DELETE : Delete the given detail user info.
Method: GET¶
Get the given detail user info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/admin/user/users/16d1e8ea-1331-4ba7-a371-2c6261e1ce33\?authtoken=986d5648-3905-4def-8479-009b33939273
{
"api_ver": "0.1",
"result": {
"name": "test2",
"password": "test2",
"tm_create": "2018-05-02T13:52:58.303710170Z",
"tm_update": "2018-05-03T03:55:08.886606228Z",
"username": "test2",
"uuid": "16d1e8ea-1331-4ba7-a371-2c6261e1ce33"
},
"statuscode": 200,
"timestamp": "2018-05-03T08:47:13.766737242Z"
}
Method: PUT¶
Update the given detail user info.
Example¶
$ curl -k -X PUT https://192.168.200.10:8081/v1/admin/user/users/4364a7cc-982b-448c-ba18-8a9b0fb3040d\?authtoken=986d5648-3905-4def-8479-009b33939273 -d '{"name": "test3 change"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-03T08:53:07.924367640Z"
}
/admin/user/contacts¶
/admin/user/contacts/<detail>¶
/admin/user/permissions¶
/admin/user/permissions/<detail>¶
/manager/sdialplans¶
/manager/sdialplans/<detail>¶
Methods¶
GET : Get the given detail static dialplan info.
PUT : Update the given detail static dialplan info.
DELETE : Delete the given detail static dialplan info.
/manager/trunks/<detail>¶
Methods¶
GET : Get the given detail trunk info.
PUT : Update the given detail trunk info.
DELETE : Delete the given detail trunk info.
/manager/users¶
Method: GET¶
Get the all users info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/manager/users?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502
{
"api_ver": "0.1",
"result": {
"list": [
{
"context": "",
"name": "Test Administrator",
"password": "admin",
"permissions": [
{
"permission": "admin"
},
{
"permission": "user"
}
],
"tm_create": "2018-04-28T05:03:36.560694725Z",
"tm_update": "2018-04-28T07:10:29.116108422Z",
"username": "admin",
"uuid": "ed629979-802b-40f0-9098-b30b2988f9b6"
},
{
"context": "demo",
"name": "test1",
"password": "test1",
"permissions": [
{
"permission": "user"
}
],
"tm_create": "2018-04-29T07:19:00.56688782Z",
"tm_update": null,
"username": "test1",
"uuid": "65abf0b4-9cd5-4bff-8ec9-c03c1aea22d4"
}
]
},
"statuscode": 200,
"timestamp": "2018-05-02T13:24:50.821980931Z"
}
Method: POST¶
Create user info
Example¶
$ curl -k -X POST https://192.168.200.10:8081/v1/manager/users?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502 -d '{"context": "demo", "name": "test2", "username": "test2", "password": "test2", "permissions": [{"permission": "user"}]}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-02T13:28:31.201418110Z"
}
/manager/users/<detail>¶
Methods¶
GET : Get the given detail user info.
PUT : Update the given detail user info.
DELETE : Delete the given detail user info.
Method: GET¶
Get the given detail user info.
Example¶
$ curl -k https://192.168.200.10:8081/v1/manager/users/3305c47b-fc87-4186-b4ef-30cef0c8f5b2?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502
{
"api_ver": "0.1",
"result": {
"context": "demo",
"name": "test2",
"password": "test2",
"permissions": [
{
"permission": "user"
}
],
"tm_create": "2018-05-02T13:28:31.101851891Z",
"tm_update": null,
"username": "test2",
"uuid": "3305c47b-fc87-4186-b4ef-30cef0c8f5b2"
},
"statuscode": 200,
"timestamp": "2018-05-02T13:30:52.782019666Z"
}
Method: PUT¶
Update the given detail user info.
Example¶
$ curl -k -X PUT https://192.168.200.10:8081/v1/manager/users/3305c47b-fc87-4186-b4ef-30cef0c8f5b2?authtoken=06d838a0-71b4-4236-8e93-b7ff59c61502 -d '{"context": "demo-test", "name": "test2", "username": "test2", "password": "test2", "permissions": [{"permission": "user"}]}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-05-02T13:38:39.731423546Z"
}
/me/buddies¶
Method: GET¶
Get the all buddy info.
Example¶
$ curl -k https://localhost:8081/me/buddies\?authtoken=490d3714-348a-4fb4-9748-0e6eef484b33
{
"api_ver": "0.1",
"result": [
{
"detail": null,
"name": null,
"tm_create": "2018-03-28T01:37:52.133197867Z",
"tm_update": null,
"uuid": "611f9902-00c9-4765-9775-20fbaf8261b0",
"uuid_user": "980404a2-f509-4140-9c92-96a018d1b61c"
}
],
"statuscode": 200,
"timestamp": "2018-03-28T01:46:34.598437496Z"
}
/me/contacts¶
Methods¶
GET : Get all contacts info.
Method: GET¶
Get all contacts info.
Example¶
$ curl -k https://localhost:8081/v1/me/contacts\?authtoken=73fe26da-bdcf-4558-afb8-b241deb00aba
{
"api_ver": "0.1",
"result": {
"list": [
{
"detail": "test target detail 4",
"info": {
"id": "199",
"password": "199",
"public_url": "sip:199@192.168.200.10",
"realm": "localhost"
},
"name": "test target",
"target": "199",
"tm_create": "2018-02-13T17:54:12.399972783Z",
"tm_update": "2018-03-28T01:15:50.278779412Z",
"type": "pjsip_endpoint",
"user_uuid": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid": "62a78a12-34ba-4b4f-b9ea-e52e4bac6459"
}
]
},
"statuscode": 200,
"timestamp": "2018-04-12T14:28:30.181544876Z"
}
/me/chats¶
Method: GET¶
Get the all chat info
Example¶
$ curl -k https://localhost:8081/me/chats\?authtoken=17cd592d-2706-44b6-b6e2-1c244b946cf0
{
"api_ver": "0.1",
"result": [
{
"detail": "test chat detail",
"name": "test chat name",
"room": {
"members": [
"59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"980404a2-f509-4140-9c92-96a018d1b61c"
],
"tm_create": "2018-03-27T06:53:37.432474880Z",
"tm_update": null,
"type": 1,
"uuid": "57b8706a-67e7-4c3a-a070-b164a08562ab",
"uuid_creator": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"tm_create": "2018-03-27T06:53:37.496918935Z",
"tm_update": null,
"uuid": "15130428-6f27-456d-b744-6156e3a4b7a8"
}
],
"statuscode": 200,
"timestamp": "2018-03-27T10:44:06.311937832Z"
}
Method: POST¶
Create chat info
Example¶
$ curl -k -X POST https://localhost:8081/me/chats\?authtoken=32644555-58e5-4d03-9608-a66ed1651f12 -d \
'{"name": "test chat name", "detail": "test chat detail", "type": 1, \
"members": ["980404a2-f509-4140-9c92-96a018d1b61c", "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"]}'
{"api_ver": "0.1", "timestamp": "2018-03-26T16:10:54.451912673Z", "statuscode": 200}
/me/chats/<detail>¶
Methods¶
GET : Get the given detail chat info.
PUT : Update the given detail chat info.
DELETE : Delete the given detail chat info.
Method: GET¶
Get the given detail chat info.
Example¶
$ curl -k https://localhost:8081/me/chats/15130428-6f27-456d-b744-6156e3a4b7a8\?authtoken=17cd592d-2706-44b6-b6e2-1c244b946cf0
{
"api_ver": "0.1",
"result": {
"detail": "test chat detail",
"name": "test chat name",
"room": {
"members": [
"59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"980404a2-f509-4140-9c92-96a018d1b61c"
],
"tm_create": "2018-03-27T06:53:37.432474880Z",
"tm_update": null,
"type": 1,
"uuid": "57b8706a-67e7-4c3a-a070-b164a08562ab",
"uuid_creator": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"tm_create": "2018-03-27T06:53:37.496918935Z",
"tm_update": null,
"uuid": "15130428-6f27-456d-b744-6156e3a4b7a8"
},
"statuscode": 200,
"timestamp": "2018-03-27T10:39:34.496808298Z"
}
Method: PUT¶
Update the given detail chat info.
Example¶
$ curl -k -X PUT https://localhost:8081/me/chats/7c817566-3c4a-4d97-b4f0-e29b2d2e1564\?authtoken=d2718890-043f-43c8-9bf9-79c2602d2c81 -d '{"name": "update test chat name"}'
{
"api_ver": "0.1",
"statuscode": 200,
"timestamp": "2018-03-26T07:27:03.713679335Z"
}
Method: DELETE¶
Delete the given detail chat info.
Example¶
- ::
$ curl -k -X DELETE https://localhost:8081/me/chats/7c817566-3c4a-4d97-b4f0-e29b2d2e1564?authtoken=d2718890-043f-43c8-9bf9-79c2602d2c81
- {
- “api_ver”: “0.1”, “statuscode”: 200, “timestamp”: “2018-03-26T07:28:19.397554581Z”
}
/me/chats/<detail>/messages¶
Method: GET¶
Get chat message
Call¶
GET /me/chats/<detail>/messages?authtoken=<string>[×tamp=<string>&count=<number>]
Method parameters
detail
: chat uuid.timestamp
: Uri encoded UTC timestamp.count
: number of message
Example¶
$ curl -k https://localhost:8081/me/chats/15130428-6f27-456d-b744-6156e3a4b7a8/messages\?authtoken=17cd592d-2706-44b6-b6e2-1c244b946cf0\×tamp=2018-03-30T08%3A30%3A02.364443446Z\&count=2
{
"api_ver": "0.1",
"result": [
{
"message": {
"message": "test message"
},
"tm_create": "2018-03-27T10:26:14.452323600Z",
"uuid": "1800fcee-1077-47f0-9d7c-3c7cde768e93",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
{
"message": {
"message": "test message"
},
"tm_create": "2018-03-27T08:30:50.225964433Z",
"uuid": "eb251f63-8ed1-4a00-b757-20a88caa8a20",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
}
],
"statuscode": 200,
"timestamp": "2018-03-27T10:36:04.543077586Z"
}
/me/info¶
Methods¶
GET : Get me info.
Method: GET¶
Get me info.
Example¶
$ curl -k https://localhost:8081/me/info\?authtoken=88fa51b6-e980-4e57-93cb-7cdefd21b2a1
{
"api_ver": "0.1",
"result": {
"chats": [
{
"detail": "test chat detail",
"name": "test chat name",
"room": {
"members": [
"59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"980404a2-f509-4140-9c92-96a018d1b61c"
],
"tm_create": "2018-03-27T06:53:37.432474880Z",
"tm_update": null,
"type": 1,
"uuid": "57b8706a-67e7-4c3a-a070-b164a08562ab",
"uuid_creator": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid_owner": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"tm_create": "2018-03-27T06:53:37.496918935Z",
"tm_update": null,
"uuid": "15130428-6f27-456d-b744-6156e3a4b7a8"
}
],
"contacts": [
{
"detail": "test target detail 4",
"info": {
"id": "199",
"password": "199",
"public_url": "sip:199@192.168.200.10",
"realm": "localhost"
},
"name": "test target",
"target": "199",
"tm_create": "2018-02-13T17:54:12.399972783Z",
"tm_update": "2018-03-27T20:24:51.355343689Z",
"type": "pjsip_endpoint",
"user_uuid": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf",
"uuid": "62a78a12-34ba-4b4f-b9ea-e52e4bac6459"
}
],
"name": "teset admin",
"tm_create": "2018-02-13T17:42:16.453145450Z",
"tm_update": "2018-03-27T08:30:03.254978318Z",
"username": "admin",
"uuid": "59e3a7d5-b05f-43cd-abdf-db7009eed6cf"
},
"statuscode": 200,
"timestamp": "2018-03-27T20:25:32.526413444Z"
}
/me/search¶
Methods¶
GET : Get searched info.
Method: GET¶
Get searched info
Example¶
$ curl -k https://localhost:8081/v1/me/search\?filter=test\&type=username\&authtoken=8eaa8d32-b58d-494a-a323-c0535b6f66d5
{
"api_ver": "0.1",
"result": {
"list": [
{
"name": "test name",
"username": "test",
"uuid": "980404a2-f509-4140-9c92-96a018d1b61c"
}
]
},
"statuscode": 200,
"timestamp": "2018-04-12T06:42:15.741891135Z"
}
EVENT basics¶
EVENT¶
core.agi¶
Notify core agi event.
core.agi.create¶
Notify event for core agi create.
Example¶
topic: /core/agis/pjagent-02
{
"core.agi.create": {
"unique_id": "1516635793.1",
"channel": "PJSIP/pjagent-02-00000001",
"linked_id": "1516635793.1",
"channel_state_desc": "Ring",
"language": "en",
"channel_state": 4,
"caller_id_name": "pjagent-02",
"caller_id_num": "pjagent-02",
"priority": "2",
"connected_line_num": "<unknown>",
"connected_line_name": "<unknown>",
"account_code": "",
"context": "sample-agi-async",
"env": {
"agi_request": "async",
"agi_uniqueid": "1516635793.1",
"agi_enhanced": "0.0",
"agi_callingpres": "0",
"agi_version": "GIT-master-516ab38M",
"agi_callington": "0",
"agi_channel": "PJSIP/pjagent-02-00000001",
"agi_language": "en",
"agi_extension": "s",
"agi_type": "PJSIP",
"agi_callerid": "pjagent-02",
"agi_callingani2": "0",
"agi_priority": "2",
"agi_calleridname": "pjagent-02",
"agi_dnid": "4006",
"agi_callingtns": "0",
"agi_rdnis": "unknown",
"agi_arg_1": "test argument 1",
"agi_context": "sample-agi-async",
"agi_accountcode": "",
"agi_threadid": "1984414752",
"agi_arg_2": "test argument 2"
},
"exten": "s",
"cmd": {},
"tm_update": "2018-01-22T15:43:13.166737961Z"
}
}
core.agi.update¶
Notify event for core agi update.
Example¶
topic: /core/agi/pjagent-01
{
"core.agi.update": {
"unique_id": "1516637665.7",
"channel_state": 6,
"caller_id_name": "pjagent-02",
"tm_update": "2018-01-22T16:14:51.595209834Z",
"cmd": {
"77cdcf4c-feed-11e7-bd12-5b24ee4818c3": {
"result": "200 result=0\n",
"tm_update": "2018-01-22T16:14:51.595209834Z"
}
},
"linked_id": "1516637665.7",
"language": "en",
"channel": "PJSIP/pjagent-02-00000006",
"channel_state_desc": "Up",
"caller_id_num": "pjagent-02",
"connected_line_num": "<unknown>",
"exten": "s",
"connected_line_name": "<unknown>",
"account_code": "",
"context": "sample-agi-async",
"priority": "2",
"env": {
"agi_request": "async",
"agi_context": "sample-agi-async",
"agi_channel": "PJSIP/pjagent-02-00000006",
"agi_language": "en",
"agi_type": "PJSIP",
"agi_uniqueid": "1516637665.7",
"agi_version": "GIT-master-516ab38M",
"agi_callerid": "pjagent-02",
"agi_callingani2": "0",
"agi_callingtns": "0",
"agi_calleridname": "pjagent-02",
"agi_arg_1": "test argument 1",
"agi_callingpres": "0",
"agi_callington": "0",
"agi_dnid": "4006",
"agi_rdnis": "unknown",
"agi_extension": "s",
"agi_accountcode": "",
"agi_priority": "2",
"agi_enhanced": "0.0",
"agi_threadid": "1954337824",
"agi_arg_2": "test argument 2"
}
}
}
core.agi.delete¶
Notify event for core agi delete.
Example¶
topic: /core/agi/pjagent-01
{
"core.agi.delete": {
"unique_id": "1516637665.7",
"channel_state": 6,
"caller_id_name": "pjagent-02",
"tm_update": "2018-01-22T16:24:23.1900430Z",
"cmd": {
"77cdcf4c-feed-11e7-bd12-5b24ee4818c3": {
"result": "200 result=0\n",
"tm_update": "2018-01-22T16:14:51.595209834Z"
}
},
"linked_id": "1516637665.7",
"language": "en",
"channel": "PJSIP/pjagent-02-00000006",
"channel_state_desc": "Up",
"caller_id_num": "pjagent-02",
"connected_line_num": "<unknown>",
"exten": "s",
"connected_line_name": "<unknown>",
"account_code": "",
"context": "sample-agi-async",
"priority": "2",
"env": {
"agi_request": "async",
"agi_context": "sample-agi-async",
"agi_channel": "PJSIP/pjagent-02-00000006",
"agi_language": "en",
"agi_type": "PJSIP",
"agi_uniqueid": "1516637665.7",
"agi_version": "GIT-master-516ab38M",
"agi_callerid": "pjagent-02",
"agi_callingani2": "0",
"agi_callingtns": "0",
"agi_calleridname": "pjagent-02",
"agi_arg_1": "test argument 1",
"agi_callingpres": "0",
"agi_callington": "0",
"agi_dnid": "4006",
"agi_rdnis": "unknown",
"agi_extension": "s",
"agi_accountcode": "",
"agi_priority": "2",
"agi_enhanced": "0.0",
"agi_threadid": "1954337824",
"agi_arg_2": "test argument 2"
}
}
}
core.channel¶
Notify core channel event.
core.channel.create¶
Notify event for core channel create.
Example¶
topic: /core/channels/pjagent-01
{
"core.channel.create": {
"unique_id": "1513946313.6",
"duration": null,
"linked_id": "1513946313.6",
"context": "demo",
"connected_line_num": "<unknown>",
"account_code": "",
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"caller_id_name": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000006",
"channel_state": 4,
"caller_id_num": "pjagent-01",
"language": "en",
"exten": "4002",
"variables": {},
"hangup_cause": null,
"priority": "1",
"application": null,
"application_data": null,
"tm_update": "2017-12-22T12:38:33.971448254Z",
"bridge_id": null,
"hangup_cause_desc": null
}
}
core.channel.update¶
Notify event for core channel update.
Example¶
topic: /core/channels/pjagent-01
{
"core.channel.update": {
"unique_id": "1513946313.6",
"duration": null,
"linked_id": "1513946313.6",
"context": "queue_sales",
"connected_line_num": "<unknown>",
"account_code": "",
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"caller_id_name": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000006",
"channel_state": 4,
"caller_id_num": "pjagent-01",
"language": "en",
"exten": "s",
"variables": {
"ABANDONED": "TRUE"
},
"hangup_cause": null,
"priority": "2",
"application": "Queue",
"application_data": "",
"tm_update": "2017-12-22T12:38:37.542000617Z",
"bridge_id": null,
"hangup_cause_desc": null
}
}
core.channel.delete¶
Notify event for core channel delete.
Example¶
topic: /core/channels/pjagent-01
{
"core.channel.delete": {
"unique_id": "1513946313.6",
"duration": null,
"linked_id": "1513946313.6",
"context": "queue_sales",
"connected_line_num": "<unknown>",
"account_code": "",
"channel_state_desc": "Ring",
"connected_line_name": "<unknown>",
"caller_id_name": "pjagent-01",
"channel": "PJSIP/pjagent-01-00000006",
"channel_state": 4,
"caller_id_num": "pjagent-01",
"language": "en",
"exten": "s",
"variables": {
"ABANDONED": "TRUE",
"QUEUEPOSITION": "1"
},
"hangup_cause": 127,
"priority": "2",
"application": "Queue",
"application_data": "",
"tm_update": "2017-12-22T12:38:37.623937167Z",
"bridge_id": null,
"hangup_cause_desc": "Interworking, unspecified"
}
}
park.parkedcall¶
Notify park parkedcall event.
core.channel.create¶
Notify event for core channel create.
Example¶
topic: /park/parkinglots/default
{
"park.parkedcall.create": {
"parkee_unique_id": "1514424631.119",
"parking_lot": "default",
"parkee_caller_id_num": "pjagent-01",
"parkee_exten": "s",
"parkee_linked_id": "1514424631.119",
"parkee_connected_line_num": "<unknown>",
"parkee_channel": "PJSIP/pjagent-01-00000048",
"parkee_account_code": "",
"parkee_caller_id_name": "pjagent-01",
"parkee_channel_state_desc": "Up",
"tm_update": "2017-12-28T01:30:31.382834514Z",
"parkee_channel_state": "6",
"parking_timeout": 45,
"parkee_connected_line_name": "<unknown>",
"parkee_context": "sample_park",
"parker_dial_string": "PJSIP/pjagent-01",
"parking_duration": 0,
"parkee_priority": "2",
"parking_space": "701"
}
}
park.parkedcall.delete¶
Notify event for park parkedcall delete.
Example¶
topic: /park/parkinglots/default
{
"park.parkedcall.delete": {
"parkee_unique_id": "1514425145.127",
"parking_lot": "default",
"parkee_caller_id_num": "pjagent-01",
"parkee_exten": "s",
"parkee_linked_id": "1514425145.127",
"parkee_connected_line_num": "<unknown>",
"parkee_channel": "PJSIP/pjagent-01-0000004c",
"parkee_account_code": "",
"parkee_caller_id_name": "pjagent-01",
"parkee_channel_state_desc": "Up",
"tm_update": "2017-12-28T01:39:05.298799696Z",
"parkee_channel_state": "6",
"parking_timeout": 45,
"parkee_connected_line_name": "<unknown>",
"parkee_context": "sample_park",
"parker_dial_string": "PJSIP/pjagent-01",
"parking_duration": 0,
"parkee_priority": "2",
"parking_space": "701"
}
}
queue.entry¶
Queue enty event.
queue.entry.delete¶
Event for queue entry delete.
Event¶
{
"queue.entry.delete": {
"unique_id": "<string>",
"queue_name": "<string>",
"channel": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"position": <number>,
"wait": <number>,
"tm_update": "<timestamp>"
}
}
- See detail at Asterisk’s queue info.
Example¶
topic: /queue/statuses/sales%5F1
{
"queue.entry.delete": {
"unique_id": "1513886574.11",
"connected_line_num": "<unknown>",
"queue_name": "sales_1",
"wait": null,
"position": 1,
"channel": "PJSIP/pjagent-01-0000000b",
"caller_id_num": "pjagent-01",
"caller_id_name": "pjagent-01",
"connected_line_name": "<unknown>",
"tm_update": "2017-12-21T20:02:55.766020378Z"
}
}
queue.entry.update¶
Event for queue entry insert/update.
Event¶
{
"queue.entry.update": {
"unique_id": "<string>",
"queue_name": "<string>",
"channel": "<string>",
"caller_id_name": "<string>",
"caller_id_num": "<string>",
"connected_line_name": "<string>",
"connected_line_num": "<string>",
"position": <number>,
"wait": <number>,
"tm_update": "<timestamp>"
}
}
- See detail at Asterisk’s queue info.
Example¶
topic: /queue/statuses/sales%5F1
{
"queue.entry.update": {
"unique_id": "1513887042.12",
"caller_id_name": "pjagent-01",
"connected_line_num": "<unknown>",
"position": 1,
"tm_update": "2017-12-21T20:10:43.841799160Z",
"queue_name": "sales_1",
"channel": "PJSIP/pjagent-01-0000000c",
"caller_id_num": "pjagent-01",
"connected_line_name": "<unknown>",
"wait": null
}
}
queue.member¶
Queue member event.
queue.member.delete¶
Event for queue member delete.
Event¶
{
"queue.entry.delete": {
"id": "<string>",
"name": "<string>",
"queue_name": "<string>",
"status": <integer>,
"membership": "<string>",
"state_interface": "<string>",
"location": "<string>",
"paused": <integer>,
"paused_reason": "<string>",
"penalty": <integer>,
"calls_taken": <integer>,
"in_call": <integer>,
"last_call": <integer>,
"last_pause": <integer>,
"ring_inuse": <integer>,
"tm_update": "<timestamp>"
}
}
- See detail at Asterisk’s queue info.
Example¶
topic: /queue/statuses/sales%5F1
{
"queue.member.delete": {
"location": "sip/agent-01",
"penalty": 0,
"ring_inuse": 1,
"id": "sip/agent-01@sales_1",
"state_interface": "sip/agent-01",
"queue_name": "sales_1",
"name": "sip/agent-01",
"membership": "dynamic",
"calls_taken": 0,
"last_call": 0,
"last_pause": 0,
"in_call": 0,
"status": 4,
"paused": 0,
"paused_reason": "",
"tm_update": "2017-12-21T21:35:04.605327430Z"
}
}
queue.member.update¶
Event for queue member insert/update.
Event¶
{
"queue.member.update": {
"id": "<string>",
"name": "<string>",
"queue_name": "<string>",
"status": <integer>,
"membership": "<string>",
"state_interface": "<string>",
"location": "<string>",
"paused": <integer>,
"paused_reason": "<string>",
"penalty": <integer>,
"calls_taken": <integer>,
"in_call": <integer>,
"last_call": <integer>,
"last_pause": <integer>,
"ring_inuse": <integer>,
"tm_update": "<timestamp>"
}
}
- See detail at Asterisk’s queue info.
Example¶
topic: /queue/statuses/sales%5F1
{
"queue.member.update": {
"location": "sip/agent-01",
"penalty": 0,
"ring_inuse": 1,
"id": "sip/agent-01@sales_1",
"state_interface": "sip/agent-01",
"queue_name": "sales_1",
"name": "sip/agent-01",
"membership": "dynamic",
"calls_taken": 0,
"last_call": 0,
"last_pause": 0,
"in_call": 0,
"status": 4,
"paused": 0,
"paused_reason": "",
"tm_update": "2017-12-21T21:35:04.605327430Z"
}
}
queue.queue¶
queue.queue.update¶
Event¶
{
"queue.queue.update": {
"name": "<string>",
"strategy": "<string>",
"max": <integer>,
"weight": <integer>,
"calls": <integer>,
"completed": <integer>,
"abandoned": <integer>,
"hold_time": <integer>,
"talk_time": <integer>,
"service_level": <integer>,
"service_level_perf": <integer>,
"tm_update": "<timestamp>"
}
}
- See detail at Asterisk’s queue info.
Example¶
topic: /queue/statuses/sales%5F1
{
"queue.queue.update": {
"weight": 0,
"name": "sales_1",
"service_level": 5,
"abandoned": 6,
"service_level_perf": 0.0,
"max": 0,
"hold_time": 0,
"strategy": "ringall",
"calls": 0,
"tm_update": "2017-12-21T18:35:17.131303352Z",
"talk_time": 0,
"completed": 0
}
}
Websock basics¶
The jade supports subscription through the Websocket.
Topic subscription¶
To subscribe topic through the websocket, the client needs to send subscription request first.
{
"type": "<message type>",
"topic": "<topic string>"
}
message type
: message type.- subscribe: add subsciption.
- unsubscribe: remove subscription.
topic
: Subscribe/Unsubscribe topic.
Example¶
{"type":"subscribe", "topic": "/"}
Outbound Basic¶
Concept¶
Principle¶
The asterisk-outbound has a 5W1H principle.

Basic concept
- Campaign : Determine why make a call(Why).
- Plan : Determine how/when to make a call(How/When).
- Destination : Determine who get a call after answer(Who).
- Dial list(Dial List Master) : Determine where/what call heading for(Where/What).
Features¶
Call balancing¶
The res_outbound supports call balancing.
With this feature, the res_outbound can managing the amount of outbound call depends on the destination’s condition.
For example, if the destination is queue, it calculate waiting agent’s number and queue’s performance.
Stratigical retrying¶
The res_outbound supports the stratigical retrying.
The user can set retry counts and retry delay time for each call.
Customer info based dial list¶
The res_outbound supports customer based dial list.
The user can set the customer’s detail info such as name, detail, database key, email, … not only for numbers And supports several types of numbers.
Call capsulization¶
The res_outbound supports the call capsulization.
When the res_outbound making a call, the call kept all the resource info itself. So, if the other resources chagned later, it doesn’t affect to the existing call.
It makes call-capsulization.
Dynamic resource management¶
The res_outbound supports the dynamic resource management.
Campaign scheduling¶
The res_outbound supports the campaign scheduling.
The user can set the auto-start, auto-end.
Set variables¶
The res_outbound supports variables setting.
The user can set the variables for each resources.
It can deliver to the dialplan or SIP headers.
Monitoring¶
Detail dial result¶
The res_outbound supports the detail dial result.
In the result, the user can check the all the call info(original info, dialing info, result info).
Resources¶
Campaign¶
- Set destination, plan, dial list(dlma).
Destination¶
- Call’s transfer destination after customer has answered.
Plan¶
Dialling stragegy. * UUI delivery. * Dial mode * Dialing control.
Dial list¶
Customer info list. * Dial number. * UUI info.
Campaign¶
Determine why make a call(Why).
To dial to the customer, the user need to create the campaign first and need to assign the correct resources(destination, plan, dial list master).
Then the resources determine where/what/who/how/when make a call to the customer.
Status¶
The campaign has a status. See detail Campaign status.
Scheduling¶
The user can sets scheduling for campaign. See detail Scheduling.
Plan¶
Determine how/when to make a call(How/When).
Dial mode¶
The user can sets the dial mode. See detail Dial mode.
Predictive¶
- Predict the number of customers to dial based on the deliver application/agent’s answer rate.
- Predict how many call will be answered or not answered.
- Calculate possilbilties automatically.
Preview¶
- The destination makes decision to make a call.
- Developing.
SMS¶
- Send an SMS messages
- Developing.
Fax¶
- Send a fax
- Developing.
Service level¶
Service level controling the amount of dailing.
(Max available outbound call count) - (Current outbound call count) + (Service level) = (Available call count)
If the (Available call count) is bigger than 0, make a call.
Max available outbound call count¶
The max available outbound call count is depends on the destination.
See detail Destination.
Destination¶
Determine who get a call after answer(Who). And it determine the max available outbound call count.
Normaly, the destination suppose to be an agent. But in the asterisk system, the destination could be anything. For example, it could be extension or application(queue).
If the destination type is application, then the res_outbound calcaulate applciation’s availablity.
Result¶
Result data devided by 5 sections.
Identity info, Dial info, Result info, Timestamp info, Related resources info.
Outbound Structure¶
Basic structures¶
Destination¶
Campaign¶
Campaign status¶
Status | Detail |
---|---|
0 | Stop |
1 | Start |
2 | Pause |
10 | Stopping |
11 | Starting |
12 | Pausing |
30 | Stopping forcedly |
Scheduling¶
The campaign can sets schedule. If the schedule sets, the campaign start and stop automatically on schedule.
Scheduling time¶
Scheduling time. 24H
hh:mm:ss
- hh : Hour. 00 ~ 23
- mm : Minute. 00 ~ 59
- ss : Second. 00 ~ 59
Example
15:00:00
Scheduling date¶
Scheduling date.
YYYY-MM-DD
- YYYY : Year.
- MM : Month.
- DD : Day.
Example
- ::
- 2016-11-17
Scheduling date list¶
List of scheduling date.
YYYY-MM-DD, YYYY-MM-DD
Example
2016-11-16, 2016-11-17, 2016-11-18, ...
Scheduling day list¶
List of scheduling day.
0 : Sunday
1 : Monday
2 : Tuesday
3 : Wednesday
4 : Thursday
5 : Friday
6 : Satursay
Example
0, 1, 3, 4
Plan¶
Dial list end handling¶
Mode | Detail |
---|---|
0 | Keep current status. |
1 | Stop the campaign. |
Trunk name¶
Determine outbound call trunk info.
Dial list¶
Dialing¶
Dialing status¶
Status | Detail |
---|---|
0 | None |
1 | Originate request sent. |
2 | Originate queued. |
3 | Dial begin. |
4 | Channel created. |
5 | Dial end. |
6 | Originate responsed. |
7 | Hangup. |
10 | Error occurred. |
11 | Originate request failed. Could not send originate request. |
12 | Originate queued failed. |
13 | Originate response failed. |
Dial result¶
Result | Detail |
---|---|
0 | No dail result event received yet. |
1 | Other end has hungup |
2 | Local ring |
3 | Remote end is ringing |
4 | Remote end has answered |
5 | Remote end is busy |
6 | Make it go off hook |
7 | Line is off hook |
8 | Congestion (circuits busy) |
9 | Flash hook |
10 | Wink |
11 | Set a low-level option |
12 | Key Radio |
13 | Un-Key Radio |
14 | Indicate PROGRESS |
15 | Indicate CALL PROCEEDING |
16 | Indicate call is placed on hold |
17 | Indicate call is left from hold |
18 | Indicate video frame update |
19 | T38 state change request/notification deprecated This is no longer supported. Use AST_CONTROL_T38_PARAMETERS instead. |
20 | Indicate source of media has changed |
21 | Indicate status of a transfer request |
22 | Indicate connected line has changed |
23 | Indicate redirecting id has changed |
24 | T38 state change request/notification with parameters |
25 | Indication that Call completion service is possible |
26 | Media source has changed and requires a new RTP SSRC |
27 | Tell ast_read to take a specific action |
28 | Advice of Charge with encoded generic AOC payload |
29 | Indicate that this position was the end of the channel queue for a softhangup. |
30 | Indication that the extension dialed is incomplete |
31 | Indicate that the caller is being malicious. |
32 | Interrupt the bridge and have it update the peer |
33 | Contains an update to the protocol-specific cause-code stored for branching dials |
34 | A masquerade is about to begin/end. (Never sent as a frame but directly with ast_indicate_data().) |
1000 | Indicate to a channel in playback to stop the stream. |
1001 | Indicate to a channel in playback to suspend the stream. |
1002 | Indicate to a channel in playback to restart the stream. |
1003 | Indicate to a channel in playback to rewind. |
1004 | Indicate to a channel in playback to fast forward. |
1100 | Indicated to a channel in record to stop recording and discard the file. |
1101 | Indicated to a channel in record to stop recording. |
1102 | Indicated to a channel in record to suspend/unsuspend recording. |
1103 | Indicated to a channel in record to mute/unmute (i.e. write silence) recording. |
Hangup result¶
Result | Detail |
---|---|
0 | No hangup event received yet. |
1 | Unallocated. |
2 | No route trasit network. |
3 | No route destination. |
5 | Mis dialled trunk prefix. |
6 | Channel unacceptable. |
7 | Call awarded delivered. |
8 | Pre empted. |
14 | Number ported not here. |
16 | Normal clearing. |
17 | User busy. |
18 | No user response. |
19 | No answer. |
20 | Subscriber absent. |
21 | Call rejected. |
22 | Number changed. |
23 | Redirected to new destination. |
26 | Answered eleswhere. |
27 | Destination out of order. |
28 | Invalid number format. |
29 | Facility rejected. |
30 | Response to status enquiry. |
31 | Normal unspecified. |
34 | Normal circuit congestion. |
38 | Network out of order. |
41 | Normal temporary failure. |
42 | Switch congestion. |
43 | Access info discarded. |
44 | Requested chan unavail. |
50 | Facility not subscribed. |
52 | Outgoing call barred. |
54 | Incoming call barred. |
57 | Bearer capability not auth. |
58 | Bearer capability not available. |
65 | Bearer capability not implemented. |
66 | Channel not implemented. |
69 | Facility not implemented. |
81 | Invalid call reference. |
88 | Incompatible destination. |
95 | Invalid message unspecified. |
96 | Madatory item missing. |
97 | Message type nonexist. |
98 | Wrong message. |
99 | Item nonexist. |
100 | Invalid item contents. |
101 | Wrong call state. |
102 | Recovery on timer expire. |
103 | Mandatory item length error. |
111 | Protocol error. |
127 | Internetwroking. |
Outbound tutorial¶
Preparation¶
We need two groups of peers. The agent and client.
Add the agent(sip) info¶
Add the agent info to the /etc/asterisk/sip.conf
This sip info is act like an agent.
Assume that we have below agent info.
[agent-01]
type=friend
secret=*****
host=dynamic
[agent-02]
type=friend
secret=*****
host=dynamic
[agent-03]
type=friend
secret=*****
host=dynamic
Add the client/customer(sip) info¶
Add the client info to the /etc/asterisk/sip.conf
This sip info is act like an client(customer).
Assume that we have a below client info.
[300]
type=friend
secret=*****
host=dynamic
[301]
type=friend
secret=*****
host=dynamic
[302]
type=friend
secret=*****
host=dynamic
Settings¶
saturn*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
300/83916470 192.168.200.1 D No Auto (Yes) 56389 OK (1 ms)
301/19563407 192.168.200.1 D No Auto (Yes) 56389 OK (1 ms)
302/52704186 192.168.200.1 D No Auto (Yes) 56389 OK (1 ms)
303/84613297 192.168.200.1 D No Auto (Yes) 56389 OK (7 ms)
agent-01/59041286 192.168.200.1 D No Auto (Yes) 56389 OK (1 ms)
agent-02/20369415 192.168.200.1 D No Auto (Yes) 56389 OK (1 ms)
agent-03/26315780 192.168.200.1 D No Auto (Yes) 56389 OK (1 ms)
...
17 sip peers [Monitored: 7 online, 0 offline Unmonitored: 0 online, 10 offline]
Basic tutorial¶
Dial to the customer. After the customer answered call, the call will be transfferred to the parking lot.
- Create a plan.
- Create a destination.
- Create dlma and dial list.
- Create a campaign.
- Update campaign status to start.
- Check dial list status.
Create plan¶
$ curl -X POST http://192.168.200.10:8081/plans -d
'{"name":"basic tutorial plan", "detail":"test plan for basic tutorial", "tech_name":"sip", "dial_mode":1}'
{
"api_ver": "0.1",
"timestamp": "2017-03-08T01:42:40.668089274Z",
"statuscode": 200,
"result": {
"tm_delete": null,
"caller_id": null,
"uuid": "50fd1e1f-920b-477a-b84c-afe58928dadc",
"name": "basic tutorial plan",
"detail": "test plan for basic tutorial",
"max_retry_cnt_1": 5,
"max_retry_cnt_7": 5,
"in_use": 1,
"max_retry_cnt_8": 5,
"service_level": 0,
"dial_timeout": 30000,
"variables": null,
"dial_mode": 1,
"codecs": null,
"dl_end_handle": 1,
"retry_delay": 60,
"trunk_name": null,
"early_media": null,
"max_retry_cnt_2": 5,
"tech_name": "sip",
"max_retry_cnt_4": 5,
"max_retry_cnt_3": 5,
"max_retry_cnt_5": 5,
"max_retry_cnt_6": 5,
"tm_create": "2017-03-08T01:42:40.551073859Z",
"tm_update": null
}
}
Create destination¶
$ curl -X POST http://192.168.200.10:8081/destinations -d
'{"name": "basic tutorial destination", "detail":"test pln for basic tutorial", "type":1, "application": "park"}'
{
"api_ver": "0.1",
"result": {
"application": "park",
"context": null,
"data": null,
"detail": "test pln for basic tutorial",
"exten": null,
"in_use": 1,
"name": "basic tutorial destination",
"priority": null,
"tm_create": "2017-03-08T01:46:42.781526492Z",
"tm_delete": null,
"tm_update": null,
"type": 1,
"uuid": "36a8a632-569d-414a-94e1-f92c8e0d505e",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T01:46:42.830332118Z"
}
Create dlma and dial list¶
Create dlma.
$ curl -X POST http://192.168.200.10:8081/dlmas -d
'{"name": "basic tutorial dlma", "detail": "test dlma for basic tutorial"}'
{
"api_ver": "0.1",
"result": {
"detail": "test dlma for basic tutorial",
"dl_table": "42b72a18_a6c5_43bf_b9aa_6043ff32128d",
"in_use": 1,
"name": "basic tutorial dlma",
"tm_create": "2017-03-08T01:51:40.978836362Z",
"tm_delete": null,
"tm_update": null,
"uuid": "42b72a18-a6c5-43bf-b9aa-6043ff32128d",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T01:51:41.37138842Z"
}
Create dial list
$ curl -X POST http://192.168.200.10:8081/dls -d
'{"dlma_uuid":"42b72a18-a6c5-43bf-b9aa-6043ff32128d", "name": "basic tutorial test customer 1", "detail": "test customer for basic tutorial", "number_1": "300"}'
{
"api_ver": "0.1",
"result": {
"detail": "test customer for basic tutorial",
"dialing_camp_uuid": null,
"dialing_plan_uuid": null,
"dialing_uuid": null,
"dlma_uuid": "42b72a18-a6c5-43bf-b9aa-6043ff32128d",
"email": null,
"in_use": 1,
"name": "basic tutorial test customer 1",
"number_1": "300",
"number_2": null,
"number_3": null,
"number_4": null,
"number_5": null,
"number_6": null,
"number_7": null,
"number_8": null,
"res_dial": 0,
"res_dial_detail": null,
"res_hangup": 0,
"res_hangup_detail": null,
"resv_target": null,
"status": 0,
"tm_create": "2017-03-08T01:55:07.911271576Z",
"tm_delete": null,
"tm_last_dial": null,
"tm_last_hangup": null,
"tm_update": null,
"trycnt_1": 0,
"trycnt_2": 0,
"trycnt_3": 0,
"trycnt_4": 0,
"trycnt_5": 0,
"trycnt_6": 0,
"trycnt_7": 0,
"trycnt_8": 0,
"ukey": null,
"uuid": "7d760dd1-8ba5-48d9-989d-415d610ffe57",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T01:55:07.936731333Z"
}
Create campaign¶
Create campaign using above information.
$ curl -X POST http://192.168.200.10:8081/campaigns -d
'{"name": "basic tutorial campaign", "detail": "test campaign for basic tutorial", \
"plan":"50fd1e1f-920b-477a-b84c-afe58928dadc", "dest":"36a8a632-569d-414a-94e1-f92c8e0d505e", \
"dlma":"42b72a18-a6c5-43bf-b9aa-6043ff32128d"}'
{
"api_ver": "0.1",
"result": {
"dest": "36a8a632-569d-414a-94e1-f92c8e0d505e",
"detail": "test campaign for basic tutorial",
"dlma": "42b72a18-a6c5-43bf-b9aa-6043ff32128d",
"in_use": 1,
"name": "basic tutorial campaign",
"next_campaign": null,
"plan": "50fd1e1f-920b-477a-b84c-afe58928dadc",
"sc_date_end": null,
"sc_date_list": null,
"sc_date_list_except": null,
"sc_date_start": null,
"sc_day_list": null,
"sc_mode": 0,
"sc_time_end": null,
"sc_time_start": null,
"status": 0,
"tm_create": "2017-03-08T01:59:48.604422007Z",
"tm_delete": null,
"tm_update": null,
"uuid": "30097375-df96-4ca4-829b-b1e3100a2221"
},
"statuscode": 200,
"timestamp": "2017-03-08T01:59:48.722673874Z"
}
Update Campaign status to start¶
$ curl -X PUT http://192.168.200.10:8081/campaigns/30097375-df96-4ca4-829b-b1e3100a2221 -d '{"status": 1}'
{
"api_ver": "0.1",
"result": {
"dest": "36a8a632-569d-414a-94e1-f92c8e0d505e",
"detail": "test campaign for basic tutorial",
"dlma": "42b72a18-a6c5-43bf-b9aa-6043ff32128d",
"in_use": 1,
"name": "basic tutorial campaign",
"next_campaign": null,
"plan": "50fd1e1f-920b-477a-b84c-afe58928dadc",
"sc_date_end": null,
"sc_date_list": null,
"sc_date_list_except": null,
"sc_date_start": null,
"sc_day_list": null,
"sc_mode": 0,
"sc_time_end": null,
"sc_time_start": null,
"status": 1,
"tm_create": "2017-03-08T01:59:48.604422007Z",
"tm_delete": null,
"tm_update": "2017-03-08T02:02:19.305706615Z",
"uuid": "30097375-df96-4ca4-829b-b1e3100a2221"
},
"statuscode": 200,
"timestamp": "2017-03-08T02:02:19.345044282Z"
}
Check dial list status¶
After update the campaign status, the aserisk will make a call to peer 300. And if the client answer the call the call transfers to the parking lot.
Then, if we check the dial list status later, we can see the updated dial list information.
$ curl -X GET http://192.168.200.10:8081/dls/7d760dd1-8ba5-48d9-989d-415d610ffe57
{
"api_ver": "0.1",
"timestamp": "2017-03-08T02:05:54.905205247Z",
"statuscode": 200,
"result": {
"tm_last_dial": "2017-03-08T02:02:19.561972329Z",
"number_4": null,
"email": null,
"trycnt_5": 0,
"uuid": "7d760dd1-8ba5-48d9-989d-415d610ffe57",
"dlma_uuid": "42b72a18-a6c5-43bf-b9aa-6043ff32128d",
"res_hangup": 16,
"detail": "test customer for basic tutorial",
"in_use": 1,
"res_hangup_detail": "Normal Clearing",
"number_3": null,
"name": "basic tutorial test customer 1",
"status": 0,
"trycnt_7": 0,
"ukey": null,
"dialing_uuid": null,
"resv_target": null,
"trycnt_6": 0,
"trycnt_3": 0,
"variables": null,
"trycnt_2": 0,
"number_8": null,
"dialing_camp_uuid": null,
"number_2": null,
"dialing_plan_uuid": null,
"res_dial": 4,
"number_1": "300",
"tm_create": "2017-03-08T01:55:07.911271576Z",
"trycnt_1": 1,
"number_5": null,
"trycnt_8": 0,
"number_6": null,
"number_7": null,
"trycnt_4": 0,
"res_dial_detail": "Remote end has answered",
"tm_delete": null,
"tm_update": null,
"tm_last_hangup": "2017-03-08T02:02:38.294239075Z"
}
}
And also, we can see the dial try result in a file.
$ tail -n 1 /opt/bin/outbound_result.json
{
"uuid": "7ac02fb2-abe9-4882-a023-bbba573fc220",
"name": null,
"res_hangup_detail": "Normal Clearing",
"status": 7,
"action_id": "7f2aab69-4d09-4756-ac9a-f522c9e12f47",
"res_dial_detail": "Remote end has answered",
"dial_addr": "300",
"res_dial": 4,
"tm_update": "2017-03-08T02:02:38.225648380Z",
"res_hangup": 16,
"uuid_camp": "30097375-df96-4ca4-829b-b1e3100a2221",
"uuid_plan": "50fd1e1f-920b-477a-b84c-afe58928dadc",
"uuid_dest": "36a8a632-569d-414a-94e1-f92c8e0d505e",
"dial_data": "",
"uuid_dlma": "42b72a18-a6c5-43bf-b9aa-6043ff32128d",
"dial_channel": "sip/300",
"uuid_dl_list": "7d760dd1-8ba5-48d9-989d-415d610ffe57",
"tm_create": "2017-03-08T02:02:19.491821216Z",
"dial_trycnt": 1,
"dial_application": "park",
"dial_type": 1,
"dial_index": 1,
"dial_timeout": 30000,
"dial_exten": null,
"tm_delete": null
}
Normal call distribute¶
Dial to the customer. After the customer answered call, the call will be distributed to the waiting agents.
- Create a queue and add memeber to queue.
- Create a destination.
- Create dlma and dial list.
- Create a campaign.
- Update campaign status to start
- Check result
Create a queue and add memeber to queue¶
Add the queue info to the /etc/asterisk/queues.conf
Assume that we have a below queue info.
[sales_1]
musicclass = default
strategy = ringall
joinempty = yes
Add the all agents to the queue.
pluto*CLI> queue add member sip/agent-01 to sales_1
Added interface 'sip/agent-01' to queue 'sales_1'
pluto*CLI> queue add member sip/agent-02 to sales_1
Added interface 'sip/agent-02' to queue 'sales_1'
pluto*CLI> queue add member sip/agent-03 to sales_1
Added interface 'sip/agent-03' to queue 'sales_1'
Check the queue status
pluto*CLI> queue show sales_1
sales_1 has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
Members:
sip/agent-01 (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
sip/agent-02 (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
sip/agent-03 (ringinuse enabled) (dynamic) (Not in use) has taken no calls yet
No Callers
Create plan¶
$ curl -X POST http://192.168.200.10:8081/plans -d
'{"name":"normal call distribute plan", "detail":"test plan for normal call distribute", "tech_name":"sip", "dial_mode":1}'
{
"api_ver": "0.1",
"result": {
"caller_id": null,
"codecs": null,
"detail": "test plan for normal call distribute",
"dial_mode": 1,
"dial_timeout": 30000,
"dl_end_handle": 1,
"early_media": null,
"in_use": 1,
"max_retry_cnt_1": 5,
"max_retry_cnt_2": 5,
"max_retry_cnt_3": 5,
"max_retry_cnt_4": 5,
"max_retry_cnt_5": 5,
"max_retry_cnt_6": 5,
"max_retry_cnt_7": 5,
"max_retry_cnt_8": 5,
"name": "normal call distribute plan",
"retry_delay": 60,
"service_level": 0,
"tech_name": "sip",
"tm_create": "2017-03-08T02:26:58.135746353Z",
"tm_delete": null,
"tm_update": null,
"trunk_name": null,
"uuid": "2410fdf4-5633-4b84-917b-c66cc5e94d0c",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T02:26:58.194401817Z"
}
Create destination¶
$ curl -X POST http://192.168.200.10:8081/destinations -d
'{"name": "normal call distribute destination", "detail":"test pln for normal call distribute", "type":1, "application": "queue", "data":"sales_1"}'
{
"api_ver": "0.1",
"result": {
"application": "queue",
"context": null,
"data": "sales_1",
"detail": "test pln for normal call distribute",
"exten": null,
"in_use": 1,
"name": "normal call distribute destination",
"priority": null,
"tm_create": "2017-03-08T02:30:28.856570883Z",
"tm_delete": null,
"tm_update": null,
"type": 1,
"uuid": "cc260c6a-80b5-434b-8d68-d2486eeb2c01",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T02:30:28.877500393Z"
}
Create dlma and dial list¶
Create Dlma
$ $ curl -X POST http://192.168.200.10:8081/dlmas -d
'{"name": "normal call distribute dlma", "detail": "test dlma for normal call distribute"}'
{
"api_ver": "0.1",
"result": {
"detail": "test dlma for normal call distribute",
"dl_table": "b0d73193_2787_4341_8c32_bc051bad9f94",
"in_use": 1,
"name": "normal call distribute dlma",
"tm_create": "2017-03-08T02:31:30.747154596Z",
"tm_delete": null,
"tm_update": null,
"uuid": "b0d73193-2787-4341-8c32-bc051bad9f94",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T02:31:30.764677718Z"
}
Create dial list.
$ curl -X POST http://192.168.200.10:8081/dls -d
'{"dlma_uuid":"b0d73193-2787-4341-8c32-bc051bad9f94", "name": "normal call distribute test customer 1", "detail": "test customer for normal call distribute", "number_1": "300"}'
{
"api_ver": "0.1",
"result": {
"detail": "test customer for normal call distribute",
"dialing_camp_uuid": null,
"dialing_plan_uuid": null,
"dialing_uuid": null,
"dlma_uuid": "b0d73193-2787-4341-8c32-bc051bad9f94",
"email": null,
"in_use": 1,
"name": "normal call distribute test customer 1",
"number_1": "300",
"number_2": null,
"number_3": null,
"number_4": null,
"number_5": null,
"number_6": null,
"number_7": null,
"number_8": null,
"res_dial": 0,
"res_dial_detail": null,
"res_hangup": 0,
"res_hangup_detail": null,
"resv_target": null,
"status": 0,
"tm_create": "2017-03-08T02:32:52.786548232Z",
"tm_delete": null,
"tm_last_dial": null,
"tm_last_hangup": null,
"tm_update": null,
"trycnt_1": 0,
"trycnt_2": 0,
"trycnt_3": 0,
"trycnt_4": 0,
"trycnt_5": 0,
"trycnt_6": 0,
"trycnt_7": 0,
"trycnt_8": 0,
"ukey": null,
"uuid": "d0527ab9-c240-49a4-a001-1d3adecebbcb",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T02:32:52.812825540Z"
}
Create campaign and status update¶
Create campaign.
$ curl -X POST http://192.168.200.10:8081/campaigns -d
'{"name": "normal call distribute campaign", "detail": "test campaign for normal call distribute", \
"plan":"2410fdf4-5633-4b84-917b-c66cc5e94d0c", "dest":"cc260c6a-80b5-434b-8d68-d2486eeb2c01", \
"dlma":"b0d73193-2787-4341-8c32-bc051bad9f94"}'
{
"api_ver": "0.1",
"result": {
"dest": "cc260c6a-80b5-434b-8d68-d2486eeb2c01",
"detail": "test campaign for normal call distribute",
"dlma": "b0d73193-2787-4341-8c32-bc051bad9f94",
"in_use": 1,
"name": "normal call distribute campaign",
"next_campaign": null,
"plan": "2410fdf4-5633-4b84-917b-c66cc5e94d0c",
"sc_date_end": null,
"sc_date_list": null,
"sc_date_list_except": null,
"sc_date_start": null,
"sc_day_list": null,
"sc_mode": 0,
"sc_time_end": null,
"sc_time_start": null,
"status": 0,
"tm_create": "2017-03-08T02:35:01.122129833Z",
"tm_delete": null,
"tm_update": null,
"uuid": "ed40ec12-9d39-4594-823c-0a2b5d86d9b6"
},
"statuscode": 200,
"timestamp": "2017-03-08T02:35:01.142891513Z"
}
Update campaign status.
$ curl -X PUT http://192.168.200.10:8081/campaigns/ed40ec12-9d39-4594-823c-0a2b5d86d9b6 -d '{"status": 1}'
{
"api_ver": "0.1",
"result": {
"dest": "cc260c6a-80b5-434b-8d68-d2486eeb2c01",
"detail": "test campaign for normal call distribute",
"dlma": "b0d73193-2787-4341-8c32-bc051bad9f94",
"in_use": 1,
"name": "normal call distribute campaign",
"next_campaign": null,
"plan": "2410fdf4-5633-4b84-917b-c66cc5e94d0c",
"sc_date_end": null,
"sc_date_list": null,
"sc_date_list_except": null,
"sc_date_start": null,
"sc_day_list": null,
"sc_mode": 0,
"sc_time_end": null,
"sc_time_start": null,
"status": 1,
"tm_create": "2017-03-08T02:35:01.122129833Z",
"tm_delete": null,
"tm_update": "2017-03-08T02:36:31.509227769Z",
"uuid": "ed40ec12-9d39-4594-823c-0a2b5d86d9b6"
},
"statuscode": 200,
"timestamp": "2017-03-08T02:36:31.526276933Z"
}
Check dial list status¶
After update the campaign status, the aserisk will make a call to peer 300. And if the client answer the call, the agent’s device will be ringing.
If the one of the agent is answered the call, the other’s device’s ringing will be stopped.
Then, if we check the dial list status later, we can see the updated dial list information.
$ curl -X GET http://192.168.200.10:8081/dls/d0527ab9-c240-49a4-a001-1d3adecebbcb
{
"api_ver": "0.1",
"result": {
"detail": "test customer for normal call distribute",
"dialing_camp_uuid": null,
"dialing_plan_uuid": null,
"dialing_uuid": null,
"dlma_uuid": "b0d73193-2787-4341-8c32-bc051bad9f94",
"email": null,
"in_use": 1,
"name": "normal call distribute test customer 1",
"number_1": "300",
"number_2": null,
"number_3": null,
"number_4": null,
"number_5": null,
"number_6": null,
"number_7": null,
"number_8": null,
"res_dial": 4,
"res_dial_detail": "Remote end has answered",
"res_hangup": 18,
"res_hangup_detail": "No user responding",
"resv_target": null,
"status": 0,
"tm_create": "2017-03-08T02:32:52.786548232Z",
"tm_delete": null,
"tm_last_dial": "2017-03-08T02:36:31.704367362Z",
"tm_last_hangup": "2017-03-08T02:37:36.836258185Z",
"tm_update": null,
"trycnt_1": 1,
"trycnt_2": 0,
"trycnt_3": 0,
"trycnt_4": 0,
"trycnt_5": 0,
"trycnt_6": 0,
"trycnt_7": 0,
"trycnt_8": 0,
"ukey": null,
"uuid": "d0527ab9-c240-49a4-a001-1d3adecebbcb",
"variables": null
},
"statuscode": 200,
"timestamp": "2017-03-08T02:38:56.518844830Z"
}
$ tail -n 1 /opt/bin/outbound_result.json
{
"uuid": "363f21fc-d7f1-43bb-868e-37b7c7ede07c",
"name": null,
"res_hangup_detail": "No user responding",
"status": 7,
"action_id": "92746286-f090-418b-9411-c0ee43b96664",
"res_dial_detail": "Remote end has answered",
"dial_addr": "300",
"res_dial": 4,
"tm_update": "2017-03-08T02:37:36.621821426Z",
"res_hangup": 18,
"uuid_camp": "ed40ec12-9d39-4594-823c-0a2b5d86d9b6",
"uuid_plan": "2410fdf4-5633-4b84-917b-c66cc5e94d0c",
"uuid_dest": "cc260c6a-80b5-434b-8d68-d2486eeb2c01",
"dial_data": "sales_1",
"uuid_dlma": "b0d73193-2787-4341-8c32-bc051bad9f94",
"dial_channel": "sip/300",
"uuid_dl_list": "d0527ab9-c240-49a4-a001-1d3adecebbcb",
"tm_create": "2017-03-08T02:36:31.649998750Z",
"dial_trycnt": 1,
"dial_application": "queue",
"dial_type": 1,
"dial_index": 1,
"dial_timeout": 30000,
"dial_exten": null,
"tm_delete": null
}