Skip to main content

voice recordings

Posted by tomkat on Tue, 03/30/2010

CentOS 5.3
Asterisk 1.6
TL 6.0.1.79

In the beginning I could not make a voice recording because it would not ring my phone. Then I changed my manager.conf to include:

[internal]
secret=insecure
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,agent,user,config,command,reporting,originate
;read=system,call,log,verbose,command,agent,user
;write=system,call,log,verbose,command,agent,user

[manager]
writetimeout=200 ;;=Asterisk-1.6
secret=insecure
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
permit=192.168.1.0/255.255.255.0
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,agent,user,config,command,reporting,originate
;read=system,call,log,verbose,command,agent,user
;write=system,call,log,verbose,command,agent,user

Now my phone rings and everything seems to work but I have an issue where my voice recordings triggered from TL delete themselves after 30 seconds. Everything works when i say make new voice recording I give it a name something.way it rings my phone, prompts me to record, completes the process, the file shows up in file manager under sounds/ogm/something.wav then 30 seconds later it disappears and is nowhere to be found. In SSH it shows everything seems like it starts and ends as it is supposed to. I can create a file on my computer and upload it and everything works fine.

== Using SIP RTP CoS mark 5
== Using SIP VRTP CoS mark 6
== Using UDPTL CoS mark 5
-- Executing [*51@from-inside:1] Macro("SIP/8177517274-09736bc0", "tl-set-variables2,from-inside-redir,") in new stack
-- Executing [s@macro-tl-set-variables2:1] Set("SIP/8177517274-09736bc0", "__tenant=") in new stack
-- Executing [s@macro-tl-set-variables2:2] Set("SIP/8177517274-09736bc0", "CDR(userfield)=") in new stack
-- Executing [s@macro-tl-set-variables2:3] Set("SIP/8177517274-09736bc0", "__FROM_INSIDE=1") in new stack
-- Executing [s@macro-tl-set-variables2:4] Set("SIP/8177517274-09736bc0", "__MOH=default") in new stack
-- Executing [s@macro-tl-set-variables2:5] GotoIf("SIP/8177517274-09736bc0", "1 ?setmoh") in new stack
-- Goto (macro-tl-set-variables2,s,7)
-- Executing [s@macro-tl-set-variables2:7] Set("SIP/8177517274-09736bc0", "CHANNEL(musicclass)=default") in new stack
-- Executing [s@macro-tl-set-variables2:8] Goto("SIP/8177517274-09736bc0", "from-inside-redir,*51,1") in new stack
-- Goto (from-inside-redir,*51,1)
== Channel 'SIP/8177517274-09736bc0' jumping out of macro 'tl-set-variables2'
-- Executing [*51@from-inside-redir:1] Macro("SIP/8177517274-09736bc0", "tl-web-record") in new stack
-- Executing [s@macro-tl-web-record:1] Wait("SIP/8177517274-09736bc0", "1") in new stack
[Mar 30 13:14:44] ERROR[22423]: utils.c:1066 ast_careful_fwrite: fwrite() returned error: Broken pipe
[Mar 30 13:14:44] ERROR[22423]: utils.c:1066 ast_careful_fwrite: fwrite() returned error: Broken pipe
== Manager 'manager' logged off from 127.0.0.1
-- Executing [s@macro-tl-web-record:2] Answer("SIP/8177517274-09736bc0", "") in new stack
-- Executing [s@macro-tl-web-record:3] Playback("SIP/8177517274-09736bc0", "tl/start-recording") in new stack
-- Playing 'tl/start-recording.slin' (language 'en')

-- Executing [s@macro-tl-web-record:4] Playback("SIP/8177517274-09736bc0", "tl/beep") in new stack
-- Playing 'tl/beep.gsm' (language 'en')
-- Executing [s@macro-tl-web-record:5] GotoIf("SIP/8177517274-09736bc0", "1?nodir") in new stack
-- Goto (macro-tl-web-record,s,8)
-- Executing [s@macro-tl-web-record:8] Record("SIP/8177517274-09736bc0", "ogm/newfile2.wav") in new stack
-- Playing 'beep.gsm' (language 'en')

== Spawn extension (macro-tl-web-record, s, 8) exited non-zero on 'SIP/8177517274-09736bc0' in macro 'tl-web-record'
== Spawn extension (from-inside-redir, *51, 1) exited non-zero on 'SIP/8177517274-09736bc0'
-- Executing [h@from-inside-redir:1] Hangup("SIP/8177517274-09736bc0", "") in new stack
== Spawn extension (from-inside-redir, h, 1) exited non-zero on 'SIP/8177517274-09736bc0'

thirdlane*CLI>

As always I am a newbie so any help is appreciated.


Submitted by tomkat on Tue, 04/13/2010 Permalink

Thank you Denis for finding the solution. Now maybe someone will help with a fix. The following came off a free PBX fourm.

-It appears that the Record() function changed in 1.6. Now if you hang up it assumes the recording "failed" and it deletes the temporary file so when you're doing new recordings via System Recordings the files keep disappearing.
To ensure your recording is kept you have to press # then hang up. OR FreePBX's extensions_additional.conf needs to be modified so that the new 'k' option is passed to Record().--

This solution worked for me as well but the voice prompt still states "when done press any key". Now I can't find extensions_additional.conf and I don't know what the 'k' option is. I'm assuming it's unique to FreePBX. So Where in Asterisk can I fix this other than to fix the prompt?

Submitted by eeman on Tue, 04/13/2010 Permalink

i believe its the [macro-tl-web-record] inside /etc/asterisk/scripts.include

changing line

exten => s,n,Record(ogm/${DIRECTORY}/${FILENAME}.${FORMAT})

to

exten => s,n,Record(ogm/${DIRECTORY}/${FILENAME}.${FORMAT},k)

let me know if that solves your hangup problem, if so I'll test to see if 1.4 ignores the k or if we have to do a more PITA approach like the other 1.4 vs 1.6 changes.

Submitted by eeman on Tue, 04/13/2010 Permalink

ok good news... 1.4 ignores it.. here is the exact syntax.. theres 2 record commands to cover STE and MTE

exten => s,n,Record(ogm/${DIRECTORY}/${FILENAME}.${FORMAT},,,k)

exten => s,n(nodir),Record(ogm/${FILENAME}.${FORMAT},,,k)

notice the 3 comma's theres a field for silence and maxduration that are unused.

I'll submit the change for 1.6 compatibility.. in the interim just manually alter for your fix

Submitted by tomkat on Tue, 04/13/2010 Permalink

Thank you that worked, However; when you press # it prompts recording saved and now all you get is silence but the results are positive. Thanks again.

Submitted by eeman on Tue, 04/13/2010 Permalink

ok give this a try..

[macro-tl-web-record]

exten => s,1,Wait(1)
exten => s,n,Answer
exten => s,n,Playback(vm-intro)
exten => s,n,GotoIf($["${DIRECTORY}" = ""]?nodir)
exten => s,n,Record(ogm/${DIRECTORY}/${FILENAME}.${FORMAT},,,k)
exten => s,n,Goto(done)
exten => s,n(nodir),Record(ogm/${FILENAME}.${FORMAT},,,k)
exten => s,n(done),Wait(1)
exten => s,n,Playback(tl/done-recording)
exten => s,n,Wait(1)
exten => s,n,Hangup
exten => t,1,Hangup
exten => i,1,Wait(1)
exten => i,2,Playback(tl/done-recording)
exten => i,3,Hangup

I changed the initial greeting and got rid of the double beep. This was the only pre-canned Alison Smith recording that is anywhere close to what is appropriate to play at the beginning. When i hit pound and stay on the line I hear the confirmation done-recording message.