Имя контакта, номер телефона и ссылка на сделку в уведомлениях.
Добавьте дополнительную строку @sipuni/sipuni в окне “Дополнительные npm модули”.
const SipuniApi = require("@sipuni/sipuni");
module.exports = async (args) => {
const sipuniApi = new SipuniApi({ token: args.sipuni_token });
const deal_id = args.context.found_deal? args.context.found_deal.deal_id : args.context.deal_id ;
const contact_name = args.context.contact_name;
const src_num = args.call_args.src_num
notifyData = {
"crm": "amocrm",
"title": "Входящий звонок",
"call_id": args.call_args.call_id,
"fields": [
{
"title": "Имя",
"value": contact_name
},
{
"title": "Телефон",
"value": src_num
}
],
"links": [
{
"title": "Сделка клиента",
"url": `https://${args.settings.domain}/leads/detail/${deal_id}`
}
]
}
let success = sipuniApi.sendNotifyWebphone(args.call_args.dst_num, notifyData);
return success;
};