Author Message
Alex999
Joined: Nov 4, 2019
Messages: 16
Offline
Hi,

We are trying to update the contact information with ContactService.updateContact. We got a message replying the operation is successful. But we didn't see any change of the value. What might be going on? Should we set up something on server side? The code snippets is listed below.



EditableContact editableContact = contactService.createEditableContactFromContact(holder.item);
if(holder.cb_contact_favorite.isChecked()){
editableContact.getRank().setValue(1.0f);
updateContact(editableContact);
Toast.makeText(getContext(), "checked" + holder.item.getRank().getValue(), Toast.LENGTH_LONG).show();
}
else{
editableContact.getRank().setValue(2.0f);
Toast.makeText(getContext(), "not checked", Toast.LENGTH_LONG).show();
}

private void updateContact(EditableContact editableContact){
contactService.updateContact(editableContact, new UpdateContactCompletionHandler() {
@Override
public void onSuccess(Contact contact) {
Log.d("Alex update contact ", "update successfully");
}

@Override
public void onError(ContactException e) {
Log.d("Alex update contact ", "update failed" + e);
}
});
}




Jayant_Wete
Joined: Jul 26, 2018
Messages: 10
Offline
Hi Alex,

Thanks for positing the query on this forum.

Please provide following details to understand the issue properly.

1> Verbose logs covering the operation.

2> Server details. ( Whats the source of contacts)

Regards,
DevConnect Team
Jayant_Wete
Joined: Jul 26, 2018
Messages: 10
Offline
Hi Alex,

Hope you are doing great.

Let's know the above logs to work on this issue.

There are basically two types of enterprise contacts, Public contact and Private contacts.
Public contacts are the ones which are administered or corporate contacts or which are linked from Active directory.
Private contacts are the personal contact of a user.

Let me know which type of contact you are trying to update. Secondly each contact has a unique value / id, while updating the contact you must provide that value.

Third thing is, the source of contacts. Which server you are using here to get the contacts?

Thanks.
Alex999
Joined: Nov 4, 2019
Messages: 16
Offline
Many thanks for the reply, Jayant.


There are basically two types of enterprise contacts, Public contact and Private contacts.
Public contacts are the ones which are administered or corporate contacts or which are linked from Active directory.
Private contacts are the personal contact of a user.


I am not quite sure what we are using is private or public contacts. I followed the client sample sdk and it fetch contacts from the server and stored in the phone.


Let me know which type of contact you are trying to update. Secondly each contact has a unique value / id, while updating the contact you must provide that value.


I new an EditableContact from the fetched contact and pass it as parameter of updateContact function. The server replied me with a success but the value is not changed.
Jayant_Wete
Joined: Jul 26, 2018
Messages: 10
Offline
Hi Alex,

Hope you are doing great.

Have you attached the logs for the query? It would be fast to give proper solution if the logs are available.

Please attach the logs.

Thanks.

DevConnect Team
Alex999
Joined: Nov 4, 2019
Messages: 16
Offline
Hi Jayant,

Please find the log in the following link.

Here are some snippets got from server describing a success.


2020-01-22 13:08:34.011 24475-24475/com.wistron.pushtotalk D/Alex: Observer onStartEvent
2020-01-22 13:08:34.021 24475-24475/com.wistron.pushtotalk D/Alex: Observer onResumeEvent
2020-01-22 13:08:34.059 24475-24475/com.wistron.pushtotalk D/Alex backstack: ----------------------------------------------
2020-01-22 13:08:34.059 24475-24475/com.wistron.pushtotalk D/Alex backstack:: add main tab
2020-01-22 13:08:50.469 24475-24475/com.wistron.pushtotalk D/Alex update contact: update successfully
2020-01-22 13:08:50.470 24475-24475/com.wistron.pushtotalk D/Alex update contact: update successfully0



https://www.dropbox.com/s/18doxte5ewutd50/log.txt?dl=0

Actually, we are just trying to make some order of the contacts. All I found is to update the Rank. Do you have any other suggestions?



Jayant_Wete
Joined: Jul 26, 2018
Messages: 10
Offline
Hi Alex,

Thanks for providing the logs.

From the logs I can see two issues.
1> The Subscription getting sent by client to server to get "Avaya-ccs-profile" notification is getting sent with "Expires=0"
=> Which is causing the subscription to be timeout.



2020-01-22 13:08:30.329 25811-25859/? D/SIP: SENDING 1130 bytes to 210.61.150.29:5061 {

SUBSCRIBE sips:210.61.150.29:5061;transport=tls SIP/2.0
From: <sips:501031@avaya.com.tw>;tag=a8f590fa-3e6f-4b7b-b57e-001325fa7e36
To: <sips:501031@avaya.com.tw>;tag=7735893995451796_local.1569991191706_6336284_6413750
Call-ID: d1c4330c-58d3-4742-ad60-54672029c98a
CSeq: 4 SUBSCRIBE
Max-Forwards: 70
Via: SIP/2.0/TLS 172.19.1.236:42520;branch=z9hG4bK2428de00-6c28-4d4e-99cf-99c2aae41baa
Supported: eventlist,outbound,replaces
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,NOTIFY,MESSAGE,REFER,INFO,PUBLISH,UPDATE
User-Agent: Avaya Communicator Android/3.7.4 (FA-RELEASE41-BUILD.2; Pixel)
Contact: <sips:501031@172.19.1.236:42520>;+sip.instance="<urn:uuid:b5a28825-cb24-4738-9a0e-eccb5c982f8c>"
Route: <sips:210.61.150.29:5061;transport=tls;lr;ipcs-line=29227>
Authorization: Digest realm="avaya.com.tw",nonce="16fcb67f5363ee76a82ff46598a5da23112f8fb40fa",uri="sips:avaya.com.tw",opaque="1234567890abcedef",qop=auth,response="9ed9f1c45335ce8949ac91a3ce70955a",username="501031",cnonce="0f2eae49927a2a279517dae3ffc50e4d",nc=00000011
Event: avaya-ccs-profile
Expires: 0
Accept: application/profile+xml
Content-Length: 0



The contact provider uses the status of this subscription to change its capabilities. And the above subscription is failed, it changes its capability of update contact to false.


2020-01-22 13:08:30.514 25811-25859/? D/ClientSDK: CContactService::OnContactManagerUpdateContactCapabilityChanged(): Allowed = no (Not supported)


Now the second problem is,
2> The client shall check the capability of CSDK before calling the functionality. Even though the capability to update contact is false, client is trying to call "update contact".

So, you first need to see why the subscription is going with "Expires=0" it should be "Expires =3600" and then again check the capability of contact service before calling the update contact functionality.

Thanks again for posting your query here, we will be pleased to help you in future. Let us know if you need any further help.

Regards,
DevConnect Team
Go to:   
Mobile view