Hi Community,
We are trying to integrate the Zadarma Widget with Creatio. Our main objective is to load this widget every time we press the "Phone" button (marked with red square in the following image).
In order to achieve this, we need to call the necessary dependencies, so it's possible to execute the "zadarmaWidgetFn" function, as you can see on the next image.
require.config({
paths: {
loader_phone_lib: '//my.zadarma.com/webphoneWebRTCWidget/v8/js/loader-phone-lib.js?sub_v=62',
loader_phone_fn: "//my.zadarma.com/webphoneWebRTCWidget/v8/js/loader-phone-fn.js?sub_v=62"
},
});
define("CtiPanel", ["ServiceHelper", "loader_phone_lib", "loader_phone_fn"], function(ServiceHelper) {
return {
messages: {},
mixins: {},
attributes: {},
methods: {
callPhoneNumber: function (){
var number = this.get("PhoneNumber");
window.console.log(number);
var sipValue = "SIP";
var payload = {
sip: sipValue
};
ServiceHelper.callService("ImdZadarmaWebHookService", "ZadarmaWebRTCKey", function(response) {
var result = JSON.parse(response.ZadarmaWebRTCKeyResult);
window.console.log(result.key);
zadarmaWidgetFn(result.key, 'SIP', 'square', 'en', true, "{left:'10px',top:'5px'}");
}, payload, this);
}
},
diff: []
};
});
However, we are getting the following error while loading these dependencies, because one of the files "loader_phone_lib" (https://my.zadarma.com/webphoneWebRTCWidget/v8/js/loader-phone-lib.js?s…) has other dependencies that are called through tags.
We would like to know, how can we load these dependencies, that are inside the "loader_phone_lib" file, without getting this error?
Thanks in Advance.
Best Regards,
Pedro Pinheiro