[SR-Users] Handling redirect replies and send to new host
Евгений Голей
goley_ev_sp at mail.ru
Wed Dec 27 17:24:31 CET 2017
Hi
First of all, do not onreply, for 3xx is used failure_route, which must be applied before
rewritehost("x.x.x.x");
t_relay();
Approximately like this
t_on_failure("FAIL");
rewritehost("x.x.x.x");
t_relay();
In order not to forward the response 302 to the user, use the function t_drop_replies () ;
Approximately like this
failure_route[FAIL]
{
if (t_check_status("302") )
{
t_drop_replies();
.....
}
}
How do I send ACK to (B) to finish this redirect ?
ACK kamailio should automatically send itself.
Then I want a new relay to the host. How would I do it ?
After the function t_drop_replies (); you can forward the original or changed request to where you want it to be, by analogy how the first one was processed.
>Среда, 27 декабря 2017, 18:35 +03:00 от voipspace voipspace <voipspace at yandex.com>:
>
>Hi
>
>I am aiming to do the following
>
>User calls to Kamailio Switch (A)
>Switch (A) calls to Kamailio redirect server (B)..
>(B) runs script to determine route
>(B) sends Stateless 300 redirect reply to (A).
>(A) sends ACK to (B).
>(A) send user call to another host (extracted from header variable from redirect reply)
>
>
>
>(A) call to (B)
>rewritehost("x.x.x.x");
>t_relay();
>
>
>(A) On receipt of the 300 response I do not want this redirect to go back to the user.
>
>onreply_route {
> if (t_check_status("3[0-9][0-9]")) {
>// How do I send ACK to (B) to finish this redirect ?
>// Then I want a new relay to the host. How would I do it ?
> }
>}
>
>
>
>
>_______________________________________________
>Kamailio (SER) - Users Mailing List
>sr-users at lists.kamailio.org
>https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
BR Evgeniy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20171227/25164154/attachment.html>
More information about the sr-users
mailing list