[Freeswitch-dev] fax tone detection inside app
Chris Burns
chris at cloudtel.com
Fri Oct 16 12:39:47 PDT 2009
Try using transfer instead of set?
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_fax_detect
On October 15, 2009 05:35:56 pm Peter Volchek wrote:
> I have just realized, that even though you turned on the fax tone
> detection, the only way to figure it out (whether the tone has been
> detected) is to poll the system variable (fax_tone_detected). In other
> words, if the prompt being played or any other lengthy operation is
> executing, I will not be able to check the variable, till that operation
> finishes.
>
> More elegant solution to that problem would be the use use of callbacks or
> hooks.
>
> The following example would demonstrate the idea:
>
> function fax_session_hook(status)
> -- fax tone detected, go and save the fax
> doProcessFax();
> end
>
> session:setFaxToneDetectHook("fax_session_hook");
> playPrompt('greeting');
>
> -- at this point we are receiving a voice mail
> session:unsetFaxToneDetectHook();
> doProcessVoice()
>
>
> Would it be difficult to implement?
> PV
>
> Michael Collins wrote:
>
>
>
> On Wed, Oct 14, 2009 at 1:09 PM, Peter Volchek <pvolchek at voicemobility.com>
> wrote:
>
> Could you provide with some examples how to do it within lua script,
> please? I was not able to find any examples myself,
>
>
>
> session:execute("tone_detect", "fax 1100 r +5000 set
> 'fax_tone_detected=true' 1")
>
> Then check for the value of the channel variable fax_tone_detected and act
> accordingly. -MC
More information about the FreeSWITCH-dev
mailing list