Hi all!

got a Kamailio doing load balancing to multiple Asterisk boxes. Kamailio is connected to a carrier's SIP trunk, and distributes calls to Asterisk.

Receiving calls from carrier's SIP trunk works perfectly: kamailio will use dispatcher module to distribute calls between Asterisk boxes. No problems!

Kamailio is also connected to the WWW, receiving calls from any authorized IP (whitelisted in Firewall).
The problem is that if I get a call from the WWW and a from whitelisted IP, kamailio does not detect any INVITE (note that the IP address is not registered).

here is the SIP Request (IPs are obfuscated)

INVITE sip:+351234567890@10.19.139.66 SIP/2.0
Record-Route: <sip:11.22.33.44:5060;r2=on;transport=udp;ftag=11592086_6772d868_135fa74b-2c83-4d5f-9882-4125b131c703;l

Record-Route: <sip:222.33.44.55:5060;r2=on;transport=udp;ftag=11592086_6772d868_135fa74b-2c83-4d5f-9882-4125b131c703r>
CSeq: 1 INVITE
From: <sip:+351999999999@somewhere.com>;tag=11592086_6772d868_135fa74b-2c83-4d5f-9882-4125b131c703
To: <sip:+351234567890@10.19.139.66>
Max-Forwards: 65
P-Asserted-Identity: "+351999999999" <sip:+351999999999@sip.somewhere.com>
Date: Tue, 05 Mar 2019 15:55:24 GMT
Min-SE: 120
Call-ID: 799ee9a8cd02e066e2811d8052759715@0.0.0.0
Via: SIP/2.0/UDP 11.22.33.44:5060;branch=z9hG4bK6b36.f67ca7e4.0
Via: SIP/2.0/UDP 222.33.44.55:5060;branch=z9hG4bK135fa74b-2c83-4d5f-9882-4125b131c703_6772d868_106-113479085018764135
Contact: "+351999999999" <sip:+351999999999@222.33.44.55:5060;transport=udp>
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE
User-Agent: SomeSIPGateway
Content-Type: application/sdp
X-SIPGW-CallSid: CA6a5691a75bb7b915c09c7931e253f542
Content-Length: 262

v=0
o=root 1219665045 1219665045 IN IP4 55.66.77.88
s=SomeSIPGateway
c=IN IP4 55.66.77.88
t=0 0
m=audio 14326 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


SIP Messages using SNGrep:

           11.22.33.44:5060             10.19.139.66:5060 
         ----------+---------          ----------+---------
 15:55:25.980727   |        INVITE (SDP)         |         
       +0.596007       | --------------------------> |         
 15:55:26.576734   |        INVITE (SDP)         |         
       +1.003393       | ------------------------>>> |         
 15:55:27.580127   |        INVITE (SDP)         |         
       +1.978513       | ------------------------>>> |         
 15:55:29.558640   |        INVITE (SDP)         |         
                               | ------------------------>>> |         


I've checked that Kamailio is listennig to all interfaces (OK) and to port 5060 (OK). 
As we can see above, SNGrep shows the incoming message to Kamailio (10.19.139.66) but it gets stuck there as there are no other messages. 
Kamailio.log doesn't show anything too, just like if the request (INVITE) is not recognizes a a SIP message.

all other use cases work fine :
- from SIP Carrier's trunk OK
- from registered SIP user OK
- from registered SIP Trunk ok

only from a not registered SIP trunk I get this behaviour.... 


Any clue?



Thanks in advance,

Sérgio