Bartek Kania wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Mon, 12 Jun 2006, Max CtRiX wrote:
>> It works because the ATA sends a reinvite with T38 headers both when
>> receiving and sending a fax, so openpbx can switch to udptl.
>> But there is still a problem.
>> Openpbx in chan_sip.c actually uses dsp to try to detect fax tones and
>> send a reinvite.
>> It simply does not work. It detects nothing even if it should do it.
> 
> I ran into that problem myself.
> It seems there is something wrong with the fax-tone detection.

I did the following at chan_sip about line 3180:

f = opbx_dsp_process(p->owner, p->vad, f);
  if (f->frametype == OPBX_FRAME_DTMF) {
  //if ((opbx_test_flag(p, SIP_DTMF) == SIP_DTMF_INBAND) && p->vad) {
    if (t38udptlsupport && f->subclass == 'f')  {
       // Fax tone
      opbx_log(LOG_DEBUG, "Fax CNG detected on %s\n", ast->name);
      *faxdetect = 1;
    }
  //      opbx_log(LOG_DEBUG, "* Detected inband DTMF '%c'\n", f->subclass);
  //}
}

AND at about line 2915:

  if (opbx_test_flag(i, SIP_DTMF) ==  SIP_DTMF_INBAND) {
                 i->vad = opbx_dsp_new();
#if T38_SUPPORT
                 opbx_dsp_set_features(i->vad, DSP_FEATURE_DTMF_DETECT | 
DSP_FEATURE_FAX_DETECT | DSP_DIGITMODE_RELAXDTMF);
#else
                 opbx_dsp_set_features(i->vad, DSP_FEATURE_DTMF_DETECT | 
DSP_DIGITMODE_RELAXDTMF);
#endif
                 opbx_dsp_set_threshold(i->vad, 256); ^
                 opbx_dsp_digitmode(i->vad, DSP_DIGITMODE_DTMF);^

                 if (relaxdtmf)
                         opbx_dsp_digitmode(i->vad, DSP_DIGITMODE_DTMF | 
DSP_DIGITMODE_RELAXDTMF);


(added some dsp_settings and enabled relaxed dtmf mode)

----------------
Now: what happens ??

Jun 12 10:22:55 VERBOSE[3054783408] logger.c: Got RTP packet from 
83.211.2.133:18206 (type 0, seq 59650, ts 102256520, len 160)
Jun 12 10:22:55 DEBUG[3054783408] chan_sip.c: Fax CNG detected on 
SIP/0240706874-08e0
Jun 12 10:22:55 VERBOSE[3054783408] logger.c: set_destination: Parsing 
<sip:195.62.225.244;ftag=5E929840-108D;lr=on> for address/port to sen
Jun 12 10:22:55 VERBOSE[3054783408] logger.c: set_destination: set 
destination to 195.62.225.244, port 5060
Jun 12 10:22:55 VERBOSE[3054783408] logger.c: T.38 UDPTL is at port 
88.149.167.222:8728
Jun 12 10:22:55 DEBUG[3054783408] chan_sip.c: Our T38 capability (3872), 
peer T38 capability (0), joint capability (3872)
Jun 12 10:22:55 DEBUG[3054783408] chan_sip.c: T38MaxFaxRate 9600 found
Jun 12 10:22:55 VERBOSE[3054783408] logger.c: 14 headers, 15 lines
Jun 12 10:22:55 VERBOSE[3054783408] logger.c: Reliably Transmitting 
(NAT) to 195.62.225.244:5060:

and then sends a reinvite...
openpbx says:

m=image 8728 udptl t38^

cisco says:
m=image 18206 udptl t38^

-------------
the problem is that:

Jun 12 10:23:09 WARNING[3054783408] rtp.c: RTP Read too short
Jun 12 10:23:10 WARNING[3054783408] rtp.c: RTP Read too short
Jun 12 10:23:13 WARNING[3054783408] rtp.c: RTP Read too short
Jun 12 10:23:13 WARNING[3054783408] rtp.c: RTP Read too short

Cisco sends UDPTL packets on RTP port, ignoring m=image informations.

I have seen that some ATA send a SIP INFO message together with t38 
udptl headers so, maybe, openpbx should do the same, maybe not 
triggering this error from cisco (i have seen many dumps .

Anyway, receiving a fax from a cisco sometimes works.

Sending a fax NEVER works because openpbx NEVER sends out t38 headers.
There are no DSP functions hanged on chan_write which should trigger T38 
headers upon fax detection.

I have no enought experience on this. I can hack, comment out, make 
tests, but I really do not know openpbx internals.

Max








_______________________________________________
Openpbx-dev mailing list
Openpbx-dev@openpbx.org
http://lists.openpbx.org/mailman/listinfo/openpbx-dev

Reply via email to