Hello,

I have trouble with REFER method that has to-tag and Route header , more than one. 

When it pass loose_route() method ,  loose_route function remove all route headar  then  sets RURI with top most Route.

Is there a function that removing own route header and sets destination uri ($du)  with top most uri.


Best Regards.

Yasin CANER

https://tools.ietf.org/html/rfc3515

2.6 Behavior of SIP Proxies

SIP proxies do not require modification to support the REFER method.
   Specifically, as required by [1], a proxy should process a REFER
   request the same way it processes an OPTIONS request.


For example,


---------->mykamailio@test2.test----------->>nextroute@test3.test------>
1
--
REFER : sip:alice@test.test ...
Route:<sip:mykamailio-local@test2.test;lr>,<sip:nextroute@test3.test;lr>,<sip:nextroute2@test4.test>
To: <>;tag=asdads
From:<>;tag=asd123


---
2 - After Kamailio Process
---
REFER : sip:alice@test.test ...
<sip:nextroute@test3.test>,<sip:nextroute2@test4.test>
To: <>;tag=asdads
From:<>;tag=asd123