So I was able to use `eval` in my script, because I didn't need any channel variables.
const recordPath="$${recordings_dir}/"+myConference.name+"/${strftime(%Y-%m-%dT%H:%M)}.mp3";
const expanded = apiExecute('eval',recordPath);

I realized this is necessary because the variable expansion must happen inside the dialplan, not inside the `set`.

-Avi Marcus
Bestfone

On Fri, May 8, 2020 at 6:06 PM Dragos Oancea <dragos@freeswitch.org> wrote:
Try uuid_getvar and save what it returns and pass it to the next command.
Eg: uuid_getvar 2428fa31-dbfc-4d95-a2bb-a3b44f13315c recordings_dir



On Thu, May 7, 2020 at 8:38 PM Avi Marcus <avi@avimarcus.net> wrote:
I'm using javascript to trigger the conference API to record when the moderator joins.

apiExecute("conference",argv[0] + " recording start $${recordings_dir}/conf-"+argv[0]+"/${strftime(%Y-%m-%d-%H-%M)}.mp3");

Those variables should be automatically expanded by FS, just like if it was used in the dialplan?
But it seems they are being treated literally:

2020-05-07 19:25:36.609713 [ERR] mod_shout.c:893 Error opening $${recordings_dir}/conf-test/${strftime(%Y-%m-%d-%H-%M)}.mp3
2020-05-07 19:25:36.609713 [ERR] conference_record.c:277 Error Opening File [$${recordings_dir}/conf-test/${strftime(%Y-%m-%d-%H-%M)}.mp3]

Ideas?
Should I expand them myself? I was wondering about wrapping it in an eval, but that would probably have the same issue. So running an API to get the results of an eval first...

Thanks,
-Avi Marcus
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com