15

我们使用 8 端口 FXO 运行星号。FXO 连接到我们的旧 PBX(Samsung Office Serv 100)。

现在我们要记录通过 FXO 路由的所有呼叫(如果它是拨到外部或从外部来的)。

这是图表

           |------|---------------------------------
           |      |--------------24 Lines ---------- Other clasic Phones
PRI------  | PBX  |---------------------------------
           |      |
           |      |
           |      |-----------|---------|
           |      |--8 lines--|         |---------         
           |      |-----------|Asterisk |---------- 50 SIP phone
           |------|           |         |----------
                              |---------|----------

有没有一种简单的方法可以做到这一点?

4

3 回答 3

28

你在运行普通的 Asterisk 吗?如果是这样,您可以修改您的拨号计划以开始“监控”频道,这将记录通话。

monitor 命令的文档:http ://www.voip-info.org/wiki/view/Asterisk+cmd+monitor

只是为了完成,这里是文档:

[root@localhost ~]# asterisk -rx 'core show application monitor'

  -= Info about application 'Monitor' =-

[Synopsis]
Monitor a channel

[Description]
  Monitor([file_format[:urlbase],[fname_base],[options]]):
Used to start monitoring a channel. The channel's input and output
voice packets are logged to files until the channel hangs up or
monitoring is stopped by the StopMonitor application.
  file_format           optional, if not set, defaults to "wav"
  fname_base            if set, changes the filename used to the one specified.
  options:
    m   - when the recording ends mix the two leg files into one and
          delete the two leg files.  If the variable MONITOR_EXEC is set, the
          application referenced in it will be executed instead of
          soxmix and the raw leg files will NOT be deleted automatically.
          soxmix or MONITOR_EXEC is handed 3 arguments, the two leg files
          and a target mixed file name which is the same as the leg file names
          only without the in/out designator.
          If MONITOR_EXEC_ARGS is set, the contents will be passed on as
          additional arguments to MONITOR_EXEC
          Both MONITOR_EXEC and the Mix flag can be set from the
          administrator interface

    b   - Don't begin recording unless a call is bridged to another channel
    i   - Skip recording of input stream (disables m option)
    o   - Skip recording of output stream (disables m option)

By default, files are stored to /var/spool/asterisk/monitor/.

Returns -1 if monitor files can't be opened or if the channel is already
monitored, otherwise 0.

这是您可以使用它的示例方式:

; This fake context records all outgoing calls to /var/spool/asterisk/monitor in wav format.
[fake-outgoing-context]
exten => s,1,Answer()
exten => s,n,Monitor(wav,,b)
exten => s,n,Dial(DAHDI/g0/${EXTEN})
exten => s,n,Hangup()

显然,您必须对我的代码进行更改,但希望这能给您一个好主意。

于 2010-03-13T21:42:02.513 回答
11

一个真实的例子是

    扩展 => _87X,1,NoOp()
    扩展 => _87X,n,MixMonitor(${UNIQUEID}.wav,ab)
    exten => _87X,n,Dial(SIP/${EXTEN},45)
    扩展 => _87X,n,StopMixMonitor()
    扩展 => _87X,n,Hangup()

始终使用 NoOp 是一种很好的做法——第一条规则必须以 1 开头,这样您就可以按照您想要的任何方式将规则与 n 步骤互换。

最好使用 MixMonitor 而不是 Monitor - Monitor 仅记录入站或出站音频 - MixMonitor 两者都使用。

wav 作为一种格式也是一个不错的选择——我还使用脚本在一天结束时将 wav 文件转换为 OGG——大小/质量和许可问题之间的最佳折衷。

关于论据

a 是附加 b 是桥(有利于生产 - 它只会在呼叫被应答时记录 - 不利于调试)

关于 StopMixMonitor(),我只是说得很透彻,但在某些情况下,您希望停止录制,例如:

    ...
    exten => _39[5-9],n,Dial(SIP/${EXTEN},45)
    exten => _39[5-9],n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavailable)
    exten => _39[5-9],n(忙),NoOp()
    扩展 => _39[5-9],n,StopMixMonitor()
    exten => _39[5-9],n,语音信箱(${EXTEN},u)
    扩展 => _39[5-9],n,Hangup()
    exten => _39[5-9],n(不可用),NoOp()
    扩展 => _39[5-9],n,StopMixMonitor()
    扩展 => _39[5-9],n,Hangup()
    ...

在此示例中,您将停止录制语音邮件交互。

希望这会给这个问题带来一些启示。

于 2014-01-15T17:18:54.367 回答
6

Depending on the specifications of your Asterisk box you might find this hack useful too. Create a rather large ramdisk and mount /var/spool/asterisk/monitor to it. That way Asterisk records to memory not disk. Then write a script under cron to move the recordings to permanent storage every 15-30 minutes or so.

于 2010-04-02T15:37:57.590 回答