[Home]

Summary:ASTERISK-17754: [patch] OOH323 does not do full T.38 Handshaking / Fax Detection is limited
Reporter:Gregory Hinton Nietsky (irroot)Labels:
Date Opened:2011-04-26 11:01:20Date Closed:2011-07-10 05:38:47
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/chan_ooh323
Versions:1.8.3 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug19183.patch
( 1) issue19183-2.patch
( 2) issue19183-final.patch
( 3) ooh323_faxdetect.patch
Description:Im working on full handshaking for this driver and correct fax detection.

OOH323 <-> receive fax does not handshake / detect Fax/T38

Watch this space for updates

This fits in with the T.38 Integration im working on.
Comments:By: Alexander Anikin (may213) 2011-04-27 12:50:30

Suggest this issue is already fixed.
Could you check it with patch from issue 0018693 plus patch from trunk rev311687?

With these patch i have work systems with t.38 between h.323 and sip and h.323-app_*fax also.

By: Gregory Hinton Nietsky (irroot) 2011-04-27 13:28:50

yeah that does go a far way im looking at it more in depth perhaps see the patch i just posted adds a faxdetect option that will control it should look for a fax extension as per other channel drivers we should send a negotiate request and wait for negotiated and only switch over when negotiated.

thx for the input appreciated ....

By: Leif Madsen (lmadsen) 2011-04-27 13:47:41

Close?

By: Gregory Hinton Nietsky (irroot) 2011-04-27 13:55:41

@lmadsen id like some leeway here there is some room for work see the patch this adds sip like faxdetect to the chan im working on it ill let you know ;)

By: Alexander Anikin (may213) 2011-04-27 15:35:56

Okay, will review attached patch. But for first i suggest that request negotiation must come not from channel driver but from asterisk core.
channel driver driver can detect fax cng or ced then send it as dtmf to core
then core layer send AST_T38_NEGOTIATE request (if need) to channel driver to change channel mode from voice to t.38, then channel driver respond NEGOTIATED if channel is capable t.38.

By: Leif Madsen (lmadsen) 2011-04-27 16:56:07

No worries I don't need to close it, just reading the feedback it seemed like it wasn't necessary, but I guess I misunderstood.

By: Gregory Hinton Nietsky (irroot) 2011-04-28 13:18:00

Ok got T38modem / GnuGK / chan_ooh323 / HylaFAX rocking with me T.38 GW bits ...

what im trying to do here is add a faxdetect option that works similar to that in other channels and divert the call to the fax extension to work with my existing dialplans as much as possible.

thx for bearing with me ... there a couple cleanups that will be included at no extra cost.

By: Gregory Hinton Nietsky (irroot) 2011-04-29 11:07:11

If a call is answered and ooh323 has changed to T.38 for example when a dialplan app answers the channel ....

if this call gets to receivefax there will be no negotiation it will request the params but ooh323 will not respond ... i have fixed this patch to follow.

By: Gregory Hinton Nietsky (irroot) 2011-04-29 11:07:12

If a call is answered and ooh323 has changed to T.38 for example when a dialplan app answers the channel ....

if this call gets to receivefax there will be no negotiation it will request the params but ooh323 will not respond ... i have fixed this patch to follow.

By: Gregory Hinton Nietsky (irroot) 2011-05-01 13:27:47

Updated trunk patch on reviewboard.

By: Alexander Anikin (may213) 2011-05-04 17:16:01

i adapted your patch for the current trunk, pls update on review board

By: Gregory Hinton Nietsky (irroot) 2011-05-05 02:49:10

Thank you i cant put this patch onto reviewboard as it appears its not against asterisk-trunk ?? it does not apply when i tried.

thank you for taking a look at it ill remove the lock from the existing patch on RB when your trunk is merged your patch will apply ??

the channel is working great as follows

HylaFAX <-> T38Modem <-> chan_ooh323 <-> res_fax [T38<->T30 GW] <-> chan_dahdi

By: Alexander Anikin (may213) 2011-05-09 06:28:06

Hi,

i have bad results with efax->t38modem->chan_ooh323->res_fax->chan_sip (t38 disabled, alaw codec). Sending side is efax, receiving side is sip remote side.
When receiving side answers i see next messages:

[May  9 15:17:50] VERBOSE[4157] chan_ooh323.c: +++++ ooh323_queryoption 10 on channel OOH323/telecore-2
[May  9 15:17:50] VERBOSE[4157] res_fax.c:     -- T.38 Gateway starting for chan OOH323/telecore-2 and peer SIP/asthq-00000002
[May  9 15:17:50] VERBOSE[4157] chan_ooh323.c: ----- ooh323_indicate 0 on call ooh323c_3
[May  9 15:17:50] WARNING[4157] chan_ooh323.c: Don't know how to indicate condition 0 on ooh323c_3
[May  9 15:17:50] VERBOSE[4157] chan_ooh323.c: ++++  ooh323_indicate 0 on ooh323c_3
[May  9 15:17:50] WARNING[4157] channel.c: Unable to handle indication 0 for 'OOH323/telecore-2'
[May  9 15:17:50] VERBOSE[4157] chan_ooh323.c: ----- ooh323_queryoption 10 on channel OOH323/telecore-2

Then there is a lot of queryoption messages:


[May  9 15:17:52] VERBOSE[4157] chan_ooh323.c: +++++ ooh323_queryoption 10 on channel OOH323/telecore-2
[May  9 15:17:52] VERBOSE[4157] chan_ooh323.c: ----- ooh323_queryoption 10 on channel OOH323/telecore-2
[May  9 15:17:52] VERBOSE[4157] chan_ooh323.c: +++++ ooh323_queryoption 10 on channel OOH323/telecore-2
[May  9 15:17:52] VERBOSE[4157] chan_ooh323.c: ----- ooh323_queryoption 10 on channel OOH323/telecore-2

so it's like to infinite loop.
10 is AST_OPTION_T38_STATE and ooh323_queryiotion return 4, T38_STATE_NEGOTIATED


When asnwering side hang up see messages:
[May  9 15:17:54] VERBOSE[4157] res_fax_spandsp.c:     -- Connection Statistics
       Bit Rate :0
       ECM : No
       Pages : 0

By: Alexander Anikin (may213) 2011-05-09 14:17:25

The reason of that happen in my previous post is loosing of frame->src in ast_write function where ast_framehook_list_write_event is called and next part
of ast_write just drop ifp frame. I mean write t38 packet from t38gateway to t38
side.

Patch that help me below:


@@ -4774,10 +4775,12 @@

       /* Perform the framehook write event here. After the frame enters the framehook list
        * there is no telling what will happen, how awesome is that!!! */
-       if (!(fr = ast_framehook_list_write_event(chan->framehooks, fr))) {
+       /* if (!(fr = ast_framehook_list_write_event(chan->framehooks, fr))) { */
+       if (!ast_framehook_list_write_event(chan->framehooks, fr)) {
               res = 0;
               goto done;
       }

Will try to understand about reason of loosing frame->src in t38_gw_framehook.

Btw, i don't understand why we have two generators in one bridge,
suggest there we can do without t38_gen but just by direct functions that
called from t38_gateway code and write data to t38 channel.
T38 generation process isn't continuous and not time depend.
Suggest this is subject for 1116 on RB.

Chain efax->t38modem->ooh323->res_fax->sip(alaw) is work ok now.

By: Alexander Anikin (may213) 2011-05-09 15:14:48

Few changed patch attached. It's do t38 signalling more correct way
from ooh323 point of view.
Changes are:

AST_T38_NEGOTIATED/TERMINATED returned from ooh323_indicated when t38 is negotiated/terminated actually.
queryoption return correct data
setup_udptl_connection return NEGOTIATED not NEGOTIATING as this called when
udptl stream is started.

Btw, suggest something is wrong in res_fax_spandsp code because t38gatewaying
doesn't work with
t38_gateway_set_transmit_on_idle(&p->t38_gw_state, FALSE);
but it must work (in previously i did t38gatewaying codes in chan_h323/ooh323
and these work without transmit_on_idle same as with).
but as in prev post it's subject for 1116 review req.

By: Gregory Hinton Nietsky (irroot) 2011-05-09 23:56:02

Thank you really appreciated ill look into it ...

i also plan to put a dialplan function into chan_ooh323

OOH323(XXXX)=YYY  / ${OOH323(XXX)}

to allow changing/reading of settings in the dialplan things like dtmf/faxdetect/t38/....

is this something you would endorse ?

By: Alexander Anikin (may213) 2011-07-09 16:05:10.325-0500

It's time to accept this in trunk due to t38gateway code accepted already

By: Alexander Anikin (may213) 2011-07-09 17:33:40.025-0500

Final patch from irroot's branch with some cleanups is attached

By: Gregory Hinton Nietsky (irroot) 2011-07-10 05:38:47.922-0500

........
 r327359 | may | 2011-07-10 03:37:58 +0200 (Sun, 10 Jul 2011) | 18 lines
 
 Full T.38 handshaking and fax detection
 
 Add full t.38 handshaking for OOH323 that are required for newest T.38
 gateway codes.
 Add fax detection (cng tone, t38) and dialplan redirection to fax ext on
 fax event detected.
 Add OOH323() function to set/get t38support and faxdetect parameters.
 
 (closes issue ASTERISK-17754)
 Reported by: irroot
 Patches:
       ooh323_faxdetect.patch uploaded by irroot (license 52)
       issue19183-final.patch uploaded by may213 (license 454)
 Tested by: may213, irroot
 
 Review: https://reviewboard.asterisk.org/r/1174/
........