<p>Make sure you&#39;re escaping the variable with ///. This variable works in my setup. Admittedly I&#39;m using api_hangup_hook and letting my script decipher whether or not the fax was successful or not. You can also use fax_document_transferred_pages. The difference between that and ...total_pages is that transferred pages shows how many pages made it and total_pages shows how many should have made it. </p>

<p>-BDF</p>
<div class="gmail_quote">On May 6, 2012 7:02 PM, &quot;Darcy Primrose&quot; &lt;<a href="mailto:darcyp@voice2net.ca">darcyp@voice2net.ca</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>





<div bgcolor="#ffffff">
<div><font face="Arial">I did do that, however, if lists 
fax_document_total_pages as NA, and when I try to pass that parameter, I get a 
blank field.  The dialplan below is not our production, it is merely a test 
platfrom we use to allow us to ensure your data flow is correct.</font></div>
<div><font face="Arial"></font> </div>
<div><font face="Arial">Darcy</font></div>
<blockquote style="PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px">
  <div style="FONT:10pt arial">----- Original Message ----- </div>
  <div style="BACKGROUND:#e4e4e4;FONT:10pt arial"><b>From:</b> 
  <a title="bdfoster@endigotech.com" href="mailto:bdfoster@endigotech.com" target="_blank">Brian 
  Foster</a> </div>
  <div style="FONT:10pt arial"><b>To:</b> <a title="freeswitch-users@lists.freeswitch.org" href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">FreeSWITCH Users Help</a> 
  </div>
  <div style="FONT:10pt arial"><b>Sent:</b> Sunday, May 06, 2012 1:39 PM</div>
  <div style="FONT:10pt arial"><b>Subject:</b> Re: [Freeswitch-users] 
  execute_on_fax_success/failure</div>
  <div><br></div>
  <p>You news to pass fax_document_total_pages to your script. Please read the 
  spandsp page on the wiki (search spandsp). </p>
  <p>Also by looking at your script you might be able to polish up your dialplan 
  so that its not so complicated.</p>
  <div class="gmail_quote">On May 6, 2012 11:06 AM, &quot;Darcy Primrose&quot; &lt;<a href="mailto:darcyp@voice2net.ca" target="_blank">darcyp@voice2net.ca</a>&gt; wrote:<br type="attribution">
  <blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><u></u>
    <div bgcolor="#ffffff">
    <div><font face="Arial">I am using excute_on_fax_success to call a script when 
    a fax is received, the script converts the fax to pdf and emails it,  
    Is there a way to pass the number of pages received, ie, a variable created 
    by spandsp.  Everything works, but I do not seem to be able to pass the 
    variables.</font></div>
    <div><font face="Arial"></font> </div>
    <div><font face="Arial">   &lt;condition field=&quot;destination_number&quot; 
    expression=&quot;^1(\d{10})$|(\d{10})$&quot;&gt;<br>    
       &lt;action application=&quot;set&quot; 
    data=&quot;faxtempdirectory=/faxfiles/${caller_id_number}&quot;/&gt;     <br>    
       &lt;action application=&quot;system&quot; data=&quot;mkdir 
    ${faxtempdirectory}&quot;/&gt;      <br>       
    &lt;action application=&quot;set&quot; 
    data=&quot;faxDirection=outbound&quot;/&gt;       <br>       
    &lt;action application=&quot;set&quot; data=&quot;<a href="mailto:emailAddress=$1$2@$%7Bfax2net_server%7D%22/" target="_blank">emailAddress=$1$2@${fax2net_server}&quot;/</a>&gt;<br>       
    &lt;action application=&quot;set&quot; 
    data=&quot;faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}&quot;/&gt;<br>       &lt;action 
    application=&quot;set&quot; data=&quot;execute_on_fax_success=system 
    /./var/mail/sentfaxes/fax2mail.sh ${faxFile} <a href="mailto:$1$2@$%7Bfax2net_server" target="_blank">$1$2@${fax2net_server</a>} ${fax_security_code} ${fromRc} 
    fax2net_orig=${fax_email}= ${fax_transfer_rate}&quot;/&gt;   
    </font></div>
    <div><font face="Arial">       &lt;action 
    application=&quot;answer&quot;/&gt;<br>       &lt;action 
    application=&quot;playback&quot; 
    data=&quot;silence_stream://2000&quot;/&gt;<br>      
     &lt;action application=&quot;set&quot; 
    data=&quot;fax_enable_t38_request=true&quot;/&gt;<br>       
    &lt;action application=&quot;set&quot; 
    data=&quot;fax_enable_t38=true&quot;/&gt;<br>      
     &lt;action application=&quot;rxfax&quot; 
    data=&quot;${faxFile}.tif&quot;/&gt;<br>      
     &lt;action 
    application=&quot;hangup&quot;/&gt;<br>  &lt;/condition&gt;  
    <br></font></div>
    <div><font face="Arial">Thanks</font></div>
    <div><font face="Arial">Darcy 
    Primrose</font></div></div><br>_________________________________________________________________________<br>Professional 
    FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>FreeSWITCH-powered 
    IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH 
    Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>FreeSWITCH-users mailing 
    list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div>
  <p>
  <hr>

  <p></p>_________________________________________________________________________<br>Professional 
  FreeSWITCH Consulting 
  Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered 
  IP PBX: The CudaTel Communication 
  Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH 
  Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>FreeSWITCH-users 
  mailing 
  list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</p></blockquote></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div>