Browse Source

move internal redirect to default (#143)

* redirect to other media server does not need extra setup

* move dispatcher ecallmgr/fs redirect to default
4.1
lazedo 9 years ago
committed by GitHub
parent
commit
24c1ea0f1b
2 changed files with 21 additions and 17 deletions
  1. +21
    -1
      kamailio/default.cfg
  2. +0
    -16
      kamailio/dispatcher-role.cfg

+ 21
- 1
kamailio/default.cfg View File

@ -748,7 +748,7 @@ failure_route[INTERNAL_FAULT]
$sht(redirects=>$var(redirect)) = $T_rpl($hdr(X-Redirect-Server));
xlog("L_INFO", "$ci|log|stored redirect mapping $var(redirect) to $T_rpl($hdr(X-Redirect-Server))\n");
}
route(DISPATCHER_REDIRECT);
route(INTERNAL_REDIRECT);
} else if (!t_check_status("407") &&
$avp(AVP_REDIRECT_KEY) != $null &&
$sht(redirects=>$avp(AVP_REDIRECT_KEY)) != $null
@ -790,6 +790,26 @@ failure_route[INTERNAL_FAULT]
xlog("L_INFO", "$ci|pass|$si:$sp\n");
}
route[INTERNAL_REDIRECT]
{
$var(ds_group) = 1;
$var(contact_uri) = $(ct{tobody.user}) + "@" + $(ct{tobody.host});
$var(redirect) = @from.uri.user + "@" + @from.uri.host + "->"
+ @ruri.user + "@" + @ruri.host;
if ($sht(redirects=>$var(redirect)) != $null) {
$var(prefered_route) = $sht(redirects=>$var(redirect));
xlog("L_INFO", "$ci|log|found redirect for $var(redirect) : $var(prefered_route)\n");
$du = $var(prefered_route);
$avp(AVP_REDIRECT_KEY) = $var(redirect);
t_on_reply("INTERNAL_REPLY");
t_on_failure("INTERNAL_FAULT");
t_set_fr(0, 1000);
t_relay();
exit();
}
}
onsend_route {
if (isflagset(FLAG_ASSOCIATE_USER)) {
$var(contact_uri) = $(ct{tobody.user}) + "@" + $(ct{tobody.host});


+ 0
- 16
kamailio/dispatcher-role.cfg View File

@ -112,22 +112,6 @@ route[DISPATCHER_FIND_ROUTES]
}
}
route[DISPATCHER_REDIRECT]
{
$var(ds_group) = 1;
$var(contact_uri) = $(ct{tobody.user}) + "@" + $(ct{tobody.host});
$var(redirect) = @from.uri.user + "@" + @from.uri.host + "->"
+ @ruri.user + "@" + @ruri.host;
if ($sht(redirects=>$var(redirect)) != $null) {
$var(prefered_route) = $sht(redirects=>$var(redirect));
xlog("L_INFO", "$ci|log|found redirect for $var(redirect) : $var(prefered_route)\n");
$du = $var(prefered_route);
$avp(AVP_REDIRECT_KEY) = $var(redirect);
route(EXTERNAL_TO_INTERNAL_RELAY);
exit();
}
}
route[DISPATCHER_REORDER_ROUTES]
{
$var(i) = 0;


Loading…
Cancel
Save