Twilio Simulring Funlet Install - twilio

I'm trying to get [https://github.com/twilio-labs/function-templates/tree/main/funlet-simulring] to work. I'm trying to upgrade my IVR to have a whisper (announce who is calling to the called party before accepting the call) and a voicemail fallback so callers don't get my personal cell voicemail instead of the work line.
I'm trying to get the Funlet Simulring working. I'm getting an error at the "split" function (full error copied below).
I copied in the code here (https://github.com/twilio-labs/function-templates/blob/main/funlet-simulring/functions/funlet-simulring.protected.js) and two numbers to line 37:
phoneNumbers: [+1xxx,+1xxx],
I also have to environmental variables set:
TWILIO_VOICE_WEBHOOK_URL=/funlet-simulring and:
FUNLET_SIMULRING_PHONE_NUMBERS=+1xxx,+1xxx
I put some more context below, but my issue is if I "fix" the split error the number doesn't forward, but if I leave it as is I get a function error.
I've tried editing line 145 since "FUNLET_FINDME_PHONE_NUMBERS" seems to me to not be defined anywhere. But if I define it my just hard coding in my forwarding numbers, I can get the function to play, but it doesn't forward anywhere.
Error: {"message":"Cannot read property 'split' of undefined","name":"TypeError","stack":"TypeError: Cannot read property 'split' of undefined\n at getPhoneNumbers (/var/task/handlers/ZNxxx.js:145:37)\n at Object.exports.handler (/var/task/handlers/ZNxxx.js:387:29)\n at Object.exports.handler (/var/task/node_modules/runtime-handler/index.js:339:10)\n at Runtime.exports.handler (/var/task/runtime-handler.js:17:17)\n at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:74:25)"}

Related

I'm using ComputerCraft, a minecraft mod that adds computers, modems, and other peripherals. In this mod, you can write code using Lua

This is my first time using Lua, and with following a tutorial, Im making a chat program, allowing two players to send and receive messages to each other. The receiving is called chatreceive.lua. The script is:
rednet.open("right")
sender, message = rednet.receive()
print("computer " .. sender .. " has sent :")
print(message)
I keep getting an error saying
chatreceive.lua:3: attempt to concatenate global 'sender' (a nil value)
Any solutions? Ive been trying for a while now
That means that the variable 'sender' was nil. This probably means that there was some sort of error with rednet. You should add a lot of checks to make sure your programs don't fail in critical situations:
if sender==nil then
print("SENDER IS NIL!!!")
end
Also, what version of CC are you using? You shoud be more specific, to get better answers...

How to draw line with Microsoft POS Printer

I am using the Microsoft Point Of Service SDK and I am testing both in my application and the Sample provided with the SDK to try and print a Line with code similar to this:
posPrinter.DrawRuledLine(PrinterStation.Receipt, "0,500", LineDirection.Horizontal, 1, LineStyle.BrokenLine, 1);
I get this error:
POSControlException ErrorCode(Illegal) ExtendedErrorCode(0) occurred: Method DrawRuledLine threw an exception. Attempt was made to perform an illegal or unsupported operation with the device, or an invalid parameter value was used.
Microsoft POS has a tendency to throw very generic errors and I don't know what I am doing wrong. I had similar errors on other methods and it turned out it was because I was passing a parameter that didn't quite work, like a too big a width. But I have tested all kinds of combinations and this always fails. And there is no enough documentation on the parameters it receives.
What parameters do I need to pass to this method to draw a line? Is this the preferred way to draw a line with Microsoft POS?
Microsoft Point Of Service(part of the UnifiedPOS implementation) is an API with an abstract standard specification and does not have all the features of a real printer.
If your printer and the service object that runs it do not have DrawRuledLine functionality, you will get that error.
ErrorCode Enumeration (POS for .NET v1.12 SDK Documentation)
Illegal
An attempt was made to perform an illegal or unsupported operation with the device, or an invalid parameter value was used.
The presence or absence of the function can be confirmed in advance by checking the value of the CapRecRuledLine(CapSlpRuledLine for Slip stations) property.
If you want to draw a line on a receipt with this DrawRuledLine method, you need to switch to a printer and service object that supports that feature.
If you don't want to change the printer, you'll have to replace it with a character line.

Error trying to configure esx_addonaccount

I am trying to make a fivem server and have been able to configure esx_addonaccount once before, but now that I have needed to restart my project it is not seeming to work. My database is considered fine, and I am running a completely vanilla install minus the esx framework plugins and esx_addonaccount, which is the problem. This occurs when I load into the server anytime.
Error running system event handling function for resource esx_addonaccount: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: #esx_addonaccount/server/main.lua:87: attempt to index a nil value (local 'xPlayer')
stack traceback:
#esx_addonaccount/server/main.lua:87: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218>
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182>
Please help!!
#esx_addonaccount/server/main.lua:87: attempt to index a nil value (local 'xPlayer')
Above is a line from your error. It basically says that in resource esx_addonaccount, in folder ./server/, in file main.lua, in line 87 you are trying to access xPlayer variable, but in this specific case it equals nil. This means that either you have not initialized ESX correctly or somehow xPlayer is not existing - eg. player with given ID doesn't exist.
The best bet would be to check the whole 'path' of this variable - where is it created, initialized and populated with data.
ESX resources should work out of the box, so if it doesn't, then try to follow the installation instructions in their README files or on github and see if you did everything to correctly install them on your server.

Twilio Twimlets are broken

The echo twimlet gives this error in the developer console when trying to save:
TypeError: $(...) is null
base.js:2:20968
TypeError: t is not a function
Ajax.Request<.initialize()
ext.js:1
t()
ext.js:1
Ext.lib.Ajax.request()
ext.js:4
.request()
ext.js:6
.save()
twimlets.js:1
Ext.Button<.onClick()
ext.js:13
E/a()
ext.js:5
n/a()
ext.js:3
ext.js:1:18861
Any ideas on what might be the problem? I've tried even a very simple echo twimlet, as well as trying to edit an existing twimlet.
There is currently an issue with editing saved Twimlets. An error will occur when you attempt to edit a saved Twimlet. However, this error does not apply when generating a new Twimlet.
We are moving towards using Twiml Bins in the Twilio Console. You can create request URLs containing some TwiML instructions and save and edit them at anytime.
It can be a bit of extra work to do this from scratch so if you are really hoping to stick with the Twimlet, alternatively, be sure to check your URL encoding.

Lua error for WoW addon (Tukui)

I don't have a lot of coding experience, did some C a few years ago, so that helps, but Lua handles things a bit differently, so I can't keep track.
I sometimes (not always) get this error when a friend or guildy logs into the game:
Date: 2013-06-14 16:57:57
ID: -1
Error occured in: Global
Count: 4
Message: ..\AddOns\Tukui\scripts\chat.lua line 335:
attempt to concatenate upvalue 'classColor' (a nil value)
Debug:
[C]: ?
Tukui\scripts\chat.lua:335: AddMessage()
..\FrameXML\ChatFrame.lua:2755: ChatFrame_MessageEventHandler()
..\FrameXML\ChatFrame.lua:2491: ChatFrame_OnEvent()
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:281:
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:252
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:308:
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:296
I have to do a reload of the ui after this happens to be able to see chat text again for that person.
Line 335 in that .lua file is this:
text = replace(text, "^|Hplayer:(.+)|h%[(.+)%]|h", "|Hplayer:%1|h|cff"..classColor.."%2|r|h")
Now I've learned that the .. indicates the concatenate function, but that isn't really helping me.
I don't know if this is enough information, but if you need it I can post the whole local function or whatever else is required.
If it makes any difference, I'm running the 3.3.5a WoW client.
You are probably using a global that gets defined from some other addon in a now deterministic way
While the (classColor or "") will get you rid of the error, you should try and find why that variable (classColor) is sometimes defined and sometimes not. Maybe it happens only for certain classes?
A simple hack would be to just replace
..classColor..
with
..(classColor or "")..
where it will select a blank string when classColor has no value assigned to it.

Resources