Имеем автообзвон через скрипт:
Код: Выделить всё
#!/bin/sh
while read number; do
cat <<EOF > /var/spool/asterisk/$number
Channel: SIP/ringing/$number
Callerid: $number
MaxRetries: 5
RetryTime: 20
WaitTime: 20
Context: new_dial
Extension: s
Priority: 1
Archive: Yes
EOF
chown root:root /var/spool/asterisk/$number
mv /var/spool/asterisk/$number /var/spool/asterisk/outgoing
echo "$number"
number=`expr $number + 1`
while [ "$?" -eq "0" ]
do
count_files ()
{
count_f=`ls /var/spool/asterisk/outgoing | wc -l`
if [ "$count_f" -eq "1" ]; then
sleep 30
return 0
else
return 1
fi
}
count_files
done
done < /var/spool/asterisk/new.txt
exit 0
Код: Выделить всё
#!/bin/bash
number=$1
callfile=/tmp/$number.call
Channel="216"
MaxRetries=10
RetryTime=10
WaitTime=20
Context="out_callback"
Extension="s"
Priority=1
DATA=`date`
rm -Rf $callfile
sleep 120
touch $callfile
echo "Action: Originate" >> $callfile
echo "Channel: Local/216@callback_queue/n" >> $callfile
echo "MaxRetries: $MaxRetries" >> $callfile
echo "RetryTime: $RetryTime" >> $callfile
echo "WaitTime: $WaitTime" >> $callfile
echo "Context: $Context" >> $callfile
echo "Extension: $Extension" >> $callfile
echo "Priority: $Priority" >> $callfile
echo "Set: CB=$number" >> $callfile
mv $callfile /var/spool/asterisk/outgoing/
exit 0
Сейчас заметил, что проблема возникает, если в outgoing более одного .call файла.