Im trying to remove a space from a variable. Is this possible?
I tried using CUT with no success.
Dialplan
exten => s,1,Noop(${CALLERID(all)})
exten => s,n,Set(callrecordingfile=${CALLERID(name)}_${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)})
exten => s,n,Set(MONITOR_EXEC=/u02/asterisk/scripts/moverecordedfiles.sh)
exten => s,n,Monitor(wav,${callrecordingfile},m)
The trouble Im having is that I want to make a recording file set as thier name not the extension they are calling from. But because thier name has a space in it the recording file is not created.
How do I remove a space from a variable?
Thanks.
See the following example:
[cut_test]
exten=>777,1,Answer
exten=>777,2,Set(ALL=Abc Def)
exten=>777,3,NoOp(${ALL})
exten=>777,4,Set(FIRST=${CUT(ALL, ,1)})
exten=>777,5,Set(SECOND=${CUT(ALL, ,2)})
exten=>777,6,NoOp(${FIRST}---${SECOND})
exten=>777,7,Hangup
Cheers.
Marco Bruni
www.marcobruni.net
Thanks, that helped a lot.
I realize what i did wrong with the cut.
I did this:
[cut_test]
exten=>777,1,Answer
exten=>777,2,Set(ALL=Abc Def)
exten=>777,3,NoOp(${ALL})
exten=>777,4,Set(FIRST=${CUT($ALL, ,1)})
exten=>777,5,Set(SECOND=${CUT($ALL, ,2)})
exten=>777,6,NoOp(${FIRST}—${SECOND})
exten=>777,7,Hangup
Which is wrong. Should not be $ALL.
Just in case anyone else finds this.