Ziqqi » 08 апр 2022, 10:45
Диалплан и скрипт выгладят так. При звонке на 555 попадаю на конференцию, номерам на списке /var/spool/asterisk/list.txt не приходят звонки.
что тут не так?
extensions.conf
[from-internal]
exten => _XXX,1,Dial(SIP/${EXTEN})
exten => _555, 1, Answer()
exten => _555, n,System(/var/spool/asterisk/call_list.sh)
exten => _555, n,ConfBridge(555)
exten => h, 1, System(asterisk -rx confbridge kick 555 all)
[conference]
exten => s, 1, Answer()
exten => s, n, ConfBridge(555)
/var/spool/asterisk/call_list.sh
#!/bin/sh
while read number; do
cat <<EOF > /var/spool/asterisk/$number
Channel: Local/$number@from-internal
Callerid: $number
MaxRetries: 1
RetryTime: 20
WaitTime: 30
Context: conference
Extension: 555
Priority: 1
Archive: yes
Set: CDR(userfield)=${REASON}
Account: confrence_1
EOF
chown asterisk:asterisk /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 "15" ]; then
sleep 10
return 0
else
return 1
fi
}
count_files
done
done < /var/spool/asterisk/list.txt
exit 0