Its not only a problem of the scripting language you use.
Asterisk also needs escaping and quoting so thats what you have to add in addition to the escaping that your scripting language needs.
In your example you must send the following to Asterisk:
[quote=“srt”]Its not only a problem of the scripting language you use.
Asterisk also needs escaping and quoting so thats what you have to add in addition to the escaping that your scripting language needs.[/quote]
Indeed, but all of this is documented, just have to know how to do it in the language of choice. Details here:
If you want double quotes inside the value then you have to escape them. For example to create a variable CID whose value is "John Doe"<555-1212> you could use:
SET VARIABLE CID ""John Doe "<555-1212>