Browser-Phone icon indicating copy to clipboard operation
Browser-Phone copied to clipboard

Adding custom buttons in buddy/contact details

Open vieridipaola opened this issue 2 years ago • 2 comments

Hi,

I add custom buttons in buddy details to allow users to open HIS or CRM after a call has been terminated so one can select any contact in the list and re-open external data sources if necessary.

Doing this on an invite works fine:

var web_hook_on_invite = function(session) {
[...]
	var buddyObj = FindBuddyByIdentity(session.data.buddyId);
[...]
	$("#contact-" + buddyObj.identity + "-action-buttons").append("<button onclick=\"window.open('" + targetURL + "', '" + HIStarget + "');\" class=roundButtons title=\"HIS\"><i class=\"fa fa-h-square\"></i></button>");

However, the custom buttons vanish on a page reload.

I guess I need to customize the updatebuddylist function in order to make these custom buttons "permanent".

Is there another way to do this in a "pre-script" without patching phone.js?

vieridipaola avatar May 04 '22 23:05 vieridipaola

Try use the CRM space for this kind of thing.

InnovateAsterisk avatar May 16 '22 10:05 InnovateAsterisk

The CRM space is available when receiving a call (addLineHTML), but is it also available in the buddy list details? I can use the CRM div just fine for the incoming dialog. However, I want the CRM data to be visible even after a call has finished and even if I reload the web page, ie. reload the buddy list. When selecting a buddy/contact, I would like to see the CRM links in the right pane. That's why I was using "action-buttons", but the custom CRM links are lost on a page reload.

vieridipaola avatar May 16 '22 15:05 vieridipaola