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

João Mesquita jmesquita at freeswitch.org
Mon Jan 21 01:50:41 MSK 2013


Hello everyone, this is me again. I keep pushing ppl to followup on their
stuff so I will put my money where my mouth is.

I've made big progress and I will respond to my own questions. Look inline.

I am still working on putting the pieces together because there are more
scenarios than the ones I anticipated when it comes to t38_gateway. It
turns out that FaxA can send a fax to FaxB even tho FaxB was the calling
party and therefore, T38 negotiation will be initiated by FSB instead of
the expected FSA since it is FaxB emitting CED/Preamble.

Anyhow, stay tuned and more will come (probably more questions than answers
tho).

Regards,
João Mesquita


On Thu, Jan 17, 2013 at 12:05 PM, João Mesquita <jmesquita at freeswitch.org>wrote:

> 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?
>

I am still not sure if there are cases where CED is optional but V.21
Preamble is not and SpanDSP detects both of them. A question remains...
I've read that CED (also called ASN in docs) is the same 2100Hz tone
emitted by answering machines. Does that mean we also start fax when there
is an answering machine on the other end?


>
> 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?
>

That is correct. The reason why it was not working for me is because I've
found a bug on latest stable that has been resolved on HEAD (I am doing a
bisect tomorrow) that removes the media bug installed by spandsp before it
has a chance to detect CED.


>
> 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?
>

That is also 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/20130120/ac729dca/attachment.html 


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