Originate - text with comma treated as arguments

Hi I use in dialplan

same = n,Originate(${channel},app,agi,“googletts.agi,”${ttsTEXT}“,${ttsLANG},${ttsSPEED}”,c(${CALLERID(num)})n(“${CALLERID(name)}”))

Let’s say ttsTEXT=My text, following text, another text so googletts.agi should receive “My text, following text, another text” but no, as I see in console
Executing [600@originateMSG:16] Originate(“Local/s@autodialout-Call-0000007b;1”, “PJSIP/tootai_105,app,agi,“googletts.agi,“Message from 23/11/2024, next text, another one”,fr,1.4”,c(0390123456)n(“Labo”)”) in new stack
[2024-11-22 14:01:59] NOTICE[8718][C-0000012f]: app_originate.c:222 originate_exec: Invalid timeout: ’ another one,fr,1.4’. Setting timeout to 30 seconds
[2024-11-22 14:01:59] WARNING[8718][C-0000012f]: app.c:3054 parse_options: Unrecognized option: ‘,’
[2024-11-22 14:01:59] WARNING[8718][C-0000012f]: app.c:3054 parse_options: Unrecognized option: ‘,’
and on the phone I only receive in english “My text”. If I remove both commas in text, I get the whole message in french.

Another one: I replace in originate command app+agi with context/exten/prio which is doing un Gosub to a context that I know is working with commas as I use it to send messages on incoming calls. Same problem as with agi, commas are treated as argument separator.

For me, problem is connected to originate command. I tried to escape commas with \ no luck. If I replace them with a dot or semi-colon, it works.

Any clue on this?


Daniel

Escape possible double quotes in text and then surround it with double quotes

same => n,Set(MESSAGE_BODY=${STRREPLACE(MESSAGE(body),“\”“,”\\\“”)});
same => n,Set(MESSAGE_BODY=“${MESSAGE_BODY}”);