[Freeswitch-users] FAX t38_gateway operation confusion (mod_spandsp)

João Mesquita jmesquita at freeswitch.org
Thu Jan 17 18:05:06 MSK 2013


Hello everyone!

I have been playing around with mod_spandsp's capabilities lately and most
certainly because I am new to the all old faxing stuff (pretty funny,
right?), I have been making a bit of a mess in my head about how a T30->T38
gateway should work.

I've set up a testing environment here as follows:

*Components:*
*
*
2 analog fax machines (call is FaxA and FaxB)
2 FXS cards
2 FreeSWITCH machines (call FSA and FSB)

*Connection scheme:*
*
*
*FaxA <-> FSA and FaxB <-> FSB*

Both of these connections are using the respective FXS cards

*FSA <-SIP-> FSB*
*
*
Both FreeSWITCHes are connected using SIP, of course.

*Call scenarios:*


   1. *FaxA sending a fax to FSB (using rxfax on FSB) - OK*
   Dialplan on FSA is:
   <action application="set" data="sip_execute_on_image="t38_gateway peer
   nocng" />
   <action application="bridge"
   data="{fax_t38_enable=true}sofia/internal/FSB" />
   Dialplan on FSB:
   <action applcation="answer"/>
   <action applcation="set" data="fax_t38_enable=true" />
   <action applcation="set" data="fax_t38_request=true" />
   <action applcation="rxfax" data="/tmp/fax.tif" />

   2. *FSB sending a a fax to FaxA - OK*
   Dialplan on FSA is:
   <action application="set" data="sip_execute_on_image="t38_gateway self
   nocng" />
   <action application="bridge"
   data="{fax_t38_enable=true}sofia/internal/FSB" />
   Originate line on FSB:

   originate {fax_enable_t38_request=true,fax_enable_t38=true}sofia/internal/FSB
'set:ignore_early_media=true,txfax:/root/fax.tiff' inline


   3. *FaxA sending a fax to FaxB in manual mode*
   4. *FaxA sending a fax to FaxB in automatic mode*
   5. *FaxA receiving a fax from FaxB in manual mode*
   6. *FaxA receiving a fax from FaxB in automatic mode*
   Here comes the problem. It is not clear to me how this should work from
   the dialplan perspective and from the theory as well. Now, as I understand,
   t38_gateway works by detecting CED tones as specified on the code by the
   line:
   *spandsp_fax_detect_session(session, "rw", timeout,
   MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, 1, direction, NULL,
   t38_gateway_start);*


*Questions:*

If this is true and looking at the T.30 standard, some of the cases
mentioned above make the CED tone optional, is this correct?

By talking to Steve Underwood yesterday on IRC, he mentioned that (and I
quote):
"the emitting gateway should detect the signal from the answering FAX
machine and initiate the change to T.38". My understanding is that on 3 for
example, FSA needs to detect CED being sent from FaxB, correct?

Looking at the T.38 standard Annex D to understand who should initiate a
T.38 re-invite at what instance, I found this phrase:

> "The receiving gateway should only use the ITU-T V.21 preamble generated
> by the answering FAX endpoint as the trigger for detection, and it should
> generate the INVITE request no more than 200 milliseconds after the ITU-T
> V.21 preamble begins, in order to allow the maximum amount of time for the
> session to transition into ITU-T T.38 mode before the answering FAX
> endpoint begins transmitting NSF, CSI or DIS."

Googling, I found that the ITU-T V.21 preamble is not CNG or CED tone, but
rather something else...  I assume that the _OR_PREAMBLE is exactly that,
correct?

I greatly appreciate any help as the Wiki is not very specific on the
analog fax stuff. My intent is to wikify all that and help the folks out
there as well. Fax seems to be mistic for more than myself.

Regards,
João Mesquita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130117/663dfd6d/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list