[OpenSER-Users] newbie help - handeling 302s and 404s

Lazer Ramm vchouse at gmail.com
Tue Dec 18 18:21:02 CET 2007


Hi,

i need a simple config that achieves the following (w/ out a db)

if a user is not registered then all calls should go to a default gw
192.168.10.1

the default gw will only respond w/ a 302 or a 404

if a 302 is received then openser should forward the call on to the
new gw listed in the reply

if a 404 is received the call should be forwarded to a different gw 172.16.20.1

if the send gw is done then the call should die.

here is what i was thinking of but as a newbie i may be off my rocker
i seem to get an error

 ERROR: t_check_status: cannot check status for a reply which has no
T-state established

but again my whole approach may be wrong.


                if (!lookup("location")) {

rewritehostport ("192.168.10.1:5060");
if (t_check_status("(404)|(480)")) {
    log("404 or 480 negative reply\n");
rewritehostport ("172.16.20.1:5060");
}
else{
t_on_failure("1");
 t_relay();
}


                failure_route[1] {

                        get_redirects("*");
                       t_relay();
}
                }

 thanx in advance




More information about the Users mailing list