нужно сделать колбек + диза.
есть скрипт
Код: Выделить всё
#!/bin/sh
sleep 5
cat << EOF > /tmp/$NUMBER.call
NUMBER=$1
echo "Channel: SIP/multifon/$NUMBER
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Context: disa1
Extension: s
Priority: 1
AlwaysDelete: Yes" >/var/spool/asterisk/tmp/$NUMBER
EOF
chown asterisk:asterisk /tmp/$NUMBER.call
mv /tmp/$NUMBER.call /var/spool/asterisk/outgoing/
Код: Выделить всё
Channel: SIP/multifon/79251xxxxxxx
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Context: disa1
Extension: s
Archive: Yes
Такое ощущение что файл просто не создается, вот диалплан.
Код: Выделить всё
[from-multifon]
include => internal
exten => _X.,1,GotoIf($["${CALLERID(num)}" = "79251891044"]?callback1,s,1)
exten => _X.,n,Hangup
Код: Выделить всё
[callback1]
exten => s,1,System(/etc/asterisk/scripts/callback 8${CALLERID(num)} &)
exten => s,n,Hangup
Код: Выделить всё
<------------>
-- Executing [79261945604@from-multifon:1] GotoIf("SIP/multifon-0000001b", "1?callback1,s,1") in new stack
-- Goto (callback1,s,1)
-- Executing [s@callback1:1] System("SIP/multifon-0000001b", "/etc/asterisk/scripts/callback 879251891044 &") in new stack
-- Executing [s@callback1:2] Hangup("SIP/multifon-0000001b", "") in new stack
== Spawn extension (callback1, s, 2) exited non-zero on 'SIP/multifon-0000001b'
Scheduling destruction of SIP dialog '020232165C8140000002F450@SFESIP1-id1-ext' in 6400 ms (Method: INVITE)
<--- Reliably Transmitting (NAT) to 193.201.229.35:5060 --->
SIP/2.0 603 Declined
Via: SIP/2.0/UDP 193.201.229.35:5060;branch=z9hG4bKsn1ctb006g3gslgsj7k0.1;received=193.201.229.35;rport=5060
From: <sip:79251891044@10.190.35.18>;tag=95ffcd055e0f78f7d5d397020e89288d991f19a0
To: sip:79261945604-qr4vc4rvrgl30@10.190.35.4:5060;tag=as74f2c628
Call-ID: 020232165C8140000002F450@SFESIP1-id1-ext
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.12.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
<------------>
<--- SIP read from UDP:193.201.229.35:5060 --->
ACK sip:79261945604@37.59.239.64:5060 SIP/2.0
Via: SIP/2.0/UDP 193.201.229.35:5060;branch=z9hG4bKsn1ctb006g3gslgsj7k0.1
CSeq: 1 ACK
Max-Forwards: 19
From: <sip:79251891044@10.190.35.18>;tag=95ffcd055e0f78f7d5d397020e89288d991f19a0
To: <sip:79261945604-qr4vc4rvrgl30@10.190.35.4:5060>;tag=as74f2c628
Call-ID: 020232165C8140000002F450@SFESIP1-id1-ext
Content-Length: 0
<------------->
(Scheduling reregistration in 51 s)
Really destroying SIP dialog '32be986d562435626166e9e239e32989@37.59.239.64' Method: REGISTER
Really destroying SIP dialog '3dc3af736e6b6fba0176ef3e01e45039@37.59.239.64' Method: REGISTER
Really destroying SIP dialog '6db054283765f29f4619f6fb348ae9a8@37.59.239.64' Method: REGISTER
Really destroying SIP dialog '61a3d8d8152cb5224bbdb8a151e14528@37.59.239.64' Method: REGISTER
Really destroying SIP dialog '25a105fb3fa4931b1fe958c135fda05a@176.9.145.115:5060' Method: NOTIFY
Really destroying SIP dialog '020232165C8140000002F450@SFESIP1-id1-ext' Method: ACK
---