[OpenSIPS-Users] About L4 Swtich + 2 * opensips
    Nick Chang 
    nick.chang at kland.com.tw
       
    Thu Jul 12 10:43:01 CEST 2012
    
    
  
Hello Ali
 
 
I try save location after register.
Please saw this config. 
 
But, It still failed.
Can you give me a suggest??
 
Thanks for your help.
Nick
 
        if (is_method("REGISTER")) {
                if (!www_authorize("", "subscriber")) {
                        www_challenge("", "0");
save(“location”);
                        exit;
                }
                if (!db_check_to()) {
                        send_reply("403","Forbidden auth ID");
                        exit;
                }
                if (isflagset(5)) {
                        setbflag(6);
                        setbflag(7);
                };
                if (!save("location"))
                        sl_reply_error();
                exit;
        }
        if ($rU==NULL) {
                send_reply("484","Address Incomplete");
                exit;
        }
        alias_db_lookup("dbaliases");
        if(!dp_translate("0","$ruri.user/$ruri.user")){
                send_reply("420", "Invalid Destination");
                exit;
        }
        xlog("$avp(dest)");
        $avp(callee) = $ru;
        if ($avp(dest)=="usrloc") {
                #Route to usrloc
                route(user_location);
        }
        send_reply("420", "Invalid Extension");
        exit;
}
route[generic_relay] {
        if (subst_uri('/((sip:.*)||(sip:.*:.*));nat=yes/\1/')){
                setbflag(6);
        };
        if (isflagset(5)||isbflagset(6)) {
                route(nat_fixups);
        };
        if (!t_relay()) {
                sl_reply_error();
        };
        exit;
}
route[user_location]{
        if (!lookup("location", "m")) {
                switch ($retcode) {
                        case -1:
                        case -3:
                                t_newtran();
                                send_reply("404", "Not Found");
                                exit;
                        case -2:
                                send_reply("405", "Method Not Allowed");
                                exit;
                }
        }
        setflag(2); 
        t_on_failure("user_failure");
        route(generic_relay);
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120712/07e130c4/attachment.htm>
    
    
More information about the Users
mailing list