1<apex:page>
2 <apex:includeScript value="/support/console/68.0/integration.js"/>
3 <script type="text/javascript">
4
5 /* Note: Open CTI needs to set call type to before getting it, and call type is INTERNAL/INBOUND/OUTBOUND.
6 */
7
8 var callback2 = function (result) {
9 alert('Call attached data is ' + result.data + '\n Call Type is ' + result.type);
10
11 };
12
13 /* Retrieving call ID of first call that came in and
14 * calling getCallAttachedData() to retrieve call data.
15 */
16 var callback1 = function (result) {
17 if (result.ids && result.ids.length > 0) {
18 sforce.console.cti.getCallAttachedData(result.ids[0], callback2, {getCallType:true});
19 }
20 };
21
22 //Note that we are using the CTI submodule here
23 function testGetCallAttachedData() {
24 sforce.console.cti.getCallObjectIds(callback1);
25 };
26
27 </script>
28 <h1>CTI</h1>
29 <button onclick="testGetCallAttachedData()">getAttachedData</button>
30</apex:page>