Starting the second line with character "#" are created by the NAS system for other packages. You may not see these lines and you just put the last line to autorun.sh.
4. umount /dev/mtdblock5
5. cd /opt/etc/init.d
6. vi asterisk-start.sh and put the code as shown below:
#!/bin/sh
{
###
# Section 1: Changes that can be made immediately.
###
/opt/sbin/asterisk
###
# Section 2: Wait for it...
###
date; echo "Waiting for boot process to complete."
while [ ! -f /tmp/.boot_done ]; do
sleep 1
done
date; echo "Boot process completed, making custom changes."
###
# Section 3: Changes after the boot processes have finished.