Хотим поздравлять сотрудников по телефону автоматически по крону сделал скрипт
Вот скрипт
Код: Выделить всё
[root@localhost outgoing]# cat /srv/dial.pl
#!/usr/bin/perl
$file = "/var/spool/asterisk/outgoing/$ARGV[0]";
$phone = $ARGV[0];
open(FILE, "> $file");
print FILE "Channel: LOCAL/".$phone."\@autodial\n";
print FILE "CallerID: 84995555555\n";
print FILE "MaxRetries: 2\n";
print FILE "RetryTime: 10\n";
print FILE "WaitTime: 60\n";
print FILE "Context: autodial\n";
print FILE "Extension: s\n";
print FILE "Priority: 2\n";
close(FILE);
Код: Выделить всё
[root@localhost outgoing]# cat /etc/asterisk/extensions_custom.conf
exten => *0101,1,ChanSpy(SIP/101,wqv(-1)
exten => *0102,1,ChanSpy(SIP/102,wqv(-1)
exten => *0103,1,ChanSpy(SIP/103,wqv(-1)
exten => *0104,1,ChanSpy(SIP/104,wqv(-1)
exten => *0105,1,ChanSpy(SIP/105,wqv(-1)
exten => *0106,1,ChanSpy(SIP/106,wqv(-1)
exten => *0107,1,ChanSpy(SIP/107,wqv(-1)
[autodial]
exten => _X.,1,Dial(SIP/MSM/${EXTEN:1})
exten => s,1,Playback(pozdreavlenyice)
Код: Выделить всё
[root@localhost outgoing]# /srv/dial.pl 8925371XXXX
Код: Выделить всё
[root@localhost outgoing]# ls
8925371XXXX
Код: Выделить всё
[root@localhost outgoing]# cat 8925371XXXX
Channel: LOCAL/8925371XXXX@autodial
CallerID: 84995555555
MaxRetries: 2
RetryTime: 10
WaitTime: 60
Context: autodial
Extension: s
Priority: 2
Код: Выделить всё
[2013-06-30 13:56:12] WARNING[5093]: pbx_spool.c:297 safe_append: Unable to set utime on /var/spool/asterisk/outgoing/8925371XXXX: Operation not permitted
-- Attempting call on LOCAL/8925371XXXX@autodial for s@autodial:2 (Retry 1)
-- Executing [89253715126@autodial:1] Dial("Local/8925371XXXX@autodial-00000011;2", "SIP/MSM/925371XXXX") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
[2013-06-30 13:56:12] ERROR[5857]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo("MSM", "(null)", ...): Name or service not known
[2013-06-30 13:56:12] WARNING[5857]: chan_sip.c:5860 create_addr: No such host: MSM
[2013-06-30 13:56:12] WARNING[5857]: app_dial.c:2345 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Auto fallthrough, channel 'Local/8925371XXXX@autodial-00000011;2' status is 'CHANUNAVAIL'
[2013-06-30 13:56:12] NOTICE[5856]: pbx_spool.c:372 attempt_thread: Call failed to go through, reason (8) Congestion (circuits busy)
[2013-06-30 13:56:12] WARNING[5856]: pbx_spool.c:297 safe_append: Unable to set utime on /var/spool/asterisk/outgoing/8925371XXXX: Operation not permitte
-- Auto fallthrough, channel 'Local/8925371XXX@autodial-0000000d;2' status is 'CHANUNAVAIL'
Что я не так делаю ?