<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffcc" text="#330000">
<tt>I found the function STAT() does not return a zero but returns a
blank on the condition that a file does not exist. <br>
the conditional jump does not fall through when no :, and when a label
is entered, does not jump to the label, but still goes to the (1) true
condition<br>
<br>
dialplan excerpt:<br>
<br>
exten => s,n,Set(TMPFILE=${SCREEN_FILE}.gsm)<br>
exten => s,n,Set(FILE_EXISTS1=STAT(e,${SCREEN_FILE}.gsm))<br>
exten => s,n,Set(FILE_EXISTS2=${STAT(e,${SCREEN_FILE}.gsm)})<br>
exten => s,n,Set(FILE_EXISTS3=${STAT(e,${TMPFILE})})<br>
exten => s,n,NoOp(FILE_EXISTS1=${FILE_EXISTS1})<br>
exten => s,n,NoOp(FILE_EXISTS2=${FILE_EXISTS2})<br>
exten => s,n,NoOp(FILE_EXISTS3=${FILE_EXISTS3})<br>
exten =>
s,n,GotoIf(STAT(e,${SCREEN_FILE}.gsm)?Iknowthem:record-announcement)<br>
exten => s,n(record-announcement),Swift(At the tone)<br>
exten => s,n,Swift(Please tell me who is calling.)<br>
;exten => s,n,Set(SCREEN_FILE=/tmp/${CALLERID(num)})<br>
exten => s,n,Record(${SCREEN_FILE}.gsm|2|4)<br>
exten => s,n,Goto(s,connect-call)<br>
exten => s,n(Iknowthem),Playback(${SCREEN_FILE}|2|4)<br>
<br>
<br>
CLI> excerpt (file does NOT exist):<br>
<br>
-- Executing [s@custom-screen:2] Swift("Zap/4-1", "Hello") in new
stack<br>
-- Executing [s@custom-screen:3] Set("Zap/4-1",
"SCREEN_FILE=/var/lib/asterisk/sounds/callerannounce/5202") in new stack<br>
-- Executing [s@custom-screen:4] Set("Zap/4-1",
"TMPFILE=/var/lib/asterisk/sounds/callerannounce/5202.gsm") in new stack<br>
-- Executing [s@custom-screen:5] Set("Zap/4-1",
"FILE_EXISTS1=STAT(e|/var/lib/asterisk/sounds/callerannounce/5202.gsm)")
in new stack<br>
-- Executing [s@custom-screen:6] Set("Zap/4-1", "FILE_EXISTS2=") in
new stack<br>
-- Executing [s@custom-screen:7] Set("Zap/4-1", "FILE_EXISTS3=") in
new stack<br>
-- Executing [s@custom-screen:8] NoOp("Zap/4-1",
"FILE_EXISTS1=STAT(e|/var/lib/asterisk/sounds/callerannounce/5202.gsm)")
in new stack<br>
-- Executing [s@custom-screen:9] NoOp("Zap/4-1", "FILE_EXISTS2=")
in new stack<br>
-- Executing [s@custom-screen:10] NoOp("Zap/4-1", "FILE_EXISTS3=")
in new stack<br>
-- Executing [s@custom-screen:11] GotoIf("Zap/4-1",
"STAT(e|/var/lib/asterisk/sounds/callerannounce/5202.gsm)?Iknowthem:record-announcement")
in new stack<br>
-- Goto (custom-screen,s,16)<br>
-- Executing [s@custom-screen:16] Playback("Zap/4-1",
"/var/lib/asterisk/sounds/callerannounce/5202|2|4") in new stack</tt><br>
<br>
<tt>CLI> excerpt (file does exist):</tt><br>
<br>
<tt> -- Executing [s@custom-screen:3] Set("Zap/4-1",
"SCREEN_FILE=/var/lib/asterisk/sounds/callerannounce/5202") in new stack<br>
-- Executing [s@custom-screen:4] Set("Zap/4-1",
"TMPFILE=/var/lib/asterisk/sounds/callerannounce/5202.gsm") in new stack<br>
-- Executing [s@custom-screen:5] Set("Zap/4-1",
"FILE_EXISTS1=STAT(e|/var/lib/asterisk/sounds/callerannounce/5202.gsm)")
in new stack<br>
-- Executing [s@custom-screen:6] Set("Zap/4-1", <b>"FILE_EXISTS2=1"</b>)
in new stack<br>
-- Executing [s@custom-screen:7] Set("Zap/4-1", <b>"FILE_EXISTS3=1"</b>)
in new stack<br>
-- Executing [s@custom-screen:8] NoOp("Zap/4-1",
"FILE_EXISTS1=STAT(e|/var/lib/asterisk/sounds/callerannounce/5202.gsm)")
in new stack<br>
-- Executing [s@custom-screen:9] NoOp("Zap/4-1", "FILE_EXISTS2=1")
in new stack<br>
-- Executing [s@custom-screen:10] NoOp("Zap/4-1", "FILE_EXISTS3=1")
in new stack<br>
-- Executing [s@custom-screen:11] GotoIf("Zap/4-1",
"STAT(e|/var/lib/asterisk/sounds/callerannounce/5202.gsm)?s|Iknowthem:s|record-announcement")
in new stack<br>
-- Goto (custom-screen,s,16)<br>
-- Executing [s@custom-screen:16] Playback("Zap/4-1",
"/var/lib/asterisk/sounds/callerannounce/5202|2|4") in new stack<br>
-- <Zap/4-1> Playing
'/var/lib/asterisk/sounds/callerannounce/5202' (language 'en')</tt><br>
<br>
<br>
<pre class="moz-signature" cols="132">--
My wife's sister is in California.
I should buy her a Videophone2008!
Truly, The Next Best Thing to Being There!
--
WorldWideVideoPhones.com
856.380.0894
</pre>
</body>
</html>