Author Message
AlokKulkarni
Joined: Jan 5, 2017
Messages: 30
Offline
Hi,
When I add a participant to Conference call, I want to get the contact object of the participant.
For this I used the method
1. getBestContactMatch() :It always returns undefined

2. getAllPossibleContactMatches(): Always returns an empty array for the contact matches for all levels.


Can someone please help what am I missing here?

ware16.avaya.com
Joined: Sep 23, 2019
Messages: 80
Offline
Hi Alok,

getBestContactMatch() & getAllPossibleContactMatches() are deprecated.
You can use following methods based on platform you are using:
1. iOS/MAC:
- (void) resolveContacts: (CSContactResolveContactsRequest *)
2. Android:
ResolveContactsRequest()
3. Windows:
public void ResolveContacts()

Thanks,
Avaya DevConnect Team
AlokKulkarni
Joined: Jan 5, 2017
Messages: 30
Offline
Thanks for the details. However I am using Javascript CSDK. What is the API there?


I had this logic implemented by myself earlier.I keep an array of contacts which I am adding in a conference call and when a participant actually gets added, I get the corresponding contact object based on the participant.getAddress() function.
participant.getAddress returned extension previously, Now it started returning email address. So for now I have both logics in place.

getContactForParticipant: function(participant) {

var participantContact;
if( this._conferenceContacts){ // // this._conferenceContacts is a list of all contacts in the conference call right now
this._conferenceContacts.forEach(function (contact) {


//Following logic is used if participant.getAddress returns the user extension. Check if participant address matches any of the conference contacts phone number.
var phoneNumbers = contact.getPhoneNumbers();
if(phoneNumbers.getSize() >= 1){
var numberArr = phoneNumbers.getValues();
if(numberArr[0].getPhoneNumber().includes(participant.getAddress()) ||
participant.getAddress().includes(numberArr[0].getPhoneNumber()) ) {
participantContact = contact;
}
}
//Following logic is used if participant.getAddress returns the user email address.Check if participant address matches any of the conference contacts email address.
var contactEmailAddressesFields = contact.getEmailAddresses();
if(contactEmailAddressesFields){
contactEmailAddressesFields.getValues().forEach(function (contactEmailAddressesField){
if(contactEmailAddressesField.getAddress().includes(participant.getAddress()) ||
participant.getAddress().includes(contactEmailAddressesField.getAddress()))
{
participantContact = contact;
}
}.bind(this));
}
}.bind(this));
}
return participantContact;
}



Please suggest me if there is any optimized version to get Contact for a participant.
jcahisa.avaya.com
Joined: Feb 6, 2020
Messages: 1
Offline
Hi Alok

In the case of the Javascript SDK, you can find the function in this link: resolveContacts

Basically what you need to do is

1. Get the contactAddress:
var searchString = participant.getAddress();


2. Create a ResolveContactsRequest
var resolveContactsRequest = new AvayaClientServices.Services.Contacts.ResolveContactsRequest(

searchStrings,
AvayaClientServices.Services.Contacts.ResolveContactsFieldType.PHONE_NUMBER,
AvayaClientServices.Services.Contacts.SearchSourceType.ALL);


3. Call the resolveContacts api:
var contactsRetrieval = sdkContactsService.resolveContacts(resolveContactsRequest);


4. subscribe a function to the DataRetrievalDoneCallback:

contactsRetrieval.addOnDataRetrievalDoneCallback(function () {

var resolveContactsResults = contactsRetrieval.getDataSet();
}.bind(this));




Please let me know if this match what your needs, or if you need any additional assistance.

Best Regards
Go to:   
Mobile view