I made the following changes:unsigned long ExtModConsumer::Consume(const DataBlock& data, unsigned long timestamp, unsigned long flags)
{
if ((m_str) && !data.null()) {
Debug(DebugTest,"ExtModConsumer::Consume ENTER");
m_str->writeData(data);
m_total += data.length();
Debug(DebugTest,"ExtModConsumer::Consume EXIT");
return invalidStamp();
}
return 0;
}
The log is:2017-05-03_15:31:13.431325 <TEST> ExtModConsumer::Consume ENTER
2017-05-03_15:31:13.431346 <TEST> ExtModConsumer::Consume EXIT
2017-05-03_15:31:13.466999 <TEST> ExtModConsumer::Consume ENTER
2017-05-03_15:31:13.467037 <TEST> ExtModConsumer::Consume EXIT
2017-05-03_15:31:13.467045 <TEST> ExtModConsumer::Consume ENTER
2017-05-03_15:31:16.057263 <sip:INFO> 'udp:0.0.0.0:5060' received 1351 bytes SIP message from 85.142.148.80:5060 [0x9b2dd0]
------
INVITE sip:200@37.140.188.160:5060 SIP/2.0
Via: SIP/2.0/UDP 85.142.148.80:5060;rport;branch=z9hG4bKPjb7b30d52-e99d-4776-9c6b-9c29aadb0b35
...
...
2017-05-03_15:31:16.063444 <INFO> Could not route call to '200' in context 'default', wasted 169 usec
!!! call_route: {'sip_user-agent': 'ruVoIP.net PBX', 'ip_host': '85.142.148.80', 'billid': '1493825410-3', 'ip_port': '5060', 'transport': 'RTP/AVP', 'antiloop': '19', 'media_video': 'yes', 'sip_content-type': 'application/sdp', 'sip_x-cid': 'KcffpUKcxxDt37oI2L77-hrHzsb7Moa-', 'sdp_maxptime': '20', 'sip_callid': '42c9652c-980e-4a17-bb77-8dbb8f5dcb5f', 'sip_from': 'sip:laptop@talk37.ru', 'callername': 'laptop', 'sip_allow': 'OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER', 'rtp_addr': '85.142.148.80', 'sdp_sendrecv': '', 'rtp_port_video': '25680', 'direction': 'incoming', 'transport_video': 'RTP/AVP', 'module': 'sip', 'handlers': 'regexroute:100,sip:100,regexroute:100', 'answered': 'false', 'device': 'ruVoIP.net PBX', 'sip_min-se': '90', 'sip_session-expires': '1800', 'formats_video': '', 'sip_contact': '<sip:asterisk@85.142.148.80:5060>', 'sip_supported': '100rel, timer, replaces, norefersub', 'rtp_forward': 'possible', 'formats': 'alaw', 'ip_transport': 'UDP', 'id': 'sip/4', 'rtp_rfc2833': '101', 'caller': 'laptop', 'address': '85.142.148.80:5060', 'media': 'yes', 'sip_uri': 'sip:200@37.140.188.160:5060', 'called': '200', 'sip_to': '<sip:200@37.140.188.160>', 'callid': 'sip/42c9652c-980e-4a17-bb77-8dbb8f5dcb5f/cd69bf93-880a-4da6-9a74-754ae71f7408/', 'status': 'incoming', 'rtp_port': '25486', 'sdp_video_sendrecv': ''} | {('200', 'laptop'): 'sip/2'} | {'sip/2': ('200', 'laptop')}
2017-05-03_15:31:16.067878 <INFO> Choosing offered 'audio' format 'alaw' [0x7fc588012b10]
2017-05-03_15:31:16.067888 <sip/4:NOTE> Formats for 'audio' changed to 'alaw' [0x7fc588012090]
2017-05-03_15:31:16.067924 >>> DataTranslator::detachChain(0x7fc584006e00,0x7fc59400fae0)
2017-05-03_15:31:19.000091 <engine:MILD> Creating new message dispatching thread (1 running)
2017-05-03_15:31:21.000020 <engine:MILD> Creating new message dispatching thread (2 running)
2017-05-03_15:31:23.000059 <engine:MILD> Creating new message dispatching thread (3 running)
2017-05-03_15:31:25.000087 <engine:WARN> Creating new message dispatching thread (4 running)
2017-05-03_15:31:27.000143 <engine:WARN> Creating new message dispatching thread (5 running)
2017-05-03_15:31:29.000109 <engine:WARN> Creating new message dispatching thread (6 running)
Supervisor: killing unresponsive child 12900
Yate (12935) is starting Wed May 3 15:31:30 2017
As you can see no EXIT before Yate hangs up. And if the problem is not happened the log is:2017-05-03_15:31:04.590200 <TEST> ExtModConsumer::Consume ENTER
2017-05-03_15:31:04.590227 <TEST> ExtModConsumer::Consume EXIT
2017-05-03_15:31:04.590236 <TEST> ExtModConsumer::Consume ENTER
2017-05-03_15:31:04.590245 <TEST> ExtModConsumer::Consume EXIT
2017-05-03_15:31:04.601540 <sip:INFO> 'udp:0.0.0.0:5060' received 1349 bytes SIP message from 85.142.148.80:5060 [0x9b2dd0]
------
INVITE sip:200@37.140.188.160:5060 SIP/2.0
Via: SIP/2.0/UDP 85.142.148.80:5060;rport;branch=z9hG4bKPjab09198c-6c90-4b01-821d-5dfd05972ad3
I.e. EXIT is appeared. Sure, I really don't know why it wasn't EXITed for 2.6 seconds when Yate hangs up...