Dear all,
I am working on a solution to replace dial pad in SAP CRM Interaction Center with click-to-call. Clicking the phone number should no longer open the dial pad, but instead directly use system default app for phone calls.
So far, I have two different approaches which both work, but I am not really happy with neither. Maybe there is a more 'standard' way to achieve this or somebody has a good idea.
My first approach was to replace some code in function onCommunicationLinkClicked of file crmcmp_ic_frame_scripts.js (component CRMCMP_IC_FRAME).
Old code:
if ( simple_cti == true )<br> contextAreaWnd.mcm_show_dialpad( channel_address, false, simple_cti );<br>else<br> contextAreaWnd.mcm_show_dialpad( channel_address, true, false );<br>
Replaced with:
var telephone_number = 'tel:' + channel_address;<br>window.open(telephone_number).focus();<br>
This will replace opening of dial pad by using default application for protocol TEL.
I don't like this approach because adjusting the javascript files often causes problems (e.g. during upgrades).
Second approach for component ICCMP_BP_DETAIL/BuPaCommContact:
CASE iv_property. WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype. rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link. WHEN if_bsp_wd_model_setter_getter=>fp_onclick. rv_value = 'CLICK_TO_CALL'. ENDCASE.
method EH_ONCLICK_TO_CALL. CONCATENATE gv_click_to_call_js 'thtmlbSuppressOnLoadKeyboardFocus(); window.open("' gv_click_to_call_js '", ' sy-timlo ')' INTO gv_click_to_call_js. endmethod.
<script type="text/javascript" language="javascript"> <%= controller->get_click_to_call_number_js( ). %> </script><br>
Thinking about doing the second approach for every field/attribute where a phone number is displayed is cumbersome.
Can any of you think of a better solution or an idea to replace the dial pad system wide with click-to-call?
Looking forward to your ideas.
Best regards
Sascha