RTPTimeout problem with SendFAX on 11.2+ooh323+spandsp

Hello all. I’m very glad to connect to asterisk community.

Now i trying to deploy new asterisk server in our company and faced with fax-problem on chan_ooh323. This test maded in local environment with quintum tenor DX2060, but i tried with external h323 provider and got the same result.
I tried to change ooh323.conf parameters: directmedia, directrtpsetup, faststart, mediaforconnect, faxtdetect - no result. Bug is stable.

I tried this test on many Asterisk 11 branches and last SVN trunk - in all bulids it not working properly.
In Asterisk 10.9 it working the same, but udp sockets closes properly after RTP-timeout call crash.

Please help me find problem. What i forgot to check ?

When I start SendFAX I get error after ooh323-rtptimeout time if value of this time less than time of fax sending:

[ul] – Attempting call on OOH323/DX2060/115 for faxout@faxsend:1 (Retry 1)
== Using ooh323-rtp TOS bits 16
> 0x7f40d40156a0 – Probation passed - setting RTP source address to 10.50.67.148:10266
> Channel OOH323/DX2060-0 was answered
– Executing [faxout@faxsend:1] Set(“OOH323/DX2060-0”, “FAXOPT(headerinfo)=Received by bla-bla”) in new stack
– Executing [faxout@faxsend:2] Set(“OOH323/DX2060-0”, “FAXOPT(localstationid)=Name”) in new stack
– Executing [faxout@faxsend:3] Set(“OOH323/DX2060-0”, “FAXOPT(maxrate)=14400”) in new stack
– Executing [faxout@faxsend:4] Set(“OOH323/DX2060-0”, “FAXOPT(minrate)=2400”) in new stack
– Executing [faxout@faxsend:5] Set(“OOH323/DX2060-0”, “FAXOPT(gateway)=no”) in new stack
– Executing [faxout@faxsend:6] Set(“OOH323/DX2060-0”, “FAXOPT(ecm)=yes”) in new stack
[/ul]

some NoOp skipped here

[ul] – Executing [faxout@faxsend:15] SendFAX(“OOH323/DX2060-0”, “/tmp/test.tiff,dsfz”) in new stack
– Channel ‘OOH323/DX2060-0’ sending FAX:
– /tmp/test.tiff
[Jan 18 20:35:04] NOTICE[17946]: chan_ooh323.c:3868 do_monitor: Disconnecting call ‘OOH323/DX2060-0’ for lack of RTP activity in 61 seconds
== Spawn extension (faxsend, faxout, 15) exited non-zero on ‘OOH323/DX2060-0’
[Jan 18 20:35:04] ERROR[17962]: chan_ooh323.c:4805 close_udptl_connection: Channel has no owner
[Jan 18 20:35:04] NOTICE[17961]: pbx_spool.c:402 attempt_thread: Call completed to OOH323/DX2060/115[/ul]

[root@ippbx2 asterisk]# netstat -ln (before sending)
[ul]Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1720 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::53 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
udp 0 0 0.0.0.0:4520 0.0.0.0:*
udp 0 0 0.0.0.0:53 0.0.0.0:*
udp 0 0 0.0.0.0:5060 0.0.0.0:*
udp 0 0 0.0.0.0:4569 0.0.0.0:*
udp 0 0 :::53 :::*
[/ul]
after sending and call clearing
[ul]udp 0 0 0.0.0.0:15228 0.0.0.0:*
udp 784 0 0.0.0.0:15229 0.0.0.0:*
udp 0 0 0.0.0.0:4520 0.0.0.0:*
udp 0 0 0.0.0.0:53 0.0.0.0:*
udp 0 0 0.0.0.0:5060 0.0.0.0:*
udp 0 0 0.0.0.0:4569 0.0.0.0:*
udp 0 0 :::53 :::* [/ul]

And after call tcpdump shows RTCP-packets from * to remote endpoint from suspended udp-sockets.

[root@ippbx2 asterisk]# tcpdump -nN net 10.50.67.144/29 -v
[ul]tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
20:40:25.875092 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 72)
192.168.235.254.15229 > 10.50.67.148.10267: UDP, length 44
20:40:25.876192 IP (tos 0x0, ttl 63, id 5675, offset 0, flags [none], proto ICMP (1), length 56)
10.50.67.148 > 192.168.235.254: ICMP 10.50.67.148 udp port 10267 unreachable, length 36
IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto UDP (17), length 72)
192.168.235.254.15229 > 10.50.67.148.10267: UDP, length 44
20:40:30.875459 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 72)
192.168.235.254.15229 > 10.50.67.148.10267: UDP, length 44
20:40:30.876516 IP (tos 0x0, ttl 63, id 5676, offset 0, flags [none], proto ICMP (1), length 56)
10.50.67.148 > 192.168.235.254: ICMP 10.50.67.148 udp port 10267 unreachable, length 36
IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto UDP (17), length 72)
192.168.235.254.15229 > 10.50.67.148.10267: UDP, length 44
[/ul]

If I increase rtptimeout in ooh323.conf greater than time of sending (f.e. 300sec) fax sending finish successfully but udp sockets still remain opened.

[ul] – Attempting call on OOH323/DX2060/115 for faxout@faxsend:1 (Retry 1)
== Using ooh323-rtp TOS bits 16
> 0x7fce14015960 – Probation passed - setting RTP source address to 10.50.67.148:10272
> Channel OOH323/DX2060-0 was answered
– Executing [faxout@faxsend:1] Set(“OOH323/DX2060-0”, “FAXOPT(headerinfo)=Received by bla-bla”) in new stack
– Executing [faxout@faxsend:2] Set(“OOH323/DX2060-0”, “FAXOPT(localstationid)=Name”) in new stack
– Executing [faxout@faxsend:3] Set(“OOH323/DX2060-0”, “FAXOPT(maxrate)=14400”) in new stack
– Executing [faxout@faxsend:4] Set(“OOH323/DX2060-0”, “FAXOPT(minrate)=2400”) in new stack
– Executing [faxout@faxsend:5] Set(“OOH323/DX2060-0”, “FAXOPT(gateway)=no”) in new stack
– Executing [faxout@faxsend:6] Set(“OOH323/DX2060-0”, “FAXOPT(ecm)=yes”) in new stack
[/ul]
some NoOp skipped here

[ul] – Executing [faxout@faxsend:15] SendFAX(“OOH323/DX2060-0”, “/tmp/test.tiff,dsfz”) in new stack
– Channel ‘OOH323/DX2060-0’ sending FAX:
– /tmp/test.tiff
– Executing [faxout@faxsend:16] NoOp(“OOH323/DX2060-0”, “Error:”) in new stack
– Executing [faxout@faxsend:17] NoOp(“OOH323/DX2060-0”, “Filename:/tmp/test.tiff”) in new stack
– Executing [faxout@faxsend:18] NoOp(“OOH323/DX2060-0”, “Pages:1”) in new stack
– Executing [faxout@faxsend:19] NoOp(“OOH323/DX2060-0”, “Rate:14400”) in new stack
– Executing [faxout@faxsend:20] NoOp(“OOH323/DX2060-0”, “RemoteStationID:”) in new stack
– Executing [faxout@faxsend:21] NoOp(“OOH323/DX2060-0”, “Resolution:8031x7700”) in new stack
– Executing [faxout@faxsend:22] NoOp(“OOH323/DX2060-0”, “Status:SUCCESS”) in new stack
– Executing [faxout@faxsend:23] NoOp(“OOH323/DX2060-0”, “StatusString:OK”) in new stack
– Executing [faxout@faxsend:24] Hangup(“OOH323/DX2060-0”, “”) in new stack
== Spawn extension (faxsend, faxout, 24) exited non-zero on ‘OOH323/DX2060-0’
[Jan 18 21:08:46] NOTICE[18114]: pbx_spool.c:402 attempt_thread: Call completed to OOH323/DX2060/115
[/ul]

[root@ippbx2 asterisk]# netstat -ln (after call finished with high rtptimeout)
[ul]Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1720 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::53 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
udp 0 0 0.0.0.0:4520 0.0.0.0:*
udp 0 0 0.0.0.0:53 0.0.0.0:*
udp 0 0 0.0.0.0:5060 0.0.0.0:*
udp 0 0 0.0.0.0:4569 0.0.0.0:*
udp 0 0 0.0.0.0:13022 0.0.0.0:*
udp 360 0 0.0.0.0:13023 0.0.0.0:*
udp 0 0 :::53 :::*
[/ul]

My configs:
CentOS 6.5 x64
[root@ippbx2 asterisk]# uname -srvmpio
Linux 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Asterisk compiled from last sources and installed with res_fax and spandsp support.
[ul]ippbx2*CLI> core show version
Asterisk 11.2-cert3 built by root @ ippbx2.local on a x86_64 running Linux on 2014-01-18 14:48:11 UTC

ippbx2*CLI> ooh323 show config

Objective Open H.323 Channel Driver’s Config:
IP:Port: 0.0.0.0:1720
H.225 port range: 12030-12230
FastStart yes
Tunneling yes
MediaWaitForConnect yes
DirectRTP no
EarlyDirectRTP no
H.323 LogFile: /var/log/asterisk/h323_log
Context: incoming
Capability: (alaw)
DTMF Mode: rfc2833
DTMF Codec: 101
T.38 Mode: faxgw/chan_sip compatible
FAX Detect: No
RoundTrip: 3,5

ippbx2*CLI> fax show capabilities

Registered FAX Technology Modules:

Type : Spandsp
Description : Spandsp FAX Driver
Capabilities : SEND RECEIVE T.38 G.711 GATEWAY

ippbx2*CLI> fax show version
FAX For Asterisk Components:
Applications: 11.2-cert3
Spandsp FAX Driver: 20110122 075024

ippbx2*CLI> ooh323 show peer DX2060
Name: DX2060
FastStart/H.245 Tunneling:yes,yes
DirectRTP no
EarlyDirectRTP no
Format Prefs: (alaw:20)
DTMF Mode: rfc2833
DTMF Codec: 101
T.38 Mode: faxgw/chan_sip compatible
FAX Detect: No
AccountCode: ast_h323
AMA flags: Unknown
IP:Port: 10.50.67.148:1720
OutgoingLimit: 0
rtptimeout: 60
nat: no
[/ul]
Thanks in advance.