我刚刚开始使用Asterisk,并按照O'Reilly指南设置了一个测试Asterisk服务器。我已经设置了一个装有 CentOS 6.4 的虚拟机,它有 1GB 内存和 50 GB 硬盘。
安装后,我在两台能够相互呼叫的PC上成功设置了软电话。我现在必须记录这些电话 - 在搜索时,我找到了这个网站并相应地编辑了我的extensions.conf
。
这是我的extensions.conf
[globals]
EXT_TESTTWO=SIP/0000FFFF0002
EXT_TESTONE=SIP/0000FFFF0001
[default]
exten => 0000FFFF0001,hint,SIP/0000FFFF0001
exten => 0000FFFF0002,hint,SIP/0000FFFF0002
[Queues]
exten => 7001,1,Verbose(2,${CALLERID(all)} entering the support queue)
same => n,Queue(support)
same => n,Hangup()
exten => 7002,1,Verbose(2,${CALLERID(all)} entering the sales queue)
same => n,Queue(sales)
same => n,Hangup()
[macro-automon]
exten => s,1,Set(MONITOR_FILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(num)})
same => n,Playback(beep) ; optional - hear when recording starts
same => n,MixMonitor(${MONITOR_FILENAME}.wav,b)
[LocalSets]
include => Queues ; allow phones to call queues
exten => 101,1,Dial(${EXT_TESTONE},20,m) ; Replace 0000FFFF0001 with your device name
same => n,Playback(vm-nobodyavail) ; Play "no one's available"
same => n,Hangup()
exten => 102,1,Noop(Dialing 102);
exten => 102,n,Macro(automon) ; start monitor
exten => 102,n,Dial(SIP/0000FFFF0002,30) ; 30 secs
exten => 102,n,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => 102-NOANSWER,1,Voicemail(20,us) ; If unavailable, send to voicemail w/ unavail announce
exten => 102-NOANSWER,n,Playback(vm-goodbye)
exten => 102-NOANSWER,n,Hangup
exten => 102-BUSY,1,Voicemail(${MACRO_EXTEN},bs) ; If busy, send to voicemail w/ busy announce
exten => 102-BUSY,n,Playback(vm-goodbye)
exten => 102-BUSY,n,Hangup
exten => _102-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
;exten => 102,1,Dial(${EXT_TESTTWO},20,m) ;Replace 0000FFFF0002 with your device name
;same => n,Playback(vm-nobodyavail) ; Play "no one's available"
;same => n,Hangup()
从 101 到 102 和 102 到 101 的调用工作正常。但是没有录音属于/var/spool/asterisk/monitor
。此外,在调用过程中,我得到以下调试输出:
Read factory 0x7f971001f428 was pretty quick last time, waiting for them.
Read factory 0x7f971001f428 and write factory 0x7f9710020068 both fail to provide 160 samples
No remote address on RTP instance '0x7f9710009258' so dropping frame
Read factory 0x7f971001f428 was pretty quick last time, waiting for them.
Read factory 0x7f971001f428 and write factory 0x7f9710020068 both fail to provide 160 samples
No remote address on RTP instance '0x7f9710009258' so dropping frame
Read factory 0x7f971001f428 was pretty quick last time, waiting for them.
Read factory 0x7f971001f428 and write factory 0x7f9710020068 both fail to provide 160 samples
No remote address on RTP instance '0x7f9710009258' so dropping frame
Read factory 0x7f971001f428 was pretty quick last time, waiting for them.
Read factory 0x7f971001f428 and write factory 0x7f9710020068 both fail to provide 160 samples
No remote address on RTP instance '0x7f9710009258' so dropping frame
Read factory 0x7f971001f428 was pretty quick last time, waiting for them.
Read factory 0x7f971001f428 and write factory 0x7f9710020068 both fail to provide 160 samples
No remote address on RTP instance '0x7f9710009258' so dropping frame
Read factory 0x7f971001f428 was pretty quick last time, waiting for them.
我在这里做错了什么?如何为特定分机上的来电和去电启用通话录音?
当您使用混音监视器时,您必须检查您的 sip 设备是否具有
directmedia=no
您还可以通过启用调试来获得更多信息
如果您按原样遵循了 O'Reilly 书籍,它会要求您创建一个名为 asteriskpbx
的用户,并以该用户身份运行其余配置。因此,在开始时的安装过程中,/var/spool/asterisk/monitor
文件夹可能仅具有 root 的写入权限。您需要为实际写入文件夹的用户/组授予写入权限(即将.wav
文件写入该位置)。
chmod -R 775 /var/spool/asterisk/monitor
这应该会为您修复它。 希望这有帮助。