Hi All,

I have system setup where there are few Asterisk servers behind Kamailio. Everything is working properly, the issue only is with the Incoming Subscribe's with to-tag from endpoints.

Below you can see the invite:
----------------------------------------------------------------------------------------------------------
2017/09/27 19:40:29.995598 192.168.2.33:5060 -> 10.25.23.1:5060
SUBSCRIBE sip:10000211@10.25.23.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.33:5060;branch=z9hG4bK-fc65f67d
From: "Cisco" <sip:211@10.25.23.1>;tag=258a856c69c288
To: <sip:10000211@10.25.23.1>;tag=02cca2b6-1d9b-4edc-b1de-fdd78f8f9ab0
Call-ID: 4ce04a70-6128897b@192.168.2.33
CSeq: 1003 SUBSCRIBE
Max-Forwards: 70
Route: <sip:10.25.23.1;lr;r2=on;ftag=258a856c69c288;nat=yes>, <sip:10.1.1.101;lr;r2=on;ftag=258a856c69c288;nat=yes>
Proxy-Authorization: Digest username="211",realm="10.25.23.1",nonce="Wcvq0VnL6aUbQ3c+nZa5xbh8KMVoOwAq",uri="sip:10000211@10.25.23.1",algorithm=MD5,response="155f68d66b3c6ad035f7db1ec5732020"
Contact: "Cisco" <sip:211@192.168.2.33:5060>
Accept: application/dialog-info+xml
Expires: 1800
Event: dialog
User-Agent: Cisco/SPA504G-7.6.2
Content-Length: 0
----------------------------------------------------------------------------------------------------------

Receiving such Invite Kamailio are routing to RELAY route (from WITHINDLG) and showing such error:
ERROR: rr [loose.c:107]: find_first_route(): failed to parse Route HF

It seems that Kamailio cannot find such Dialog, but why is happening? where is it destroyed?
How can i solve this?

Route (WITHINDLG) is as default, below you can see it as well. 

-----------------------------------------------------------------------------------------------------------
route[WITHINDLG] {
if (!has_totag()) return;

if (loose_route()) {

if ( is_method("ACK") ) {
route(NATMANAGE);
}

route(RELAY);
} else {
if (is_method("SUBSCRIBE") && uri == myself) {
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
t_relay();
exit;
} else {
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
-----------------------------------------------------------------------------------------------------------

Thank You.