SIP peer with t.38 and g.711 Pass

I want to set sip account, that has t.38 mode enabled (t.38_udptl=yes), but when this peer doesn’t sent any t.38 re-Invite I want to use Pass Through instead. Is it possible? I have one customer who wants to use both ways, so I can’t set only one mode.

If you enable T.38 passthrough it should work this way already.

It doesn’t work this way. If I set t.38 it waits for re-Invite, and if it doesn’t come, the connections is done.

I don’t understand what you mean. The option itself is just for allowing the outgoing T.38 re-invite to be sent. Can you provide console logging to show exactly what you mean by it not working?

I was wrong, it works as You wrote. But question is, if I set it like this:

[peer]
host=xx.xx.xx.xx
port=5060
nat=force_rport,comedia
canreinvite=no
dtmfmode=rfc2833
insecure=port,invite
disallow=all
allow=alaw
type=peer
context=
t38pt_udptl=yes,redundancy,maxdatagram=400
t38pt_rtp=no
t38pt_tcp=no

does it mean I will send re-Invite for t.38, or it means I will wait for re-Invite t.38 protocol?

That depends on what is on the other side… if using res_fax then a T.38 reinvite could be sent which would be rejected and if configured it would fall back to audio. In other cases Asterisk won’t initiate (unless it itself gets a reinvite) a T.38 reinvite and it won’t wait for one.