Getting the call from Twilio but it's not reading the message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 11:28 PM
I have using this code, it is making the call to twilio but it's not reading the text. May I know what I am doing wrong here?
Hello,
I have configured the Twilio and SNOW connection. I am able to get the call from twilio but it's not reading the text message that I have provided him in the code
May I know how to achieve this functionality?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 12:03 AM
I'm not completely sure, but I think you are trying to use 2 different API together.
I'd say the script should be something like this:
var x = new GlideRecord('incident');
x.get('79c681211ba93514713762007e4bcb55');
var list = x.getValue('watch_list');
var list1 = list.split(',');
gs.info(list1);
var arr = [];
for (var i = 0; i < list1.length; i++) {
var user = new GlideRecord('sys_user');
if (user.get(list1[i])) {
gs.info(user.getValue('mobile_phone'));
var numbers = user.getValue('mobile_phone');
var from = '';
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber(numbers);
}
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 01:42 PM
No, it did not work. I will have to mention Twilio number as well in the from Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 10:16 AM - edited 11-30-2023 10:25 AM
I found the solution. If you are still looking for it. I tried this and it worked