I am setting channel variable execute_on_answer in my call to application bridge. Like this: <action application='bridge' data='{execute_on_answer=record_session $${base_dir}/storage/recorded_sessions/${uuid}_${strftime(%Y%m%d-%H%M%S)}.wav}sofia/external/ DestinationNumber@192.168.2.2' /> The above works, and the application record_session is executed on the leg b. However, the uuid it gets is from leg a, and the timestamp is from the time bridge was executed, which as I understand, is happening because the variable interpolation is performed at the moment the application bridge is executed. So, is there a way to delay variable interpolation to the instant the b leg app is executed? br, takeshi
Try this instead: http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_bleg_ap... and http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_bleg_da... -MC On Thu, Mar 31, 2011 at 1:32 AM, mayamatakeshi <mayamatakeshi@gmail.com>wrote:
I am setting channel variable execute_on_answer in my call to application bridge. Like this:
<action application='bridge' data='{execute_on_answer=record_session $${base_dir}/storage/recorded_sessions/${uuid}_${strftime(%Y%m%d-%H%M%S)}.wav}sofia/external/ DestinationNumber@192.168.2.2' />
The above works, and the application record_session is executed on the leg b. However, the uuid it gets is from leg a, and the timestamp is from the time bridge was executed, which as I understand, is happening because the variable interpolation is performed at the moment the application bridge is executed. So, is there a way to delay variable interpolation to the instant the b leg app is executed?
br, takeshi
_______________________________________________ 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 http://www.freeswitch.org
Thanks, I tried that but still it doesn't work. The following dialplan (starting record_session 2 times) generates filenames with the same UUID/TimeStamp: <action application='set' data='bridge_pre_execute_bleg_app=record_session'/> <action application='set' data='bridge_pre_execute_bleg_data=/recorded_sessions/file1_${uuid}_${strftime(%Y%m%d-%H%M%S)}.wav'/> <action application='bridge' data='{execute_on_answer=record_session /recorded_sessions/file2_${uuid}_${strftime(%Y%m%d-%H%M%S)}.wav}sofia/internal/ term1@127.0.0.1'/> file1_b3b338d8-8e52-4077-8b41-0ddc587716da_20110401-222314.wav file2_b3b338d8-8e52-4077-8b41-0ddc587716da_20110401-222314.wav But I think there is a simple solution: I just have to use ESL to watch for CHANNEL_ANSWER or set execute_on_answer=lua somescript.lua" and set the filename inside the script. br, takeshi On Fri, Apr 1, 2011 at 1:30 PM, Michael Collins <msc@freeswitch.org> wrote:
Try this instead:
http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_bleg_ap... and
http://wiki.freeswitch.org/wiki/Channel_Variables#bridge_pre_execute_bleg_da...
-MC
On Thu, Mar 31, 2011 at 1:32 AM, mayamatakeshi <mayamatakeshi@gmail.com>wrote:
I am setting channel variable execute_on_answer in my call to application bridge. Like this:
<action application='bridge' data='{execute_on_answer=record_session $${base_dir}/storage/recorded_sessions/${uuid}_${strftime(%Y%m%d-%H%M%S)}.wav}sofia/external/ DestinationNumber@192.168.2.2' />
The above works, and the application record_session is executed on the leg b. However, the uuid it gets is from leg a, and the timestamp is from the time bridge was executed, which as I understand, is happening because the variable interpolation is performed at the moment the application bridge is executed. So, is there a way to delay variable interpolation to the instant the b leg app is executed?
br, takeshi
_______________________________________________ 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 http://www.freeswitch.org
_______________________________________________ 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 http://www.freeswitch.org
participants (2)
-
mayamatakeshi
-
Michael Collins