Changeset 3165
The T.38 gateway should now be monitoring for CED from the receiving end, and
should try to kick T.38 into gear if it seems it.
Still need to mute which the T.38 negotiation occurs, and check for when that is
abanoned.
Committed by:
coppice
Date:
Jun 26 2007 * 16:30 (about 1 year ago)
Affected files:
callweaver/trunk/apps/app_t38gateway.c (unified diff)
| r3164 | r3165 | |
|---|---|---|
| 102 | 102 | struct opbx_frame *fr2; |
| 103 | 103 | int timeout = -1; |
| 104 | 104 | int running = RUNNING; |
| 105 | struct opbx_dsp *dsp = NULL; | |
| 105 | struct opbx_dsp *dsp_cng = NULL; | |
| 106 | struct opbx_dsp *dsp_ced = NULL; | |
| 106 | 107 | |
| 107 | if ((dsp = opbx_dsp_new()) == NULL) | |
| 108 | if ((dsp_cng = opbx_dsp_new()) == NULL) | |
| 108 | 109 | { |
| 109 | 110 | opbx_log(LOG_WARNING, "Unable to allocate DSP!\n"); |
| 110 | 111 | } |
| 111 | 112 | else |
| 112 | 113 | { |
| 113 | opbx_dsp_set_threshold(dsp, 256); | |
| 114 | opbx_dsp_set_features(dsp, DSP_FEATURE_DTMF_DETECT | DSP_FEATURE_FAX_CNG_DETECT); | |
| 115 | opbx_dsp_digitmode(dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF); | |
| 114 | opbx_dsp_set_threshold(dsp_cng, 256); | |
| 115 | opbx_dsp_set_features(dsp_cng, DSP_FEATURE_DTMF_DETECT | DSP_FEATURE_FAX_CNG_DETECT); | |
| 116 | opbx_dsp_digitmode(dsp_cng, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF); | |
| 116 | 117 | } |
| 117 | 118 | |
| 119 | if ((dsp_ced = opbx_dsp_new()) == NULL) | |
| 120 | { | |
| 121 | opbx_log(LOG_WARNING, "Unable to allocate DSP!\n"); | |
| 122 | } | |
| 123 | else | |
| 124 | { | |
| 125 | opbx_dsp_set_threshold(dsp_ced, 256); | |
| 126 | opbx_dsp_set_features(dsp_ced, DSP_FEATURE_FAX_CED_DETECT); | |
| 127 | } | |
| 128 | ||
| 118 | 129 | channels[0] = chan; |
| 119 | 130 | channels[1] = peer; |
| 120 | 131 | |
| --- | --- | |
| 126 | 137 | if ((f = opbx_read(active))) |
| 127 | 138 | { |
| 128 | 139 | |
| 129 | if ((active == chan) && dsp) | |
| 140 | if ((active == chan) && dsp_cng) | |
| 130 | 141 | fr2 = opbx_frdup(f); |
| 131 | 142 | else |
| 132 | 143 | fr2 = NULL; |
| --- | --- | |
| 137 | 148 | channels[0] = inactive; |
| 138 | 149 | channels[1] = active; |
| 139 | 150 | |
| 140 | if ((active == chan) && fr2 && dsp) | |
| 151 | if (active == chan) | |
| 141 | 152 | { |
| 142 | if ((fr2 = opbx_dsp_process(active, dsp, fr2))) | |
| 153 | /* Look for FAX CNG tone */ | |
| 154 | if (fr2 && dsp_cng) | |
| 143 | 155 | { |
| 144 | if (fr2->frametype == OPBX_FRAME_DTMF) | |
| 156 | if ((fr2 = opbx_dsp_process(active, dsp_cng, fr2))) | |
| 145 | 157 | { |
| 146 | if (fr2->subclass == 'f') | |
| 158 | if (fr2->frametype == OPBX_FRAME_DTMF) | |
| 147 | 159 | { |
| 148 | opbx_log(LOG_DEBUG, "Fax detected in T38 Gateway !!!\n"); | |
| 149 | opbx_app_request_t38(active); | |
| 160 | if (fr2->subclass == 'f') | |
| 161 | { | |
| 162 | opbx_log(LOG_DEBUG, "FAX CNG detected in T38 Gateway !!!\n"); | |
| 163 | opbx_app_request_t38(active); | |
| 164 | } | |
| 150 | 165 | } |
| 151 | 166 | } |
| 152 | 167 | } |
| 153 | 168 | } |
| 169 | else | |
| 170 | { | |
| 171 | /* Look for FAX CED tone or V.21 preamble */ | |
| 172 | if (fr2 && dsp_ced) | |
| 173 | { | |
| 174 | if ((fr2 = opbx_dsp_process(active, dsp_ced, fr2))) | |
| 175 | { | |
| 176 | if (fr2->frametype == OPBX_FRAME_DTMF) | |
| 177 | { | |
| 178 | if (fr2->subclass == 'F') | |
| 179 | { | |
| 180 | opbx_log(LOG_DEBUG, "FAX CED detected in T38 Gateway !!!\n"); | |
| 181 | opbx_app_request_t38(active); | |
| 182 | } | |
| 183 | } | |
| 184 | } | |
| 185 | } | |
| 186 | } | |
| 154 | 187 | if (f != fr2) |
| 155 | 188 | { |
| 156 | 189 | if (fr2) |
| --- | --- | |
| 168 | 201 | break; |
| 169 | 202 | } |
| 170 | 203 | |
| 171 | if (dsp) | |
| 172 | opbx_dsp_free(dsp); | |
| 204 | if (dsp_cng) | |
| 205 | opbx_dsp_free(dsp_cng); | |
| 206 | if (dsp_ced) | |
| 207 | opbx_dsp_free(dsp_ced); | |
| 173 | 208 | |
| 174 | 209 | return running; |
| 175 | 210 | } |
![Home changeset 3165 [home]](/images/logo.png?1180520111)
RSS Feeds