[Freeswitch-users] Faxing with FreeSWITCH

Ali Pey alipey at gmail.com
Tue Mar 25 01:04:38 MSK 2014


You can use something like this:

<action application="set" data="execute_on_answer=spandsp_start_fax_detect
transfer 'FAX_DETECTED XML default' 6"/>

This way the call will be transferred only if a fax signal is detected,
otherwise, you can continue playing prompts or transferring the call
somewhere else after the 6 seconds.


Also you don't need to play silence, just start the fax detection. The
silence would only delays the fax detection. You can play a prompt or ring
back tone for 6 seconds or so and if fax is not detected, handle it as a
non-fax call.


Regards,
Ali Pey


On Mon, Mar 24, 2014 at 5:19 PM, <bruce at sqls.net> wrote:

>
> Ah, thanks for the info on fax detect..  With that and reading some more
> examples/docs I tried this..
>
> session:answer()
> session:execute("playback", "silence_stream://2000")
> session:execute("spandsp_start_fax_detect", "rxfax '/tmp/FAX-" .. uuid
> .. ".tif'")
> session:sleep(15000);
> session:hangup()
>
>
> Which seems to work.  Once it detects a fax it fire's off the rxfax app.
>   I'm not sure if maybe there's a better method to do this or not.  This
> doesn't really leave me a variable saying that no fax was detected
> outside the lack of result variables from rxfax but maybe that's good
> enough.  Any ideas on a better solution, anyone? :)
>
> On a side note.  Does anyone know -why- the playback silence_stream is
> needed? Or is it not needed at all? I see that in almost every example
> on using FreeSWITCH faxing but I'm not sure what it's purpose is.
> Thanks.
>
>
> ------ Original Message ------
> From: "Tim St. Pierre" <fs-list at communicatefreely.net>
> To: freeswitch-users at lists. <freeswitch-users at lists.freeswitch.org>
> freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=19bd6695-7e80-47d2-a671-407cd1f61276&cm_destination=http://freeswitch.org>
> Sent: 3/24/2014 3:15:08 PM
> Subject: Re: [Freeswitch-users] Faxing with FreeSWITCH
>
> >The fax detect function starts listening for fax tones while the call
> >continues. You are right, in that it is a non-blocking function.
> >
> >What you probably need to do, after making sure that media is
> >established, is call fax detect, then give the caller something to do
> >while you wait for a possible fax tone. You could just play silence to
> >the caller for a few seconds, unless there was something more relevant
> >to do. I believe that the original intent of fax detect was to be
> >invoked just before an IVR was run, so that a voice caller would just
> >listen to the menu, but a fax would start making tones that could then
> >be detected, transferring the call to the named extension where it
> >would
> >be answered as a fax.
> >
> >Hope that helps!
> >
> >On 14-03-24 01:49 PM, bruce at sqls.net wrote:
> >>
> >>  Hello! I'm working on setting up a FreeSWITCH/Flowroute fax server.
> >>The
> >>  server is connected without any nat on a 20MB fiber internet
> >>connection.
> >>  I've built some lua scripts that allow me to receive and send faxes
> >>and
> >>  log all the faxes to a sqlite database. I even have a management
> >>script
> >>  that can be called from the fs_cli to add fax2email routes and adjust
> >>  settings. It's still a pretty rough implementation but overall it's
> >>  working fairly well but I have two main questions that I hope someone
> >>  could help me with.
> >>
> >>  1) I would like to detect "voice calls" or maybe I want to detect fax
> >>  calls? There's a dialplan function to listen for and detect a fax
> >>caller
> >>  but I'm having trouble implementing it in my lua script. It seems
> >>it's a
> >>  non-blocking function, maybe? Because it just walks right over that
> >>line
> >>  instead of waiting and listening for any fax tones. I thought it
> >>would
> >>  block the script for x seconds and listen for a fax tone and return a
> >>  result based on what it found. Can someone help me accomplish
> >>something
> >>  similar to that?
> >>
> >>  2) So far, by far... my most common error is "The call dropped
> >>  prematurely". I'm not sure how to start debugging the error to figure
> >>  out what's causing it and how (if I can) solve it. I do have pcap's
> >>of
> >>  the calls from pcapsipdump and I also have the freeswitch log of each
> >>  call (my lua script pulls and saves that for each fax call). I've
> >>opened
> >>  the pcap files up in wireshark but I don't know what I'm looking for
> >>and
> >>  I think that might be over my head at the moment. Can anyone give me
> >>any
> >>  help on what this error is normally caused by or what I could look
> >>for
> >>  and/or test?
> >>
> >>  Here are a couple of example logs that ended with "The call dropped
> >>  prematurely".
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=b9c10772-5827-46aa-98a5-23a2330c7e13&cm_destination=http://bmts.us/faxlogs/FAX-2e913a50-3a4f-4abc-9882-a323a97e5138.log>
> http://bmts.us/faxlogs/FAX-<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=e9d443c1-f146-415d-83d7-3361d17f9462&cm_destination=http://bmts.us/faxlogs/FAX->
> 2e913a50-3a4f-4abc-9882-a323a97e5138.log
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=5c914ed7-f254-440c-8e6d-7d8ed891765a&cm_destination=http://bmts.us/faxlogs/_FAX-59d02d9d-c4ba-44c2-8edd-a1c9142c7c1c.log_>
> http://bmts.us/faxlogs/_FAX-<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=840d221b-357a-44b0-982b-1533c317dadb&cm_destination=http://bmts.us/faxlogs/_FAX->
> 59d02d9d-c4ba-44c2-8edd-a1c9142c7c1c.log_
> >>  <<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=4c319ad8-db28-43ff-9060-f27b7d35758a&cm_destination=http://bmts.us/faxlogs/FAX-59d02d9d-c4ba-44c2-8edd-a1c9142c7c1c.log>
> http://bmts.us/faxlogs/FAX-<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=d077bb12-78d7-4a2f-8313-bb4dc3d3d6c5&cm_destination=http://bmts.us/faxlogs/FAX->
> 59d02d9d-c4ba-44c2-8edd-a1c9142c7c1c.log>
> >>  __
> >>  __
> >>
> >>
> >>
> >>
> >>
> >>_________________________________________________________________________
> >>  Professional FreeSWITCH Consulting Services:
> >>  consulting at freeswitch.org
> >>  http://www.<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=95dc4d0c-6f2b-43c8-95a0-dc34cc845f63&cm_destination=http://www.freeswitchsolutions.com>
> freeswitchsolutions.com<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=ba6a5ef6-71d4-41b7-acd3-e752dca2ad39&cm_destination=http://freeswitchsolutions.com>
> >>
> >>  
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=a1006375-44ae-46ee-8787-772991abd4ca&cm_destination=>
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=664fa681-b411-40d3-9a54-3da5afcd5546&cm_destination=>
> >>
> >>  Official FreeSWITCH Sites
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=d4f57c62-7824-4c24-b573-07a2ba1a3dc5&cm_destination=http://www.freeswitch.org>
> http://www.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=44cbde89-df49-4eff-9189-76ba6c60af1c&cm_destination=http://www.freeswitch.org>
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=30fe28bf-2576-4f77-88ef-f6f7e635126e&cm_destination=http://wiki.freeswitch.org>
> http://wiki.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=4fcce9fc-086e-4cd6-8046-a9f22d0c1fc0&cm_destination=http://wiki.freeswitch.org>
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=2d3bded0-aac4-4123-8e89-373db3d2bea7&cm_destination=http://www.cluecon.com>
> http://www.cluecon.com<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=c4ba51ec-eff5-41b3-83d2-6deb65879fa9&cm_destination=http://www.cluecon.com>
> >>
> >>  FreeSWITCH-users mailing list
> >>  FreeSWITCH-users at lists. <FreeSWITCH-users at lists.freeswitch.org>
> freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=bf398a8b-bb6e-4bb0-b6c5-1055a0bda5a0&cm_destination=http://freeswitch.org>
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=39ee4396-a982-4515-a1e2-ea3c1cd6abe7&cm_destination=http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
> http://lists.freeswitch.org/<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=21394d2a-77a2-44b0-b9e1-5921e4595c66&cm_destination=http://lists.freeswitch.org/>
> mailman/listinfo/freeswitch-users
> >>
> >>UNSUBSCRIBE:http://lists.<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=0542f7b0-29c3-4f08-8b01-c48363ee5339&cm_destination=http://lists.freeswitch.org/mailman/options/freeswitch-users>
> freeswitch.org/mailman/<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=7cad591b-20ab-4e8a-954d-6dd60ecaf601&cm_destination=http://freeswitch.org/mailman/>
> options/freeswitch-users
> >>  <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=82256ec1-4f59-4f16-8af7-5d8870030f25&cm_destination=http://www.freeswitch.org>
> http://www.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=57853c78-5ce3-43c1-9781-4524aa56a7a3&cm_destination=http://www.freeswitch.org>
> >>
> >
> >_________________________________________________________________________
> >Professional FreeSWITCH Consulting Services:
> >consulting at freeswitch.org
> >http://www.<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=97771563-d3ee-47de-87fb-d566fd6937fb&cm_destination=http://www.freeswitchsolutions.com>
> freeswitchsolutions.com<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=1a88c0ca-437b-4b9b-a155-40d0537ec685&cm_destination=http://freeswitchsolutions.com>
> >
> >
> ><https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=55239f20-e973-47ca-bad0-58db3cd85348&cm_destination=>
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=eaf5dce9-4806-4300-b491-446c6b40826c&cm_destination=>
> >
> >Official FreeSWITCH Sites
> ><https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=c44a6823-7d45-4ddc-8c5d-397029d000fd&cm_destination=http://www.freeswitch.org>
> http://www.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=c084909d-c1a9-47be-9dae-25182d56e692&cm_destination=http://www.freeswitch.org>
> ><https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=3a2a5744-763f-44bb-a46e-3ce439fdad90&cm_destination=http://wiki.freeswitch.org>
> http://wiki.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=e3c47bd5-da6e-48c5-9064-13344623d479&cm_destination=http://wiki.freeswitch.org>
> ><https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=6e634c9c-5e23-47f2-b455-a9e4255b2a56&cm_destination=http://www.cluecon.com>
> http://www.cluecon.com<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=714364c6-145c-45b4-b60f-2022dba471a2&cm_destination=http://www.cluecon.com>
> >
> >FreeSWITCH-users mailing list
> >FreeSWITCH-users at lists. <FreeSWITCH-users at lists.freeswitch.org>
> freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=ee6d86b2-99d2-4c54-b837-b8ae11c8f629&cm_destination=http://freeswitch.org>
> ><https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=93f0fbe2-02fe-4b85-931e-48d88a73e16f&cm_destination=http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
> http://lists.freeswitch.org/<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=23603af1-6fe3-467e-918d-161a73cd3a0f&cm_destination=http://lists.freeswitch.org/>
> mailman/listinfo/freeswitch-users
> >UNSUBSCRIBE:http://lists.<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=33e80e0e-b60d-49ae-a49d-1c207c5d61ba&cm_destination=http://lists.freeswitch.org/mailman/options/freeswitch-users>
> freeswitch.org/mailman/<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=32dccef8-e9e4-4dc5-b748-9bac864da2a1&cm_destination=http://freeswitch.org/mailman/>
> options/freeswitch-users
> ><https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=adccdfc7-898e-4b4d-90e7-5f676e87f286&cm_destination=http://www.freeswitch.org>
> http://www.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=babb151f-f865-449f-baac-972843054549&cm_destination=http://www.freeswitch.org>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=5861ba48-883c-456c-b1d0-654b9757794a&cm_destination=http://www.freeswitchsolutions.com>
> freeswitchsolutions.com<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=521cec9c-4e64-4907-a3a2-da04899a70e5&cm_destination=http://freeswitchsolutions.com>
>
> 
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=b08e67c9-4c49-4543-8fc5-5de30813ce93&cm_destination=>
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=644168a8-9d41-4bbe-9e1d-d7d697d67ead&cm_destination=>
>
> Official FreeSWITCH Sites
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=8f2aef4c-0343-4ffa-816a-122562cf9281&cm_destination=http://www.freeswitch.org>
> http://www.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=d2761052-041d-4daa-b9b2-1900f945a350&cm_destination=http://www.freeswitch.org>
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=2e383671-c064-4b05-9b22-df42e44e7537&cm_destination=http://wiki.freeswitch.org>
> http://wiki.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=c39fc734-5609-45cd-b2cc-18f2328dd436&cm_destination=http://wiki.freeswitch.org>
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=328528be-c7e0-4e60-a392-49cb355524b7&cm_destination=http://www.cluecon.com>
> http://www.cluecon.com<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=5f99a4ba-6ad7-42f3-ac0d-f13d7db3ccfe&cm_destination=http://www.cluecon.com>
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists. <FreeSWITCH-users at lists.freeswitch.org>
> freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=a5fb5216-cf6c-4b3c-b16b-ed9438b7e29d&cm_destination=http://freeswitch.org>
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=5415791b-4bf9-4ebb-b7ca-939f1bc4c4a9&cm_destination=http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
> http://lists.freeswitch.org/<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=49cdd797-90ef-4471-960d-c83ac6d62a7b&cm_destination=http://lists.freeswitch.org/>
> mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=fee66711-4272-4116-8ef7-cb0f5fd0868e&cm_destination=http://lists.freeswitch.org/mailman/options/freeswitch-users>
> freeswitch.org/mailman/<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=0f4ab484-2796-49d0-898a-651e55492e2a&cm_destination=http://freeswitch.org/mailman/>
> options/freeswitch-users
> <https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=2e86f3ca-4dd0-4340-b9a3-c444a6ab71ea&cm_destination=http://www.freeswitch.org>
> http://www.freeswitch.org<https://contactmonkey.com/api/tracker?cm_session=ee64b0c4-b3ea-4168-b533-9d4a1ad93dc5&cm_type=link&cm_link=993924c7-bf1e-4eca-b33b-b0a0a06da2cb&cm_destination=http://www.freeswitch.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140324/904b9c6c/attachment-0001.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list