[SR-Users] Kamailio as redirect
Daniel Tryba
daniel at pocos.nl
Mon Feb 24 14:15:16 CET 2014
On Monday 24 February 2014 14:00:01 Mike Claudi Pedersen wrote:
> i want to setup a test environment to see how kamailio handles redirection.
> i want to be able to reroute calls between servers, where do i insert the
> configuration for this?
A redirect is acomplished by manipulating $ru (or its parts $rU/$rd/...) and
instead of relaying the request (t_relay()) sending a 302 Redirect
(send_reply("302", "Redirect")). This has to be handled from the
request_route.
> can i append a list of user and destination to make the configuration go
> through, to see where the call is going?
You could use the alias_db module
http://www.kamailio.org/docs/modules/4.1.x/modules/alias_db.html
request_route {
#do stuff
if(alias_db_lookup("dbaliases"))
{
send_reply("302", "Redirect");
}
else
{
send_reply("404", "Unknow destination");
}
exit;
}
--
POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/ - http://www.sipo.nl/
K.v.K. Eindhoven 17097024
More information about the sr-users
mailing list