[Asterisk-Users] Monitor does not like variable subsitutions

Jim Van Meggelen jim at vanmeggelen.ca
Thu Feb 17 00:31:06 MST 2005


OK, forget I said that. Wrong side of my brain.

Still, it is funny that it truncates the filename at the colon. 

These lines are suspicious:

CLI>ast_writefile: No such format
'wav|rec_to_448704386865_at_16022005-16' 
Where'd the ":56:35" on the end go? Also, why is is trying to set the
format to "wav|rec_to_4487...". Shouldn't it just be "wav"?
Almost as if it sees the ":" as the first delimiter instead of the "|"

Here, it's trying to name the file using the third argument instead of
the second.
CLI>ast_monitor_start: Could not create file
/var/spool/asterisk/monitor/m 
CLI>ast_monitor_change_fname: Cannot change monitor filename of channel
SIP/3004-da21 to m, monitoring not started

I don't know if this is too kludgy, but it might help to determine if
the ":" is buggering it up.

Cut(hrs=DATETIME,:,1)
Cut(mins=DATETIME,:,2)
Cut(secs=DATETIME,:,3)
REC_FILE_NAME=rec_to_${EXTEN:1}_at_${hrs}_${mins}_${secs}
Monitor(wav|${REC_FILE_NAME}|m)

(I didn't test this, so there might be typos in there, but you get the
idea . . .)

Where ya go from there, I couldn't say.


asterisk-users-bounces at lists.digium.com wrote:
> You are using illegal characters in your file name.
> 
> See this line in your output?
> 
>> ast_writefile: No such format
> 'wav|rec_to_448704386865_at_16022005-16'
> 
> It can't get past it because the colon is not a valid
> filename character.
> 
> 
> 
> asterisk-users-bounces at lists.digium.com wrote:
>> Hello,
>> 
>> I have been attempting to get the Monitor function to
>> accept a loal variable substitution in order to use
>> the same filename later in the same context.  Monitor
>> does not appear to like it, as it attempts to use
>> wav|filename as the recording type, as opposed to just wav.
>> 
>> Here is what I get if I just supply a filename
>> directly (it works fine):
>> 
>> --context-----------------------------
>> exten => _9X.,3,Monitor(wav|recording|m)
>> --context-----------------------------
>> 
>> --CLI---------------------------------
>>     -- Executing SetVar("SIP/3004-275c",
>> "REC_FILE_NAME=rec_to_448704386865_at_16022005-16:54:10") in new
>>     stack -- Executing Monitor("SIP/3004-275c",
>> "wav|recording|m") in new stack
>>     -- Executing AGI("SIP/3004-275c", "outbound.agi")
>> in new stack
>> --CLI---------------------------------
>> 
>> Here is what I get when I attempt to to variable
>> substituion for the filename:
>> 
>> 
>> --context-----------------------------
>> exten =>
>> _9X.,2,SetVar(REC_FILE_NAME=rec_to_${EXTEN:1}_at_${DATETIME})
>> exten => _9X.,3,Monitor(wav|${FILENAME}|m)
>> --context-----------------------------
>> 
>> --CLI---------------------------------
>>     -- Executing SetVar("SIP/3004-da21",
>> "REC_FILE_NAME=rec_to_448704386865_at_16022005-16:56:35") in new
>>     stack -- Executing Monitor("SIP/3004-da21",
>> "wav|rec_to_448704386865_at_16022005-16:56:35|m") in
>> new stack
>> Feb 16 16:56:35 WARNING[17028]: file.c:934
>> ast_writefile: No such format
> 'wav|rec_to_448704386865_at_16022005-16'
>> Feb 16 16:56:35 WARNING[17028]: res_monitor.c:154
>> ast_monitor_start: Could not create file
>> /var/spool/asterisk/monitor/m-in Feb 16 16:56:35
>> WARNING[17028]: res_monitor.c:300
>> ast_monitor_change_fname: Cannot change monitor
>> filename of channel SIP/3004-da21 to m, monitoring not
>> started    -- Executing AGI("SIP/3004-da21",
>> "outbound.agi") in new stack
>> --CLI---------------------------------
>> 
>> I do believe that I had this working before (I am
>> running the CVS HEAD from yesterday).

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005
 




More information about the asterisk-users mailing list