function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SaurabhGupta_SaurabhGupta_ 

How to get Ani (Caller Number) value in Apex controller when I am using open CTI?

I have used pop to visualforce page in softphone layout. My custom vf page is popping in the new tab of service console. But I am not able to get the ANI(Caller number) value in apex controller.
It was available in old version of CTI but in open CTI I am not able to get ANI. Please suggest.
Ashish_SFDCAshish_SFDC
Hi Saurabh,


Looks like this issue has been addressed in the link below, 

http://www.linkedin.com/groups/How-get-ANI-value-in-4216754.S.5841808408478498820

Have a look at this thread on the developer forums - https://developer.salesforce.com/forums/ForumsMain?id=906F00000009Ecq

In a nutshell, your Open CTI partner is responsible for passing along call data to the Visualforce Screen pop.


Regards,
Ashish

Andreas MeyerAndreas Meyer
indeed .. your OpenCTI Provider has to provide the number if you are using "sforce.interaction.screenPop"

example:

Javascript function in OpenCTI Softphone Adapter (coming from your OpenCTI provider):


	function screenPop() {
		//Invokes API method
		var PNR="123456"; // Number coming from OpenCTI provider
		var URL='/apex/CTI_Notification?PNR='+PNR;
		sforce.interaction.screenPop(URL, true);
	}


Constructor of your Controller:


		Map<String,String> 	pageParams;
		String 			callingNumber;

		pageParams = ApexPages.currentPage().getParameters();

		if(pageParams.containsKey('PNR')) {
			callingNumber = pageParams.get('PNR');
		}

Best,
Andreas