Record to two places without a conference?

We do only user-to-service WebRTC calls, and we currently use a conference for that. But we think we don’t need the conference if we could record the AV stream to two places, an mp4 and a forward of the stream. Is a conference inescapable if one wants the inbound AV and outbound audio all to be in a single stream and single peer connection? If not, how can we record to two places? We have tried using two record_sessions but only one is honored in FS 1.10.7.

On the other hand, if a conference is inescapable with these requirements, is it possible to set its destination to something like /dev/null ?

You can record a session without a conference with ease, just session_record, and it doesn’t matter if its a conference or a bridge.


In the log I shared in another thread, the following appears:

028eac32-e628-ccf7-1948-48f7ab87279c |--- Dialplan: verto.rtc/0010_ae52d95e-6a96-4b99-9034-c10469e462c1_v-1 Action record_session({modname=mod_av,vw=640,vh=480}/var/lib/freeswitch/recordings/${mp4_filename}) INLINE
028eac32-e628-ccf7-1948-48f7ab87279c 2022-11-05 08:56:26.699090 97.27% [ERR] mod_dialplan_xml.c:69 This application cannot be executed inline

The dialplan line it’s trying to execute is the 2nd use of record_session in this execution of the dialplan. Notice the following things in the dialplan snippet below:

  1. Line 11 sets var mp4_filename so it should be defined and usable despite what the log says above
  2. Line 33 is the first use of record_session
  3. Line 38 is the second use, resulting in the logged problem. If the problem is instead the directive in {...} then how can we control the dimensions of the recording without using conference.conf.xml?
<extension name="all-callflows">
    <!-- Allow any 3+ alphanums or dashes after digit as extension. Asterisk prefers it start with a digit.
    <condition regex="all" require-nested="false" break="never">
        <regex field="${extension}" expression="${regexExtension}" />
        <regex field="${idOfClientSession}" expression="${regexIdOfClientSession}" />

        <action application="log" data="INFO Report the start of an FS session to restfuldb."/>
        <action application="set" data="timestamp_of_session_start=${strftime(%Y-%m-%d-%H-%M-%S)}" inline="true"/>
        <action application="set" data="filename_of_session_recording=${timestamp_of_session_start}_${extension}_${idOfClientSession}" inline="true"/>
        <action application="set" data="mp4_filename=${filename_of_session_recording}.mp4" inline="true"/>
        <!-- Adapted from -->
        <action application="set" data='postBodyForStartedFsSession={ "idOfClientSession":"${idOfClientSession}", "extension":"${extension}", "timestamp":"${strftime(%Y-%m-%dT%H:%M:%S.000Z)}", "nameOfMp4": "${mp4_filename}" }' inline="true"/>
        <action application="curl" data="http://${ipOfRestfuldb}/startedFsSession content-type 'application/json' post '${postBodyForStartedFsSession}'"/>

        <action application="set" data="core_video_blank_image=false" inline="true"/>
        <action application="lua" data="${conf_dir}/dialplan/answer_then_ensure_sip_encryption.lua ${extension}"/>
        <!-- <action application="set" data="record_concat_video=true"/> RND-1459 and -->
        <action application="set" data="jitterbuffer_msec=5p:100p" inline="true"/>
        <action application="set" data="RECORD_MIN_SEC=2" inline="true"/>
        <action application="set" data="RECORD_STEREO=true" inline="true"/>
        <action application="set" data="record_sample_rate=48000" inline="true"/>

        <!-- Notify VA that a new stream will arrive soon, and then start streaming. Do so even for audio-only projects. -->
        <action application="set" data="baseUrl_startStreamCapture=http://${ipOfVideoAnalyzer}:8080?Command=startStreamCapture&idOfClientSession=${idOfClientSession}&ext=${extension}" inline="true"/>
        <condition field="${codeForDesiredExperience}" expression="v-1" require-nested="false" break="never">
            <action      application="set" data="url_startStreamCapture=${baseUrl_startStreamCapture}" inline="true"/>
            <anti-action application="set" data="url_startStreamCapture=${baseUrl_startStreamCapture}&audio_only=True" inline="true"/>
        <action application="set" data="maxSecondsToConnectToVA=3" inline="true"/>
        <action application="log" data="INFO Start streaming to video analyzer"/>
        <action application="curl" data="${url_startStreamCapture} connect-timeout ${maxSecondsToConnectToVA} post"/>
        <action application="record_session" data="{modname=mod_av,vw=640,vh=480}rtmp://${ipOfVideoAnalyzer}:5150/viewOfUser/${idOfClientSession}"/>

        <condition break="never">
            <action application="set" data="api_hangup_hook=jsrun ${conf_dir}/dialplan/cleanup.js ${idOfClientSession} ${codeForDesiredExperience} ${ipOfVideoAnalyzer} ${ipOfRestfuldb}" inline="true"/>
            <action application="set" data="session_in_hangup_hook=true" inline="true"/>
            <action application="record_session" data="{modname=mod_av,vw=640,vh=480}$${recordings_dir}/${mp4_filename}" inline="true"/>
            <action application="park"/>

I then tried removing the {...} directive from line 38 but I get the same failure:

c09d6998-bbb4-6e22-79ee-e587ff9dc777 |--- Dialplan: verto.rtc/0010_cb52c043-68dd-4f2d-bdf7-9cf986afe492_v-1 Action record_session(/var/lib/freeswitch/recordings/${mp4_filename}) INLINE
c09d6998-bbb4-6e22-79ee-e587ff9dc777 2022-11-28 11:40:15.604676 97.97% [ERR] mod_dialplan_xml.c:69 This application cannot be executed inline

Can’t record until the session is answered and media established.