Setting channel variables for FIFO-originated calls
I'm still pretty new to FreeSWITCH, but learning my way around. I've been trying to figure out how to use a different filename for each call in an on-hook agent fifo setup. I've been setting fifo_record_template in the originate string of the member definition, e.g.
{member_wait=nowait,fifo_record_template=$${base_dir}/recordings/fifo.wav}sofia/gateway/sip.jnctn.net/18005551212
This works, but as soon as I put a (non-preprocessor) variable in there, I get a complaint that my variable contains a variable: "Invalid data (${fifo_record_template} contains a variable)". But the code in mod_fifo.c seems to expect to find variables in there:
if (record_template) { expanded = switch_channel_expand_variables(other_channel, record_template); switch_ivr_record_session(session, expanded, 0, NULL); }
So my only conclusions at this point are that either: 1. The validation rule that gives me the "contains a variable" is being overly paranoid, or 2. There must be some other way to set this variable. I've chased #2 for a little bit, but apparently since FIFO-originated calls are created without any linked session (first arg to switch_ivr_originate is NULL), I can't export the variable from the original channel either. Is there some other way to set channel variables on the calls the FIFO originates? -- Ken Treis Miriam Technologies, Inc.
For what it's worth, I've worked around this by pulling the fifo_record_template variable from the originating channel instead by using the attached patch. It means you can't set the fifo_record_template in your member definition anymore, but now the following variable expansion works: <action application="set" data='fifo_record_template=/mnt/recordings/${strftime(%Y%m%d_%H%M%S)}_${uuid:-4}_${ani}.wav' /> <action application="fifo" data="..."/> In my case, I don't really care about any of the details of the outbound call, so this worked nicely. -- Ken Treis Miriam Technologies, Inc.
participants (1)
-
Ken Treis