daniel,
is_first_hop() readme has this on replies:
For incoming SIP replies, it means that top Record-Route URI is 'myself' and source address is not matching it (to avoid detecting in case of local loops). Note that it does not detect spirals, which can have the condition for replies true also in the case of additional SIP reply receival.
in contact alias tutorial
https://sip-router.org/wiki/tutorials/alias-example?&#in-dialog_requests
i have implemented "is first hop" check by checking that reply does not have any other r-r headers except the ones added by the proxy itself when it relayed the request:
in request route i set
$avp("rr_count") = $rr_count;
and in reply route, i test
if ($rr_count == $avp(rr_count) + $rr_top_count) ...
i think that this method also works in case of spirals if i understand correctly what spirals are.
do you have any comment about possible equivalence or non-equivalence of the two methods? could i safely use is_first_hop test also for replies in contact alias tutorial?
-- juha