Author: ctrix
Date: 2007-04-01 08:01:50 -0400 (Sun, 01 Apr 2007)
New Revision: 2574
Modified:
openpbx/trunk/apps/app_t38gateway.c
Log:
More T38gw mods...
Modified: openpbx/trunk/apps/app_t38gateway.c
============================================================
=======
--- openpbx/trunk/apps/app_t38gateway.c 2007-04-01 11:16:30
UTC (rev 2573)
+++ openpbx/trunk/apps/app_t38gateway.c 2007-04-01 12:01:50
UTC (rev 2574)
 -97,16
+97,17 
struct opbx_frame *f, *fr2;
int timeout = -1;
int running = RUNNING;
+
struct opbx_dsp *dsp = NULL;
if ( !( dsp = opbx_dsp_new() ) )
opbx_log(LOG_WARNING, "Unable to allocate
DSP!n");
+ else {
+ opbx_dsp_set_threshold(dsp, 256);
+ opbx_dsp_set_features (dsp, DSP_FEATURE_DTMF_DETECT |
DSP_FEATURE_FAX_DETECT);
+ opbx_dsp_digitmode (dsp, DSP_DIGITMODE_DTMF |
DSP_DIGITMODE_RELAXDTMF);
+ }
- opbx_dsp_set_threshold(dsp, 256);
- opbx_dsp_set_features(dsp, DSP_FEATURE_DTMF_DETECT |
DSP_FEATURE_FAX_DETECT);
- opbx_dsp_digitmode(dsp, DSP_DIGITMODE_DTMF |
DSP_DIGITMODE_RELAXDTMF);
-
-
channels[0] = chan;
channels[1] = peer;
 -117,28
+118,31 
inactive = (active == channels[0]) ?
channels[1] : channels[0];
if ((f = opbx_read(active)))
{
- fr2 = opbx_frdup(f);
+ if ( ( active == chan ) && dsp )
+ fr2 = opbx_frdup(f);
+
f->tx_copies = 1; /* TODO: this is only
needed because not everything sets the tx_copies field
properly */
opbx_write(inactive, f);
clean_frame(f);
channels[0] = inactive;
channels[1] = active;
- fr2 = opbx_dsp_process(active, dsp, fr2);
- if (fr2) {
- if (fr2->frametype == OPBX_FRAME_DTMF)
- {
- if (fr2->subclass == 'f')
- {
- opbx_log(LOG_DEBUG, "Fax detected in T38
Gateway !!!n");
- opbx_app_request_t38(active);
+ if ( ( active == chan ) && fr2 && dsp) {
+ fr2 = opbx_dsp_process(active, dsp, fr2);
+ if (fr2) {
+ if (fr2->frametype == OPBX_FRAME_DTMF)
+ {
+ if (fr2->subclass == 'f')
+ {
+ opbx_log(LOG_DEBUG, "Fax detected in T38
Gateway !!!n");
+ opbx_app_request_t38(active);
+ }
}
+ if (f != fr2)
+ opbx_fr_free(fr2);
}
- if (f != fr2)
- opbx_fr_free(fr2);
}
-
}
else
{
_______________________________________________
Openpbx-svn mailing list
Openpbx-svn openpbx.org
http://lists.openpbx.org/mailman/listinfo/openpbx-svn
|