i did some more tests and got very puzzling result. this time i tested
with 488 response, but response code does not matter.
sip proxy forwards invite based on location lookup to contact of
registered local user:
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[8001]: INFO: INVITE
<sip:test@test.tutpro.com> is to local user <test(a)test.tutpro.com>
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[8001]: INFO: Routing INVITE
<sip:test@192.98.102.30:5054> to contact
in branch route these two statements are executed:
t_on_branch_failure("contact");
xlog("L_INFO", "Routing $rm <$ru> to contact\n");
uas replies with 488 which causes this branch-failure route to be
executed:
event_route [tm:branch-failure:contact] {
if (t_check_status("488")) {
xlog("L_INFO", "Got 488 response to <$ru>\n");
append_branch();
xlog("L_INFO", "Relaying to <$ru>\n");
route(RELAY_TO_CONTACTS);
exit;
};
};
and i get to syslog:
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7952]: INFO: Got 488 response to
<sip:test@test.tutpro.com>
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7952]: INFO: Relaying to
<sip:test@test.tutpro.com>
note that in above $ru is aor, not contact uri, of the callee, which is
the same problem that i described in previous message. for that reason,
route(RELAY_TO_CONTACTS) causes the request to be routed back to the
proxy itself:
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7952]: INFO: Routing INVITE to
contact <sip:test@test.tutpro.com> to proxy itself
proxy reports that it receives the request and is processes it exactly
the same way as previously, except that this time magic happens and $ru
in branch_failure route is not aor like it was before but it is the
contact uri like it should have been already during the first iteration:
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7953]: INFO: INVITE
<sip:test@test.tutpro.com> by <sip:jh@test.tutpro.com> is from Proxy Itself
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7953]: INFO: INVITE
<sip:test@test.tutpro.com> is to local user <test(a)test.tutpro.com>
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7953]: INFO: Routing INVITE
<sip:test@192.98.102.30:5054> to contact
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7951]: INFO: Got 488 response to
<sip:test@192.98.102.30:5054>
Apr 14 09:13:33 siika /usr/sbin/sip-proxy[7951]: INFO: Relaying to
<sip:test@192.98.102.30:5054>
can someone explain how/why behavior changes and why during the first
execution of branch_failure route, $ru is not what it should be?
-- juha