Question

I'm just starting out with Asterisk and following the O'Reilly Guide to set up a test Asterisk server. I have set up a VM with CentOS 6.4, which has 1GB RAM and 50 GB HDD.

After installation, I set up soft phones successfully on 2 PCs which were able to call each other. I have to record these calls now - on searching, I found this site and ediiting my extensions.conf accordingly.

Here's my 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()

The calling from 101 to 102 and 102 to 101 work fine. But there are no recordings which come under /var/spool/asterisk/monitor. Moreover, during the call, I get the following debug output:

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.

What am I doing wrong here? How can I enable call recordings for both incoming and outgoing calls on a particular extension?

Was it helpful?

Solution 2

If you have followed the O'Reilly book as is, it asks you to create a user called asteriskpbx and run the rest of the configurations as that user. As a result, during the installation process in the beginning, the /var/spool/asterisk/monitor folder may have write permissions only for root. You need to give write permissions to for the user/ group which is actually writing into the folder (i.e writing the .wav file to that location).

chmod -R 775 /var/spool/asterisk/monitor

This should fix it for you. hope this helps.

OTHER TIPS

When you using mixmonitor you have check that your sip devices have

directmedia=no

Also you can have more info by enabling debugging

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top