RECORD_START|Freeswitch ESL 中的 STOP 事件

RECORD_START|STOP event in Freeswitch ESL

我已经设置了一个 NodeJS 应用程序(使用 node_esl)并将其连接到部署在 Amazon AWS 上的 Freeswitch 服务器的事件套接字层 (ESL)。请参阅下面的代码:

var esl = require('modesl'),
conn = new esl.Connection('SERVER_IP', PORT, 'PASSWORD', function() {
        conn.api('status', function(res) {
            //res is an esl.Event instance
            console.log(res.getBody());
        });


    conn.subscribe([
        'RECORD_START',
        'RECORD_STOP'
    ], function(evt) {
        console.log(evt)    
    });

    conn.on('esl::event::RECORD_START::*', function(evt) {
        console.log(evt);
    });

    conn.on('esl::event::RECORD_STOP::*', function(evt) {
        console.log(evt);
    });
});

我正在使用以下命令在 Freeswitch 中录制视频会议,我希望上述界面能够接收到 RECORD_START|STOP 事件。然而,从未收到上述事件。

# To start recording
conference <conf_id> recording start
# To stop recording
conference <conf_id> recording stop

以下是我正在录制的会议的 Freeswitch 配置文件:

<profile name="cp">
  <param name="domain" value="$${domain}"/>
  <param name="rate" value="8000"/>
  <param name="video-mode" value="transcode"/>
  <param name="interval" value="20"/>
  <param name="caller-controls" value="default"/>
  <param name="energy-level" value="0"/>
  <param name="conference-flags" value="wait-mod|audio-always|livearray-sync|livearray-json-status"/>
  <param name="max-members" value="25"/>
  <param name="sound-prefix" value="/usr/local/freeswitch/conf/sounds/"/>
  <param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
  <param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
</profile>

我通过此界面收到大部分 ESL 事件,但 RECORD_START|STOP 没有收到。有什么想法吗?

我对此进行了测试,看起来 RECORD_START|STOP 事件仅针对 record application (and probably the record_session 应用程序发出。我没有测试这个),但不是用于会议记录。

为了排除故障,我从 freeswitch 命令行 运行 fs_cli> /event plain all,当我 运行 conference <conf_id> recording startconference <conf_id> recording stop 时,这些事件确实出现了。

这是开始事件:

RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: fe0ebcc0-0c43-44ed-adb3-ce4e7ee8f48b
FreeSWITCH-Hostname: freeswitch
FreeSWITCH-Switchname: freeswitch
FreeSWITCH-IPv4: 192.168.1.114
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2017-09-14 17:38:22
Event-Date-GMT: Thu, 14 Sep 2017 17:38:22 GMT
Event-Date-Timestamp: 1505410702748201
Event-Calling-File: conference_record.c
Event-Calling-Function: conference_record_thread_run
Event-Calling-Line-Number: 278
Event-Sequence: 990
Conference-Name: conference
Conference-Size: 1
Conference-Ghosts: 0
Conference-Profile-Name: cp
Conference-Unique-ID: a431361f-a59b-4319-bec1-fa76f8630197
Action: start-recording
Path:{channels=1,samplerate=8000,vw=0,vh=0,fps=0.00}/usr/local/freeswitch/log/conference_recording_1.mp3
Error: File could not be opened for recording

这里是停止事件:

RECV EVENT
Event-Subclass: conference::maintenance
Event-Name: CUSTOM
Core-UUID: fe0ebcc0-0c43-44ed-adb3-ce4e7ee8f48b
FreeSWITCH-Hostname: freeswitch
FreeSWITCH-Switchname: freeswitch
FreeSWITCH-IPv4: 192.168.1.114
FreeSWITCH-IPv6: ::1
Event-Date-Local: 2017-09-14 17:38:22
Event-Date-GMT: Thu, 14 Sep 2017 17:38:22 GMT
Event-Date-Timestamp: 1505410702748201
Event-Calling-File: conference_record.c
Event-Calling-Function: conference_record_thread_run
Event-Calling-Line-Number: 418
Event-Sequence: 991
Conference-Name: conference
Conference-Size: 1
Conference-Ghosts: 0
Conference-Profile-Name: cp
Conference-Unique-ID: a431361f-a59b-4319-bec1-fa76f8630197
Action: stop-recording
Path: {channels=1,samplerate=8000,vw=0,vh=0,fps=0.00}/usr/local/freeswitch/log/conference_recording_1.mp3
Other-Recordings: true
Samples-Out: 0
Samplerate: 8000
Milliseconds-Elapsed: 0

对于您的节点应用程序,您可以尝试这样的事情来获得您需要的东西:

var esl = require('modesl'),

conn = new esl.Connection('127.0.0.1', 8021, 'ClueCon', function() {
  conn.api('status', function(res) {
    //res is an esl.Event instance
    console.log(res.getBody());
  });

  conn.subscribe('CUSTOM conference::maintenance', function() {
    conn.on('esl::event::CUSTOM::**', function(evt) {
       console.log(evt);
       // now do something
    });
  });
});