Skip to content

Commit

Permalink
allow media/internal servers to set initial route
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo committed Sep 19, 2023
1 parent cdbf6a2 commit 5a683ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions kamailio/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,12 @@ route[PREPARE_INITIAL_REQUESTS]
xlog("L_INFO", "call is not from internal source, recording route\n");
record_route();
}
} else if (loose_route()) {
xlog("L_WARN", "end - loose routing of internal initial request\n");
exit();
} else if ($hdr(Route) != $null) {
if (!is_myself($route_uri)) {
xlog("L_INFO", "setting initial route to $route_uri\n");
$du = $route_uri;
}
remove_hf("Route");
}

}
Expand Down
6 changes: 5 additions & 1 deletion kamailio/registrar-role.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,11 @@ route[ROUTE_TO_EXTERNAL_AOR]

xlog("L_INFO", "using aor $hdr(X-KAZOO-AOR) with format $hdr(X-KAZOO-INVITE-FORMAT)\n");
if ($hdr(X-KAZOO-INVITE-FORMAT) == "route") {
xlog("L_INFO", "routing $hdr(X-KAZOO-AOR) to $ruri\n");
if ($du == $null) {
xlog("L_INFO", "routing $hdr(X-KAZOO-AOR) to $ruri\n");
} else {
xlog("L_INFO", "routing $hdr(X-KAZOO-AOR) to $du\n");
}
} else if ($hdr(X-KAZOO-INVITE-FORMAT) =~ "contact|username") {
if(lookup("location", "$hdr(X-KAZOO-AOR)") > 0) {
xlog("L_INFO", "end - routing to contact $ru\n");
Expand Down

0 comments on commit 5a683ea

Please sign in to comment.