Maybe you could clean things up a bit and use an extension that sets some of these variables:<br><a href="http://wiki.freeswitch.org/wiki/Mod_spandsp#Execute_based_on_fax_session_outcome">http://wiki.freeswitch.org/wiki/Mod_spandsp#Execute_based_on_fax_session_outcome</a><br>
<br>Maybe do something like:<br><br><font face="courier new, monospace">originate {ignore_early_media='true'}sofia/gateway/mygateway/<a href="tel:18005551234" value="+18005551234" target="_blank">18005551234</a></font><font face="courier new,monospace"> handle_fax</font> <br>
<br>Then create that extension:<br><span style="font-family:courier new,monospace"><extension name="Handle faxes"><br> <condition field="destination_number" expression="^handle_fax$"><br>
<action application="answer"/><br> <action application="execute_on_fax_detect=txfa</span><span style="font-family:courier new,monospace">x /tmp/myfax.tif"/><br> <action application="execute_on_fax_success=perl <a href="http://fax_sent.pl">fax_sent.pl</a>"/><br>
<action application="execute_on_fax_failure=perl <a href="http://fax_failed.pl">fax_failed.pl</a>"/><br> <action application="playback" data="silence_stream://20000"/><br> <action application="hangup"/><br>
</condition><br></extension><br></span><br>Of course, do your own thing with the execute_on_fax_xxx variables. Standard disclaimer applies - test it and tinker before telling me it doesn't work. :)<br><br>
-MC<br><br><div class="gmail_quote">On Fri, Sep 21, 2012 at 12:31 PM, Adam Johnston <span dir="ltr"><<a href="mailto:ajohnston@blimessaging.com" target="_blank">ajohnston@blimessaging.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I had actually added some sleep commands in some of my other command combinations but I kept getting the same result. However, once I increased the timeout to spandsp_start_fax_detect and increased the sleep time I started getting some successful faxes out.</div>
<div><br></div><div>If no fax tone is detected I would like to set fax_result_code to a custom error code that I could then map in my controller application. Is there some way to evaluate the result of a tone detect? I've been trying the below inline dialplan but it's giving my false negatives so I'm back on the wiki looking for a solution.</div>
<div><br></div><div><span style="font-family:'courier new',monospace">'spandsp_start_fax_detect:</span><span style="font-family:'courier new',monospace">txfax /tmp/myfax.tif 10 ced,sleep:10000,set:fax_result_code:951' inline</span></div>
<div><br></div><div>Many thanks,</div><div><br></div>Adam Johnston<br clear="all"><div><br></div><br><div class="gmail_quote">On Fri, Sep 21, 2012 at 2:07 PM, Michael Collins <span dir="ltr"><<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Adam,<br><br>The key piece of information is this:<div><br><font face="courier new, monospace">[NOTICE] switch_core_state_machine.c:226 sofia/external/<a href="tel:18005551234" value="+18005551234" target="_blank">18005551234</a> has executed the last dialplan instruction, hanging up.<br>
</font><br></div>You've enabled "fax detection" on the call but you haven't told the call to actually do anything. From what you're doing it seems like you're wanting to detect a fax and then run the txfax application. But what happens if a fax is not detected? Also, what happens to the call in the interim, i.e. between the time you enable fax detect and the time it actually detects a fax tone? The call needs to do "something" while waiting for a fax tone. You may be better off sending this call to an extension and then having several dialplan actions, like "answer", "spandsp_start_fax_detect", and then a "sleep" or "playback" app, or something for the channel to do while it's waiting for fax tone.<br>
<br>Question: what do you want the call to do if no fax is detected?<br><br>-MC<br><br><div class="gmail_quote"><div><div>On Fri, Sep 21, 2012 at 10:26 AM, Adam Johnston <span dir="ltr"><<a href="mailto:ajohnston@blimessaging.com" target="_blank">ajohnston@blimessaging.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hi all,<div><br></div><div>I've been trying to use the spandsp_start_fax_detect application (with txfax as the callback) from the originate command but I keep getting a hangup before it completes.</div>
<div><br></div><div>
So far I've tried calling the app directly:</div><div><font face="courier new, monospace">originate {ignore_early_media='true'}sofia/gateway/mygateway/<a href="tel:18005551234" value="+18005551234" target="_blank">18005551234</a> &spandsp_start_fax_detect('txfax /tmp/myfax.tif 3 ced')</font></div>
<div><br></div><div>Inline dialplan:</div><div><font face="courier new, monospace">originate {ignore_early_media='true'}sofia/gateway/mygateway/<a href="tel:18005551234" value="+18005551234" target="_blank">18005551234</a> 'spandsp_start_fax_detect:txfax /tmp/myfax.tif 3 ced' inline</font>
</div><div><br></div><div>..plus some other permutations but all end with the same result:</div><div><br></div><div><div><font face="courier new, monospace">[NOTICE] mod_spandsp.c:107 Enabling fax detection 'txfax' '/tmp/myfax.tif'</font></div>
<div><font face="courier new, monospace">[DEBUG] switch_core_media_bug.c:456 Attaching BUG to sofia/external/<a href="tel:18005551234" value="+18005551234" target="_blank">18005551234</a></font></div><div><font face="courier new, monospace">[NOTICE] switch_core_state_machine.c:226 sofia/external/<a href="tel:18005551234" value="+18005551234" target="_blank">18005551234</a> has executed the last dialplan instruction, hanging up.</font></div>
</div><div><br></div><div>Am I misunderstanding how spandsp_start_fax_detect works?</div><span><font color="#888888"><div><br></div><div>Adam Johnston<br>
</div>
</font></span><br></div></div>_________________________________________________________________________<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><span><font color="#888888"><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>
<a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>
</font></span><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><br>
<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><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>