The examples below
show how to: make a call, check call status, record by phone, play the
recording, pause and resume the recording, hang up, and send the recording as a
message. Each step is shown as the HTTP request and response.
Make the call
POST /vmrest/calls HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic
Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 36
{"number":"2119","maximumRings":"4"}
|
Response:
HTTP/1.1 201 Created
Set-Cookie:
JSESSIONIDSSO=CB2BE1D9771621DBEA24B479C1A9C10A; Path=/
Set-Cookie:
JSESSIONID=EB7C33B4DC0AAE91CB002D799C8734BA; Path=/vmrest
Location:
[http://cuc-install-67.cisco.com/vmrest/calls/vmrest/calls/1]
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 15 Jan 2010 15:14:11 GMT
Server:
|
Make the Video call
POST https://<connection-server>/vmrest/calls
|
<Call>
<number>1096</number>
<maximumRings>5</maximumRings>
<callType>Video</callType>
</Call>
|
The following is
the response from the above *POST* request and the actual response will depend
upon the information given by you:
Response Code: 201
/vmrest/calls/66
CallType:video
|
JSON Example
POST /vmrest/calls HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic
Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 36
{"number":"1097","maximumRings":"4","callType":"video"}
|
Response:
HTTP/1.1 201 Created
Set-Cookie:
JSESSIONIDSSO=CB2BE1D9771621DBEA24B479C1A9C10A; Path=/
Set-Cookie:
JSESSIONID=EB7C33B4DC0AAE91CB002D799C8734BA; Path=/vmrest
Location:
[http://cuc-install-67.cisco.com/vmrest/calls/vmrest/calls/40/calltype:video]
Content-Type: application/json
Video Call Downgrade
Scenarios
If a Video call
gets downgraded to audio, user receives the following response:
Scenario 1
If a user does not
have Video Service Account and try to make a video call, the following response
is received:
Response Code: 201
/vmrest/calls/66
CallType: Audio
CallDowngradeReason: Video Service Account does not exist
|
Scenario 2
If a user does not
have Video Service activated on Unity Connection and try to make a video call,
the following response is received:
Response Code: 201
/vmrest/calls/66
CallType: Audio
CallDowngradeReason: Video Service not found
|
Scenario 3
If a user does not
have Video enabled in Class of Service and try to make a video call, the
following response is received:
Response Code: 201
/vmrest/calls/66
CallType: Audio
CallDowngradeReason: Not allowed to Playback and Record Video Greetings
|
Check call status
GET /vmrest/calls/1 HTTP/1.1
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
|
Response:
HTTP/1.1 200 OK
Pragma: No-cache
Cache-Control: no-cache
Expires: Wed, 31 Dec 1969 16:00:00 PST
Set-Cookie: JSESSIONIDSSO=849167D3D61D2F30BA278BBF949FDF0F; Path=/
Set-Cookie: JSESSIONID=28A69142E490EC63A56690F9811BDDF9; Path=/vmrest
Content-Type: application/json
{"id":"1","connected":"true","nativeConnectionId":"2"}
|
Check Video call
status
GET https://<connection-server>/vmrest/calls/<call-id>
|
The following is
the response from the above *GET* request and the actual response will depend
upon the information given by you:
<Call>
<number>1007</number>
<id>1105</id>
<connected>true</connected>
<callType>video</callType>
<nativeConnectionId>16</nativeConnectionId>
</Call>
|
JSON
Example
GET /vmrest/calls/1 HTTP/1.1
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
|
Response:
HTTP/1.1 200 OK
Pragma: No-cache
Cache-Control: no-cache
Expires: Wed, 31 Dec 1969 16:00:00 PST
Set-Cookie: JSESSIONIDSSO=849167D3D61D2F30BA278BBF949FDF0F; Path=/
Set-Cookie: JSESSIONID=28A69142E490EC63A56690F9811BDDF9; Path=/vmrest
Content-Type: application/json
{"number":"1097","id":"40","connected":"true","callType":"video","nativeConnectionId":"45"}
|
Record by
phone
POST /vmrest/calls/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 15
{"op":"RECORD"}
|
Response:
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=8279B639488165EFFAC8D330FD2A1281; Path=/
Set-Cookie: JSESSIONID=AA008CFCC9B329EA961CD1E660384785; Path=/vmrest
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 15 Jan 2010 15:14:13 GMT
Server:
{"op":"RECORD","resourceType":"STREAM","resourceId":"cf1cb014-6394- 4279-ab5a-74a6d680e440.wav",
"lastResult":"0","speed":"100","volume":"100","startPosition":"0"}
|
Video Recording by
phone
POST https://<connection-server>/vmrest/calls/<call-id>
|
<CallControl>
<op>RECORD</op>
</CallControl>
|
The following is
the response from the above *POST* request and the actual response will depend
upon the information given by you:
<CallControl>
<op>RECORD</op>
<resourceType>STREAM</resourceType>
<resourceId>9d59b180-6147-4796-9488-014ef73203a0.wav</resourceId>
<sessionId>3514637e02b471</sessionId>
<lastResult>0</lastResult>
</CallControl>
|
JSON
Example
POST /vmrest/calls/<call-id> HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 15
{"op":"RECORD"}
|
Response:
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=8279B639488165EFFAC8D330FD2A1281; Path=/
Set-Cookie: JSESSIONID=AA008CFCC9B329EA961CD1E660384785; Path=/vmrest
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 15 Jan 2010 15:14:13 GMT
Server:
1({"op":"RECORD","resourceType":"STREAM","resourceId":"a899bac7-9ee2-4c75-b3a7-e6a2a5d6d2dc.wav","sessionId":"1e14628d9a9ac1","lastResult":"0"})
|
Pause the recording
POST /vmrest/calls/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: ucbu-aricent-vm5.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
{"op":"PAUSE"}
|
Response:
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=6A4C99C02E79D696A2DEC46C24A0B2DA; Path=/; Secure
Set-Cookie: JSESSIONID=1E642B010F5AD5630DE922B1378679DF; Path=/vmrest; Secure
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 01 Jun 2012 06:33:49 GMT
Server:
{"op":"PAUSE","lastResult":"0","speed":"100","volume":"100","startPosition":"0"}
|
Resume the recording
POST /vmrest/calls/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: ucbu-aricent-vm5.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
{"op":"RESUME"}
|
Response:
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=687E20DEFCC984797342E37A656A1F32; Path=/; Secure
Set-Cookie: JSESSIONID=48D31DBFCBAEF586F2A9398AB11204CC; Path=/vmrest; Secure
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 01 Jun 2012 06:34:25 GMT
Server:
{"op":"RESUME","lastResult":"0","speed":"100","volume":"100","startPosition":"0"}
|
Play the recording
POST /vmrest/calls/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 159
{"op":"PLAY","resourceType":"STREAM","resourceId":"cf1cb014-6394-4279-ab5a-74a6d680e440.wav",
"lastResult":"0","speed":"100","volume":"100","startPosition":"0"}
|
Response:
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=CD7B1064CEB9385B6FE9279ECBDB40E3; Path=/
Set-Cookie: JSESSIONID=201BD26E840AA2CEEC242A9CCD0FE8F6; Path=/vmrest
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 15 Jan 2010 15:14:15 GMT
Server:
{"op":"PLAY","resourceType":"STREAM","resourceId":"cf1cb014-6394-4279-ab5a-74a6d680e440.wav",
"lastResult":"0","speed":"100","volume":"100","startPosition":"0"}
|
Play Video recording
In a video call,
- For STREAM or URI
resource type, if the Session ID is available, then the video recording will be
played, else the audio recording will be played from the Audio resource-ID
along with an image.
- For Message or Broadcast
Message resource type, the audio recording will be played from the Audio
resource-ID along with an image.
- If both sessionID and
resource ID are not available, an error message is send to the user.
POST https://<connection-server>/vmrest/calls/<call-id>
|
Request:
<CallControl>
<op>PLAY</op>
<resourceType>STREAM</resourceType>
<resourceId>1218f93a-2ce2-4987-9589-f8e06bd54a14.wav</resourceId>
<sessionId>2f61469411d7131</sessionId>
<lastResult>0</lastResult>
</CallControl>
|
The following is
the response from the above *POST* request and the actual response will depend
upon the information given by you:
Response: 200 Ok
<CallControl>
<op>PLAY</op>
<resourceType>STREAM</resourceType>
<resourceId>1218f93a-2ce2-4987-9589-f8e06bd54a14.wav</resourceId>
<sessionId>2f61469411d7131</sessionId>
<lastResult>0</lastResult>
</CallControl>
|
JSON
Example
Request:
POST /vmrest/calls/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 159
{"op":"PLAY","resourceType":"STREAM","resourceId":"1218f93a-2ce2-4987-9589-f8e06bd54a14.wav","sessionId":"2f61469411d7131","lastResult":"0"}
|
Response:
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=CD7B1064CEB9385B6FE9279ECBDB40E3; Path=/
Set-Cookie: JSESSIONID=201BD26E840AA2CEEC242A9CCD0FE8F6; Path=/vmrest
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 15 Jan 2010 15:14:15 GMT
Server:
1({"op":"PLAY","resourceType":"STREAM","resourceId":"1218f93a-2ce2-4987-9589-f8e06bd54a14.wav","sessionId":"2f61469411d7131","lastResult":"0"})
|
Hang up
DELETE /vmrest/calls/1 HTTP/1.1
Content-Type: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Accept: text/html, image/gif, image/jpeg, \*; q=.2, \*/*; q=.2
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
|
Response:
HTTP/1.1 204 No Content
Pragma: No-cache
Cache-Control: no-cache
Expires: Wed, 31 Dec 1969 16:00:00 PST
Set-Cookie: JSESSIONIDSSO=93B286C6584533F9EE793A01E5804465; Path=/
Set-Cookie: JSESSIONID=0CCFFFCAD1C11A45EAD1E8F04B22D28D; Path=/vmrest
Date: Fri, 15 Jan 2010 15:14:15 GMT
Server:
|
Send the recording as a
message
POST /vmrest/messages?userobjectid=84c14db9-7439-4326-a2e2-e516aa192dff HTTP/1.1
Content-Type: multipart/form-data;boundary=Boundary_1_16617866_1263568442453
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 731
\--Boundary_1_16617866_1263568442453
Content-Type: application/json
{"Subject":"send message test","ArrivalTime":"0","FromSub":"false"}
\--Boundary_1_16617866_1263568442453
Content-Type: application/json
{"Recipient":{"Type":"TO","Address":
{"UserGuid":"84c14db9-7439-4326-a2e2-e516aa192dff","DisplayName":"Operator"}
}}
\--Boundary_1_16617866_1263568442453
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CallControl><op>PLAY</op><resourceType>STREAM</resourceType><resourceId>cf1cb014-6394-4279-
ab5a-74a6d680e440.wav</resourceId><lastResult>0</lastResult><speed>100</speed><volume>100</volume><startPosition>0</startPosition></CallControl>
\--Boundary_1_16617866_1263568442453-\-
|
Response:
HTTP/1.1 202 Accepted
Set-Cookie: JSESSIONIDSSO=3D875CAE50B6B4947DEDCF5EDA119922; Path=/
Set-Cookie: JSESSIONID=842B1A6E53DAE329F6DA7525951668B4; Path=/vmrest
Content-Type: application/json
Content-Length: 0
Date: Fri, 15 Jan 2010 15:14:16 GMT
Server:
|
Send the recording as a Video message
POST /vmrest/messages?userobjectid=84c14db9-7439-4326-a2e2-e516aa192dff HTTP/1.1
Content-Type: multipart/form-data;boundary=Boundary_1_16617866_1263568442453
Accept: application/json
User-Agent: Java/1.6.0_17
Host: cuc-install-67.cisco.com
Connection: keep-alive
Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg==
Content-Length: 731
\--Boundary_1_16617866_1263568442453
Content-Type: application/json
{"Subject":"send message test","ArrivalTime":"0","FromSub":"false"}
\--Boundary_1_16617866_1263568442453
Content-Type: application/json
{"Recipient":{"Type":"TO","Address":
{"UserGuid":"84c14db9-7439-4326-a2e2-e516aa192dff","DisplayName":"Operator"}
}}
\--Boundary_1_16617866_1263568442453
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CallControl><op>PLAY</op><resourceType>STREAM</resourceType><resourceId>cf1cb014-6394-4279-
ab5a-74a6d680e440.wav</resourceId><sessionId><lastResult>0</lastResult><speed>100</speed><volume>100</volume><startPosition>0</startPosition></CallControl>
\--Boundary_1_16617866_1263568442453-\-
|