I'm not sure if tl-web-record (web) could be used as a feature code, but any how i did set it as feature code *551 it plays back i should start recording but immediate thereafter it says recording is done following is copy of the cli looks like a file name is missing, -- Executing [*551@from-inside-tenantID:1] Macro("SIP/1555-tenantID-b7ae90c0",
"tl-set-variables2|from-inside-redir-tenantID|tenantID") in new stack
-- Executing [s@macro-tl-set-variables2:1] Set("SIP/1555-tenantID-b7ae90c0", "__tenant=tenantID") in new stack
-- Executing [s@macro-tl-set-variables2:2] Set("SIP/1555-tenantID-b7ae90c0", "CDR(userfield)=tenantID") in new stack
-- Executing [s@macro-tl-set-variables2:3] Set("SIP/1555-tenantID-b7ae90c0", "__FROM_INSIDE=1") in new stack
-- Executing [s@macro-tl-set-variables2:4] Set("SIP/1555-tenantID-b7ae90c0", "__MOH=default-tenantID") in new stack
-- Executing [s@macro-tl-set-variables2:5] GotoIf("SIP/1555-tenantID-b7ae90c0", "1 ?setmoh") in new stack
-- Goto (macro-tl-set-variables2,s,7)
-- Executing [s@macro-tl-set-variables2:7] SetMusicOnHold("SIP/1555-tenantID-b7ae90c0", "default-tenantID") in new stack
-- Executing [s@macro-tl-set-variables2:8] Goto("SIP/1555-tenantID-b7ae90c0",
"from-inside-redir-tenantID|*551|1") in new stack
-- Goto (from-inside-redir-tenantID,*551,1)
== Channel 'SIP/1555-tenantID-b7ae90c0' jumping out of macro 'tl-set-variables2'
-- Executing [*551@from-inside-redir-tenantID:1]
Macro("SIP/1555-tenantID-b7ae90c0", "tl-web-record") in new stack
-- Executing [s@macro-tl-web-record:1] Wait("SIP/1555-tenantID-b7ae90c0", "1") in new stack
-- Executing [s@macro-tl-web-record:2] Answer("SIP/1555-tenantID-b7ae90c0", "") in new stack
-- Executing [s@macro-tl-web-record:3] Playback("SIP/1555-tenantID-b7ae90c0", "tl/start-recording") in new stack
-- Playing 'tl/start-recording'
(language 'en')
-- Executing [s@macro-tl-web-record:4] Playback("SIP/1555-tenantID-b7ae90c0", "tl/beep") in new stack
-- Playing 'tl/beep' (language 'en')
-- Executing [s@macro-tl-web-record:5] GotoIf("SIP/1555-tenantID-b7ae90c0", "1?nodir") in new stack
-- Goto (macro-tl-web-record,s,8)
-- Executing [s@macro-tl-web-record:8] Record("SIP/1555-tenantID-b7ae90c0", "ogm/.") in new stack
-- Playing 'beep' (language 'en') [Sep 29 11:08:50] WARNING[28567]: file.c:1149 ast_writefile: No such format ''
[Sep 29 11:08:50] WARNING[28567]: app_record.c:272 record_exec: Could not create file ogm/
-- Executing [s@macro-tl-web-record:9] Wait("SIP/1555-tenantID-b7ae90c0", "1") in new stack
-- Executing [s@macro-tl-web-record:10] Playback("SIP/1555-tenantID-b7ae90c0", "tl/done-recording") in new stack
-- Playing 'tl/done-recording'
(language 'en')
I started thinking that <tl-web-record> (web) is not for Feature code use, i don't know why it is included in the scripts as a feature code or em i missing something
thank goodness you were able
thank goodness you were able to understand what he wrote. I was having an aneurysm following the structure of a few sentences.
script
exten => s,1,Wait(1)
exten => s,n,Answer
exten => s,n,Playback(tl/start-recording)
exten => s,n,Playback(tl/beep)
exten => s,n,GotoIf($["${DIRECTORY}" = ""]?nodir)
exten => s,n,Record(ogm/${DIRECTORY}/${FILENAME}.${FORMAT})
exten => s,n,Goto(done)
exten => s,n(nodir),Record(ogm/${FILENAME}.${FORMAT})
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
Ok, I see whats going on. If
Ok, I see whats going on. If you go back to your debug output the recording format is not defined. Your trace shows this:
-- Executing [s@macro-tl-web-record:8] Record("SIP/1555-tenantID-b7ae90c0", "ogm/.") in new stack
-- Playing 'beep' (language 'en') [Sep 29 11:08:50] WARNING[28567]: file.c:1149 ast_writefile: No such format ''
[Sep 29 11:08:50] WARNING[28567]: app_record.c:272 record_exec: Could not create file ogm/
Thats the problem. And as an FYI asterisk is trying to create the file in /var/lib/asterisk/sounds/ogm. I've seen in other cases where the script failed because ownership and permissions on that directory were not correct. That's not in this case though.
I hope this helps.
FSD
tl-web-record (web)
This was written for the web recording functionality. The FILENAME and FORMAT are passed via the web as variables and so aren't set when you dial it as a feature code. The following works as a feature code for me.
exten => s,1,Wait(1)
exten => s,n,Answer
exten => s,n,Set(FILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => s,n,Set(FORMAT=wav)
exten => s,n,Playback(tl/start-recording)
exten => s,n,Playback(tl/beep)
exten => s,n,GotoIf($["${tenant}" = ""]?nodir)
exten => s,n,Record(ogm/${tenant}/${FILENAME}.${FORMAT})
exten => s,n,Goto(done)
exten => s,n(nodir),Record(ogm/${FILENAME}.${FORMAT})
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 just used the timestamp as a somewhat unique filename that a person would still be able to make sense of.
I am using the macro tl-web-record as a feature code without issue. Why don't you post the macro as well and just go through it line by line to see whats missing. Its a very small and simple script, only about 15 lines. Also, make sure that the directory /var/lib/asterisk/sounds/ogm exists and has the correct permissions and ownership.
FSD