ā09-27-2019 08:12 AM
Hi there,
we have created a nice 'external services' macro that dials into Webex, bluejeans or Zoom depending on the users selection. One of the entries is for the user to select 'other' where they can enter and IP or URI... What we'd like, is that when an IP is entered, the macro adds @ip.address at the end so the call manager can send the call via sip.
This is an excerpt of what I have so far:
case PHONECALLDIALPAD_ID:
fixedStringToDial=event.Text;
if (fixedStringToDial.length>0)
{
if (fixedStringToDial.includes=("@")) {fixedStringToDial=fixedStringToDial};
}
else
{
console.log("Not URI, assuming IP: ",fixedStringToDial);
fixedStringToDial=fixedStringToDial+'@ip.address';
}
xapi.command("dial", {Number: fixedStringToDial});
console.log("Actual dial string: ",fixedStringToDial);
isInOtherCall=1;
break;
This is the log from the GUI:
16:08:56CallConferenceMultiAppjsTypeError: cannot write property includes' of '199.48.152.152' at [anon] (duk_hobject_props.c:4193) internal at [anon] (CallConferenceMultiAppjs:367) strict at [anon] (extensions/xapi.js:8264) strict at _dispatch (extensions/xapi.js:3978) strict at [anon] (extensions/xapi.js:3982) strict preventsyield at forEach () native strict preventsyield at _dispatch (extensions/xapi.js:3983) strict at [anon] (extensions/xapi.js:3982) strict preventsyield at forEach () native strict preventsyield at _dispatch (extensions/xapi.js:3983) strict at [anon] (extensions/xapi.js:3982) strict preventsyield [...]367
Can anyone assist?
ā09-30-2019 06:48 AM
can anyone help?? :)
ā10-15-2019 09:09 PM
You seem to be having an issue with the .includes bit.
Try using .indexof instead:
if (fixedStringToDial.indexof("@") == -1) { console.log("Not URI, assuming IP: ",fixedStringToDial); fixedStringToDial=fixedStringToDial+'@ip.address'; }
Please remember to mark helpful responses and to set your question as answered if appropriate.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide