As far i read on Kamailio reposity, WITHINDLG use loose_route() function.
But on BYE request, no Route headers (corresponding to asterisk 1) are available => BYE request can not be loose routed. Route headers has been remove by loadbalancer to avoid routing injections on my network (by an hacker for example).
Example of BYE request sent from IPBX throught Loadbalancer to Kamailio proxy:
BYE sip:
10.0.246.76:5060 SIP/2.0
Record-Route: <sip:10.0.246.189;r2=on;lr=on;ftag=as08627a3a;socket=udp:
91.129.172.36:5060>
Record-Route: <sip:91.129.172.36;r2=on;lr=on;ftag=as08627a3a;socket=udp:
91.129.172.36:5060>
Via: SIP/2.0/UDP 10.0.246.189;branch=z9hG4bK0d3d.f756947e05f126ea9f04daf00218c6fa.0
Via: SIP/2.0/UDP 91.129.172.1:3198;received=91.129.172.1;branch=z9hG4bK6896d552;rport=3198
Max-Forwards: 69
From: <
sip:0450584004@example.net>;tag=as08627a3a
To: 0482680110 <
sip:0481680110@example.net>;tag=0ee03819-900d-4d09-8188-de39ce74afcf
Call-ID: 25bf2883-640c-4139-aca6-6c3e1170ea60
CSeq: 102 BYE
User-Agent: Wazo PBX
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16