GET Get active channels list

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
RESPONSE BODY
{
"status":"OK",
"data":{
	"row_count":1,
	"rows":[{
		"uuid":"d16592f8-e9c2-409d-a994-13c033b282ab",
		"direction":"inbound",
		"created":"2015-09-06 20:05:11",
		"created_epoch":"1441569911",
		"name":"sofia/internal/[email protected]",
		"state":"CS_EXECUTE",
		"cid_name":"201",
		"cid_num":"201",
		"ip_addr":"93.75.208.227",
		"dest":"00",
		"application":"conference",
		"application_data":"10.10.10.144@video-mcu-stereo",
		"dialplan":"XML",
		"context":"default",
		"read_codec":"L16","read_rate":"48000",
		"read_bit_rate":"768000",
		"write_codec":"opus",
		"write_rate":"48000",
		"write_bit_rate":"0",
		"secure":"",
		"hostname":"webitel",
		"presence_id":"[email protected]",
		"presence_data":"",
		"callstate":"ACTIVE",
		"callee_name":"",
		"callee_num":"",
		"callee_direction":"",
		"call_uuid":"",
		"sent_callee_name":"",
		"sent_callee_num":"",
		"initial_cid_name":"201",
		"initial_cid_num":"201",
		"initial_ip_addr":"93.75.208.227",
		"initial_dest":"00",
		"initial_dialplan":"XML",
		"initial_context":"default"}]
	}
}
CURL EXAMPLE
curl -XGET -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzA0NDk2NTB9.WqTx_dpbuTyp-l8w6rmQhzoatI-qPRkoM-hmxXTAzaU' -H 'X-Key: bed5ea60-84e7-4eba-b6ad-e3a23f220be1' "https://api.webitel.com:10022/api/v2/channels"

 

POST Originate new call

REQUEST HEADERS
Content-Type: application/json
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
REQUEST BODY
{
	"calledId":"00",
	"callerId": "[email protected]",
	"auto_answer_param": "sip_h_Call-Info=answer-after=0"
}
AttributeDescription
calledId
Destination number. Where to make call.
callerId
Call from user.
auto_answer_param
SIP auto answer header.
RESPONSE BODY
{
	"status":"OK",
	"info":"+OK d917a647-7378-4b02-a3e6-0c24cc7feeac\n",
	"more info":"https://docs.webitel.com/pages/viewpage.action?pageId=23953416"
}
CURL EXAMPLE
curl -XPOST -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzUxMjk5ODF9.DFtcez2ntKLsTsQ5SHYtlwXLf9UC3UbxfMIFRZlCgOE' -H 'X-Key: 1809dfa7-243c-49a6-a5ef-67f9d9565f3f'  -H 'Content-Type: application/json' -d '{"calledId":"00","callerId": "[email protected]","auto_answer_param": "sip_h_Call-Info=answer-after=0"}' "https://api.webitel.com:10022/api/v2/channels"

 

DELETE /api/v2/channels/:id - Hangup channel by uuid

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
RESPONSE BODY
{
	"status":"OK",
	"info":"+OK\n",
	"more info":"https://docs.webitel.com/pages/viewpage.action?pageId=23953416"
}
CURL EXAMPLE
curl -XDELETE  -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzUxMjk5ODF9.DFtcez2ntKLsTsQ5SHYtlwXLf9UC3UbxfMIFRZlCgOE' -H 'X-Key: 1809dfa7-243c-49a6-a5ef-67f9d9565f3f'  "https://api.webitel.com:10022/api/v2/channels/d917a647-7378-4b02-a3e6-0c24cc7feeac"

 

PUT /api/v2/channels/:id Change state of the channel

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
Content-Type: application/json

 

REQUEST BODY
{
	"state": "hold"
}
AttributeDescription
state
hold or unhold active channel
RESPONSE BODY
{
	"status":"OK",
	"info":"+OK Success\n",
	"more info":"https://docs.webitel.com/pages/viewpage.action?pageId=23953416"
}
CURL EXAMPLE
curl -XPUT  -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzUxMjk5ODF9.DFtcez2ntKLsTsQ5SHYtlwXLf9UC3UbxfMIFRZlCgOE' -H 'X-Key: 1809dfa7-243c-49a6-a5ef-67f9d9565f3f'  -H 'Content-Type: application/json' -d '{"state": "hold"}'  "https://api.webitel.com:10022/api/v2/channels/6efeb018-7356-4a2b-9ffc-78e78a9b8c47"


POST /api/v2/channels/:id/eavesdrop - Spy on a channel

REQUEST HEADERS
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIwMDY1MTUxNzB9.3L4D21aMdNxnm9lZTklt6EvjeNP9RLLKLJtFqVLnSCs
X-Key: eb76bb9f-6366-4168-b0f1-dac6f15adceb
Content-Type: application/json
REQUEST BODY
{
	"user":"201"
}
RESPONSE BODY
{
	"status":"OK",
	"info":"+OK 0dc8c0b7-7d7d-45b7-be77-2e1f95c32595\n"
}
CURL EXAMPLE
curl -XPOST -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0NDIxNzUxMjk5ODF9.DFtcez2ntKLsTsQ5SHYtlwXLf9UC3UbxfMIFRZlCgOE' -H 'X-Key: 1809dfa7-243c-49a6-a5ef-67f9d9565f3f'  -H 'Content-Type: application/json' -d '{"user":"201"}' "https://api.webitel.com:10022/api/v2/channels/f09bf0d5-effe-4847-bc79-d0eb179664bc/eavesdrop"
  • No labels