Why is file not copying using System()?

I am having a problem either with the System() application or the commands i am passing it, here is the code i am using:


exten => XXXXXXX,1,Wait(2)
exten => XXXXXXX,n,Set(fax_filename=${CALLERID(dnid)}${CALLERID(num)}
exten => _XXXXXXX,n,RxFax(${FAX_DIR_1}${fax_filename}.tif)
exten => _XXXXXXX,n,Wait(2)
exten => _XXXXXXX,n,system(mv $FAX_DIR_1}${fax_filename}.tif ${FAX_DIR_2}${fax_filename}.tif)
exten => _XXXXXXX,n,Hangup()[/code]

This code receives the incoming fax fine and writes to disk no problem, It then is supposed to copy the tif file over to another directory however it does not

It doesnt seem to throw an error but it doesnt seem to work either ?

to try and debug i also tryed replaced the problem line with:

This also did not throw an error but did not write to the file

I have check all paths and filenames and i have no doubt they are all in the correct places

Is there anything obviously wrong with this code?

I am using asterisk on Fedora core 7


Try it using the full paths for the commands .


Try this.

Change this:
exten => _XXXXXXX,n,system(mv $FAX_DIR_1}${fax_filename}.tif ${FAX_DIR_2}${fax_filename}.tif)

To this: (note extra brace here)
exten => _XXXXXXX,n,system(mv ${FAX_DIR_1}${fax_filename}.tif ${FAX_DIR_2}${fax_filename}.tif)


the rxFax application automatically hangs up once the fax has been receieved so i just moved the “move file” line to the hangup extension