[Freeswitch-dev] mod_fax
damjan at ecntelecoms.com
damjan at ecntelecoms.com
Tue Jan 6 22:00:40 PST 2009
> Tony, Steve, & team,
>
>> mod_fax is an unfunded work in progress so calling it crude means I
>> guess we
>> are not off to a very good start.
>
> One idea and one question:
>
> - It seems that doing fax detection over RTP/RFC2833 would be fairly
> easy if the RFC2833_CHARS in switch_utils.c was extended to support
> values like 36 (CNG) and the range 32-35 (ANS* messages). Or more
> simply if the original RFC2833 event value could be accessed directly.
> For example (in Javascript) if one could write:
>
>
> function onInput( session, type, data, arg ) {
> if ( type == "dtmf" ) {
> /* uses the plain RTP NTE event */
> if ( data.nte_event == 36 ) { /* <-- e.g. "nte_event" instead
> of "digit" */
> console_log( "info", "CNG received\n" );
> /* Caller is a sending fax macine, start rx_fax, etc. */
> }
> }
>
> ...
>
> /* Play voicemail prompt and attempt fax or DTMF detection */
> session.streamFile( "somefile.wav", onInput );
> /* No DTMF or fax detected, start recording the voicemail message. */
In RFC2833, support for relaying modem connect tones (CNG, [/]ANS[am] and
co) is optional, and relatively few implementations support them. It also
has to be supported on both sides for it to work. Carrying these tones
over compressing codecs distorts them, often beyond recognition - that's
why in T.38 it is the answering end, which has a clear channel to the
answering fax machine, that initiates the T.38 switchover.
Also CNG and ANS are not generated or generated incorrectly by many fax
machines, you need to look for V.21H HDLC flags, or even T.30 data in the
HDLC frames, to know for sure that it's a fax.
Damjan
More information about the Freeswitch-dev
mailing list