The essence of the problem. Retry does not work with Datacard when the device is busy.For example, if 2 call files started immediately only one will work, the second falls with error and no longer tries to dial:
[Nov 25 12:47:35] NOTICE[5801] pbx_spool.c: Call failed to go through, reason (0) Call Failure (not BUSY, and not NO_ANSWER, maybe
Circuit busy or down?)
Here how it looks in call log:
12:47:27 [74c414f9-b5b9-4c83-9ebd-79c7e417ca79]:{Type:1,Number:0038050xxxxxxx,Secret:xxx,Service:1}
12:47:35 [27a262f5-70dc-42bf-b023-0878712ac6cb]:{Type:1,Number:0038050yyyyyyy,Secret:xxx,Service:1}
12:47:49 [74c414f9-b5b9-4c83-9ebd-79c7e417ca79]: Call to +38050xxxxxxx ended with status OK.
Here is my call file:
#! /usr/bin/bash
CALL_SPOOL_DIR="/var/spool/asterisk/outgoing/"
CALL="/var/spool/asterisk/tmp/alarm-iax.call"
echo "Channel: Datacard/datacard0/$1">$CALL
echo "CallerId: 666">>$CALL
echo "MaxRetries: 10" >>$CALL
echo "RetryTime: 45">>$CALL
echo "WaitTime: 30">>$CALL
echo "Context: monitoring-alarm">>$CALL
echo "Extension: s">>$CALL
echo "Priority: 1">>$CALL
echo "Setvar: STATUS=$2">>$CALL
echo "Setvar: SERVICE=$3">>$CALL
echo "Setvar: NUM=$1">>$CALL
echo "Setvar: UID=$4">>$CALL
mv $CALL $CALL_SPOOL_DIR
extension
[monitoring-alarm]
exten = s,1,Wait(0.5)
exten = s,2,Set(VOLUME(TX)=-5)
exten = s,3,Playback(${STATUS})
exten = s,4,Playback(ru_service)
exten = s,5,Playback(${SERVICE})
exten = s,6,Hangup
exten = h,1,System(echo ${STRFTIME(${EPOCH},"GMT-2","%a, %d %b %Y %H:%M:%S %z")}[${UID}]: Call to ${NUM} ended with status OK. >>
/var/log/informer.log)
Try via Local channel:
Change call file to
Channel: Local/$1@datacard/n
Set: datacardchan=datacard0
Add to extensions.conf
[datacard]
exten => _X.,1,Dial(Datacard/${datacardchan}/${EXTEN},,); dial
exten => _X.,n,Dumpchan; to see variables. remove in production
exten => _X.,n,Congestion; send congestion to pbx_spool