Cisco Unity Connection Provisioning Interface (CUPI) API -- Port Group Codec Settings

From DocWiki

Revision as of 11:01, 1 November 2013 by Deeptija (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Links to Other API pages: Cisco_Unity_Connection_APIs

CUPI Guide Contents
API Overview
Index of All CUPI Documentation

Contents


Port Group Codec Settings

Administrator can use this API to create/update/fetch/delete the port group codec settings API. There are 5 types of codec that you can add and delete:

  • G.711 mu-law
  • G.729
  • G.711 a-law
  • G.722
  • iLBC


Listing Port Group Codecs

The following is an example of the GET request that will list all the port group codecs:

GET https:/<connection-server>/vmrest/rtpcodecdefs

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

<RtpCodecDefs total="5">
  <RtpCodecDef>
     <URI>/vmrest/rtpcodecdefs/5623a48c-255d-a121-a4b4-5788238a8123</URI>
     <ObjectId>5623a48c-255d-a121-a4b4-5788238a8123</ObjectId>
     <DisplayName>G.711 mu-law</DisplayName>
  </RtpCodecDef>
  <RtpCodecDef>
     <URI>/vmrest/rtpcodecdefs/672e247c-33de-b232-b5b4-12eb238a8234</URI>
     <ObjectId>672e247c-33de-b232-b5b4-12eb238a8234</ObjectId>
     <DisplayName>G.711 a-law</DisplayName>
  </RtpCodecDef> 
  <RtpCodecDef>
     <URI>/vmrest/rtpcodecdefs/7823a48c-105d-b232-07b4-635a20810345</URI>
     <ObjectId>7823a48c-105d-b232-07b4-635a20810345</ObjectId>
     <DisplayName>G.722</DisplayName>
  </RtpCodecDef>
  <RtpCodecDef>
     <URI>/vmrest/rtpcodecdefs/8923aabc-3650-b232-1b00-0788b04a84c6</URI>
     <ObjectId>8923aabc-3650-b232-1b00-0788b04a84c6</ObjectId>
     <DisplayName>G.729</DisplayName>
  </RtpCodecDef>
  <RtpCodecDef>
     <URI>/vmrest/rtpcodecdefs/9a23b48c-060d-b267-2589-5701238ab567</URI>
     <ObjectId>9a23b48c-060d-b267-2589-5701238ab567</ObjectId>
     <DisplayName>iLBC</DisplayName>
  </RtpCodecDef>
</RtpCodecDefs>
Response Code: 200

JSON Example:

GET https://<connection-server>/vmrest/rtpcodecdefs
Accept: application/json
Connection: keep-alive

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

{
  "@total": "5",
  "RtpCodecDef": [
  {
     "URI": "/vmrest/rtpcodecdefs/5623a48c-255d-a121-a4b4-5788238a8123",
     "ObjectId": "5623a48c-255d-a121-a4b4-5788238a8123",
     "DisplayName": "G.711 mu-law"
  },
 {
     "URI": "/vmrest/rtpcodecdefs/672e247c-33de-b232-b5b4-12eb238a8234",
     "ObjectId": "672e247c-33de-b232-b5b4-12eb238a8234",
     "DisplayName": "G.711 a-law"
  },
  {
     "URI": "/vmrest/rtpcodecdefs/7823a48c-105d-b232-07b4-635a20810345",
     "ObjectId": "7823a48c-105d-b232-07b4-635a20810345",
     "DisplayName": "G.722"
  },
  {
     "URI": "/vmrest/rtpcodecdefs/8923aabc-3650-b232-1b00-0788b04a84c6",
     "ObjectId": "8923aabc-3650-b232-1b00-0788b04a84c6",
     "DisplayName": "G.729"
  },
  {
     "URI": "/vmrest/rtpcodecdefs/9a23b48c-060d-b267-2589-5701238ab567",
     "ObjectId": "9a23b48c-060d-b267-2589-5701238ab567",
     "DisplayName": "iLBC"
  }
  ]
}
Response Code: 200


Listing Codecs for a Specific Port Group

The following is an example of GET request that list the codecs for a particular port group:

GET https://<connection-server>/vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

<PortGroupCodecs total="1">
  <PortGroupCodec>
     <URI>/vmrest/portgroups/bcf14081-f142-4429-bb58-
   e7704cbd969e/portgroupcodecs/1cac6677-acd8-4f5a-ac35-26c626eda515</URI>
     <ObjectId>1cac6677-acd8-4f5a-ac35-26c626eda515</ObjectId>
     <MediaPortGroupObjectId>bcf14081-f142-4429-bb58-
   e7704cbd969e</MediaPortGroupObjectId>
     <PortGroupURI>/vmrest/portgroups/bcf14081-f142-4429-bb58-
   e7704cbd969e</PortGroupURI>
     <RtpCodecDefObjectId>5623a48c-255d-a121-a4b4-
   5788238a8123</RtpCodecDefObjectId>
     <PreferredPacketSizeMs>20</PreferredPacketSizeMs>
     <Preference>1</Preference>
     <RtpCodecDefDisplayName>G.711 mu-law</RtpCodecDefDisplayName>
     <CodecsURI>/vmrest/rtpcodecdefs/</CodecsURI>
  </PortGroupCodec>
<PortGroupCodecs>
Response Code: 200

JSON Example:

GET https://<connection-server>/vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs
Accept: application/json
Connection: keep-alive

The following is the response from the above *GET* request and the actual response will depend upon the information given by you:

{
  "@total": "2",
  "PortGroupCodec": [
  {
     "URI": "/vmrest/portgroups/74a008c0-bdc6-4e4b-a304-
     8a220a081990/portgroupcodecs/7e176c22-8e01-4c6f-b60c-074143f11a67",
     "ObjectId": "7e176c22-8e01-4c6f-b60c-074143f11a67",
     "MediaPortGroupObjectId": "74a008c0-bdc6-4e4b-a304-8a220a081990",
     "PortGroupURI": "/vmrest/portgroups/74a008c0-bdc6-4e4b-a304-8a220a081990",
     "RtpCodecDefObjectId": "5623a48c-255d-a121-a4b4-5788238a8123",
     "PreferredPacketSizeMs": "20",
     "Preference": "1",
     "RtpCodecDefDisplayName": "G.711 mu-law",
     "CodecsURI": "/vmrest/rtpcodecdefs/"
  },
  {
     "URI": "/vmrest/portgroups/74a008c0-bdc6-4e4b-a304-
     8a220a081990/portgroupcodecs/0b1f066c-2781-4821-b327-d2afc40674a1",
     "ObjectId": "0b1f066c-2781-4821-b327-d2afc40674a1",
     "MediaPortGroupObjectId": "74a008c0-bdc6-4e4b-a304-8a220a081990",
     "PortGroupURI": "/vmrest/portgroups/74a008c0-bdc6-4e4b-a304-8a220a081990",
     "RtpCodecDefObjectId": "8923aabc-3650-b232-1b00-0788b04a84c6",
     "PreferredPacketSizeMs": "20",
     "Preference": "2",
     "RtpCodecDefDisplayName": "G.729",
     "CodecsURI": "/vmrest/rtpcodecdefs/"
  }
  ]
}
Response Code: 200


Adding Codec to a Port Group

The codec settings can be added to a port group. The following are the mandatory fields:

   *Codec Object Id (RtpCodecDefObjectId)
   *Preferred Packet Size

Obtain the object ID of the codec using the following URI:

GET https://<connection-server>/vmrest/rtpcodecdefs

The value of the PreferedPacketSizeMS can be 10, 20, 30, 40, 50, or 60. The following is an example of POST request to add codec to a port group:

POST https://<connection-server>/vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs
Request Body:
<PortGroupCodec>
     <RtpCodecDefObjectId>5623a48c-255d-a121-a4b4-5788238a8123</RtpCodecDefObjectId>
     <PreferredPacketSizeMs>20</PreferredPacketSizeMs>
</PortGroupCodec>

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/portgroups/8a009b99-22cf-4305-822df5e449a42263/
portgroupcodecs/5623a48c-255d-a121-a4b4-5788238a8123

JSON Example:

POST https://<connection-server>/vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs
Accept: application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
     "RtpCodecDefObjectId":"5623a48c-255d-a121-a4b4-5788238a8123",
     "PreferredPacketSizeMs":"20"
}

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/portgroups/8a009b99-22cf-4305-822df5e449a42263/
portgroupcodecs/5623a48c-255d-a121-a4b4-5788238a8123


Delete a Codec Setting from a Port Group

The following is an example of the Delete request that will delete a codec setting from a port group:

DELETE https://<connectionserver>/
vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs/<PortGroupCodecObjectId>
Response Code: 201


Changing Order of Codecs

The following is an example of the Put request that will change the order of codec for a port group:

PUT https://<connection-
server>/vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs/<PortGroupCodecObjectId>
Request Body:
<PortGroupCodec>
     <Preference>0</Preference>
</PortGroupCodec>

The following is the response from the above *PUT* request and the actual response will depend upon the information given by you:

Response Code: 204

JSON EXample:

PUT https://<connectionserver>/
vmrest/portgroups/<PortGroupObjectId>/portgroupcodecs/<PortGroupCodecObjectId>
Accept: application/json
Content-Type: application/json
Connection: keep-alive
Request Body:
{
     "Preference":"0"
}

The following is the response from the above *PUT* request and the actual response will depend upon the information given by you:

Response Code: 204

NOTE: The preference of all codecs added for the port group has to be changed and multiple PUT requests may have to be sent in case of multiple codes selected for the port group.


Explanation of Data Fields

Parameter Operations Data Type Comments
ObjectID Read Only String Specifies the object ID of the codec setting added.
MediaPOrtGroupObjectId Read Only String Specifies the object ID of the port group.
Preference Read/Write Integer Specifies the preference for this codec relative to other codecs supported for the port group. The lowest value of preference is considered as the most preferred. This field is pertinent only if the port group uses (SIP)for call control. The range can vary from 0 to 999.
PreferredPacketSizeMs Read/Write Integer Specifies the default packet size (in milliseconds)where valid values are 10, 20, 20, 40, 50, 60.
RtpCodecDefObjectId Read/Write String Object Id of the codec specified.

Rating: 0.0/5 (0 votes cast)

Personal tools